Skip to content

Commit

Permalink
feature: support 'ongoing' in din.ContractAuthenticationResponse and …
Browse files Browse the repository at this point in the history
…iso1.AuthorizationResponse
  • Loading branch information
uhi22 committed Jul 23, 2024
1 parent 2e69770 commit 0ee2d2a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/test/iso1_commandlineinterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -965,6 +965,16 @@ void encodeIso1AuthorizationResponse(void) {
init_iso1BodyType(&iso1Doc.V2G_Message.Body);
iso1Doc.V2G_Message.Body.AuthorizationRes_isUsed = 1u;
init_iso1AuthorizationResType(&iso1Doc.V2G_Message.Body.AuthorizationRes);
int isAuthenticationFinished = getIntParam(0);
/* The Iso1AuthorizationResponse has two possible results:
- Either the authorization is not necessary or successfully finished, means that e.g. the user presented a valid RFID
- Or the charger is still waiting for the users authentication. */
if(isAuthenticationFinished){
iso1Doc.V2G_Message.Body.AuthorizationRes.EVSEProcessing=iso1EVSEProcessingType_Finished;
} else {
iso1Doc.V2G_Message.Body.AuthorizationRes.EVSEProcessing=iso1EVSEProcessingType_Ongoing;
/* unclear: could be also iso1EVSEProcessingType_Ongoing_WaitingForCustomerInteraction */
}
prepareGlobalStream();
g_errn = encode_iso1ExiDocument(&global_stream1, &iso1Doc);
printGlobalStream();
Expand Down
9 changes: 9 additions & 0 deletions src/test/main_commandlineinterface.c
Original file line number Diff line number Diff line change
Expand Up @@ -1828,6 +1828,15 @@ void encodeContractAuthenticationResponse(void) {
init_dinBodyType(&dinDoc.V2G_Message.Body);
dinDoc.V2G_Message.Body.ContractAuthenticationRes_isUsed = 1u;
init_dinContractAuthenticationResType(&dinDoc.V2G_Message.Body.ContractAuthenticationRes);
int isAuthenticationFinished = getIntParam(0);
/* The ContractAuthenticationResponse has two possible results:
- Either the authorization is not necessary or successfully finished, means that e.g. the user presented a valid RFID
- Or the charger is still waiting for the users authentication. */
if(isAuthenticationFinished){
dinDoc.V2G_Message.Body.ContractAuthenticationRes.EVSEProcessing=dinEVSEProcessingType_Finished;
} else {
dinDoc.V2G_Message.Body.ContractAuthenticationRes.EVSEProcessing=dinEVSEProcessingType_Ongoing;
}
prepareGlobalStream();
g_errn = encode_dinExiDocument(&global_stream1, &dinDoc);
printGlobalStream();
Expand Down

0 comments on commit 0ee2d2a

Please sign in to comment.