Class BluetoothGattAttribute
Definition
- Namespace:
- Tizen.Network.Bluetooth
- Assembly:
- Tizen.Network.Bluetooth.dll
- API Level:
- 3
The Bluetooth GATT attribute.
C#Copypublic abstract class BluetoothGattAttribute
- Inheritance
-
System.ObjectBluetoothGattAttribute
- Derived
Constructors
Declaration
C#Copypublic BluetoothGattAttribute(string uuid, BluetoothGattPermission permission)
Parameters
Type | Name | Description |
---|---|---|
System.String | uuid | The UUID of the GATT attribute. |
BluetoothGattPermission | permission | Permission for the GATT attribute. |
API Level: 3
Properties
Declaration
C#Copypublic BluetoothGattPermission Permissions { get; }
Property Value
Type | Description |
---|---|
BluetoothGattPermission |
API Level: 3
Declaration
C#Copypublic string Uuid { get; }
Property Value
Type | Description |
---|---|
System.String |
API Level: 3
Declaration
C#Copypublic byte[] Value { get; set; }
Property Value
Type | Description |
---|---|
System.Byte[] |
API Level: 3
Methods
Declaration
C#Copypublic string GetValue(int offset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | offset | An offset in the attribute value buffer. |
Returns
Type | Description |
---|---|
System.String | The string value at specified offset. |
API Level: 3
GetValue(FloatDataType, Int32)
Returns a value at the specified offset as the float value of the specified type.
Declaration
C#Copypublic float GetValue(FloatDataType type, int offset)
Parameters
Type | Name | Description |
---|---|---|
FloatDataType | type | The type of the float value. |
System.Int32 | offset | An offset in the attribute value buffer. |
Returns
Type | Description |
---|---|
System.Single | The float value at given offset. |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | Throws exception if (offset + size of float value) is greater than the length of the value buffer. |
API Level: 3
GetValue(IntDataType, Int32)
Returns a value at specified offset as the int value of the specified type.
Declaration
C#Copypublic int GetValue(IntDataType type, int offset)
Parameters
Type | Name | Description |
---|---|---|
IntDataType | type | The type of the int value. |
System.Int32 | offset | An offset in the attribute value buffer. |
Returns
Type | Description |
---|---|
System.Int32 | The int value at given offset. |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | Throws exception if (offset + size of int value) is greater than the length of the value buffer. |
API Level: 3
Declaration
C#Copypublic void SetValue(string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | value | value to set |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | Throws exception if the value is null. |
API Level: 3
SetValue(FloatDataType, Int32, Int32, Int32)
Updates the value at the specified offset by the float value of the specified type.
Declaration
C#Copypublic void SetValue(FloatDataType type, int mantissa, int exponent, int offset)
Parameters
Type | Name | Description |
---|---|---|
FloatDataType | type | The type of the float value. |
System.Int32 | mantissa | The mantissa of the float value. |
System.Int32 | exponent | An exponent of the float value. |
System.Int32 | offset | An offset in the attribute value buffer. |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | Throws exception if (offset + size of float value) is greater than the length of the value buffer. |
API Level: 3
SetValue(IntDataType, Int32, Int32)
Updates a value at the specified offset by the int value of the specified type.
Declaration
C#Copypublic void SetValue(IntDataType type, int value, int offset)
Parameters
Type | Name | Description |
---|---|---|
IntDataType | type | The type of the int value. |
System.Int32 | value | The value to set. |
System.Int32 | offset | An offset in the attribute value buffer. |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | Throws exception if (offset + size of int value) is greater than the length of the value buffer. |
API Level: 3
Events
ReadRequested
This event is called when the client request to read the value of a characteristic or a descriptor.
Declaration
C#Copypublic event EventHandler<ReadRequestedEventArgs> ReadRequested
Event Type
Type | Description |
---|---|
System.EventHandler<ReadRequestedEventArgs> |
Remarks
BluetoothGattServer.RegisterGattService() should be called before adding/removing this EventHandler.
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | Thrown when the set read value requested callback procedure fails. |
API Level: 3
WriteRequested
This event is called when a value of a characteristic or a descriptor has been changed by a client.
Declaration
C#Copypublic event EventHandler<WriteRequestedEventArgs> WriteRequested
Event Type
Type | Description |
---|---|
System.EventHandler<WriteRequestedEventArgs> |
Remarks
BluetoothGattServer.RegisterGattService() should be called before adding/removing this EventHandler.
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | Thrown when the set write value requested callback procedure fails. |