new upgrade
This commit is contained in:
@@ -16,6 +16,7 @@ typedef enum {
|
||||
EVSE_EVENT_ENABLE_UPDATED,
|
||||
EVSE_EVENT_AVAILABLE_UPDATED,
|
||||
EVSE_EVENT_SESSION,
|
||||
EVSE_EVENT_ERROR_CHANGED,
|
||||
} evse_event_id_t;
|
||||
|
||||
// -----------------
|
||||
@@ -43,35 +44,41 @@ typedef enum {
|
||||
typedef struct {
|
||||
evse_session_event_type_t type; ///< STARTED / FINISHED
|
||||
|
||||
// campos básicos da sessão, em tipos simples:
|
||||
uint32_t session_id; ///< opcional, se tiveres um ID
|
||||
uint32_t duration_s; ///< duração em segundos (0 no STARTED)
|
||||
uint32_t energy_wh; ///< energia em Wh (0 no STARTED)
|
||||
uint32_t avg_power_w; ///< potência média em W (0 no STARTED)
|
||||
uint32_t session_id;
|
||||
uint32_t duration_s;
|
||||
uint32_t energy_wh;
|
||||
uint32_t avg_power_w;
|
||||
|
||||
bool is_current; ///< true se ainda estiver em curso
|
||||
bool is_current;
|
||||
} evse_session_event_data_t;
|
||||
|
||||
|
||||
// -----------------
|
||||
// Eventos de CONFIG
|
||||
// -----------------
|
||||
typedef struct {
|
||||
bool charging; // Estado de carregamento
|
||||
float hw_max_current; // Corrente máxima suportada pelo hardware
|
||||
float runtime_current; // Corrente de carregamento em uso
|
||||
int64_t timestamp_us; // Momento da atualização
|
||||
bool charging;
|
||||
float hw_max_current;
|
||||
float runtime_current;
|
||||
int64_t timestamp_us;
|
||||
} evse_config_event_data_t;
|
||||
|
||||
// Eventos simples e específicos
|
||||
typedef struct {
|
||||
bool enabled; // novo estado de enabled
|
||||
int64_t timestamp_us; // epoch micros
|
||||
bool enabled;
|
||||
int64_t timestamp_us;
|
||||
} evse_enable_event_data_t;
|
||||
|
||||
typedef struct {
|
||||
bool available; // novo estado de available
|
||||
int64_t timestamp_us; // epoch micros
|
||||
bool available;
|
||||
int64_t timestamp_us;
|
||||
} evse_available_event_data_t;
|
||||
|
||||
// -----------------
|
||||
// Eventos de ERRO
|
||||
// -----------------
|
||||
typedef struct {
|
||||
uint32_t error_bits; ///< estado atual (todos os bits de erro)
|
||||
uint32_t changed_mask; ///< bits que mudaram nesta notificação
|
||||
int64_t timestamp_us; ///< esp_timer_get_time()
|
||||
} evse_error_event_data_t;
|
||||
|
||||
#endif // EVSE_EVENTS_H
|
||||
|
||||
Reference in New Issue
Block a user