Closed BigCorvus closed 3 years ago
thank for filing this issue, could you be more specific on the issue and how to reproduce it (update 1st post and ping me when you are done). Note: thing can be different on different app or mobile OS or even phone.
How to reproduce
section please specify exact steps to reproduce the issue: which app that you use, your mobile OS version etc, and which steps within the app that trigger the issue. And what is expected behavior etc..closed since user marks it as solved.
This saved me!! I can confirm I had the same issue with the Chipolo One Beacon. Please fix this in the next release.
Operating System
Windows 10
IDE version
Arduino 1.8.16
Board
Feather nRF52840 express
BSP version
1.0.0
Sketch
Adafruit_nRF52_Arduino/libraries/Bluefruit52Lib/examples/Central/central_custom_hrm/central_custom_hrm.ino
modified to connect with custom service and custom characteristic of a moodmetric smart ring
What happened ?
Notifications on the Ring could not be enabled by enableNotify() until I changed the .write_op = BLE_GATT_OP_WRITE_CMD to .write_op = BLE_GATT_OP_WRITE_REQ in the BLEClientCharacteristic::writeCCCD() of BLEClientCharacteristic.cpp.
Found the inspiration to the solution here: https://devzone.nordicsemi.com/f/nordic-q-a/40602/unable-to-enable-notifications-using-sd_ble_gattc_write-sdk-15-2
How to reproduce ?
Just in case notifications on a peripheral are not enabled: this change in the ble_gattc_write_params_t param of the function writeCCCD() should be attempted.
Debug Log
No errors. writeCCCD() worked, but the notification callback was never called until I changed this one value.
ble_gattc_write_params_t param = { .write_op = BLE_GATT_OP_WRITE_REQ, //formerly BLE_GATT_OP_WRITE_CMD .flags = BLE_GATT_EXEC_WRITE_FLAG_PREPARED_WRITE, .handle = _cccd_handle, .offset = 0, .len = 2, .p_value = (uint8_t*) &value };
Screenshots
No response