Share via


GattServiceProvider Class

Definition

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
Object Platform::Object IInspectable GattServiceProvider
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.

Applies to