Arendi.BleLibrary  6.2.1.1599
Arendi.BleLibrary for Android
Arendi.BleLibrary.Service.ICharacteristic Interface Reference

Interface all platform specific implementations of the characteristic fulfill. More...

Inheritance diagram for Arendi.BleLibrary.Service.ICharacteristic:
Arendi.BleLibrary.Service.CharacteristicBase< TPeripheral >

Public Member Functions

byte [] ReadData (int timeout=Constants.ReadDataTimeout, CancellationToken cancellationToken=default(CancellationToken))
 Retrieves the value of a specified characteristic from peripheral. More...
 
void WriteData (byte[] data, WriteType writeType=WriteType.Default, int timeout=Constants.WriteDataTimeout, CancellationToken cancellationToken=default(CancellationToken))
 Writes the data of the characteristic to the peripheral. More...
 
void ChangeNotification (bool enable, int timeout=Constants.ChangeNotificationTimeout, CancellationToken cancellationToken=default(CancellationToken))
 Changes the notifications for the value of a specified characteristic. More...
 
void ChangeIndication (bool enable, int timeout=Constants.ChangeIndicationTimeout, CancellationToken cancellationToken=default(CancellationToken))
 Changes the indications for the value of a specified characteristic. More...
 
Task< byte[]> ReadDataAsync (int timeout=Constants.ReadDataTimeout, CancellationToken cancellationToken=default(CancellationToken))
 Retrieves the value of a specified characteristic from peripheral. More...
 
Task WriteDataAsync (byte[] data, WriteType writeType=WriteType.Default, int timeout=Constants.WriteDataTimeout, CancellationToken cancellationToken=default(CancellationToken))
 Writes the data of the characteristic to the peripheral. More...
 
Task ChangeNotificationAsync (bool enable, int timeout=Constants.ChangeNotificationTimeout, CancellationToken cancellationToken=default(CancellationToken))
 Changes the notifications for the value of a specified characteristic. More...
 
Task ChangeIndicationAsync (bool enable, int timeout=Constants.ChangeIndicationTimeout, CancellationToken cancellationToken=default(CancellationToken))
 Changes the indications for the value of a specified characteristic. 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, IDescriptorDescriptors [get]
 Get a dictionary with all descriptors of this characteristic. More...
 
IPeripheral Peripheral [get]
 Get the peripheral the characteristic is associated to. More...
 
ILog Log [get]
 Logger instance. More...
 

Events

EventHandler< NotificationReceivedEventArgsNotificationReceived
 Event triggered, when a notification has been received. More...
 
EventHandler< IndicationReceivedEventArgsIndicationReceived
 Event triggered, when a indication has been received. More...
 

Detailed Description

Interface all platform specific implementations of the characteristic fulfill.

The characteristic object supports "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.

Member Function Documentation

◆ ChangeIndication()

void Arendi.BleLibrary.Service.ICharacteristic.ChangeIndication ( bool  enable,
int  timeout = Constants.ChangeIndicationTimeout,
CancellationToken  cancellationToken = default(CancellationToken) 
)

Changes the indications for the value of a specified characteristic.

Parameters
enableEnable or disable the indication.
timeoutOptional timeout [ms] (Default: Constants.ChangeIndicationTimeout). The timeout may be set to infinite by using
Timeout.Infinite
.
cancellationTokenToken to cancel an ongoing async operation.

Implemented in Arendi.BleLibrary.Service.CharacteristicBase< TPeripheral >.

◆ ChangeIndicationAsync()

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.

Parameters
enableEnable or disable the indication.
timeoutOptional timeout [ms] (Default: Constants.ChangeIndicationTimeout). The timeout may be set to infinite by using
Timeout.Infinite
.
cancellationTokenToken to cancel an ongoing async operation.

Implemented in Arendi.BleLibrary.Service.CharacteristicBase< TPeripheral >.

◆ ChangeNotification()

void Arendi.BleLibrary.Service.ICharacteristic.ChangeNotification ( bool  enable,
int  timeout = Constants.ChangeNotificationTimeout,
CancellationToken  cancellationToken = default(CancellationToken) 
)

Changes the notifications for the value of a specified characteristic.

Parameters
enableEnable or disable the notification.
timeoutOptional timeout [ms] (Default: Constants.ChangeNotificationTimeout). The timeout may be set to infinite by using
Timeout.Infinite
.
cancellationTokenToken to cancel an ongoing async operation.

Implemented in Arendi.BleLibrary.Service.CharacteristicBase< TPeripheral >.

◆ ChangeNotificationAsync()

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.

