Version: Smart Feature Phone 3.0

BluetoothGatt.connect

Description#

The method connects to the remote LE device. This is an asynchronous method and its result is returned via a Promise. Once the method is called, property connectionState becomes connecting and a corresponding onconnectionstatechanged would be triggered. If the connect operation succeeds, another onconnectionstatechanged would be triggered before the Promise is resolved to indicate property connectionState becomes connected.

Syntax#

var promise = instanceOfBluetoothGatt.connect();

Return value#

A Promise to indicate whether the operation is resolved or rejected. The Promise would be rejected if 1) property connectionState is not disconnected when the method is called, or 2) the remote LE device is not in range.