BluetoothLEDevice.GattServicesChanged Event
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.
Raised when the list of GATT services supported by the device has changed.
// Register
event_token GattServicesChanged(TypedEventHandler<BluetoothLEDevice, IInspectable const&> const& handler) const;
// Revoke with event_token
void GattServicesChanged(event_token const* cookie) const;
// Revoke with event_revoker
BluetoothLEDevice::GattServicesChanged_revoker GattServicesChanged(auto_revoke_t, TypedEventHandler<BluetoothLEDevice, IInspectable const&> const& handler) const;
public event TypedEventHandler<BluetoothLEDevice,object> GattServicesChanged;
function onGattServicesChanged(eventArgs) { /* Your code */ }
bluetoothLEDevice.addEventListener("gattserviceschanged", onGattServicesChanged);
bluetoothLEDevice.removeEventListener("gattserviceschanged", onGattServicesChanged);
- or -
bluetoothLEDevice.ongattserviceschanged = onGattServicesChanged;
Public Custom Event GattServicesChanged As TypedEventHandler(Of BluetoothLEDevice, Object)
Event Type
TypedEventHandler<BluetoothLEDevice,IInspectable>
Windows requirements
App capabilities |
bluetooth
|
Remarks
This event is raised when the remote device changes its services, or an unpaired device is disconnecting. All services are cleared because unpaired device services can't be cached between connections.
The object parameter in this event is null for every event that is raised.
In your handler for this event, do the following in order to get the services available. Call BluetoothLEDevice.GetGattServicesAsync on the BluetoothLEDevice that's passed to your handler. When calling GetGattServicesAsync, use the Cached option. This can be used to refresh the list of services and re-initialize the services on the device if they are gone.