/      日本語

mwings.serializers.app_io Module

mwings.serializers.app_io

Serializers that generate commands representing packets to be sent to the remote control app, and the data structures to handle them.

src/mwings/serializers/app_io.py

CommandSerializer

Static class that serializes commands representing packets to be sent to the remote control app

Inherits from: common.CommandSerializerBase

serialize()

serialize(command)

Expands the given command into a raw packet byte sequence.

Parameters

NameTypeDescription
commandCommandCommand data

Returns

TypeValueDescription
optional common.BarePacketcommon.BarePacketExpanded data
NoneInvalid command data

Command

Data structure to hold data used to generate commands representing packets to be sent to the remote control app

Inherits from: common.CommandBase

Command()

Command(*, destination_logical_id=120, di_to_change=<mwings.common.FixedList object>, di_state=<mwings.common.FixedList object>)

Parameters

NameTypeDescription
destination_logical_idcommon.UInt8Destination logical device ID
di_to_changecommon.FixedList[bool](12)Digital interfaces to change
di_statecommon.FixedList[bool](12)State of digital interfaces after change

You can also pass a dictionary unpacked with **.

is_valid()

is_valid()

Checks whether the command data is valid.

Parameters

None

Returns

TypeValueDescription
boolTrueValid
FalseInvalid

model_*()