#include <api_frame_helper_noise.h>
 | 
| APIError  | state_action_ () | 
|   | To be called from read/write methods.  
  | 
|   | 
| APIError  | try_read_frame_ () | 
|   | Read a packet into the rx_buf_.  
  | 
|   | 
| APIError  | write_frame_ (const uint8_t *data, uint16_t len) | 
|   | 
| APIError  | init_handshake_ () | 
|   | Initiate the data structures for the handshake.  
  | 
|   | 
| APIError  | check_handshake_finished_ () | 
|   | 
| void  | send_explicit_handshake_reject_ (const LogString *reason) | 
|   | 
| APIError  | handle_handshake_frame_error_ (APIError aerr) | 
|   | 
| APIError  | handle_noise_error_ (int err, const LogString *func_name, APIError api_err) | 
|   | 
| 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) | 
|   | 
Definition at line 10 of file api_frame_helper_noise.h.
 
◆ APINoiseFrameHelper()
◆ ~APINoiseFrameHelper()
  
  
      
        
          | esphome::api::APINoiseFrameHelper::~APINoiseFrameHelper  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
override   | 
  
 
 
◆ check_handshake_finished_()
  
  
      
        
          | APIError esphome::api::APINoiseFrameHelper::check_handshake_finished_  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
protected   | 
  
 
 
◆ handle_handshake_frame_error_()
  
  
      
        
          | APIError esphome::api::APINoiseFrameHelper::handle_handshake_frame_error_  | 
          ( | 
          APIError |           aerr | ) | 
           | 
         
       
   | 
  
protected   | 
  
 
 
◆ handle_noise_error_()
  
  
      
        
          | APIError esphome::api::APINoiseFrameHelper::handle_noise_error_  | 
          ( | 
          int |           err,  | 
         
        
           | 
           | 
          const LogString * |           func_name,  | 
         
        
           | 
           | 
          APIError |           api_err ) | 
         
       
   | 
  
protected   | 
  
 
 
◆ init()
  
  
      
        
          | APIError esphome::api::APINoiseFrameHelper::init  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
overridevirtual   | 
  
 
 
◆ init_handshake_()
  
  
      
        
          | APIError esphome::api::APINoiseFrameHelper::init_handshake_  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
protected   | 
  
 
Initiate the data structures for the handshake. 
- Returns
 - 0 on success, -1 on error (check errno) 
 
Definition at line 513 of file api_frame_helper_noise.cpp.
 
 
◆ loop()
  
  
      
        
          | APIError esphome::api::APINoiseFrameHelper::loop  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
overridevirtual   | 
  
 
 
◆ read_packet()
◆ send_explicit_handshake_reject_()
  
  
      
        
          | void esphome::api::APINoiseFrameHelper::send_explicit_handshake_reject_  | 
          ( | 
          const LogString * |           reason | ) | 
           | 
         
       
   | 
  
protected   | 
  
 
 
◆ state_action_()
  
  
      
        
          | APIError esphome::api::APINoiseFrameHelper::state_action_  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
protected   | 
  
 
To be called from read/write methods. 
This method runs through the internal handshake methods, if in that state.
If the handshake is still active when this method returns and a read/write can't take place at the moment, returns WOULD_BLOCK. If an error occurred, returns that error. Only returns OK if the transport is ready for data traffic. 
Definition at line 217 of file api_frame_helper_noise.cpp.
 
 
◆ try_read_frame_()
  
  
      
        
          | APIError esphome::api::APINoiseFrameHelper::try_read_frame_  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
protected   | 
  
 
Read a packet into the rx_buf_. 
- Returns
 - APIError::OK if a full packet is in rx_buf_
 
errno EWOULDBLOCK: Packet could not be read without blocking. Try again later. errno ENOMEM: Not enough memory for reading packet. errno API_ERROR_BAD_INDICATOR: Bad indicator byte at start of frame. errno API_ERROR_HANDSHAKE_PACKET_LEN: Packet too big for this phase. 
Definition at line 144 of file api_frame_helper_noise.cpp.
 
 
◆ write_frame_()
  
  
      
        
          | APIError esphome::api::APINoiseFrameHelper::write_frame_  | 
          ( | 
          const uint8_t * |           data,  | 
         
        
           | 
           | 
          uint16_t |           len ) | 
         
       
   | 
  
protected   | 
  
 
 
◆ write_protobuf_packet()
◆ write_protobuf_packets()
◆ ctx_
◆ handshake_
  
  
      
        
          | NoiseHandshakeState* esphome::api::APINoiseFrameHelper::handshake_ {nullptr} | 
         
       
   | 
  
protected   | 
  
 
 
◆ nid_
  
  
      
        
          | NoiseProtocolId esphome::api::APINoiseFrameHelper::nid_ | 
         
       
   | 
  
protected   | 
  
 
 
◆ prologue_
  
  
      
        
          | std::vector<uint8_t> esphome::api::APINoiseFrameHelper::prologue_ | 
         
       
   | 
  
protected   | 
  
 
 
◆ recv_cipher_
  
  
      
        
          | NoiseCipherState* esphome::api::APINoiseFrameHelper::recv_cipher_ {nullptr} | 
         
       
   | 
  
protected   | 
  
 
 
◆ rx_header_buf_
  
  
      
        
          | uint8_t esphome::api::APINoiseFrameHelper::rx_header_buf_[3] | 
         
       
   | 
  
protected   | 
  
 
 
◆ rx_header_buf_len_
  
  
      
        
          | uint8_t esphome::api::APINoiseFrameHelper::rx_header_buf_len_ = 0 | 
         
       
   | 
  
protected   | 
  
 
 
◆ send_cipher_
  
  
      
        
          | NoiseCipherState* esphome::api::APINoiseFrameHelper::send_cipher_ {nullptr} | 
         
       
   | 
  
protected   | 
  
 
 
The documentation for this class was generated from the following files: