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: supports legacy pairing. #2237

Merged
merged 8 commits into from
Dec 22, 2020
Merged

BLE: supports legacy pairing. #2237

merged 8 commits into from
Dec 22, 2020

Conversation

XuGuohui
Copy link
Member

As the title describes.

Example App

  • user/tests/wiring/ble_central_peripheral

References

N/A

Completeness

  • User is totes amazing for contributing!
  • Contributor has signed CLA (Info here)
  • Problem and Solution clearly stated
  • Run unit/integration/application tests on device
  • Added documentation
  • Added to CHANGELOG.md after merging (add links to docs and issues)

@XuGuohui XuGuohui requested a review from mgolu November 25, 2020 04:56
hal/src/nRF52840/ble_hal.cpp Outdated Show resolved Hide resolved
Copy link
Contributor

@mgolu mgolu left a comment

Choose a reason for hiding this comment

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

This looks really good.

I did the following integration testing with Boron as a Central device, and BLE devices that require pairing:

  • nRF evaluation board with Nordic firmware that makes it a peripheral that requires pairing: passed
  • Masterbuilt meat smoker that requires passkey authentication: passed
  • Omron Blood Pressure monitor: failed. Upon further investigation, it uses LESC, not Legacy Pairing, so pairing to this device is not in scope of this PR.

@XuGuohui XuGuohui requested a review from mgolu December 18, 2020 15:11
@XuGuohui XuGuohui requested a review from mgolu December 21, 2020 08:17
Copy link
Member

@avtolstoy avtolstoy left a comment

Choose a reason for hiding this comment

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

🎉 Nice

@@ -121,6 +121,8 @@
#define BLE_MAX_PERIPHERAL_COUNT NRF_SDH_BLE_PERIPHERAL_LINK_COUNT
#define BLE_MAX_CENTRAL_COUNT NRF_SDH_BLE_CENTRAL_LINK_COUNT

#define BLE_PAIRING_PASSKEY_LEN 6
Copy link
Member

Choose a reason for hiding this comment

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

Nit: move to ble_hal_defines.h perhaps? I believe this is a universal BLE constant.

} hal_ble_pairing_passkey_input_evt_t;

typedef struct hal_ble_pairing_status_updated_evt_t {
int status;
Copy link
Member

Choose a reason for hiding this comment

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

int32_t?

Copy link
Member Author

Choose a reason for hiding this comment

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

The SoftDevice features uint8_t for the authentication status and the status here will also indicate system error, so I think int is sufficient and is consistent with the function that returns system error.

Comment on lines 1902 to 1907
secParams.min_key_size = 7;
secParams.max_key_size = 16;
secParams.kdist_own.enc = 1;
secParams.kdist_own.id = 1;
secParams.kdist_peer.enc = 1;
secParams.kdist_peer.id = 1;
Copy link
Member

Choose a reason for hiding this comment

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

Nit: magic numbers

Copy link
Member Author

Choose a reason for hiding this comment

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

For the one bit-filed member, I'll just use true/false instead.

Comment on lines 2333 to 2338
secParams.min_key_size = 7;
secParams.max_key_size = 16;
secParams.kdist_own.enc = 1;
secParams.kdist_own.id = 1;
secParams.kdist_peer.enc = 1;
secParams.kdist_peer.id = 1;
Copy link
Member

Choose a reason for hiding this comment

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

Nit: magic numbers

@XuGuohui XuGuohui merged commit 8abb0e8 into develop Dec 22, 2020
@XuGuohui XuGuohui deleted the feature/ble_passkey/ch50363 branch December 22, 2020 07:25
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.

3 participants