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.

public : ushort AttributeHandle { get; }
ushort AttributeHandle();
public ushort AttributeHandle { get; }
Public ReadOnly Property AttributeHandle As ushort
var ushort = gattDeviceService.attributeHandle;
Value
ushort ushort ushort

Handle to uniquely identify GATT-based service attributes.

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

Device Device Device Device Device

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

public : BluetoothLEDevice Device { get; }
BluetoothLEDevice Device();
public BluetoothLEDevice Device { get; }
Public ReadOnly Property Device As BluetoothLEDevice
var bluetoothleDevice = gattDeviceService.device;
Value
BluetoothLEDevice BluetoothLEDevice BluetoothLEDevice

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

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

DeviceAccessInformation DeviceAccessInformation DeviceAccessInformation DeviceAccessInformation DeviceAccessInformation

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

public : DeviceAccessInformation DeviceAccessInformation { get; }
DeviceAccessInformation DeviceAccessInformation();
public DeviceAccessInformation DeviceAccessInformation { get; }
Public ReadOnly Property DeviceAccessInformation As DeviceAccessInformation
var deviceAccessInformation = gattDeviceService.deviceAccessInformation;
Value
DeviceAccessInformation DeviceAccessInformation DeviceAccessInformation

The device access information associated with the current GattDeviceService object.

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

DeviceId DeviceId DeviceId DeviceId DeviceId

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

public : Platform::String DeviceId { get; }
winrt::hstring DeviceId();
public string DeviceId { get; }
Public ReadOnly Property DeviceId As string
var string = gattDeviceService.deviceId;
Value
string string string

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

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

ParentServices ParentServices ParentServices ParentServices ParentServices

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

public : IVectorView<GattDeviceService> ParentServices { get; }
IVectorView<GattDeviceService> ParentServices();
public IReadOnlyList<GattDeviceService> ParentServices { get; }
Public ReadOnly Property ParentServices As IReadOnlyList<GattDeviceService>
var iReadOnlyList = gattDeviceService.parentServices;
Value
IReadOnlyList<GattDeviceService> IReadOnlyList<GattDeviceService> IReadOnlyList<GattDeviceService>

A read-only list of parent services from which this object is derived, if this GattDeviceService is an included service; Otherwise, null.

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

Session Session Session Session Session

Gets the session for this GATT device service instance.

public : GattSession Session { get; }
GattSession Session();
public GattSession Session { get; }
Public ReadOnly Property Session As GattSession
var gattSession = gattDeviceService.session;
Value
GattSession GattSession GattSession

The session for this GATT device service instance.

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

SharingMode SharingMode SharingMode SharingMode SharingMode

Gets the sharing mode for this GATT device service instance.

public : GattSharingMode SharingMode { get; }
GattSharingMode SharingMode();
public GattSharingMode SharingMode { get; }
Public ReadOnly Property SharingMode As GattSharingMode
var gattSharingMode = gattDeviceService.sharingMode;
Value
GattSharingMode GattSharingMode GattSharingMode

The sharing mode for this GATT device service instance.

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

Uuid Uuid Uuid Uuid Uuid

The GATT Service UUID associated with this GattDeviceService.

public : Platform::Guid Uuid { get; }
Guid Uuid();
public Guid Uuid { get; }
Public ReadOnly Property Uuid As Guid
var guid = gattDeviceService.uuid;
Value
Guid Guid Guid

A 128-bit Bluetooth GATT Service UUID, represented as a standard GUID object.

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

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.

public : void Close()
void Close() const;
// This member is not implemented in C#
' This member is not implemented in VB.Net
// This member is not implemented in JavaScript
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

ConvertShortIdToUuid(UInt16) 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)
Guid ConvertShortIdToUuid(UInt16 shortId) const;
public static Guid ConvertShortIdToUuid(UInt16 shortId)
Public Static Function ConvertShortIdToUuid(shortId As UInt16) As Guid
var guid = Windows.Devices.Bluetooth.GenericAttributeProfile.GattDeviceService.convertShortIdToUuid(shortId);
Parameters
shortId
UInt16 UInt16 UInt16

