Skip to content

Commit

Permalink
EvseV2G sends a ResponseCode_Failed if the auth_status is not accepted
Browse files Browse the repository at this point in the history
Signed-off-by: Sebastian Lukas <[email protected]>
  • Loading branch information
SebaLukas authored and corneliusclaussen committed Jun 11, 2024
1 parent ae92dd8 commit c0c8ab6
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions modules/EvseV2G/charger/ISO15118_chargerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,10 @@ void ISO15118_chargerImpl::handle_authorization_response(
} else if (v2g_ctx->session.iso_selected_payment_option == iso1paymentOptionType_Contract) {
v2g_ctx->session.certificate_status = certificate_status;
v2g_ctx->evse_v2g_data.evse_processing[PHASE_AUTH] = (uint8_t)iso1EVSEProcessingType_Finished;

if (authorization_status != types::authorization::AuthorizationStatus::Accepted) {
v2g_ctx->session.authorization_rejected = true;
}
}
}

Expand Down
2 changes: 2 additions & 0 deletions modules/EvseV2G/iso_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1389,6 +1389,8 @@ static enum v2g_event handle_iso_authorization(struct v2g_connection* conn) {
conn->ctx->session.auth_start_timeout = getmonotonictime();
res->ResponseCode = iso1responseCodeType_FAILED;
}
} else if (conn->ctx->session.authorization_rejected == true) {
res->ResponseCode = iso1responseCodeType_FAILED;
}

error_out:
Expand Down
1 change: 1 addition & 0 deletions modules/EvseV2G/v2g.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ struct v2g_context {
uint8_t gen_challenge[16]; // for PnC
bool verify_contract_cert_chain; // for PnC
types::authorization::CertificateStatus certificate_status; // for PnC
bool authorization_rejected; // for PnC

struct {
bool valid_crt;
Expand Down
2 changes: 2 additions & 0 deletions modules/EvseV2G/v2g_ctx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,8 @@ void v2g_ctx_init_charging_values(struct v2g_context* const ctx) {
}
memset(ctx->session.gen_challenge, 0, sizeof(ctx->session.gen_challenge));

ctx->session.authorization_rejected = false;

initialize_once = true;
}

Expand Down

0 comments on commit c0c8ab6

Please sign in to comment.