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

Add presentation format descriptor support for nRF5x #5727

Merged
merged 1 commit into from Jan 15, 2018

Conversation

Projects
None yet
6 participants
@dschuler
Contributor

dschuler commented Dec 19, 2017

Notes:

  • Have agreed to contributor agreement on mbed site (user: dschuler)

Description

Looking through the mbed BTLE sources, I can find the characteristic presentation format descriptor, BLE_UUID_DESCRIPTOR_CHAR_PRESENTATION_FORMAT, as well as a struct to hold the format in GattCharacteristic::PresentationFormat_t. However, when I add this descriptor to a characteristic and test using Nordic's NRF52 DK board, the descriptor does not appear.

Nordic seems to handle this presentation format differently from other descriptors, along with BLE_UUID_DESCRIPTOR_CHAR_USER_DESC. So, here I added a code path to handle the presentation format the similarly. Tested again on the NRF52 DK, everything appears to be working well.

Status

READY

Migrations

This does not change any APIs or behavior, but should allow a user to pass a characteristic presentation format descriptor, which was not possible before.

Related PRs

No related PRs.

Todos

  • Tests
  • Documentation

I will create another PR with sample code to use the characteristic presentation format.

Deploy notes

Nothing needs to be done to deploy these changes.

Steps to test or reproduce

To test if this PR works, create a descriptor of type BLE_UUID_DESCRIPTOR_CHAR_PRESENTATION_FORMAT - without these changes, the descriptor will not appear on a Nordic NRF52 target. I assume the NRF51 target will have a similar issue, but I had some unrelated probles getting the NRF51 dongle to work so can't currently test changes to NRF51.

@0xc0170 0xc0170 requested a review from pan- Dec 19, 2017

@jrobeson

This comment has been minimized.

Contributor

jrobeson commented Dec 19, 2017

shouldn't this apply just as well to nrf51? If so, can you change the title to nrf5x?

@dschuler dschuler changed the title from Add presentation format descriptor support for NRF52 to Add presentation format descriptor support for nRF5x Dec 26, 2017

@mbed-ci

This comment has been minimized.

mbed-ci commented Dec 26, 2017

Automatic CI verification build not done, please verify manually.

@dschuler

This comment has been minimized.

Contributor

dschuler commented Dec 26, 2017

@jrobeson: Tested with NRF52_DK and NRF51_DONGLE and can confirm everything works as expected. Changed title to nRF5x.

@adbridge

This comment has been minimized.

Contributor

adbridge commented Dec 29, 2017

@pan- Can you look at this please ?

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Jan 4, 2018

Can you change destination branch mbed-os-5.7 to master?

@0xc0170 0xc0170 added needs: work and removed needs: review labels Jan 4, 2018

@dschuler dschuler changed the base branch from mbed-os-5.7 to master Jan 4, 2018

@dschuler dschuler force-pushed the dschuler:nrf52pf branch from ce81d4c to 9f8a837 Jan 4, 2018

@dschuler

This comment has been minimized.

Contributor

dschuler commented Jan 4, 2018

@0xc0170 - changed destination to master.

@0xc0170 0xc0170 added needs: review and removed needs: work labels Jan 4, 2018

@pan-

Good work!

Once the point I've mentioned is fixed we can move forward.

@@ -179,6 +189,11 @@ ble_error_t nRF5xGattServer::addService(GattService &service)
nrfCharacteristicHandles[characteristicCount].user_desc_handle
);
}
if (p_presentation_format_descriptor) {
p_presentation_format_descriptor->setHandle(
nrfCharacteristicHandles[characteristicCount].value_handle

This comment has been minimized.

@pan-

pan- Jan 9, 2018

Member

Unfortunately the Softdevice doesn't return the handle of the presentation format descriptor. I would set this handle to GattAttribute::INVALID_HANDLE.

@0xc0170 0xc0170 added needs: work and removed needs: review labels Jan 12, 2018

@dschuler dschuler force-pushed the dschuler:nrf52pf branch from 9f8a837 to 6304e7b Jan 13, 2018

@dschuler dschuler force-pushed the dschuler:nrf52pf branch from 6304e7b to 271b09c Jan 13, 2018

@dschuler

This comment has been minimized.

Contributor

dschuler commented Jan 13, 2018

@pan- - changed handle to GattAttribute::INVALID_HANDLE and tested on nRF52.

@pan-

pan- approved these changes Jan 15, 2018

@0xc0170 0xc0170 added needs: CI and removed needs: work labels Jan 15, 2018

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Jan 15, 2018

/morph build

@mbed-ci

This comment has been minimized.

mbed-ci commented Jan 15, 2018

Build : SUCCESS

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

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 0xc0170 merged commit 7be79f9 into ARMmbed:master Jan 15, 2018

19 checks passed

ARM mbed CI Verification build successful.
Details
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
travis-ci/docs Local docs testing has passed
Details
travis-ci/events Local events testing has passed
Details
travis-ci/littlefs Local littlefs testing has passed
Details
travis-ci/mbed2-ATMEL Local mbed2-ATMEL testing has passed
Details
travis-ci/mbed2-MAXIM Local mbed2-MAXIM testing has passed
Details
travis-ci/mbed2-NORDIC Local mbed2-NORDIC testing has passed
Details
travis-ci/mbed2-NUVOTON Local mbed2-NUVOTON testing has passed
Details
travis-ci/mbed2-NXP Local mbed2-NXP testing has passed
Details
travis-ci/mbed2-RENESAS Local mbed2-RENESAS testing has passed
Details
travis-ci/mbed2-SILICON_LABS Local mbed2-SILICON_LABS testing has passed
Details
travis-ci/mbed2-STM Local mbed2-STM testing has passed
Details
travis-ci/tools Local tools testing has passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment