From fb92cbad5987722fdaa6446ca0beef3a0735c15a Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Fri, 6 Jun 2025 20:10:41 -0500 Subject: [PATCH] document --- esphome/components/api/api_connection.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/esphome/components/api/api_connection.cpp b/esphome/components/api/api_connection.cpp index 40513555ce..90c5051ebb 100644 --- a/esphome/components/api/api_connection.cpp +++ b/esphome/components/api/api_connection.cpp @@ -244,6 +244,8 @@ void APIConnection::on_disconnect_response(const DisconnectResponse &value) { // pass } +// Encodes a message to the buffer and returns the total number of bytes used, +// including header and footer overhead. Returns 0 if the message doesn't fit. uint16_t APIConnection::encode_message_to_buffer(ProtoMessage &msg, uint16_t message_type, APIConnection *conn, uint32_t remaining_size, bool is_single) { // Calculate size