connect
open fun connect(@NonNull context: Context, @Nullable deviceAddress: String): Boolean
Content copied to clipboard
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
device Address
: The device address of the destination device.
open fun connect(@NonNull context: Context, @Nullable device: BluetoothDevice): Boolean
Content copied to clipboard
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.