getConnectionState static method

Future<BleConnectionState> getConnectionState(
  1. String deviceId, {
  2. Duration? timeout,
})

Returns connection state of the device. All platforms will return Connected/Disconnected states. Android and Apple can also return Connecting/Disconnecting states.

Implementation

static Future<BleConnectionState> getConnectionState(
  String deviceId, {
  Duration? timeout,
}) async {
  return await _bleCommandQueue.queueCommand(
    () => _platform.getConnectionState(deviceId),
    timeout: timeout,
  );
}