-
Notifications
You must be signed in to change notification settings - Fork 7.6k
ble2902->setNotifications(false); does not get reflected to the Client #6868
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
Comments
@SuperTankMan - Could you please provide both Sketches (BLE Central and Peripheral) that demonstrate the issue and that would be used to also demonstrate a fix? Thanks! The example you suggested has no BLE2902 object ( What did you use as BLE central (client) to test it and see the issue? |
See code and details in issue #6863 |
@SuperTankMan can we close this issue and continue only in #6863? |
@VojtechBartoska (Sorry but No) - Frankly I think this issue although related is different the other is about default values not being set when disconnected and in this one is the new values of BLL2902 are not reflected to the client via reading BLE2902 it is possible the bug fix solution will cure both issues but I do think we should keep it until they are both resolved. |
Issue confirmed. There are actually two issues: These functionalities need to be implemented in BLE Library: |
Hi @SuGlider I am not so sure if issue: L185-L194(ESP32 BLE Server doesn't send back Descriptor when read is requested by BLE Client.) is completely true. I have done this experiment where I use one client to connect then register for notifications then I read the value of the BLE2902 descriptor and it reads value correctly as expected. I have also tried another experiment where a client connects then registers for notifications and then disconnects. I then use another client device to connect and read the BLE2902 descriptor and then too again is read correctly. What is not happening is that when I internally setNotifications(true or false) and then read the BLE2902 then it does not read correctly! hence not sure of your description of the issue. Also there is the issue that when server is disconnected from an unbonded/unpaired device the BLE2902 is not reset to its default value of 0x0000. I am also not sure about L54-L58(ESP32 BLE Client doesn't receive Descriptor data when it is sent from BLE Server) I have not done this experiment with ESP32 being the Client so do not know. Please clarify to me if I am missing something and also that the implanted cure will resolve both my issues? Thank you for your assistance and sorry if I have not understood your cure to be implemented. |
@SuperTankMan - I guess you are using nRF Connect APP or BLE Scanner APP as client to run your exepriments.
None APPs, nRF Connect nor BLE Scanner, really reads Descriptors. Both write to them, but do not read. I also added the necessary code in the place I mentioned to send a Message back with the data to the Client and it just ignores it. By other hand, when the Client requests to read a Characteristic, it turns After all these tests, I concluded that BLE may define that when reading a Descriptor, the client doesn't get any response from this request and just get the data from its cache, created in the discovery process. Therefore, as I said in my first message, the Client doesn't matter reading Descriptors, only matter reading Characteristics. Thus, your Client APP will never read and doesn't want to read Descriptors.
This is something that if your ESP32 Server Sketch can do, as already said, by After analyzing the Logs, I really think that there may be nothing to fix here... |
Description of Change This PR fixes an issue related to BLE Server and Descriptors. The issue: If the BLE Server code changes its own descriptors, it is not reflected in the GATTS database. BLE2902 CCCD also didn't reflect any changes to the GATTS database. Because of this issue, the client could never read the real Descriptor values from the remote Server. Tests scenarios Tested with ESP32. Related links Fixes #6863 Fixes #6868
Board
az-delivery-devkit-v4
Device Description
n/a
Hardware Configuration
N/A
Version
v2.0.3
IDE Name
Arduino IDE and PlatformIO
Operating System
All
Flash frequency
80-240Mhz
PSRAM enabled
no
Upload speed
115200
Description
The code:
ble2902->setNotifications(false);
in the server side BLE does not get reflected to the client even when they read the notification and indication status.
Sketch
Debug Message
Other Steps to Reproduce
using modified code in the server side with ble2902->setNotifications(false); after the Client has registered for Notifications and the Server has processed ble2902->setNotifications(false); when you read the BLE2902 values they are still 01 00.
I have checked existing issues, online documentation and the Troubleshooting Guide
The text was updated successfully, but these errors were encountered: