mirror of
https://github.com/esphome/esphome.git
synced 2026-09-11 23:37:34 +00:00
reduce
This commit is contained in:
@@ -187,9 +187,9 @@ class APIFrameHelper {
|
||||
std::vector<struct iovec> reusable_iovs_;
|
||||
std::vector<uint8_t> rx_buf_;
|
||||
|
||||
// Pointer to client info (4 bytes on 32-bit)
|
||||
// Note: The pointed-to ClientInfo object must outlive this APIFrameHelper instance.
|
||||
const ClientInfo *client_info_{nullptr};
|
||||
// Pointer to client name buffer (4 bytes on 32-bit)
|
||||
// Note: The pointed-to buffer must outlive this APIFrameHelper instance.
|
||||
const char *client_name_{nullptr};
|
||||
|
||||
// Group smaller types together
|
||||
uint16_t rx_buf_len_ = 0;
|
||||
|
||||
@@ -7,8 +7,8 @@ namespace esphome::api {
|
||||
|
||||
class APIPlaintextFrameHelper final : public APIFrameHelper {
|
||||
public:
|
||||
APIPlaintextFrameHelper(std::unique_ptr<socket::Socket> socket, const ClientInfo *client_info)
|
||||
: APIFrameHelper(std::move(socket), client_info) {
|
||||
APIPlaintextFrameHelper(std::unique_ptr<socket::Socket> socket, const char *client_name)
|
||||
: APIFrameHelper(std::move(socket), client_name) {
|
||||
// Plaintext header structure (worst case):
|
||||
// Pos 0: indicator (0x00)
|
||||
// Pos 1-3: payload size varint (up to 3 bytes)
|
||||
|
||||
Reference in New Issue
Block a user