mirror of
https://github.com/espressif/openthread.git
synced 2026-08-12 21:57:47 +00:00
Clean up state changed names. (#1887)
This commit is contained in:
@@ -479,7 +479,7 @@ otLwfTunAddressesUpdated(
|
||||
{
|
||||
memcpy_s(&addr.mAddress, sizeof(addr.mAddress), pAddr, sizeof(IN6_ADDR));
|
||||
otLwfOnAddressAdded(pFilter, &addr, TRUE);
|
||||
*aNotifFlags |= OT_IP6_ADDRESS_ADDED;
|
||||
*aNotifFlags |= OT_CHANGED_IP6_ADDRESS_ADDED;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -499,7 +499,7 @@ otLwfTunAddressesUpdated(
|
||||
if ((FoundInOpenThread & (1 << i)) == 0)
|
||||
{
|
||||
otLwfOnAddressRemoved(pFilter, (ULONG)i, TRUE);
|
||||
*aNotifFlags |= OT_IP6_ADDRESS_REMOVED;
|
||||
*aNotifFlags |= OT_CHANGED_IP6_ADDRESS_REMOVED;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -489,59 +489,59 @@ void otLwfStateChangedCallback(uint32_t aFlags, _In_ void *aContext)
|
||||
// Process the notification internally
|
||||
//
|
||||
|
||||
if ((aFlags & OT_IP6_ADDRESS_ADDED) != 0)
|
||||
if ((aFlags & OT_CHANGED_IP6_ADDRESS_ADDED) != 0)
|
||||
{
|
||||
LogVerbose(DRIVER_DEFAULT, "Filter %p received OT_IP6_ADDRESS_ADDED", pFilter);
|
||||
LogVerbose(DRIVER_DEFAULT, "Filter %p received OT_CHANGED_IP6_ADDRESS_ADDED", pFilter);
|
||||
otLwfRadioAddressesUpdated(pFilter);
|
||||
}
|
||||
|
||||
if ((aFlags & OT_IP6_ADDRESS_REMOVED) != 0)
|
||||
if ((aFlags & OT_CHANGED_IP6_ADDRESS_REMOVED) != 0)
|
||||
{
|
||||
LogVerbose(DRIVER_DEFAULT, "Filter %p received OT_IP6_ADDRESS_REMOVED", pFilter);
|
||||
LogVerbose(DRIVER_DEFAULT, "Filter %p received OT_CHANGED_IP6_ADDRESS_REMOVED", pFilter);
|
||||
otLwfRadioAddressesUpdated(pFilter);
|
||||
}
|
||||
|
||||
if ((aFlags & OT_IP6_RLOC_ADDED) != 0)
|
||||
if ((aFlags & OT_CHANGED_THREAD_RLOC_ADDED) != 0)
|
||||
{
|
||||
LogVerbose(DRIVER_DEFAULT, "Filter %p received OT_IP6_RLOC_ADDED", pFilter);
|
||||
LogVerbose(DRIVER_DEFAULT, "Filter %p received OT_CHANGED_THREAD_RLOC_ADDED", pFilter);
|
||||
otLwfRadioAddressesUpdated(pFilter);
|
||||
}
|
||||
|
||||
if ((aFlags & OT_IP6_RLOC_REMOVED) != 0)
|
||||
if ((aFlags & OT_CHANGED_THREAD_RLOC_REMOVED) != 0)
|
||||
{
|
||||
LogVerbose(DRIVER_DEFAULT, "Filter %p received OT_IP6_RLOC_REMOVED", pFilter);
|
||||
LogVerbose(DRIVER_DEFAULT, "Filter %p received OT_CHANGED_THREAD_RLOC_REMOVED", pFilter);
|
||||
otLwfRadioAddressesUpdated(pFilter);
|
||||
}
|
||||
|
||||
if ((aFlags & OT_NET_ROLE) != 0)
|
||||
if ((aFlags & OT_CHANGED_THREAD_ROLE) != 0)
|
||||
{
|
||||
LogVerbose(DRIVER_DEFAULT, "Filter %p received OT_NET_ROLE", pFilter);
|
||||
LogVerbose(DRIVER_DEFAULT, "Filter %p received OT_CHANGED_THREAD_ROLE", pFilter);
|
||||
otLwfProcessRoleStateChange(pFilter);
|
||||
}
|
||||
|
||||
if ((aFlags & OT_NET_PARTITION_ID) != 0)
|
||||
if ((aFlags & OT_CHANGED_THREAD_PARTITION_ID) != 0)
|
||||
{
|
||||
LogVerbose(DRIVER_DEFAULT, "Filter %p received OT_NET_PARTITION_ID", pFilter);
|
||||
LogVerbose(DRIVER_DEFAULT, "Filter %p received OT_CHANGED_THREAD_PARTITION_ID", pFilter);
|
||||
}
|
||||
|
||||
if ((aFlags & OT_NET_KEY_SEQUENCE_COUNTER) != 0)
|
||||
if ((aFlags & OT_CHANGED_THREAD_KEY_SEQUENCE_COUNTER) != 0)
|
||||
{
|
||||
LogVerbose(DRIVER_DEFAULT, "Filter %p received OT_NET_KEY_SEQUENCE_COUNTER", pFilter);
|
||||
LogVerbose(DRIVER_DEFAULT, "Filter %p received OT_CHANGED_THREAD_KEY_SEQUENCE_COUNTER", pFilter);
|
||||
}
|
||||
|
||||
if ((aFlags & OT_THREAD_CHILD_ADDED) != 0)
|
||||
if ((aFlags & OT_CHANGED_THREAD_CHILD_ADDED) != 0)
|
||||
{
|
||||
LogVerbose(DRIVER_DEFAULT, "Filter %p received OT_THREAD_CHILD_ADDED", pFilter);
|
||||
LogVerbose(DRIVER_DEFAULT, "Filter %p received OT_CHANGED_THREAD_CHILD_ADDED", pFilter);
|
||||
}
|
||||
|
||||
if ((aFlags & OT_THREAD_CHILD_REMOVED) != 0)
|
||||
if ((aFlags & OT_CHANGED_THREAD_CHILD_REMOVED) != 0)
|
||||
{
|
||||
LogVerbose(DRIVER_DEFAULT, "Filter %p received OT_THREAD_CHILD_REMOVED", pFilter);
|
||||
LogVerbose(DRIVER_DEFAULT, "Filter %p received OT_CHANGED_THREAD_CHILD_REMOVED", pFilter);
|
||||
}
|
||||
|
||||
if ((aFlags & OT_THREAD_NETDATA_UPDATED) != 0)
|
||||
if ((aFlags & OT_CHANGED_THREAD_NETDATA) != 0)
|
||||
{
|
||||
LogVerbose(DRIVER_DEFAULT, "Filter %p received OT_THREAD_NETDATA_UPDATED", pFilter);
|
||||
LogVerbose(DRIVER_DEFAULT, "Filter %p received OT_CHANGED_THREAD_NETDATA", pFilter);
|
||||
otIp6SlaacUpdate(pFilter->otCtx, pFilter->otAutoAddresses, ARRAYSIZE(pFilter->otAutoAddresses), otIp6CreateRandomIid, NULL);
|
||||
|
||||
#if OPENTHREAD_ENABLE_DHCP6_SERVER
|
||||
@@ -553,9 +553,9 @@ void otLwfStateChangedCallback(uint32_t aFlags, _In_ void *aContext)
|
||||
#endif // OPENTHREAD_ENABLE_DHCP6_CLIENT
|
||||
}
|
||||
|
||||
if ((aFlags & OT_IP6_ML_ADDR_CHANGED) != 0)
|
||||
if ((aFlags & OT_CHANGED_THREAD_ML_ADDR) != 0)
|
||||
{
|
||||
LogVerbose(DRIVER_DEFAULT, "Filter %p received OT_IP6_ML_ADDR_CHANGED", pFilter);
|
||||
LogVerbose(DRIVER_DEFAULT, "Filter %p received OT_CHANGED_THREAD_ML_ADDR", pFilter);
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
@@ -450,27 +450,27 @@ otLwfTunValueIs(
|
||||
MediaConnectStateDisconnected);
|
||||
|
||||
// Set flag to indicate we should send a notification
|
||||
aNotifFlags = OT_NET_ROLE;
|
||||
aNotifFlags = OT_CHANGED_THREAD_ROLE;
|
||||
}
|
||||
else if (key == SPINEL_PROP_IPV6_LL_ADDR)
|
||||
{
|
||||
// Set flag to indicate we should send a notification
|
||||
aNotifFlags = OT_IP6_LL_ADDR_CHANGED;
|
||||
aNotifFlags = OT_CHANGED_THREAD_LL_ADDR;
|
||||
}
|
||||
else if (key == SPINEL_PROP_IPV6_ML_ADDR)
|
||||
{
|
||||
// Set flag to indicate we should send a notification
|
||||
aNotifFlags = OT_IP6_ML_ADDR_CHANGED;
|
||||
aNotifFlags = OT_CHANGED_THREAD_ML_ADDR;
|
||||
}
|
||||
else if (key == SPINEL_PROP_NET_PARTITION_ID)
|
||||
{
|
||||
// Set flag to indicate we should send a notification
|
||||
aNotifFlags = OT_NET_PARTITION_ID;
|
||||
aNotifFlags = OT_CHANGED_THREAD_PARTITION_ID;
|
||||
}
|
||||
else if (key == SPINEL_PROP_NET_KEY_SEQUENCE_COUNTER)
|
||||
{
|
||||
// Set flag to indicate we should send a notification
|
||||
aNotifFlags = OT_NET_KEY_SEQUENCE_COUNTER;
|
||||
aNotifFlags = OT_CHANGED_THREAD_KEY_SEQUENCE_COUNTER;
|
||||
}
|
||||
else if (key == SPINEL_PROP_IPV6_ADDRESS_TABLE)
|
||||
{
|
||||
@@ -486,7 +486,7 @@ otLwfTunValueIs(
|
||||
// TODO - Slaac
|
||||
|
||||
// Set flag to indicate we should send a notification
|
||||
aNotifFlags = OT_THREAD_NETDATA_UPDATED;
|
||||
aNotifFlags = OT_CHANGED_THREAD_NETDATA;
|
||||
}
|
||||
else if ((key == SPINEL_PROP_STREAM_NET) || (key == SPINEL_PROP_STREAM_NET_INSECURE))
|
||||
{
|
||||
|
||||
@@ -707,14 +707,14 @@ void OTCALL otNodeStateChangedCallback(uint32_t aFlags, void *aContext)
|
||||
otLogFuncEntry();
|
||||
otNode* aNode = (otNode*)aContext;
|
||||
|
||||
if ((aFlags & OT_NET_ROLE) != 0)
|
||||
if ((aFlags & OT_CHANGED_THREAD_ROLE) != 0)
|
||||
{
|
||||
auto Role = otThreadGetDeviceRole(aNode->mInstance);
|
||||
printf("%d: new role: %s\r\n", aNode->mId, otDeviceRoleToString(Role));
|
||||
}
|
||||
|
||||
if ((aFlags & OT_IP6_ADDRESS_ADDED) != 0 || (aFlags & OT_IP6_ADDRESS_REMOVED) != 0 ||
|
||||
(aFlags & OT_IP6_RLOC_ADDED) != 0 || (aFlags & OT_IP6_RLOC_REMOVED) != 0)
|
||||
if ((aFlags & OT_CHANGED_IP6_ADDRESS_ADDED) != 0 || (aFlags & OT_CHANGED_IP6_ADDRESS_REMOVED) != 0 ||
|
||||
(aFlags & OT_CHANGED_THREAD_RLOC_ADDED) != 0 || (aFlags & OT_CHANGED_THREAD_RLOC_REMOVED) != 0)
|
||||
{
|
||||
HandleAddressChanges(aNode);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user