Merge remote-tracking branch 'refs/remotes/origin/master'

This commit is contained in:
emanuel 2022-04-13 17:27:11 +01:00
commit 79ab400337
4 changed files with 48 additions and 37 deletions

View File

@ -560,6 +560,7 @@ static int mk_cpm(facilities_t* facilities, uint8_t *bdr_oer, uint32_t *bdr_len,
dissemination_reset_timer(facilities->dissemination, &facilities->epv, 0); dissemination_reset_timer(facilities->dissemination, &facilities->epv, 0);
} }
if (s_objectControl.u8_numberOfObjects > 0) {
cpm_tx->cpm.cpmParameters.perceivedObjectContainer = calloc(1, sizeof(PerceivedObjectContainer_t)); cpm_tx->cpm.cpmParameters.perceivedObjectContainer = calloc(1, sizeof(PerceivedObjectContainer_t));
cpm_tx->cpm.cpmParameters.perceivedObjectContainer->list.array = calloc(s_objectControl.u8_numberOfObjects,sizeof(PerceivedObject_t*)); cpm_tx->cpm.cpmParameters.perceivedObjectContainer->list.array = calloc(s_objectControl.u8_numberOfObjects,sizeof(PerceivedObject_t*));
@ -603,6 +604,7 @@ static int mk_cpm(facilities_t* facilities, uint8_t *bdr_oer, uint32_t *bdr_len,
cpm_tx->cpm.cpmParameters.numberOfPerceivedObjects = cpm_tx->cpm.cpmParameters.perceivedObjectContainer->list.count; // Object perceived by the Radar (Does not have to match the objects included in the CPM) cpm_tx->cpm.cpmParameters.numberOfPerceivedObjects = cpm_tx->cpm.cpmParameters.perceivedObjectContainer->list.count; // Object perceived by the Radar (Does not have to match the objects included in the CPM)
cpm_tx->cpm.cpmParameters.perceivedObjectContainer->list.count = j; // The number of objects that were included in the CPM cpm_tx->cpm.cpmParameters.perceivedObjectContainer->list.count = j; // The number of objects that were included in the CPM
cpm_tx->cpm.cpmParameters.perceivedObjectContainer->list.size = j; cpm_tx->cpm.cpmParameters.perceivedObjectContainer->list.size = j;
}
cpm_tx->cpm.cpmParameters.numberOfPerceivedObjects = j; cpm_tx->cpm.cpmParameters.numberOfPerceivedObjects = j;

View File

@ -225,11 +225,15 @@ static int transport_indication(facilities_t *facilities, void* responder, void*
break; break;
case 7011: case 7011:
if (facilities->tolling.active) {
tpm_recv(facilities, its_msg, neighbour_cert); tpm_recv(facilities, its_msg, neighbour_cert);
}
break; break;
case 2043: case 2043:
if (facilities->coordination.active) {
pcm_check(facilities, its_msg); pcm_check(facilities, its_msg);
}
fwd = true; fwd = true;
break; break;

View File

@ -35,7 +35,7 @@ static int are_vehicles_intersecting(
// B2[1] = tB[b+1].longitude; // B2[1] = tB[b+1].longitude;
// if (it2s_tender_do_segments_intersect(A1, A2, B1, B2)) { // if (it2s_tender_do_segments_intersect(A1, A2, B1, B2)) {
if (it2s_tender_is_inside_rectangle(tA[a].latitude, tA[a].longitude, tB[b].latitude, tB[b].longitude, 8, 8, 0, DCM_HAVERSINE)) { if (it2s_tender_is_inside_circle(tA[a].latitude, tA[a].longitude, tB[b].latitude, tB[b].longitude, 8, DCM_HAVERSINE)) {
if (tA[a].timestamp < tB[b].timestamp + 2000 && if (tA[a].timestamp < tB[b].timestamp + 2000 &&
tA[a].timestamp > tB[b].timestamp - 2000) { tA[a].timestamp > tB[b].timestamp - 2000) {
*index = a; *index = a;
@ -219,7 +219,12 @@ static int pcm_check_handle_reply(facilities_t* facilities, PCM_t* pcm, mc_neigh
uint64_t now_us = it2s_tender_get_now(TIME_MICROSECONDS); uint64_t now_us = it2s_tender_get_now(TIME_MICROSECONDS);
pthread_mutex_unlock(&facilities->epv.time.lock); pthread_mutex_unlock(&facilities->epv.time.lock);
if (neighbour->intersecting) {
syslog_info("[facilities] [pc] received PCM.reply with %d accepted trajectories | took %ld us", reply->acceptedTrajectoriesIds.list.count, now_us-neighbour->t_iid); syslog_info("[facilities] [pc] received PCM.reply with %d accepted trajectories | took %ld us", reply->acceptedTrajectoriesIds.list.count, now_us-neighbour->t_iid);
} else {
syslog_info("[facilities] [pc] received PCM.reply is response to another ITS-S PCM.request");
}
neighbour->intersecting = false; neighbour->intersecting = false;
neighbour->proposed = false; neighbour->proposed = false;

View File

@ -244,7 +244,7 @@ int mk_saem(facilities_t* facilities, uint8_t* b_saem, uint32_t* b_saem_len) {
exts->list.array[3]->present = ServiceInfoExt_PR_applicationDataSAM; exts->list.array[3]->present = ServiceInfoExt_PR_applicationDataSAM;
exts->list.array[3]->choice.applicationDataSAM.buf = malloc(1024); exts->list.array[3]->choice.applicationDataSAM.buf = malloc(1024);
enc = uper_encode_to_buffer(&asn_DEF_TollingPaymentInfo, NULL, facilities->tolling.infos.z[0], exts->list.array[3]->choice.applicationDataSAM.buf, 1024); enc = uper_encode_to_buffer(&asn_DEF_TollingPaymentInfo, NULL, facilities->tolling.infos.z[0]->asn, exts->list.array[3]->choice.applicationDataSAM.buf, 1024);
if (enc.encoded == -1) { if (enc.encoded == -1) {
syslog_err("[facilities] [sa] failure to encode TollingPaymentInfo (%s)", enc.failed_type->name); syslog_err("[facilities] [sa] failure to encode TollingPaymentInfo (%s)", enc.failed_type->name);
rv = 1; rv = 1;