Arendi.BleLibrary
4.5.1.999
Core-Library (PCL)
|
Interface all platform specific implementations of the characteristic fulfill. More...
Public Member Functions | |
BleResult | ReadData (int timeout=Constants.ReadDataTimeout) |
Retrieves the data of a specified characteristic from peripheral (EAP). More... | |
BleResult | WriteData (byte[] data, int timeout=Constants.WriteDataTimeout) |
Writes the data to a characteristic of the peripheral (EAP). More... | |
BleResult | ChangeNotification (bool enable, int timeout=Constants.ChangeNotificationTimeout) |
Changes the notifications for the value of a specified characteristic (EAP). More... | |
BleResult | ChangeIndication (bool enable, int timeout=Constants.ChangeIndicationTimeout) |
Changes the indication for the value of a specified characteristic (EAP). More... | |
Task< byte[]> | ReadDataAsync (int timeout=Constants.ReadDataTimeout, CancellationToken cancellationToken=default(CancellationToken)) |
Retrieves the value of a specified characteristic from peripheral (TAP). More... | |
Task | WriteDataAsync (byte[] data, int timeout=Constants.WriteDataTimeout, CancellationToken cancellationToken=default(CancellationToken)) |
Writes the data of the characteristic to the peripheral (TAP). More... | |
Task | ChangeNotificationAsync (bool enable, int timeout=Constants.ChangeNotificationTimeout, CancellationToken cancellationToken=default(CancellationToken)) |
Changes the notifications for the value of a specified characteristic (TAP). More... | |
Task | ChangeIndicationAsync (bool enable, int timeout=Constants.ChangeIndicationTimeout, CancellationToken cancellationToken=default(CancellationToken)) |
Changes the indications for the value of a specified characteristic (TAP). More... | |
Properties | |
Uuid | Uuid [get] |
Get the UUID identifying the characteristic. More... | |
byte [] | Value [get] |
Get the local value of the characteristic. The local value is not valid on all implementations. More... | |
CharacteristicPermissions | Permission [get] |
Get the permissions associated with the characteristic. More... | |
CharacteristicProperties | Property [get] |
Get the properties associated with the characteristic. More... | |
Dictionary< DescriptorType, IDescriptor > | Descriptors [get] |
Get a dictionary with all descriptors of this characteristic. More... | |
IPeripheral | Peripheral [get] |
Get the peripheral the characteristic is associated to. More... | |
Events | |
EventHandler< DataReadEventArgs > | DataRead |
Event triggered, when a read data operation initiated by the ReadData method has been completed (EAP). More... | |
EventHandler< DataWrittenEventArgs > | DataWritten |
Event triggered, when a write data operation initiated by the WriteData method has been completed (EAP). More... | |
EventHandler< NotificationChangedEventArgs > | NotificationChanged |
Event triggered, when a notification change operation initiated by the ChangeNotification method has been completed (EAP). More... | |
EventHandler< NotificationReceivedEventArgs > | NotificationReceived |
Event triggered, when a notification has been received. More... | |
EventHandler< IndicationChangedEventArgs > | IndicationChanged |
Event triggered, when a indication change operation initiated by the ChangeIndication method has been completed (EAP). More... | |
EventHandler< IndicationReceivedEventArgs > | IndicationReceived |
Event triggered, when a indication has been received. More... | |
Interface all platform specific implementations of the characteristic fulfill.
The characteristic object supports two different ways to handle asynchronous programming: EAP: Earlier versions of the BleLibrary only supported "Event asynchronous Programming". Any asynchronous operation is initiated by a method. When the method returns BleResult.Pending the end of the asynchronous operation is signalized by events. E.g. the method ReadData will trigger the event DataRead event when done. The result of the operation is given as part of the event arguments in the event.
TAP: The newer way to handle the asynchronous part is the "Task Asynchronous Programming". The methods with the ending "Async" handle its operation in a task which can be awaited on the upper level. The TAP methods won't trigger events unless other described. Error cases in TAP events are always triggering an exception based on the type BleException.
BleResult Arendi.BleLibrary.Service.ICharacteristic.ChangeIndication | ( | bool | enable, |
int | timeout = Constants.ChangeIndicationTimeout |
||
) |
Changes the indication for the value of a specified characteristic (EAP).
enable | Enable or disable the indication. |
timeout | Optional timeout [ms] (Default: Constants.ChangeIndicationTimeout) |
Task Arendi.BleLibrary.Service.ICharacteristic.ChangeIndicationAsync | ( | bool | enable, |
int | timeout = Constants.ChangeIndicationTimeout , |
||
CancellationToken | cancellationToken = default(CancellationToken) |
||
) |
Changes the indications for the value of a specified characteristic (TAP).
enable | Enable or disable the indication. |
timeout | Optional timeout [ms] (Default: Constants.ChangeIndicationTimeout). The timeout may be set to infinite by using Timeout.Infinite |
cancellationToken | Token to cancel an ongoing async operation. |
BleResult Arendi.BleLibrary.Service.ICharacteristic.ChangeNotification | ( | bool | enable, |
int | timeout = Constants.ChangeNotificationTimeout |
||
) |
Changes the notifications for the value of a specified characteristic (EAP).
enable | Enable or disable the notification. |
timeout | Optional timeout [ms] (Default: Constants.ChangeNotificationTimeout) |
Task Arendi.BleLibrary.Service.ICharacteristic.ChangeNotificationAsync | ( | bool | enable, |
int | timeout = Constants.ChangeNotificationTimeout , |
||
CancellationToken | cancellationToken = default(CancellationToken) |
||
) |
Changes the notifications for the value of a specified characteristic (TAP).
enable | Enable or disable the notification. |
timeout | Optional timeout [ms] (Default: Constants.ChangeNotificationTimeout). The timeout may be set to infinite by using Timeout.Infinite |
cancellationToken | Token to cancel an ongoing async operation. |
BleResult Arendi.BleLibrary.Service.ICharacteristic.ReadData | ( | int | timeout = Constants.ReadDataTimeout | ) |
Retrieves the data of a specified characteristic from peripheral (EAP).
timeout | Optional timeout [ms] (Default: Constants.ReadDataTimeout) |
Task<byte[]> Arendi.BleLibrary.Service.ICharacteristic.ReadDataAsync | ( | int | timeout = Constants.ReadDataTimeout , |
CancellationToken | cancellationToken = default(CancellationToken) |
||
) |
Retrieves the value of a specified characteristic from peripheral (TAP).
timeout | Optional timeout [ms] (Default: Constants.ReadDataTimeout). The timeout may be set to infinite by using Timeout.Infinite |
cancellationToken | Token to cancel an ongoing async operation. |
BleResult Arendi.BleLibrary.Service.ICharacteristic.WriteData | ( | byte [] | data, |
int | timeout = Constants.WriteDataTimeout |
||
) |
Writes the data to a characteristic of the peripheral (EAP).
data | Data to write to the characteristic. |
timeout | Optional timeout [ms] (Default: Constants.WriteDataTimeout) |
Task Arendi.BleLibrary.Service.ICharacteristic.WriteDataAsync | ( | byte [] | data, |
int | timeout = Constants.WriteDataTimeout , |
||
CancellationToken | cancellationToken = default(CancellationToken) |
||
) |
Writes the data of the characteristic to the peripheral (TAP).
data | Data to write to the characteristic. |
timeout | Optional timeout [ms] (Default: Constants.WriteDataTimeout). The timeout may be set to infinite by using Timeout.Infinite |
cancellationToken | Token to cancel an ongoing async operation. |
|
get |
Get a dictionary with all descriptors of this characteristic.
|
get |
Get the peripheral the characteristic is associated to.
|
get |
Get the permissions associated with the characteristic.
|
get |
Get the properties associated with the characteristic.
|
get |
Get the UUID identifying the characteristic.
|
get |
Get the local value of the characteristic. The local value is not valid on all implementations.
EventHandler<DataReadEventArgs> Arendi.BleLibrary.Service.ICharacteristic.DataRead |
Event triggered, when a read data operation initiated by the ReadData method has been completed (EAP).
EventHandler<DataWrittenEventArgs> Arendi.BleLibrary.Service.ICharacteristic.DataWritten |
Event triggered, when a write data operation initiated by the WriteData method has been completed (EAP).
EventHandler<IndicationChangedEventArgs> Arendi.BleLibrary.Service.ICharacteristic.IndicationChanged |
Event triggered, when a indication change operation initiated by the ChangeIndication method has been completed (EAP).
EventHandler<IndicationReceivedEventArgs> Arendi.BleLibrary.Service.ICharacteristic.IndicationReceived |
Event triggered, when a indication has been received.
EventHandler<NotificationChangedEventArgs> Arendi.BleLibrary.Service.ICharacteristic.NotificationChanged |
Event triggered, when a notification change operation initiated by the ChangeNotification method has been completed (EAP).
EventHandler<NotificationReceivedEventArgs> Arendi.BleLibrary.Service.ICharacteristic.NotificationReceived |
Event triggered, when a notification has been received.