GattDescriptor GattDescriptor GattDescriptor GattDescriptor Class

Definition

Represents a Descriptor of a GATT Characteristic. The GattDescriptor object represents a GATT Descriptor of a particular characteristic, and is obtained from the Descriptors property of the GattCharacteristic object.

public : sealed class GattDescriptor : IGattDescriptor, IGattDescriptor2public sealed class GattDescriptor : IGattDescriptor, IGattDescriptor2Public NotInheritable Class GattDescriptor Implements IGattDescriptor, IGattDescriptor2// You can use this class in JavaScript.
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0 - for Xbox, see UWP features that aren't yet supported on Xbox)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Properties

AttributeHandle AttributeHandle AttributeHandle AttributeHandle

Gets the GATT Attribute handle used to uniquely identify this attribute on the GATT Server Device.

public : ushort AttributeHandle { get; }public ushort AttributeHandle { get; }Public ReadOnly Property AttributeHandle As ushort// You can use this property in JavaScript.
Value
ushort ushort ushort ushort

Handle that uniquely identifies this attribute on the GATT Server Device.

ProtectionLevel ProtectionLevel ProtectionLevel ProtectionLevel

Gets or sets the desired GATT security options for over the air communication with the device.

Windows will negotiate the maximum security possible with the device as part of the pairing process, and specifying a lower level of security won’t degrade the existing security level.

public : GattProtectionLevel ProtectionLevel { get; set; }public GattProtectionLevel ProtectionLevel { get; set; }Public ReadWrite Property ProtectionLevel As GattProtectionLevel// You can use this property in JavaScript.
Value
GattProtectionLevel GattProtectionLevel GattProtectionLevel GattProtectionLevel

The desired GATT security options for over the air communication with the device.

Uuid Uuid Uuid Uuid

Gets the GATT Descriptor UUID for this GattDescriptor.

public : PlatForm::Guid Uuid { get; }public Guid Uuid { get; }Public ReadOnly Property Uuid As Guid// You can use this property in JavaScript.
Value
PlatForm::Guid Guid Guid Guid

The GATT Descriptor UUID for this GattDescriptor.

Methods

ConvertShortIdToUuid(UInt16) ConvertShortIdToUuid(UInt16) ConvertShortIdToUuid(UInt16) ConvertShortIdToUuid(UInt16)

Converts a Bluetooth SIG defined short Id to a full GATT UUID.

public : static PlatForm::Guid ConvertShortIdToUuid(unsigned short shortId)public static Guid ConvertShortIdToUuid(UInt16 shortId)Public Static Function ConvertShortIdToUuid(shortId As UInt16) As Guid// You can use this method in JavaScript.
Parameters
shortId
unsigned short UInt16 UInt16 UInt16

A 16-bit Bluetooth GATT Descriptor UUID.

Returns
PlatForm::Guid Guid Guid Guid

The corresponding 128-bit GATT Descriptor UUID, that uniquely identifies this descriptor.

ReadValueAsync() ReadValueAsync() ReadValueAsync() ReadValueAsync()

Performs a Descriptor Value read from a value cache maintained by Windows.

public : IAsyncOperation<GattReadResult> ReadValueAsync()public IAsyncOperation<GattReadResult> ReadValueAsync()Public Function ReadValueAsync() As IAsyncOperation( Of GattReadResult )// You can use this method in JavaScript.
Returns

The object required to manage the asynchronous operation, which, upon completion, returns a GattReadResult object, which in turn contains the completion status of the asynchronous operation and, if successful, the data read from the device.

See Also

ReadValueAsync(BluetoothCacheMode) ReadValueAsync(BluetoothCacheMode) ReadValueAsync(BluetoothCacheMode) ReadValueAsync(BluetoothCacheMode)

Performs a Descriptor Value read either from the value cache maintained by Windows, or directly from the device.

public : IAsyncOperation<GattReadResult> ReadValueAsync(BluetoothCacheMode cacheMode)public IAsyncOperation<GattReadResult> ReadValueAsync(BluetoothCacheMode cacheMode)Public Function ReadValueAsync(cacheMode As BluetoothCacheMode) As IAsyncOperation( Of GattReadResult )// You can use this method in JavaScript.
Parameters
cacheMode
BluetoothCacheMode BluetoothCacheMode BluetoothCacheMode BluetoothCacheMode

Specifies whether to read the value directly from the device or from a value cache maintained by Windows.

Returns

The object required to manage the asynchronous operation, which, upon completion, returns a GattReadResult object, which in turn contains the completion status of the asynchronous operation and, if successful, the data read from the device.

See Also

WriteValueAsync(IBuffer) WriteValueAsync(IBuffer) WriteValueAsync(IBuffer) WriteValueAsync(IBuffer)

Performs a Descriptor Value write to a Bluetooth LE device.

public : IAsyncOperation<GattCommunicationStatus> WriteValueAsync(IBuffer value)public IAsyncOperation<GattCommunicationStatus> WriteValueAsync(IBuffer value)Public Function WriteValueAsync(value As IBuffer) As IAsyncOperation( Of GattCommunicationStatus )// You can use this method in JavaScript.
Parameters
value
IBuffer IBuffer IBuffer IBuffer

A Windows.Storage.Streams.IBuffer object which contains the data to be written to the Bluetooth LE device.

Returns

The object that manages the asynchronous operation, which, upon completion, returns the status with which the operation completed.

WriteValueWithResultAsync(IBuffer) WriteValueWithResultAsync(IBuffer) WriteValueWithResultAsync(IBuffer) WriteValueWithResultAsync(IBuffer)

Performs a Descriptor Value write to a Bluetooth LE device.

public : IAsyncOperation<GattWriteResult> WriteValueWithResultAsync(IBuffer value)public IAsyncOperation<GattWriteResult> WriteValueWithResultAsync(IBuffer value)Public Function WriteValueWithResultAsync(value As IBuffer) As IAsyncOperation( Of GattWriteResult )// You can use this method in JavaScript.
Parameters
value
IBuffer IBuffer IBuffer IBuffer

A Windows.Storage.Streams.IBuffer object which contains the data to be written to the Bluetooth LE device.

Returns
Additional features and requirements
Device family
Windows 10 Creators Update (introduced v10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v4)