-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
Option to overwrite a Receive State in the Scan Delegator #62609
Option to overwrite a Receive State in the Scan Delegator #62609
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @pmullt, and thank you very much for your first pull request to the Zephyr project!
A project maintainer just triggered our CI pipeline to run it against your PR and ensure it's compliant and doesn't cause any issues. You might want to take this opportunity to review the project's Contributor Expectations and make any updates to your pull request if necessary. 😊
b94a48a
to
dafbba7
Compare
dafbba7
to
a8e7c9c
Compare
e9638e0
to
0157c3e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work so far, but with some comments on the approach with the big
as well as some formatting
@pmullt feature freeze is tomorrow. If you'd like to get this into Zephyr 3.5 please address all review comments before EOB tomorrow. |
cc966f4
to
8b395bf
Compare
9da387c
to
b1b66a0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few more comments, but I think it's nearly there
b1b66a0
to
ecc1f79
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks pretty good now - Mostly some formatting comments
if (scan_delegator_cbs != NULL && | ||
scan_delegator_cbs->recv_state_add_failed != NULL) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (scan_delegator_cbs != NULL && | |
scan_delegator_cbs->recv_state_add_failed != NULL) { | |
if (scan_delegator_cbs != NULL && | |
scan_delegator_cbs->recv_state_add_failed != NULL) { |
ecc1f79
to
76083d7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly formatting.
Have you consider using something like clang-format to help your formatting?
if (state->pa_sync_state == BT_BAP_PA_STATE_SYNCED || | ||
state->pa_sync_state == BT_BAP_PA_STATE_INFO_REQ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (state->pa_sync_state == BT_BAP_PA_STATE_SYNCED || | |
state->pa_sync_state == BT_BAP_PA_STATE_INFO_REQ) { | |
if (state->pa_sync_state == BT_BAP_PA_STATE_SYNCED || | |
state->pa_sync_state == BT_BAP_PA_STATE_INFO_REQ) { |
if ((oldest_inactive_state == NULL) || | ||
(current_state->aging_counter < oldest_inactive_state->aging_counter)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if ((oldest_inactive_state == NULL) || | |
(current_state->aging_counter < oldest_inactive_state->aging_counter)) { | |
if ((oldest_inactive_state == NULL) || | |
(current_state->aging_counter < oldest_inactive_state->aging_counter)) { |
(void)memcpy(&state_info.subgroups, ¶m->subgroups, | ||
sizeof(state_info.subgroups)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(void)memcpy(&state_info.subgroups, ¶m->subgroups, | |
sizeof(state_info.subgroups)); | |
(void)memcpy(&state_info.subgroups, ¶m->subgroups, | |
sizeof(state_info.subgroups)); |
LOG_DBG("New source ID 0x%02x (%d) added to Scan Delegator at Index %u: ", | ||
state->src_id, state->src_id, internal_state->index); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LOG_DBG("New source ID 0x%02x (%d) added to Scan Delegator at Index %u: ", | |
state->src_id, state->src_id, internal_state->index); | |
LOG_DBG("New source ID 0x%02x (%d) added to Scan Delegator at Index %u: ", | |
state->src_id, state->src_id, internal_state->index); |
76083d7
to
9c8437c
Compare
9c8437c
to
be1ecf6
Compare
be1ecf6
to
60c916e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still a few formatting issues.
Also, you've (accidentally?) resolved a few comments that weren't fixed.
60c916e
to
10b1548
Compare
Kconfig option BT_BAP_SCAN_DELEGATOR_OVERWRITE_OLDEST allows the Scan Delegator to overwrite the oldest inactive receive state if there aren't any free receive states. A inactive receive state is a receive state that has neither a Periodic Advertising or Broadcast Isochronous Group (BIG) sync. There is also a recv_state_add_fail callback function added which can notify an application if all receive states are not inactive and can't be freed. Signed-off-by: Paul Mulligan <[email protected]>
10b1548
to
a2f9362
Compare
@pmullt Looks like it needs a rebase :) |
This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time. |
This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time. |
Kconfig option CONFIG_SD_RECEIVE_STATE_OVERWRITE_OLDEST allows the Scan Delegator to overwrite the oldest updated receive state which is not being synced, if receive states are full.
There is also a recv_states_full() callback function added which can notify an application if all receive states are full and being synced.