Skip to content
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

Cordio BLE stack: No callback comes to the application for Descriptor Read and Write #9771

Closed
cy-kishore opened this issue Feb 20, 2019 · 10 comments

Comments

@cy-kishore
Copy link

When a GATT client reads or writes to the Characteristic descriptor application does not receive any read and write callback.

The below function GattServer::insert_descriptor in CordioGattserver.cpp does not set callback bits. Can you please check. Probably below bits need to be set for descriptors as well.

attribute_it->settings = ATTS_SET_READ_CBACK;
attribute_it->settings |= ATTS_SET_WRITE_CBACK;

Issue request type

[ ] Question
[ ] Enhancement
[X ] Bug
@ciarmcom
Copy link
Member

Internal Jira reference: https://jira.arm.com/browse/MBOCUSTRIA-898

@desmond-blue
Copy link
Contributor

Duplicate of #9732
@akkishore1 We already merged the fix by this pull request #9748, could you check if this solve your issue? Thanks.

@cy-kishore
Copy link
Author

Hi, This issue is different from #9732. #9732 is for Readcallback for Characteristics.
This issue is there are no callbacks coming when we read or write to characteristic descriptors. I think you need to have similar callback bits set in GattServer::insert_descriptor function in CordioGattserver.cpp

@desmond-blue
Copy link
Contributor

I apologize that I misunderstood this description, we will look into it.

@desmond-blue
Copy link
Contributor

Hi @pan- ,

My thought for what we need to change is

  • Regarding Characteristic Extended Properties(read only), we need to add
    attribute_it->settings |= ATTS_SET_READ_CBACK; if it's readable.

  • Regarding Characteristic User Description and Server Characteristic Configuration, we need to add
    attribute_it->settings |= ATTS_SET_READ_CBACK; if it's readable.
    attribute_it->settings |= ATTS_SET_WRITE_CBACK; if it's writable.

@pan-
Copy link
Member

pan- commented Feb 26, 2019

@desmond-blue IIRC correctly it is asked that users set their properties for these descriptor types; the only exception being CCCD as they are implicitly instantiated if a characteristic is able to notify or indicate. More generally, I believe the whole GattServer API needs a refresh as it is not built on sane grounds.

@desmond-blue
Copy link
Contributor

@pan-
Even if users set the read/write properties, current GattServer::insert_descriptor() API doesn't check this and doesn't set callback. I would like to propose this fix, would you take a look at it?

Or do you already have a plan for refreshing this API?

Thanks for your help.

@pan-
Copy link
Member

pan- commented Mar 4, 2019

@desmond-blue Happy to approve your fix as it solves one of the issue. It must be stretched out that it does not solve the case when the value of the descriptor being read needs to be generated at access time or authorisation/rejection of a descriptor write. For that we would need an API refresh.

@desmond-blue
Copy link
Contributor

Thanks @pan- , so we could use this PR #9948 for this issue now, and we may need to raise other tasks for GattServer API refreshing?

@cy-kishore
Copy link
Author

Fixed on master branch of mbed. Verified the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants