Skip to content

Commit 5417936

Browse files
author
Jarkko Paso
authored
Merge pull request ARMmbed#1623 from ARMmbed/mergeMtoK3
Merge mto k3
2 parents ad41972 + a314db0 commit 5417936

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

nanostack/net_interface.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -996,6 +996,7 @@ extern void net_get_version_information(uint8_t *ptr);
996996
*
997997
* Note! In Thread mode parent buffer size is automatically set during Thread initialization.
998998
*
999+
* \param interface_id Network interface ID.
9991000
* \param big_packet_threshold Indicate how long packets are considered big. For Thread, must be 106 bytes.
10001001
* \param small_packets_per_child_count Number of small packets stored for each sleepy children. For Thread, must be at least 1.
10011002
* \param big_packets_total_count Total number of big packets parent can store for all sleepy children. For Thread, must be at least 1.

source/6LoWPAN/Thread/thread_bootstrap.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1668,6 +1668,23 @@ bool thread_network_data_timeout(int8_t interface_id, uint16_t msgId, bool usedA
16681668
return true;
16691669
}
16701670

1671+
if(cur->thread_info->leader_synced) {
1672+
if(usedAllRetries) {
1673+
// could not learn network data from neighbour, everyone must reregister
1674+
cur->thread_info->leader_synced = false;
1675+
thread_leader_service_network_data_changed(cur,true,true);
1676+
return false;
1677+
} else {
1678+
tr_debug("retrying as leader data not yet synced");
1679+
return true;
1680+
}
1681+
}
1682+
1683+
// if REED fails to get updated network data, it reattaches
1684+
if (thread_info(cur)->networkDataRequested && !thread_attach_active_router(cur) && usedAllRetries) {
1685+
thread_bootstrap_reset_restart(interface_id);
1686+
}
1687+
16711688
thread_info(cur)->networkDataRequested = false;
16721689
mac_data_poll_protocol_poll_mode_decrement(cur);
16731690
return false;

test/nanostack/unittest/stub/thread_leader_service_stub.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,6 @@ uint16_t thread_leader_service_child_id_from_networkdata_get(struct thread_info_
8080
void thread_leader_service_thread_partitition_generate(int8_t interface_id, bool newPartition)
8181
{
8282
}
83+
void thread_leader_service_network_data_changed(protocol_interface_info_entry_t *cur, bool force_stable_update, bool force_unstable_update)
84+
{
85+
}

0 commit comments

Comments
 (0)