new upgrade

This commit is contained in:
2025-12-21 23:28:26 +00:00
parent 82fa194bd8
commit 023644a887
99 changed files with 7457 additions and 7079 deletions

View File

@@ -3,6 +3,7 @@
#include "esp_event.h"
#include "meter_manager.h" // Para meter_type_t
#include <stdint.h> // Para int64_t
#ifdef __cplusplus
extern "C" {
@@ -16,20 +17,27 @@ typedef enum {
METER_EVENT_DATA_READY = 0,
METER_EVENT_ERROR,
METER_EVENT_STARTED,
METER_EVENT_STOPPED
METER_EVENT_STOPPED,
METER_EVENT_CONFIG_UPDATED // Novo: configuração (grid/evse) atualizada
} meter_event_id_t;
// Estrutura de dados enviados com METER_EVENT_DATA_READY
typedef struct {
const char *source; // "GRID" ou "EVSE"
float vrms[3]; // Tensão por fase
float irms[3]; // Corrente por fase
int watt[3]; // Potência ativa por fase
float frequency; // Frequência da rede (Hz)
float power_factor; // Fator de potência
float total_energy; // Energia acumulada (kWh)
float vrms[3]; // Tensão por fase
float irms[3]; // Corrente por fase
int watt[3]; // Potência ativa por fase
float frequency; // Frequência da rede (Hz)
float power_factor; // Fator de potência
float total_energy; // Energia acumulada (kWh)
} meter_event_data_t;
// Estrutura de dados enviados com METER_EVENT_CONFIG_UPDATED
typedef struct {
meter_type_t grid_type; // Tipo de contador configurado para o GRID
meter_type_t evse_type; // Tipo de contador configurado para a EVSE
int64_t timestamp_us; // Momento da atualização (esp_timer_get_time)
} meter_config_event_t;
#ifdef __cplusplus
}