Skip to content

Conversation

paul-szczepanek-arm
Copy link
Member

Description

There was an error in gatt server where the cccd index variable was being used outside of its valid scope. This fix updates the variable to its correct value in the outside scope.

I also renamed the functions to explicitly state what they do to avoid ambiguity. There index is the same but the handle used to get it is different. This is now reflected in the names.

Pull request type

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

@paul-szczepanek-arm paul-szczepanek-arm changed the title fix using an invalid cccd index BLE: fix using an invalid cccd index Oct 3, 2018
@paul-szczepanek-arm paul-szczepanek-arm changed the title BLE: fix using an invalid cccd index BLE: fix use of invalid cccd index Oct 3, 2018

// return if the update does not have to be propagated to peers
if (local_only || !has_cccd(att_handle)) {
if (local_only || !get_cccd_index_by_value_handle(att_handle, cccd_index)) {
Copy link
Member Author

Choose a reason for hiding this comment

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

this call makes the cccd_index valid in this scope

// Check to see if this is a CCCD
uint8_t cccd_index;
if (get_cccd_id(att_handle, cccd_index)) {
if (get_cccd_index_by_cccd_handle(att_handle, cccd_index)) {
Copy link
Member Author

Choose a reason for hiding this comment

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

the cccd_index is only valid within the scope of the if statement

@0xc0170
Copy link
Contributor

0xc0170 commented Oct 4, 2018

/morph build

@mbed-ci
Copy link

mbed-ci commented Oct 4, 2018

Build : SUCCESS

Build number : 3233
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/8318/

Triggering tests

/morph test
/morph mbed2-build

@0xc0170
Copy link
Contributor

0xc0170 commented Oct 4, 2018

License issue for IAR

/morph mbed2-build

@mbed-ci
Copy link

mbed-ci commented Oct 4, 2018

@0xc0170
Copy link
Contributor

0xc0170 commented Oct 5, 2018

/morph export-build

@mbed-ci
Copy link

mbed-ci commented Oct 5, 2018

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.

4 participants