A 16-bit Bluetooth GATT Service UUID.

Returns
Guid Guid Guid

The corresponding 128-bit GATT Service UUID, that uniquely identifies this service.

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

Dispose() Dispose() Dispose()

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

// This member is not implemented in C++/CX
void Dispose()
Sub Dispose

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

Instantiates a new GattDeviceService from the device ID.

public : static IAsyncOperation<GattDeviceService> FromIdAsync(Platform::String deviceId)
IAsyncOperation<GattDeviceService> FromIdAsync(winrt::hstring deviceId) const;
public static IAsyncOperation<GattDeviceService> FromIdAsync(String deviceId)
Public Static Function FromIdAsync(deviceId As String) As IAsyncOperation( Of GattDeviceService )
Windows.Devices.Bluetooth.GenericAttributeProfile.GattDeviceService.fromIdAsync(deviceId).done( /* Your success and error handlers */ );
Parameters
deviceId
String String String

The GATT device ID.

Returns

The object for managing the asynchronous operation, which, upon completion, returns the newly instantiated GattDeviceService.

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

Remarks

The first time this method is invoked by a store app, it should be called from a UI thread in order to display the consent prompt. After the user has granted consent, the method can be invoked from any application thread.

If a store app has not declared the right capabilities or the user does not grant consent, the method returns a null object.

For Windows 10Universal Windows Platform (UWP) apps, use the bluetooth capability. For more info see App capability declarations.For Windows 8.x store apps, see How to specify device capabilities for Bluetooth (Windows) to declare the right capabilities.

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

Instantiates a new GattDeviceService object from the device ID.

public : static IAsyncOperation<GattDeviceService> FromIdAsync(Platform::String deviceId, GattSharingMode sharingMode)
IAsyncOperation<GattDeviceService> FromIdAsync(winrt::hstring deviceId, GattSharingMode sharingMode) const;
public static IAsyncOperation<GattDeviceService> FromIdAsync(String deviceId, GattSharingMode sharingMode)
Public Static Function FromIdAsync(deviceId As String, sharingMode As GattSharingMode) As IAsyncOperation( Of GattDeviceService )
Windows.Devices.Bluetooth.GenericAttributeProfile.GattDeviceService.fromIdAsync(deviceId, sharingMode).done( /* Your success and error handlers */ );
Parameters
deviceId
String String String

The GATT device ID.

sharingMode
GattSharingMode GattSharingMode GattSharingMode

The sharing mode of the GATT device.

Returns

An asynchronous operation that completes with a GattDeviceService object.

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

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

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

public : IVectorView<GattCharacteristic> GetAllCharacteristics()
IVectorView<GattCharacteristic> GetAllCharacteristics() const;
public IReadOnlyList<GattCharacteristic> GetAllCharacteristics()
Public Function GetAllCharacteristics() As IReadOnlyList<GattCharacteristic>( Of GattCharacteristic )
var iVectorView = gattDeviceService.getAllCharacteristics();
Returns
IReadOnlyList<GattCharacteristic> IReadOnlyList<GattCharacteristic> IReadOnlyList<GattCharacteristic>

The collection of all characteristics belonging to this GattDeviceService instance.

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

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

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

public : IVectorView<GattDeviceService> GetAllIncludedServices()
IVectorView<GattDeviceService> GetAllIncludedServices() const;
public IReadOnlyList<GattDeviceService> GetAllIncludedServices()
Public Function GetAllIncludedServices() As IReadOnlyList<GattDeviceService>( Of GattDeviceService )
var iVectorView = gattDeviceService.getAllIncludedServices();
Returns
IReadOnlyList<GattDeviceService> IReadOnlyList<GattDeviceService> IReadOnlyList<GattDeviceService>

The collection of all included services belonging to this GattDeviceService instance.

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

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.

public : IVectorView<GattCharacteristic> GetCharacteristics(Platform::Guid characteristicUuid)
IVectorView<GattCharacteristic> GetCharacteristics(Guid characteristicUuid) const;
public IReadOnlyList<GattCharacteristic> GetCharacteristics(Guid characteristicUuid)
Public Function GetCharacteristics(characteristicUuid As Guid) As IReadOnlyList<GattCharacteristic>( Of GattCharacteristic )
var iVectorView = gattDeviceService.getCharacteristics(characteristicUuid);
Parameters
characteristicUuid
Guid Guid Guid

