LSH-Core
Deterministic firmware core for Controllino-based Labo Smart Home nodes
 
Loading...
Searching...
No Matches
protocol.hpp File Reference

Defines the communication protocol contract (JSON keys and 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::core::protocol::Command : uint8_t {
  DEVICE_DETAILS = 1 , ACTUATORS_STATE = 2 , NETWORK_CLICK_REQUEST = 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 ,
  NETWORK_CLICK_CONFIRM = 17 , SYSTEM_REBOOT = 254 , SYSTEM_RESET = 255
}
 Valid command types for the 'p' (payload) key. More...
 
enum class  lsh::core::protocol::ProtocolClickType : uint8_t { LONG = 1 , SUPER_LONG = 2 }
 Valid click types for the 't' (type) key.
 

Variables

constexpr uint32_t lsh::core::protocol::SPEC_REVISION = 2026050101U
 Metadata-only revision, never transmitted on wire.
 
constexpr uint8_t lsh::core::protocol::WIRE_PROTOCOL_MAJOR = 3U
 Handshake-only protocol major, transmitted only in DEVICE_DETAILS.
 
constexpr char lsh::core::protocol::KEY_PAYLOAD [] = "p"
 
constexpr char lsh::core::protocol::KEY_PROTOCOL_MAJOR [] = "v"
 
constexpr char lsh::core::protocol::KEY_NAME [] = "n"
 
constexpr char lsh::core::protocol::KEY_ACTUATORS_ARRAY [] = "a"
 
constexpr char lsh::core::protocol::KEY_BUTTONS_ARRAY [] = "b"
 
constexpr char lsh::core::protocol::KEY_CORRELATION_ID [] = "c"
 
constexpr char lsh::core::protocol::KEY_ID [] = "i"
 
constexpr char lsh::core::protocol::KEY_STATE [] = "s"
 
constexpr char lsh::core::protocol::KEY_TYPE [] = "t"
 

Detailed Description

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

Author
Jacopo Labardi (labodj)
Note
Do not edit manually. Run tools/generate_lsh_protocol.py instead.

Copyright 2026 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.

Enumeration Type Documentation

◆ Command

enum class lsh::core::protocol::Command : uint8_t
strong

Valid command types for the 'p' (payload) key.

Enumerator
DEVICE_DETAILS 

Device details payload with handshake-only protocol major used for wire compatibility checks.

ACTUATORS_STATE 

Bitpacked actuator state payload.

NETWORK_CLICK_REQUEST 

Network click request with correlation ID.

BOOT 

Controller boot notification and re-sync trigger. Does not carry version metadata.

PING_ 

Ping or heartbeat payload.

REQUEST_DETAILS 

Request device details.

REQUEST_STATE 

Request current state.

SET_STATE 

Set all actuators.

SET_SINGLE_ACTUATOR 

Set a single actuator.

NETWORK_CLICK_ACK 

Acknowledge a network click with correlation ID.

FAILOVER 

General failover signal.

FAILOVER_CLICK 

Failover for a specific click with correlation ID.

NETWORK_CLICK_CONFIRM 

Confirm a network click after ACK using the same correlation ID.

SYSTEM_REBOOT 

Bridge system reboot command.

SYSTEM_RESET 

Bridge system reset command.