BleCharacteristicValue class

Represents the value of a Bluetooth characteristic.

This class encapsulates the value of a specific Bluetooth characteristic fetched from a connected device. The value is typically a list of integers, representing bytes of data from the characteristic.

Along with the value, the class provides details about the characteristic's UUID and the Bluetooth device's address from which the value was read.

Instances of this class can be used to easily manage, display, or process the characteristic values in your application.

Example:

BleCharacteristicValue charValue = await readCharacteristic(address, characteristicUuid, timeout);
print(charValue.characteristicUuid);  // prints UUID of the characteristic
print(charValue.deviceAddress);       // prints address of the device
print(charValue.value);               // prints the actual value of the characteristic

Constructors

BleCharacteristicValue({required String characteristicUuid, required String deviceAddress, required List<int> value})
Constructs a new instance of BleCharacteristicValue.
BleCharacteristicValue.fromMap(Map map)
Factory constructor that creates an instance of BleCharacteristicValue from a map. This is typically used to convert data coming from the platform side using methods provided by the flutter_splendid_ble plugin.
factory

Properties

characteristicUuid String
The UUID of the Bluetooth characteristic.
final
deviceAddress String
The MAC address of the Bluetooth device.
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
value List<int>
The actual value of the characteristic.
final
valueString String
Returns the value converted into a String by treating the List<int> as a UTF-8 encoded string. This string value may, depending upon your application and the firmware running on the Bluetooth device, be further deserialized as a JSON or Protobuf object.
no setter

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited