Added missing response to [itss]

This commit is contained in:
emanuel 2020-10-21 12:26:19 +01:00
parent 7136fe195c
commit dec270f337
1 changed files with 14 additions and 2 deletions

View File

@ -116,7 +116,8 @@ static int facilities_request(facilities_t *facilities, uint8_t *msg, uint32_t m
int code = 0; int code = 0;
uint8_t *fdres_oer = NULL; uint8_t *fdres_oer = NULL;
asn_enc_rval_t enc;
FacilitiesDataRequest_t *fdreq = calloc(1, sizeof(FacilitiesDataRequest_t)); FacilitiesDataRequest_t *fdreq = calloc(1, sizeof(FacilitiesDataRequest_t));
FacilitiesDataResult_t *fdres = calloc(1, sizeof(FacilitiesDataResult_t)); FacilitiesDataResult_t *fdres = calloc(1, sizeof(FacilitiesDataResult_t));
BTPDataRequest_t *bdr = calloc(1, sizeof(BTPDataRequest_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; 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] // Forward message to [transport]
if (fwd) { if (fwd) {
bdr->btpType = BTPType_btpB; 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 // Encode ITS message into OER
uint8_t bdr_oer[384]; uint8_t bdr_oer[384];
bdr_oer[0] = 4; // [facilities] service id 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) { if (enc.encoded == -1) {
syslog_err("[facilities] failed encoding BDR (%s)", enc.failed_type->name); syslog_err("[facilities] failed encoding BDR (%s)", enc.failed_type->name);
rv = 1; rv = 1;