BluetoothDevice.fromDeviceId constructor

BluetoothDevice.fromDeviceId(
  1. String deviceId
)

Creates a BluetoothDevice with a predefined device ID. Be aware that the device ID could change anytime so the proper way is to scan for the device first. This constructor is created for a workaround to be able to reconnect on Android to devices which has still an unreleased connection with the phone after app restart.

Implementation

BluetoothDevice.fromDeviceId(String deviceId)
    : id = new DeviceIdentifier(deviceId),
      name = deviceId,
      type = BluetoothDeviceType.unknown;