mirror of
https://github.com/esphome/esphome.git
synced 2025-07-30 15:16:37 +00:00
Make ProtoSize an object
This commit is contained in:
parent
1032e5c220
commit
33ec5e195f
@ -290,8 +290,9 @@ uint16_t APIConnection::encode_message_to_buffer(ProtoMessage &msg, uint8_t mess
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Calculate size
|
// Calculate size
|
||||||
uint32_t calculated_size = 0;
|
ProtoSize size_calc;
|
||||||
msg.calculate_size(calculated_size);
|
msg.calculate_size(size_calc);
|
||||||
|
uint32_t calculated_size = size_calc.get_size();
|
||||||
|
|
||||||
// Cache frame sizes to avoid repeated virtual calls
|
// Cache frame sizes to avoid repeated virtual calls
|
||||||
const uint8_t header_padding = conn->helper_->frame_header_padding();
|
const uint8_t header_padding = conn->helper_->frame_header_padding();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user