|
|
| Line 59: |
Line 59: |
|
| |
|
| == Event Handlers == | | == Event Handlers == |
| * [[B2G/Bluetooth/WebBluetooth-v2/BluetoothGatt#onservicechanged|BluetoothGatt.onservicechanged]]
| |
| * [[B2G/Bluetooth/WebBluetooth-v2/BluetoothGatt#oncharacteristicchanged|BluetoothGatt.oncharacteristicchanged]] | | * [[B2G/Bluetooth/WebBluetooth-v2/BluetoothGatt#oncharacteristicchanged|BluetoothGatt.oncharacteristicchanged]] |
| * [[B2G/Bluetooth/WebBluetooth-v2/BluetoothGatt#onconnectionstatechanged|BluetoothGatt.onconnectionstatechanged]] | | * [[B2G/Bluetooth/WebBluetooth-v2/BluetoothGatt#onconnectionstatechanged|BluetoothGatt.onconnectionstatechanged]] |
|
| |
| === onservicechanged ===
| |
| ; Description
| |
| : A handler to trigger when GATT services on the remote LE device have been added, removed, or modified. Access to property [[B2G/Bluetooth/WebBluetooth-v2/BluetoothGatt#services|services]] in this event handler would get the updated list. See BT4.1 3.G.2.5.2 and 3.G.7.1 for detailed information.
| |
|
| |
| ; Sample
| |
| var gatt = device.gatt;
| |
| if (gatt) {
| |
| gatt.onservicechanged = function onServiceChanged() {
| |
| console.log("Services on remote LE device have been added, removed, or modified. Check the services list to ensure services in use still exist.");
| |
| };
| |
| }
| |
|
| |
|
| === oncharacteristicchanged === | | === oncharacteristicchanged === |