Skip to content

Commit

Permalink
[spinel] add spinel net role DISABLED (#9731)
Browse files Browse the repository at this point in the history
This commit adds net role 'DISABLED' into `spinel_net_role_t` to
differentiate between 'DISABLED' and 'DETACHED' status of NCP.

Since this is only used for NCP and not related with RCP, the
`RCP_API_VERSION` is not updated.
  • Loading branch information
Irving-cl authored Dec 20, 2023
1 parent a492d04 commit 55cc30b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/lib/spinel/spinel.c
Original file line number Diff line number Diff line change
Expand Up @@ -1500,11 +1500,9 @@ const char *spinel_prop_key_to_cstr(spinel_prop_key_t prop_key)
const char *spinel_net_role_to_cstr(uint8_t net_role)
{
static const struct spinel_cstr spinel_net_cstr[] = {
{SPINEL_NET_ROLE_DETACHED, "NET_ROLE_DETACHED"},
{SPINEL_NET_ROLE_CHILD, "NET_ROLE_CHILD"},
{SPINEL_NET_ROLE_ROUTER, "NET_ROLE_ROUTER"},
{SPINEL_NET_ROLE_LEADER, "NET_ROLE_LEADER"},
{0, NULL},
{SPINEL_NET_ROLE_DETACHED, "NET_ROLE_DETACHED"}, {SPINEL_NET_ROLE_CHILD, "NET_ROLE_CHILD"},
{SPINEL_NET_ROLE_ROUTER, "NET_ROLE_ROUTER"}, {SPINEL_NET_ROLE_LEADER, "NET_ROLE_LEADER"},
{SPINEL_NET_ROLE_DISABLED, "NET_ROLE_DISABLED"}, {0, NULL},
};

return spinel_to_cstr(spinel_net_cstr, net_role);
Expand Down
2 changes: 2 additions & 0 deletions src/lib/spinel/spinel.h
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,7 @@ typedef enum
SPINEL_NET_ROLE_CHILD = 1,
SPINEL_NET_ROLE_ROUTER = 2,
SPINEL_NET_ROLE_LEADER = 3,
SPINEL_NET_ROLE_DISABLED = 4,
} spinel_net_role_t;

typedef enum
Expand Down Expand Up @@ -2296,6 +2297,7 @@ enum
* SPINEL_NET_ROLE_CHILD = 1,
* SPINEL_NET_ROLE_ROUTER = 2,
* SPINEL_NET_ROLE_LEADER = 3,
* SPINEL_NET_ROLE_DISABLED = 4,
*
*/
SPINEL_PROP_NET_ROLE = SPINEL_PROP_NET__BEGIN + 3,
Expand Down

0 comments on commit 55cc30b

Please sign in to comment.