[ncp] add dhcp6 client support (#2833)

This commit is contained in:
Jonathan Hui
2018-06-26 22:26:36 -05:00
committed by GitHub
parent e69019f962
commit c325ab8a39
3 changed files with 13 additions and 0 deletions
+4
View File
@@ -633,6 +633,10 @@ NcpBase::NcpBase(Instance *aInstance)
memset(&mResponseQueue, 0, sizeof(mResponseQueue));
#if OPENTHREAD_ENABLE_DHCP6_CLIENT
memset(mDhcpAddresses, 0, sizeof(mDhcpAddresses));
#endif
#if OPENTHREAD_MTD || OPENTHREAD_FTD
otMessageQueueInit(&mMessageQueue);
otSetStateChangedCallback(mInstance, &NcpBase::HandleStateChanged, this);
+5
View File
@@ -43,6 +43,7 @@
#if OPENTHREAD_FTD
#include <openthread/thread_ftd.h>
#endif
#include <openthread/dhcp6_client.h>
#include <openthread/message.h>
#include <openthread/ncp.h>
#include <openthread/types.h>
@@ -864,6 +865,10 @@ protected:
bool mDisableStreamWrite;
bool mShouldEmitChildTableUpdate;
#if OPENTHREAD_ENABLE_DHCP6_CLIENT
otDhcpAddress mDhcpAddresses[OPENTHREAD_CONFIG_NUM_DHCP_PREFIXES];
#endif
#if OPENTHREAD_FTD
#if OPENTHREAD_CONFIG_ENABLE_STEERING_DATA_SET_OOB
otExtAddress mSteeringDataAddress;
+4
View File
@@ -3008,6 +3008,10 @@ void NcpBase::ProcessThreadChangedFlags(void)
{
mChangedPropsSet.AddProperty(SPINEL_PROP_THREAD_ON_MESH_NETS);
mChangedPropsSet.AddProperty(SPINEL_PROP_THREAD_OFF_MESH_ROUTES);
#if OPENTHREAD_ENABLE_DHCP6_CLIENT
otDhcp6ClientUpdate(mInstance, mDhcpAddresses, OT_ARRAY_LENGTH(mDhcpAddresses), NULL);
#endif
}
mThreadChangedFlags &= ~threadFlag;