1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-18 09:43:47 +01:00

[bluetooth_proxy] Use FixedVector for GATT characteristics and descriptors (#11214)

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
J. Nick Koston
2025-10-13 17:05:13 -10:00
committed by GitHub
parent 5bb69a968c
commit 8a15c18066
7 changed files with 146 additions and 32 deletions

View File

@@ -1415,6 +1415,8 @@ class RepeatedTypeInfo(TypeInfo):
# Check if this is a pointer field by looking for container_pointer option
self._container_type = get_field_opt(field, pb.container_pointer, "")
self._use_pointer = bool(self._container_type)
# Check if this should use FixedVector instead of std::vector
self._use_fixed_vector = get_field_opt(field, pb.fixed_vector, False)
# For repeated fields, we need to get the base type info
# but we can't call create_field_type_info as it would cause recursion
@@ -1438,6 +1440,8 @@ class RepeatedTypeInfo(TypeInfo):
if "<" in self._container_type and ">" in self._container_type:
return f"const {self._container_type}*"
return f"const {self._container_type}<{self._ti.cpp_type}>*"
if self._use_fixed_vector:
return f"FixedVector<{self._ti.cpp_type}>"
return f"std::vector<{self._ti.cpp_type}>"
@property