
Nanostack Border Router is a generic mbed border router implementation that provides the 6LoWPAN ND or Thread border router initialization logic.
Revision 37:465118eec099, committed 2017-10-09
- Comitter:
- mbed_official
- Date:
- Mon Oct 09 10:45:42 2017 +0100
- Parent:
- 36:a914cfe663a8
- Child:
- 38:79d4737edea8
- Commit message:
- Updating mbed-os to mbed-os-5.6.2
.
Commit copied from https://github.com/ARMmbed/nanostack-border-router
Changed in this revision
mbed-os.lib | Show annotated file Show diff for this revision Revisions of this file |
source/borderrouter_tasklet.c | Show annotated file Show diff for this revision Revisions of this file |
--- a/mbed-os.lib Fri Oct 06 03:00:48 2017 +0100 +++ b/mbed-os.lib Mon Oct 09 10:45:42 2017 +0100 @@ -1,1 +1,1 @@ -https://github.com/ARMmbed/mbed-os/#cc7556a92fb9320f4bebb190c6e1315af116c50c +https://github.com/ARMmbed/mbed-os/#6e0d01cd13e8aca7bf4d697c3699ec9225386881
--- a/source/borderrouter_tasklet.c Fri Oct 06 03:00:48 2017 +0100 +++ b/source/borderrouter_tasklet.c Mon Oct 09 10:45:42 2017 +0100 @@ -117,11 +117,12 @@ void border_router_tasklet_start(void) { - load_config(); net_init_core(); /* initialize Radio module*/ net_6lowpan_id = rf_interface_init(); + load_config(); + protocol_stats_start(&nwk_stats); eventOS_event_handler_create( @@ -211,9 +212,14 @@ /* generate DODAG ID */ memcpy(rpl_setup_info.DODAG_ID, nd_prefix, 8); - memcpy(&rpl_setup_info.DODAG_ID[8], gp16_address_suffix, 6); - rpl_setup_info.DODAG_ID[14] = (br.mac_short_adr >> 8); - rpl_setup_info.DODAG_ID[15] = br.mac_short_adr; + if (br.mac_short_adr < 0xfffe) { + memcpy(&rpl_setup_info.DODAG_ID[8], gp16_address_suffix, 6); + rpl_setup_info.DODAG_ID[14] = (br.mac_short_adr >> 8); + rpl_setup_info.DODAG_ID[15] = br.mac_short_adr; + } else { + rf_read_mac_address(&rpl_setup_info.DODAG_ID[8]); + rpl_setup_info.DODAG_ID[8] ^= 2; + } /* DODAG configuration */ dodag_config.DAG_DIO_INT_DOUB = cfg_int(global_config, "RPL_IDOUBLINGS", 12);