mirror of
https://github.com/espressif/openthread.git
synced 2026-08-13 06:07:48 +00:00
[ncp] add dhcp6 client support (#2833)
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user