ESPHome  2024.5.4
Public Member Functions | Protected Attributes
esphome::web_server_idf::AsyncEventSource Class Reference

#include <web_server_idf.h>

Inheritance diagram for esphome::web_server_idf::AsyncEventSource:
esphome::web_server_idf::AsyncWebHandler

Public Member Functions

 AsyncEventSource (std::string url)
 
 ~AsyncEventSource () override
 
bool canHandle (AsyncWebServerRequest *request) override
 
void handleRequest (AsyncWebServerRequest *request) override
 
void onConnect (connect_handler_t cb)
 
void send (const char *message, const char *event=nullptr, uint32_t id=0, uint32_t reconnect=0)
 
size_t count () const
 
- Public Member Functions inherited from esphome::web_server_idf::AsyncWebHandler
virtual ~AsyncWebHandler ()
 
virtual void handleUpload (AsyncWebServerRequest *request, const std::string &filename, size_t index, uint8_t *data, size_t len, bool final)
 
virtual void handleBody (AsyncWebServerRequest *request, uint8_t *data, size_t len, size_t index, size_t total)
 
virtual bool isRequestHandlerTrivial ()
 

Protected Attributes

std::string url_
 
std::set< AsyncEventSourceResponse * > sessions_
 
connect_handler_t on_connect_ {}
 

Detailed Description

Definition at line 235 of file web_server_idf.h.

Constructor & Destructor Documentation

◆ AsyncEventSource()

esphome::web_server_idf::AsyncEventSource::AsyncEventSource ( std::string  url)
inline

Definition at line 240 of file web_server_idf.h.

◆ ~AsyncEventSource()

esphome::web_server_idf::AsyncEventSource::~AsyncEventSource ( )
override

Definition at line 272 of file web_server_idf.cpp.

Member Function Documentation

◆ canHandle()

bool esphome::web_server_idf::AsyncEventSource::canHandle ( AsyncWebServerRequest request)
inlineoverridevirtual

Reimplemented from esphome::web_server_idf::AsyncWebHandler.

Definition at line 244 of file web_server_idf.h.

◆ count()

size_t esphome::web_server_idf::AsyncEventSource::count ( ) const
inline

Definition at line 254 of file web_server_idf.h.

◆ handleRequest()

void esphome::web_server_idf::AsyncEventSource::handleRequest ( AsyncWebServerRequest request)
overridevirtual

Reimplemented from esphome::web_server_idf::AsyncWebHandler.

Definition at line 278 of file web_server_idf.cpp.

◆ onConnect()

void esphome::web_server_idf::AsyncEventSource::onConnect ( connect_handler_t  cb)
inline

Definition at line 250 of file web_server_idf.h.

◆ send()

void esphome::web_server_idf::AsyncEventSource::send ( const char *  message,
const char *  event = nullptr,
uint32_t  id = 0,
uint32_t  reconnect = 0 
)

Definition at line 286 of file web_server_idf.cpp.

Field Documentation

◆ on_connect_

connect_handler_t esphome::web_server_idf::AsyncEventSource::on_connect_ {}
protected

Definition at line 259 of file web_server_idf.h.

◆ sessions_

std::set<AsyncEventSourceResponse *> esphome::web_server_idf::AsyncEventSource::sessions_
protected

Definition at line 258 of file web_server_idf.h.

◆ url_

std::string esphome::web_server_idf::AsyncEventSource::url_
protected

Definition at line 257 of file web_server_idf.h.


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