response is now just a pointer
This commit is contained in:
parent
2d793a334a
commit
6a7af33656
22
src/evm.c
22
src/evm.c
|
|
@ -212,19 +212,20 @@ static int evrsrm_pre_reservation_response(uint8_t *evrsrm_oer, uint32_t *evrsrm
|
|||
pthread_mutex_unlock(&facilities.id.lock);
|
||||
evrsr_response->messageBody.present = EV_RSR_MessageBody_PR_preReservationResponseMessage;
|
||||
|
||||
PreReservationResponseMessage_t response = evrsr_response->messageBody.choice.preReservationResponseMessage;
|
||||
response.preReservation_ID.buf = calloc(8, sizeof(uint8_t));
|
||||
response.preReservation_ID.size = 8;
|
||||
*(uint64_t *)response.preReservation_ID.buf = pre_reservation_id;
|
||||
PreReservationResponseMessage_t* response = &evrsr_response->messageBody.choice.preReservationResponseMessage;
|
||||
response->preReservation_ID.buf = calloc(8, sizeof(uint8_t));
|
||||
response->preReservation_ID.size = 8;
|
||||
*(int64_t*) response->preReservation_ID.buf = pre_reservation_id;
|
||||
|
||||
response.availabilityStatus = 0;
|
||||
|
||||
response.supportedPaymentTypes.buf = calloc(1, sizeof(uint8_t));
|
||||
response.supportedPaymentTypes.bits_unused = 0;
|
||||
response.supportedPaymentTypes.size = 1;
|
||||
response.supportedPaymentTypes.buf[0] = 0x00;
|
||||
response->availabilityStatus = 0;
|
||||
|
||||
response.preReservationExpirationTime = 0;
|
||||
response->supportedPaymentTypes.buf = calloc(1, sizeof(uint8_t));
|
||||
response->supportedPaymentTypes.bits_unused = 0;
|
||||
response->supportedPaymentTypes.size = 1;
|
||||
response->supportedPaymentTypes.buf[0] = 0x00;
|
||||
|
||||
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("[ev] failed encoding evrsrm (%s)", enc.failed_type->name);
|
||||
|
|
@ -233,6 +234,7 @@ static int evrsrm_pre_reservation_response(uint8_t *evrsrm_oer, uint32_t *evrsrm
|
|||
}
|
||||
*evrsrm_len = (enc.encoded + 7) / 8;
|
||||
pre_reservation_id++;
|
||||
|
||||
cleanup:
|
||||
ASN_STRUCT_FREE(asn_DEF_EV_RSR, evrsr_response);
|
||||
return rv;
|
||||
|
|
|
|||
Loading…
Reference in New Issue