Skip to content

Bluetooth

The nearby Bluetooth devices found in one scan.

Collected by BluetoothProbe for the ConnectivitySamplingPackage.BLUETOOTH measure. Each device appears only once, keyed by its BluetoothDevice.bluetoothDeviceId.

Inheritance
Annotations

Constructors

Bluetooth.fromJson

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

Bluetooth

Bluetooth({
  1. DateTime? startScan,
  2. DateTime? endScan,
})

Properties

endScan

DateTime? endScan
getter/setter pair

Timestamp of scan end, if available.

fromJsonFunction

Function get fromJsonFunction
override

The function which can convert a JSON string to an object of this type.

scanResult

List<BluetoothDevice> get scanResult
set scanResult (List<BluetoothDevice> devices)

The list of BluetoothDevice found in a scan.

Setting it adds the devices to the existing result.

startScan

DateTime startScan
getter/setter pair

Timestamp of scan start.

Methods

addBluetoothDevice

void addBluetoothDevice(
  1. BluetoothDevice device
)

Adds device, replacing any device with the same id.

addBluetoothDevicesFromRangingResults

void addBluetoothDevicesFromRangingResults(
  1. Beacon result,
  2. String beaconName
)

Adds a beacon found by ranging as a device named beaconName.

addBluetoothDevicesFromScanResults

void addBluetoothDevicesFromScanResults(
  1. List<ScanResult> results
)

Adds the devices in a list of flutter_blue_plus scan results.

toJson

Map<String, dynamic> toJson()
override

Return a JSON encoding of this object.

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.