Corrected count of characteristics to get (#3082)

Only space for 1 characteristic is allocated, requesting 10 leads to stack corruption.
This commit is contained in:
Arjan Mels 2019-08-20 15:38:59 +02:00 committed by Me No Dev
parent 73576674b8
commit a12d609b22

View File

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