Class BluetoothGattClient
Definition
- Namespace:
- Tizen.Network.Bluetooth
- Assembly:
- Tizen.Network.Bluetooth.dll
- API Level:
- 3
The Bluetooth GATT client.
C#Copypublic class BluetoothGattClient
- Inheritance
-
BluetoothGattClient
Properties
Declaration
C#Copypublic string RemoteAddress { get; }
Property Value
Type | Description |
---|---|
System.String |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | Thrown when the BT/BTLE is not enabled or when the remote device is disconnected. |
API Level: 3
Methods
Declaration
C#Copypublic void DestroyClient()
API Level: 3
GetService(String)
Gets the service with the given UUID that belongs to the remote device.
Declaration
C#Copypublic BluetoothGattService GetService(string uuid)
Parameters
Type | Name | Description |
---|---|---|
System.String | uuid | The UUID for the service to get. |
Returns
Type | Description |
---|---|
BluetoothGattService | The service with the given UUID if it exists, null otherwise. |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | Thrown when the BT/BTLE is not enabled or when the remote device is disconnected, or when the get service fails. |
API Level: 3
Declaration
C#Copypublic IEnumerable<BluetoothGattService> GetServices()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<BluetoothGattService> | The list of services that belongs to the remote device. |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | Thrown when the BT/BTLE is not enabled or when the remote device is disconnected, or when the get service fails. |
API Level: 3
ReadValueAsync(BluetoothGattCharacteristic)
Reads the value of a given characteristic from the remote device asynchronously.
Declaration
C#Copypublic Task<bool> ReadValueAsync(BluetoothGattCharacteristic characteristic)
Parameters
Type | Name | Description |
---|---|---|
BluetoothGattCharacteristic | characteristic | The characteristic to be read. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<Boolean> | true on success, false otherwise. |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | Thrown when the BT/BTLE is not enabled or when the remote device is disconnected, or when the read attribute value fails. |
API Level: 3
ReadValueAsync(BluetoothGattDescriptor)
Reads the value of the given descriptor from the remote device asynchronously.
Declaration
C#Copypublic Task<bool> ReadValueAsync(BluetoothGattDescriptor descriptor)
Parameters
Type | Name | Description |
---|---|---|
BluetoothGattDescriptor | descriptor | The descriptor to be read. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<Boolean> | true on success, false otherwise. |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | Thrown when the BT/BTLE is not enabled or when the remote device is disconnected, or when the read attribute value fails. |
API Level: 3
WriteValueAsync(BluetoothGattCharacteristic)
Writes the value of a given characteristic to the remote device asynchronously.
Declaration
C#Copypublic Task<bool> WriteValueAsync(BluetoothGattCharacteristic characteristic)
Parameters
Type | Name | Description |
---|---|---|
BluetoothGattCharacteristic | characteristic | The characteristic to be written. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<Boolean> | true on success, false otherwise. |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | Thrown when the BT/BTLE is not enabled or when the remote device is disconnected or when the write attribute value fails. |
API Level: 3
WriteValueAsync(BluetoothGattDescriptor)
Writes the value of the given descriptor to the remote device asynchronously.
Declaration
C#Copypublic Task<bool> WriteValueAsync(BluetoothGattDescriptor descriptor)
Parameters
Type | Name | Description |
---|---|---|
BluetoothGattDescriptor | descriptor | The descriptor to be written. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<Boolean> | true on success, false otherwise. |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | Thrown when the BT/BTLE is not enabled or when the remote device is disconnected, or when the write attribute value fails. |