Skip to content

Commit

Permalink
Merge pull request #3158 from mikaleppanen/6lowpan_panid_filter
Browse files Browse the repository at this point in the history
Add support for 6lowpan PAN ID filter to mbed mesh api configuration
  • Loading branch information
0xc0170 authored Oct 31, 2016
2 parents c9f9ffa + fae713e commit 8a9a246
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ An example of the configuration file:
| 6lowpan-nd-channel-mask | number [0-0x07fff800] | Channel mask, bit-mask of channels to use |
| 6lowpan-nd-channel-page | number [0, 2] | 0 for 2,4 GHz and 2 for sub-GHz radios |
| 6lowpan-nd-channel | number [0-27] | RF channel to use when `channel_mask` is not defined |
| 6lowpan-nd-panid-filter | number [0-0xffff] | Beacon PAN ID filter, 0xffff means no filtering |
| 6lowpan-nd-security-mode | "NONE" or "PSK" | To use either no security, or Pre shared network key |
| 6lowpan-nd-psk-key-id | number | PSK key id when PSK is enabled |
| 6lowpan-nd-psk-key | byte array [16] | Pre shared network key |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"6lowpan-nd-channel-mask": "(1<<12)",
"6lowpan-nd-channel-page": 0,
"6lowpan-nd-channel": 12,
"6lowpan-nd-panid-filter": "0xffff",
"6lowpan-nd-security-mode": "NONE",
"6lowpan-nd-psk-key-id": 1,
"6lowpan-nd-psk-key": "{0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,12 @@ extern "C" {
#define MBED_MESH_API_6LOWPAN_ND_SEC_LEVEL 5
#endif

#if defined MBED_CONF_MBED_MESH_API_6LOWPAN_ND_PANID_FILTER
#define MBED_MESH_API_6LOWPAN_ND_PANID_FILTER MBED_CONF_MBED_MESH_API_6LOWPAN_ND_PANID_FILTER
#else
#define MBED_MESH_API_6LOWPAN_ND_PANID_FILTER 0xffff
#endif

/* Thread configuration */
// PSKd, must be longer than 6
#ifdef YOTTA_CFG_MBED_MESH_API_THREAD_PSKD
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,10 @@ void nd_tasklet_configure_and_connect_to_network(void)
arm_nwk_6lowpan_link_nwk_id_filter_for_nwk_scan(
tasklet_data_ptr->network_interface_id, NULL);

arm_nwk_6lowpan_link_panid_filter_for_nwk_scan(
tasklet_data_ptr->network_interface_id,
MBED_MESH_API_6LOWPAN_ND_PANID_FILTER);

status = arm_nwk_interface_up(tasklet_data_ptr->network_interface_id);
if (status >= 0) {
tasklet_data_ptr->tasklet_state = TASKLET_STATE_BOOTSTRAP_STARTED;
Expand Down

0 comments on commit 8a9a246

Please sign in to comment.