Arendi.BleLibrary
4.5.1.999
Core-Library (PCL)
|
Interface of the EnhancedPeripheral class. More...
Public Member Functions | |
void | Establish () |
Initiate the establishment of a connection. This is not allowed if peripheral mode is set to PeripheralMode.Inactive. More... | |
Task | EstablishAsync (int timeout=Constants.EnhancedPeripheralEstablishTimeout) |
Execute the establishment of a connection. This is not allowed if peripheral mode is set to PeripheralMode.Inactive. More... | |
void | Teardown () |
Initiate the teardown of a connection. This is not allowed if peripheral mode is set to PeripheralMode.Inactive. More... | |
Task | TeardownAsync (int timeout=Constants.EnhancedPeripheralTeardownTimeout) |
Execute the teardown of a connection. This is not allowed if peripheral mode is set to PeripheralMode.Inactive. More... | |
void | Update (UpdateSetup updateSetup) |
Start an update process When the enhanced peripheral is in a stable state as PeripheralState.Idle or PeripheralState.Ready the update will be initiated immediately. In transition states the update will be initiated after completion of the state. More... | |
Task | UpdateAsync (UpdateSetup updateSetup, int timeout=Constants.EnhancedPeripheralUpdateTimeout) |
Execute an update process asynchronously. When the enhanced peripheral is in a stable state as PeripheralState.Idle or PeripheralState.Ready the update will be initiated immediately. In transition states the update will be initiated after completion of the state. More... | |
Properties | |
int | ReconnectAfterFailedConnectTimeoutDefault [get] |
Default timeout after a failed connect [ms]. More... | |
int | ReconnectAfterDisconnectTimeoutDefault [get] |
Default timeout after a disconnect [ms]. More... | |
int | RssiIntervalDefault [get] |
Get the default interval for RSSI measurements [ms]. More... | |
PeripheralState | State [get] |
Get the state of the peripheral. More... | |
PeripheralMode | Mode [get, set] |
Get/Set the mode the peripheral is used. More... | |
int | ConnectTimeout [get, set] |
Get/Set the connect timeout [ms]. By default the value is set to Constants.ConnectTimeout. It is allowed to set this value to Timeout.Infinite to keep trying to connect to a device. More... | |
int | DiscoverServicesTimeout [get, set] |
Get/Set the discover services timeout [ms]. By default the value is set to Constants.DiscoverServicesTimeout. More... | |
int | DisconnectTimeout [get, set] |
Get/Set the disconnect timeout [ms]. By default the value is set to Constants.DisconnectTimeout. More... | |
int | ReconnectAfterDisconnectTimeout [get, set] |
Get/Set the reconnect timeout [ms] after a disconnect. This timeout is used after a peripheral has been disconnected. This value may be set to 0 to immediately retry to establish a connection. By default the value is set to ReconnectAfterDisconnectTimeoutDefault. More... | |
int | ReconnectAfterFailedConnectTimeout [get, set] |
Get/Set the reconnect timeout [ms] after a failed connect. This timeout is used after a peripheral couldn't be connected to try next time. It is not recommended, to set this duration to a value of 0. By default the value is set to ReconnectAfterFailedConnectTimeoutDefault. More... | |
int | RssiInterval [get, set] |
Get/Set the interval the RSSI is measured when the peripheral is connected [ms]. A value of 0 means, that no RSSI is measured. By default the value is set to RssiIntervalDefault. More... | |
Properties inherited from Arendi.BleLibrary.Extention.IManagedPeripheral | |
IPeripheral | Peripheral [get, set] |
Get/Set the used standard peripheral object. More... | |
Uuid | Uuid [get] |
Get the UUID uniquely identifying an peripheral. More... | |
string | Name [get, set] |
Get the name of the enhanced peripheral. More... | |
int | Rssi [get, set] |
Get the last set RSSI value. The returned value was update when the peripheral was last seen (see Rssi). More... | |
bool | IsConnectable [get, set] |
Is the device is connectable or not. More... | |
DateTime | LastSeen [get, set] |
Time the peripheral was last seen. More... | |
bool | IsDisposed [get] |
Check if the peripheral object is already disposed. More... | |
Events | |
EventHandler< PeripheralStateChangedEventArgs > | StateChanged |
State of the peripheral changed. More... | |
EventHandler | PeripheralUpdated |
Standard peripheral object of the peripheral has been set. More... | |
EventHandler< NameUpdatedEventArgs > | NameUpdated |
Name of the peripheral has changed. More... | |
EventHandler< RssiUpdatedEventArgs > | RssiUpdated |
RSSI level of the peripheral has changed. More... | |
EventHandler< IsConnectableUpdatedEventArgs > | IsConnectableUpdated |
Property if the peripheral may be connected has been updated. More... | |
EventHandler< EstablishStartedEventArgs > | EstablishStarted |
An establish operation has been started. The establish operation may be initiated by enhanced peripheral mode PeripheralMode.Active or by the methods Establish and EstablishAsync. More... | |
EventHandler< EstablishSucceededEventArgs > | EstablishSucceeded |
An establish operation has succeeded. The establish operation may be initiated by enhanced peripheral mode PeripheralMode.Active or by the methods Establish and EstablishAsync. More... | |
EventHandler< EstablishFailedEventArgs > | EstablishFailed |
An establish operation has failed. The establish operation may be initiated by enhanced peripheral mode PeripheralMode.Active or by the methods Establish and EstablishAsync. More... | |
EventHandler< TeardownStartedEventArgs > | TeardownStarted |
A teardown operation has been started. The teardown operation may have been initiated by enhanced peripheral mode PeripheralMode.Active or by the methods Teardown and TeardownAsync. More... | |
EventHandler< TeardownSucceededEventArgs > | TeardownSucceeded |
A teardown operation has succeeded. The teardown operation may be initiated by enhanced peripheral mode PeripheralMode.Active or by the methods Teardown and TeardownAsync. More... | |
EventHandler< TeardownFailedEventArgs > | TeardownFailed |
A teardown operation has failed. The tear down operation may be initiated by enhanced peripheral mode PeripheralMode.Active or by the methods Teardown and TeardownAsync. More... | |
EventHandler< UpdateStartedEventArgs > | UpdateStarted |
An update operation has been started. The update operation may be initiated by the methods Update and UpdateAsync. Additionally the establish operation may include an update operation. More... | |
EventHandler< UpdateSucceededEventArgs > | UpdateSucceeded |
An update operation has succeeded. The update operation may be initiated by the methods Update and UpdateAsync. More... | |
EventHandler< UpdateFailedEventArgs > | UpdateFailed |
An update operation has succeeded. The update operation may be initiated by the methods Update and UpdateAsync. More... | |
Interface of the EnhancedPeripheral class.
void Arendi.BleLibrary.Extention.IEnhancedPeripheral.Establish | ( | ) |
Initiate the establishment of a connection.
This is not allowed if peripheral mode is set to PeripheralMode.Inactive.
Implemented in Arendi.BleLibrary.Extention.EnhancedPeripheral.
Task Arendi.BleLibrary.Extention.IEnhancedPeripheral.EstablishAsync | ( | int | timeout = Constants.EnhancedPeripheralEstablishTimeout | ) |
Execute the establishment of a connection.
This is not allowed if peripheral mode is set to PeripheralMode.Inactive.
timeout | Optional timeout [ms] (Default: Constants.EnhancedPeripheralEstablishTimeout). If no timeout should be set Timeout.Infinite can be used. |
Implemented in Arendi.BleLibrary.Extention.EnhancedPeripheral.
void Arendi.BleLibrary.Extention.IEnhancedPeripheral.Teardown | ( | ) |
Initiate the teardown of a connection.
This is not allowed if peripheral mode is set to PeripheralMode.Inactive.
Implemented in Arendi.BleLibrary.Extention.EnhancedPeripheral.
Task Arendi.BleLibrary.Extention.IEnhancedPeripheral.TeardownAsync | ( | int | timeout = Constants.EnhancedPeripheralTeardownTimeout | ) |
Execute the teardown of a connection.
This is not allowed if peripheral mode is set to PeripheralMode.Inactive.
timeout | Optional timeout [ms] (Default: Constants.EnhancedPeripheralTeardownTimeout). If no timeout should be set Timeout.Infinite can be used. |
Implemented in Arendi.BleLibrary.Extention.EnhancedPeripheral.
void Arendi.BleLibrary.Extention.IEnhancedPeripheral.Update | ( | UpdateSetup | updateSetup | ) |
Start an update process
When the enhanced peripheral is in a stable state as PeripheralState.Idle or PeripheralState.Ready the update will be initiated immediately. In transition states the update will be initiated after completion of the state.
updateSetup | Update setup to be used for the update. |
Implemented in Arendi.BleLibrary.Extention.EnhancedPeripheral.
Task Arendi.BleLibrary.Extention.IEnhancedPeripheral.UpdateAsync | ( | UpdateSetup | updateSetup, |
int | timeout = Constants.EnhancedPeripheralUpdateTimeout |
||
) |
Execute an update process asynchronously.
When the enhanced peripheral is in a stable state as PeripheralState.Idle or PeripheralState.Ready the update will be initiated immediately. In transition states the update will be initiated after completion of the state.
It is not allowed to await this task from the EnhancedPeripheral.InitializeAsync method. The update won't start until the establish is done. So the update will always end with a timeout.
updateSetup | Update setup to be used for the update. |
timeout | Optional timeout [ms] (Default: Constants.EnhancedPeripheralUpdateTimeout). If no timeout should be set Timeout.Infinite can be used. |
Implemented in Arendi.BleLibrary.Extention.EnhancedPeripheral.
|
getset |
Get/Set the connect timeout [ms]. By default the value is set to Constants.ConnectTimeout. It is allowed to set this value to Timeout.Infinite to keep trying to connect to a device.
|
getset |
Get/Set the disconnect timeout [ms]. By default the value is set to Constants.DisconnectTimeout.
|
getset |
Get/Set the discover services timeout [ms]. By default the value is set to Constants.DiscoverServicesTimeout.
|
getset |
Get/Set the mode the peripheral is used.
|
getset |
Get/Set the reconnect timeout [ms] after a disconnect. This timeout is used after a peripheral has been disconnected. This value may be set to 0 to immediately retry to establish a connection. By default the value is set to ReconnectAfterDisconnectTimeoutDefault.
|
get |
Default timeout after a disconnect [ms].
|
getset |
Get/Set the reconnect timeout [ms] after a failed connect. This timeout is used after a peripheral couldn't be connected to try next time. It is not recommended, to set this duration to a value of 0. By default the value is set to ReconnectAfterFailedConnectTimeoutDefault.
|
get |
Default timeout after a failed connect [ms].
|
getset |
Get/Set the interval the RSSI is measured when the peripheral is connected [ms]. A value of 0 means, that no RSSI is measured. By default the value is set to RssiIntervalDefault.
|
get |
Get the default interval for RSSI measurements [ms].
|
get |
Get the state of the peripheral.
EventHandler<EstablishFailedEventArgs> Arendi.BleLibrary.Extention.IEnhancedPeripheral.EstablishFailed |
An establish operation has failed.
The establish operation may be initiated by enhanced peripheral mode PeripheralMode.Active or by the methods Establish and EstablishAsync.
EventHandler<EstablishStartedEventArgs> Arendi.BleLibrary.Extention.IEnhancedPeripheral.EstablishStarted |
An establish operation has been started.
The establish operation may be initiated by enhanced peripheral mode PeripheralMode.Active or by the methods Establish and EstablishAsync.
EventHandler<EstablishSucceededEventArgs> Arendi.BleLibrary.Extention.IEnhancedPeripheral.EstablishSucceeded |
An establish operation has succeeded.
The establish operation may be initiated by enhanced peripheral mode PeripheralMode.Active or by the methods Establish and EstablishAsync.
EventHandler<IsConnectableUpdatedEventArgs> Arendi.BleLibrary.Extention.IEnhancedPeripheral.IsConnectableUpdated |
Property if the peripheral may be connected has been updated.
EventHandler<NameUpdatedEventArgs> Arendi.BleLibrary.Extention.IEnhancedPeripheral.NameUpdated |
Name of the peripheral has changed.
EventHandler Arendi.BleLibrary.Extention.IEnhancedPeripheral.PeripheralUpdated |
Standard peripheral object of the peripheral has been set.
This may only occur if the peripheral was created as virtual peripheral. This event is triggered, when the peripheral is set later and the peripheral becomes a real peripheral behind.
EventHandler<RssiUpdatedEventArgs> Arendi.BleLibrary.Extention.IEnhancedPeripheral.RssiUpdated |
RSSI level of the peripheral has changed.
EventHandler<PeripheralStateChangedEventArgs> Arendi.BleLibrary.Extention.IEnhancedPeripheral.StateChanged |
State of the peripheral changed.
EventHandler<TeardownFailedEventArgs> Arendi.BleLibrary.Extention.IEnhancedPeripheral.TeardownFailed |
A teardown operation has failed.
The tear down operation may be initiated by enhanced peripheral mode PeripheralMode.Active or by the methods Teardown and TeardownAsync.
EventHandler<TeardownStartedEventArgs> Arendi.BleLibrary.Extention.IEnhancedPeripheral.TeardownStarted |
A teardown operation has been started.
The teardown operation may have been initiated by enhanced peripheral mode PeripheralMode.Active or by the methods Teardown and TeardownAsync.
EventHandler<TeardownSucceededEventArgs> Arendi.BleLibrary.Extention.IEnhancedPeripheral.TeardownSucceeded |
A teardown operation has succeeded.
The teardown operation may be initiated by enhanced peripheral mode PeripheralMode.Active or by the methods Teardown and TeardownAsync.
EventHandler<UpdateFailedEventArgs> Arendi.BleLibrary.Extention.IEnhancedPeripheral.UpdateFailed |
An update operation has succeeded.
The update operation may be initiated by the methods Update and UpdateAsync.
EventHandler<UpdateStartedEventArgs> Arendi.BleLibrary.Extention.IEnhancedPeripheral.UpdateStarted |
An update operation has been started.
The update operation may be initiated by the methods Update and UpdateAsync. Additionally the establish operation may include an update operation.
EventHandler<UpdateSucceededEventArgs> Arendi.BleLibrary.Extention.IEnhancedPeripheral.UpdateSucceeded |
An update operation has succeeded.
The update operation may be initiated by the methods Update and UpdateAsync.