120
edits
(remove auto connect) |
|||
| Line 105: | Line 105: | ||
; Return | ; Return | ||
: A Promise to indicate whether the operation is resolved or rejected. 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, 2) | : A Promise to indicate whether the operation is resolved or rejected. 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. | ||
; Sample | ; Sample | ||
| Line 111: | Line 111: | ||
if (gatt) { | if (gatt) { | ||
gatt.connect(false).then ( function onResolve() { | gatt.connect(false).then ( function onResolve() { | ||
console.log(" | console.log("Connection established. ConnectionState becomes:", gatt.connectionState); | ||
}, function onReject(aReason) { | }, function onReject(aReason) { | ||
console.log("Rejected with this reason: ", aReason, ". ConnectionState becomes:", gatt.connectionState); | console.log("Rejected with this reason: ", aReason, ". ConnectionState becomes:", gatt.connectionState); | ||
| Line 118: | Line 118: | ||
; Note | ; Note | ||
: Auto connection establishment procedure defined in bluetooth specification(3.C.9.3.5) is not | : Auto connection establishment procedure defined in bluetooth specification(3.C.9.3.5) is not supported yet. | ||
: Please see [https://bugzilla.mozilla.org/show_bug.cgi?id=1126123 Bug 1126123] for details. | : Please see [https://bugzilla.mozilla.org/show_bug.cgi?id=1126123 Bug 1126123] for details. | ||
edits