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.
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
IAsyncOperation<GattServiceProviderResult>
IAsyncOperation<GattServiceProviderResult>
IAsyncOperation<GattServiceProviderResult>
IAsyncOperation<GattServiceProviderResult>
An asynchronous operation that completes with a GattServiceProviderResult object.
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
- parameters
- GattServiceProviderAdvertisingParameters GattServiceProviderAdvertisingParameters GattServiceProviderAdvertisingParameters GattServiceProviderAdvertisingParameters
The advertising parameters.
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.