ManufacturerData class
Represents manufacturer data from a BLE device.
Manufacturer data is a specific type of data that can be included in the advertisement packets sent by Bluetooth Low Energy (BLE) devices. This data is used to provide additional information about the device, which can be useful for identifying the device or understanding its capabilities.
The manufacturer data is divided into two main parts:
-
Manufacturer Identifier: The first two bytes of the manufacturer data represent the identifier of the manufacturer of the device or the Bluetooth radio. This identifier is assigned by the Bluetooth Special Interest Group (SIG) and is unique to each manufacturer. It helps in identifying the manufacturer of the BLE device.
-
Manufacturer-Specific Payload: The remaining bytes of the manufacturer data are available for the BLE device firmware to use according to the designer's purposes. This payload can contain any data that the device wants to advertise, such as sensor readings, device status, or other custom information. Interpreting this data generally requires documentation or some other reference about the firmware implementation, as it is specific to the device and its manufacturer.
This class encapsulates the manufacturer data and provides a structure for handling it within the application.
Constructors
-
ManufacturerData.new({required List<
int> manufacturerId, required List<int> payload}) - Creates an instance of ManufacturerData.
- ManufacturerData.fromString(String manufacturerData)
-
Creates an instance of ManufacturerData from the provided string. In the provided string, the first two bytes
represent the manufacturer identifier, and the remaining bytes represent the manufacturer-specific payload.
factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
-
manufacturerId
→ List<
int> -
The manufacturer identifier of the device.
final
-
payload
→ List<
int> -
The manufacturer-specific payload of the device.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toFormattedString(
) → String - Converts the manufacturer data to a string that is formatted for easy reading. The manufacturer identifier is surrounded by angle brackets to make its separation from the rest of the data more clear. A space is included after every fourth character to separate the manufacturer data into chunks of four characters.
-
toString(
) → String -
Converts the manufacturer data to a string.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited