|
ESPHome 2026.2.2
|
#include <api_frame_helper_plaintext.h>
Public Member Functions | |
| APIPlaintextFrameHelper (std::unique_ptr< socket::Socket > socket) | |
| ~APIPlaintextFrameHelper () override=default | |
| APIError | init () override |
| Initialize the frame helper, returns OK if successful. | |
| APIError | loop () override |
| APIError | read_packet (ReadPacketBuffer *buffer) override |
| APIError | write_protobuf_packet (uint8_t type, ProtoWriteBuffer buffer) override |
| APIError | write_protobuf_messages (ProtoWriteBuffer buffer, std::span< const MessageInfo > messages) override |
Public Member Functions inherited from esphome::api::APIFrameHelper | |
| APIFrameHelper ()=default | |
| APIFrameHelper (std::unique_ptr< socket::Socket > socket) | |
| const char * | get_client_name () const |
| const char * | get_peername_to (std::span< char, socket::SOCKADDR_STR_LEN > buf) const |
| void | set_client_name (const char *name, size_t len) |
| virtual | ~APIFrameHelper ()=default |
| bool | can_write_without_blocking () |
| int | getpeername (struct sockaddr *addr, socklen_t *addrlen) |
| APIError | close () |
| APIError | shutdown (int how) |
| void | set_nodelay_for_message (bool is_log_message) |
| uint8_t | frame_header_padding () const |
| uint8_t | frame_footer_size () const |
| bool | is_socket_ready () const |
| void | release_buffers () |
Protected Member Functions | |
| APIError | try_read_frame_ () |
| Read a packet into the rx_buf_. | |
Protected Member Functions inherited from esphome::api::APIFrameHelper | |
| APIError | write_raw_ (const struct iovec *iov, int iovcnt, uint16_t total_write_len) |
| APIError | try_send_tx_buf_ () |
| void | buffer_data_from_iov_ (const struct iovec *iov, int iovcnt, uint16_t total_write_len, uint16_t offset) |
| APIError | handle_socket_write_error_ () |
| template<typename StateEnum > | |
| APIError | write_raw_ (const struct iovec *iov, int iovcnt, socket::Socket *socket, std::vector< uint8_t > &tx_buf, const std::string &info, StateEnum &state, StateEnum failed_state) |
| void | set_nodelay_raw_ (bool enable) |
| APIError | init_common_ () |
| APIError | handle_socket_read_result_ (ssize_t received) |
Protected Attributes | |
| uint16_t | rx_header_parsed_type_ = 0 |
| uint16_t | rx_header_parsed_len_ = 0 |
| uint8_t | rx_header_buf_ [6] |
| uint8_t | rx_header_buf_pos_ = 0 |
| bool | rx_header_parsed_ = false |
Protected Attributes inherited from esphome::api::APIFrameHelper | |
| std::unique_ptr< socket::Socket > | socket_ |
| std::array< std::unique_ptr< SendBuffer >, API_MAX_SEND_QUEUE > | tx_buf_ |
| std::vector< uint8_t > | rx_buf_ |
| char | client_name_ [CLIENT_INFO_NAME_MAX_LEN] {} |
| uint16_t | rx_buf_len_ = 0 |
| State | state_ {State::INITIALIZE} |
| uint8_t | frame_header_padding_ {0} |
| uint8_t | frame_footer_size_ {0} |
| uint8_t | tx_buf_head_ {0} |
| uint8_t | tx_buf_tail_ {0} |
| uint8_t | tx_buf_count_ {0} |
| int8_t | nodelay_state_ {NODELAY_ON} |
Additional Inherited Members | |
Protected Types inherited from esphome::api::APIFrameHelper | |
| enum class | State : uint8_t { INITIALIZE = 1 , CLIENT_HELLO = 2 , SERVER_HELLO = 3 , HANDSHAKE = 4 , DATA = 5 , CLOSED = 6 , FAILED = 7 , EXPLICIT_REJECT = 8 } |
Static Protected Attributes inherited from esphome::api::APIFrameHelper | |
| static constexpr int8_t | NODELAY_ON = -1 |
| static constexpr int8_t | LOG_NAGLE_COUNT = 2 |
Definition at line 8 of file api_frame_helper_plaintext.h.
|
inlineexplicit |
Definition at line 10 of file api_frame_helper_plaintext.h.
|
overridedefault |
|
overridevirtual |
Initialize the frame helper, returns OK if successful.
Implements esphome::api::APIFrameHelper.
Definition at line 54 of file api_frame_helper_plaintext.cpp.
|
overridevirtual |
Reimplemented from esphome::api::APIFrameHelper.
Definition at line 63 of file api_frame_helper_plaintext.cpp.
|
overridevirtual |
Implements esphome::api::APIFrameHelper.
Definition at line 196 of file api_frame_helper_plaintext.cpp.
|
protected |
Read a packet into the rx_buf_.
error API_ERROR_BAD_INDICATOR: Bad indicator byte at start of frame.
Definition at line 77 of file api_frame_helper_plaintext.cpp.
|
overridevirtual |
Implements esphome::api::APIFrameHelper.
Definition at line 244 of file api_frame_helper_plaintext.cpp.
|
overridevirtual |
Implements esphome::api::APIFrameHelper.
Definition at line 239 of file api_frame_helper_plaintext.cpp.
|
protected |
Definition at line 41 of file api_frame_helper_plaintext.h.
|
protected |
Definition at line 42 of file api_frame_helper_plaintext.h.
|
protected |
Definition at line 43 of file api_frame_helper_plaintext.h.
|
protected |
Definition at line 30 of file api_frame_helper_plaintext.h.
|
protected |
Definition at line 29 of file api_frame_helper_plaintext.h.