LSH-Core
A robust C++ framework for Arduino-based home automation nodes
Loading...
Searching...
No Matches
serializer.hpp File Reference

Declares functions for serializing data structures into JSON or MsgPack format. More...

#include <ArduinoJson.h>
#include <stdint.h>
#include "communication/constants/static_payloads.hpp"
#include "util/constants/clicktypes.hpp"
Include dependency graph for serializer.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  Serializer
 Provide functions to prepare and serialize Json payloads.
 

Functions

void Serializer::serializeStaticJson (constants::payloads::StaticType payloadType)
 Send a static json payload.
 
void Serializer::serializeDetails ()
 Prepare and send json details payload (eg: {"p":1,"n":"c1","a":[1,2,...],"b":[1,3,...]}).
 
void Serializer::serializeActuatorsState ()
 Prepare and send a json actuators state payload (eg: {"p":2,"s":[0,1,0,1,...]}).
 
void Serializer::serializeNetworkClick (uint8_t clickableIndex, constants::ClickType clickType, bool confirm)
 Prepares and sends a JSON network click payload (e.g., {"p":3,"t":1,"i":1,"c":0}).
 

Detailed Description

Declares functions for serializing data structures into JSON or MsgPack format.

Author
Jacopo Labardi (labodj)

Copyright 2025 Jacopo Labardi

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.