Skip to content

Fix BLE long write execution failure #9143

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

Merged
merged 1 commit into from
Dec 20, 2018

Conversation

desmond-blue
Copy link
Contributor

Description

In function nRF5xGattServer::hwCallback(), case BLE_GATTS_OP_EXEC_WRITE_REQ_NOW, the value of variable characteristicIndex is -1 so that causes an exception.

The reason is that the handle_value is retrieved from Execute Write Request, but in spec there is no attribute handle field for this command, I believe this attribute handle should be retrieved from previous Prepare Write Request, in our code, it’s req->attr_handle.

There is one issue (#8548) regarding this fix.

Pull request type

[x] Fix
[ ] Refactor
[ ] Target update
[ ] Functionality change
[ ] Docs update
[ ] Test update
[ ] Breaking change

@cmonr cmonr requested a review from a team December 19, 2018 03:55
Copy link
Member

@pan- pan- left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the submission @desmond-blue!

Your reasoning is correct; as this implementation doesn't supports "atomic" writes of multiple characteristics; the handle can be retrieved from long_write_request_t::attr_handle.

Could you apply your fix to the NRF51 implementation ? It is here.

@desmond-blue
Copy link
Contributor Author

@pan- Thanks for reviewing, the change is also applied to NRF51 implementation now.

@0xc0170
Copy link
Contributor

0xc0170 commented Dec 19, 2018

CI started

@mbed-ci
Copy link

mbed-ci commented Dec 19, 2018

Test run: SUCCESS

Summary: 11 of 11 test jobs passed
Build number : 1
Build artifacts

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

Successfully merging this pull request may close these issues.

5 participants