Class BluetoothGattCharacteristic

Definition

Namespace:
Tizen.Network.Bluetooth
Assembly:
Tizen.Network.Bluetooth.dll

The Bluetooth GATT characteristic.

C#
Copy
public class BluetoothGattCharacteristic : BluetoothGattAttribute
Inheritance
object
BluetoothGattCharacteristic

Constructors

View Source

BluetoothGattCharacteristic(string, BluetoothGattPermission, BluetoothGattProperty, byte[])

The constructor.

Declaration
C#
Copy
public BluetoothGattCharacteristic(string uuid, BluetoothGattPermission permissions, BluetoothGattProperty properties, byte[] value)
Parameters
Type Name Description
string uuid

The UUID of the characterstic.

BluetoothGattPermission permissions

Permissions for the characterstic.

BluetoothGattProperty properties

Properties set for the characterstic.

byte[] value

The value associated with the characterstic.

Remarks

throws in case of internal error.

Exceptions
Type Condition
System.InvalidOperationException

Thrown when the create GATT characteristics procedure fails.

Properties

View Source

Properties

The property for this characteristic.

Declaration
C#
Copy
public BluetoothGattProperty Properties { get; set; }
Property Value
Type Description
BluetoothGattProperty
View Source

WriteType

The write type to be used for write operations.

Declaration
C#
Copy
public BluetoothGattWriteType WriteType { get; set; }
Property Value
Type Description
BluetoothGattWriteType

Methods

View Source

AddDescriptor(BluetoothGattDescriptor)

Adds a descriptor to this characteristic.

Declaration
C#
Copy
public void AddDescriptor(BluetoothGattDescriptor descriptor)
Parameters
Type Name Description
BluetoothGattDescriptor descriptor

The descriptor to be added.

Exceptions
Type Condition
System.InvalidOperationException

Thrown when the add GATT descriptor procedure fails.

View Source

GetDescriptor(string)

Gets the descriptor with the given UUID that belongs to this characteristic.

Declaration
C#
Copy
public BluetoothGattDescriptor GetDescriptor(string uuid)
Parameters
Type Name Description
string uuid

The UUID for the descriptor to get.

Returns
Type Description
BluetoothGattDescriptor

The descriptor with a given UUID if it exists, null otherwise.

View Source

GetDescriptors()

Gets the list of descriptors that belongs to this characteristic.

Declaration
C#
Copy
public IEnumerable<BluetoothGattDescriptor> GetDescriptors()
Returns
Type Description
System.Collections.Generic.IEnumerable<T><BluetoothGattDescriptor>

The list of descriptors that belongs to this characteristic.

View Source

GetService()

Gets the service instance, which the specified characterstic belongs to.

Declaration
C#
Copy
public BluetoothGattService GetService()
Returns
Type Description
BluetoothGattService

The characteristic instance, the specified characterstic belongs to.

Events

View Source

NotificationStateChanged

The NotificationStateChanged event is called when the client enables or disables the Notification/Indication for particular characteristics.

Declaration
C#
Copy
public event EventHandler<NotificationStateChangedEventArg> NotificationStateChanged
Event Type
Type Description
System.EventHandler<TEventArgs><NotificationStateChangedEventArg>
Remarks

BluetoothGattServer.RegisterGattService() should be called before adding/removing this EventHandler. Adding event handle on the characteristic on the client side will not have any effect.

View Source

ValueChanged

The CharacteristicValueChanged event is raised when the server notifies for change in this characteristic value.

Declaration
C#
Copy
public event EventHandler<ValueChangedEventArgs> ValueChanged
Event Type
Type Description
System.EventHandler<TEventArgs><ValueChangedEventArgs>
Remarks

Adding the event handle on characteristic on the server side will not have any effect.