Skip to content

BluetoothDevice

A Bluetooth device found in a scan, as listed in Bluetooth.

Annotations

Constructors

BluetoothDevice.fromJson

BluetoothDevice.fromJson(
  1. Map<String, dynamic> json
)

BluetoothDevice.fromRangingResult

BluetoothDevice.fromRangingResult(
  1. Beacon result,
  2. String beaconName
)

Creates a BluetoothDevice from a ranged Beacon, using beaconName as id and names.

BluetoothDevice.fromScanResult

BluetoothDevice.fromScanResult(
  1. ScanResult result
)

Creates a BluetoothDevice from a flutter_blue_plus ScanResult.

BluetoothDevice

BluetoothDevice({
  1. required String advertisementName,
  2. required String bluetoothDeviceId,
  3. required String bluetoothDeviceName,
  4. required bool connectable,
  5. required int rssi,
  6. int? txPowerLevel,
})

Properties

advertisementName

String advertisementName
getter/setter pair

The bluetooth advertising name of the device.

bluetoothDeviceId

String bluetoothDeviceId
getter/setter pair

The bluetooth id of the nearby device.

bluetoothDeviceName

String bluetoothDeviceName
getter/setter pair

The bluetooth name of the nearby device.

connectable

bool connectable
getter/setter pair

Whether the device is connectable.

rssi

int rssi
getter/setter pair

The RSSI signal strength to the device, in dBm.

txPowerLevel

int? txPowerLevel
getter/setter pair

The advertised transmit power level, if available.

Methods

toJson

Map<String, dynamic> toJson()

toString

String toString()
override

A string representation of this object.

Some classes have a default textual representation, often paired with a static parse function (like int.parse). These classes will provide the textual representation as their string representation.

Other classes have no meaningful textual representation that a program will care about. Such classes will typically override toString to provide useful information when inspecting the object, mainly for debugging or logging.