Skip to content

Commit 399f02f

Browse files
Additional time for distribution of dataset added (ARMmbed#1892)
This reduces the possibility of routers changing state before distributing updated settings.
1 parent dde9e61 commit 399f02f

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

source/6LoWPAN/Thread/thread_joiner_application.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
#include "thread_management_if.h"
5555
#include "thread_common.h"
5656
#include "thread_bootstrap.h"
57+
#include "thread_router_bootstrap.h"
5758
#include "thread_network_synch.h"
5859
#include "thread_network_data_lib.h"
5960
#include "thread_joiner_application.h"
@@ -1922,6 +1923,8 @@ int thread_joiner_application_update_configuration(uint8_t interface_id, uint8_t
19221923
}
19231924
thread_meshcop_tlv_data_get_uint64(msg_ptr, msg_len, MESHCOP_TLV_ACTIVE_TIME_STAMP, &this->active_configuration_ptr->timestamp);
19241925
link_configuration_update(this->configuration_ptr,msg_ptr,msg_len);
1926+
// allow 5 seconds delay before state change for data response propagation
1927+
thread_router_bootstrap_delay_reed_jitter(interface_id, 5);
19251928
ns_dyn_mem_free(configuration_ptr);
19261929
thread_joiner_application_configuration_nvm_save(interface_id);
19271930

source/6LoWPAN/Thread/thread_router_bootstrap.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2782,4 +2782,18 @@ void thread_router_bootstrap_address_change_notify_send(protocol_interface_info_
27822782
thread_info(cur)->proactive_an_timer = THREAD_PROACTIVE_AN_SEND_DELAY;
27832783
}
27842784

2785+
void thread_router_bootstrap_delay_reed_jitter(int8_t interface_id, uint16_t delay)
2786+
{
2787+
protocol_interface_info_entry_t *cur = protocol_stack_interface_info_get_by_id(interface_id);
2788+
if (!cur) {
2789+
return;
2790+
}
2791+
if (cur->thread_info->thread_device_mode != THREAD_DEVICE_MODE_ROUTER) {
2792+
return;
2793+
}
2794+
// delay reed jitter timer to allow for settings changes to distribute
2795+
thread_info(cur)->reedJitterTimer += delay;
2796+
return;
2797+
}
2798+
27852799
#endif /* HAVE_THREAD_ROUTER */

source/6LoWPAN/Thread/thread_router_bootstrap.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ void thread_router_bootstrap_anycast_address_register(protocol_interface_info_en
7676
void thread_router_bootstrap_network_data_distribute(protocol_interface_info_entry_t *cur);
7777
bool thread_router_bootstrap_routing_allowed(struct protocol_interface_info_entry *cur);
7878
void thread_router_bootstrap_address_change_notify_send(protocol_interface_info_entry_t *cur);
79+
void thread_router_bootstrap_delay_reed_jitter(int8_t interface_id, uint16_t delay);
7980

8081
#else
8182

@@ -108,7 +109,7 @@ void thread_router_bootstrap_address_change_notify_send(protocol_interface_info_
108109
#define thread_router_bootstrap_routing_allowed(cur) false
109110
#define thread_router_bootstrap_address_change_notify_send(cur)
110111
#define thread_router_bootstrap_reed_merge_advertisement(cur)
111-
112+
#define thread_router_bootstrap_delay_reed_jitter(interface_id, delay)
112113
#endif/*HAVE_THREAD_ROUTER*/
113114

114115
#endif /* THREAD_ROUTER_BOOTSTRAP_H_ */

0 commit comments

Comments
 (0)