C# Class SensorbergSDK.Background.BackgroundEngine

BackgroundEngine resolves actions from BluetoothLEAdvertisementWatcherTriggerDetails object and resolves delayed actions. This is not part of the public API. Making modifications into background tasks is not required in order to use the SDK.
Inheritance: IDisposable
Exibir arquivo Open project: sensorberg-dev/windows10-sdk Class Usage Examples

Private Properties

Property Type Description
AddBeaconArgs void
AddBeaconsToBeaconArgsAsync System.Threading.Tasks.Task
IsOutOfRange bool
IsValidEnterEvent bool
OnBeaconActionResolvedAsync void

Public Methods

Method Description
BackgroundEngine ( ) : System
Dispose ( ) : void

Finishes background processing and releases all resources.

InitializeAsync ( ) : System.Threading.Tasks.Task

Initializes BackgroundEngine.

ProcessDelayedActionsAsync ( bool flushHistory = true ) : System.Threading.Tasks.Task

Processes the delayed actions, executes them as necessary and sends history statistics.

ResolveBeaconActionsAsync ( List beacons, int outOfRangeDb ) : System.Threading.Tasks.Task

Resolves beacons, which triggered the background task.

Private Methods

Method Description
AddBeaconArgs ( Beacon beacon, BeaconEventType eventType ) : void
AddBeaconsToBeaconArgsAsync ( int outOfRangeDb ) : System.Threading.Tasks.Task

Generates BeaconArgs from beacon events. For instance if a beacon is seen for the first time, BeaconArgs with enter type is generated.

IsOutOfRange ( int outOfRangeDb, Beacon beacon ) : bool
IsValidEnterEvent ( BackgroundEvent history, Beacon beacon, int outOfRangeDb ) : bool
OnBeaconActionResolvedAsync ( object sender, BeaconAction beaconAction ) : void

Handles BeaconActions that are resolved in the SDKEngine. All resolved actions are stored into local database. And the UI app will show actions to the user. When the UI app is not running, toast notification is shown for the user.

Method Details

BackgroundEngine() public method

public BackgroundEngine ( ) : System
return System

Dispose() public method

Finishes background processing and releases all resources.
public Dispose ( ) : void
return void

InitializeAsync() public method

Initializes BackgroundEngine.
public InitializeAsync ( ) : System.Threading.Tasks.Task
return System.Threading.Tasks.Task

ProcessDelayedActionsAsync() public method

Processes the delayed actions, executes them as necessary and sends history statistics.
public ProcessDelayedActionsAsync ( bool flushHistory = true ) : System.Threading.Tasks.Task
flushHistory bool
return System.Threading.Tasks.Task

ResolveBeaconActionsAsync() public method

Resolves beacons, which triggered the background task.
public ResolveBeaconActionsAsync ( List beacons, int outOfRangeDb ) : System.Threading.Tasks.Task
beacons List
outOfRangeDb int
return System.Threading.Tasks.Task