Skip to content

Commit 0777583

Browse files
cvinayakaescolar
authored andcommitted
Bluetooth: Controller: Fix peripheral ISO data ack mechanism
Fix peripheral ISO data ack mechanism to correctly update the SN when PDUs fail to be received. Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
1 parent 0b27981 commit 0777583

File tree

2 files changed

+20
-8
lines changed

2 files changed

+20
-8
lines changed

subsys/bluetooth/controller/ll_sw/nordic/lll/lll_central_iso.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -760,7 +760,7 @@ static void isr_rx(void *param)
760760
ull_iso_pdu_rx_alloc_peek(2U)) {
761761
struct node_rx_iso_meta *iso_meta;
762762

763-
/* Increment next expected serial number */
763+
/* Increment next expected sequence number */
764764
cis_lll->nesn++;
765765

766766
#if defined(CONFIG_BT_CTLR_LE_ENC)

subsys/bluetooth/controller/ll_sw/nordic/lll/lll_peripheral_iso.c

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,21 @@ static void isr_rx(void *param)
443443

444444
/* No Rx */
445445
if (!trx_done) {
446+
/* FIXME: Consider Flush Timeout when resetting current burst number */
447+
if (!has_tx) {
448+
has_tx = 1U;
449+
450+
/* Adjust nesn when flushing Tx */
451+
/* FIXME: When Flush Timeout is implemented */
452+
if (bn_tx <= cis_lll->tx.bn) {
453+
/* sn and nesn are 1-bit, only Least Significant bit is needed */
454+
cis_lll->sn += cis_lll->tx.bn + 1U - bn_tx;
455+
}
456+
457+
/* Start transmitting new burst */
458+
bn_tx = 1U;
459+
}
460+
446461
if (se_curr < cis_lll->nse) {
447462
radio_isr_set(isr_prepare_subevent, param);
448463
} else {
@@ -534,7 +549,7 @@ static void isr_rx(void *param)
534549
ull_iso_pdu_rx_alloc_peek(2U)) {
535550
struct node_rx_iso_meta *iso_meta;
536551

537-
/* Increment next expected serial number */
552+
/* Increment next expected sequence number */
538553
cis_lll->nesn++;
539554

540555
#if defined(CONFIG_BT_CTLR_LE_ENC)
@@ -618,20 +633,17 @@ static void isr_rx(void *param)
618633
if (!has_tx) {
619634
has_tx = 1U;
620635

621-
/* Adjust sn when flushing Tx. Stop at sn != nesn, hence
622-
* (bn < cis_lll->tx.bn).
623-
*/
636+
/* Adjust nesn when flushing Tx */
624637
/* FIXME: When Flush Timeout is implemented */
625-
if (bn_tx < cis_lll->tx.bn) {
638+
if (bn_tx <= cis_lll->tx.bn) {
626639
/* sn and nesn are 1-bit, only Least Significant bit is needed */
627-
cis_lll->sn += cis_lll->tx.bn - bn_tx;
640+
cis_lll->sn += cis_lll->tx.bn + 1U - bn_tx;
628641
}
629642

630643
/* Start transmitting new burst */
631644
bn_tx = 1U;
632645
}
633646

634-
635647
/* Close Isochronous Event */
636648
cie = cie || ((bn_rx > cis_lll->rx.bn) &&
637649
(bn_tx > cis_lll->tx.bn) &&

0 commit comments

Comments
 (0)