Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[posix] Add Cli Daemon module #2676

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/host/ncp_host.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ NcpHost::NcpHost(const char *aInterfaceName, const char *aBackboneInterfaceName,
: mSpinelDriver(*static_cast<ot::Spinel::SpinelDriver *>(otSysGetSpinelDriver()))
, mNetif(mNcpSpinel)
, mInfraIf(mNcpSpinel)
, mDaemon()
{
memset(&mConfig, 0, sizeof(mConfig));
mConfig.mInterfaceName = aInterfaceName;
Expand All @@ -116,6 +117,7 @@ void NcpHost::Init(void)
mNcpSpinel.Init(mSpinelDriver, *this);
mNetif.Init(mConfig.mInterfaceName);
mInfraIf.Init();
mDaemon.Init(mNetif.GetNetifName());

mNcpSpinel.Ip6SetAddressCallback(
[this](const std::vector<Ip6AddressInfo> &aAddrInfos) { mNetif.UpdateIp6UnicastAddresses(aAddrInfos); });
Expand Down Expand Up @@ -149,6 +151,7 @@ void NcpHost::Deinit(void)
{
mNcpSpinel.Deinit();
mNetif.Deinit();
mDaemon.Deinit();
otSysDeinit();
}

Expand Down Expand Up @@ -258,6 +261,7 @@ void NcpHost::Process(const MainloopContext &aMainloop)
mSpinelDriver.Process(&aMainloop);

mNetif.Process(&aMainloop);
mDaemon.Process(aMainloop);
}

void NcpHost::Update(MainloopContext &aMainloop)
Expand All @@ -271,6 +275,7 @@ void NcpHost::Update(MainloopContext &aMainloop)
}

mNetif.UpdateFdSet(&aMainloop);
mDaemon.UpdateFdSet(aMainloop);
}

#if OTBR_ENABLE_SRP_ADVERTISING_PROXY
Expand Down
2 changes: 2 additions & 0 deletions src/host/ncp_host.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#include "common/mainloop.hpp"
#include "host/ncp_spinel.hpp"
#include "host/thread_host.hpp"
#include "posix/daemon.hpp"
#include "posix/netif.hpp"

namespace otbr {
Expand Down Expand Up @@ -140,6 +141,7 @@ class NcpHost : public MainloopProcessor,
TaskRunner mTaskRunner;
Netif mNetif;
InfraIf mInfraIf;
Daemon mDaemon;
};

} // namespace Host
Expand Down
2 changes: 2 additions & 0 deletions src/host/posix/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
#

add_library(otbr-posix
daemon.hpp
daemon.cpp
infra_if.hpp
infra_if.cpp
netif.cpp
Expand Down
Loading
Loading