GattServiceProvider Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
This class is used to advertise a GATT service.
public ref class GattServiceProvider sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 262144)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class GattServiceProvider final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 262144)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class GattServiceProvider
Public NotInheritable Class GattServiceProvider
- Inheritance
- Attributes
Windows requirements
Device family |
Windows 10 Creators Update (introduced in 10.0.15063.0)
|
API contract |
Windows.Foundation.UniversalApiContract (introduced in v4.0)
|
App capabilities |
bluetooth
|
Remarks
After you've set up, and called GattServiceProvider.StartAdvertising, devices can initiate connections. But there is no explicit functionality associated with this API to disconnect such a device. That's because as a platform there might be other GATT services active and using the device. If the device is in the Central role, then the device will disconnect when there are no longer any active GATT services being used on the connection. If the device is in the Peripheral role, then the device itself is in control of when to disconnect.
Properties
AdvertisementStatus |
Gets the advertisement status of this GATT service. |
Service |
Gets the GATT service. |
Methods
CreateAsync(Guid) |
Creates a new GATT service with the specified serviceUuid |
StartAdvertising() |
Start advertising the GATT service. |
StartAdvertising(GattServiceProviderAdvertisingParameters) |
Start advertising the GATT service. |
StopAdvertising() |
Stop advertising the GATT service. |
UpdateAdvertisingParameters(GattServiceProviderAdvertisingParameters) |
Events
AdvertisementStatusChanged |
An event that is triggered when the advertisement status has changed. |