new release
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include "esp_event.h"
|
||||
#include "auth_types.h"
|
||||
|
||||
ESP_EVENT_DECLARE_BASE(EVSE_EVENTS);
|
||||
|
||||
@@ -45,6 +46,7 @@ typedef struct {
|
||||
evse_session_event_type_t type; ///< STARTED / FINISHED
|
||||
|
||||
uint32_t session_id;
|
||||
char tag[AUTH_TAG_MAX_LEN];
|
||||
uint32_t duration_s;
|
||||
uint32_t energy_wh;
|
||||
uint32_t avg_power_w;
|
||||
|
||||
@@ -4,19 +4,32 @@
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include "freertos/FreeRTOS.h"
|
||||
#include "auth_types.h"
|
||||
|
||||
/**
|
||||
* @brief Charging session statistics
|
||||
*/
|
||||
typedef struct {
|
||||
TickType_t start_tick; ///< tick when session began (debug/trace)
|
||||
uint32_t duration_s; ///< total duration in seconds (tempo real)
|
||||
uint32_t energy_wh; ///< total energy consumed in Wh (tempo real)
|
||||
uint32_t avg_power_w; ///< average power in W
|
||||
bool is_current; ///< true if session still in progress
|
||||
TickType_t start_tick; ///< tick when session began (debug/trace)
|
||||
uint32_t session_id; ///< monotonically increasing session identifier
|
||||
char tag[AUTH_TAG_MAX_LEN]; ///< RFID/auth tag associated with this session, empty if none
|
||||
uint32_t duration_s; ///< total duration in seconds (tempo real)
|
||||
uint32_t energy_wh; ///< total energy consumed in Wh (tempo real)
|
||||
uint32_t avg_power_w; ///< average power in W
|
||||
bool is_current; ///< true if session still in progress
|
||||
} evse_session_t;
|
||||
|
||||
void evse_session_init(void);
|
||||
|
||||
/**
|
||||
* @brief Stores the tag that authorized the next charging session.
|
||||
*
|
||||
* The tag is copied into the session when evse_session_start() is called.
|
||||
* Passing NULL or an empty string clears the pending tag.
|
||||
*/
|
||||
void evse_session_set_authorized_tag(const char *tag);
|
||||
void evse_session_clear_authorized_tag(void);
|
||||
|
||||
void evse_session_start(void);
|
||||
void evse_session_end(void);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user