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

Defines the communication protocol contract (JSON keys, command IDs). More...

#include <stdint.h>
Include dependency graph for protocol.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Enumerations

enum class  LSH::protocol::Command : uint8_t {
  DEVICE_DETAILS = 1 , ACTUATORS_STATE = 2 , NETWORK_CLICK = 3 , BOOT = 4 ,
  PING_ = 5 , REQUEST_DETAILS = 10 , REQUEST_STATE = 11 , SET_STATE = 12 ,
  SET_SINGLE_ACTUATOR = 13 , NETWORK_CLICK_ACK = 14 , FAILOVER = 15 , FAILOVER_CLICK = 16 ,
  SYSTEM_REBOOT = 254 , SYSTEM_RESET = 255
}
 Defines the valid command types for the 'p' (payload) key in JSON messages.
 
enum class  LSH::protocol::ProtocolClickType : uint8_t { LONG = 1 , SUPER_LONG = 2 }
 Defines the valid click types for the 't' (type) key in JSON messages.
 

Variables

constexpr const char * LSH::protocol::KEY_PAYLOAD = "p"
 Payload.
 
constexpr const char * LSH::protocol::KEY_NAME = "n"
 Device Name.
 
constexpr const char * LSH::protocol::KEY_ACTUATORS_ARRAY = "a"
 Actuators IDs.
 
constexpr const char * LSH::protocol::KEY_BUTTONS_ARRAY = "b"
 Buttons IDs.
 
constexpr const char * LSH::protocol::KEY_ID = "i"
 ID.
 
constexpr const char * LSH::protocol::KEY_STATE = "s"
 Actuators State.
 
constexpr const char * LSH::protocol::KEY_TYPE = "t"
 Click Type.
 
constexpr const char * LSH::protocol::KEY_CONFIRM = "c"
 Confirm.
 

Detailed Description

Defines the communication protocol contract (JSON keys, command IDs).

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.