|
LSH-Core
A robust C++ framework for Arduino-based home automation nodes
|
Provide functions to prepare and serialize Json payloads. More...
Functions | |
| void | serializeStaticJson (constants::payloads::StaticType payloadType) |
| Send a static json payload. | |
| void | serializeDetails () |
| Prepare and send json details payload (eg: {"p":1,"n":"c1","a":[1,2,...],"b":[1,3,...]}). | |
| void | serializeActuatorsState () |
| Prepare and send a JSON actuators state payload with bitpacked byte array. | |
| void | serializeNetworkClick (uint8_t clickableIndex, constants::ClickType clickType, bool confirm) |
| Prepares and sends a JSON network click payload. | |
Provide functions to prepare and serialize Json payloads.
| void Serializer::serializeActuatorsState | ( | ) |
Prepare and send a JSON actuators state payload with bitpacked byte array.
AVR-optimized packing using:
>>3 instead of /8 (~1 cycle vs ~20-50 cycles)*8)Output format: {"p":2,"s":[byte0,byte1,...]} Each byte contains 8 actuator states (bit 0 = first actuator in byte). Example: 12 actuators → {"p":2,"s":[90,15]} (2 bytes vs 12 array elements)


| void Serializer::serializeNetworkClick | ( | uint8_t | clickableIndex, |
| constants::ClickType | clickType, | ||
| bool | confirm | ||
| ) |
Prepares and sends a JSON network click payload.
Uses NETWORK_CLICK_REQUEST (p:3) for network click requests. Example request: {"p":3,"t":1,"i":7}
| clickableIndex | The index of the clickable. |
| clickType | The type of the click (long, super long). |
| confirm | Set to true to confirm the action after an ACK has been received. |


| void Serializer::serializeStaticJson | ( | constants::payloads::StaticType | payloadType | ) |
Send a static json payload.
| payloadType | type of the payload. |

