/      日本語

mwings.serializers.app_twelite Module

mwings.serializers.app_twelite

Serializers to generate commands representing packets for the Extremely Simple! Standard App, and data structures to handle them.

src/mwings/serializers/app_twelite.py

CommandSerializer

Static class to generate commands representing packets for the Extremely Simple! Standard App

Inherits: common.CommandSerializerBase

serialize()

serialize(command)

Expands the given command into a raw 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 for the Extremely Simple! Standard App

Inherits: common.CommandBase

Command()

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

Arguments

NameTypeDescription
destination_logical_idcommon.UInt8Destination logical device ID
di_to_changecommon.FixedList[bool](4)Digital interfaces to change
di_statecommon.FixedList[bool](4)Digital interface states after change
pwm_to_changecommon.FixedList[bool](4)PWM interfaces to change
pwm_dutycommon.FixedList[int](4)PWM interface duty after change

You can also pass a dictionary unpacked with **.

is_valid()

is_valid()

Checks whether the command data is valid.

Arguments

None

Returns

TypeValueDescription
boolTrueValid
FalseInvalid

model_*()