Changes

Jump to: navigation, search

B2G/Bluetooth/WebBluetooth-v2/BluetoothGatt

No change in size, 09:30, 22 August 2014
Methods
* [[B2G/Bluetooth/WebBluetooth-v2/BluetoothGatt#disconnect.28.29|BluetoothGatt.disconnect()]]
* [[B2G/Bluetooth/WebBluetooth-v2/BluetoothGatt#readRemoteRssi.28.29|BluetoothGatt.readRemoteRssi()]]
* [[B2G/Bluetooth/WebBluetooth-v2/BluetoothGatt#findService.28DOMString_serviceUuid.29|BluetoothGatt.findService(DOMString serviceUuid)]]
* [[B2G/Bluetooth/WebBluetooth-v2/BluetoothGatt#beginReliableWrite.28.29|BluetoothGatt.beginReliableWrite()]]
* [[B2G/Bluetooth/WebBluetooth-v2/BluetoothGatt#executeReliableWrite.28.29|BluetoothGatt.executeReliableWrite()]]
* [[B2G/Bluetooth/WebBluetooth-v2/BluetoothGatt#abortReliableWrite.28.29|BluetoothGatt.abortReliableWrite()]]
* [[B2G/Bluetooth/WebBluetooth-v2/BluetoothGatt#findService.28DOMString_serviceUuid.29|BluetoothGatt.findService(DOMString serviceUuid)]]
=== connect() ===
console.log("Rejected with this reason: ", aReason);
};
}
 
=== findService(DOMString serviceUuid) ===
 
; Description
: The method is a helper to find the [[B2G/Bluetooth/WebBluetooth-v2/BluetoothGattService#BluetoothGattService|BluetoothGattService]] object of given service UUID from the offered GATT services list (i.e., property [[B2G/Bluetooth/WebBluetooth-v2/BluetoothGatt#services|services]]). If multiple [[B2G/Bluetooth/WebBluetooth-v2/BluetoothGattService#BluetoothGattService|BluetoothGattService]] objects of given service UUID exist, the first [[B2G/Bluetooth/WebBluetooth-v2/BluetoothGattService#BluetoothGattService|BluetoothGattService]] object of the service is returned.
 
; Return
: A [[B2G/Bluetooth/WebBluetooth-v2/BluetoothGattService#BluetoothGattService|BluetoothGattService]] object of given service UUID.
 
; Sample
var gatt = device.gatt;
if (gatt) {
heartRateService = gatt.findService(0x180D);
}
; Return
: A Promise to indicate whether the operation is resolved or rejected.
 
=== findService(DOMString serviceUuid) ===
 
; Description
: The method is a helper to find the [[B2G/Bluetooth/WebBluetooth-v2/BluetoothGattService#BluetoothGattService|BluetoothGattService]] object of given service UUID from the offered GATT services list (i.e., property [[B2G/Bluetooth/WebBluetooth-v2/BluetoothGatt#services|services]]). If multiple [[B2G/Bluetooth/WebBluetooth-v2/BluetoothGattService#BluetoothGattService|BluetoothGattService]] objects of given service UUID exist, the first [[B2G/Bluetooth/WebBluetooth-v2/BluetoothGattService#BluetoothGattService|BluetoothGattService]] object of the service is returned.
 
; Return
: A [[B2G/Bluetooth/WebBluetooth-v2/BluetoothGattService#BluetoothGattService|BluetoothGattService]] object of given service UUID.
 
; Sample
var gatt = device.gatt;
if (gatt) {
heartRateService = gatt.findService(0x180D);
}
== See Also ==
* [[B2G/Bluetooth/WebBluetooth-v2/BluetoothDevice|BluetoothDevice]]
Confirm
891
edits

Navigation menu