Skip to content
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

BLE: Need API to get Data Length Extension status if it's Bluetooth 4.2 or above. #9263

Closed
kaiser-ren opened this issue Jan 6, 2019 · 11 comments

Comments

@kaiser-ren
Copy link

Description

Data Length Extension (DLE) was introduced in Bluetooth v4.2, but this feature is optional which means that some kits are 4.2, but they don't have DLE feature.
So developer need API to get DLE status, when has DLE status, it's possible to estimate the top-proof of the connection throughput.

Issue request type

[ ] Question
[x ] Enhancement
[ ] Bug
@ciarmcom
Copy link
Member

ciarmcom commented Jan 6, 2019

Internal Jira reference: https://jira.arm.com/browse/MBOCUSTRIA-388

@0xc0170
Copy link
Contributor

0xc0170 commented Jan 7, 2019

cc @ARMmbed/mbed-os-pan

@pan-
Copy link
Member

pan- commented Jan 7, 2019

@kaiser-ren We plan to introduce something a bit different: right after connection we want to initiate an MTU negotiation between the ends of the connection. The GATT client (I'm not so sure for server) APIs already take advantage of the MTU size negotiated so there is nothing else to worry about from a developer perspective.

@paul-szczepanek-arm Would it be possible to expose a public API to get the MTU size of a given connection ? Or we can fire an event when the MTU size change.

@kaiser-ren
Copy link
Author

@pan- Thanks for the update. It would be awesome to have APIs to get negotiated ATT_MTU size, but it's not enough for developers to calculated throughput. For example when ATT_MTU is 185 bytes:

  • if each ATT packet length is 27 bytes, for 185 bytes MTU, it needs 7 packets;
  • if each ATT packet length is 247 bytes (like I mentioned before, DLE is enabled), for 185 bytes MTU, it just needs one packet.
    So, data packet length for each ATT packet has huge impact for BLE connection throughput, meanwhile, this is also the most common question about BLE: how fact can my peripheral be with a smartphone?

@kaiser-ren
Copy link
Author

And I just did a test between Nordic nRF52840 and iPhone8:
*connection interval is 50ms
*ATT_MTU is 185 byte
The difference of DLE-enable and DLE-disable:

  • when I set packet length is 27 bytes (DLE diable), the throughput is about 48.27 kbps;
  • when I set packet length is 247 bytes (DLE enable), the throughput is about 135 kbps;

So, API about data packet length is important.

@pan-
Copy link
Member

pan- commented Jan 8, 2019

@kaiser-ren We intend to provide both information: packet size and ATT_MTU size in the form of events as the value is negotiated by both ends. DLE negotiation is enabled by default on ports using the cordio stack; it should be enabled for builds using the Cordio link layer on Nordic targets. For softdevice build I don't think it is enabled yet.

@kaiser-ren
Copy link
Author

@pan- I'm so glad to hear it: providing both information.
Just for your reference, I think s140 softdevice uses below function for DLE.
`

uint32_t sd_ble_gap_data_length_update ( uint16_t conn_handle,
    ble_gap_data_length_params_t const * p_dl_params,
    ble_gap_data_length_limitation_t * p_dl_limitation
  )

`
Detail please refer to Nordic document center.
https://www.nordicsemi.com/DocLib/Content/SoftDevice_API_Doc/S140/v6-1-0/group_ble_gap_functions#gac4a6ef5c106107eb2a1707bb26f3245c
https://www.nordicsemi.com/DocLib/Content/SoftDevice_API_Doc/S140/v6-1-0/group_ble_gap_data_length_update_procedure_msc

@kaiser-ren
Copy link
Author

Hello @pan- ,
As for this issue, any update on it? I'd like to check with you that when it could be on the schedule.
Thanks.

@pan-
Copy link
Member

pan- commented Jan 30, 2019

@kaiser-ren Please have a look at #9537 .

@paul-szczepanek-arm
Copy link
Member

Hi @kaiser-ren, the MTU PR has been merged to master. As for your original question you can check features like Data Length Extension with Gap::isFeatureSupported()

@kaiser-ren
Copy link
Author

Hi @paul-szczepanek-arm , thank you so much to notify me about this, well done!
I will test it later in next week!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants