Skip to content

Support for nRF52x BLE 4.2 and 5 events #6308

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 2 commits into from
Mar 12, 2018

Conversation

donatieng
Copy link
Contributor

@donatieng donatieng commented Mar 8, 2018

Description

This pull requests adds handling of 3 BLE 4.2 & 5 events generated by the NRF S132 and S140 softdevices:

  • BLE_GAP_EVT_PHY_UPDATE_REQUEST: BLE PHY negotiation - for instance Coded or 2M PHY (BLE 5)
  • BLE_GAP_EVT_DATA_LENGTH_UPDATE_REQUEST: LL data length negotiation (Data packet length extension, BLE 4.2)
  • BLE_GATTS_EVT_EXCHANGE_MTU_REQUEST: Extended ATT MTU negotiation (Data packet length extension, BLE 4.2)

It fixes issues encountered when using a device (phone, etc) issuing these requests to the Nordic stack that will issue these events that need to be handled by the application for a connection to be established successfully.

Pull request type

  • Fix
  • Refactor
  • New target
  • Feature
  • Breaking change

@AGlass0fMilk
Copy link
Member

Can confirm that this fixes connection timeout issues I was seeing on the feature-nrf528xx branch.

Related forum post:
https://os.mbed.com/forum/upcoming-features/topic/29477/?page=1#comment-55450

@0xc0170
Copy link
Contributor

0xc0170 commented Mar 9, 2018

I believe this is a fix, not a feature (targeting patch release).

/morph build

@donatieng
Copy link
Contributor Author

Thanks @AGlass0fMilk for testing :)

@0xc0170 more like a fixture ;) - feature enabling a fix? Is that a thing?

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.

LGTM!
At some point we will need APIs that exposes these events allows user code to handle them.

@mbed-ci
Copy link

mbed-ci commented Mar 9, 2018

Build : SUCCESS

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

Triggering tests

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

uint8_t const data_length_peer =
p_gap_evt->params.data_length_update_request.peer_params.max_tx_octets;

const uint8_t max_data_length = NRF_SDH_BLE_GATT_MAX_MTU_SIZE + 4 /* L2CAP header size */;
Copy link
Member

Choose a reason for hiding this comment

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

The L2CAP header size is defined with L2CAP_HDR_LEN.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually this is defined in nrf_ble_gatt.c in the Nordic SDK so not available in that scope, that's why I put it like that.

@mbed-ci
Copy link

mbed-ci commented Mar 9, 2018

@mbed-ci
Copy link

mbed-ci commented Mar 9, 2018

@cmonr cmonr merged commit dfcbb4c into ARMmbed:feature-nrf528xx Mar 12, 2018
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

Successfully merging this pull request may close these issues.

7 participants