From 32be69f7f25bb3749ab44b26fd15c1c99aa56c50 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Fri, 6 Jun 2025 22:06:29 -0500 Subject: [PATCH] cleanup --- esphome/components/api/api_connection.cpp | 4 ++-- esphome/components/api/api_connection.h | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/esphome/components/api/api_connection.cpp b/esphome/components/api/api_connection.cpp index 490912c56a..59cd78b517 100644 --- a/esphome/components/api/api_connection.cpp +++ b/esphome/components/api/api_connection.cpp @@ -1638,9 +1638,9 @@ bool APIConnection::schedule_batch_() { return true; } -ProtoWriteBuffer APIConnection::allocate_single_message_buffer(uint32_t size) { return this->create_buffer(size); } +ProtoWriteBuffer APIConnection::allocate_single_message_buffer(uint16_t size) { return this->create_buffer(size); } -ProtoWriteBuffer APIConnection::allocate_batch_message_buffer(uint32_t size) { +ProtoWriteBuffer APIConnection::allocate_batch_message_buffer(uint16_t size) { ProtoWriteBuffer result = this->prepare_message_buffer(size, this->batch_first_message_); this->batch_first_message_ = false; return result; diff --git a/esphome/components/api/api_connection.h b/esphome/components/api/api_connection.h index fcc5833b8f..b4760f5f96 100644 --- a/esphome/components/api/api_connection.h +++ b/esphome/components/api/api_connection.h @@ -246,7 +246,7 @@ class APIConnection : public APIServerConnection { } // Prepare buffer for next message in batch - ProtoWriteBuffer prepare_message_buffer(uint32_t message_size, bool is_first_message) { + ProtoWriteBuffer prepare_message_buffer(uint16_t message_size, bool is_first_message) { // Get reference to shared buffer (it maintains state between batch messages) std::vector &shared_buf = this->parent_->get_shared_buffer_ref(); size_t current_size = shared_buf.size(); @@ -284,8 +284,8 @@ class APIConnection : public APIServerConnection { std::string get_client_combined_info() const { return this->client_combined_info_; } // Buffer allocator methods for batch processing - ProtoWriteBuffer allocate_single_message_buffer(uint32_t size); - ProtoWriteBuffer allocate_batch_message_buffer(uint32_t size); + ProtoWriteBuffer allocate_single_message_buffer(uint16_t size); + ProtoWriteBuffer allocate_batch_message_buffer(uint16_t size); protected: // Helper function to fill common entity fields