40#ifndef CONFIG_PING_INTERVAL_MS
41static constexpr const uint16_t PING_INTERVAL_MS = 10000U;
43static_assert(CONFIG_PING_INTERVAL_MS >= 0,
"CONFIG_PING_INTERVAL_MS must be non-negative.");
44static_assert(CONFIG_PING_INTERVAL_MS < UINT16_MAX,
"CONFIG_PING_INTERVAL_MS must be below UINT16_MAX so saturated timers can pass it.");
45static constexpr const uint16_t PING_INTERVAL_MS = CONFIG_PING_INTERVAL_MS;
48#ifndef CONFIG_CONNECTION_TIMEOUT_MS
49static_assert(PING_INTERVAL_MS <= static_cast<uint16_t>(UINT16_MAX - 200U),
50 "CONFIG_PING_INTERVAL_MS is too high for the default CONFIG_CONNECTION_TIMEOUT_MS.");
51static constexpr const uint16_t CONNECTION_TIMEOUT_MS = PING_INTERVAL_MS + 200U;
53static_assert(CONFIG_CONNECTION_TIMEOUT_MS > 0,
"CONFIG_CONNECTION_TIMEOUT_MS must be greater than zero.");
54static_assert(CONFIG_CONNECTION_TIMEOUT_MS <= UINT16_MAX,
"CONFIG_CONNECTION_TIMEOUT_MS must fit in uint16_t.");
55static constexpr const uint16_t CONNECTION_TIMEOUT_MS = CONFIG_CONNECTION_TIMEOUT_MS;
58#ifndef CONFIG_BRIDGE_BOOT_RETRY_INTERVAL_MS
59static constexpr const uint16_t BRIDGE_BOOT_RETRY_INTERVAL_MS =
62static_assert(CONFIG_BRIDGE_BOOT_RETRY_INTERVAL_MS > 0,
"CONFIG_BRIDGE_BOOT_RETRY_INTERVAL_MS must be greater than zero.");
63static_assert(CONFIG_BRIDGE_BOOT_RETRY_INTERVAL_MS <= UINT16_MAX,
"CONFIG_BRIDGE_BOOT_RETRY_INTERVAL_MS must fit in uint16_t.");
64static constexpr const uint16_t BRIDGE_BOOT_RETRY_INTERVAL_MS = CONFIG_BRIDGE_BOOT_RETRY_INTERVAL_MS;
67#ifndef CONFIG_BRIDGE_AWAIT_STATE_TIMEOUT_MS
68static constexpr const uint16_t BRIDGE_AWAIT_STATE_TIMEOUT_MS =
71static_assert(CONFIG_BRIDGE_AWAIT_STATE_TIMEOUT_MS > 0,
"CONFIG_BRIDGE_AWAIT_STATE_TIMEOUT_MS must be greater than zero.");
72static_assert(CONFIG_BRIDGE_AWAIT_STATE_TIMEOUT_MS <= UINT16_MAX,
"CONFIG_BRIDGE_AWAIT_STATE_TIMEOUT_MS must fit in uint16_t.");
73static constexpr const uint16_t BRIDGE_AWAIT_STATE_TIMEOUT_MS = CONFIG_BRIDGE_AWAIT_STATE_TIMEOUT_MS;
76#ifndef CONFIG_COM_SERIAL_BAUD
77static constexpr const uint32_t COM_SERIAL_BAUD = 250000U;
79static constexpr const uint32_t COM_SERIAL_BAUD = CONFIG_COM_SERIAL_BAUD;
82#ifndef CONFIG_COM_SERIAL_TIMEOUT_MS
83static constexpr const uint8_t COM_SERIAL_TIMEOUT_MS =
86static_assert(CONFIG_COM_SERIAL_TIMEOUT_MS >= 0,
"CONFIG_COM_SERIAL_TIMEOUT_MS must be non-negative.");
87static_assert(CONFIG_COM_SERIAL_TIMEOUT_MS <= UINT8_MAX,
"CONFIG_COM_SERIAL_TIMEOUT_MS must fit in uint8_t.");
88static constexpr const uint8_t COM_SERIAL_TIMEOUT_MS =
89 CONFIG_COM_SERIAL_TIMEOUT_MS;
92#ifndef CONFIG_COM_SERIAL_MSGPACK_FRAME_IDLE_TIMEOUT_MS
93static constexpr const uint8_t COM_SERIAL_MSGPACK_FRAME_IDLE_TIMEOUT_MS =
94 COM_SERIAL_TIMEOUT_MS;
96static_assert(CONFIG_COM_SERIAL_MSGPACK_FRAME_IDLE_TIMEOUT_MS >= 0,
97 "CONFIG_COM_SERIAL_MSGPACK_FRAME_IDLE_TIMEOUT_MS must be non-negative.");
98static_assert(CONFIG_COM_SERIAL_MSGPACK_FRAME_IDLE_TIMEOUT_MS <= UINT8_MAX,
99 "CONFIG_COM_SERIAL_MSGPACK_FRAME_IDLE_TIMEOUT_MS must fit in uint8_t.");
100static constexpr const uint8_t COM_SERIAL_MSGPACK_FRAME_IDLE_TIMEOUT_MS =
101 CONFIG_COM_SERIAL_MSGPACK_FRAME_IDLE_TIMEOUT_MS;
104#ifndef CONFIG_COM_SERIAL_MAX_RX_PAYLOADS_PER_LOOP
105static constexpr const uint8_t COM_SERIAL_MAX_RX_PAYLOADS_PER_LOOP =
108static_assert(CONFIG_COM_SERIAL_MAX_RX_PAYLOADS_PER_LOOP > 0,
"CONFIG_COM_SERIAL_MAX_RX_PAYLOADS_PER_LOOP must be greater than zero.");
109static_assert(CONFIG_COM_SERIAL_MAX_RX_PAYLOADS_PER_LOOP <= UINT8_MAX,
"CONFIG_COM_SERIAL_MAX_RX_PAYLOADS_PER_LOOP must fit in uint8_t.");
110static constexpr const uint8_t COM_SERIAL_MAX_RX_PAYLOADS_PER_LOOP = CONFIG_COM_SERIAL_MAX_RX_PAYLOADS_PER_LOOP;
112static_assert(COM_SERIAL_MAX_RX_PAYLOADS_PER_LOOP > 0U,
"COM_SERIAL_MAX_RX_PAYLOADS_PER_LOOP must be greater than zero.");
114#ifndef CONFIG_COM_SERIAL_FLUSH_AFTER_SEND
116static constexpr const bool COM_SERIAL_FLUSH_AFTER_SEND =
true;
118static constexpr const bool COM_SERIAL_FLUSH_AFTER_SEND =
false;
121static constexpr const bool COM_SERIAL_FLUSH_AFTER_SEND = (CONFIG_COM_SERIAL_FLUSH_AFTER_SEND != 0);
125 CONFIG_PACKED_ACTUATOR_STATE_BYTES;
149static_assert(
RECEIVED_DOC_SIZE >= JSON_OBJECT_SIZE(4),
"RECEIVED_DOC_SIZE must fit network click responses with correlation ID.");
151#ifdef CONFIG_MSG_PACK
160constexpr uint16_t PACKED_STATE_MSGPACK_ARRAY_HEADER_SIZE =
202#ifdef CONFIG_MSG_PACK
209constexpr uint16_t MSGPACK_SERIAL_MAX_FRAME_SIZE =
static_cast<uint16_t
>(2U + (
RAW_INPUT_BUFFER_SIZE * 2U));
211static_assert(
RAW_INPUT_BUFFER_SIZE >= 13U,
"RAW_INPUT_BUFFER_SIZE must fit fixed-size network click commands in MsgPack mode.");
213static_assert(
RAW_INPUT_BUFFER_SIZE >= 31U,
"RAW_INPUT_BUFFER_SIZE must fit fixed-size click/failover commands plus null terminator.");
216#ifndef CONFIG_COM_SERIAL_MAX_RX_BYTES_PER_LOOP
217static constexpr const uint16_t COM_SERIAL_MAX_RX_BYTES_PER_LOOP =
218#ifdef CONFIG_MSG_PACK
219 MSGPACK_SERIAL_MAX_FRAME_SIZE;
224static_assert(CONFIG_COM_SERIAL_MAX_RX_BYTES_PER_LOOP > 0,
"CONFIG_COM_SERIAL_MAX_RX_BYTES_PER_LOOP must be greater than zero.");
225static_assert(CONFIG_COM_SERIAL_MAX_RX_BYTES_PER_LOOP <= UINT16_MAX,
"CONFIG_COM_SERIAL_MAX_RX_BYTES_PER_LOOP must fit in uint16_t.");
226static constexpr const uint16_t COM_SERIAL_MAX_RX_BYTES_PER_LOOP =
227 CONFIG_COM_SERIAL_MAX_RX_BYTES_PER_LOOP;
229static_assert(COM_SERIAL_MAX_RX_BYTES_PER_LOOP > 0U,
"CONFIG_COM_SERIAL_MAX_RX_BYTES_PER_LOOP must be greater than zero.");