connect
Establishes Bluetooth LE connection to the peripheral using default connection options.
Parameters
The peripheral to connect to.
See also
Throws
If the central manager has been closed.
If Bluetooth is disabled or not available.
If BLUETOOTH_CONNECT permission is denied.
If the Peripheral wasn't acquired from this manager by scanning, ranging, or using methods getPeripheralsById or getBondedPeripherals.
If connection failed. See ConnectionFailedException.reason for a reason.
If the coroutine was canceled.
If the connection attempt timed out.
Establishes Bluetooth LE connection to the peripheral.
This method does nothing if the device is already connected.
Parameters
The peripheral to connect to.
Connection options.
Throws
If the central manager has been closed.
If Bluetooth is disabled or not available.
If BLUETOOTH_CONNECT permission is denied.
If the Peripheral wasn't acquired from this manager by scanning, getPeripheralsById or getBondedPeripherals.
If connection failed. See ConnectionFailedException.reason for a reason.
If the coroutine was canceled.
If the connection attempt timed out.