Skip to content

Commit

Permalink
Merge branch 'main' into feature/PN7160TokenProv-extLib
Browse files Browse the repository at this point in the history
Signed-off-by: Christoph Burandt <[email protected]>
  • Loading branch information
cburandt committed Nov 27, 2024
2 parents a425768 + 2b9d96d commit 8d9ed54
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions modules/OCPP201/OCPP201.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -299,26 +299,6 @@ void OCPP201::init() {
}
});
}

const auto error_handler = [this](const Everest::error::Error& error) {
if (error.type == EVSE_MANAGER_INOPERATIVE_ERROR) {
// handled by specific evse_manager error handler
return;
}
const auto event_data = get_event_data(error, false, this->event_id_counter++);
this->charge_point->on_event({event_data});
};

const auto error_cleared_handler = [this](const Everest::error::Error& error) {
if (error.type == EVSE_MANAGER_INOPERATIVE_ERROR) {
// handled by specific evse_manager error handler
return;
}
const auto event_data = get_event_data(error, true, this->event_id_counter++);
this->charge_point->on_event({event_data});
};

subscribe_global_all_errors(error_handler, error_cleared_handler);
}

void OCPP201::ready() {
Expand Down Expand Up @@ -745,6 +725,26 @@ void OCPP201::ready() {
this->config.CoreDatabasePath, sql_init_path.string(), this->config.MessageLogPath,
std::make_shared<EvseSecurity>(*this->r_security), callbacks);

const auto error_handler = [this](const Everest::error::Error& error) {
if (error.type == EVSE_MANAGER_INOPERATIVE_ERROR) {
// handled by specific evse_manager error handler
return;
}
const auto event_data = get_event_data(error, false, this->event_id_counter++);
this->charge_point->on_event({event_data});
};

const auto error_cleared_handler = [this](const Everest::error::Error& error) {
if (error.type == EVSE_MANAGER_INOPERATIVE_ERROR) {
// handled by specific evse_manager error handler
return;
}
const auto event_data = get_event_data(error, true, this->event_id_counter++);
this->charge_point->on_event({event_data});
};

subscribe_global_all_errors(error_handler, error_cleared_handler);

// publish charging schedules at least once on startup
charging_schedules_callback();

Expand Down

0 comments on commit 8d9ed54

Please sign in to comment.