2018-09-15 08:06 AM
It looks like BlueNRG-MS doesn't remember that BLE client asked it to change CCCD from 0 (default value) to 1 (subscribe to value change notifications) upon BLE server reboot. And I need to restore CCCD to 1 because BLE client doesn't do it on reconnect.
More details in this topic: https://social.msdn.microsoft.com/Forums/ru-RU/617c16ea-37d6-43c6-bab8-f925642ef1db/ble-hid-hid-over-gatt-device-status-reports-are-not-received-after-device-reconnected?forum=wdk&prof=required
btw: I am aware that this value must be set by BLE client, but what should I do if it doesn't do it?
2018-09-18 03:21 PM
I am thinking of trying to look at the configuration area available via aci_hal_write_config_data() / aci_hal_read_config_data(), if I am lucky enough I can find something interesting...
2018-09-24 04:01 AM
Hi guys,
BlueNRG-MS does store the value of the CCCD in NVM. This is done when the device is disconnected, in order to reduce the number of writes in Flash.
Probably, the cause of the problems seen here is due to the fact that the BlueNRG is reset before terminating the connection. Hence, the content of the GATT database is not stored.
2018-09-28 02:29 AM
Yes, this is the root cause of the problem. Device has physical power switch to cut down power when it's not needed anymore. That's why we have it. Keeping GATT database unsaved until BLE client is disconnected forces us to implement a complex device shutdown sequence or a user must turn off their computer before turning off the device (or at least turn off Bluetooth). All these options are not what we expected to get.
2018-10-01 06:18 AM
Then there' should be real eeprom instead of flash.
If Microsoft just did what Apple does everyone would be happy.
-- pa
2018-10-05 06:30 AM
There are two workarounds in this case, (when the application cannot gracefully disconnect from the peer)
1) Disconnecting from the peer after the CCCD has been written by the client the first time after bonding. Disconnection is initiating by the slave. In this case there will be a reconnection only after the two devices are paired (reconnection is immediately done without too much impact). After pairing is done, user experience is not impacted.
or
2) Writing of the CCCD by the server itself upon reconnection if a bonded device has written into the CCCD. No impact on user experience even after pairing.
2018-10-09 02:27 PM
1) As I said MS Windows and MacOS behave differently in this situation, disconnecting after CCCD is set by server will work fine with Windows but it will cause endless loop with MacOS because MacOS sets CCCD each time device is reconnected.
2) I cannot dictate Microsoft how they must implement their HID driver. Unfortunately.
2018-10-12 03:52 AM
1) You don't need to disconnect every time the CCD is set. You have to do this only after the pairing.
2) it is your device (the server) that sets the value of its descriptor. No change is required on the HID driver. This is in charge of your firmware.
2018-10-12 11:56 AM
I didn't get how BLE server can set the value of CCCD, there is no way it could be done using provided API.
2018-10-16 02:02 AM
There is an API for this: ACI_GATT_SET_DESC_VALUE.
2023-09-02 12:25 AM
Hello RStvep,
i hava he same problem,
i need to set notification on CCCD on the server to notify the client,
Do you found a solution ?
Thank you,
Sincerely.