The UUID for the characteristics to be retrieved.

Returns
IReadOnlyList<GattCharacteristic> IReadOnlyList<GattCharacteristic> IReadOnlyList<GattCharacteristic>

A vector of GattCharacteristic objects whose UUIDs match characteristicUuid.

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

Remarks

Only a single app can access a single service. If one app has registered a GATT notification trigger, this method will throw an exception for all other apps that sub subsequently call this API.

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

Gets the characterisitics that are part of this GattDeviceService instance.

public : IAsyncOperation<GattCharacteristicsResult> GetCharacteristicsAsync()
IAsyncOperation<GattCharacteristicsResult> GetCharacteristicsAsync() const;
public IAsyncOperation<GattCharacteristicsResult> GetCharacteristicsAsync()
Public Function GetCharacteristicsAsync() As IAsyncOperation( Of GattCharacteristicsResult )
Windows.Devices.Bluetooth.GenericAttributeProfile.GattDeviceService.getCharacteristicsAsync().done( /* Your success and error handlers */ );
Returns

An asynchronous operation that completes with a GattCharacteristicsResult object.

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

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

Gets the characterisitics that are part of this GattDeviceService instance.

public : IAsyncOperation<GattCharacteristicsResult> GetCharacteristicsAsync(BluetoothCacheMode cacheMode)
IAsyncOperation<GattCharacteristicsResult> GetCharacteristicsAsync(BluetoothCacheMode cacheMode) const;
public IAsyncOperation<GattCharacteristicsResult> GetCharacteristicsAsync(BluetoothCacheMode cacheMode)
Public Function GetCharacteristicsAsync(cacheMode As BluetoothCacheMode) As IAsyncOperation( Of GattCharacteristicsResult )
Windows.Devices.Bluetooth.GenericAttributeProfile.GattDeviceService.getCharacteristicsAsync(cacheMode).done( /* Your success and error handlers */ );
Parameters
Returns

An asynchronous operation that completes with a GattCharacteristicsResult object.

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

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.

public : IAsyncOperation<GattCharacteristicsResult> GetCharacteristicsForUuidAsync(Platform::Guid characteristicUuid)
IAsyncOperation<GattCharacteristicsResult> GetCharacteristicsForUuidAsync(Guid characteristicUuid) const;
public IAsyncOperation<GattCharacteristicsResult> GetCharacteristicsForUuidAsync(Guid characteristicUuid)
Public Function GetCharacteristicsForUuidAsync(characteristicUuid As Guid) As IAsyncOperation( Of GattCharacteristicsResult )
Windows.Devices.Bluetooth.GenericAttributeProfile.GattDeviceService.getCharacteristicsForUuidAsync(characteristicUuid).done( /* Your success and error handlers */ );
Parameters
characteristicUuid
Guid Guid Guid

The UUID for the characteristics to be retrieved.

Returns

An asynchronous operation that completes with a GattCharacteristicsResult object.

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

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.

public : IAsyncOperation<GattCharacteristicsResult> GetCharacteristicsForUuidAsync(Platform::Guid characteristicUuid, BluetoothCacheMode cacheMode)
IAsyncOperation<GattCharacteristicsResult> GetCharacteristicsForUuidAsync(Guid characteristicUuid, BluetoothCacheMode cacheMode) const;
public IAsyncOperation<GattCharacteristicsResult> GetCharacteristicsForUuidAsync(Guid characteristicUuid, BluetoothCacheMode cacheMode)
Public Function GetCharacteristicsForUuidAsync(characteristicUuid As Guid, cacheMode As BluetoothCacheMode) As IAsyncOperation( Of GattCharacteristicsResult )
Windows.Devices.Bluetooth.GenericAttributeProfile.GattDeviceService.getCharacteristicsForUuidAsync(characteristicUuid, cacheMode).done( /* Your success and error handlers */ );
Parameters
characteristicUuid
Guid Guid Guid

