PCM efforts

This commit is contained in:
emanuel 2022-02-22 11:39:11 +00:00
parent 5b066efcc5
commit 73a9e0a37a
1 changed files with 6 additions and 6 deletions

View File

@ -120,7 +120,7 @@ static int pcm_check_handle_request(facilities_t* facilities, PCM_t* pcm) {
asn_enc_rval_t enc = asn_encode_to_buffer(NULL, ATS_UNALIGNED_CANONICAL_PER, &asn_DEF_PCM, pcm_rep, buf, buf_len); asn_enc_rval_t enc = asn_encode_to_buffer(NULL, ATS_UNALIGNED_CANONICAL_PER, &asn_DEF_PCM, pcm_rep, buf, buf_len);
if (enc.encoded == -1) { if (enc.encoded == -1) {
syslog_err("[facilities] [pc] PCM request encode failure"); syslog_err("[facilities] [pc] PCM.reply encode failure (%s)", enc.failed_type->name);
rv = 1; rv = 1;
goto cleanup; goto cleanup;
} }
@ -151,7 +151,7 @@ static int pcm_check_handle_request(facilities_t* facilities, PCM_t* pcm) {
buf[0] = 4; buf[0] = 4;
enc = asn_encode_to_buffer(NULL, ATS_CANONICAL_OER, &asn_DEF_TransportRequest, tr, buf+1, buf_len-1); enc = asn_encode_to_buffer(NULL, ATS_CANONICAL_OER, &asn_DEF_TransportRequest, tr, buf+1, buf_len-1);
if (enc.encoded == -1) { if (enc.encoded == -1) {
syslog_err("[facilities] [pc] TR PCM request encode failure"); syslog_err("[facilities] [pc] TR PCM.reply encode failure (%s)", enc.failed_type->name);
rv = 1; rv = 1;
goto cleanup; goto cleanup;
} }
@ -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; CoordinationReply_t* reply = &pcm->pcm.maneuverContainer.choice.vehicle.negotiation->choice.reply;
syslog_info("[facilities] [pc] received coordination reply with %d accepted trajectories", reply->acceptedTrajectoriesIds.list.count); syslog_info("[facilities] [pc] received TPM.reply with %d accepted trajectories", reply->acceptedTrajectoriesIds.list.count);
return rv; return rv;
} }
@ -295,7 +295,7 @@ static int pcm_check_intersection_detected(facilities_t* facilities, PCM_t* pcm)
buf[0] = 4; buf[0] = 4;
enc = asn_encode_to_buffer(NULL, ATS_CANONICAL_OER, &asn_DEF_TransportRequest, tr, buf+1, buf_len-1); enc = asn_encode_to_buffer(NULL, ATS_CANONICAL_OER, &asn_DEF_TransportRequest, tr, buf+1, buf_len-1);
if (enc.encoded == -1) { if (enc.encoded == -1) {
syslog_err("[facilities] [pc] TR PCM request encode failure"); syslog_err("[facilities] [pc] TR PCM.request encode failure (%s)", enc.failed_type->name);
rv = 1; rv = 1;
goto cleanup; goto cleanup;
} }
@ -395,8 +395,8 @@ int pcm_check(void* fc, PCM_t* pcm) {
} }
if (intersecting) { if (intersecting) {
syslog_info("[facilities] [pc] intersection danger with %ld @ (%d, %d) in %ld ms", syslog_info("[facilities] [pc] intersection danger with %ld @ (%f, %f) in %ld ms",
pcm->header.stationID, trajectoryA[index].latitude, trajectoryA[index].longitude, trajectoryA[index].timestamp - now); pcm->header.stationID, trajectoryA[index].latitude/1.0e7, trajectoryA[index].longitude/1.0e7, trajectoryA[index].timestamp - now);
coordination->neighbours[ni].intersecting = true; coordination->neighbours[ni].intersecting = true;
coordination->neighbours[ni].t_iid = now; coordination->neighbours[ni].t_iid = now;
pcm_check_intersection_detected(facilities, pcm); pcm_check_intersection_detected(facilities, pcm);