List of Data Types and Procedures
Structures
BarePacket
Stores raw data extracted from the packet received by the parent device from a child device.
Data
| Type | Name | Description |
|---|---|---|
uint8_t* | u8Payload | Payload data converted to binary (excluding :, checksum, and CRLF) |
uint16_t | u16PayloadSize | Byte size of the above data |
uint8_t | u8Checksum | Checksum of the above data |
Procedures
| Type and Name | Description |
|---|---|
uint8_t* u8From(int) | Gets payload data from the specified position onward |
uint8_t u8At(int) | Gets the payload data at the specified position as an 8-bit unsigned integer |
int8_t i8At(int) | Gets the payload data at the specified position as an 8-bit signed integer |
uint16_t u16At(int) | Gets the payload data at the specified position as a 16-bit unsigned integer |
int16_t i16At(int) | Gets the payload data at the specified position as a 16-bit signed integer |
uint32_t u32At(int) | Gets the payload data at the specified position as a 32-bit unsigned integer |
int32_t i32At(int) | Gets the payload data at the specified position as a 32-bit signed integer |
mwings::ParsedPacketBase
Abstract structure that stores parsed data received by the parent device from a child device.
Data
| Type | Name | Description |
|---|---|---|
uint32_t | u32SourceSerialId | Serial ID of the sender |
uint8_t | u8SourceLogicalId | Logical device ID of the sender |
uint16_t | u16SequenceNumber | Sequence number |
uint8_t | u8Lqi | LQI |
uint16_t | u16SupplyVoltage | Supply voltage (mV) |
This abstract structure defines data that is commonly used.
Structures derived from this abstract type (e.g., ParsedAppTwelitePacket) can access the data defined here.
ParsedAppTwelitePacket
Derived from mwings::ParsedPacketBase
Structure that stores data received by the parent device from a child device running the “Super Easy! Standard App”.
Data
| Type | Name | Description |
|---|---|---|
uint8_t | u8DestinationLogicalId | Logical device ID of the recipient |
uint8_t | u8RelayCount | Number of relays |
bool | bPeriodic | true if the packet is a periodic transmission |
bool[4] | bDiChanged | true if DI1–4 changed |
bool[4] | bDiState | true if DI1–4 are in Low state |
uint16_t[4] | u16AiVoltage | Input voltage of AI1–4 (mV) |
ParsedAppIoPacket
Derived from mwings::ParsedPacketBase
Structure that stores data received by the parent device from a child device running the Remote App.
Data
| Type | Name | Description |
|---|---|---|
uint8_t | u8RelayCount | Number of relays |
bool[12] | bDiState | true if each DI is in Low state |
bool[12] | bDiValid | true if each DI is valid |
bool[12] | bDiInterrupt | true if each DI has changed by interrupt |
ParsedAppAriaPacket
Derived from mwings::ParsedPacketBase
Structure that stores data received by the parent device from a child device running the Aria App (TWELITE ARIA mode).
Data
| Type | Name | Description |
|---|---|---|
uint32_t | u32RouterSerialId | Serial ID of the first relay device0x80000000 if not relayed (v1.2.2+) |
int16_t | i16Temp100x | Temperature ×100 (Celsius) |
uint16_t | u16Humid100x | Relative humidity ×100 (%) |
uint8_t | u8MagnetState | Magnet Event ID |
bool | bMagnetStateChanged | true if magnet sensor state changed |
Magnet Event ID
| ID | Description |
|---|---|
0x00 | No magnet nearby |
0x01 | North pole is nearby |
0x02 | South pole is nearby |
ParsedAppCuePacket
Derived from mwings::ParsedPacketBase
Structure that stores data received by the parent device from a child device running the Cue App (TWELITE CUE mode).
Data
| Type | Name | Description |
|---|---|---|
uint32_t | u32RouterSerialId | Serial ID of the first relay device0x80000000 if not relayed (v1.2.2+) |
int16_t[10] | i16SamplesX | X-axis acceleration samples (mG) |
int16_t[10] | i16SamplesY | Y-axis acceleration samples (mG) |
int16_t[10] | i16SamplesZ | Z-axis acceleration samples (mG) |
uint8_t | u8SampleCount | Number of samples |
bool | bHasAccelEvent | true if there is an acceleration event |
uint8_t | u8AccelEvent | Acceleration Event ID |
uint8_t | u8MagnetState | Magnet Event ID |
bool | bMagnetStateChanged | true if magnet sensor state changed |
Acceleration Event ID
| ID | Description |
|---|---|
0x01~0x06 | Dice |
0x08 | Shake |
0x10 | Move |
Magnet Event ID
| ID | Description |
|---|---|
0x00 | No magnet nearby |
0x01 | North pole is nearby |
0x02 | South pole is nearby |
ParsedAppPalAmbPacket
Derived from mwings::ParsedPacketBase
Structure that stores data received by the parent device from a child device running the Pal App (environment sensor Pal).
Data
| Type | Name | Description |
|---|---|---|
uint32_t | u32RouterSerialId | Serial ID of the first relay device0x80000000 if not relayed (v1.2.2+) |
uint16_t | u16Ai1Voltage | AI1 input voltage (mV) |
int16_t | i16Temp100x | Temperature ×100 (Celsius) |
uint16_t | u16Humid100x | Relative humidity ×100 (%) |
uint32_t | u32Illuminance | Illuminance (lux) |
ParsedAppPalMotPacket
Derived from mwings::ParsedPacketBase
Structure that stores data received by the parent device from a child device running the Pal App (motion sensor Pal).
Data
| Type | Name | Description |
|---|---|---|
uint32_t | u32RouterSerialId | Serial ID of the first relay device0x80000000 if not relayed (v1.2.2+) |
uint16_t | u16Ai1Voltage | AI1 input voltage (mV) |
int16_t[16] | i16SamplesX | X-axis acceleration samples (mG) |
int16_t[16] | i16SamplesY | Y-axis acceleration samples (mG) |
int16_t[16] | i16SamplesZ | Z-axis acceleration samples (mG) |
uint8_t | u8SampleCount | Number of samples |
uint16_t | u16SamplingFrequency | Sampling frequency (Hz) |
ParsedAppPalOpenClosePacket
Derived from mwings::ParsedPacketBase
Structure that stores data received by the parent device from a child device running the Pal App (open/close sensor Pal).
Data
| Type | Name | Description |
|---|---|---|
uint32_t | u32RouterSerialId | Serial ID of the first relay device0x80000000 if not relayed (v1.2.2+) |
uint16_t | u16Ai1Voltage | AI1 input voltage (mV) |
uint8_t | u8MagnetState | Magnet Event ID |
bool | bMagnetStateChanged | true if magnet sensor state changed |
Magnet Event ID
| ID | Description |
|---|---|
0x00 | No magnet nearby |
0x01 | North pole is nearby |
0x02 | South pole is nearby |
ParsedAppUartAsciiPacket
Derived from mwings::ParsedPacketBase
Structure that stores data received by the parent device from a child device running the serial communication app (A mode, simple format).
Data
| Type | Name | Description |
|---|---|---|
uint8_t | u8CommandId | Command type (response ID) |
uint8_t* | u8Data | Data |
uint16_t | u16DataSize | Data length |
ParsedAppUartAsciiExtendedPacket
Derived from mwings::ParsedPacketBase
Structure that stores data received by the parent device from a child device running the serial communication app (A mode, extended format).
AppUartAsciiExtendedPacketParser.h
Data
| Type | Name | Description |
|---|---|---|
uint32_t | u32DestinationSerialId | Destination serial ID |
uint8_t | u8CommandId | Command type (response ID) |
uint8_t* | u8Data | Data |
uint16_t | u16DataSize | Data length |
ParsedActPacket
Derived from mwings::ParsedPacketBase
Structure that stores data received by the parent device from a child device running the act app.
Data
| Type | Name | Description |
|---|---|---|
uint8_t | u8CommandId | Command type (response ID) |
uint8_t* | u8Data | Data |
uint16_t | u16DataSize | Data length |
mwings::CommandBase
Abstract structure that stores command data sent from the parent device to a child device.
Data
| Type | Name | Description |
|---|---|---|
uint8_t | u8DestinationLogicalId | Destination logical device ID |
Procedures
| Type and Name | Description |
|---|---|
bool isValid() | Returns true if the data is valid (pure virtual function) |
This abstract structure defines data and procedures that are commonly used.
Structures derived from this abstract type (e.g., AppTweliteCommand) can access the data and procedures defined here.
AppTweliteCommand
Derived from mwings::CommandBase
Structure that stores command data sent from the parent device to a child device running the “Super Easy! Standard App”.
Data
| Type | Name | Description |
|---|---|---|
bool[4] | bDiToChange | true to change the state of each DO1-4 |
bool[4] | bDiState | true to set each DO1-4 to Low state |
bool[4] | bPwmToChange | true to change the state of each PWM1-4 |
uint16_t[4] | u16PwmDuty | Duty ratio of each PWM1-4 (0-1024) |
AppIoCommand
Derived from mwings::CommandBase
Structure that stores command data sent from the parent device to a child device running the Remote App.
Data
| Type | Name | Description |
|---|---|---|
bool[12] | bDiToChange | true to change the state of each O1-12 |
bool[12] | bDiState | true to set each O1-12 to Low state |
AppPalNoticeCommand
Derived from mwings::CommandBase
Structure that stores command data sent from the parent device to a child device running the Pal App (Notifier Pal).
AppPalNoticeCommandSerializer.h
Data
| Type | Name | Description |
|---|---|---|
AppPalNoticeColor | eColor | Lighting color |
AppPalNoticeBlinkSpeed | eBlinkSpeed | Blinking speed |
uint8_t | u8Brightness | Brightness (0-15) |
uint16_t | u16DurationInSec | Lighting duration (seconds) |
AppPalNoticeDetailedCommand
Derived from mwings::CommandBase
Structure that stores command data sent from the parent device to a child device running the Pal App (Notifier Pal) — detailed format.
AppPalNoticeDetailedCommandSerializer.h
Data
| Type | Name | Description |
|---|---|---|
AppPalNoticeRGBWColor | sRGBWColor | Lighting color (RGBW) |
uint8_t | u8BlinkDutyPercentage | Lighting time ratio (%) |
float | fBlinkPeriodInSec | Blinking period (seconds) |
uint16_t | u16DurationInSec | Lighting duration (seconds) |
AppPalNoticeEventCommand
Derived from mwings::CommandBase
Structure that stores command data (detailed format) sent from the parent device to a child device running the Pal App (Notifier Pal).
AppPalNoticeEventCommandSerializer.h
Data
| Type | Name | Description |
|---|---|---|
uint8_t | u8EventId | Event ID (0x00-0x10) |
AppUartAsciiCommand
Derived from mwings::CommandBase
Structure that stores command data (simple format) sent from the parent device to a child device running the serial communication app (A mode).
Data
| Type | Name | Description |
|---|---|---|
uint8_t | u8CommandId | Command type (response ID) |
uint8_t* | u8Data | Data |
uint16_t | u16DataSize | Data length |
Command data represented by AppUartAsciiCommand does not require serialization.
Call Twelite.send() directly as shown below:
Twelite.send(command.u8DestinationLogicalId, command.u8CommandId,
command.u8Data, command.u16DataSize);
AppPalNoticeRGBWColor
Structure that defines the lighting color (RGBW) used in AppPalNoticeDetailedCommand.
AppPalNoticeDetailedCommandSerializer.h
Data
| Type | Name | Description |
|---|---|---|
uint8_t | red | R (0-15) |
uint8_t | green | G (0-15) |
uint8_t | blue | B (0-15) |
uint8_t | white | W (0-15) |
Procedures
| Type and Name | Description |
|---|---|
bool isValid() | Returns true if the data is valid |
uint16_t u16() | Returns a 16-bit unsigned integer with RGBW packed in order from LSB, 4 bits each |
Enumerations
AppPalNoticeColor
enum class based on uint8_t ?
Enumeration that defines the lighting color used in AppPalNoticeCommand.
AppPalNoticeCommandSerializer.h
| Identifier | Value | Description |
|---|---|---|
AppPalNoticeColor::RED | 0 | Red |
AppPalNoticeColor::GREEN | 1 | Green |
AppPalNoticeColor::BLUE | 2 | Blue |
AppPalNoticeColor::YELLOW | 3 | Yellow |
AppPalNoticeColor::PURPLE | 4 | Purple |
AppPalNoticeColor::LIGHT_BLUE | 5 | Light blue |
AppPalNoticeColor::WHITE | 6 | White |
AppPalNoticeColor::WARM_WHITE | 7 | Warm white |
AppPalNoticeBlinkSpeed
enum class based on uint8_t
Enumeration that defines the blinking speed used in AppPalNoticeCommand.
AppPalNoticeCommandSerializer.h
| Identifier | Value | Description |
|---|---|---|
AppPalNoticeBlinkSpeed::ALWAYS_ON | 0 | Always on |
AppPalNoticeBlinkSpeed::SLOW | 1 | Slow blinking |
AppPalNoticeBlinkSpeed::MEDIUM | 2 | Medium blinking |
AppPalNoticeBlinkSpeed::FAST | 3 | Fast blinking |
Other Data Types
Procedures
GetAppTweliteSerializedCommandPayloadSize()
constexpr function ?
Returns the payload size (in bytes) of the serialized fixed-length data for AppTweliteCommand.
| Type and Name | Description |
|---|---|
int GetAppTweliteSerializedCommandPayloadSize() | Returns the number of bytes |
GetAppAppPalNoticeSerializedCommandPayloadSize()
constexpr function
Returns the payload size (in bytes) of the serialized fixed-length data for AppPalNoticeCommand.
AppPalNoticeCommandSerializer.h
| Type and Name | Description |
|---|---|
int GetAppPalNoticeSerializedCommandPayloadSize() | Returns the number of bytes |
GetAppAppPalNoticeDetailedSerializedCommandPayloadSize()
constexpr function
Returns the payload size (in bytes) of the serialized fixed-length data for AppPalNoticeDetailedCommand.
AppPalNoticeDetailedCommandSerializer.h
| Type and Name | Description |
|---|---|
int GetAppPalNoticeDetailedSerializedCommandPayloadSize() | Returns the number of bytes |
GetAppAppPalNoticeEventSerializedCommandPayloadSize()
constexpr function
Returns the payload size (in bytes) of the serialized fixed-length data for AppPalNoticeEventCommand.
AppPalNoticeEventCommandSerializer.h
| Type and Name | Description |
|---|---|
int GetAppPalNoticeEventSerializedCommandPayloadSize() | Returns the number of bytes |