Skip to content

Commit a12d609

Browse files
arjanmelsme-no-dev
authored andcommitted
Corrected count of characteristics to get (#3082)
Only space for 1 characteristic is allocated, requesting 10 leads to stack corruption.
1 parent 7357667 commit a12d609

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libraries/BLE/src/BLERemoteService.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ void BLERemoteService::retrieveCharacteristics() {
164164
uint16_t offset = 0;
165165
esp_gattc_char_elem_t result;
166166
while (true) {
167-
uint16_t count = 10; // this value is used as in parameter that allows to search max 10 chars with the same uuid
167+
uint16_t count = 1; // only room for 1 result allocated, so go one by one
168168
esp_gatt_status_t status = ::esp_ble_gattc_get_all_char(
169169
getClient()->getGattcIf(),
170170
getClient()->getConnId(),

0 commit comments

Comments
 (0)