GattDeviceService GattDeviceService GattDeviceService GattDeviceService GattDeviceService Class

Definition

Represents a GATT Primary Service on a Bluetooth device. The GattDeviceService class represents a GATT service on a Bluetooth LE device. It is instantiated by using a device service instance path, obtained by finding a device using the Windows.Devices.Enumeration API.

public : sealed class GattDeviceService : IGattDeviceService, IGattDeviceService2, IGattDeviceService3, IClosable
struct winrt::Windows::Devices::Bluetooth::GenericAttributeProfile::GattDeviceService : IGattDeviceService, IGattDeviceService2, IGattDeviceService3, IClosable
public sealed class GattDeviceService : IGattDeviceService, IGattDeviceService2, IGattDeviceService3, IDisposable
Public NotInheritable Class GattDeviceService Implements IGattDeviceService, IGattDeviceService2, IGattDeviceService3, IDisposable
// 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 service attributes as declared on the Bluetooth LE device.

Device Device Device Device Device

Gets the BluetoothLEDevice object describing the device associated with the current GattDeviceService object.

DeviceAccessInformation DeviceAccessInformation DeviceAccessInformation DeviceAccessInformation DeviceAccessInformation

Gets the device access information associated with the current GattDeviceService object.

DeviceId DeviceId DeviceId DeviceId DeviceId

Get the string that represents the GATT service instance path used to instantiate the GattDeviceService.

ParentServices ParentServices ParentServices ParentServices ParentServices

Gets the read-only list of parent services for this service.

Session Session Session Session Session

Gets the session for this GATT device service instance.

SharingMode SharingMode SharingMode SharingMode SharingMode

Gets the sharing mode for this GATT device service instance.

Uuid Uuid Uuid Uuid Uuid

The GATT Service UUID associated with this GattDeviceService.

Methods

Close() Close() Close() Close() Close()

Releases the resources associated with the GattDeviceService class. This allows other apps to access the resources of the GattDeviceService in question. A GattDeviceService object should not be used after Close is invoked, instead a new GattDeviceService object should be instantiated using the FromIdAsync method.

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

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

Dispose() Dispose() Dispose() Dispose() Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

FromIdAsync(String) FromIdAsync(String) FromIdAsync(String) FromIdAsync(String) FromIdAsync(String)

Instantiates a new GattDeviceService from the device ID.

FromIdAsync(String, GattSharingMode) FromIdAsync(String, GattSharingMode) FromIdAsync(String, GattSharingMode) FromIdAsync(String, GattSharingMode) FromIdAsync(String, GattSharingMode)

Instantiates a new GattDeviceService object from the device ID.

GetAllCharacteristics() GetAllCharacteristics() GetAllCharacteristics() GetAllCharacteristics() GetAllCharacteristics()

Gets the collection of all characteristics belonging to this GattDeviceService instance.

GetAllIncludedServices() GetAllIncludedServices() GetAllIncludedServices() GetAllIncludedServices() GetAllIncludedServices()

Gets the collection of all included services belonging to this GattDeviceService instance.

GetCharacteristics(Guid) GetCharacteristics(Guid) GetCharacteristics(Guid) GetCharacteristics(Guid) GetCharacteristics(Guid)

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

GetCharacteristicsAsync() GetCharacteristicsAsync() GetCharacteristicsAsync() GetCharacteristicsAsync() GetCharacteristicsAsync()

Gets the characterisitics that are part of this GattDeviceService instance.

GetCharacteristicsAsync(BluetoothCacheMode) GetCharacteristicsAsync(BluetoothCacheMode) GetCharacteristicsAsync(BluetoothCacheMode) GetCharacteristicsAsync(BluetoothCacheMode) GetCharacteristicsAsync(BluetoothCacheMode)

Gets the characterisitics that are part of this GattDeviceService instance.

GetCharacteristicsForUuidAsync(Guid) GetCharacteristicsForUuidAsync(Guid) GetCharacteristicsForUuidAsync(Guid) GetCharacteristicsForUuidAsync(Guid) GetCharacteristicsForUuidAsync(Guid)

Gets the characterisitics that are part of this GattDeviceService instance and associated with the characteristicUuid.

GetCharacteristicsForUuidAsync(Guid, BluetoothCacheMode) GetCharacteristicsForUuidAsync(Guid, BluetoothCacheMode) GetCharacteristicsForUuidAsync(Guid, BluetoothCacheMode) GetCharacteristicsForUuidAsync(Guid, BluetoothCacheMode) GetCharacteristicsForUuidAsync(Guid, BluetoothCacheMode)

Gets the characterisitics that are part of this GattDeviceService instance and associated with the characteristicUuid.

GetDeviceSelectorForBluetoothDeviceId(BluetoothDeviceId) GetDeviceSelectorForBluetoothDeviceId(BluetoothDeviceId) GetDeviceSelectorForBluetoothDeviceId(BluetoothDeviceId) GetDeviceSelectorForBluetoothDeviceId(BluetoothDeviceId) GetDeviceSelectorForBluetoothDeviceId(BluetoothDeviceId)

