-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Bluetooth: Controller: Add support for scanning complete periodic adv trains #37943
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: Add support for scanning complete periodic adv trains #37943
Conversation
1cf6837 to
8583311
Compare
subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync_internal.h
Outdated
Show resolved
Hide resolved
samples/bluetooth/direction_finding_connectionless_rx/boards/nrf52833dk_nrf52833.conf
Outdated
Show resolved
Hide resolved
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.
Rename is_aux_sched to aux_lll_sched in LLL context for consistency.
| if (ftr->aux_lll_sched) { | |
| lll->aux_lll_sched = ftr->aux_lll_sched; | |
| if (ftr->aux_lll_sched) { |
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'm wondering about one situation. What in case the scanner is synchronized to periodic advertisement, there is a chain of e.g. 6 PDUs. 4th AUX_CHAIN_IND PDU is received with wrong CRC. node_rx is set to type: NODE_RX_TYPE_EXT_AUX_RELEASE but no report is generated to inform host about incomplete data and no more IQ reports.
See 7.7.65.21 LE Connectionless IQ Report event:
This event is also used by the Controller to report that it has insufficient
resources to report IQ samples for all received Constant Tone Extensions and
has failed to sample at least once. In this case Packet_Status shall be set to
0xFF and Sample_Count to 0x00.
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 function declaration should go into nordic/lll/lll_sync_interna.h. There is no such file, so please create a new one.
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 function may be changed to static. It is used in lll_sync.c only.
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.
err here overlaps with err declared at the beginning of the function.
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.
what about this?
samples/bluetooth/direction_finding_connectionless_rx/boards/nrf52833dk_nrf52833.conf
Outdated
Show resolved
Hide resolved
Yes, I noticed this when making changes towards |
|
The PR has to be merged after: #37930 |
|
I've just spot one more thing. Max number of node_rx required to single per. adv. event (when DF is also enabled) is 16x2 (per. adv. reports, cte IQ reports). I suggest to change the This is solved by commit: a1b8d14 |
Set the required number conditionally based on features enabled (Do not want increased RAM when Periodic and/or DF is not used). |
b002c3e to
22feb53
Compare
|
@cvinayak @ppryga I pushed additional commit that addresses main issue i.e. moving sync specific code from lll_scan_aux to lll_sync. There's just one extra branch in |
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.
Did a quick pass, looks good. Will do some testing and review early tomorrow, and will get back.
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 went over last commit very briefly. I'll continue that in the morning.
|
No more comments from my site. |
22feb53 to
a1b8d14
Compare
a1b8d14 to
1c0ed5a
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.
There are some not addressed comments.
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 function may be changed to static. It is used in lll_sync.c only.
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.
what about this?
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 stressing change requests from my side. I could not get to testing, but will do when I can get to it in my todo. Any functional issues can be address when discovered as bug fixes.
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.
Thinking aloud, no change required. Application ecosystems with known max data length may want the count to be configurable to reduce RAM.
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.
Tested with use of direction_finding_connectionless_rx. Changes approved.
Periodic advertising reports can have 255 bytes of payload so need to use that value by default if periodic advertising is enabled. Signed-off-by: Andrzej Kaczmarek <[email protected]>
We should decide on flush immediately vs. from disabled_cb based on ull_hdr reference count instead of last rxd node - if ull_hdr has non-zero ref, then done event is still pending and we should flush from there. Signed-off-by: Andrzej Kaczmarek <[email protected]>
aux->rx_last cannot be NULL since it's always set after acquire to a valid node so the flow in flush() can be simplified. rx parameter is only used to update PDU chain, then it's overwritten, so we can instead update PDU chain in caller since there's only one place when this should happen. Signed-off-by: Andrzej Kaczmarek <[email protected]>
This adds complete support for scanning for periodic advertising trains. AUX_SYNC_IND is always scheduled from ULL as usual, then code for aux scanning is reused to allow for AUX_CHAIN_IND scanning scheduled from both ULL and LLL, depending on AuxPtr. Signed-off-by: Andrzej Kaczmarek <[email protected]>
We use 1st node enqueued in aux context to retrieve lll scan/sync struct, but that only works if we buffer PDUs in aux context. It's better to store parent lll struct as explicit member in aux context as this also works if we skip buffering. Signed-off-by: Andrzej Kaczmarek <[email protected]>
Periodic advertising reports can be reated directly from single PDU as they do not require any information from superior PDU, so we can dispatch them immediately instead of buffering in aux context and flushing at the end of chain. This also resolves proper order of Periodic advertising and IQ reports. Signed-off-by: Andrzej Kaczmarek <[email protected]>
AdvA, TargetA, ADI and SyncInfo are RFU in periodic advertising PDUs so we should ignore them when present in PDU. Signed-off-by: Andrzej Kaczmarek <[email protected]>
Periodic advertising PDUs are now dispatched immediately one by one (i.e. without list of PDUs as when flushed from aux context) so we do not need to iterate such a list. Signed-off-by: Andrzej Kaczmarek <[email protected]>
This updates DF to properly receive CTE in per adv chains scanning. Signed-off-by: Andrzej Kaczmarek <[email protected]>
Periodic advertising train scanner implemented in lll_scan_aux adds lots of branches that cannot be compiled out with periodic advertising sync disabled. This commit moves sync parts of the code from lll_scan_aux to lll_sync. Signed-off-by: Andrzej Kaczmarek <[email protected]>
This seems not to be needed anymore, it's only written. Signed-off-by: Andrzej Kaczmarek <[email protected]>
We need more RX nodes when scanning either extended/periodic advertising trains and CTE samples so pudate those values based on observer and DF features enabled. The number of nodes for non-DF allows to scan complete chain for each aux scan set (assuming max data length and optimal fragmentation by advertiser), for DF it allows to scan max possible PDUs and CTE samples. Signed-off-by: Andrzej Kaczmarek <[email protected]>
This was changes when sync chain handling was done in lll_scan_aux, we can now revert to original code. Signed-off-by: Andrzej Kaczmarek <[email protected]>
Add todos for few useful improvements that can be done later. Signed-off-by: Andrzej Kaczmarek <[email protected]>
'err' is already defined in parent scope, we can use. Just need to set it back to 0 before returning from function. Signed-off-by: Andrzej Kaczmarek <[email protected]>
044e0bb to
844712f
Compare
|
rebased due to conflict after #37934 was merged |
This adds support to scan complete periodic adv trains including mixed scheduling from ULL/LLL if necessary.