Skip to content

Commit 6ba8068

Browse files
author
Seppo Takalo
committed
Allow mesh-api to configure routing.
1 parent bf8d821 commit 6ba8068

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Currently, 6LoWPAN-ND (neighbour discovery) and Thread bootstrap modes are suppo
1010

1111
## Module Configuration
1212

13-
This module supports static configuration via **mbed configuration system** by using the `mbed_app.json` file. The application needs to create the configuration file if it wants to use other than default settings.
13+
This module supports static configuration via **mbed configuration system** by using the `mbed_app.json` file. The application needs to create the configuration file if it wants to use other than default settings.
1414

1515
An example of the configuration file:
1616

@@ -58,7 +58,7 @@ An example of the configuration file:
5858
| 6lowpan-nd-psk-key-id | number | PSK key id when PSK is enabled |
5959
| 6lowpan-nd-psk-key | byte array [16] | Pre shared network key |
6060
| 6lowpan-nd-sec-level | number [1-7] | Network security level. Use default `5` |
61-
61+
| 6lowpan-nd-device-type | "NET_6LOWPAN_ROUTER" or "NET_6LOWPAN_HOST" | Device mode. Router is routing packets from other device, creating a mesh network. |
6262

6363
## Usage notes
6464

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"6lowpan-nd-psk-key-id": 1,
1010
"6lowpan-nd-psk-key": "{0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf}",
1111
"6lowpan-nd-sec-level": 5,
12+
"6lowpan-nd-device-type": "NET_6LOWPAN_ROUTER",
1213
"thread-pskd": "\"Secret password\"",
1314
"thread-config-channel-mask": "0x7fff800",
1415
"thread-config-channel-page": 0,

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -370,8 +370,7 @@ int8_t nd_tasklet_connect(mesh_interface_cb callback, int8_t nwk_interface_id)
370370
tasklet_data_ptr->network_interface_id = nwk_interface_id;
371371
tasklet_data_ptr->tasklet_state = TASKLET_STATE_INITIALIZED;
372372

373-
//TODO: Fetch these values from device config api
374-
tasklet_data_ptr->mode = NET_6LOWPAN_ROUTER;
373+
tasklet_data_ptr->mode = MBED_CONF_MBED_MESH_API_6LOWPAN_ND_DEVICE_TYPE;
375374
tasklet_data_ptr->sec_mode = NET_SEC_MODE_NO_LINK_SECURITY;
376375
//tasklet_data_ptr->psk_sec_info.key_id = 0;
377376

0 commit comments

Comments
 (0)