refactor: stabilize legacy-core linking and header ownership
- Make include/ the canonical declarations for data_model/html_util/json_codec and convert dd3_legacy_core header copies to thin forwarders. - Add stable public forwarders for app_context/receiver_pipeline/sender_state_machine and update refactor smoke test to stop using ../../src includes. - Force-link dd3_legacy_core from setup() to ensure deterministic PlatformIO LDF linking across firmware envs. - Refresh docs (README, Requirements, docs/TESTS.md) to reflect current module paths and smoke-test include strategy.
This commit is contained in:
@@ -1,60 +1,3 @@
|
||||
#pragma once
|
||||
|
||||
#include <Arduino.h>
|
||||
|
||||
enum class FaultType : uint8_t {
|
||||
None = 0,
|
||||
MeterRead = 1,
|
||||
Decode = 2,
|
||||
LoraTx = 3
|
||||
};
|
||||
|
||||
enum class RxRejectReason : uint8_t {
|
||||
None = 0,
|
||||
CrcFail = 1,
|
||||
InvalidMsgKind = 2,
|
||||
LengthMismatch = 3,
|
||||
DeviceIdMismatch = 4,
|
||||
BatchIdMismatch = 5,
|
||||
UnknownSender = 6
|
||||
};
|
||||
|
||||
struct FaultCounters {
|
||||
uint32_t meter_read_fail;
|
||||
uint32_t decode_fail;
|
||||
uint32_t lora_tx_fail;
|
||||
};
|
||||
|
||||
struct MeterData {
|
||||
uint32_t ts_utc;
|
||||
uint32_t meter_seconds;
|
||||
uint16_t short_id;
|
||||
char device_id[16];
|
||||
float energy_total_kwh;
|
||||
float phase_power_w[3];
|
||||
float total_power_w;
|
||||
float battery_voltage_v;
|
||||
uint8_t battery_percent;
|
||||
bool meter_seconds_valid;
|
||||
bool valid;
|
||||
int16_t link_rssi_dbm;
|
||||
float link_snr_db;
|
||||
bool link_valid;
|
||||
uint32_t err_meter_read;
|
||||
uint32_t err_decode;
|
||||
uint32_t err_lora_tx;
|
||||
FaultType last_error;
|
||||
uint8_t rx_reject_reason;
|
||||
};
|
||||
|
||||
struct SenderStatus {
|
||||
MeterData last_data;
|
||||
uint32_t last_update_ts_utc;
|
||||
uint32_t rx_batches_total;
|
||||
uint32_t rx_batches_duplicate;
|
||||
uint32_t rx_last_duplicate_ts_utc;
|
||||
bool has_data;
|
||||
};
|
||||
|
||||
void init_device_ids(uint16_t &short_id, char *device_id, size_t device_id_len);
|
||||
const char *rx_reject_reason_text(RxRejectReason reason);
|
||||
#include "../../../include/data_model.h"
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
#pragma once
|
||||
|
||||
#include <Arduino.h>
|
||||
|
||||
String html_escape(const String &input);
|
||||
String url_encode_component(const String &input);
|
||||
bool sanitize_device_id(const String &input, String &out_device_id);
|
||||
#include "../../../include/html_util.h"
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
#pragma once
|
||||
|
||||
#include <Arduino.h>
|
||||
#include "data_model.h"
|
||||
|
||||
bool meterDataToJson(const MeterData &data, String &out_json);
|
||||
#include "../../../include/json_codec.h"
|
||||
|
||||
Reference in New Issue
Block a user