diff --git a/src/vcm.c b/src/vcm.c index 739ad43..ed5e53e 100644 --- a/src/vcm.c +++ b/src/vcm.c @@ -444,10 +444,10 @@ static int intersection_detected(VCM_t* vcm, mc_neighbour_s* neighbour) { neighbour->intersecting = true; neighbour->t_iid = now_us; - uint32_t intneigh[15]; + uint32_t intneigh[MC_AFF_STATIONS_N_MAX]; intneigh[0] = neighbour->station_id; int n_intneigh = 1; - for (int n = 0; n < coordination->neighbours_len && n_intneigh < 15; ++n) { + for (int n = 0; n < coordination->neighbours_len && n_intneigh < MC_AFF_STATIONS_N_MAX; ++n) { if (coordination->neighbours[n].station_id == neighbour->station_id) { continue; } @@ -685,6 +685,7 @@ int vcm_check(VCM_t* vcm) { now < neighbour->t_proposal + MC_RESOLUTION_TIMEOUT /* issued reply */ ) { /* in maneuver */ log_debug("[coordination] ignoring VCM - currently in maneuver"); + // TODO dont ignore-> reject } else { /* not in maneuver OR timeout reached */ if (coordination->session.req) { /* clear previous request if exists */ diff --git a/src/vcm.h b/src/vcm.h index 773dcac..4bde28f 100644 --- a/src/vcm.h +++ b/src/vcm.h @@ -9,7 +9,7 @@ #define MC_MAX_NEIGHBOURS 256 #define MC_RESOLUTION_TIMEOUT 500 #define MC_TRAJECTORIES_N_MAX 4 -#define MC_AFF_STATIONS_N_MAX 15 +#define MC_AFF_STATIONS_N_MAX 7 #define MC_HASH_LINK_LEN 32 typedef struct {