Skip to content

Nordic: Set handle of user description descriptors. #5589

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
Nov 30, 2017

Conversation

pan-
Copy link
Member

@pan- pan- commented Nov 27, 2017

Description

Fix a bug in Nordic GattServer implementation: Handle of user description descriptors were not populated when a service was added to the GattServer.

Status

READY

Migrations

NO

@pan-
Copy link
Member Author

pan- commented Nov 27, 2017

@paul-szczepanek-arm @nvlsianpu Could you review ?

@@ -65,6 +65,7 @@ ble_error_t nRF5xGattServer::addService(GattService &service)
return BLE_ERROR_NO_MEM;
}
GattCharacteristic *p_char = service.getCharacteristic(i);
GattAttribute *description_descriptor = NULL;
Copy link
Member

@paul-szczepanek-arm paul-szczepanek-arm Nov 27, 2017

Choose a reason for hiding this comment

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

should use the existing code practice of prefixing the pointer with p_
following the naming here I'd go with p_user_desc

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed

@@ -83,6 +84,7 @@ ble_error_t nRF5xGattServer::addService(GattService &service)
for (uint8_t j = 0; j < p_char->getDescriptorCount(); j++) {
GattAttribute *p_desc = p_char->getDescriptor(j);
if (p_desc->getUUID() == BLE_UUID_DESCRIPTOR_CHAR_USER_DESC) {
description_descriptor = p_desc;
userDescriptionDescriptorValuePtr = p_desc->getValuePtr();
userDescriptionDescriptorValueLen = p_desc->getLength();
Copy link
Contributor

Choose a reason for hiding this comment

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

Why It is expected that tere could be more than one descriptor per characteristic at input? Shouldn't this be an error?

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 Nordic code for the GattServer can be improved in many ways; raising an error if there is multiple user description descriptors may be one of them but it is not the purpose of this PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

Right. I Just spotted this at first sight.

@pan- pan- force-pushed the ble-nordic-set-description-handle branch from 352ed33 to a665f3e Compare November 27, 2017 14:26
@0xc0170
Copy link
Contributor

0xc0170 commented Nov 27, 2017

/morph build

@mbed-ci
Copy link

mbed-ci commented Nov 27, 2017

Build : SUCCESS

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

Triggering tests

/morph test
/morph uvisor-test
/morph export-build

@mbed-ci
Copy link

mbed-ci commented Nov 27, 2017

@mbed-ci
Copy link

mbed-ci commented Nov 27, 2017

@0xc0170
Copy link
Contributor

0xc0170 commented Nov 28, 2017

/morph export-build

@mbed-ci
Copy link

mbed-ci commented Nov 28, 2017

@0xc0170 0xc0170 merged commit 969f8af into ARMmbed:master Nov 30, 2017
@pan- pan- deleted the ble-nordic-set-description-handle branch July 3, 2018 11:04
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