Usage¶
Test¶
- class src.can.row.CanValue(value: float | None = None, is_averaged=True)¶
CAN value object, which manages the common occurence of getting multiple values for a specific CAN tag before wanting to send it, through simple averaging.
- update(value)¶
- class src.can.row.Row(sigdef: Database | dict[str, CanValue], name: str, timestamp: float | None = None)¶
- classmethod deserialize(b: bytes, db: Database) Row¶
Deserialize a JSON-formatted string into a Row object.
Parameters¶
- sstr
JSON-formatted string representing the serialized row.
- db: Database
cantools configuration database.
Returns¶
- Row
Deserialized Row object.
- serialize() bytes¶
Serialize the row to a JSON-formatted string.
Parameters¶
- indentint, optional
Number of spaces to use for indentation in the output.
Returns¶
- str
JSON-formatted string representing the serialized row.
- stamp()¶