This is the multi-page printable view of this section. Click here to print...

Return to the regular view of this page

As of 2025-07-24

Class List

List of MWings classes for 32-bit Arduino boards
This is a list of classes.

1 - mwings::MWings Class

The main MWings class for 32-bit Arduino boards
This is an explanation of the mwings::MWings class.

Constructor

MWings()

Constructor. Initializes internal variables.

MWings()

MWings.h

Arguments

None

Destructor

~MWings()

Destructor. Releases allocated buffers.

~MWings()

Public Member Functions

begin()

Initializes TWELITE and starts it with the specified settings.

    bool begin(HardwareSerial& serial,
                   const int indicatorPin = -1,
                   const int resetPin = -1,
                   const int programPin = -1,
                   const uint8_t channel = 18,
                   const uint32_t appId = 0x67720102,
                   const uint8_t retryCount = 2,
                   const uint8_t txPower = 3,
                   const int rxBufferSize = 1024,
                   const int timeout = 100,
                   const uint32_t encryptKey = 0,
                   HardwareSerial* debugSerial = nullptr);

MWings.cpp

Arguments

TypeNameDescriptionOptionalRemarks
HardwareSerial&serialPort communicating with TWELITE
intindicatorPinPin connected to status LED🆗Can be omitted with -1
intresetPinTWELITE’s RST pin🆗Can be omitted with -1
intprogramPinTWELITE’s PRG pin🆗Can be omitted with -1
uint8_tchannelFrequency channel🆗Default is 18
uint32_tappIdApplication ID🆗Default is 0x67720102
uint8_tretryCountNumber of retries🆗0-9
uint8_ttxPowerTransmission power🆗0-3
intrxBufferSizeSize of packet reception buffer🆗Binary-based
inttimeoutTimeout for each packet🆗Until reception completion
uint32_tencryptKeyEncryption key🆗Disabled if 0, available from v1.2.3+
HardwareSerial*debugSerialDebug output port🆗

Return Value

TypeValueDescriptionRemarks
booltrueSuccess
falseError

end()

Initializes all internal variables.

inline void end()

MWings.h

Arguments

None

Return Value

None

update()

Reads the serial receive buffer and parses the ModBus ASCII format data sent from the parent device.

void update();

MWings.h

Arguments

None

Return Value

None

on() <BarePacket>

Registers a handler to process data sent from all child devices.

inline void on(void (*callback)(const BarePacket& packet))

MWings.h

Arguments

TypeNameDescriptionOptionalRemarks
void (*)(BarePacket&)callbackEvent handler

Return Value

None

on() <ParsedAppTwelitePacket>

Super easy! Registers a handler to process data sent from standard app child devices.

inline void on(void (*callback)(const ParsedAppTwelitePacket& packet))

MWings.h

Arguments

TypeNameDescriptionOptionalRemarks
void (*)(ParsedAppTwelitePacket&)callbackEvent handler

Return Value

None

on() <ParsedAppIoPacket>

Registers a handler to process data sent from remote control app child devices.

inline void on(void (*callback)(const ParsedAppIoPacket& packet))

MWings.h

Arguments

TypeNameDescriptionOptionalRemarks
void (*)(ParsedAppIoPacket&)callbackEvent handler

Return Value

None

on() <ParsedAppAriaPacket>

Registers a handler to process data sent from ARIA app (TWELITE ARIA mode) child devices.

inline void on(void (*callback)(const ParsedAppAriaPacket& packet))

MWings.h

Arguments

TypeNameDescriptionOptionalRemarks
void (*)(ParsedAppAriaPacket&)callbackEvent handler

Return Value

None

on() <ParsedAppCuePacket>

Registers a handler to process data sent from CUE app (TWELITE CUE mode) child devices.

inline void on(void (*callback)(const ParsedAppCuePacket& packet))

MWings.h

Arguments

TypeNameDescriptionOptionalRemarks
void (*)(ParsedAppCuePacket&)callbackEvent handler

Return Value

None

on() <ParsedAppPalOpenClosePacket>

Registers a handler to process data sent from PAL app (open/close sensor PAL) child devices.

inline void on(void (*callback)(const ParsedAppPalOpenClosePacket& packet))

MWings.h

Arguments

TypeNameDescriptionOptionalRemarks
void (*)(ParsedAppPalOpenClosePacket&)callbackEvent handler

Return Value

None

on() <ParsedAppPalAmbPacket>

Registers a handler to process data sent from PAL app (environment sensor PAL) child devices.

inline void on(void (*callback)(const ParsedAppPalAmbPacket& packet))

MWings.h

Arguments

TypeNameDescriptionOptionalRemarks
void (*)(ParsedAppPalAmbPacket&)callbackEvent handler

Return Value

None

on() <ParsedAppPalMotPacket>

Registers a handler to process data sent from PAL app (motion sensor PAL) child devices.

inline void on(void (*callback)(const ParsedAppPalMotPacket& packet))

MWings.h

Arguments

TypeNameDescriptionOptionalRemarks
void (*)(ParsedAppPalMotPacket&)callbackEvent handler

Return Value

None

on() <ParsedAppUartAsciiPacket>

Registers a handler to process data (simple format) sent from serial communication app (A mode) child devices.

inline void on(void (*callback)(const ParsedAppUartAsciiPacket& packet))

MWings.h

Arguments

