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, IGattDescriptor2
public sealed class GattDescriptor : IGattDescriptor, IGattDescriptor2
Public NotInheritable Class GattDescriptor Implements IGattDescriptor, IGattDescriptor2
// This class does not provide a public constructor.
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)
Capabilities
bluetooth

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
var ushort = gattDescriptor.attributeHandle;
Value
ushort ushort ushort ushort

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

Additional features and 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)
Capabilities
bluetooth

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
var gattProtectionLevel = gattDescriptor.protectionLevel;
gattDescriptor.protectionLevel = gattProtectionLevel;
Value
GattProtectionLevel GattProtectionLevel GattProtectionLevel GattProtectionLevel

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

Additional features and 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)
Capabilities
bluetooth

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
var guid = gattDescriptor.uuid;
Value
Platform::Guid Guid Guid Guid

The GATT Descriptor UUID for this GattDescriptor.

Additional features and 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)
Capabilities
bluetooth

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
var guid = Windows.Devices.Bluetooth.GenericAttributeProfile.GattDescriptor.convertShortIdToUuid(shortId);
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.

Additional features and 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)
Capabilities
bluetooth

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 )
Windows.Devices.Bluetooth.GenericAttributeProfile.GattDescriptor.readValueAsync().done( /* Your success and error handlers */ );
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.

Additional features and 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)
Capabilities
bluetooth
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 )
Windows.Devices.Bluetooth.GenericAttributeProfile.GattDescriptor.readValueAsync(cacheMode).done( /* Your success and error handlers */ );
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.

Additional features and 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)
Capabilities
bluetooth
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 )
Windows.Devices.Bluetooth.GenericAttributeProfile.GattDescriptor.writeValueAsync(value).done( /* Your success and error handlers */ );
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.

Additional features and 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)
Capabilities
bluetooth

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 )
Windows.Devices.Bluetooth.GenericAttributeProfile.GattDescriptor.writeValueWithResultAsync(value).done( /* Your success and error handlers */ );
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)
Capabilities
bluetooth