xref: /aosp_15_r20/external/ot-br-posix/src/ncp/rcp_host.hpp (revision 4a64e381480ef79f0532b2421e44e6ee336b8e0d)
1*4a64e381SAndroid Build Coastguard Worker /*
2*4a64e381SAndroid Build Coastguard Worker  *  Copyright (c) 2017, The OpenThread Authors.
3*4a64e381SAndroid Build Coastguard Worker  *  All rights reserved.
4*4a64e381SAndroid Build Coastguard Worker  *
5*4a64e381SAndroid Build Coastguard Worker  *  Redistribution and use in source and binary forms, with or without
6*4a64e381SAndroid Build Coastguard Worker  *  modification, are permitted provided that the following conditions are met:
7*4a64e381SAndroid Build Coastguard Worker  *  1. Redistributions of source code must retain the above copyright
8*4a64e381SAndroid Build Coastguard Worker  *     notice, this list of conditions and the following disclaimer.
9*4a64e381SAndroid Build Coastguard Worker  *  2. Redistributions in binary form must reproduce the above copyright
10*4a64e381SAndroid Build Coastguard Worker  *     notice, this list of conditions and the following disclaimer in the
11*4a64e381SAndroid Build Coastguard Worker  *     documentation and/or other materials provided with the distribution.
12*4a64e381SAndroid Build Coastguard Worker  *  3. Neither the name of the copyright holder nor the
13*4a64e381SAndroid Build Coastguard Worker  *     names of its contributors may be used to endorse or promote products
14*4a64e381SAndroid Build Coastguard Worker  *     derived from this software without specific prior written permission.
15*4a64e381SAndroid Build Coastguard Worker  *
16*4a64e381SAndroid Build Coastguard Worker  *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17*4a64e381SAndroid Build Coastguard Worker  *  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18*4a64e381SAndroid Build Coastguard Worker  *  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19*4a64e381SAndroid Build Coastguard Worker  *  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20*4a64e381SAndroid Build Coastguard Worker  *  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21*4a64e381SAndroid Build Coastguard Worker  *  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22*4a64e381SAndroid Build Coastguard Worker  *  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23*4a64e381SAndroid Build Coastguard Worker  *  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24*4a64e381SAndroid Build Coastguard Worker  *  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25*4a64e381SAndroid Build Coastguard Worker  *  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26*4a64e381SAndroid Build Coastguard Worker  *  POSSIBILITY OF SUCH DAMAGE.
27*4a64e381SAndroid Build Coastguard Worker  */
28*4a64e381SAndroid Build Coastguard Worker 
29*4a64e381SAndroid Build Coastguard Worker /**
30*4a64e381SAndroid Build Coastguard Worker  * @file
31*4a64e381SAndroid Build Coastguard Worker  *   This file includes definitions of Thread Controller under RCP mode.
32*4a64e381SAndroid Build Coastguard Worker  */
33*4a64e381SAndroid Build Coastguard Worker 
34*4a64e381SAndroid Build Coastguard Worker #ifndef OTBR_AGENT_RCP_HOST_HPP_
35*4a64e381SAndroid Build Coastguard Worker #define OTBR_AGENT_RCP_HOST_HPP_
36*4a64e381SAndroid Build Coastguard Worker 
37*4a64e381SAndroid Build Coastguard Worker #include "openthread-br/config.h"
38*4a64e381SAndroid Build Coastguard Worker 
39*4a64e381SAndroid Build Coastguard Worker #include <chrono>
40*4a64e381SAndroid Build Coastguard Worker #include <memory>
41*4a64e381SAndroid Build Coastguard Worker 
42*4a64e381SAndroid Build Coastguard Worker #include <assert.h>
43*4a64e381SAndroid Build Coastguard Worker 
44*4a64e381SAndroid Build Coastguard Worker #include <openthread/backbone_router_ftd.h>
45*4a64e381SAndroid Build Coastguard Worker #include <openthread/cli.h>
46*4a64e381SAndroid Build Coastguard Worker #include <openthread/instance.h>
47*4a64e381SAndroid Build Coastguard Worker #include <openthread/openthread-system.h>
48*4a64e381SAndroid Build Coastguard Worker 
49*4a64e381SAndroid Build Coastguard Worker #include "common/mainloop.hpp"
50*4a64e381SAndroid Build Coastguard Worker #include "common/task_runner.hpp"
51*4a64e381SAndroid Build Coastguard Worker #include "common/types.hpp"
52*4a64e381SAndroid Build Coastguard Worker #include "ncp/thread_host.hpp"
53*4a64e381SAndroid Build Coastguard Worker #include "utils/thread_helper.hpp"
54*4a64e381SAndroid Build Coastguard Worker 
55*4a64e381SAndroid Build Coastguard Worker namespace otbr {
56*4a64e381SAndroid Build Coastguard Worker #if OTBR_ENABLE_FEATURE_FLAGS
57*4a64e381SAndroid Build Coastguard Worker // Forward declaration of FeatureFlagList proto.
58*4a64e381SAndroid Build Coastguard Worker class FeatureFlagList;
59*4a64e381SAndroid Build Coastguard Worker #endif
60*4a64e381SAndroid Build Coastguard Worker 
61*4a64e381SAndroid Build Coastguard Worker namespace Ncp {
62*4a64e381SAndroid Build Coastguard Worker 
63*4a64e381SAndroid Build Coastguard Worker /**
64*4a64e381SAndroid Build Coastguard Worker  * This class implements the NetworkProperties for architectures where OT APIs are directly accessible.
65*4a64e381SAndroid Build Coastguard Worker  */
66*4a64e381SAndroid Build Coastguard Worker class OtNetworkProperties : virtual public NetworkProperties
67*4a64e381SAndroid Build Coastguard Worker {
68*4a64e381SAndroid Build Coastguard Worker public:
69*4a64e381SAndroid Build Coastguard Worker     /**
70*4a64e381SAndroid Build Coastguard Worker      * Constructor.
71*4a64e381SAndroid Build Coastguard Worker      */
72*4a64e381SAndroid Build Coastguard Worker     explicit OtNetworkProperties(void);
73*4a64e381SAndroid Build Coastguard Worker 
74*4a64e381SAndroid Build Coastguard Worker     // NetworkProperties methods
75*4a64e381SAndroid Build Coastguard Worker     otDeviceRole GetDeviceRole(void) const override;
76*4a64e381SAndroid Build Coastguard Worker     bool         Ip6IsEnabled(void) const override;
77*4a64e381SAndroid Build Coastguard Worker     uint32_t     GetPartitionId(void) const override;
78*4a64e381SAndroid Build Coastguard Worker     void         GetDatasetActiveTlvs(otOperationalDatasetTlvs &aDatasetTlvs) const override;
79*4a64e381SAndroid Build Coastguard Worker     void         GetDatasetPendingTlvs(otOperationalDatasetTlvs &aDatasetTlvs) const override;
80*4a64e381SAndroid Build Coastguard Worker 
81*4a64e381SAndroid Build Coastguard Worker     // Set the otInstance
82*4a64e381SAndroid Build Coastguard Worker     void SetInstance(otInstance *aInstance);
83*4a64e381SAndroid Build Coastguard Worker 
84*4a64e381SAndroid Build Coastguard Worker private:
85*4a64e381SAndroid Build Coastguard Worker     otInstance *mInstance;
86*4a64e381SAndroid Build Coastguard Worker };
87*4a64e381SAndroid Build Coastguard Worker 
88*4a64e381SAndroid Build Coastguard Worker /**
89*4a64e381SAndroid Build Coastguard Worker  * This interface defines OpenThread Controller under RCP mode.
90*4a64e381SAndroid Build Coastguard Worker  */
91*4a64e381SAndroid Build Coastguard Worker class RcpHost : public MainloopProcessor, public ThreadHost, public OtNetworkProperties
92*4a64e381SAndroid Build Coastguard Worker {
93*4a64e381SAndroid Build Coastguard Worker public:
94*4a64e381SAndroid Build Coastguard Worker     /**
95*4a64e381SAndroid Build Coastguard Worker      * This constructor initializes this object.
96*4a64e381SAndroid Build Coastguard Worker      *
97*4a64e381SAndroid Build Coastguard Worker      * @param[in]   aInterfaceName          A string of the NCP interface name.
98*4a64e381SAndroid Build Coastguard Worker      * @param[in]   aRadioUrls              The radio URLs (can be IEEE802.15.4 or TREL radio).
99*4a64e381SAndroid Build Coastguard Worker      * @param[in]   aBackboneInterfaceName  The Backbone network interface name.
100*4a64e381SAndroid Build Coastguard Worker      * @param[in]   aDryRun                 TRUE to indicate dry-run mode. FALSE otherwise.
101*4a64e381SAndroid Build Coastguard Worker      * @param[in]   aEnableAutoAttach       Whether or not to automatically attach to the saved network.
102*4a64e381SAndroid Build Coastguard Worker      */
103*4a64e381SAndroid Build Coastguard Worker     RcpHost(const char                      *aInterfaceName,
104*4a64e381SAndroid Build Coastguard Worker             const std::vector<const char *> &aRadioUrls,
105*4a64e381SAndroid Build Coastguard Worker             const char                      *aBackboneInterfaceName,
106*4a64e381SAndroid Build Coastguard Worker             bool                             aDryRun,
107*4a64e381SAndroid Build Coastguard Worker             bool                             aEnableAutoAttach);
108*4a64e381SAndroid Build Coastguard Worker 
109*4a64e381SAndroid Build Coastguard Worker     /**
110*4a64e381SAndroid Build Coastguard Worker      * This method initialize the Thread controller.
111*4a64e381SAndroid Build Coastguard Worker      */
112*4a64e381SAndroid Build Coastguard Worker     void Init(void) override;
113*4a64e381SAndroid Build Coastguard Worker 
114*4a64e381SAndroid Build Coastguard Worker     /**
115*4a64e381SAndroid Build Coastguard Worker      * This method deinitialize the Thread controller.
116*4a64e381SAndroid Build Coastguard Worker      */
117*4a64e381SAndroid Build Coastguard Worker     void Deinit(void) override;
118*4a64e381SAndroid Build Coastguard Worker 
119*4a64e381SAndroid Build Coastguard Worker     /**
120*4a64e381SAndroid Build Coastguard Worker      * Returns an OpenThread instance.
121*4a64e381SAndroid Build Coastguard Worker      *
122*4a64e381SAndroid Build Coastguard Worker      * @retval Non-null OpenThread instance if `RcpHost::Init()` has been called.
123*4a64e381SAndroid Build Coastguard Worker      *         Otherwise, it's guaranteed to be `null`
124*4a64e381SAndroid Build Coastguard Worker      */
GetInstance(void)125*4a64e381SAndroid Build Coastguard Worker     otInstance *GetInstance(void) { return mInstance; }
126*4a64e381SAndroid Build Coastguard Worker 
127*4a64e381SAndroid Build Coastguard Worker     /**
128*4a64e381SAndroid Build Coastguard Worker      * This method gets the thread functionality helper.
129*4a64e381SAndroid Build Coastguard Worker      *
130*4a64e381SAndroid Build Coastguard Worker      * @retval The pointer to the helper object.
131*4a64e381SAndroid Build Coastguard Worker      */
GetThreadHelper(void)132*4a64e381SAndroid Build Coastguard Worker     otbr::agent::ThreadHelper *GetThreadHelper(void)
133*4a64e381SAndroid Build Coastguard Worker     {
134*4a64e381SAndroid Build Coastguard Worker         assert(mThreadHelper != nullptr);
135*4a64e381SAndroid Build Coastguard Worker         return mThreadHelper.get();
136*4a64e381SAndroid Build Coastguard Worker     }
137*4a64e381SAndroid Build Coastguard Worker 
138*4a64e381SAndroid Build Coastguard Worker     void Update(MainloopContext &aMainloop) override;
139*4a64e381SAndroid Build Coastguard Worker     void Process(const MainloopContext &aMainloop) override;
140*4a64e381SAndroid Build Coastguard Worker 
141*4a64e381SAndroid Build Coastguard Worker     /**
142*4a64e381SAndroid Build Coastguard Worker      * This method posts a task to the timer
143*4a64e381SAndroid Build Coastguard Worker      *
144*4a64e381SAndroid Build Coastguard Worker      * @param[in] aDelay  The delay in milliseconds before executing the task.
145*4a64e381SAndroid Build Coastguard Worker      * @param[in] aTask   The task function.
146*4a64e381SAndroid Build Coastguard Worker      */
147*4a64e381SAndroid Build Coastguard Worker     void PostTimerTask(Milliseconds aDelay, TaskRunner::Task<void> aTask);
148*4a64e381SAndroid Build Coastguard Worker 
149*4a64e381SAndroid Build Coastguard Worker     /**
150*4a64e381SAndroid Build Coastguard Worker      * This method registers a reset handler.
151*4a64e381SAndroid Build Coastguard Worker      *
152*4a64e381SAndroid Build Coastguard Worker      * @param[in] aHandler  The handler function.
153*4a64e381SAndroid Build Coastguard Worker      */
154*4a64e381SAndroid Build Coastguard Worker     void RegisterResetHandler(std::function<void(void)> aHandler);
155*4a64e381SAndroid Build Coastguard Worker 
156*4a64e381SAndroid Build Coastguard Worker     /**
157*4a64e381SAndroid Build Coastguard Worker      * This method resets the OpenThread instance.
158*4a64e381SAndroid Build Coastguard Worker      */
159*4a64e381SAndroid Build Coastguard Worker     void Reset(void);
160*4a64e381SAndroid Build Coastguard Worker 
161*4a64e381SAndroid Build Coastguard Worker     /**
162*4a64e381SAndroid Build Coastguard Worker      * This method returns the Thread protocol version as a string.
163*4a64e381SAndroid Build Coastguard Worker      *
164*4a64e381SAndroid Build Coastguard Worker      * @returns A pointer to the Thread version string.
165*4a64e381SAndroid Build Coastguard Worker      */
166*4a64e381SAndroid Build Coastguard Worker     static const char *GetThreadVersion(void);
167*4a64e381SAndroid Build Coastguard Worker 
168*4a64e381SAndroid Build Coastguard Worker     /**
169*4a64e381SAndroid Build Coastguard Worker      * This method returns the Thread network interface name.
170*4a64e381SAndroid Build Coastguard Worker      *
171*4a64e381SAndroid Build Coastguard Worker      * @returns A pointer to the Thread network interface name string.
172*4a64e381SAndroid Build Coastguard Worker      */
GetInterfaceName(void) const173*4a64e381SAndroid Build Coastguard Worker     const char *GetInterfaceName(void) const override { return mConfig.mInterfaceName; }
174*4a64e381SAndroid Build Coastguard Worker 
175*4a64e381SAndroid Build Coastguard Worker     static otbrLogLevel ConvertToOtbrLogLevel(otLogLevel aLogLevel);
176*4a64e381SAndroid Build Coastguard Worker 
177*4a64e381SAndroid Build Coastguard Worker #if OTBR_ENABLE_FEATURE_FLAGS
178*4a64e381SAndroid Build Coastguard Worker     /**
179*4a64e381SAndroid Build Coastguard Worker      * Apply the feature flag values to OpenThread through OpenThread APIs.
180*4a64e381SAndroid Build Coastguard Worker      *
181*4a64e381SAndroid Build Coastguard Worker      * @param[in] aFeatureFlagList  The feature flag list to be applied to OpenThread.
182*4a64e381SAndroid Build Coastguard Worker      *
183*4a64e381SAndroid Build Coastguard Worker      * @returns The error value of underlying OpenThread API calls.
184*4a64e381SAndroid Build Coastguard Worker      */
185*4a64e381SAndroid Build Coastguard Worker     otError ApplyFeatureFlagList(const FeatureFlagList &aFeatureFlagList);
186*4a64e381SAndroid Build Coastguard Worker 
187*4a64e381SAndroid Build Coastguard Worker     /**
188*4a64e381SAndroid Build Coastguard Worker      * This method returns the applied FeatureFlagList in ApplyFeatureFlagList call.
189*4a64e381SAndroid Build Coastguard Worker      *
190*4a64e381SAndroid Build Coastguard Worker      * @returns the applied FeatureFlagList's serialized bytes.
191*4a64e381SAndroid Build Coastguard Worker      */
GetAppliedFeatureFlagListBytes(void)192*4a64e381SAndroid Build Coastguard Worker     const std::string &GetAppliedFeatureFlagListBytes(void)
193*4a64e381SAndroid Build Coastguard Worker     {
194*4a64e381SAndroid Build Coastguard Worker         return mAppliedFeatureFlagListBytes;
195*4a64e381SAndroid Build Coastguard Worker     }
196*4a64e381SAndroid Build Coastguard Worker #endif
197*4a64e381SAndroid Build Coastguard Worker 
198*4a64e381SAndroid Build Coastguard Worker     ~RcpHost(void) override;
199*4a64e381SAndroid Build Coastguard Worker 
200*4a64e381SAndroid Build Coastguard Worker     // Thread Control virtual methods
201*4a64e381SAndroid Build Coastguard Worker     void Join(const otOperationalDatasetTlvs &aActiveOpDatasetTlvs, const AsyncResultReceiver &aRecevier) override;
202*4a64e381SAndroid Build Coastguard Worker     void Leave(const AsyncResultReceiver &aRecevier) override;
203*4a64e381SAndroid Build Coastguard Worker     void ScheduleMigration(const otOperationalDatasetTlvs &aPendingOpDatasetTlvs,
204*4a64e381SAndroid Build Coastguard Worker                            const AsyncResultReceiver       aReceiver) override;
205*4a64e381SAndroid Build Coastguard Worker     void SetThreadEnabled(bool aEnabled, const AsyncResultReceiver aReceiver) override;
206*4a64e381SAndroid Build Coastguard Worker     void SetCountryCode(const std::string &aCountryCode, const AsyncResultReceiver &aReceiver) override;
207*4a64e381SAndroid Build Coastguard Worker     void GetChannelMasks(const ChannelMasksReceiver &aReceiver, const AsyncResultReceiver &aErrReceiver) override;
208*4a64e381SAndroid Build Coastguard Worker     void SetChannelMaxPowers(const std::vector<ChannelMaxPower> &aChannelMaxPowers,
209*4a64e381SAndroid Build Coastguard Worker                              const AsyncResultReceiver          &aReceiver) override;
210*4a64e381SAndroid Build Coastguard Worker     void AddThreadStateChangedCallback(ThreadStateChangedCallback aCallback) override;
211*4a64e381SAndroid Build Coastguard Worker 
GetCoprocessorType(void)212*4a64e381SAndroid Build Coastguard Worker     CoprocessorType GetCoprocessorType(void) override
213*4a64e381SAndroid Build Coastguard Worker     {
214*4a64e381SAndroid Build Coastguard Worker         return OT_COPROCESSOR_RCP;
215*4a64e381SAndroid Build Coastguard Worker     }
216*4a64e381SAndroid Build Coastguard Worker 
GetCoprocessorVersion(void)217*4a64e381SAndroid Build Coastguard Worker     const char *GetCoprocessorVersion(void) override
218*4a64e381SAndroid Build Coastguard Worker     {
219*4a64e381SAndroid Build Coastguard Worker         return otPlatRadioGetVersionString(mInstance);
220*4a64e381SAndroid Build Coastguard Worker     }
221*4a64e381SAndroid Build Coastguard Worker 
222*4a64e381SAndroid Build Coastguard Worker private:
SafeInvokeAndClear(AsyncResultReceiver & aReceiver,otError aError,const std::string & aErrorInfo="")223*4a64e381SAndroid Build Coastguard Worker     static void SafeInvokeAndClear(AsyncResultReceiver &aReceiver, otError aError, const std::string &aErrorInfo = "")
224*4a64e381SAndroid Build Coastguard Worker     {
225*4a64e381SAndroid Build Coastguard Worker         if (aReceiver)
226*4a64e381SAndroid Build Coastguard Worker         {
227*4a64e381SAndroid Build Coastguard Worker             aReceiver(aError, aErrorInfo);
228*4a64e381SAndroid Build Coastguard Worker             aReceiver = nullptr;
229*4a64e381SAndroid Build Coastguard Worker         }
230*4a64e381SAndroid Build Coastguard Worker     }
231*4a64e381SAndroid Build Coastguard Worker 
HandleStateChanged(otChangedFlags aFlags,void * aContext)232*4a64e381SAndroid Build Coastguard Worker     static void HandleStateChanged(otChangedFlags aFlags, void *aContext)
233*4a64e381SAndroid Build Coastguard Worker     {
234*4a64e381SAndroid Build Coastguard Worker         static_cast<RcpHost *>(aContext)->HandleStateChanged(aFlags);
235*4a64e381SAndroid Build Coastguard Worker     }
236*4a64e381SAndroid Build Coastguard Worker     void HandleStateChanged(otChangedFlags aFlags);
237*4a64e381SAndroid Build Coastguard Worker 
238*4a64e381SAndroid Build Coastguard Worker     static void HandleBackboneRouterDomainPrefixEvent(void                             *aContext,
239*4a64e381SAndroid Build Coastguard Worker                                                       otBackboneRouterDomainPrefixEvent aEvent,
240*4a64e381SAndroid Build Coastguard Worker                                                       const otIp6Prefix                *aDomainPrefix);
241*4a64e381SAndroid Build Coastguard Worker     void        HandleBackboneRouterDomainPrefixEvent(otBackboneRouterDomainPrefixEvent aEvent,
242*4a64e381SAndroid Build Coastguard Worker                                                       const otIp6Prefix                *aDomainPrefix);
243*4a64e381SAndroid Build Coastguard Worker 
244*4a64e381SAndroid Build Coastguard Worker #if OTBR_ENABLE_DUA_ROUTING
245*4a64e381SAndroid Build Coastguard Worker     static void HandleBackboneRouterNdProxyEvent(void                        *aContext,
246*4a64e381SAndroid Build Coastguard Worker                                                  otBackboneRouterNdProxyEvent aEvent,
247*4a64e381SAndroid Build Coastguard Worker                                                  const otIp6Address          *aAddress);
248*4a64e381SAndroid Build Coastguard Worker     void        HandleBackboneRouterNdProxyEvent(otBackboneRouterNdProxyEvent aEvent, const otIp6Address *aAddress);
249*4a64e381SAndroid Build Coastguard Worker #endif
250*4a64e381SAndroid Build Coastguard Worker 
251*4a64e381SAndroid Build Coastguard Worker     static void DisableThreadAfterDetach(void *aContext);
252*4a64e381SAndroid Build Coastguard Worker     void        DisableThreadAfterDetach(void);
253*4a64e381SAndroid Build Coastguard Worker     static void SendMgmtPendingSetCallback(otError aError, void *aContext);
254*4a64e381SAndroid Build Coastguard Worker     void        SendMgmtPendingSetCallback(otError aError);
255*4a64e381SAndroid Build Coastguard Worker 
256*4a64e381SAndroid Build Coastguard Worker     bool IsAutoAttachEnabled(void);
257*4a64e381SAndroid Build Coastguard Worker     void DisableAutoAttach(void);
258*4a64e381SAndroid Build Coastguard Worker 
259*4a64e381SAndroid Build Coastguard Worker     bool IsAttached(void);
260*4a64e381SAndroid Build Coastguard Worker 
261*4a64e381SAndroid Build Coastguard Worker     otError SetOtbrAndOtLogLevel(otbrLogLevel aLevel);
262*4a64e381SAndroid Build Coastguard Worker 
263*4a64e381SAndroid Build Coastguard Worker     otInstance *mInstance;
264*4a64e381SAndroid Build Coastguard Worker 
265*4a64e381SAndroid Build Coastguard Worker     otPlatformConfig                           mConfig;
266*4a64e381SAndroid Build Coastguard Worker     std::unique_ptr<otbr::agent::ThreadHelper> mThreadHelper;
267*4a64e381SAndroid Build Coastguard Worker     std::vector<std::function<void(void)>>     mResetHandlers;
268*4a64e381SAndroid Build Coastguard Worker     TaskRunner                                 mTaskRunner;
269*4a64e381SAndroid Build Coastguard Worker     std::vector<ThreadStateChangedCallback>    mThreadStateChangedCallbacks;
270*4a64e381SAndroid Build Coastguard Worker     bool                                       mEnableAutoAttach = false;
271*4a64e381SAndroid Build Coastguard Worker 
272*4a64e381SAndroid Build Coastguard Worker     AsyncResultReceiver mSetThreadEnabledReceiver;
273*4a64e381SAndroid Build Coastguard Worker     AsyncResultReceiver mScheduleMigrationReceiver;
274*4a64e381SAndroid Build Coastguard Worker 
275*4a64e381SAndroid Build Coastguard Worker #if OTBR_ENABLE_FEATURE_FLAGS
276*4a64e381SAndroid Build Coastguard Worker     // The applied FeatureFlagList in ApplyFeatureFlagList call, used for debugging purpose.
277*4a64e381SAndroid Build Coastguard Worker     std::string mAppliedFeatureFlagListBytes;
278*4a64e381SAndroid Build Coastguard Worker #endif
279*4a64e381SAndroid Build Coastguard Worker };
280*4a64e381SAndroid Build Coastguard Worker 
281*4a64e381SAndroid Build Coastguard Worker } // namespace Ncp
282*4a64e381SAndroid Build Coastguard Worker } // namespace otbr
283*4a64e381SAndroid Build Coastguard Worker 
284*4a64e381SAndroid Build Coastguard Worker #endif // OTBR_AGENT_RCP_HOST_HPP_
285