Open hansmbakker opened 5 years ago
The issue seems to be in this call: https://github.com/nkolban/esp32-snippets/blob/c48cb19186744f5792b37060b4ae9b1c36b422df/cpp_utils/BLERemoteService.cpp#L173-L181
The code runs into the invalid offset statement at https://github.com/nkolban/esp32-snippets/blob/c48cb19186744f5792b37060b4ae9b1c36b422df/cpp_utils/BLERemoteService.cpp#L183-L185 so it calls break;
, then the code causes a Stack smashing protect failure!
before https://github.com/nkolban/esp32-snippets/blob/c48cb19186744f5792b37060b4ae9b1c36b422df/cpp_utils/BLERemoteService.cpp#L155
This issue is not present in arduino-esp32 1.0.0 (non-Platform.IO, just using Arduino IDE directly with esp32 1.0.0 from board manager).
Hi @hansmbakker sorry for late reply. I cant reproduce this with arduino-ide and your test repository, with both ble v1.0.0 and ble v1.0.1. I am not working with PlatformIO, sorry.
was (maybe) wrong. If you want to do this, you'd need to
esp_gattc_char_elem_t result[10];
For example... https://pbs.twimg.com/media/Dwv3pnaVAAAk3kk.jpg:large
Some bugs I found were fixed. https://github.com/wakwak-koba/ESP32_BLE_Arduino https://github.com/nkolban/ESP32_BLE_Arduino/compare/master...wakwak-koba:master
Hi @wakwak-koba thanks for finding this. If you can make PR in this repository i will merge it.
esp32-snippets/cpp_utils/BLERemoteService.cpp
Lines 170 to 172 in c48cb19
esp_gattc_char_elem_t result; while (true) { uint16_t count = 10; // this value is used as in parameter that allows to search max 10 chars with the same uuid was (maybe) wrong. If you want to do this, you'd need to
esp_gattc_char_elem_t result[10];
For example... https://pbs.twimg.com/media/Dwv3pnaVAAAk3kk.jpg:large
Some bugs I found were fixed. https://github.com/wakwak-koba/ESP32_BLE_Arduino nkolban/ESP32_BLE_Arduino@master...wakwak-koba:master
I triggered a similar bug when I try to connect a Surface Dial. In BLERemoteService::getCharacteristic, the uuid got modified after retrieveCharacteristics() is called (then cpu crash). This seems an out of bounds problem in retrieveCharacteristics()
this commit seems fixes it. https://github.com/wakwak-koba/ESP32_BLE_Arduino/commit/b1ef06eee327062351a05c4159576ba0d66ca380#diff-95400a504c71c5204a517b0ed85fcd1c
@DeqingSun this PR has been merged to this library, just not pushed to Arduino yet. I have to fix few more issues before i will do it.
I'm trying to build a BLE GATT client with notify registration, based on the samples in this repository. I'm using PlatformIO with ESP32 BLE Arduino@^1.0.1.
I can connect successfully to my device but when I try to get the characteristic I'm interested in, the application crashes in https://github.com/nkolban/esp32-snippets/blob/c48cb19186744f5792b37060b4ae9b1c36b422df/cpp_utils/BLERemoteService.cpp#L164.
The crash location looks similar to https://github.com/nkolban/esp32-snippets/issues/736 but I cannot say whether the backtrace is the same? What can I do to solve this?
I uploaded a reproduction project at https://github.com/hansmbakker/BleClientBugRepro