Skip to content

Commit 1d56070

Browse files
author
Jarkko Paso
authored
EU channel plan ids (FAN 1.1) supported (ARMmbed#2668)
1 parent fc4f41f commit 1d56070

File tree

2 files changed

+78
-22
lines changed

2 files changed

+78
-22
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
### Changes
1212
* PAN_TIMEOUT for medium sized network changed to 30 minutes.
13-
*
13+
* Updated EU regulatory domain to support (FAN 1.1) channel plan ids.
1414

1515
### Bug fixes
1616
*

source/6LoWPAN/ws/ws_common.c

Lines changed: 77 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,22 @@ int8_t ws_generate_channel_list(uint32_t *channel_mask, uint16_t number_of_chann
9393
ws_disable_channels_in_range(channel_mask, number_of_channels, 3, 10);
9494
}
9595
}
96+
} else if (regulatory_domain == REG_DOMAIN_EU) {
97+
if (channel_plan_id == 32) {
98+
ws_disable_channels_in_range(channel_mask, number_of_channels, 55, 56);
99+
ws_disable_channels_in_range(channel_mask, number_of_channels, 61, 63);
100+
ws_disable_channels_in_range(channel_mask, number_of_channels, 65, 66);
101+
} else if (channel_plan_id == 33) {
102+
ws_disable_channels_in_range(channel_mask, number_of_channels, 27, 28);
103+
ws_disable_channels_in_range(channel_mask, number_of_channels, 30, 33);
104+
} else if (channel_plan_id == 36) {
105+
ws_disable_channels_in_range(channel_mask, number_of_channels, 55, 56);
106+
ws_disable_channels_in_range(channel_mask, number_of_channels, 61, 63);
107+
ws_disable_channels_in_range(channel_mask, number_of_channels, 65, 66);
108+
} else if (channel_plan_id == 37) {
109+
ws_disable_channels_in_range(channel_mask, number_of_channels, 27, 28);
110+
ws_disable_channels_in_range(channel_mask, number_of_channels, 30, 33);
111+
}
96112
}
97113
return 0;
98114
}
@@ -261,20 +277,44 @@ int8_t ws_common_regulatory_domain_config(protocol_interface_info_entry_t *cur,
261277
return -1;
262278
}
263279
} else if (hopping_schdule->regulatory_domain == REG_DOMAIN_EU) {
264-
if (hopping_schdule->operating_class == 1) {
265-
hopping_schdule->ch0_freq = 8631;
266-
hopping_schdule->channel_spacing = CHANNEL_SPACING_100;
267-
} else if (hopping_schdule->operating_class == 2) {
268-
hopping_schdule->ch0_freq = 8631;
269-
hopping_schdule->channel_spacing = CHANNEL_SPACING_200;
270-
} else if (hopping_schdule->operating_class == 3) {
271-
hopping_schdule->ch0_freq = 8701;
272-
hopping_schdule->channel_spacing = CHANNEL_SPACING_100;
273-
} else if (hopping_schdule->operating_class == 4) {
274-
hopping_schdule->ch0_freq = 8702;
275-
hopping_schdule->channel_spacing = CHANNEL_SPACING_200;
280+
if (hopping_schdule->channel_plan_id == 255) {
281+
if (hopping_schdule->operating_class == 1) {
282+
hopping_schdule->ch0_freq = 8631;
283+
hopping_schdule->channel_spacing = CHANNEL_SPACING_100;
284+
} else if (hopping_schdule->operating_class == 2) {
285+
hopping_schdule->ch0_freq = 8631;
286+
hopping_schdule->channel_spacing = CHANNEL_SPACING_200;
287+
} else if (hopping_schdule->operating_class == 3) {
288+
hopping_schdule->ch0_freq = 8701;
289+
hopping_schdule->channel_spacing = CHANNEL_SPACING_100;
290+
} else if (hopping_schdule->operating_class == 4) {
291+
hopping_schdule->ch0_freq = 8702;
292+
hopping_schdule->channel_spacing = CHANNEL_SPACING_200;
293+
} else {
294+
return -1;
295+
}
276296
} else {
277-
return -1;
297+
if (hopping_schdule->channel_plan_id == 32) {
298+
hopping_schdule->ch0_freq = 8631;
299+
hopping_schdule->channel_spacing = CHANNEL_SPACING_100;
300+
} else if (hopping_schdule->channel_plan_id == 33) {
301+
hopping_schdule->ch0_freq = 8631;
302+
hopping_schdule->channel_spacing = CHANNEL_SPACING_200;
303+
} else if (hopping_schdule->channel_plan_id == 34) {
304+
hopping_schdule->ch0_freq = 8701;
305+
hopping_schdule->channel_spacing = CHANNEL_SPACING_100;
306+
} else if (hopping_schdule->channel_plan_id == 35) {
307+
hopping_schdule->ch0_freq = 8702;
308+
hopping_schdule->channel_spacing = CHANNEL_SPACING_200;
309+
} else if (hopping_schdule->channel_plan_id == 36) {
310+
hopping_schdule->ch0_freq = 8631;
311+
hopping_schdule->channel_spacing = CHANNEL_SPACING_100;
312+
} else if (hopping_schdule->channel_plan_id == 37) {
313+
hopping_schdule->ch0_freq = 8631;
314+
hopping_schdule->channel_spacing = CHANNEL_SPACING_200;
315+
} else {
316+
return -1;
317+
}
278318
}
279319
} else if (hopping_schdule->regulatory_domain == REG_DOMAIN_IN) {
280320
if (hopping_schdule->operating_class == 1) {
@@ -385,14 +425,30 @@ uint16_t ws_common_channel_number_calc(uint8_t regulatory_domain, uint8_t operat
385425
return 16;
386426
}
387427
} else if (regulatory_domain == REG_DOMAIN_EU) {
388-
if (operating_class == 1) {
389-
return 69;
390-
} else if (operating_class == 2) {
391-
return 35;
392-
} else if (operating_class == 3) {
393-
return 55;
394-
} else if (operating_class == 4) {
395-
return 27;
428+
if (channel_plan_id == 255) {
429+
if (operating_class == 1) {
430+
return 69;
431+
} else if (operating_class == 2) {
432+
return 35;
433+
} else if (operating_class == 3) {
434+
return 55;
435+
} else if (operating_class == 4) {
436+
return 27;
437+
}
438+
} else {
439+
if (channel_plan_id == 32) {
440+
return 69;
441+
} else if (channel_plan_id == 33) {
442+
return 35;
443+
} else if (channel_plan_id == 34) {
444+
return 55;
445+
} else if (channel_plan_id == 35) {
446+
return 27;
447+
} else if (channel_plan_id == 36) {
448+
return 125;
449+
} else if (channel_plan_id == 37) {
450+
return 62;
451+
}
396452
}
397453
} else if (regulatory_domain == REG_DOMAIN_IN) {
398454
if (operating_class == 1) {

0 commit comments

Comments
 (0)