-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Bluetooth: Controller: Implement PAST Support #78894
base: main
Are you sure you want to change the base?
Conversation
platform_allow: | ||
- nrf52_bsim | ||
- nrf5340bsim/nrf5340/ | ||
- nrf5340bsim/nrf5340/cpuapp |
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 you want to build for the nrf5340bsim/nrf5340/cpuapp you'll need to use sysbuild (you can check other bsim tests building for it)
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.
initial comments, will do re-review after these comments are addressed and CI jobs are passing.
0cfd60a
to
d7b3d88
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.
With a very quick pass, the changes LGTM, I do not see any objections from my side. Just get the CI happy :-)
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.
nitpick.... use Bluetooth and Controller with B
and C
in commit title and message body etc... (BT Spec documentation uses so).
d7b3d88
to
165f287
Compare
I change requests have been addressed.
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.
Very nice work. Great that you've added a bunch of tests for this
Most comments are code style and security related
CONFIG_BT_ISO_BROADCASTER=y | ||
CONFIG_BT_ISO_SYNC_RECEIVER=y |
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.
Is ISO needed for this test?
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.
Yes, same as earlier message.
#define FAIL(...) \ | ||
do { \ | ||
bst_result = Failed; \ | ||
bs_trace_error_time_line(__VA_ARGS__); \ | ||
} while (0) | ||
|
||
#define PASS(...) \ | ||
do { \ | ||
bst_result = Passed; \ | ||
bs_trace_info_time(1, __VA_ARGS__); \ | ||
} while (0) |
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.
Consider having a look at the https://github.com/zephyrproject-rtos/zephyr/tree/main/tests/bsim/babblekit and https://github.com/zephyrproject-rtos/zephyr/tree/main/tests/bluetooth/common/testlib to see if you can reduce the overhead here by using the predefined test helpers
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.
This is how it is done everywhere, so it should probably be a separate PR for fixing and cleaning this up everywhere in both host and controller bsim tests.
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.
I understand your point, although I don't necessarily agree. We do not need to follow the structure of older tests if new tests could use frameworks that were not available when the older tests were written.
It's OK to keep as is, but could have saved you time to use the frameworks we have now :)
165f287
to
0d53aa8
Compare
INVALID_SYNC_HANDLE; | ||
ctx->data.periodic_sync.adv_handle = adv_sync ? ull_adv_sync_handle_get(adv_sync) : | ||
INVALID_ADV_HANDLE; | ||
ctx->data.periodic_sync.id = service_data; |
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.
Would it make sense to use service_data
instead of id
in the periodic_sync
struct?
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.
The only reason it is called ID is because of the naming in the Spec:
"ID shall be set to an identifier provided by the Host. This is for use by higher-level protocols and its value is not specified or used by this specification."
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.
Aha, interesting. I'm having trouble finding where it's defined that the id
here is the same value as the service_data
provided by the host. I believe it's correct that it is, but haven't found where that's explicitly stated
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.
I haven't seen it explicitly stated anywhere in the Spec. However, it is the only host parameter in HCI_LE_Periodic_Advertising_Sync_Transfer
and HCI_LE_Periodic_Advertising_Sync_Transfer
with the correct range and description, but it is not explicitly stated anywhere.
0813c81
to
4a2e12d
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.
No more blocking comments from me, but we should really get @cvinayak to do another review and respond to some of the outstanding comments before I'll approve
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.
No definite change requests from my end. LGTM.
CONFIG_BT_CTLR_SYNC_ISO_STREAM_COUNT=1 | ||
CONFIG_BT_CTLR_CONN_ISO_STREAMS=1 | ||
CONFIG_BT_CTLR_CONN_ISO_GROUPS=1 |
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.
@lutb-ot you should make sca
available for PAST support too.
Background, periodic sync needs sca
but uses it as local variable to calculate window widening. But a ISO sync is established using an inherited sca
value, hence sca
was stored in lll_sync
context. Now that PAST feature will need the sca
to be remembered, i think we should make the sca
field available in the lll_sync
context? or wait, if this is for window widening, then it would be calculated only once, do we really need it to be present in lll_sync
context?
4a2e12d
to
ae127b1
Compare
ae127b1
to
af1794a
Compare
PDU_SYNC_INFO_SCA_CHM_SCA_BIT_MASK) >> | ||
PDU_SYNC_INFO_SCA_CHM_SCA_BIT_POS; | ||
|
||
lll->sca = sca; |
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.
dont you need conditional compiles here?
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.
The whole function is already flaged with CONFIG_BT_CTLR_SYNC_TRANSFER_RECEIVER.
Adding PDU flow for Periodic Sync Indication Signed-off-by: Lucas Mathias Balling <[email protected]>
Added LLCP PDU Periodic Sync Indication unittests Signed-off-by: Lucas Mathias Balling <[email protected]>
66b4b23
to
1d91fa8
Compare
Implement PAST support in ULL and fixed test after changed dependencies in ull_sync_internal.c Signed-off-by: Lucas Mathias Balling <[email protected]>
Implemented: * Central sync to broadcaster, connects to peripheral and transfers sync. Peripheral Syncs to PA * Broadcaster acting Central connects to peripheral and transfers sync. Peripheral sync to PA * Moved previous bis tests to test_bis.c and new PAST tests was added in test_past.c Signed-off-by: Lucas Mathias Balling <[email protected]>
Fixed PAST support for bap_scan_delegator Signed-off-by: Lucas Mathias Balling <[email protected]>
1d91fa8
to
89eaa5c
Compare
Implements: