From dec270f337085d4fb2aa7de740e924dfdfdb4992 Mon Sep 17 00:00:00 2001 From: emanuel Date: Wed, 21 Oct 2020 12:26:19 +0100 Subject: [PATCH] Added missing response to [itss] --- src/facilities.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/facilities.c b/src/facilities.c index d51d16f..9d2d270 100644 --- a/src/facilities.c +++ b/src/facilities.c @@ -116,7 +116,8 @@ static int facilities_request(facilities_t *facilities, uint8_t *msg, uint32_t m int code = 0; uint8_t *fdres_oer = NULL; - + asn_enc_rval_t enc; + FacilitiesDataRequest_t *fdreq = calloc(1, sizeof(FacilitiesDataRequest_t)); FacilitiesDataResult_t *fdres = calloc(1, sizeof(FacilitiesDataResult_t)); BTPDataRequest_t *bdr = calloc(1, sizeof(BTPDataRequest_t)); @@ -158,6 +159,17 @@ static int facilities_request(facilities_t *facilities, uint8_t *msg, uint32_t m goto cleanup; } + // Respond to [itss] + fdres->code = ResultCode_accepted; + fdres_oer = malloc(16); + enc = oer_encode_to_buffer(&asn_DEF_FacilitiesDataResult, NULL, fdres, fdres_oer, 16); + if (enc.encoded == -1) { + syslog_err("[facilities] failed encoding FDResult (%s)", enc.failed_type->name); + rv = 1; + goto cleanup; + } + zmq_send(facilities->responder, fdres_oer, enc.encoded, 0); + // Forward message to [transport] if (fwd) { bdr->btpType = BTPType_btpB; @@ -173,7 +185,7 @@ static int facilities_request(facilities_t *facilities, uint8_t *msg, uint32_t m // Encode ITS message into OER uint8_t bdr_oer[384]; bdr_oer[0] = 4; // [facilities] service id - asn_enc_rval_t enc = oer_encode_to_buffer(&asn_DEF_BTPDataRequest, NULL, bdr, bdr_oer + 1, 383); + enc = oer_encode_to_buffer(&asn_DEF_BTPDataRequest, NULL, bdr, bdr_oer + 1, 383); if (enc.encoded == -1) { syslog_err("[facilities] failed encoding BDR (%s)", enc.failed_type->name); rv = 1;