Changes

Jump to: navigation, search

B2G/Bluetooth/WebBluetooth-v2/BluetoothGatt

344 bytes added, 06:00, 22 August 2014
Event Handlers
=== 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|gatt.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;
gatt.onservicechanged = function onServiceChanged() {
console.log("Services on remote LE devices have been added, removed, or modified. Check the services list to ensure services in use still exist.");
=== onconnectionstatechanged ===
; Description
: A handler to trigger when GATT client has connected/disconnected to/from a remote GATT server.
 
; Sample
var gatt = device.gatt;
gatt.onconnectionstatechanged = function onConnectionStateChanged() {
console.log("Connection state changed to", gatt.connectionState);
};
== Methods ==
Confirm
891
edits

Navigation menu