From 80b4d724121f2d383b5fb54f2ed1bc21dfa57a48 Mon Sep 17 00:00:00 2001 From: Tero Heinonen Date: Tue, 30 Jan 2018 11:28:20 +0200 Subject: [PATCH] Thread partition merge mode TLV change (#1546) When thread REED/Router device is sending parent request to higher partition, it must set 'E' bit already in the first message. --- source/6LoWPAN/Thread/thread_common.h | 6 +++--- source/6LoWPAN/Thread/thread_host_bootstrap.c | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/source/6LoWPAN/Thread/thread_common.h b/source/6LoWPAN/Thread/thread_common.h index acc93055465a..382e15a6b6a4 100644 --- a/source/6LoWPAN/Thread/thread_common.h +++ b/source/6LoWPAN/Thread/thread_common.h @@ -70,9 +70,9 @@ extern uint16_t thread_joiner_port; typedef enum { THREAD_STATE_NETWORK_DISCOVER, // Not commissioned to Thread network - THREAD_STATE_REATTACH, // Connected to thread network, searching for better partition - THREAD_STATE_REATTACH_RETRY, // Connected to thread network, searching for better partition with REED bit is set - THREAD_STATE_ATTACH_ANY, // Connected to thread network, searching for all partitions with leader connectivity + THREAD_STATE_REATTACH, // Connection to leader lost, searching for new parent + THREAD_STATE_REATTACH_RETRY, // Connection to leader lost, searching for new parent with REED bit is set + THREAD_STATE_ATTACH_ANY, // Searching for all partitions with leader connectivity THREAD_STATE_CONNECTED, // Attached to Thread network - can't route THREAD_STATE_CONNECTED_ROUTER, // Attached to Thread network - Routing enabled } thread_attach_state_e; diff --git a/source/6LoWPAN/Thread/thread_host_bootstrap.c b/source/6LoWPAN/Thread/thread_host_bootstrap.c index e68f1480e88e..9f5e5bd5dc16 100644 --- a/source/6LoWPAN/Thread/thread_host_bootstrap.c +++ b/source/6LoWPAN/Thread/thread_host_bootstrap.c @@ -230,7 +230,9 @@ static int thread_parent_request_build(protocol_interface_info_entry_t *cur) } if (cur->thread_info->thread_attached_state == THREAD_STATE_REATTACH || - cur->thread_info->thread_attached_state == THREAD_STATE_REATTACH_RETRY) { + cur->thread_info->thread_attached_state == THREAD_STATE_REATTACH_RETRY || + cur->thread_info->thread_attached_state == THREAD_STATE_CONNECTED || + cur->thread_info->thread_attached_state == THREAD_STATE_CONNECTED_ROUTER) { // When doing re-attach End devices are immediately accepted as parents scanMask |= 0x40; }