fixed grammar error and the size of the encoded evrsr cancellation and update responses
This commit is contained in:
parent
a8351242f2
commit
c770eb0a00
11
src/evm.c
11
src/evm.c
|
|
@ -168,7 +168,7 @@ int evrsrm_recv(EV_RSR_t *evrsr_request) {
|
||||||
else if (evrsr_request->messageBody.present == EV_RSR_MessageBody_PR_reservationRequestMessage)
|
else if (evrsr_request->messageBody.present == EV_RSR_MessageBody_PR_reservationRequestMessage)
|
||||||
evrsr_response = evrsrm_reservation_response(evrsr_request, bpr->data.buf, (uint32_t *)&bpr->data.size);
|
evrsr_response = evrsrm_reservation_response(evrsr_request, bpr->data.buf, (uint32_t *)&bpr->data.size);
|
||||||
else if (evrsr_request->messageBody.present == EV_RSR_MessageBody_PR_cancellationRequestMessage)
|
else if (evrsr_request->messageBody.present == EV_RSR_MessageBody_PR_cancellationRequestMessage)
|
||||||
evrsr_response = evrsrm_cancelation_response(evrsr_request, bpr->data.buf, (uint32_t *)&bpr->data.size);
|
evrsr_response = evrsrm_cancellation_response(evrsr_request, bpr->data.buf, (uint32_t *)&bpr->data.size);
|
||||||
else if (evrsr_request->messageBody.present == EV_RSR_MessageBody_PR_updateRequestMessage)
|
else if (evrsr_request->messageBody.present == EV_RSR_MessageBody_PR_updateRequestMessage)
|
||||||
evrsr_response = evrsrm_update_response(evrsr_request, bpr->data.buf, (uint32_t *)&bpr->data.size);
|
evrsr_response = evrsrm_update_response(evrsr_request, bpr->data.buf, (uint32_t *)&bpr->data.size);
|
||||||
if (evrsr_response != 0) {
|
if (evrsr_response != 0) {
|
||||||
|
|
@ -208,7 +208,7 @@ cleanup:
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int evrsrm_cancelation_response(EV_RSR_t *evrsrm_request, uint8_t *evrsrm_oer, uint32_t *evrsrm_len){
|
static int evrsrm_cancellation_response(EV_RSR_t *evrsrm_request, uint8_t *evrsrm_oer, uint32_t *evrsrm_len){
|
||||||
int rv = 0;
|
int rv = 0;
|
||||||
EV_RSR_t *evrsr_response = calloc(1, sizeof(EV_RSR_t));
|
EV_RSR_t *evrsr_response = calloc(1, sizeof(EV_RSR_t));
|
||||||
evrsr_response->header.protocolVersion = 1;
|
evrsr_response->header.protocolVersion = 1;
|
||||||
|
|
@ -218,12 +218,13 @@ static int evrsrm_cancelation_response(EV_RSR_t *evrsrm_request, uint8_t *evrsrm
|
||||||
pthread_mutex_unlock(&facilities.id.lock);
|
pthread_mutex_unlock(&facilities.id.lock);
|
||||||
evrsr_response->messageBody.present = EV_RSR_MessageBody_PR_cancellationResponseMessage;
|
evrsr_response->messageBody.present = EV_RSR_MessageBody_PR_cancellationResponseMessage;
|
||||||
CancellationResponseMessage_t *evrsr_cancellation_response = &evrsr_response->messageBody.choice.cancellationResponseMessage;
|
CancellationResponseMessage_t *evrsr_cancellation_response = &evrsr_response->messageBody.choice.cancellationResponseMessage;
|
||||||
|
|
||||||
evrsr_cancellation_response->reservation_ID = evrsrm_request->messageBody.choice.cancellationRequestMessage.reservation_ID;
|
evrsr_cancellation_response->reservation_ID = evrsrm_request->messageBody.choice.cancellationRequestMessage.reservation_ID;
|
||||||
evrsr_cancellation_response->cancellationResponseCode = CancellationResponseCode_ok;
|
evrsr_cancellation_response->cancellationResponseCode = CancellationResponseCode_ok;
|
||||||
|
|
||||||
asn_enc_rval_t enc = uper_encode_to_buffer(&asn_DEF_EV_RSR, NULL, evrsr_response, evrsrm_oer, 1023);
|
asn_enc_rval_t enc = uper_encode_to_buffer(&asn_DEF_EV_RSR, NULL, evrsr_response, evrsrm_oer, 512);
|
||||||
if (enc.encoded == -1) {
|
if (enc.encoded == -1) {
|
||||||
log_error("[ev] failed encoding evrsrm cancelation response (%s)", enc.failed_type->name);
|
log_error("[ev] failed encoding evrsrm cancellation response (%s)", enc.failed_type->name);
|
||||||
rv = 1;
|
rv = 1;
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
@ -247,7 +248,7 @@ static int evrsrm_update_response(EV_RSR_t *evrsrm_request, uint8_t *evrsrm_oer,
|
||||||
evrsr_update_response->reservation_ID = evrsrm_request->messageBody.choice.updateRequestMessage.reservation_ID;
|
evrsr_update_response->reservation_ID = evrsrm_request->messageBody.choice.updateRequestMessage.reservation_ID;
|
||||||
evrsr_update_response->updateResponseCode = UpdateResponseCode_ok;
|
evrsr_update_response->updateResponseCode = UpdateResponseCode_ok;
|
||||||
|
|
||||||
asn_enc_rval_t enc = uper_encode_to_buffer(&asn_DEF_EV_RSR, NULL, evrsr_response, evrsrm_oer, 1023);
|
asn_enc_rval_t enc = uper_encode_to_buffer(&asn_DEF_EV_RSR, NULL, evrsr_response, evrsrm_oer, 512);
|
||||||
if (enc.encoded == -1) {
|
if (enc.encoded == -1) {
|
||||||
log_error("[ev] failed encoding evrsrm update response (%s)", enc.failed_type->name);
|
log_error("[ev] failed encoding evrsrm update response (%s)", enc.failed_type->name);
|
||||||
rv = 1;
|
rv = 1;
|
||||||
|
|
|
||||||
|
|
@ -66,14 +66,14 @@ static int evrsrm_pre_reservation_response(uint8_t *evrsrm_oer, uint32_t *evrsrm
|
||||||
static int evrsrm_reservation_response(EV_RSR_t *evrsrm_request, uint8_t *evrsrm_oer, uint32_t *evrsrm_len);
|
static int evrsrm_reservation_response(EV_RSR_t *evrsrm_request, uint8_t *evrsrm_oer, uint32_t *evrsrm_len);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Creates a reservation cancelation response.
|
* @brief Creates a reservation cancellation response.
|
||||||
* @param evrsrm_oer The encoded reservation response
|
* @param evrsrm_oer The encoded reservation response
|
||||||
* @param evrsrm_len The length of the encoded reservation response
|
* @param evrsrm_len The length of the encoded reservation response
|
||||||
*
|
*
|
||||||
* @return The reservation response
|
* @return The reservation response
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static int evrsrm_cancelation_response(EV_RSR_t *evrsrm_request, uint8_t *evrsrm_oer, uint32_t *evrsrm_len);
|
static int evrsrm_cancellation_response(EV_RSR_t *evrsrm_request, uint8_t *evrsrm_oer, uint32_t *evrsrm_len);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Creates a reservation update response.
|
* @brief Creates a reservation update response.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue