Skip to content

Commit a5566b2

Browse files
author
Juha Heiskanen
committed
Channel Plan 2 validation and FAN 1.0 reject
1 parent 42dba41 commit a5566b2

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

source/6LoWPAN/ws/ws_bootstrap.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1936,6 +1936,16 @@ static bool ws_channel_plan_one_compare(ws_channel_plan_one_t *rx_plan, ws_hoppi
19361936
return true;
19371937
}
19381938

1939+
static bool ws_channel_plan_two_compare(ws_channel_plan_two_t *rx_plan, ws_hopping_schedule_t *hopping_schdule)
1940+
{
1941+
if (rx_plan->channel_plan_id != hopping_schdule->channel_plan_id) {
1942+
return false;
1943+
} else if (rx_plan->regulator_domain != hopping_schdule->regulatory_domain) {
1944+
return false;
1945+
}
1946+
return true;
1947+
}
1948+
19391949
bool ws_bootstrap_validate_channel_plan(ws_us_ie_t *ws_us, struct protocol_interface_info_entry *cur)
19401950
{
19411951
if (ws_us->channel_plan == 0) {
@@ -1946,6 +1956,15 @@ bool ws_bootstrap_validate_channel_plan(ws_us_ie_t *ws_us, struct protocol_inter
19461956
if (!ws_channel_plan_one_compare(&ws_us->plan.one, &cur->ws_info->hopping_schdule)) {
19471957
return false;
19481958
}
1959+
} else if (ws_us->channel_plan == 2) {
1960+
if (!ws_version_1_1(cur)) {
1961+
return false;
1962+
}
1963+
if (!ws_channel_plan_two_compare(&ws_us->plan.two, &cur->ws_info->hopping_schdule)) {
1964+
return false;
1965+
}
1966+
} else {
1967+
return false;
19491968
}
19501969

19511970
return true;

source/6LoWPAN/ws/ws_neighbor_class.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,8 @@ void ws_neighbor_class_neighbor_unicast_schedule_set(ws_neighbor_class_entry_t *
258258
} else if (ws_us->channel_plan == 1) {
259259
ws_neighbor->fhss_data.uc_timing_info.unicast_number_of_channels = ws_us->plan.one.number_of_channel;
260260

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

263265
//Handle excluded channel and generate activate channel list

0 commit comments

Comments
 (0)