Skip to content

Commit 8f0e98e

Browse files
authored
Sync protobuf changes for FixedVector support in BLE characteristics and descriptors (#1393)
1 parent 7f13a66 commit 8f0e98e

File tree

4 files changed

+209
-199
lines changed

4 files changed

+209
-199
lines changed

aioesphomeapi/api.proto

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1519,7 +1519,7 @@ message BluetoothGATTCharacteristic {
15191519
repeated uint64 uuid = 1 [(fixed_array_size) = 2, (fixed_array_skip_zero) = true];
15201520
uint32 handle = 2;
15211521
uint32 properties = 3;
1522-
repeated BluetoothGATTDescriptor descriptors = 4;
1522+
repeated BluetoothGATTDescriptor descriptors = 4 [(fixed_vector) = true];
15231523

15241524
// New field for efficient UUID (v1.12+)
15251525
// Only one of uuid or short_uuid will be set.
@@ -1531,7 +1531,7 @@ message BluetoothGATTCharacteristic {
15311531
message BluetoothGATTService {
15321532
repeated uint64 uuid = 1 [(fixed_array_size) = 2, (fixed_array_skip_zero) = true];
15331533
uint32 handle = 2;
1534-
repeated BluetoothGATTCharacteristic characteristics = 3;
1534+
repeated BluetoothGATTCharacteristic characteristics = 3 [(fixed_vector) = true];
15351535

15361536
// New field for efficient UUID (v1.12+)
15371537
// Only one of uuid or short_uuid will be set.

aioesphomeapi/api_options.proto

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,10 @@ extend google.protobuf.FieldOptions {
6464
// This is typically done through methods returning const T& or special accessor
6565
// methods like get_options() or supported_modes_for_api_().
6666
optional string container_pointer = 50001;
67+
68+
// fixed_vector: Use FixedVector instead of std::vector for repeated fields
69+
// When set, the repeated field will use FixedVector<T> which requires calling
70+
// init(size) before adding elements. This eliminates std::vector template overhead
71+
// and is ideal when the exact size is known before populating the array.
72+
optional bool fixed_vector = 50013 [default=false];
6773
}

aioesphomeapi/api_options_pb2.py

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

aioesphomeapi/api_pb2.py

Lines changed: 200 additions & 196 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)