diff --git a/include/bluetooth/iso.h b/include/bluetooth/iso.h index e43b1cd31c4..93f69649ae9 100644 --- a/include/bluetooth/iso.h +++ b/include/bluetooth/iso.h @@ -405,6 +405,10 @@ struct bt_iso_chan_ops { * If this callback is provided it will be called whenever the * connection completes. * + * For a peripheral, the QoS values (see @ref bt_iso_chan_io_qos) + * are set when this is called. The peripheral does not have any + * information about the RTN though. + * * @param chan The channel that has been connected */ void (*connected)(struct bt_iso_chan *chan); diff --git a/subsys/bluetooth/host/iso.c b/subsys/bluetooth/host/iso.c index d14e93fb63b..964d788b471 100644 --- a/subsys/bluetooth/host/iso.c +++ b/subsys/bluetooth/host/iso.c @@ -815,6 +815,28 @@ void hci_le_cis_established(struct net_buf *buf) } if (!evt->status) { + if (iso->role == BT_HCI_ROLE_PERIPHERAL) { + struct bt_iso_chan *chan = iso->iso.chan; + struct bt_iso_chan_io_qos *rx; + struct bt_iso_chan_io_qos *tx; + + __ASSERT(chan != NULL && chan->qos != NULL, + "Invalid ISO chan"); + + rx = chan->qos->rx; + tx = chan->qos->tx; + + if (rx != NULL) { + rx->phy = evt->c_phy; + rx->sdu = evt->c_max_pdu; + } + + if (tx != NULL) { + tx->phy = evt->p_phy; + tx->sdu = evt->p_max_pdu; + } + } /* values are already set for central */ + /* TODO: Add CIG sync delay */ bt_conn_set_state(iso, BT_CONN_CONNECTED); bt_conn_unref(iso);