Creates a suitable AQS Filter string for use with the CreateWatcher method, from a BluetoothDeviceId.

GetDeviceSelectorForBluetoothDeviceId(BluetoothDeviceId, BluetoothCacheMode) GetDeviceSelectorForBluetoothDeviceId(BluetoothDeviceId, BluetoothCacheMode) GetDeviceSelectorForBluetoothDeviceId(BluetoothDeviceId, BluetoothCacheMode) GetDeviceSelectorForBluetoothDeviceId(BluetoothDeviceId, BluetoothCacheMode) GetDeviceSelectorForBluetoothDeviceId(BluetoothDeviceId, BluetoothCacheMode)

Creates a suitable AQS Filter string for use with the CreateWatcher method, from a BluetoothDeviceId.

GetDeviceSelectorForBluetoothDeviceIdAndUuid(BluetoothDeviceId, Guid) GetDeviceSelectorForBluetoothDeviceIdAndUuid(BluetoothDeviceId, Guid) GetDeviceSelectorForBluetoothDeviceIdAndUuid(BluetoothDeviceId, Guid) GetDeviceSelectorForBluetoothDeviceIdAndUuid(BluetoothDeviceId, Guid) GetDeviceSelectorForBluetoothDeviceIdAndUuid(BluetoothDeviceId, Guid)

Creates a suitable AQS Filter string for use with the CreateWatcher method, from a BluetoothDeviceId and serviceUuid.

GetDeviceSelectorForBluetoothDeviceIdAndUuid(BluetoothDeviceId, Guid, BluetoothCacheMode) GetDeviceSelectorForBluetoothDeviceIdAndUuid(BluetoothDeviceId, Guid, BluetoothCacheMode) GetDeviceSelectorForBluetoothDeviceIdAndUuid(BluetoothDeviceId, Guid, BluetoothCacheMode) GetDeviceSelectorForBluetoothDeviceIdAndUuid(BluetoothDeviceId, Guid, BluetoothCacheMode) GetDeviceSelectorForBluetoothDeviceIdAndUuid(BluetoothDeviceId, Guid, BluetoothCacheMode)

Creates a suitable AQS Filter string for use with the CreateWatcher method, from a BluetoothDeviceId and serviceUuid.

GetDeviceSelectorFromShortId(UInt16) GetDeviceSelectorFromShortId(UInt16) GetDeviceSelectorFromShortId(UInt16) GetDeviceSelectorFromShortId(UInt16) GetDeviceSelectorFromShortId(UInt16)

Creates a suitable AQS Filter string for use with the CreateWatcher method, from a 16-bit Bluetooth GATT Service UUID.

GetDeviceSelectorFromUuid(Guid) GetDeviceSelectorFromUuid(Guid) GetDeviceSelectorFromUuid(Guid) GetDeviceSelectorFromUuid(Guid) GetDeviceSelectorFromUuid(Guid)

Creates a suitable AQS Filter string for use with the CreateWatcher method, from a Bluetooth service UUID.

GetIncludedServices(Guid) GetIncludedServices(Guid) GetIncludedServices(Guid) GetIncludedServices(Guid) GetIncludedServices(Guid)

Returns a vector of included services, that are identified by the specified UUID and belong to this GattDeviceService instance.

GetIncludedServicesAsync() GetIncludedServicesAsync() GetIncludedServicesAsync() GetIncludedServicesAsync() GetIncludedServicesAsync()

Gets the included services that are associated with this GattDeviceService instance.

GetIncludedServicesAsync(BluetoothCacheMode) GetIncludedServicesAsync(BluetoothCacheMode) GetIncludedServicesAsync(BluetoothCacheMode) GetIncludedServicesAsync(BluetoothCacheMode) GetIncludedServicesAsync(BluetoothCacheMode)

Gets the included services that are associated with this GattDeviceService instance.

GetIncludedServicesForUuidAsync(Guid) GetIncludedServicesForUuidAsync(Guid) GetIncludedServicesForUuidAsync(Guid) GetIncludedServicesForUuidAsync(Guid) GetIncludedServicesForUuidAsync(Guid)

Gets the included services from the serviceUuid that is associated with this GattDeviceService instance.

GetIncludedServicesForUuidAsync(Guid, BluetoothCacheMode) GetIncludedServicesForUuidAsync(Guid, BluetoothCacheMode) GetIncludedServicesForUuidAsync(Guid, BluetoothCacheMode) GetIncludedServicesForUuidAsync(Guid, BluetoothCacheMode) GetIncludedServicesForUuidAsync(Guid, BluetoothCacheMode)

Gets the included services from the serviceUuid that is associated with this GattDeviceService instance.

OpenAsync(GattSharingMode) OpenAsync(GattSharingMode) OpenAsync(GattSharingMode) OpenAsync(GattSharingMode) OpenAsync(GattSharingMode)

Opens the GATT device service with the specified sharingMode.

RequestAccessAsync() RequestAccessAsync() RequestAccessAsync() RequestAccessAsync() RequestAccessAsync()

Requests access to the GattDeviceService.

See also