connect

Establishes a connection to the specified BLE device.

If a connection to the device already exists, returns the existing BleConnection instance. Otherwise, creates a new connection and initiates the connection process. The connection is stored internally and can be retrieved for subsequent operations.

Return

A BleConnection instance representing the connection to the device.

Parameters

device

The BluetoothDevice to connect to.

See also

Throws

if the connection map is in an inconsistent state.

if required Bluetooth permissions are not granted.