Skip to content

Commit 660d5aa

Browse files
committed
[spinel] handle new spinel net role DISABLED
1 parent e2fd726 commit 660d5aa

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/ncp-spinel/SpinelNCPInstance.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -5767,6 +5767,7 @@ SpinelNCPInstance::handle_ncp_spinel_value_is(spinel_prop_key_t key, const uint8
57675767

57685768
if (ncp_state_is_joining_or_joined(get_ncp_state())
57695769
&& (value != SPINEL_NET_ROLE_DETACHED)
5770+
&& (value != SPINEL_NET_ROLE_DISABLED)
57705771
) {
57715772
change_ncp_state(ASSOCIATED);
57725773
}
@@ -5784,7 +5785,7 @@ SpinelNCPInstance::handle_ncp_spinel_value_is(spinel_prop_key_t key, const uint8
57845785
} else if (value == SPINEL_NET_ROLE_LEADER) {
57855786
update_node_type(LEADER);
57865787

5787-
} else if (value == SPINEL_NET_ROLE_DETACHED) {
5788+
} else if (value == SPINEL_NET_ROLE_DETACHED || value == SPINEL_NET_ROLE_DISABLED) {
57885789
update_node_type(UNKNOWN);
57895790
if (ncp_state_is_associated(get_ncp_state())) {
57905791
change_ncp_state(ISOLATED);

third_party/openthread/src/ncp/spinel.h

+2
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,7 @@ typedef enum
504504
SPINEL_NET_ROLE_CHILD = 1,
505505
SPINEL_NET_ROLE_ROUTER = 2,
506506
SPINEL_NET_ROLE_LEADER = 3,
507+
SPINEL_NET_ROLE_DISABLED = 4,
507508
} spinel_net_role_t;
508509

509510
typedef enum
@@ -2090,6 +2091,7 @@ enum
20902091
* SPINEL_NET_ROLE_CHILD = 1,
20912092
* SPINEL_NET_ROLE_ROUTER = 2,
20922093
* SPINEL_NET_ROLE_LEADER = 3,
2094+
* SPINEL_NET_ROLE_DISABLED = 4,
20932095
*
20942096
*/
20952097
SPINEL_PROP_NET_ROLE = SPINEL_PROP_NET__BEGIN + 3,

0 commit comments

Comments
 (0)