LSH-Core
A robust C++ framework for Arduino-based home automation nodes
Loading...
Searching...
No Matches
static_payloads.hpp
Go to the documentation of this file.
1
21#ifndef LSHCORE_COMMUNICATION_CONSTANTS_STATIC_PAYLOADS_HPP
22#define LSHCORE_COMMUNICATION_CONSTANTS_STATIC_PAYLOADS_HPP
23
24#include <etl/array.h>
25#include <stdint.h>
26
27namespace constants::payloads
28{
32 enum class StaticType : uint8_t
33 {
34 BOOT,
35 PING_
36 };
37
38 // --- BOOT ---
39 constexpr etl::array<const uint8_t, 8> JSON_BOOT_BYTES = {'{', '"', 'p', '"', ':', '4', '}', '\n'};
40 constexpr etl::array<const uint8_t, 4> MSGPACK_BOOT_BYTES = {0x81, 0xA1, 0x70, 0x04};
41
42 // --- PING ---
43 constexpr etl::array<const uint8_t, 8> JSON_PING_BYTES = {'{', '"', 'p', '"', ':', '5', '}', '\n'};
44 constexpr etl::array<const uint8_t, 4> MSGPACK_PING_BYTES = {0x81, 0xA1, 0x70, 0x05};
45} // namespace constants::payloads
46#endif // LSHCORE_COMMUNICATION_CONSTANTS_STATIC_PAYLOADS_HPP
StaticType
Defines the types of pre-serialized static payloads.
Definition static_payloads.hpp:33
constexpr etl::array< const uint8_t, 4 > MSGPACK_PING_BYTES
Pre-serialized PING payload in MsgPack format.
Definition static_payloads.hpp:44
constexpr etl::array< const uint8_t, 8 > JSON_BOOT_BYTES
Pre-serialized BOOT payload in JSON format.
Definition static_payloads.hpp:39
constexpr etl::array< const uint8_t, 8 > JSON_PING_BYTES
Pre-serialized PING payload in JSON format.
Definition static_payloads.hpp:43
constexpr etl::array< const uint8_t, 4 > MSGPACK_BOOT_BYTES
Pre-serialized BOOT payload in MsgPack format.
Definition static_payloads.hpp:40