From ad1d00f7c96e95e9a4060becc845e885437368cd Mon Sep 17 00:00:00 2001 From: gilteixeira Date: Sun, 23 Apr 2023 16:02:22 +0100 Subject: [PATCH] changing the order of includes to avoid warning of duplicate var def --- .vscode/settings.json | 4 +++- src/evm.c | 13 ++++++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 3c5787f..767a2af 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -11,6 +11,8 @@ "availabilitystatus.h": "c", "chargingspotlabel.h": "c", "reservation-id.h": "c", - "stationdetails.h": "c" + "stationdetails.h": "c", + "managementrequest.h": "c", + "facilities.h": "c" } } \ No newline at end of file diff --git a/src/evm.c b/src/evm.c index 7cd41b1..bd99890 100644 --- a/src/evm.c +++ b/src/evm.c @@ -1,4 +1,5 @@ #include "evm.h" +#include "facilities.h" #include #include @@ -18,7 +19,6 @@ #include #include -#include "facilities.h" static UTF8String_t *create_utf8_from_string(const char *string, size_t length) { UTF8String_t *utf8_string = calloc(1, sizeof(UTF8String_t)); @@ -215,6 +215,7 @@ static int evrsrm_reservation_response(EV_RSR_t *evrsrm_request, uint8_t *evrsrm ReservationResponseMessage_t *response = &evrsr_response->messageBody.choice.reservationResponseMessage; // Assumes the pre reservation was successful response->reservationResponseCode = ReservationResponseCode_ok; + response->reservation_ID = calloc(1, sizeof(Reservation_ID_t)); response->reservation_ID->buf = calloc(8, sizeof(uint8_t)); response->reservation_ID->size = 8; @@ -226,13 +227,14 @@ static int evrsrm_reservation_response(EV_RSR_t *evrsrm_request, uint8_t *evrsrm response->reservation_ID->buf[5] = '0' + (reservation_id / 100) % 10; response->reservation_ID->buf[6] = '0' + (reservation_id / 10) % 10; response->reservation_ID->buf[7] = '0' + reservation_id % 10; + response->reservation_Password = calloc(1, sizeof(Reservation_Password_t)); response->reservation_Password->buf = calloc(8, sizeof(uint8_t)); response->reservation_Password->size = 8; - response->reservation_Password->buf[0] = ' '; - response->reservation_Password->buf[1] = ' '; - response->reservation_Password->buf[2] = ' '; - response->reservation_Password->buf[3] = ' '; + response->reservation_Password->buf[0] = 'i'; + response->reservation_Password->buf[1] = 't'; + response->reservation_Password->buf[2] = '2'; + response->reservation_Password->buf[3] = 's'; response->reservation_Password->buf[4] = 'i'; response->reservation_Password->buf[5] = 't'; response->reservation_Password->buf[6] = '2'; @@ -248,6 +250,7 @@ static int evrsrm_reservation_response(EV_RSR_t *evrsrm_request, uint8_t *evrsrm goto cleanup; } *evrsrm_len = (enc.encoded + 7) / 8; + reservation_id++; cleanup: ASN_STRUCT_FREE(asn_DEF_EV_RSR, evrsr_response);