fixed logging and the creating of the pre-reservation id

This commit is contained in:
gilteixeira 2023-04-21 14:15:12 +01:00
parent 9466f7e920
commit a1f3bacea5
2 changed files with 11 additions and 6 deletions

View File

@ -6,6 +6,8 @@
"string_view": "c",
"initializer_list": "c",
"nativeenumerated.h": "c",
"asn_application.h": "c"
"asn_application.h": "c",
"timestamputc.h": "c",
"availabilitystatus.h": "c"
}
}

View File

@ -104,7 +104,7 @@ static int mk_evcsnm(uint8_t *evcsnm_oer, uint32_t *evcsnm_len) {
asn_enc_rval_t enc = uper_encode_to_buffer(&asn_DEF_EvcsnPdu, NULL, evcsnm, evcsnm_oer, 512);
if (enc.encoded == -1) {
log_error("[ca] failed encoding evcsnm (%s)", enc.failed_type->name);
log_error("[ev] failed encoding evcsnm (%s)", enc.failed_type->name);
rv = 1;
goto cleanup;
}
@ -213,9 +213,12 @@ static int evrsrm_pre_reservation_response(uint8_t *evrsrm_oer, uint32_t *evrsrm
evrsr_response->messageBody.present = EV_RSR_MessageBody_PR_preReservationResponseMessage;
PreReservationResponseMessage_t response = evrsr_response->messageBody.choice.preReservationResponseMessage;
char *pre_reservation_id_s = calloc(1, sizeof(char) * 10);
sprintf(pre_reservation_id_s, "%d", pre_reservation_id);
response.preReservation_ID = *create_utf8_from_string(pre_reservation_id_s, strlen(pre_reservation_id_s));
response.preReservation_ID.buf = calloc(4, sizeof(uint8_t));
response.preReservation_ID.size = 4;
response.preReservation_ID.buf[0] = (pre_reservation_id >> 24) & 0xff;
response.preReservation_ID.buf[1] = (pre_reservation_id >> 16) & 0xff;
response.preReservation_ID.buf[2] = (pre_reservation_id >> 8) & 0xff;
response.preReservation_ID.buf[3] = pre_reservation_id & 0xff;
response.availabilityStatus = 0;
@ -227,7 +230,7 @@ static int evrsrm_pre_reservation_response(uint8_t *evrsrm_oer, uint32_t *evrsrm
response.preReservationExpirationTime = 0;
asn_enc_rval_t enc = uper_encode_to_buffer(&asn_DEF_EV_RSR, NULL, evrsr_response, evrsrm_oer, 512);
if (enc.encoded == -1) {
log_error("[ca] failed encoding evrsrm (%s)", enc.failed_type->name);
log_error("[ev] failed encoding evrsrm (%s)", enc.failed_type->name);
rv = 1;
goto cleanup;
}