Skip to content

Commit

Permalink
Channel Plan 2 validation and FAN 1.0 reject
Browse files Browse the repository at this point in the history
  • Loading branch information
Juha Heiskanen committed Aug 19, 2021
1 parent 42dba41 commit a5566b2
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
19 changes: 19 additions & 0 deletions source/6LoWPAN/ws/ws_bootstrap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1936,6 +1936,16 @@ static bool ws_channel_plan_one_compare(ws_channel_plan_one_t *rx_plan, ws_hoppi
return true;
}

static bool ws_channel_plan_two_compare(ws_channel_plan_two_t *rx_plan, ws_hopping_schedule_t *hopping_schdule)
{
if (rx_plan->channel_plan_id != hopping_schdule->channel_plan_id) {
return false;
} else if (rx_plan->regulator_domain != hopping_schdule->regulatory_domain) {
return false;
}
return true;
}

bool ws_bootstrap_validate_channel_plan(ws_us_ie_t *ws_us, struct protocol_interface_info_entry *cur)
{
if (ws_us->channel_plan == 0) {
Expand All @@ -1946,6 +1956,15 @@ bool ws_bootstrap_validate_channel_plan(ws_us_ie_t *ws_us, struct protocol_inter
if (!ws_channel_plan_one_compare(&ws_us->plan.one, &cur->ws_info->hopping_schdule)) {
return false;
}
} else if (ws_us->channel_plan == 2) {
if (!ws_version_1_1(cur)) {
return false;
}
if (!ws_channel_plan_two_compare(&ws_us->plan.two, &cur->ws_info->hopping_schdule)) {
return false;
}
} else {
return false;
}

return true;
Expand Down
2 changes: 2 additions & 0 deletions source/6LoWPAN/ws/ws_neighbor_class.c
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,8 @@ void ws_neighbor_class_neighbor_unicast_schedule_set(ws_neighbor_class_entry_t *
} else if (ws_us->channel_plan == 1) {
ws_neighbor->fhss_data.uc_timing_info.unicast_number_of_channels = ws_us->plan.one.number_of_channel;

} else if (ws_us->channel_plan == 2) {
//TODO add Channel plan 2 channel count function call here
}

//Handle excluded channel and generate activate channel list
Expand Down

0 comments on commit a5566b2

Please sign in to comment.