Arendi.BleLibrary  4.5.1.999
Core-Library (PCL)
Arendi.BleLibrary.Extention.IEnhancedPeripheral Interface Reference

Interface of the EnhancedPeripheral class. More...

Inheritance diagram for Arendi.BleLibrary.Extention.IEnhancedPeripheral:
Arendi.BleLibrary.Extention.IManagedPeripheral Arendi.BleLibrary.Extention.EnhancedPeripheral

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< PeripheralStateChangedEventArgsStateChanged
 State of the peripheral changed. More...
 
EventHandler PeripheralUpdated
 Standard peripheral object of the peripheral has been set. More...
 
EventHandler< NameUpdatedEventArgsNameUpdated
 Name of the peripheral has changed. More...
 
EventHandler< RssiUpdatedEventArgsRssiUpdated
 RSSI level of the peripheral has changed. More...
 
EventHandler< IsConnectableUpdatedEventArgsIsConnectableUpdated
 Property if the peripheral may be connected has been updated. More...
 
EventHandler< EstablishStartedEventArgsEstablishStarted
 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< EstablishSucceededEventArgsEstablishSucceeded
 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< EstablishFailedEventArgsEstablishFailed
 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< TeardownStartedEventArgsTeardownStarted
 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< TeardownSucceededEventArgsTeardownSucceeded
 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< TeardownFailedEventArgsTeardownFailed
 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< UpdateStartedEventArgsUpdateStarted
 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< UpdateSucceededEventArgsUpdateSucceeded
 An update operation has succeeded.
The update operation may be initiated by the methods Update and UpdateAsync. More...
 
EventHandler< UpdateFailedEventArgsUpdateFailed
 An update operation has succeeded.
The update operation may be initiated by the methods Update and UpdateAsync. More...
 

Detailed Description

Interface of the EnhancedPeripheral class.

Member Function Documentation

§ Establish()

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.

§ EstablishAsync()

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.

Parameters
timeoutOptional timeout [ms] (Default: Constants.EnhancedPeripheralEstablishTimeout). If no timeout should be set Timeout.Infinite can be used.

Implemented in Arendi.BleLibrary.Extention.EnhancedPeripheral.

§ Teardown()

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.

§ TeardownAsync()

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.

Parameters
timeoutOptional timeout [ms] (Default: Constants.EnhancedPeripheralTeardownTimeout). If no timeout should be set Timeout.Infinite can be used.

Implemented in Arendi.BleLibrary.Extention.EnhancedPeripheral.

§ Update()

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.

Parameters
updateSetupUpdate setup to be used for the update.

Implemented in Arendi.BleLibrary.Extention.EnhancedPeripheral.

§ UpdateAsync()

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.

Parameters
updateSetupUpdate setup to be used for the update.
timeoutOptional timeout [ms] (Default: Constants.EnhancedPeripheralUpdateTimeout). If no timeout should be set Timeout.Infinite can be used.

Implemented in Arendi.BleLibrary.Extention.EnhancedPeripheral.

Property Documentation

§ ConnectTimeout

int Arendi.BleLibrary.Extention.IEnhancedPeripheral.ConnectTimeout
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.

§ DisconnectTimeout

int Arendi.BleLibrary.Extention.IEnhancedPeripheral.DisconnectTimeout
getset

Get/Set the disconnect timeout [ms]. By default the value is set to Constants.DisconnectTimeout.

§ DiscoverServicesTimeout

int Arendi.BleLibrary.Extention.IEnhancedPeripheral.DiscoverServicesTimeout
getset

Get/Set the discover services timeout [ms]. By default the value is set to Constants.DiscoverServicesTimeout.

§ Mode

PeripheralMode Arendi.BleLibrary.Extention.IEnhancedPeripheral.Mode
getset

Get/Set the mode the peripheral is used.

§ ReconnectAfterDisconnectTimeout

int Arendi.BleLibrary.Extention.IEnhancedPeripheral.ReconnectAfterDisconnectTimeout
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.

§ ReconnectAfterDisconnectTimeoutDefault

int Arendi.BleLibrary.Extention.IEnhancedPeripheral.ReconnectAfterDisconnectTimeoutDefault
get

Default timeout after a disconnect [ms].

§ ReconnectAfterFailedConnectTimeout

int Arendi.BleLibrary.Extention.IEnhancedPeripheral.ReconnectAfterFailedConnectTimeout
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.

§ ReconnectAfterFailedConnectTimeoutDefault

int Arendi.BleLibrary.Extention.IEnhancedPeripheral.ReconnectAfterFailedConnectTimeoutDefault
get

Default timeout after a failed connect [ms].

§ RssiInterval

int Arendi.BleLibrary.Extention.IEnhancedPeripheral.RssiInterval
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.

§ RssiIntervalDefault

int Arendi.BleLibrary.Extention.IEnhancedPeripheral.RssiIntervalDefault
get

Get the default interval for RSSI measurements [ms].

§ State

PeripheralState Arendi.BleLibrary.Extention.IEnhancedPeripheral.State
get

Get the state of the peripheral.

Event Documentation

§ EstablishFailed

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.

§ EstablishStarted

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.

§ EstablishSucceeded

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.

§ IsConnectableUpdated

EventHandler<IsConnectableUpdatedEventArgs> Arendi.BleLibrary.Extention.IEnhancedPeripheral.IsConnectableUpdated

Property if the peripheral may be connected has been updated.

§ NameUpdated

EventHandler<NameUpdatedEventArgs> Arendi.BleLibrary.Extention.IEnhancedPeripheral.NameUpdated

Name of the peripheral has changed.

§ PeripheralUpdated

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.

§ RssiUpdated

EventHandler<RssiUpdatedEventArgs> Arendi.BleLibrary.Extention.IEnhancedPeripheral.RssiUpdated

RSSI level of the peripheral has changed.

§ StateChanged

EventHandler<PeripheralStateChangedEventArgs> Arendi.BleLibrary.Extention.IEnhancedPeripheral.StateChanged

State of the peripheral changed.

§ TeardownFailed

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.

§ TeardownStarted

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.

§ TeardownSucceeded

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.

§ UpdateFailed

EventHandler<UpdateFailedEventArgs> Arendi.BleLibrary.Extention.IEnhancedPeripheral.UpdateFailed

An update operation has succeeded.
The update operation may be initiated by the methods Update and UpdateAsync.

§ UpdateStarted

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.

§ UpdateSucceeded

EventHandler<UpdateSucceededEventArgs> Arendi.BleLibrary.Extention.IEnhancedPeripheral.UpdateSucceeded

An update operation has succeeded.
The update operation may be initiated by the methods Update and UpdateAsync.