|
ESPHome 2026.11.0b6
|
RFB (VNC) client that draws the remote framebuffer into a display. More...
#include <vnc_client.h>
Public Member Functions | |
| VncClient (display::Display *display, bool big_endian=false) | |
| void | set_host (const char *host) |
| void | set_port (uint16_t port) |
| void | set_reconnect_interval (uint32_t ms) |
| void | set_update_delay (uint32_t ms) |
| void | set_max_update_delay (uint32_t ms) |
| void | set_pixel_format (VncPixelFormat format) |
| void | set_auth_key (const uint8_t *key) |
| 8 bytes, already bit-reversed for VNC, may live in PROGMEM. | |
| void | register_touchscreen (touchscreen::Touchscreen *touchscreen) |
| void | touch (touchscreen::TouchPoint tp) override |
| void | update (const touchscreen::TouchPoints_t &tpoints) override |
| void | release () override |
| void | setup () override |
| void | loop () override |
| void | dump_config () override |
| void | on_shutdown () override |
| float | get_setup_priority () const override |
| bool | is_connected () const |
| void | connect () |
| Retry now, also after an authentication failure or disconnect(). | |
| void | disconnect () |
| Close the session and stop retrying until connect(). | |
| void | refresh () |
| Ask the server for the whole screen again. | |
| bool | send_pointer (uint16_t x, uint16_t y, uint8_t buttons) |
| void | send_key (uint32_t keysym, VncKeyAction action) |
| void | type_text (const char *text, size_t len) |
| void | type_text (const std::string &text) |
| template<typename F > | |
| void | add_on_connect_callback (F &&callback) |
| template<typename F > | |
| void | add_on_disconnect_callback (F &&callback) |
Public Member Functions inherited from esphome::Component | |
| float | get_actual_setup_priority () const |
| void | set_setup_priority (float priority) |
| void | call () |
| virtual void | on_safe_shutdown () |
| virtual bool | teardown () |
| Called during teardown to allow component to gracefully finish operations. | |
| virtual void | on_powerdown () |
| Called last before a reboot or deep sleep to power down hardware. | |
| uint8_t | get_component_state () const |
| void | reset_to_construction_state () |
| Reset this component back to the construction state to allow setup to run again. | |
| bool | is_in_loop_state () const |
| Check if this component has completed setup and is in the loop state. | |
| bool | is_idle () const |
| Check if this component is idle. | |
| void | mark_failed () |
| Mark this component as failed. | |
| void | mark_failed (const LogString *message) |
| bool ESPHOME_ALWAYS_INLINE | setup_check (bool ok) |
Marks the component failed with message (default "Communication failed") unless ok; returns ok. | |
| bool ESPHOME_ALWAYS_INLINE | setup_check (bool ok, const LogString *message) |
| void | disable_loop () |
| Disable this component's loop. | |
| void | enable_loop () |
| Enable this component's loop. | |
| void | enable_loop_soon_any_context () |
| Thread and ISR-safe version of enable_loop() that can be called from any context. | |
| bool | is_failed () const |
| bool | is_ready () const |
| virtual bool | can_proceed () |
| bool | status_has_warning () const |
| bool | status_has_error () const |
| void | status_set_warning () |
| void | status_set_warning (const char *message) |
| void | status_set_warning (const LogString *message) |
| bool | status_comm_result (bool ok) |
Clears the warning when ok, else sets it with message (default "Communication failed"); returns ok. | |
| bool | status_comm_result (bool ok, const LogString *message) |
| void | status_set_error () |
| void | status_set_error (const LogString *message) |
| void | status_clear_warning () |
| void | status_clear_error () |
| ESPDEPRECATED ("Use status_momentary_warning() without a name. Removed in 2027.5.0", "2026.11.0") void status_momentary_warning(const char *name | |
| void | status_momentary_warning (uint32_t length=5000) |
Set warning status flag and clear it after length ms. | |
| void | status_momentary_warning (const LogString *message, uint32_t length=5000) |
| ESPDEPRECATED ("Use status_momentary_error() without a name. Removed in 2027.5.0", "2026.11.0") void status_momentary_error(const char *name | |
| void | status_momentary_error (uint32_t length=5000) |
Set error status flag and clear it after length ms. | |
| void | status_momentary_error (const LogString *message, uint32_t length=5000) |
| bool | has_overridden_loop () const |
| const LogString * | get_component_log_str () const ESPHOME_ALWAYS_INLINE |
| Get the integration where this component was declared as a LogString for logging. | |
| bool | should_warn_of_blocking (uint32_t blocking_time, uint32_t &threshold_ms_out) |
Public Member Functions inherited from esphome::touchscreen::TouchListener | |
Protected Member Functions | |
| void | connect_step_ (uint32_t now) |
| void | start_handshake_ (uint32_t now) |
| void | service_rx_ (uint32_t now) |
| VncParse | parse_ () |
| void | pace_ (uint32_t now) |
| bool | start_session_ (uint32_t now) |
| bool | send_client_init_ () |
| bool | select_security_ (uint8_t type) |
| bool | has_auth_key_ () const |
| void | frame_done_ () |
| void | rect_done_ () |
| void | next_tile_ () |
| void | draw_tile_ () |
| uint32_t | tile_hash_ () const |
| void | clear_tiles_ () |
| void | forget_tiles_ (uint16_t x, uint16_t y, uint16_t w, uint16_t h) |
| void | draw_row_ (uint16_t x, uint16_t y, uint16_t count, const uint8_t *pixels) |
| void | fill_tile_ (uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *pixel) |
| void | skip_ (uint32_t count, VncStep next) |
| bool | budget_exhausted_ () const |
| bool | send_ (const uint8_t *data, size_t len) |
| bool | send_update_request_ (bool incremental, uint32_t now) |
| bool | send_key_event_ (uint32_t keysym, VncKeyAction action) |
| bool | send_input_ (const uint8_t *msg, size_t len, bool release) |
| bool | send_pending_ () |
| void | note_input_ () |
| void | handle_touch_ (uint16_t x, uint16_t y) |
| Touch input in display coordinates. | |
| void | handle_release_ () |
| VncParse | fail_ (VncFailure failure, const LogString *reason) |
| VncParse | fail_send_ () |
| VncFailure | lost_failure_ () const |
| void | session_lost_ (uint32_t now) |
| void | session_end_ (uint32_t now, VncFailure failure, const LogString *reason) |
| void | schedule_retry_ (uint32_t now, VncFailure failure, const LogString *reason, bool was_running) |
| void | reset_session_ () |
| void | clear_link_warning_ () |
Protected Member Functions inherited from esphome::Component | |
| friend | void::setup () |
| friend | void::original_setup () |
| void | set_component_source_ (uint8_t index) |
| Set where this component was loaded from for some debug messages. | |
| virtual void | call_setup () |
| void | call_dump_config_ () |
| void | enable_loop_slow_path_ () |
| void | set_component_state_ (uint8_t state) |
| Helper to set component state (clears state bits and sets new state) | |
| bool | set_status_flag_ (uint8_t flag) |
| Helper to set a status LED flag on both this component and the app. | |
| bool | set_error_flag_ (const LogString *message) |
| Set the error flag and log it; true when it was not set before. | |
| void | set_interval (const char *name, uint32_t interval, std::function< void()> &&f) |
| Set an interval function with a const char* name. | |
| void | set_interval (uint32_t id, uint32_t interval, std::function< void()> &&f) |
| Set an interval function with a numeric ID (zero heap allocation). | |
| void | set_interval (InternalSchedulerID id, uint32_t interval, std::function< void()> &&f) |
| void | set_interval (uint32_t interval, std::function< void()> &&f) |
| bool | cancel_interval (const char *name) |
| Cancel an interval function. | |
| bool | cancel_interval (uint32_t id) |
| bool | cancel_interval (InternalSchedulerID id) |
| void | set_timeout (const char *name, uint32_t timeout, std::function< void()> &&f) |
| Set a timeout function with a const char* name. | |
| void | set_timeout (uint32_t id, uint32_t timeout, std::function< void()> &&f) |
| Set a timeout function with a numeric ID (zero heap allocation). | |
| void | set_timeout (InternalSchedulerID id, uint32_t timeout, std::function< void()> &&f) |
| void | set_timeout (uint32_t timeout, std::function< void()> &&f) |
| bool | cancel_timeout (const char *name) |
| Cancel a timeout function. | |
| bool | cancel_timeout (uint32_t id) |
| bool | cancel_timeout (InternalSchedulerID id) |
| void | defer (const char *name, std::function< void()> &&f) |
| Defer a callback to the next loop() call with a const char* name. | |
| void | defer (std::function< void()> &&f) |
| Defer a callback to the next loop() call. | |
| void | defer (uint32_t id, std::function< void()> &&f) |
| Defer a callback with a numeric ID (zero heap allocation) | |
| bool | cancel_defer (const char *name) |
| Cancel a defer callback using the specified name, name must not be empty. | |
| bool | cancel_defer (uint32_t id) |
| void | status_clear_warning_slow_path_ () |
| void | status_clear_error_slow_path_ () |
Static Protected Attributes | |
| static constexpr size_t | RX_BUFFER_SIZE = 512 |
| static constexpr size_t | TILE_BUFFER_SIZE = 16 * 16 * 2 |
| static constexpr uint32_t | INPUT_BOOST_MS = 2000 |
| static constexpr size_t | KEY_EVENT_SIZE = 8 |
| static constexpr size_t | POINTER_EVENT_SIZE = 6 |
| static constexpr size_t | MAX_PENDING_RELEASES = 4 |
Additional Inherited Members | |
Data Fields inherited from esphome::Component | |
| uint32_t | length = 5000) |
RFB (VNC) client that draws the remote framebuffer into a display.
Definition at line 75 of file vnc_client.h.
|
inlineexplicit |
Definition at line 82 of file vnc_client.h.
|
inline |
Definition at line 125 of file vnc_client.h.
|
inline |
Definition at line 128 of file vnc_client.h.
|
protected |
Definition at line 515 of file vnc_client.cpp.
|
protected |
Definition at line 369 of file vnc_client.cpp.
|
protected |
Definition at line 164 of file vnc_client.cpp.
| void esphome::vnc::VncClient::connect | ( | ) |
Retry now, also after an authentication failure or disconnect().
Definition at line 308 of file vnc_client.cpp.
|
protected |
Definition at line 342 of file vnc_client.cpp.
| void esphome::vnc::VncClient::disconnect | ( | ) |
Close the session and stop retrying until connect().
Definition at line 327 of file vnc_client.cpp.
|
protected |
Definition at line 1000 of file vnc_client.cpp.
|
protected |
Definition at line 1009 of file vnc_client.cpp.
|
overridevirtual |
Reimplemented from esphome::Component.
Definition at line 170 of file vnc_client.cpp.
|
protected |
Definition at line 433 of file vnc_client.cpp.
|
inlineprotected |
Definition at line 183 of file vnc_client.h.
|
protected |
Definition at line 1069 of file vnc_client.cpp.
|
protected |
Definition at line 1056 of file vnc_client.cpp.
|
protected |
Definition at line 982 of file vnc_client.cpp.
|
inlineoverridevirtual |
Reimplemented from esphome::Component.
Definition at line 108 of file vnc_client.h.
|
protected |
Definition at line 1336 of file vnc_client.cpp.
|
protected |
Touch input in display coordinates.
Definition at line 1308 of file vnc_client.cpp.
|
inlineprotected |
Definition at line 151 of file vnc_client.h.
|
inline |
Definition at line 110 of file vnc_client.h.
|
overridevirtual |
Reimplemented from esphome::Component.
Definition at line 193 of file vnc_client.cpp.
|
protected |
Definition at line 414 of file vnc_client.cpp.
|
protected |
Definition at line 968 of file vnc_client.cpp.
|
protected |
Definition at line 1268 of file vnc_client.cpp.
|
overridevirtual |
Reimplemented from esphome::Component.
Definition at line 191 of file vnc_client.cpp.
|
protected |
Definition at line 1164 of file vnc_client.cpp.
|
protected |
Definition at line 579 of file vnc_client.cpp.
|
protected |
Definition at line 960 of file vnc_client.cpp.
| void esphome::vnc::VncClient::refresh | ( | ) |
Ask the server for the whole screen again.
Definition at line 159 of file vnc_client.cpp.
|
inline |
Definition at line 95 of file vnc_client.h.
|
overridevirtual |
Reimplemented from esphome::touchscreen::TouchListener.
Definition at line 133 of file vnc_client.cpp.
|
protected |
Definition at line 376 of file vnc_client.cpp.
|
protected |
Definition at line 449 of file vnc_client.cpp.
|
protected |
Definition at line 563 of file vnc_client.cpp.
|
protected |
Definition at line 1181 of file vnc_client.cpp.
|
protected |
Definition at line 558 of file vnc_client.cpp.
|
protected |
Definition at line 1217 of file vnc_client.cpp.
| void esphome::vnc::VncClient::send_key | ( | uint32_t | keysym, |
| VncKeyAction | action ) |
Definition at line 1270 of file vnc_client.cpp.
|
protected |
Definition at line 1205 of file vnc_client.cpp.
|
protected |
Definition at line 1234 of file vnc_client.cpp.
| bool esphome::vnc::VncClient::send_pointer | ( | uint16_t | x, |
| uint16_t | y, | ||
| uint8_t | buttons ) |
Definition at line 1247 of file vnc_client.cpp.
|
protected |
Definition at line 1192 of file vnc_client.cpp.
|
protected |
Definition at line 517 of file vnc_client.cpp.
|
protected |
Definition at line 440 of file vnc_client.cpp.
|
protected |
Definition at line 429 of file vnc_client.cpp.
|
inline |
8 bytes, already bit-reversed for VNC, may live in PROGMEM.
Definition at line 92 of file vnc_client.h.
|
inline |
Definition at line 84 of file vnc_client.h.
|
inline |
Definition at line 88 of file vnc_client.h.
|
inline |
Definition at line 89 of file vnc_client.h.
|
inline |
Definition at line 85 of file vnc_client.h.
|
inline |
Definition at line 86 of file vnc_client.h.
|
inline |
Definition at line 87 of file vnc_client.h.
|
overridevirtual |
Reimplemented from esphome::Component.
Definition at line 136 of file vnc_client.cpp.
Definition at line 552 of file vnc_client.cpp.
|
protected |
Definition at line 407 of file vnc_client.cpp.
|
protected |
Definition at line 1091 of file vnc_client.cpp.
|
protected |
Definition at line 1038 of file vnc_client.cpp.
|
overridevirtual |
Reimplemented from esphome::touchscreen::TouchListener.
Definition at line 118 of file vnc_client.cpp.
| void esphome::vnc::VncClient::type_text | ( | const char * | text, |
| size_t | len ) |
Definition at line 1280 of file vnc_client.cpp.
|
inline |
Definition at line 122 of file vnc_client.h.
|
overridevirtual |
Reimplemented from esphome::touchscreen::TouchListener.
Definition at line 124 of file vnc_client.cpp.
|
protected |
Definition at line 275 of file vnc_client.h.
|
protected |
Definition at line 282 of file vnc_client.h.
|
protected |
Definition at line 194 of file vnc_client.h.
|
protected |
Definition at line 281 of file vnc_client.h.
|
protected |
Definition at line 205 of file vnc_client.h.
|
protected |
Definition at line 301 of file vnc_client.h.
|
protected |
Definition at line 271 of file vnc_client.h.
|
protected |
Definition at line 260 of file vnc_client.h.
|
protected |
Definition at line 209 of file vnc_client.h.
|
protected |
Definition at line 293 of file vnc_client.h.
|
protected |
Definition at line 196 of file vnc_client.h.
|
protected |
Definition at line 197 of file vnc_client.h.
|
protected |
Definition at line 191 of file vnc_client.h.
|
protected |
Definition at line 292 of file vnc_client.h.
|
protected |
Definition at line 291 of file vnc_client.h.
|
protected |
Definition at line 298 of file vnc_client.h.
|
protected |
Definition at line 240 of file vnc_client.h.
|
protected |
Definition at line 228 of file vnc_client.h.
|
protected |
Definition at line 227 of file vnc_client.h.
|
protected |
Definition at line 213 of file vnc_client.h.
|
protected |
Definition at line 288 of file vnc_client.h.
|
protected |
Definition at line 297 of file vnc_client.h.
|
protected |
Definition at line 241 of file vnc_client.h.
|
protected |
Definition at line 242 of file vnc_client.h.
|
protected |
Definition at line 268 of file vnc_client.h.
|
protected |
Definition at line 243 of file vnc_client.h.
|
protected |
Definition at line 269 of file vnc_client.h.
|
protected |
Definition at line 270 of file vnc_client.h.
|
protected |
Definition at line 198 of file vnc_client.h.
|
protected |
Definition at line 206 of file vnc_client.h.
|
protected |
Definition at line 207 of file vnc_client.h.
|
protected |
Definition at line 284 of file vnc_client.h.
|
staticconstexprprotected |
Definition at line 137 of file vnc_client.h.
|
staticconstexprprotected |
Definition at line 138 of file vnc_client.h.
|
protected |
Definition at line 214 of file vnc_client.h.
|
protected |
Definition at line 216 of file vnc_client.h.
|
protected |
Definition at line 220 of file vnc_client.h.
|
protected |
Definition at line 221 of file vnc_client.h.
|
protected |
Definition at line 192 of file vnc_client.h.
|
staticconstexprprotected |
Definition at line 140 of file vnc_client.h.
|
protected |
Definition at line 204 of file vnc_client.h.
|
protected |
Definition at line 261 of file vnc_client.h.
|
protected |
Definition at line 287 of file vnc_client.h.
|
protected |
Definition at line 295 of file vnc_client.h.
|
protected |
Definition at line 222 of file vnc_client.h.
|
protected |
Definition at line 306 of file vnc_client.h.
|
protected |
Definition at line 255 of file vnc_client.h.
|
protected |
Definition at line 272 of file vnc_client.h.
|
staticconstexprprotected |
Definition at line 139 of file vnc_client.h.
|
protected |
Definition at line 237 of file vnc_client.h.
|
protected |
Definition at line 238 of file vnc_client.h.
|
protected |
Definition at line 249 of file vnc_client.h.
|
protected |
Definition at line 250 of file vnc_client.h.
|
protected |
Definition at line 254 of file vnc_client.h.
|
protected |
Definition at line 245 of file vnc_client.h.
|
protected |
Definition at line 246 of file vnc_client.h.
|
protected |
Definition at line 276 of file vnc_client.h.
|
protected |
Definition at line 235 of file vnc_client.h.
|
protected |
Definition at line 234 of file vnc_client.h.
|
protected |
Definition at line 232 of file vnc_client.h.
|
protected |
Definition at line 233 of file vnc_client.h.
|
protected |
Definition at line 231 of file vnc_client.h.
|
protected |
Definition at line 286 of file vnc_client.h.
|
protected |
Definition at line 294 of file vnc_client.h.
|
protected |
Definition at line 285 of file vnc_client.h.
|
protected |
Definition at line 303 of file vnc_client.h.
|
staticconstexprprotected |
Definition at line 133 of file vnc_client.h.
|
protected |
Definition at line 226 of file vnc_client.h.
|
protected |
Definition at line 278 of file vnc_client.h.
|
protected |
Definition at line 225 of file vnc_client.h.
|
protected |
Definition at line 218 of file vnc_client.h.
|
protected |
Definition at line 265 of file vnc_client.h.
|
protected |
Definition at line 263 of file vnc_client.h.
|
protected |
Definition at line 210 of file vnc_client.h.
|
protected |
Definition at line 208 of file vnc_client.h.
|
protected |
Definition at line 223 of file vnc_client.h.
|
protected |
Definition at line 273 of file vnc_client.h.
|
protected |
Definition at line 274 of file vnc_client.h.
|
protected |
Definition at line 289 of file vnc_client.h.
|
protected |
Definition at line 259 of file vnc_client.h.
|
protected |
Definition at line 266 of file vnc_client.h.
|
protected |
Definition at line 308 of file vnc_client.h.
|
staticconstexprprotected |
Definition at line 134 of file vnc_client.h.
|
protected |
Definition at line 239 of file vnc_client.h.
|
protected |
Definition at line 258 of file vnc_client.h.
|
protected |
Definition at line 201 of file vnc_client.h.
|
protected |
Definition at line 290 of file vnc_client.h.
|
protected |
Definition at line 257 of file vnc_client.h.
|
protected |
Definition at line 299 of file vnc_client.h.
|
protected |
Definition at line 203 of file vnc_client.h.
|
protected |
Definition at line 219 of file vnc_client.h.
|
protected |
Definition at line 211 of file vnc_client.h.
|
protected |
Definition at line 230 of file vnc_client.h.
|
protected |
Definition at line 229 of file vnc_client.h.