Class BluetoothGattAttribute

    Definition

    Namespace:
    Tizen.Network.Bluetooth
    Assembly:
    Tizen.Network.Bluetooth.dll

    The Bluetooth GATT attribute.

    public abstract class BluetoothGattAttribute
    Inheritance
    object
    BluetoothGattAttribute
    Derived
    BluetoothGattCharacteristic
    BluetoothGattCharacteristic
    BluetoothGattDescriptor
    BluetoothGattDescriptor

    Constructors

    View Source

    BluetoothGattAttribute(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.

    Properties

    View Source

    Permissions

    Permissions for this attribute.

    Declaration
    public BluetoothGattPermission Permissions { get; }
    Property Value
    Type Description
    BluetoothGattPermission
    View Source

    Uuid

    The attribute's UUID.

    Declaration
    public string Uuid { get; }
    Property Value
    Type Description
    string
    View Source

    Value

    The value of this descriptor.

    Declaration
    public byte[] Value { get; set; }
    Property Value
    Type Description
    byte[]

    Methods

    View Source

    GetValue(int)

    Returns a string value at the specified offset.

    Declaration
    public string GetValue(int offset)
    Parameters
    Type Name Description
    int offset

    An offset in the attribute value buffer.

    Returns
    Type Description
    string

    The string value at specified offset.

    View Source

    GetValue(FloatDataType, int)

    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.

    int offset

    An offset in the attribute value buffer.

    Returns
    Type Description
    float

    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.

    View Source

    GetValue(IntDataType, int)

    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.

    int offset

    An offset in the attribute value buffer.

    Returns
    Type Description
    int

    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.

    View Source

    SetValue(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
    System.InvalidOperationException

    Throws exception if the value is null.

    View Source

    SetValue(FloatDataType, int, int, int)

    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.

    int mantissa

    The mantissa of the float value.

    int exponent

    An exponent of the float value.

    int 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.

    View Source

    SetValue(IntDataType, int, int)

    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.

    int value

    The value to set.

    int 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.

    Events

    View Source

    ReadRequested

    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
    System.EventHandler<TEventArgs><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.

    View Source

    WriteRequested

    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
    System.EventHandler<TEventArgs><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.

    • View Source
    Back to top Copyright © 2016-2024 Samsung
    Generated by DocFX