The UUID for the characteristics to be retrieved.

Returns

An asynchronous operation that completes with a GattCharacteristicsResult object.

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

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.

public : static Platform::String GetDeviceSelectorForBluetoothDeviceId(BluetoothDeviceId bluetoothDeviceId)
winrt::hstring GetDeviceSelectorForBluetoothDeviceId(BluetoothDeviceId bluetoothDeviceId) const;
public static string GetDeviceSelectorForBluetoothDeviceId(BluetoothDeviceId bluetoothDeviceId)
Public Static Function GetDeviceSelectorForBluetoothDeviceId(bluetoothDeviceId As BluetoothDeviceId) As string
var string = Windows.Devices.Bluetooth.GenericAttributeProfile.GattDeviceService.getDeviceSelectorForBluetoothDeviceId(bluetoothDeviceId);
Parameters
bluetoothDeviceId
BluetoothDeviceId BluetoothDeviceId BluetoothDeviceId

The bluetooth device ID.

Returns
string string string

A suitable AQS Selector String which can be passed as a parameter to the CreateWatcher method, in order to retrieve a GATT service instance path

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

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.

public : static Platform::String GetDeviceSelectorForBluetoothDeviceId(BluetoothDeviceId bluetoothDeviceId, BluetoothCacheMode cacheMode)
winrt::hstring GetDeviceSelectorForBluetoothDeviceId(BluetoothDeviceId bluetoothDeviceId, BluetoothCacheMode cacheMode) const;
public static string GetDeviceSelectorForBluetoothDeviceId(BluetoothDeviceId bluetoothDeviceId, BluetoothCacheMode cacheMode)
Public Static Function GetDeviceSelectorForBluetoothDeviceId(bluetoothDeviceId As BluetoothDeviceId, cacheMode As BluetoothCacheMode) As string
var string = Windows.Devices.Bluetooth.GenericAttributeProfile.GattDeviceService.getDeviceSelectorForBluetoothDeviceId(bluetoothDeviceId, cacheMode);
Parameters
bluetoothDeviceId
BluetoothDeviceId BluetoothDeviceId BluetoothDeviceId

The bluetooth device ID.

Returns
string string string

A suitable AQS Selector String which can be passed as a parameter to the CreateWatcher method, in order to retrieve a GATT service instance path

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

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.

public : static Platform::String GetDeviceSelectorForBluetoothDeviceIdAndUuid(BluetoothDeviceId bluetoothDeviceId, Platform::Guid serviceUuid)
winrt::hstring GetDeviceSelectorForBluetoothDeviceIdAndUuid(BluetoothDeviceId bluetoothDeviceId, Guid serviceUuid) const;
public static string GetDeviceSelectorForBluetoothDeviceIdAndUuid(BluetoothDeviceId bluetoothDeviceId, Guid serviceUuid)
Public Static Function GetDeviceSelectorForBluetoothDeviceIdAndUuid(bluetoothDeviceId As BluetoothDeviceId, serviceUuid As Guid) As string
var string = Windows.Devices.Bluetooth.GenericAttributeProfile.GattDeviceService.getDeviceSelectorForBluetoothDeviceIdAndUuid(bluetoothDeviceId, serviceUuid);
Parameters
bluetoothDeviceId
BluetoothDeviceId BluetoothDeviceId BluetoothDeviceId

The bluetooth device ID.

serviceUuid
Guid Guid Guid

The GATT service ID.

Returns
string string string

A suitable AQS Selector String which can be passed as a parameter to the CreateWatcher method, in order to retrieve a GATT service instance path

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

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.

