25 lines
470 B
C
25 lines
470 B
C
#pragma once
|
|
|
|
#include <Arduino.h>
|
|
|
|
struct MeterData {
|
|
uint32_t ts_utc;
|
|
uint16_t short_id;
|
|
char device_id[16];
|
|
float energy_total_kwh;
|
|
float phase_power_w[3];
|
|
float total_power_w;
|
|
float phase_voltage_v[3];
|
|
float battery_voltage_v;
|
|
uint8_t battery_percent;
|
|
bool valid;
|
|
};
|
|
|
|
struct SenderStatus {
|
|
MeterData last_data;
|
|
uint32_t last_update_ts_utc;
|
|
bool has_data;
|
|
};
|
|
|
|
void init_device_ids(uint16_t &short_id, char *device_id, size_t device_id_len);
|