LSH-Core
Deterministic firmware core for Controllino-based Labo Smart Home nodes
 
Loading...
Searching...
No Matches
static_payloads.hpp
Go to the documentation of this file.
1
22#ifndef LSH_CORE_COMMUNICATION_CONSTANTS_STATIC_PAYLOADS_HPP
23#define LSH_CORE_COMMUNICATION_CONSTANTS_STATIC_PAYLOADS_HPP
24
25#include <stdint.h>
26#include "../../internal/etl_array.hpp"
27
28namespace constants::payloads
29{
30 enum class StaticType : uint8_t
31 {
32 BOOT,
33 PING_,
34 };
35
36 // --- BOOT ---
37 inline constexpr etl::array<uint8_t, 7> JSON_RAW_BOOT_BYTES = {'{', '"', 'p', '"', ':', '4', '}'};
38 inline constexpr etl::array<uint8_t, 8> JSON_SERIAL_BOOT_BYTES = {'{', '"', 'p', '"', ':', '4', '}', '\n'};
39 inline constexpr etl::array<uint8_t, 4> MSGPACK_RAW_BOOT_BYTES = {0x81, 0xA1, 0x70, 0x04};
40 inline constexpr etl::array<uint8_t, 6> MSGPACK_SERIAL_BOOT_BYTES = {0xC0, 0x81, 0xA1, 0x70, 0x04, 0xC0};
41
42 // --- PING ---
43 inline constexpr etl::array<uint8_t, 7> JSON_RAW_PING_BYTES = {'{', '"', 'p', '"', ':', '5', '}'};
44 inline constexpr etl::array<uint8_t, 8> JSON_SERIAL_PING_BYTES = {'{', '"', 'p', '"', ':', '5', '}', '\n'};
45 inline constexpr etl::array<uint8_t, 4> MSGPACK_RAW_PING_BYTES = {0x81, 0xA1, 0x70, 0x05};
46 inline constexpr etl::array<uint8_t, 6> MSGPACK_SERIAL_PING_BYTES = {0xC0, 0x81, 0xA1, 0x70, 0x05, 0xC0};
47
48} // namespace constants::payloads
49
50#endif // LSH_CORE_COMMUNICATION_CONSTANTS_STATIC_PAYLOADS_HPP
@ PING_
Ping or heartbeat payload.
@ BOOT
Controller boot notification and re-sync trigger. Does not carry version metadata.