GattCharacteristic GattCharacteristic GattCharacteristic GattCharacteristic GattCharacteristic Class

Definition

Represents a Characteristic of a GATT service. The GattCharacteristic object represents a GATT Characteristic of a particular service, and is obtained from the Characteristics property of the GattDeviceService object.

public : sealed class GattCharacteristic : IGattCharacteristic, IGattCharacteristic2, IGattCharacteristic3
struct winrt::Windows::Devices::Bluetooth::GenericAttributeProfile::GattCharacteristic : IGattCharacteristic, IGattCharacteristic2, IGattCharacteristic3
public sealed class GattCharacteristic : IGattCharacteristic, IGattCharacteristic2, IGattCharacteristic3
Public NotInheritable Class GattCharacteristic Implements IGattCharacteristic, IGattCharacteristic2, IGattCharacteristic3
// 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 AttributeHandle

Gets the handle used to uniquely identify GATT-based characteristic attributes as declared on the Bluetooth LE device.

CharacteristicProperties CharacteristicProperties CharacteristicProperties CharacteristicProperties CharacteristicProperties

Gets the GATT characteristic properties, as defined by the GATT profile.

If the ExtendedProperties flag is present it also represents the properties of the Extended Characteristic Properties Descriptor.

PresentationFormats PresentationFormats PresentationFormats PresentationFormats PresentationFormats

Gets the list of presentation format descriptors associated with this GattCharacteristic, in the order specified by the Aggregate Format Descriptor.

The list shall be empty if no PresentationFormat or Aggregate Format descriptors are found.

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

Service Service Service Service Service

Gets the GattDeviceService of which this characteristic is a member.

UserDescription UserDescription UserDescription UserDescription UserDescription

Get the user friendly description for this GattCharacteristic, if the User Description Descriptor is present, otherwise this will be an empty string.

Uuid Uuid Uuid Uuid Uuid

Gets the GATT Characteristic UUID for this GattCharacteristic.

Methods

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

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

GetAllDescriptors() GetAllDescriptors() GetAllDescriptors() GetAllDescriptors() GetAllDescriptors()

Gets the collection of all descriptors belonging to this GattCharacteristic instance.

GetDescriptors(Guid) GetDescriptors(Guid) GetDescriptors(Guid) GetDescriptors(Guid) GetDescriptors(Guid)

Returns a vector of descriptors, that are identified by the specified UUID, and belong to this GattCharacteristic instance.

GetDescriptorsAsync() GetDescriptorsAsync() GetDescriptorsAsync() GetDescriptorsAsync() GetDescriptorsAsync()

Returns the descriptors for this GattCharacteristic instance.

GetDescriptorsAsync(BluetoothCacheMode) GetDescriptorsAsync(BluetoothCacheMode) GetDescriptorsAsync(BluetoothCacheMode) GetDescriptorsAsync(BluetoothCacheMode) GetDescriptorsAsync(BluetoothCacheMode)

Returns the descriptors with the specified cache mode for this GattCharacteristic instance.

GetDescriptorsForUuidAsync(Guid) GetDescriptorsForUuidAsync(Guid) GetDescriptorsForUuidAsync(Guid) GetDescriptorsForUuidAsync(Guid) GetDescriptorsForUuidAsync(Guid)

Returns the descriptors whose UUIDs match descriptorUuid.

GetDescriptorsForUuidAsync(Guid, BluetoothCacheMode) GetDescriptorsForUuidAsync(Guid, BluetoothCacheMode) GetDescriptorsForUuidAsync(Guid, BluetoothCacheMode) GetDescriptorsForUuidAsync(Guid, BluetoothCacheMode) GetDescriptorsForUuidAsync(Guid, BluetoothCacheMode)

Returns the descriptors whose UUIDs match descriptorUuid with the specified cacheMode.

ReadClientCharacteristicConfigurationDescriptorAsync() ReadClientCharacteristicConfigurationDescriptorAsync() ReadClientCharacteristicConfigurationDescriptorAsync() ReadClientCharacteristicConfigurationDescriptorAsync() ReadClientCharacteristicConfigurationDescriptorAsync()

Reads the current value of the ClientCharacteristicConfigurationDescriptor.

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

Performs a Characteristic Value read from the value cache maintained by Windows.

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

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

WriteClientCharacteristicConfigurationDescriptorAsync(GattClientCharacteristicConfigurationDescriptorValue) WriteClientCharacteristicConfigurationDescriptorAsync(GattClientCharacteristicConfigurationDescriptorValue) WriteClientCharacteristicConfigurationDescriptorAsync(GattClientCharacteristicConfigurationDescriptorValue) WriteClientCharacteristicConfigurationDescriptorAsync(GattClientCharacteristicConfigurationDescriptorValue) WriteClientCharacteristicConfigurationDescriptorAsync(GattClientCharacteristicConfigurationDescriptorValue)

Writes the ClientCharacteristicConfigurationDescriptor to the Bluetooth LE device, and if the value to be written represents an indication or a notification and a ValueChanged event handler is registered, enables receiving ValueChanged events from the device.

WriteClientCharacteristicConfigurationDescriptorWithResultAsync(GattClientCharacteristicConfigurationDescriptorValue) WriteClientCharacteristicConfigurationDescriptorWithResultAsync(GattClientCharacteristicConfigurationDescriptorValue) WriteClientCharacteristicConfigurationDescriptorWithResultAsync(GattClientCharacteristicConfigurationDescriptorValue) WriteClientCharacteristicConfigurationDescriptorWithResultAsync(GattClientCharacteristicConfigurationDescriptorValue) WriteClientCharacteristicConfigurationDescriptorWithResultAsync(GattClientCharacteristicConfigurationDescriptorValue)

Writes the ClientCharacteristicConfigurationDescriptor to the Bluetooth LE device, and if the value to be written represents an indication or a notification and a ValueChanged event handler is registered, enables receiving ValueChanged events from the device.

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

Performs a Characteristic Value write to a Bluetooth LE device.

WriteValueAsync(IBuffer, GattWriteOption) WriteValueAsync(IBuffer, GattWriteOption) WriteValueAsync(IBuffer, GattWriteOption) WriteValueAsync(IBuffer, GattWriteOption) WriteValueAsync(IBuffer, GattWriteOption)

Performs a Characteristic Value write to a Bluetooth LE device.

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

Performs a Characteristic Value write to a Bluetooth LE device.

WriteValueWithResultAsync(IBuffer, GattWriteOption) WriteValueWithResultAsync(IBuffer, GattWriteOption) WriteValueWithResultAsync(IBuffer, GattWriteOption) WriteValueWithResultAsync(IBuffer, GattWriteOption) WriteValueWithResultAsync(IBuffer, GattWriteOption)

Performs a Characteristic Value write to a Bluetooth LE device.

Events

ValueChanged ValueChanged ValueChanged ValueChanged ValueChanged

An App can register an event handler in order to receive events when notification or indications are received from a device, after setting the Client Characteristic Configuration Descriptor.