ESPHome 2026.3.0-dev
Loading...
Searching...
No Matches
lwip_fast_select.h
Go to the documentation of this file.
1#pragma once
2
3// Fast socket monitoring for ESP32 and LibreTiny (LwIP >= 2.1.3)
4// Replaces lwip_select() with direct rcvevent reads and FreeRTOS task notifications.
5
6#include <stdbool.h>
7
8#ifdef __cplusplus
9extern "C" {
10#endif
11
15
21
25void esphome_lwip_hook_socket(int fd);
26
30
34void esphome_lwip_wake_main_loop_from_isr(int *px_higher_priority_task_woken);
35
39#ifdef USE_ESP32
41#endif
42
43#ifdef __cplusplus
44}
45#endif
void esphome_lwip_fast_select_init(void)
Initialize fast select — must be called from the main loop task during setup().
bool esphome_lwip_socket_has_data(int fd)
Check if a LwIP socket has data ready via direct rcvevent read (~215 ns per socket).
void esphome_lwip_wake_main_loop_any_context(void)
Wake the main loop task from any context (ISR, thread, or main loop).
void esphome_lwip_hook_socket(int fd)
Hook a socket's netconn callback to notify the main loop task on receive events.
void esphome_lwip_wake_main_loop_from_isr(int *px_higher_priority_task_woken)
Wake the main loop task from an ISR — costs <1 us.
void esphome_lwip_wake_main_loop(void)
Wake the main loop task from another FreeRTOS task — costs <1 us.