ESPHome 2026.8.0-dev
Loading...
Searching...
No Matches
esphome::openthread::OpenThreadComponentBaseAction Class Referenceabstract

Base class allowing to fetch OpenThread lock from parent component while applying action. More...

#include <automation.h>

Inheritance diagram for esphome::openthread::OpenThreadComponentBaseAction:
esphome::Parented< OpenThreadComponent > esphome::openthread::OpenThreadComponentPollPeriodAction< Ts >

Public Member Functions

 OpenThreadComponentBaseAction (OpenThreadComponent *ot)
 
- Public Member Functions inherited from esphome::Parented< OpenThreadComponent >
 Parented ()
 
 Parented (OpenThreadComponent *parent)
 
OpenThreadComponent * get_parent () const
 Get the parent of this object.
 
void set_parent (OpenThreadComponent *parent)
 Set the parent of this object.
 

Protected Member Functions

virtual void apply_locked (otInstance *instance)=0
 Handler to implement in subclass for applying action parts that need lock.
 
void lock_and_apply_ ()
 Fetch OT lock and then call apply_locked.
 
void warn_ftd_no_op_ ()
 Log a warning that this action has no effect on FTD devices.
 

Static Protected Attributes

static constexpr uint32_t LOCK_ACQUIRE_TIMEOUT_MS = 100
 Timeout (ms) for acquiring OT lock.
 

Additional Inherited Members

- Protected Attributes inherited from esphome::Parented< OpenThreadComponent >
OpenThreadComponent * parent_
 

Detailed Description

Base class allowing to fetch OpenThread lock from parent component while applying action.

  • Nontemplate aspects belong here to avoid template bloat.
  • Subclasses implement virtual action method that is called under lock.
  • Seal leaf subclasses via final to support devirtualization.

Definition at line 18 of file automation.h.

Constructor & Destructor Documentation

◆ OpenThreadComponentBaseAction()

esphome::openthread::OpenThreadComponentBaseAction::OpenThreadComponentBaseAction ( OpenThreadComponent * ot)
inlineexplicit

Definition at line 21 of file automation.h.

Member Function Documentation

◆ apply_locked()

virtual void esphome::openthread::OpenThreadComponentBaseAction::apply_locked ( otInstance * instance)
protectedpure virtual

Handler to implement in subclass for applying action parts that need lock.

Implemented in esphome::openthread::OpenThreadComponentPollPeriodAction< Ts >.

◆ lock_and_apply_()

void esphome::openthread::OpenThreadComponentBaseAction::lock_and_apply_ ( )
protected

Fetch OT lock and then call apply_locked.

Definition at line 16 of file automation.cpp.

◆ warn_ftd_no_op_()

void esphome::openthread::OpenThreadComponentBaseAction::warn_ftd_no_op_ ( )
protected

Log a warning that this action has no effect on FTD devices.

Definition at line 12 of file automation.cpp.

Field Documentation

◆ LOCK_ACQUIRE_TIMEOUT_MS

uint32_t esphome::openthread::OpenThreadComponentBaseAction::LOCK_ACQUIRE_TIMEOUT_MS = 100
staticconstexprprotected

Timeout (ms) for acquiring OT lock.

Definition at line 34 of file automation.h.


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