mirror of
https://github.com/esphome/esphome.git
synced 2026-07-10 17:05:36 +00:00
4d4b77f9fc
Add a new message-level option (inline_encode) that causes the code generator to inline sub-message encoding directly into the parent's encode/calculate_size methods instead of going through the encode_sub_message function pointer indirection. When set on a sub-message type, the generator: - Inlines field encoding directly (no function pointer, no backpatch overhead) - Inlines size calculation (no separate method call) - Skips generating standalone encode/calculate_size methods - Validates at generation time that max encoded size < 128 bytes Applied to BluetoothLERawAdvertisement which is encoded 12 times per BLE advertisement batch in a hot loop.