Class BluetoothGattClient
Definition
- Namespace:
- Tizen.Network.Bluetooth
- Assembly:
- Tizen.Network.Bluetooth.dll
- API Level:
- 3
The Bluetooth GATT client.
C#Copypublic class BluetoothGattClient : IDisposable
- Inheritance
-
BluetoothGattClient
Properties
Declaration
C#Copypublic string RemoteAddress { get; }
Property Value
Type | Description |
---|---|
String |
API Level: 3
Methods
Declaration
C#Copypublic Task ConnectAsync(bool autoConnect)
Parameters
Type | Name | Description |
---|---|---|
Boolean | autoConnect | The flag for reconnecting when the connection is disconnceted. |
Returns
Type | Description |
---|---|
Task | A task indicating whether the method is done or not. |
API Level: 6
Privilege Level: public
Privilege: http://tizen.org/privilege/bluetooth
Feature: http://tizen.org/feature/network.bluetooth.le.gatt.client
Declaration
C#Copypublic static BluetoothGattClient CreateClient(string remoteAddress)
Parameters
Type | Name | Description |
---|---|---|
String | remoteAddress | The remote device address. |
Returns
Type | Description |
---|---|
BluetoothGattClient | The BluetoothGattClient instance. |
API Level: 6
Feature: http://tizen.org/feature/network.bluetooth.le.gatt.client
Declaration
C#Copypublic void DestroyClient()
API Level: 3
Declaration
C#Copypublic Task DisconnectAsync()
Returns
Type | Description |
---|---|
Task | A task indicating whether the method is done or not. |
API Level: 6
Privilege Level: public
Privilege: http://tizen.org/privilege/bluetooth
Feature: http://tizen.org/feature/network.bluetooth.le.gatt.client
Declaration
C#Copypublic void Dispose()
API Level: 6
Feature: http://tizen.org/feature/network.bluetooth.le.gatt.client
Declaration
C#Copyprotected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
Boolean | disposing | true if the managed resources should be disposed, otherwise false. |
API Level: 6
Declaration
C#Copyprotected void Finalize()
GetAttMtu()
Gets the value of the ATT MTU(Maximum Transmission Unit) for the connection.
Declaration
C#Copypublic int GetAttMtu()
Returns
Type | Description |
---|---|
Int32 | The MTU value |
API Level: 8
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 |
---|---|---|
String | uuid | The UUID for the service to get. |
Returns
Type | Description |
---|---|
BluetoothGattService | The service with the given UUID if it exists, null otherwise. |
API Level: 3
Declaration
C#Copypublic IEnumerable<BluetoothGattService> GetServices()
Returns
Type | Description |
---|---|
IEnumerable<BluetoothGattService> | The list of services that belongs to the remote device. |
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 |
---|---|
Task<Boolean> | true on success, false otherwise. |
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 |
---|---|
Task<Boolean> | true on success, false otherwise. |
API Level: 3
SetAttMtu(Int32)
Sets the value of the ATT MTU(Maximum Transmission Unit) for the connection.
Declaration
C#Copypublic void SetAttMtu(int mtu)
Parameters
Type | Name | Description |
---|---|---|
Int32 | mtu | The MTU value |
API Level: 8
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 |
---|---|
Task<Boolean> | true on success, false otherwise. |
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 |
---|---|
Task<Boolean> | true on success, false otherwise. |
API Level: 3
Events
Declaration
C#Copypublic event EventHandler<AttMtuChangedEventArgs> AttMtuChanged
Event Type
Type | Description |
---|---|
EventHandler<AttMtuChangedEventArgs> |
API Level: 8
ConnectionStateChanged
The ConnectionStateChanged event is raised when the gatt connection state is changed.
Declaration
C#Copypublic event EventHandler<GattConnectionStateChangedEventArgs> ConnectionStateChanged
Event Type
Type | Description |
---|---|
EventHandler<GattConnectionStateChangedEventArgs> |
API Level: 6
ServiceChanged
The ServiceChanged event is raised when the service is changed from the remote device(GATT server).
Declaration
C#Copypublic event EventHandler<ServiceChangedEventArgs> ServiceChanged
Event Type
Type | Description |
---|---|
EventHandler<ServiceChangedEventArgs> |