public : static Platform::String GetDeviceSelectorForBluetoothDeviceIdAndUuid(BluetoothDeviceId bluetoothDeviceId, Platform::Guid serviceUuid, BluetoothCacheMode cacheMode)
winrt::hstring GetDeviceSelectorForBluetoothDeviceIdAndUuid(BluetoothDeviceId bluetoothDeviceId, Guid serviceUuid, BluetoothCacheMode cacheMode) const;
public static string GetDeviceSelectorForBluetoothDeviceIdAndUuid(BluetoothDeviceId bluetoothDeviceId, Guid serviceUuid, BluetoothCacheMode cacheMode)
Public Static Function GetDeviceSelectorForBluetoothDeviceIdAndUuid(bluetoothDeviceId As BluetoothDeviceId, serviceUuid As Guid, cacheMode As BluetoothCacheMode) As string
var string = Windows.Devices.Bluetooth.GenericAttributeProfile.GattDeviceService.getDeviceSelectorForBluetoothDeviceIdAndUuid(bluetoothDeviceId, serviceUuid, cacheMode);
Parameters
bluetoothDeviceId
BluetoothDeviceId BluetoothDeviceId BluetoothDeviceId

The bluetooth device ID.

serviceUuid
Guid Guid Guid

The GATT service ID.

Returns
string string string

A suitable AQS Selector String which can be passed as a parameter to the CreateWatcher method, in order to retrieve a GATT service instance path

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

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.

public : static Platform::String GetDeviceSelectorFromShortId(unsigned short serviceShortId)
winrt::hstring GetDeviceSelectorFromShortId(UInt16 serviceShortId) const;
public static string GetDeviceSelectorFromShortId(UInt16 serviceShortId)
Public Static Function GetDeviceSelectorFromShortId(serviceShortId As UInt16) As string
var string = Windows.Devices.Bluetooth.GenericAttributeProfile.GattDeviceService.getDeviceSelectorFromShortId(serviceShortId);
Parameters
serviceShortId
UInt16 UInt16 UInt16

A 16-bit Bluetooth GATT Service UUID.

Returns
string string string

A suitable AQS Selector String which can be passed as a parameter to the CreateWatcher method, in order to retrieve a GATT service instance path

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

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.

public : static Platform::String GetDeviceSelectorFromUuid(Platform::Guid serviceUuid)
winrt::hstring GetDeviceSelectorFromUuid(Guid serviceUuid) const;
public static string GetDeviceSelectorFromUuid(Guid serviceUuid)
Public Static Function GetDeviceSelectorFromUuid(serviceUuid As Guid) As string
var string = Windows.Devices.Bluetooth.GenericAttributeProfile.GattDeviceService.getDeviceSelectorFromUuid(serviceUuid);
Parameters
serviceUuid
Guid Guid Guid

A 128-bit Bluetooth GATT Service UUID, represented as a standard GUID object.

Returns
string string string

A suitable AQS Selector String which can be passed as a parameter to the CreateWatcher method, in order to retrieve a GATT service instance path.

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

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.

public : IVectorView<GattDeviceService> GetIncludedServices(Platform::Guid serviceUuid)
IVectorView<GattDeviceService> GetIncludedServices(Guid serviceUuid) const;
public IReadOnlyList<GattDeviceService> GetIncludedServices(Guid serviceUuid)
Public Function GetIncludedServices(serviceUuid As Guid) As IReadOnlyList<GattDeviceService>( Of GattDeviceService )
var iVectorView = gattDeviceService.getIncludedServices(serviceUuid);
Parameters
serviceUuid
Guid Guid Guid

The UUID for the included services to be retrieved.

Returns
IReadOnlyList<GattDeviceService> IReadOnlyList<GattDeviceService> IReadOnlyList<GattDeviceService>

A vector of included services whose UUIDs match serviceUuid.

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

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

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

public : IAsyncOperation<GattDeviceServicesResult> GetIncludedServicesAsync()
IAsyncOperation<GattDeviceServicesResult> GetIncludedServicesAsync() const;
public IAsyncOperation<GattDeviceServicesResult> GetIncludedServicesAsync()
Public Function GetIncludedServicesAsync() As IAsyncOperation( Of GattDeviceServicesResult )
Windows.Devices.Bluetooth.GenericAttributeProfile.GattDeviceService.getIncludedServicesAsync().done( /* Your success and error handlers */ );
Returns

An asynchronous operation that completes with a GattDeviceServicesResult object.

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

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

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

