Skip to content

File espos_httpd_sse.h

FileList > espos_httpd > include > espos_httpd_sse.h

Go to the source code of this file

  • #include <stdbool.h>
  • #include "esp_err.h"

Public Types

Type Name
typedef void(* espos_httpd_sse_connect_cb_t
Called (on the server task) each time a client connects, so a component can push its current snapshot to just that client.

Public Functions

Type Name
int espos_httpd_sse_client_count (void)
esp_err_t espos_httpd_sse_on_connect (espos_httpd_sse_connect_cb_t cb, void * arg)
esp_err_t espos_httpd_sse_publish (const char * event, const char * json)
Broadcast to every connected client.
esp_err_t espos_httpd_sse_send (int client, const char * event, const char * json)
Send to one client (valid inside an on-connect callback).

Public Types Documentation

typedef espos_httpd_sse_connect_cb_t

Called (on the server task) each time a client connects, so a component can push its current snapshot to just that client.

typedef void(* espos_httpd_sse_connect_cb_t) (int client, void *arg);

Small fixed table.


Public Functions Documentation

function espos_httpd_sse_client_count

int espos_httpd_sse_client_count (
    void
) 

function espos_httpd_sse_on_connect

esp_err_t espos_httpd_sse_on_connect (
    espos_httpd_sse_connect_cb_t cb,
    void * arg
) 

function espos_httpd_sse_publish

Broadcast to every connected client.

esp_err_t espos_httpd_sse_publish (
    const char * event,
    const char * json
) 

Returns ESP_OK even with 0 clients.


function espos_httpd_sse_send

Send to one client (valid inside an on-connect callback).

esp_err_t espos_httpd_sse_send (
    int client,
    const char * event,
    const char * json
) 



The documentation for this class was generated from the following file espos_httpd/include/espos_httpd_sse.h