diff --git a/src/evm.c b/src/evm.c index 4c7be7e..cb6bd0b 100644 --- a/src/evm.c +++ b/src/evm.c @@ -115,7 +115,7 @@ cleanup: return rv; } -static int pre_reservation_id = 0; +static int pre_reservation_id = 1; int evrsrm_recv(EV_RSR_t *evrsr_request) { int rv = 0; @@ -180,7 +180,7 @@ int evrsrm_recv(EV_RSR_t *evrsr_request) { bpr->id = id; fmi->id = id; - asn_enc_rval_t enc = uper_encode_to_buffer(&asn_DEF_TransportRequest, NULL, tr, tr_oer + 1, 1023); + asn_enc_rval_t enc = oer_encode_to_buffer(&asn_DEF_TransportRequest, NULL, tr, tr_oer + 1, 1023); if (enc.encoded == -1) { log_error("[ev] failed encoding transport request (%s)", enc.failed_type->name); rv = 1; @@ -215,7 +215,14 @@ static int evrsrm_pre_reservation_response(uint8_t *evrsrm_oer, uint32_t *evrsrm 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->preReservation_ID.buf[0] = '0' + (pre_reservation_id >> 56) & 0xff; + response->preReservation_ID.buf[1] = '0' + (pre_reservation_id >> 48) & 0xff; + response->preReservation_ID.buf[2] = '0' + (pre_reservation_id >> 40) & 0xff; + response->preReservation_ID.buf[3] = '0' + (pre_reservation_id >> 32) & 0xff; + response->preReservation_ID.buf[4] = '0' + (pre_reservation_id >> 24) & 0xff; + response->preReservation_ID.buf[5] = '0' + (pre_reservation_id >> 16) & 0xff; + response->preReservation_ID.buf[6] = '0' + (pre_reservation_id >> 8) & 0xff; + response->preReservation_ID.buf[7] = '0' + pre_reservation_id & 0xff; response->availabilityStatus = 0;