mwings.serializers.app_uart_ascii Module
mwings.serializers.app_uart_asciiSerializers that generate commands representing packets to be sent to the serial communication app (format mode: simplified), and the data structures to handle them.
CommandSerializer
Static class serializer that generates commands representing packets to be sent to the serial communication app (format mode: simplified)
Inherits from:
common.CommandSerializerBase
Members inherited from the base class are listed.
serialize()
serialize(command)
Expands the given command into a raw packet byte sequence.
Arguments
| Name | Type | Description |
|---|---|---|
command | Command | Command data |
Returns
| Type | Value | Description |
|---|---|---|
optional common.BarePacket | common.BarePacket | Expanded data |
None | Invalid command data |
Command
Structure to store data used to generate commands representing packets to be sent to the serial communication app (format mode: simplified)
Inherits from:
common.CommandBase
Members inherited from the base class are also listed.
Command()
Command(*, destination_logical_id=120, command_id=0, data)
Arguments
| Name | Type | Description |
|---|---|---|
destination_logical_id | common.UInt8 | Destination logical device ID |
command_id | common.UInt8 | Command ID |
data | bytes | Data |
You can pass a dictionary unpacked with
**.
is_valid()
is_valid()
Checks whether the command data is valid.
Arguments
None
Returns
| Type | Value | Description |
|---|---|---|
bool | True | Valid |
False | Invalid |
model_*()
In addition, you can use various methods from
pydantic.BaseModel.