Gatt​Device​Service Gatt​Device​Service Gatt​Device​Service 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, IClosablepublic sealed class GattDeviceService : IGattDeviceService, IGattDeviceService2, IGattDeviceService3, IDisposablePublic NotInheritable Class GattDeviceService Implements IGattDeviceService, IGattDeviceService2, IGattDeviceService3, IDisposable
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

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

public ushort AttributeHandle { get; }public ushort AttributeHandle { get; }Public ReadOnly Property AttributeHandle As ushort
Value
ushort ushort ushort

Handle to uniquely identify GATT-based service attributes.

Attributes

Device Device Device

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

public BluetoothLEDevice Device { get; }public BluetoothLEDevice Device { get; }Public ReadOnly Property Device As BluetoothLEDevice
Value
BluetoothLEDevice BluetoothLEDevice BluetoothLEDevice

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

Attributes

DeviceAccessInformation DeviceAccessInformation DeviceAccessInformation

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

public DeviceAccessInformation DeviceAccessInformation { get; }public DeviceAccessInformation DeviceAccessInformation { get; }Public ReadOnly Property DeviceAccessInformation As DeviceAccessInformation
Value
DeviceAccessInformation DeviceAccessInformation DeviceAccessInformation

The device access information associated with the current GattDeviceService object.

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

DeviceId DeviceId DeviceId

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

public PlatForm::String DeviceId { get; }public string DeviceId { get; }Public ReadOnly Property DeviceId As string
Value
string string string

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

Attributes

ParentServices ParentServices ParentServices

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

public IVectorView<GattDeviceService> ParentServices { get; }public IVectorView<GattDeviceService> ParentServices { get; }Public ReadOnly Property ParentServices As IVectorView<GattDeviceService>
Value

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

Attributes

Session Session Session

Gets the session for this GATT device service instance.

public GattSession Session { get; }public GattSession Session { get; }Public ReadOnly Property Session As GattSession
Value
GattSession GattSession GattSession

The session for this GATT device service instance.

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

SharingMode SharingMode SharingMode

Gets the sharing mode for this GATT device service instance.

public GattSharingMode SharingMode { get; }public GattSharingMode SharingMode { get; }Public ReadOnly Property SharingMode As GattSharingMode
Value
GattSharingMode GattSharingMode GattSharingMode

The sharing mode for this GATT device service instance.

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

Uuid Uuid Uuid

The GATT Service UUID associated with this GattDeviceService.

public PlatForm::Guid Uuid { get; }public Guid Uuid { get; }Public ReadOnly Property Uuid As Guid
Value
System.Guid System.Guid System.Guid

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

Attributes

Methods

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()This member is not implemented in C#This member is not implemented in VB.Net
Attributes

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

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

public static PlatForm::Guid ConvertShortIdToUuid(UInt16 shortId)public static Guid ConvertShortIdToUuid(UInt16 shortId)Public Static Function ConvertShortIdToUuid(shortId As UInt16) As Guid
Parameters
shortId
System.UInt16 System.UInt16 System.UInt16

A 16-bit Bluetooth GATT Service UUID.

Returns
System.Guid System.Guid System.Guid

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

Attributes

Dispose() Dispose() Dispose()

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

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

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

Instantiates a new GattDeviceService from the device ID.

public static IAsyncOperation<GattDeviceService> FromIdAsync(String deviceId)public static IAsyncOperation<GattDeviceService> FromIdAsync(String deviceId)Public Static Function FromIdAsync(deviceId As String) As IAsyncOperation( Of GattDeviceService )
Parameters
deviceId
System.String System.String System.String

The GATT device ID.

Returns

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

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

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)

Instantiates a new GattDeviceService object from the device ID.

public static IAsyncOperation<GattDeviceService> FromIdAsync(String deviceId, GattSharingMode sharingMode)public static IAsyncOperation<GattDeviceService> FromIdAsync(String deviceId, GattSharingMode sharingMode)Public Static Function FromIdAsync(deviceId As String, sharingMode As GattSharingMode) As IAsyncOperation( Of GattDeviceService )
Parameters
deviceId
System.String System.String System.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.

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

GetAllCharacteristics() GetAllCharacteristics() GetAllCharacteristics()

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

public IVectorView<GattCharacteristic> GetAllCharacteristics()public IVectorView<GattCharacteristic> GetAllCharacteristics()Public Function GetAllCharacteristics() As IVectorView( Of GattCharacteristic )
Returns

