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