C# Class SensorbergSDK.Internal.Scanner

Bluetooth LE advertisement scanner helper class with beacon list management.
Inheritance: IBeaconScanner, IDisposable
Show file Open project: sensorberg-dev/windows10-sdk

Public Methods

Method Description
Dispose ( ) : void
FilterBeaconByUuid ( Beacon beacon ) : bool
NotifyBeaconEvent ( Beacon beacon ) : void

Notifies any listeners about the beacon event.

Scanner ( ) : System

Create new Scanner Object.

StartWatcher ( ushort manufacturerId, ushort beaconCode, ulong beaconExitTimeoutInMiliseconds, short rssiEnterThreshold = null, ulong enterDistanceThreshold = null ) : void

Starts the watcher and hooks its events to callbacks.

StopWatcher ( ) : void

Stops the watcher. The events are unhooked in the callback (OnWatcherStopped).

Private Methods

Method Description
OnAdvertisementReceived ( BluetoothLEAdvertisementWatcher sender, BluetoothLEAdvertisementReceivedEventArgs args ) : void

Triggered when the watcher receives an advertisement. If the advertisement came from a beacon, a Beacon instance is created based on the received data. A new beacon is added to the list and an existing one is only updated.

OnNotifyStartedDelayTimeout ( object state ) : void

Sends a delayed notifications about watcher started event.

OnWatcherStopped ( BluetoothLEAdvertisementWatcher sender, BluetoothLEAdvertisementWatcherStoppedEventArgs args ) : void

Method Details

Dispose() public method

public Dispose ( ) : void
return void

FilterBeaconByUuid() public method

public FilterBeaconByUuid ( Beacon beacon ) : bool
beacon Beacon
return bool

NotifyBeaconEvent() public method

Notifies any listeners about the beacon event.
public NotifyBeaconEvent ( Beacon beacon ) : void
beacon Beacon
return void

Scanner() public method

Create new Scanner Object.
public Scanner ( ) : System
return System

StartWatcher() public method

Starts the watcher and hooks its events to callbacks.
public StartWatcher ( ushort manufacturerId, ushort beaconCode, ulong beaconExitTimeoutInMiliseconds, short rssiEnterThreshold = null, ulong enterDistanceThreshold = null ) : void
manufacturerId ushort The manufacturer ID.
beaconCode ushort The beacon code.
beaconExitTimeoutInMiliseconds ulong Time in miliseconds after beacon will be trated as lost.
rssiEnterThreshold short Optional rssi threshold which will trigger beacon discover event. Value must be between -128 and 127.
enterDistanceThreshold ulong Optional minimal distance in meters that will trigger beacon discover event.
return void

StopWatcher() public method

Stops the watcher. The events are unhooked in the callback (OnWatcherStopped).
public StopWatcher ( ) : void
return void