Skip to content

Commit 8a9a246

Browse files
authored
Merge pull request #3158 from mikaleppanen/6lowpan_panid_filter
Add support for 6lowpan PAN ID filter to mbed mesh api configuration
2 parents c9f9ffa + fae713e commit 8a9a246

File tree

4 files changed

+12
-0
lines changed

4 files changed

+12
-0
lines changed

features/nanostack/FEATURE_NANOSTACK/mbed-mesh-api/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ An example of the configuration file:
5454
| 6lowpan-nd-channel-mask | number [0-0x07fff800] | Channel mask, bit-mask of channels to use |
5555
| 6lowpan-nd-channel-page | number [0, 2] | 0 for 2,4 GHz and 2 for sub-GHz radios |
5656
| 6lowpan-nd-channel | number [0-27] | RF channel to use when `channel_mask` is not defined |
57+
| 6lowpan-nd-panid-filter | number [0-0xffff] | Beacon PAN ID filter, 0xffff means no filtering |
5758
| 6lowpan-nd-security-mode | "NONE" or "PSK" | To use either no security, or Pre shared network key |
5859
| 6lowpan-nd-psk-key-id | number | PSK key id when PSK is enabled |
5960
| 6lowpan-nd-psk-key | byte array [16] | Pre shared network key |

features/nanostack/FEATURE_NANOSTACK/mbed-mesh-api/mbed_lib.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"6lowpan-nd-channel-mask": "(1<<12)",
66
"6lowpan-nd-channel-page": 0,
77
"6lowpan-nd-channel": 12,
8+
"6lowpan-nd-panid-filter": "0xffff",
89
"6lowpan-nd-security-mode": "NONE",
910
"6lowpan-nd-psk-key-id": 1,
1011
"6lowpan-nd-psk-key": "{0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf}",

features/nanostack/FEATURE_NANOSTACK/mbed-mesh-api/source/include/static_config.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,12 @@ extern "C" {
100100
#define MBED_MESH_API_6LOWPAN_ND_SEC_LEVEL 5
101101
#endif
102102

103+
#if defined MBED_CONF_MBED_MESH_API_6LOWPAN_ND_PANID_FILTER
104+
#define MBED_MESH_API_6LOWPAN_ND_PANID_FILTER MBED_CONF_MBED_MESH_API_6LOWPAN_ND_PANID_FILTER
105+
#else
106+
#define MBED_MESH_API_6LOWPAN_ND_PANID_FILTER 0xffff
107+
#endif
108+
103109
/* Thread configuration */
104110
// PSKd, must be longer than 6
105111
#ifdef YOTTA_CFG_MBED_MESH_API_THREAD_PSKD

features/nanostack/FEATURE_NANOSTACK/mbed-mesh-api/source/nd_tasklet.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,10 @@ void nd_tasklet_configure_and_connect_to_network(void)
263263
arm_nwk_6lowpan_link_nwk_id_filter_for_nwk_scan(
264264
tasklet_data_ptr->network_interface_id, NULL);
265265

266+
arm_nwk_6lowpan_link_panid_filter_for_nwk_scan(
267+
tasklet_data_ptr->network_interface_id,
268+
MBED_MESH_API_6LOWPAN_ND_PANID_FILTER);
269+
266270
status = arm_nwk_interface_up(tasklet_data_ptr->network_interface_id);
267271
if (status >= 0) {
268272
tasklet_data_ptr->tasklet_state = TASKLET_STATE_BOOTSTRAP_STARTED;

0 commit comments

Comments
 (0)