Update batch schema and add ACK handling

This commit is contained in:
2026-01-31 01:53:02 +01:00
parent 8ba7675a1c
commit 8fba67fcf3
9 changed files with 305 additions and 321 deletions

View File

@@ -11,7 +11,8 @@ enum class PayloadType : uint8_t {
MeterData = 0,
TestCode = 1,
TimeSync = 2,
MeterBatch = 3
MeterBatch = 3,
Ack = 4
};
constexpr uint8_t PROTOCOL_VERSION = 1;
@@ -59,6 +60,8 @@ constexpr uint32_t OLED_AUTO_OFF_MS = 10UL * 60UL * 1000UL;
constexpr uint32_t SENDER_OLED_READ_MS = 10000;
constexpr uint32_t METER_SAMPLE_INTERVAL_MS = 1000;
constexpr uint32_t METER_SEND_INTERVAL_MS = 30000;
constexpr uint32_t BATCH_ACK_TIMEOUT_MS = 3000;
constexpr uint8_t BATCH_MAX_RETRIES = 2;
constexpr uint8_t METER_BATCH_MAX_SAMPLES = 30;
constexpr uint32_t WATCHDOG_TIMEOUT_SEC = 120;
constexpr bool ENABLE_HA_DISCOVERY = true;