RegisterDefinition class
Register definition in a point table.
Example:
final tempReg = RegisterDefinition(
name: 'temperature',
address: 100,
type: RegisterType.inputRegister,
dataType: DataType.float32,
multiplier: 0.1,
unit: '°C',
);
Constructors
- RegisterDefinition({required String name, required int address, required RegisterType type, DataType dataType = DataType.uint16, int? quantity, ByteOrder byteOrder = ByteOrder.bigEndian, double? multiplier, double? offset, String? unit, String? description, bool readOnly = false})
-
const
-
RegisterDefinition.fromJson(Map<
String, dynamic> json) -
Create from JSON map.
factory
Properties
- address → int
-
Register address
final
- byteOrder → ByteOrder
-
Byte order for multi-register types
final
- dataType → DataType
-
Data type (uint16, int32, float32, etc.)
final
- description → String?
-
Description (for documentation)
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- multiplier → double?
-
Multiplier for scaling (applied after reading)
final
- name → String
-
Register name/identifier
final
- offset → double?
-
Offset for scaling (applied after multiplier)
final
- quantity → int?
-
Number of registers (auto-calculated if null)
final
- readOnly → bool
-
Read-only flag
final
- registerCount → int
-
Get the number of registers required for this data type.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- type → RegisterType
-
Register type (coil, discrete input, input register, holding register)
final
- unit → String?
-
Unit of measurement (for documentation)
final
Methods
-
decode(
Uint8List bytes) → dynamic - Decode raw bytes to value based on data type.
-
encode(
dynamic value) → Uint8List - Encode value to bytes based on data type.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> - Convert to JSON map.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited