Show / Hide Table of Contents

    Class BluetoothGattClient

    The Bluetooth GATT client.

    Inheritance
    Object
    BluetoothGattClient
    Implements
    IDisposable
    Inherited Members
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Object.ReferenceEquals(Object, Object)
    Object.ToString()
    Namespace: Tizen.Network.Bluetooth
    Assembly: Tizen.Network.Bluetooth.dll
    Syntax
    public class BluetoothGattClient : IDisposable

    Properties

    RemoteAddress

    The address of the remote device.

    Declaration
    public string RemoteAddress { get; }
    Property Value
    Type Description
    String
    API Version
    3
    Exceptions
    Type Condition
    InvalidOperationException

    Thrown when the BT/BTLE is not enabled or when the remote device is disconnected.

    Methods

    ConnectAsync(Boolean)

    Connects to the remote GATT server asynchronously.

    Declaration
    public 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 Version
    6
    Privilege Level
    public
    Privilege

    http://tizen.org/privilege/bluetooth

    Feature

    http://tizen.org/feature/network.bluetooth.le.gatt.client

    Exceptions
    Type Condition
    NotSupportedException

    Thrown when the BT/BTLE is not supported.

    InvalidOperationException

    Thrown when the create GATT client fails.

    CreateClient(String)

    Creates the Bluetooth GATT client.

    Declaration
    public static BluetoothGattClient CreateClient(string remoteAddress)
    Parameters
    Type Name Description
    String remoteAddress

    The remote device address.

    Returns
    Type Description
    BluetoothGattClient

    The BluetoothGattClient instance.

    API Version
    6
    Feature

    http://tizen.org/feature/network.bluetooth.le.gatt.client

    Exceptions
    Type Condition
    NotSupportedException

    Thrown when the BT/BTLE is not supported.

    InvalidOperationException

    Thrown when the create GATT client fails.

    DestroyClient()

    Destroy Bluetooth GATT client

    Declaration
    [Obsolete("Deprecated since API level 6. Please use Dispose() method on BluetoothGattClient.")]
    public void DestroyClient()
    API Version
    3

    DisconnectAsync()

    Disconnects to the remote GATT server asynchronously.

    Declaration
    public Task DisconnectAsync()
    Returns
    Type Description
    Task

    A task indicating whether the method is done or not.

    API Version
    6
    Privilege Level
    public
    Privilege

    http://tizen.org/privilege/bluetooth

    Feature

    http://tizen.org/feature/network.bluetooth.le.gatt.client

    Exceptions
    Type Condition
    NotSupportedException

    Thrown when the BT/BTLE is not supported.

    InvalidOperationException

    Thrown when the create GATT client fails.

    Dispose()

    Destroys the current object.

    Declaration
    public void Dispose()
    API Version
    6
    Feature

    http://tizen.org/feature/network.bluetooth.le.gatt.client

    Dispose(Boolean)

    Releases all the resources currently used by this instance.

    Declaration
    protected virtual void Dispose(bool disposing)
    Parameters
    Type Name Description
    Boolean disposing

    true if the managed resources should be disposed, otherwise false.

    API Version
    6

    Finalize()

    Destroys the current object.

    Declaration
    protected void Finalize()

    GetService(String)

    Gets the service with the given UUID that belongs to the remote device.

    Declaration
    public 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 Version
    3
    Exceptions
    Type Condition
    InvalidOperationException

    Thrown when the BT/BTLE is not enabled or when the remote device is disconnected, or when the get service fails.

    GetServices()

    Gets list of services that belongs to the remote device.

    Declaration
    public IEnumerable<BluetoothGattService> GetServices()
    Returns
    Type Description
    IEnumerable<BluetoothGattService>

    The list of services that belongs to the remote device.

    API Version
    3
    Exceptions
    Type Condition
    InvalidOperationException

    Thrown when the BT/BTLE is not enabled or when the remote device is disconnected, or when the get service fails.

    ReadValueAsync(BluetoothGattCharacteristic)

    Reads the value of a given characteristic from the remote device asynchronously.

    Declaration
    public 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 Version
    3
    Exceptions
    Type Condition
    InvalidOperationException

    Thrown when the BT/BTLE is not enabled or when the remote device is disconnected, or when the read attribute value fails.

    ReadValueAsync(BluetoothGattDescriptor)

    Reads the value of the given descriptor from the remote device asynchronously.

    Declaration
    public 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 Version
    3
    Exceptions
    Type Condition
    InvalidOperationException

    Thrown when the BT/BTLE is not enabled or when the remote device is disconnected, or when the read attribute value fails.

    WriteValueAsync(BluetoothGattCharacteristic)

    Writes the value of a given characteristic to the remote device asynchronously.

    Declaration
    public 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 Version
    3
    Exceptions
    Type Condition
    InvalidOperationException

    Thrown when the BT/BTLE is not enabled or when the remote device is disconnected or when the write attribute value fails.

    WriteValueAsync(BluetoothGattDescriptor)

    Writes the value of the given descriptor to the remote device asynchronously.

    Declaration
    public 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 Version
    3
    Exceptions
    Type Condition
    InvalidOperationException

    Thrown when the BT/BTLE is not enabled or when the remote device is disconnected, or when the write attribute value fails.

    Events

    ConnectionStateChanged

    The ConnectionStateChanged event is raised when the gatt connection state is changed.

    Declaration
    public event EventHandler<GattConnectionStateChangedEventArgs> ConnectionStateChanged
    Event Type
    Type Description
    EventHandler<GattConnectionStateChangedEventArgs>
    API Version
    6

    Implements

    System.IDisposable
    Back to top Copyright © 2016-2018 Samsung
    Generated by DocFX