The collection of all characteristics belonging to this GattDeviceService instance.

Attributes

GetAllIncludedServices() GetAllIncludedServices() GetAllIncludedServices()

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

public IVectorView<GattDeviceService> GetAllIncludedServices()public IVectorView<GattDeviceService> GetAllIncludedServices()Public Function GetAllIncludedServices() As IVectorView( Of GattDeviceService )
Returns

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

Attributes

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(Guid characteristicUuid)public IVectorView<GattCharacteristic> GetCharacteristics(Guid characteristicUuid)Public Function GetCharacteristics(characteristicUuid As Guid) As IVectorView( Of GattCharacteristic )
Parameters
characteristicUuid
System.Guid System.Guid System.Guid

The UUID for the characteristics to be retrieved.

Returns

A vector of GattCharacteristic objects whose UUIDs match characteristicUuid.

Attributes

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()

Gets the characterisitics that are part of this GattDeviceService instance.

public IAsyncOperation<GattCharacteristicsResult> GetCharacteristicsAsync()public IAsyncOperation<GattCharacteristicsResult> GetCharacteristicsAsync()Public Function GetCharacteristicsAsync() As IAsyncOperation( Of GattCharacteristicsResult )
Returns

An asynchronous operation that completes with a GattCharacteristicsResult object.

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

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

Gets the characterisitics that are part of this GattDeviceService instance.

public IAsyncOperation<GattCharacteristicsResult> GetCharacteristicsAsync(BluetoothCacheMode cacheMode)public IAsyncOperation<GattCharacteristicsResult> GetCharacteristicsAsync(BluetoothCacheMode cacheMode)Public Function GetCharacteristicsAsync(cacheMode As BluetoothCacheMode) As IAsyncOperation( Of GattCharacteristicsResult )
Parameters
Returns

An asynchronous operation that completes with a GattCharacteristicsResult object.

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

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(Guid characteristicUuid)public IAsyncOperation<GattCharacteristicsResult> GetCharacteristicsForUuidAsync(Guid characteristicUuid)Public Function GetCharacteristicsForUuidAsync(characteristicUuid As Guid) As IAsyncOperation( Of GattCharacteristicsResult )
Parameters
characteristicUuid
System.Guid System.Guid System.Guid

The UUID for the characteristics to be retrieved.

Returns

An asynchronous operation that completes with a GattCharacteristicsResult object.

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

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(Guid characteristicUuid, BluetoothCacheMode cacheMode)public IAsyncOperation<GattCharacteristicsResult> GetCharacteristicsForUuidAsync(Guid characteristicUuid, BluetoothCacheMode cacheMode)Public Function GetCharacteristicsForUuidAsync(characteristicUuid As Guid, cacheMode As BluetoothCacheMode) As IAsyncOperation( Of GattCharacteristicsResult )
Parameters
characteristicUuid
System.Guid System.Guid System.Guid

The UUID for the characteristics to be retrieved.

Returns

An asynchronous operation that completes with a GattCharacteristicsResult object.

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

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)public static string GetDeviceSelectorForBluetoothDeviceId(BluetoothDeviceId bluetoothDeviceId)Public Static Function GetDeviceSelectorForBluetoothDeviceId(bluetoothDeviceId As BluetoothDeviceId) As string
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

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

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)public static string GetDeviceSelectorForBluetoothDeviceId(BluetoothDeviceId bluetoothDeviceId, BluetoothCacheMode cacheMode)Public Static Function GetDeviceSelectorForBluetoothDeviceId(bluetoothDeviceId As BluetoothDeviceId, cacheMode As BluetoothCacheMode) As string
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

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

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, Guid serviceUuid)public static string GetDeviceSelectorForBluetoothDeviceIdAndUuid(BluetoothDeviceId bluetoothDeviceId, Guid serviceUuid)Public Static Function GetDeviceSelectorForBluetoothDeviceIdAndUuid(bluetoothDeviceId As BluetoothDeviceId, serviceUuid As Guid) As string
Parameters
bluetoothDeviceId
BluetoothDeviceId BluetoothDeviceId BluetoothDeviceId

The bluetooth device ID.