TypeNameDescriptionOptionalRemarks
void (*)(ParsedAppUartAsciiPacket&)callbackEvent handler

Return Value

None

on() <ParsedAppUartAsciiExtendedPacket>

Registers a handler to process data (extended format) sent from serial communication app (A mode) child devices.

inline void on(void (*callback)(const ParsedAppUartAsciiExtendedPacket& packet))

MWings.h

Arguments

TypeNameDescriptionOptionalRemarks
void (*)(ParsedAppUartAsciiExtendedPacket&)callbackEvent handler

Return Value

None

on() <ParsedActPacket>

Registers a handler to process data sent from act child devices.

inline void on(void (*callback)(const ParsedActPacket& packet))

MWings.h

Arguments

TypeNameDescriptionOptionalRemarks
void (*)(ParsedActPacket&)callbackEvent handler

Return Value

None

send() <uint8_t*, int, uint8_t>

Sends an arbitrary command (ModBus ASCII format) to the parent device.

inline bool send(const uint8_t* const payload,
                     const int payloadSize,
                     const uint8_t checksum)

MWings.h

Arguments

TypeNameDescriptionOptionalRemarks
uint8_t*payloadPayloadBetween : and LRC
intpayloadSizePayload size
uint8_tchecksumChecksumLRC of the payload

Return Value

TypeValueDescriptionRemarks
booltrueSuccess
falseError

send() <uint8_t*, int>

Sends an arbitrary command (ModBus ASCII format) to the parent device (checksum automatically added).

inline bool send(const uint8_t* const payload,
                     const int payloadSize)

MWings.h

Arguments

TypeNameDescriptionOptionalRemarks
uint8_t*payloadPayloadBetween : and LRC
intpayloadSizePayload size

Return Value

TypeValueDescriptionRemarks
booltrueSuccess
falseError

send() <uint8_t, uint8_t, uint8_t* int, uint8_t>

Sends an arbitrary command (ModBus ASCII format) to the parent device.

inline bool send(const uint8_t logicalId,
                     const uint8_t commandId,
                     const uint8_t* const payload,
                     const int payloadSize,
                     const uint8_t checksum)

MWings.h

Arguments

TypeNameDescriptionOptionalRemarks
uint8_tlogicalIdDestination logical device ID
uint8_tcommandIdCommand type
uint8_t*payloadPayloadBetween : and LRC
intpayloadSizePayload size
uint8_tchecksumChecksumLRC of the payload

Return Value

TypeValueDescriptionRemarks
booltrueSuccess
falseError

send() <uint8_t, uint8_t, uint8_t* int>

Sends an arbitrary command (ModBus ASCII format) to the parent device (checksum automatically added).

inline bool send(const uint8_t logicalId,
                     const uint8_t commandId,
                     const uint8_t* const payload,
                     const int payloadSize)

MWings.h

Arguments

TypeNameDescriptionOptionalRemarks
uint8_tlogicalIdDestination logical device ID
uint8_tcommandIdCommand type
uint8_t*payloadPayloadBetween : and LRC
intpayloadSizePayload size

Return Value

TypeValueDescriptionRemarks
booltrueSuccess
falseError

send() <AppTweliteCommand>

Super easy! Sends a command to operate standard app terminals to the parent device.

inline bool send(AppTweliteCommand& command)

MWings.h

Arguments

TypeNameDescriptionOptionalRemarks
AppTweliteCommandcommandCommand data

Return Value

TypeValueDescriptionRemarks
booltrueSuccess
falseError

send() <AppIoCommand>

Sends a command to operate remote control app terminals to the parent device.

inline bool send(AppIoCommand& command)

MWings.h

Arguments

TypeNameDescriptionOptionalRemarks
AppIoCommandcommandCommand data

Return Value

TypeValueDescriptionRemarks
booltrueSuccess
falseError

send() <AppPalNoticeCommand>

Sends a command to operate PAL app (notification PAL) terminals to the parent device.

inline bool send(AppPalNoticeCommand& command)

MWings.h

Arguments

TypeNameDescriptionOptionalRemarks
AppPalNoticeCommandcommandCommand data

Return Value

TypeValueDescriptionRemarks
booltrueSuccess
falseError

send() <AppPalNoticeDetailedCommand>

Sends a command (detailed format) to operate PAL app (notification PAL) terminals to the parent device.

inline bool send(AppPalNoticeDetailedCommand& command)

MWings.h

Arguments

TypeNameDescriptionOptionalRemarks
AppPalNoticeDetailedCommandcommandCommand data

Return Value

TypeValueDescriptionRemarks
booltrueSuccess
falseError

send() <AppPalNoticeEventCommand>

Sends a command (event) to operate PAL app (notification PAL) terminals to the parent device.

inline bool send(AppPalNoticeEventCommand& command)

MWings.h

Arguments

TypeNameDescriptionOptionalRemarks
AppPalNoticeEventCommandcommandCommand data

Return Value

TypeValueDescriptionRemarks
booltrueSuccess
falseError

send() <AppPalUartAsciiCommand>

Sends a command (simple format) to operate serial communication app (A mode) terminals to the parent device.

inline bool send(AppPalUartAsciiCommand& command)

MWings.h

Arguments

TypeNameDescriptionOptionalRemarks
AppPalUartAsciiCommandcommandCommand data

Return Value

TypeValueDescriptionRemarks
booltrueSuccess
falseError