mirror of
https://github.com/esphome/esphome.git
synced 2026-05-13 03:30:34 +08:00
65f68a412a
Adds a (mac_address) field option that switches uint64 fields holding 48-bit MAC addresses to a specialized varint encoder. The fast path emits exactly 7 bytes when bits [42..47] are non-zero (the common case for real MACs, since OUIs occupy the top 24 bits) -- one bounds check and 7 independent stores instead of the 7-iteration shift+branch loop. calc_uint64_48bit_force mirrors the same fast path in size calculation. Applied to BluetoothLERawAdvertisement.address, the per-advertisement address encode in BluetoothLERawAdvertisementsResponse drops from a serialized per-byte loop to straight-line code.