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

Nordic: Set handle of user description descriptors. #5589

Merged
merged 1 commit into from Nov 30, 2017

Conversation

Projects
None yet
5 participants
@pan-
Member

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-

This comment has been minimized.

Member

pan- commented Nov 27, 2017

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

features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_MCU_NRF51822/source/nRF5xGattServer.cpp Outdated
@@ -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;

This comment has been minimized.

@paul-szczepanek-arm

paul-szczepanek-arm Nov 27, 2017

Member

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

This comment has been minimized.

@pan-

pan- Nov 27, 2017

Member

Fixed

features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_MCU_NRF51822/source/nRF5xGattServer.cpp Outdated
@@ -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();

This comment has been minimized.

@nvlsianpu

nvlsianpu Nov 27, 2017

Contributor

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

This comment has been minimized.

@pan-

pan- Nov 27, 2017

Member

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.

This comment has been minimized.

@nvlsianpu

nvlsianpu Nov 27, 2017

Contributor

Right. I Just spotted this at first sight.

@pan- pan- force-pushed the pan-:ble-nordic-set-description-handle branch to a665f3e Nov 27, 2017

@0xc0170 0xc0170 added needs: CI and removed needs: review labels Nov 27, 2017

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Nov 27, 2017

/morph build

@mbed-ci

This comment has been minimized.

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

This comment has been minimized.

@mbed-ci

This comment has been minimized.

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Nov 28, 2017

/morph export-build

@mbed-ci

This comment has been minimized.

@0xc0170 0xc0170 merged commit 969f8af into ARMmbed:master Nov 30, 2017

6 checks passed

AWS-CI uVisor Build & Test Success
Details
ci-morph-build build completed
Details
ci-morph-exporter build completed
Details
ci-morph-test test completed
Details
continuous-integration/jenkins/pr-head This commit looks good
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@pan- pan- deleted the pan-:ble-nordic-set-description-handle branch Jul 3, 2018

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