-
Notifications
You must be signed in to change notification settings - Fork 75
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
Initial version of the setCCCD API for GattClient #172
base: develop
Are you sure you want to change the base?
Conversation
This is an initial version of an API that automates the process of setting the Client Characteristic Configuration Descriptor (CCCD) to enable/disable notifications. The new API is DiscoveredCharacteristic::setCCCD(). The new API internally triggers a characteristic descriptor discovery procedure to find the handle of the CCCD. If this succeeds, it attempts to execute a write procedure. On termination, a user configured callback is executed to report the final outcome of the process.
The build will fail because there is a problem in the API when registering onShutdown callbacks. The signature of the function should be I have made a PR to solve this issue: #174 |
It seems that the ble-nrf51822 implementation of the API does shutdown the Service Discovery but NOT the Characteristic Descriptor Discoverer. I have raised an issue about this, see ARMmbed/ble-nrf51822#110. In this case, the CCCDSetter objects will never receive the expected callbacks and the memory resources allocated will never be cleared. |
This is an initial version of an API that automates the process of setting the
Client Characteristic Configuration Descriptor (CCCD) to enable/disable
notifications. The new API is DiscoveredCharacteristic::setCCCD().
The new API internally triggers a characteristic descriptor discovery procedure
to find the handle of the CCCD. If this succeeds, it attempts to execute a write
procedure. On termination, a user configured callback is executed to report the
final outcome of the process.
NOTE: This pull request is NOT READY FOR MERGE, it is an early version of the new API to start discussion around this issue. In my opinion, there are still a few problems that need to be tackled:
@pan- Please comment.