TPM reset state if in entry zone

This commit is contained in:
emanuel 2022-06-22 23:19:52 +01:00
parent aacada4135
commit 7781ffe805
1 changed files with 5 additions and 3 deletions

View File

@ -112,10 +112,12 @@ int tpm_pay(void* fc, tolling_info_t* info, void* security_socket, uint8_t* neig
switch (info->asn->tollType) { switch (info->asn->tollType) {
case TollType_entry: case TollType_entry:
if (tolling->station.obu.toll_type != -1) { if (tolling->station.obu.toll_type != -1) {
syslog_err("[facilities] [tolling] trying to issue entry.request but current tolling state is %s", syslog_err("[facilities] [tolling] trying to issue entry.request but current tolling state is %s - resetting",
tts(tolling->station.obu.toll_type)); tts(tolling->station.obu.toll_type));
rv = 1; tolling->station.obu.toll_type = -1;
goto cleanup; tolling->station.obu.active = false;
ASN_STRUCT_FREE(asn_DEF_TPM, tolling->station.obu.entry_proof);
tolling->station.obu.entry_proof = NULL;
} }
type->present = TollingType_PR_entry; type->present = TollingType_PR_entry;
type->choice.entry.present = TollingEntry_PR_request; type->choice.entry.present = TollingEntry_PR_request;