-
Notifications
You must be signed in to change notification settings - Fork 7.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bluetooth onWrite callback uses the wrong characteristic #3153
Comments
I can confirm that every BLECharacteristic received by the BleCharacteristicCallback has its rightmost 2 omitted. This used to work in v1.0.2, so I would say that it is a bug introduced in 1.0.3
Characteristic given to the server and visible to other clients is ''6e99a24f-e50c-425d-acce-b92dbad49c90'', but the callback receives that UUID with the rightmost 2 characters missing. |
Suggest you update the issue title to reflect the actual error. |
Actually, this bug is worse than just omitting the last 2 chars. I am seeing BLECharacteristic UUID and their values come back partially overwritten and truncated. Something within the BLE library is referencing memory incorrectly. |
OK, retrieved using 1.0.3 with the BLE sources from 1.0.2 and I'm still getting the memory corruption showing up BLECharacteristic UUIDs. So it's a memory issue somewhere else in 1.0.3. This is now beyond the budget I have, so I'm going to have to revert to 1.0.2 @me-no-dev this is a big worry for 1.0.3 (I tested on master too). |
OK, looks like I managed to convince myself that I had was working on 1.0.2 when that wasn't true.. Definitely failing for both 1.0.2 and 1.0.3 and master. |
I have created a very simple project https://github.com/william-ferguson-au/arduino-esp32-issue-3153 It shows that the UUID is corrupt when given to the BLECharcateristic callback. I suspect this is an issue in the underlying esp-idf BT library. |
[STALE_SET] This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions. |
[STALE_DEL] This stale issue has been automatically closed. Thank you for your contributions. |
Hardware:
Board: ESP32 Dev Module
Core Installation/update date: 29/aug/2019
IDE name: Arduino IDE
Flash Frequency: 80Mhz
PSRAM enabled: no
Upload Speed: 921600
Computer OS: Windows 10
Description:
Not sure if this issue was created recently, but for some reason the BLECharacteristic in the onWrite event is always the first one added to the service.
For an instance. Writing a value to "ba5edca7-face-d00d-c0de-000000000001" using nrf connect causes onWrite to fire with pCharacteristic as "ba5edca7-face-d00d-c0de-0000000000".
The value does get set though, because if I disconnect in nrf connect and reconnect, the updated value is set. But if I need to be able to get which characteristic was changed in the application.
Edit: Looking closer at what I pasted. It looks like
pCharacteristic->getUUID()
is shifting off the last 2 characters of the UUID. Is this a bug or by design?Header
CPP File
ino setup
The text was updated successfully, but these errors were encountered: