openthread-br  0.3.0-72c0388
Public Types | Public Member Functions | Static Public Member Functions | List of all members
otbr::Ncp::ControllerOpenThread Class Reference

#include <src/ncp/ncp_openthread.hpp>

Inheritance diagram for otbr::Ncp::ControllerOpenThread:
otbr::MainloopProcessor

Public Types

using ThreadStateChangedCallback = std::function< void(otChangedFlags aFlags)>
 

Public Member Functions

 ControllerOpenThread (const char *aInterfaceName, const std::vector< const char * > &aRadioUrls, const char *aBackboneInterfaceName, bool aDryRun, bool aEnableAutoAttach)
 
void Init (void)
 
void Deinit (void)
 
otInstance * GetInstance (void)
 
otbr::agent::ThreadHelperGetThreadHelper (void)
 
void Update (MainloopContext &aMainloop) override
 
void Process (const MainloopContext &aMainloop) override
 
void PostTimerTask (Milliseconds aDelay, TaskRunner::Task< void > aTask)
 
void RegisterResetHandler (std::function< void(void)> aHandler)
 
void AddThreadStateChangedCallback (ThreadStateChangedCallback aCallback)
 
void Reset (void)
 
const char * GetInterfaceName (void) const
 

Static Public Member Functions

static const char * GetThreadVersion (void)
 
static otbrLogLevel ConvertToOtbrLogLevel (otLogLevel aLogLevel)
 

Detailed Description

This interface defines NCP Controller functionality.

Constructor & Destructor Documentation

◆ ControllerOpenThread()

otbr::Ncp::ControllerOpenThread::ControllerOpenThread ( const char *  aInterfaceName,
const std::vector< const char * > &  aRadioUrls,
const char *  aBackboneInterfaceName,
bool  aDryRun,
bool  aEnableAutoAttach 
)

This constructor initializes this object.

Parameters
[in]aInterfaceNameA string of the NCP interface name.
[in]aRadioUrlsThe radio URLs (can be IEEE802.15.4 or TREL radio).
[in]aBackboneInterfaceNameThe Backbone network interface name.
[in]aDryRunTRUE to indicate dry-run mode. FALSE otherwise.
[in]aEnableAutoAttachWhether or not to automatically attach to the saved network.

Member Function Documentation

◆ AddThreadStateChangedCallback()

void otbr::Ncp::ControllerOpenThread::AddThreadStateChangedCallback ( ThreadStateChangedCallback  aCallback)

This method adds a event listener for Thread state changes.

Parameters
[in]aCallbackThe callback to receive Thread state changed events.

◆ Deinit()

void otbr::Ncp::ControllerOpenThread::Deinit ( void  )

This method deinitialize the NCP controller.

◆ GetInstance()

otInstance* otbr::Ncp::ControllerOpenThread::GetInstance ( void  )
inline

This method get mInstance pointer.

Return values
Thepointer of mInstance.

◆ GetInterfaceName()

const char* otbr::Ncp::ControllerOpenThread::GetInterfaceName ( void  ) const
inline

This method returns the Thread network interface name.

Returns
A pointer to the Thread network interface name string.

◆ GetThreadHelper()

otbr::agent::ThreadHelper* otbr::Ncp::ControllerOpenThread::GetThreadHelper ( void  )
inline

This method gets the thread functionality helper.

Return values
Thepointer to the helper object.

◆ GetThreadVersion()

const char * otbr::Ncp::ControllerOpenThread::GetThreadVersion ( void  )
static

This method returns the Thread protocol version as a string.

Returns
A pointer to the Thread version string.

◆ Init()

void otbr::Ncp::ControllerOpenThread::Init ( void  )

This method initialize the NCP controller.

◆ PostTimerTask()

void otbr::Ncp::ControllerOpenThread::PostTimerTask ( Milliseconds  aDelay,
TaskRunner::Task< void >  aTask 
)

This method posts a task to the timer

Parameters
[in]aDelayThe delay in milliseconds before executing the task.
[in]aTaskThe task function.

◆ Process()

void otbr::Ncp::ControllerOpenThread::Process ( const MainloopContext aMainloop)
overridevirtual

This method processes mainloop events.

Parameters
[in]aMainloopA reference to the mainloop context.

Implements otbr::MainloopProcessor.

◆ RegisterResetHandler()

void otbr::Ncp::ControllerOpenThread::RegisterResetHandler ( std::function< void(void)>  aHandler)

This method registers a reset handler.

Parameters
[in]aHandlerThe handler function.

◆ Reset()

void otbr::Ncp::ControllerOpenThread::Reset ( void  )

This method resets the OpenThread instance.

◆ Update()

void otbr::Ncp::ControllerOpenThread::Update ( MainloopContext aMainloop)
overridevirtual

This method updates the mainloop context.

Parameters
[in,out]aMainloopA reference to the mainloop to be updated.

Implements otbr::MainloopProcessor.


The documentation for this class was generated from the following files: