Use protocol constants for ACK airtime window sizing
This commit is contained in:
@@ -5,6 +5,14 @@
|
||||
#include "data_model.h"
|
||||
|
||||
constexpr size_t LORA_MAX_PAYLOAD = 230;
|
||||
constexpr size_t LORA_FRAME_HEADER_LEN = 3; // msg_kind + dev_id_short
|
||||
constexpr size_t LORA_FRAME_CRC_LEN = 2;
|
||||
constexpr size_t LORA_ACK_DOWN_PAYLOAD_LEN = 7; // flags(1) + batch_id(2) + epoch_utc(4)
|
||||
static_assert(LORA_ACK_DOWN_PAYLOAD_LEN == 7, "ACK_DOWN payload must remain 7 bytes");
|
||||
|
||||
constexpr size_t lora_frame_size(size_t payload_len) {
|
||||
return LORA_FRAME_HEADER_LEN + payload_len + LORA_FRAME_CRC_LEN;
|
||||
}
|
||||
|
||||
enum class LoraMsgKind : uint8_t {
|
||||
BatchUp = 0,
|
||||
|
||||
Reference in New Issue
Block a user