diff --git a/modules/EvseV2G/charger/ISO15118_chargerImpl.cpp b/modules/EvseV2G/charger/ISO15118_chargerImpl.cpp index 55d585a85..a1ca76375 100644 --- a/modules/EvseV2G/charger/ISO15118_chargerImpl.cpp +++ b/modules/EvseV2G/charger/ISO15118_chargerImpl.cpp @@ -213,7 +213,7 @@ void ISO15118_chargerImpl::handle_session_setup(std::vectormqtt_lock); - if (exi_stream_status.exi_response.has_value()) { + if (exi_stream_status.exi_response.has_value() and not exi_stream_status.exi_response.value().empty()) { v2g_ctx->evse_v2g_data.cert_install_res_b64_buffer = std::string(exi_stream_status.exi_response.value()); } v2g_ctx->evse_v2g_data.cert_install_status = diff --git a/modules/OCPP/OCPP.cpp b/modules/OCPP/OCPP.cpp index 9c6ef24e4..889758469 100644 --- a/modules/OCPP/OCPP.cpp +++ b/modules/OCPP/OCPP.cpp @@ -761,8 +761,12 @@ void OCPP::ready() { const ocpp::v201::CertificateActionEnum& certificate_action) { types::iso15118_charger::ResponseExiStreamStatus response; response.status = conversions::to_everest_iso15118_charger_status(certificate_response.status); - response.exi_response.emplace(certificate_response.exiResponse.get()); response.certificate_action = conversions::to_everest_certificate_action_enum(certificate_action); + if (not certificate_response.exiResponse.get().empty()) { + // since exi_response is an optional in the EVerest type we only set it when not empty + response.exi_response.emplace(certificate_response.exiResponse.get()); + } + this->r_evse_manager.at(this->connector_evse_index_map.at(connector_id)) ->call_set_get_certificate_response(response); }); diff --git a/modules/OCPP201/OCPP201.cpp b/modules/OCPP201/OCPP201.cpp index 1a6772577..643134bca 100644 --- a/modules/OCPP201/OCPP201.cpp +++ b/modules/OCPP201/OCPP201.cpp @@ -795,10 +795,13 @@ void OCPP201::ready() { conversions::to_ocpp_get_15118_certificate_request(certificate_request)); EVLOG_debug << "Received response from get_15118_ev_certificate_request: " << ocpp_response; // transform response, inject action, send to associated EvseManager - const auto everest_response_status = - conversions::to_everest_iso15118_charger_status(ocpp_response.status); - const types::iso15118_charger::ResponseExiStreamStatus everest_response{ - everest_response_status, certificate_request.certificate_action, ocpp_response.exiResponse}; + types::iso15118_charger::ResponseExiStreamStatus everest_response; + everest_response.status = conversions::to_everest_iso15118_charger_status(ocpp_response.status); + everest_response.certificate_action = certificate_request.certificate_action; + if (not ocpp_response.exiResponse.get().empty()) { + // since exi_response is an optional in the EVerest type we only set it when not empty + everest_response.exi_response = ocpp_response.exiResponse.get(); + } this->r_evse_manager.at(evse_id - 1)->call_set_get_certificate_response(everest_response); });