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

fix(split): reserve peripheral slot before stopping scanning #1912

Merged
merged 1 commit into from Sep 3, 2023

Conversation

xudongzheng
Copy link
Contributor

In the event that the peripheral MAC address does not match, this allows scanning to continue.

@xudongzheng xudongzheng requested a review from a team as a code owner September 2, 2023 03:34

// Reserve peripheral slot. Once the central has bonded to its peripherals,
// the peripheral MAC addresses will be validated internally and the slot
// reservation will fail if there is a mismatch.
int slot_idx = reserve_peripheral_slot(addr);
if (slot_idx < 0) {
LOG_ERR("Failed to reserve peripheral slot (err %d)", slot_idx);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

In the context of central being in the vicinity of multiple ZMK peripherals, this is not really an error. I've changed it to LOG_INF("unable to reserve peripheral slot ..."). Let me know if you think LOG_ERR or LOG_WRN is more suitable.

In the event that the peripheral MAC address does not match, this allows
scanning to continue.
Copy link
Contributor

@petejohanson petejohanson left a comment

Choose a reason for hiding this comment

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

Good catch. Thanks.

@petejohanson petejohanson merged commit 544612c into zmkfirmware:main Sep 3, 2023
42 checks passed
@xudongzheng xudongzheng deleted the reserve-slot-pr branch September 5, 2023 04:35
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.

None yet

2 participants