Changes

Jump to: navigation, search

B2G/Bluetooth/WebBluetooth-v2/BluetoothGatt

154 bytes added, 07:23, 22 August 2014
connect()
; Return
: A Promise to indicate whether the operation is resolved or rejected. Once the method is called, property [[B2G/Bluetooth/WebBluetooth-v2/BluetoothGatt#connectionState|connectionState]] becomes <tt>connecting</tt> and a corresponding [[B2G/Bluetooth/WebBluetooth-v2/BluetoothGatt#onconnectionstatechanged|onconnectionstatechanged]] would be triggered. If the connect operation succeeds, another [[B2G/Bluetooth/WebBluetooth-v2/BluetoothGatt#onconnectionstatechanged|onconnectionstatechanged]] would be triggered before the Promise is resolved to indicate property [[B2G/Bluetooth/WebBluetooth-v2/BluetoothGatt#connectionState|connectionState]] becomes <tt>connected</tt>.
: The Promise would be rejected if 1) property [[B2G/Bluetooth/WebBluetooth-v2/BluetoothGatt#connectionState|connectionState]] is not <tt>disconnected</tt> when the method is called, or 2) the remote LE device is not in range. Once the device is back in range and re-triggered connection succeeds, an [[B2G/Bluetooth/WebBluetooth-v2/BluetoothGatt#onconnectionstatechanged|onconnectionstatechanged]] would be fired to indicate property [[B2G/Bluetooth/WebBluetooth-v2/BluetoothGatt#connectionState|connectionState]] becomes <tt>connected</tt>.
; Sample
Confirm
891
edits

Navigation menu