Parameters
enableEnable or disable the notification.
timeoutOptional timeout [ms] (Default: Constants.ChangeNotificationTimeout). The timeout may be set to infinite by using
Timeout.Infinite
.
cancellationTokenToken to cancel an ongoing async operation.

Implemented in Arendi.BleLibrary.Service.CharacteristicBase< TPeripheral >.

◆ ReadData()

byte [] Arendi.BleLibrary.Service.ICharacteristic.ReadData ( int  timeout = Constants.ReadDataTimeout,
CancellationToken  cancellationToken = default(CancellationToken) 
)

Retrieves the value of a specified characteristic from peripheral.

Parameters
timeoutOptional timeout [ms] (Default: Constants.ReadDataTimeout). The timeout may be set to infinite by using
Timeout.Infinite
.
cancellationTokenToken to cancel an ongoing async operation.
Returns
Data read from the characteristic.

Implemented in Arendi.BleLibrary.Service.CharacteristicBase< TPeripheral >.

◆ ReadDataAsync()

Task<byte[]> Arendi.BleLibrary.Service.ICharacteristic.ReadDataAsync ( int  timeout = Constants.ReadDataTimeout,
CancellationToken  cancellationToken = default(CancellationToken) 
)

Retrieves the value of a specified characteristic from peripheral.

Parameters
timeoutOptional timeout [ms] (Default: Constants.ReadDataTimeout). The timeout may be set to infinite by using
Timeout.Infinite
.
cancellationTokenToken to cancel an ongoing async operation.
Returns
Data read from the characteristic.

Implemented in Arendi.BleLibrary.Service.CharacteristicBase< TPeripheral >.

◆ WriteData()

void Arendi.BleLibrary.Service.ICharacteristic.WriteData ( byte []  data,
WriteType  writeType = WriteType.Default,
int  timeout = Constants.WriteDataTimeout,
CancellationToken  cancellationToken = default(CancellationToken) 
)

Writes the data of the characteristic to the peripheral.

Parameters
dataData to write to the characteristic.
writeTypeType of the used write operation.
timeoutOptional timeout [ms] (Default: Constants.WriteDataTimeout). The timeout may be set to infinite by using
Timeout.Infinite
.
cancellationTokenToken to cancel an ongoing async operation.

Implemented in Arendi.BleLibrary.Service.CharacteristicBase< TPeripheral >.

◆ WriteDataAsync()

Task Arendi.BleLibrary.Service.ICharacteristic.WriteDataAsync ( byte []  data,
WriteType  writeType = WriteType.Default,
int  timeout = Constants.WriteDataTimeout,
CancellationToken  cancellationToken = default(CancellationToken) 
)

Writes the data of the characteristic to the peripheral.

Parameters
dataData to write to the characteristic.
writeTypeType of the used write operation.
timeoutOptional timeout [ms] (Default: Constants.WriteDataTimeout). The timeout may be set to infinite by using
Timeout.Infinite
.
cancellationTokenToken to cancel an ongoing async operation.

Implemented in Arendi.BleLibrary.Service.CharacteristicBase< TPeripheral >.

Property Documentation

◆ Descriptors

Dictionary<DescriptorType, IDescriptor> Arendi.BleLibrary.Service.ICharacteristic.Descriptors
get

Get a dictionary with all descriptors of this characteristic.

◆ Log

ILog Arendi.BleLibrary.Service.ICharacteristic.Log
get

Logger instance.

◆ Peripheral

IPeripheral Arendi.BleLibrary.Service.ICharacteristic.Peripheral
get

Get the peripheral the characteristic is associated to.

◆ Permission

CharacteristicPermissions Arendi.BleLibrary.Service.ICharacteristic.Permission
get

Get the permissions associated with the characteristic.

◆ Property

CharacteristicProperties Arendi.BleLibrary.Service.ICharacteristic.Property
get

Get the properties associated with the characteristic.

◆ Uuid

Uuid Arendi.BleLibrary.Service.ICharacteristic.Uuid
get

Get the UUID identifying the characteristic.

◆ Value

byte [] Arendi.BleLibrary.Service.ICharacteristic.Value
get

Get the local value of the characteristic. The local value is not valid on all implementations.

Event Documentation

◆ IndicationReceived

EventHandler<IndicationReceivedEventArgs> Arendi.BleLibrary.Service.ICharacteristic.IndicationReceived

Event triggered, when a indication has been received.

◆ NotificationReceived

EventHandler<NotificationReceivedEventArgs> Arendi.BleLibrary.Service.ICharacteristic.NotificationReceived

Event triggered, when a notification has been received.