GattServiceProvider GattServiceProvider GattServiceProvider GattServiceProvider Class

Definition

This class is used to advertise a GATT service.

public : sealed class GattServiceProvider : IGattServiceProviderpublic sealed class GattServiceProvider : IGattServiceProviderPublic NotInheritable Class GattServiceProvider Implements IGattServiceProvider// You can use this class in JavaScript.
Attributes
Windows 10 requirements
Device family
Windows 10 Creators Update (introduced v10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v4)

Properties

AdvertisementStatus AdvertisementStatus AdvertisementStatus AdvertisementStatus

Gets the advertisement status of this GATT service.

public : GattServiceProviderAdvertisementStatus AdvertisementStatus { get; }public GattServiceProviderAdvertisementStatus AdvertisementStatus { get; }Public ReadOnly Property AdvertisementStatus As GattServiceProviderAdvertisementStatus// You can use this property in JavaScript.

Service Service Service Service

Gets the GATT service.

public : GattLocalService Service { get; }public GattLocalService Service { get; }Public ReadOnly Property Service As GattLocalService// You can use this property in JavaScript.

Methods

CreateAsync(Guid) CreateAsync(Guid) CreateAsync(Guid) CreateAsync(Guid)

Creates a new GATT service with the specified serviceUuid

public : static IAsyncOperation<GattServiceProviderResult> CreateAsync(PlatForm::Guid serviceUuid)public static IAsyncOperation<GattServiceProviderResult> CreateAsync(Guid serviceUuid)Public Static Function CreateAsync(serviceUuid As Guid) As IAsyncOperation( Of GattServiceProviderResult )// You can use this method in JavaScript.
Parameters
serviceUuid
PlatForm::Guid Guid Guid Guid

The service UUID.

Returns

StartAdvertising() StartAdvertising() StartAdvertising() StartAdvertising()

Start advertising the GATT service.

public : void StartAdvertising()public void StartAdvertising()Public Function StartAdvertising() As void// You can use this method in JavaScript.

StartAdvertising(GattServiceProviderAdvertisingParameters) StartAdvertising(GattServiceProviderAdvertisingParameters) StartAdvertising(GattServiceProviderAdvertisingParameters) StartAdvertising(GattServiceProviderAdvertisingParameters)

Start advertising the GATT service.

public : void StartAdvertising(GattServiceProviderAdvertisingParameters parameters)public void StartAdvertising(GattServiceProviderAdvertisingParameters parameters)Public Function StartAdvertising(parameters As GattServiceProviderAdvertisingParameters) As void// You can use this method in JavaScript.
Parameters

StopAdvertising() StopAdvertising() StopAdvertising() StopAdvertising()

Stop advertising the GATT service.

public : void StopAdvertising()public void StopAdvertising()Public Function StopAdvertising() As void// You can use this method in JavaScript.

Events

AdvertisementStatusChanged AdvertisementStatusChanged AdvertisementStatusChanged AdvertisementStatusChanged

An event that is triggered when the advertisement status has changed.

public : event TypedEventHandler AdvertisementStatusChanged<GattServiceProvider,  GattServiceProviderAdvertisementStatusChangedEventArgs>public event TypedEventHandler AdvertisementStatusChanged<GattServiceProvider,  GattServiceProviderAdvertisementStatusChangedEventArgs>Public Event AdvertisementStatusChanged<GattServiceProvider,  GattServiceProviderAdvertisementStatusChangedEventArgs>// You can use this event in JavaScript.