refact auth

This commit is contained in:
2025-06-08 10:06:28 +01:00
parent 71b6cb7878
commit 214cf1ee04
236 changed files with 466 additions and 251 deletions

View File

@@ -45,13 +45,8 @@ void evse_process(void) {
evse_error_check(pilot_voltage, is_n12v);
if (evse_get_error() == 0 && !evse_is_error_cleared()) {
// Autorização temporária se exigida
if (!authorized && evse_is_require_auth()) {
authorized = auth_grant_to >= xTaskGetTickCount();
if (auth_grant_to) auth_grant_to = 0;
} else {
authorized = true;
}
bool authorized = evse_state_get_authorized();
evse_fsm_process(
pilot_voltage,
@@ -109,7 +104,7 @@ bool evse_is_pending_auth(void) {
void evse_authorize(void) {
ESP_LOGI(TAG, "Authorize");
auth_grant_to = xTaskGetTickCount() + pdMS_TO_TICKS(60000);
evse_state_set_authorized(true);
}
void evse_set_authorized(bool value) {