[ncp] add netif state property change (#11950)

This commit makes NCP send notification to the host when the netif
state changes.

At the beginning we use ThreadHost API to start the thread network on
OTBR NCP which explicitly sends spinel property set command to the NCP
and get response. So the host side can get the latest state of netif
in the response. However if we use the cli command (`ifconfig up`) to
start the thread network, we need the NCP to send a notification to
the host that netif state changes.

I have verified that with the change, the host can receive the update
if we issue `ifconfig up` command.
This commit is contained in:
Li Cao
2025-09-19 14:35:37 -07:00
committed by GitHub
parent 3b3dd203be
commit 60dca7fbce
2 changed files with 2 additions and 0 deletions
+1
View File
@@ -54,6 +54,7 @@ const ChangedPropsSet::Entry ChangedPropsSet::mSupportedProps[] = {
{SPINEL_PROP_IPV6_LL_ADDR, SPINEL_STATUS_OK, true},
{SPINEL_PROP_IPV6_ML_ADDR, SPINEL_STATUS_OK, true},
{SPINEL_PROP_IPV6_ADDRESS_TABLE, SPINEL_STATUS_OK, true},
{SPINEL_PROP_NET_IF_UP, SPINEL_STATUS_OK, true},
{SPINEL_PROP_NET_ROLE, SPINEL_STATUS_OK, true},
{SPINEL_PROP_NET_PARTITION_ID, SPINEL_STATUS_OK, true},
{SPINEL_PROP_NET_KEY_SEQUENCE_COUNTER, SPINEL_STATUS_OK, true},
+1
View File
@@ -4749,6 +4749,7 @@ void NcpBase::ProcessThreadChangedFlags(void)
{OT_CHANGED_PSKC, SPINEL_PROP_NET_PSKC},
{OT_CHANGED_CHANNEL_MANAGER_NEW_CHANNEL, SPINEL_PROP_CHANNEL_MANAGER_NEW_CHANNEL},
{OT_CHANGED_SUPPORTED_CHANNEL_MASK, SPINEL_PROP_PHY_CHAN_SUPPORTED},
{OT_CHANGED_THREAD_NETIF_STATE, SPINEL_PROP_NET_IF_UP},
{OT_CHANGED_THREAD_BACKBONE_ROUTER_STATE, SPINEL_PROP_BACKBONE_ROUTER_STATE},
};