LSH-Core
Deterministic firmware core for Controllino-based Labo Smart Home nodes
 
Loading...
Searching...
No Matches
protocol.hpp
Go to the documentation of this file.
1
22#ifndef LSH_CORE_COMMUNICATION_CONSTANTS_PROTOCOL_HPP
23#define LSH_CORE_COMMUNICATION_CONSTANTS_PROTOCOL_HPP
24
25#include <stdint.h>
26
27namespace lsh::core
28{
29 namespace protocol
30 {
31 inline constexpr uint32_t SPEC_REVISION = 2026050101U;
32 inline constexpr uint8_t WIRE_PROTOCOL_MAJOR = 3U;
33
34 // === JSON KEYS ===
35 inline constexpr char KEY_PAYLOAD[] = "p";
36 inline constexpr char KEY_PROTOCOL_MAJOR[] = "v";
37 inline constexpr char KEY_NAME[] = "n";
38 inline constexpr char KEY_ACTUATORS_ARRAY[] = "a";
39 inline constexpr char KEY_BUTTONS_ARRAY[] = "b";
40 inline constexpr char KEY_CORRELATION_ID[] = "c";
41 inline constexpr char KEY_ID[] = "i";
42 inline constexpr char KEY_STATE[] = "s";
43 inline constexpr char KEY_TYPE[] = "t";
44
48 enum class Command : uint8_t
49 {
50 DEVICE_DETAILS = 1,
51 ACTUATORS_STATE = 2,
53 BOOT = 4,
54 PING_ = 5,
55 REQUEST_DETAILS = 10,
56 REQUEST_STATE = 11,
57 SET_STATE = 12,
60 FAILOVER = 15,
61 FAILOVER_CLICK = 16,
63 SYSTEM_REBOOT = 254,
64 SYSTEM_RESET = 255,
65 };
66
70 enum class ProtocolClickType : uint8_t
71 {
72 LONG = 1,
73 SUPER_LONG = 2,
74 };
75
76 } // namespace protocol
77} // namespace lsh::core
78
79#endif // LSH_CORE_COMMUNICATION_CONSTANTS_PROTOCOL_HPP
constexpr uint32_t SPEC_REVISION
Metadata-only revision, never transmitted on wire.
Definition protocol.hpp:31
Command
Valid command types for the 'p' (payload) key.
Definition protocol.hpp:49
@ FAILOVER_CLICK
Failover for a specific click with correlation ID.
@ SYSTEM_RESET
Bridge system reset command.
@ ACTUATORS_STATE
Bitpacked actuator state payload.
@ FAILOVER
General failover signal.
@ PING_
Ping or heartbeat payload.
@ NETWORK_CLICK_ACK
Acknowledge a network click with correlation ID.
@ SYSTEM_REBOOT
Bridge system reboot command.
@ SET_STATE
Set all actuators.
@ SET_SINGLE_ACTUATOR
Set a single actuator.
@ NETWORK_CLICK_CONFIRM
Confirm a network click after ACK using the same correlation ID.
@ NETWORK_CLICK_REQUEST
Network click request with correlation ID.
@ REQUEST_DETAILS
Request device details.
@ DEVICE_DETAILS
Device details payload with handshake-only protocol major used for wire compatibility checks.
@ BOOT
Controller boot notification and re-sync trigger. Does not carry version metadata.
@ REQUEST_STATE
Request current state.
constexpr uint8_t WIRE_PROTOCOL_MAJOR
Handshake-only protocol major, transmitted only in DEVICE_DETAILS.
Definition protocol.hpp:32
ProtocolClickType
Valid click types for the 't' (type) key.
Definition protocol.hpp:71