serviceUuid
System.Guid System.Guid System.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

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

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, Guid serviceUuid, BluetoothCacheMode cacheMode)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
Parameters
bluetoothDeviceId
BluetoothDeviceId BluetoothDeviceId BluetoothDeviceId

The bluetooth device ID.

serviceUuid
System.Guid System.Guid System.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

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

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(UInt16 serviceShortId)public static string GetDeviceSelectorFromShortId(UInt16 serviceShortId)Public Static Function GetDeviceSelectorFromShortId(serviceShortId As UInt16) As string
Parameters
serviceShortId
System.UInt16 System.UInt16 System.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

Attributes

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(Guid serviceUuid)public static string GetDeviceSelectorFromUuid(Guid serviceUuid)Public Static Function GetDeviceSelectorFromUuid(serviceUuid As Guid) As string
Parameters
serviceUuid
System.Guid System.Guid System.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.

Attributes

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(Guid serviceUuid)public IVectorView<GattDeviceService> GetIncludedServices(Guid serviceUuid)Public Function GetIncludedServices(serviceUuid As Guid) As IVectorView( Of GattDeviceService )
Parameters
serviceUuid
System.Guid System.Guid System.Guid

The UUID for the included services to be retrieved.

Returns

A vector of included services whose UUIDs match serviceUuid.

Attributes

GetIncludedServicesAsync() GetIncludedServicesAsync() GetIncludedServicesAsync()

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

public IAsyncOperation<GattDeviceServicesResult> GetIncludedServicesAsync()public IAsyncOperation<GattDeviceServicesResult> GetIncludedServicesAsync()Public Function GetIncludedServicesAsync() As IAsyncOperation( Of GattDeviceServicesResult )
Returns

An asynchronous operation that completes with a GattDeviceServicesResult object.

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

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

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

public IAsyncOperation<GattDeviceServicesResult> GetIncludedServicesAsync(BluetoothCacheMode cacheMode)public IAsyncOperation<GattDeviceServicesResult> GetIncludedServicesAsync(BluetoothCacheMode cacheMode)Public Function GetIncludedServicesAsync(cacheMode As BluetoothCacheMode) As IAsyncOperation( Of GattDeviceServicesResult )
Parameters
Returns

An asynchronous operation that completes with a GattDeviceServicesResult object.

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

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

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

public IAsyncOperation<GattDeviceServicesResult> GetIncludedServicesForUuidAsync(Guid serviceUuid)public IAsyncOperation<GattDeviceServicesResult> GetIncludedServicesForUuidAsync(Guid serviceUuid)Public Function GetIncludedServicesForUuidAsync(serviceUuid As Guid) As IAsyncOperation( Of GattDeviceServicesResult )
Parameters
serviceUuid
System.Guid System.Guid System.Guid

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

Returns

An asynchronous operation that completes with a GattDeviceServicesResult object.

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

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(Guid serviceUuid, BluetoothCacheMode cacheMode)public IAsyncOperation<GattDeviceServicesResult> GetIncludedServicesForUuidAsync(Guid serviceUuid, BluetoothCacheMode cacheMode)Public Function GetIncludedServicesForUuidAsync(serviceUuid As Guid, cacheMode As BluetoothCacheMode) As IAsyncOperation( Of GattDeviceServicesResult )
Parameters
serviceUuid
System.Guid System.Guid System.Guid

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

Returns

An asynchronous operation that completes with a GattDeviceServicesResult object.

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

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

Opens the GATT device service with the specified sharingMode.

public IAsyncOperation<GattOpenStatus> OpenAsync(GattSharingMode sharingMode)public IAsyncOperation<GattOpenStatus> OpenAsync(GattSharingMode sharingMode)Public Function OpenAsync(sharingMode As GattSharingMode) As IAsyncOperation( Of GattOpenStatus )
Parameters
sharingMode
GattSharingMode GattSharingMode GattSharingMode

The sharing mode.

Returns

An asynchronous operation that completes with a GattOpenStatus object.

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

RequestAccessAsync() RequestAccessAsync() RequestAccessAsync()

Requests access to the GattDeviceService.

public IAsyncOperation<DeviceAccessStatus> RequestAccessAsync()public IAsyncOperation<DeviceAccessStatus> RequestAccessAsync()Public Function RequestAccessAsync() As IAsyncOperation( Of DeviceAccessStatus )
Returns

An asynchronous operation that completes with a DeviceAccessStatus object.

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