connect

@RequiresPermission(value = "android.permission.BLUETOOTH_CONNECT")
suspend fun connect(context: Context, macAddress: String, scope: CoroutineScope, options: BleGattConnectOptions = BleGattConnectOptions()): ClientBleGatt

Connects to the specified device. Device is provided using mac address.

Return

ClientBleGatt with initiated connection based on options provided.

Parameters

context

Application context.

macAddress

MAC address of a device.

options

Connection options.

logger

Logger which is responsible for displaying logs from the BLE device.


@RequiresPermission(value = "android.permission.BLUETOOTH_CONNECT")
suspend fun connect(context: Context, device: ServerDevice, scope: CoroutineScope, options: BleGattConnectOptions = BleGattConnectOptions()): ClientBleGatt

Connects to the specified device. Device is provided using mac address.

Return

ClientBleGatt with initiated connection based on options provided.

Parameters

context

Application context.

device

A server device returned by scanner.

options

Connection options.

logger

Logger which is responsible for displaying logs from the BLE device.