ESPHome 2026.12.0-dev
Loading...
Searching...
No Matches
esphome::web_server_base::StallClock Class Reference

How long sends have made no progress. More...

#include <stream_head.h>

Public Member Functions

void start (uint32_t now)
 Starts the clock; a running clock keeps its start time.
 
void clear ()
 
bool is_running () const
 
bool is_expired (uint32_t now, uint32_t timeout_ms) const
 True once the clock has run for timeout_ms.
 
uint32_t elapsed (uint32_t now) const
 
bool start_or_expired (uint32_t now, uint32_t timeout_ms)
 Starts the clock if needed; true once it has run for timeout_ms.
 

Protected Attributes

uint32_t started_ms_ {0}
 

Detailed Description

How long sends have made no progress.

Zero means not running, so a start at millis() == 0 records 1. The comparison is wraparound safe across a millis() rollover.

Definition at line 174 of file stream_head.h.

Member Function Documentation

◆ clear()

void esphome::web_server_base::StallClock::clear ( )
inline

Definition at line 182 of file stream_head.h.

◆ elapsed()

uint32_t esphome::web_server_base::StallClock::elapsed ( uint32_t now) const
inline

Definition at line 188 of file stream_head.h.

◆ is_expired()

bool esphome::web_server_base::StallClock::is_expired ( uint32_t now,
uint32_t timeout_ms ) const
inline

True once the clock has run for timeout_ms.

Definition at line 185 of file stream_head.h.

◆ is_running()

bool esphome::web_server_base::StallClock::is_running ( ) const
inline

Definition at line 183 of file stream_head.h.

◆ start()

void esphome::web_server_base::StallClock::start ( uint32_t now)
inline

Starts the clock; a running clock keeps its start time.

Definition at line 177 of file stream_head.h.

◆ start_or_expired()

bool esphome::web_server_base::StallClock::start_or_expired ( uint32_t now,
uint32_t timeout_ms )
inline

Starts the clock if needed; true once it has run for timeout_ms.

Definition at line 190 of file stream_head.h.

Field Documentation

◆ started_ms_

uint32_t esphome::web_server_base::StallClock::started_ms_ {0}
protected

Definition at line 196 of file stream_head.h.


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