public : IAsyncOperation<GattDeviceServicesResult> GetIncludedServicesAsync(BluetoothCacheMode cacheMode)
IAsyncOperation<GattDeviceServicesResult> GetIncludedServicesAsync(BluetoothCacheMode cacheMode) const;
public IAsyncOperation<GattDeviceServicesResult> GetIncludedServicesAsync(BluetoothCacheMode cacheMode)
Public Function GetIncludedServicesAsync(cacheMode As BluetoothCacheMode) As IAsyncOperation( Of GattDeviceServicesResult )
Windows.Devices.Bluetooth.GenericAttributeProfile.GattDeviceService.getIncludedServicesAsync(cacheMode).done( /* Your success and error handlers */ );
Parameters
Returns

An asynchronous operation that completes with a GattDeviceServicesResult object.

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

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

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

public : IAsyncOperation<GattDeviceServicesResult> GetIncludedServicesForUuidAsync(Platform::Guid serviceUuid)
IAsyncOperation<GattDeviceServicesResult> GetIncludedServicesForUuidAsync(Guid serviceUuid) const;
public IAsyncOperation<GattDeviceServicesResult> GetIncludedServicesForUuidAsync(Guid serviceUuid)
Public Function GetIncludedServicesForUuidAsync(serviceUuid As Guid) As IAsyncOperation( Of GattDeviceServicesResult )
Windows.Devices.Bluetooth.GenericAttributeProfile.GattDeviceService.getIncludedServicesForUuidAsync(serviceUuid).done( /* Your success and error handlers */ );
Parameters
serviceUuid
Guid Guid Guid

A 128-bit Bluetooth GATT Service UUID, represented as a standard GUID object.

Returns

An asynchronous operation that completes with a GattDeviceServicesResult object.

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

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.

public : IAsyncOperation<GattDeviceServicesResult> GetIncludedServicesForUuidAsync(Platform::Guid serviceUuid, BluetoothCacheMode cacheMode)
IAsyncOperation<GattDeviceServicesResult> GetIncludedServicesForUuidAsync(Guid serviceUuid, BluetoothCacheMode cacheMode) const;
public IAsyncOperation<GattDeviceServicesResult> GetIncludedServicesForUuidAsync(Guid serviceUuid, BluetoothCacheMode cacheMode)
Public Function GetIncludedServicesForUuidAsync(serviceUuid As Guid, cacheMode As BluetoothCacheMode) As IAsyncOperation( Of GattDeviceServicesResult )
Windows.Devices.Bluetooth.GenericAttributeProfile.GattDeviceService.getIncludedServicesForUuidAsync(serviceUuid, cacheMode).done( /* Your success and error handlers */ );
Parameters
serviceUuid
Guid Guid Guid

A 128-bit Bluetooth GATT Service UUID, represented as a standard GUID object.

Returns

An asynchronous operation that completes with a GattDeviceServicesResult object.

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

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

Opens the GATT device service with the specified sharingMode.

public : IAsyncOperation<GattOpenStatus> OpenAsync(GattSharingMode sharingMode)
IAsyncOperation<GattOpenStatus> OpenAsync(GattSharingMode sharingMode) const;
public IAsyncOperation<GattOpenStatus> OpenAsync(GattSharingMode sharingMode)
Public Function OpenAsync(sharingMode As GattSharingMode) As IAsyncOperation( Of GattOpenStatus )
Windows.Devices.Bluetooth.GenericAttributeProfile.GattDeviceService.openAsync(sharingMode).done( /* Your success and error handlers */ );
Parameters
sharingMode
GattSharingMode GattSharingMode GattSharingMode

The sharing mode.

Returns

An asynchronous operation that completes with a GattOpenStatus object.

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

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

Requests access to the GattDeviceService.

public : IAsyncOperation<DeviceAccessStatus> RequestAccessAsync()
IAsyncOperation<DeviceAccessStatus> RequestAccessAsync() const;
public IAsyncOperation<DeviceAccessStatus> RequestAccessAsync()
Public Function RequestAccessAsync() As IAsyncOperation( Of DeviceAccessStatus )
Windows.Devices.Bluetooth.GenericAttributeProfile.GattDeviceService.requestAccessAsync().done( /* Your success and error handlers */ );
Returns

An asynchronous operation that completes with a DeviceAccessStatus object.

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

See Also