|
ESPHome 2025.12.0-dev
|
#include <api_frame_helper_plaintext.h>
Public Member Functions | |
| APIPlaintextFrameHelper (std::unique_ptr< socket::Socket > socket, const ClientInfo *client_info) | |
| ~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_packets (ProtoWriteBuffer buffer, std::span< const PacketInfo > packets) override |
Public Member Functions inherited from esphome::api::APIFrameHelper | |
| APIFrameHelper ()=default | |
| APIFrameHelper (std::unique_ptr< socket::Socket > socket, const ClientInfo *client_info) | |
| virtual | ~APIFrameHelper ()=default |
| bool | can_write_without_blocking () |
| std::string | getpeername () |
| int | getpeername (struct sockaddr *addr, socklen_t *addrlen) |
| APIError | close () |
| APIError | shutdown (int how) |
| uint8_t | frame_header_padding () const |
| uint8_t | frame_footer_size () const |
| bool | is_socket_ready () const |
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) |
| 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 | |
| socket::Socket * | socket_ {nullptr} |
| std::unique_ptr< socket::Socket > | socket_owned_ |
| std::array< std::unique_ptr< SendBuffer >, API_MAX_SEND_QUEUE > | tx_buf_ |
| std::vector< struct iovec > | reusable_iovs_ |
| std::vector< uint8_t > | rx_buf_ |
| const ClientInfo * | client_info_ {nullptr} |
| 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} |
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 } |
Definition at line 8 of file api_frame_helper_plaintext.h.
|
inline |
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 33 of file api_frame_helper_plaintext.cpp.
|
overridevirtual |
Reimplemented from esphome::api::APIFrameHelper.
Definition at line 42 of file api_frame_helper_plaintext.cpp.
|
overridevirtual |
Implements esphome::api::APIFrameHelper.
Definition at line 175 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 56 of file api_frame_helper_plaintext.cpp.
|
overridevirtual |
Implements esphome::api::APIFrameHelper.
Definition at line 219 of file api_frame_helper_plaintext.cpp.
|
overridevirtual |
Implements esphome::api::APIFrameHelper.
Definition at line 224 of file api_frame_helper_plaintext.cpp.
|
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 44 of file api_frame_helper_plaintext.h.
|
protected |
Definition at line 31 of file api_frame_helper_plaintext.h.
|
protected |
Definition at line 30 of file api_frame_helper_plaintext.h.