Class BluetoothGattCharacteristic
Definition
- Namespace:
- Tizen.Network.Bluetooth
- Assembly:
- Tizen.Network.Bluetooth.dll
- API Level:
- 3
The Bluetooth GATT characteristic.
public class BluetoothGattCharacteristic : BluetoothGattAttribute
- Inheritance
Constructors
View SourceBluetoothGattCharacteristic(String, BluetoothGattPermission, BluetoothGattProperty, Byte[])
The constructor.
Declaration
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 |
---|---|
InvalidOperationException | Thrown when the create GATT characteristics procedure fails. |
API Level: 3
Properties
View SourceProperties
The property for this characteristic.
Declaration
public BluetoothGattProperty Properties { get; set; }
Property Value
Type | Description |
---|---|
BluetoothGattProperty |
API Level: 3
View SourceWriteType
The write type to be used for write operations.
Declaration
public BluetoothGattWriteType WriteType { get; set; }
Property Value
Type | Description |
---|---|
BluetoothGattWriteType |
API Level: 3
Methods
View SourceAddDescriptor(BluetoothGattDescriptor)
Adds a descriptor to this characteristic.
Declaration
public void AddDescriptor(BluetoothGattDescriptor descriptor)
Parameters
Type | Name | Description |
---|---|---|
BluetoothGattDescriptor | descriptor | The descriptor to be added. |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | Thrown when the add GATT descriptor procedure fails. |
API Level: 3
View SourceGetDescriptor(String)
Gets the descriptor with the given UUID that belongs to this characteristic.
Declaration
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. |
API Level: 3
View SourceGetDescriptors()
Gets the list of descriptors that belongs to this characteristic.
Declaration
public IEnumerable<BluetoothGattDescriptor> GetDescriptors()
Returns
Type | Description |
---|---|
IEnumerable<BluetoothGattDescriptor> | The list of descriptors that belongs to this characteristic. |
API Level: 3
View SourceGetService()
Gets the service instance, which the specified characterstic belongs to.
Declaration
public BluetoothGattService GetService()
Returns
Type | Description |
---|---|
BluetoothGattService | The characteristic instance, the specified characterstic belongs to. |
API Level: 3
Events
View SourceNotificationStateChanged
The NotificationStateChanged event is called when the client enables or disables the Notification/Indication for particular characteristics.
Declaration
public event EventHandler<NotificationStateChangedEventArg> NotificationStateChanged
Event Type
Type | Description |
---|---|
EventHandler<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.
API Level: 3
View SourceValueChanged
The CharacteristicValueChanged event is raised when the server notifies for change in this characteristic value.
Declaration
public event EventHandler<ValueChangedEventArgs> ValueChanged
Event Type
Type | Description |
---|---|
EventHandler<ValueChangedEventArgs> |
Remarks
Adding the event handle on characteristic on the server side will not have any effect.