/      日本語

mwings.serializers.app_uart_ascii Module

mwings.serializers.app_uart_ascii

Serializers that generate commands representing packets to be sent to the serial communication app (format mode: simplified), and the data structures to handle them.

src/mwings/serializers/app_uart_ascii.py

CommandSerializer

Static class serializer that generates commands representing packets to be sent to the serial communication app (format mode: simplified)

Inherits from: common.CommandSerializerBase

serialize()

serialize(command)

Expands the given command into a raw packet byte sequence.

Arguments

NameTypeDescription
commandCommandCommand data

Returns

TypeValueDescription
optional common.BarePacketcommon.BarePacketExpanded data
NoneInvalid 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

Command()

Command(*, destination_logical_id=120, command_id=0, data)

Arguments

NameTypeDescription
destination_logical_idcommon.UInt8Destination logical device ID
command_idcommon.UInt8Command ID
databytesData

You can pass a dictionary unpacked with **.

is_valid()

is_valid()

Checks whether the command data is valid.

Arguments

None

Returns

TypeValueDescription
boolTrueValid
FalseInvalid

model_*()