Skip to content

Commit

Permalink
OCPP201: Implement security events over the generic ocpp interface (#781
Browse files Browse the repository at this point in the history
)

Signed-off-by: Kai-Uwe Hermann <[email protected]>
  • Loading branch information
hikinggrass authored Jul 19, 2024
1 parent c2ef709 commit 131a192
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions modules/OCPP201/OCPP201.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,17 @@ void OCPP201::ready() {
this->p_ocpp_generic->publish_is_connected(is_connected);
};

callbacks.security_event_callback = [this](const ocpp::CiString<50>& event_type,
const std::optional<ocpp::CiString<255>>& tech_info) {
types::ocpp::SecurityEvent event;
event.type = event_type.get();
EVLOG_info << "Security Event in OCPP occured: " << event.type;
if (tech_info.has_value()) {
event.info = tech_info.value().get();
}
this->p_ocpp_generic->publish_security_event(event);
};

const auto sql_init_path = this->ocpp_share_path / SQL_CORE_MIGRATIONS;

std::map<int32_t, int32_t> evse_connector_structure = this->get_connector_structure();
Expand Down
2 changes: 1 addition & 1 deletion modules/OCPP201/ocpp_generic/ocppImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ bool ocppImpl::handle_restart() {
}

void ocppImpl::handle_security_event(std::string& type, std::string& info) {
// your code for cmd security_event goes here
this->mod->charge_point->on_security_event(type, info);
}

std::vector<types::ocpp::GetVariableResult>
Expand Down

0 comments on commit 131a192

Please sign in to comment.