Skip to content

BLEDeviceRegistration

A DeviceRegistration for Bluetooth Low Energy (BLE) devices which can connect to the smartphone via BLE, e.g., a heart rate monitor or a BLE beacon.

Inheritance
Annotations

Constructors

BLEDeviceRegistration.fromJson

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

BLEDeviceRegistration

BLEDeviceRegistration({
  1. String? deviceDisplayName,
  2. DateTime? registrationCreatedOn,
  3. bool isConnected = false,
  4. BatteryChargingState batteryChargingState = BatteryChargingState.unknown,
  5. String? hardwareName,
  6. required String bleAddress,
  7. String? bleName,
})

Creates a new BLEDeviceRegistration with a unique BLE bleAddress.

The bleAddress is also used as the device id, and bleName is used as display name and hardware name, if those are not given.

Properties

bleAddress

String bleAddress
getter/setter pair

The BLE address of this device.

The format of the BLE address is platform-specific. On Android, it is typically a MAC address of the form 00:04:79:00:0F:4D. On iOS, it may be a UUID string on the form E2C56DB5-DFFB-48D2-B060-D0F5A71096E0.

bleName

String? bleName
getter/setter pair

The BLE name of this device, if known. Not all devices will have a BLE name, and it may not be available at the time of registration.

fromJsonFunction

Function get fromJsonFunction
override

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

Methods

toJson

Map<String, dynamic> toJson()
override

Return a JSON encoding of this object.