Fix PCM REQ/REP encoding
This commit is contained in:
parent
73a9e0a37a
commit
2e3eb8784e
15
src/pcm.c
15
src/pcm.c
|
|
@ -144,9 +144,9 @@ static int pcm_check_handle_request(facilities_t* facilities, PCM_t* pcm) {
|
|||
|
||||
bpr->gn.trafficClass = 2;
|
||||
|
||||
bpr->data.buf = malloc(512);
|
||||
memcpy(bpr->data.buf, buf, buf_len);
|
||||
bpr->data.size = (enc.encoded + 7) / 8;
|
||||
bpr->data.buf = malloc(enc.encoded);
|
||||
memcpy(bpr->data.buf, buf, enc.encoded);
|
||||
bpr->data.size = enc.encoded;
|
||||
|
||||
buf[0] = 4;
|
||||
enc = asn_encode_to_buffer(NULL, ATS_CANONICAL_OER, &asn_DEF_TransportRequest, tr, buf+1, buf_len-1);
|
||||
|
|
@ -169,7 +169,7 @@ static int pcm_check_handle_reply(facilities_t* facilities, PCM_t* pcm) {
|
|||
|
||||
CoordinationReply_t* reply = &pcm->pcm.maneuverContainer.choice.vehicle.negotiation->choice.reply;
|
||||
|
||||
syslog_info("[facilities] [pc] received TPM.reply with %d accepted trajectories", reply->acceptedTrajectoriesIds.list.count);
|
||||
syslog_info("[facilities] [pc] received PCM.reply with %d accepted trajectories", reply->acceptedTrajectoriesIds.list.count);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
|
@ -288,9 +288,9 @@ static int pcm_check_intersection_detected(facilities_t* facilities, PCM_t* pcm)
|
|||
|
||||
bpr->gn.trafficClass = 2;
|
||||
|
||||
bpr->data.buf = malloc(512);
|
||||
memcpy(bpr->data.buf, buf, buf_len);
|
||||
bpr->data.size = (enc.encoded + 7) / 8;
|
||||
bpr->data.buf = malloc(enc.encoded);
|
||||
memcpy(bpr->data.buf, buf, enc.encoded);
|
||||
bpr->data.size = enc.encoded;
|
||||
|
||||
buf[0] = 4;
|
||||
enc = asn_encode_to_buffer(NULL, ATS_CANONICAL_OER, &asn_DEF_TransportRequest, tr, buf+1, buf_len-1);
|
||||
|
|
@ -302,6 +302,7 @@ static int pcm_check_intersection_detected(facilities_t* facilities, PCM_t* pcm)
|
|||
|
||||
queue_send(facilities->tx_queue, buf, enc.encoded+1, 3);
|
||||
|
||||
|
||||
cleanup:
|
||||
ASN_STRUCT_FREE(asn_DEF_PCM, pcm_req);
|
||||
ASN_STRUCT_FREE(asn_DEF_TransportRequest, tr);
|
||||
|
|
|
|||
Loading…
Reference in New Issue