connect

open fun connect(@NonNull context: Context, @Nullable deviceAddress: String): Boolean

Called to connect to the GATT server hosted on the Bluetooth LE device.

Return

: Booleantrue if the connection is initiated successfully. The connection result is reported asynchronously through the onConnectionStateChange callback.false otherwise.

Parameters

deviceAddress

: The device address of the destination device.


open fun connect(@NonNull context: Context, @Nullable device: BluetoothDevice): Boolean

Called to connect to the GATT server hosted on the Bluetooth LE device.

Return

: Booleantrue if the connection is initiated successfully. The connection result is reported asynchronously through the onConnectionStateChange callback.true otherwise.

Parameters

device

: The device.