Skip to content

Add presentation format descriptor support for nRF5x #5727

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
Jan 15, 2018

Conversation

dschuler
Copy link
Contributor

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.

@ghost
Copy link

ghost 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 Add presentation format descriptor support for NRF52 Add presentation format descriptor support for nRF5x Dec 26, 2017
@mbed-ci
Copy link

mbed-ci commented Dec 26, 2017

Automatic CI verification build not done, please verify manually.

@dschuler
Copy link
Contributor Author

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
Copy link
Contributor

@pan- Can you look at this please ?

@0xc0170
Copy link
Contributor

0xc0170 commented Jan 4, 2018

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

@dschuler dschuler changed the base branch from mbed-os-5.7 to master January 4, 2018 16:53
@dschuler
Copy link
Contributor Author

dschuler commented Jan 4, 2018

@0xc0170 - changed destination to master.

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.

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
Copy link
Member

Choose a reason for hiding this comment

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

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

@dschuler
Copy link
Contributor Author

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

@0xc0170
Copy link
Contributor

0xc0170 commented Jan 15, 2018

/morph build

@mbed-ci
Copy link

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
Copy link

mbed-ci commented Jan 15, 2018

@mbed-ci
Copy link

mbed-ci commented Jan 15, 2018

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

5 participants