Skip to content

Commit

Permalink
host/ble_att.c: fix ATT MTU for EATT channels
Browse files Browse the repository at this point in the history
For EATT bearer, ATT MTU is same for bot RX and TX and is minimum of the
two. L2CAP Credit Based Reconfigure Request can be used to change its
value.
  • Loading branch information
KKopyscinski committed Aug 21, 2023
1 parent 71bbaaf commit 7d46958
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions nimble/host/src/ble_att.c
Original file line number Diff line number Diff line change
Expand Up @@ -463,9 +463,12 @@ ble_att_chan_mtu(const struct ble_l2cap_chan *chan)
uint16_t mtu;

#if MYNEWT_VAL(BLE_EATT_CHAN_NUM) > 0
if (chan->scid != BLE_L2CAP_CID_ATT) {
/* EATT case */
return chan->coc_tx.mtu;
if (chan->psm == BLE_EATT_PSM) {
/* The ATT_MTU for the Enhanced ATT bearer shall be set to the minimum of the
* MTU field values of the two devices. Reference:
* Core v5.0, Vol 6, Part B, section 1.3.2.1
*/
return min(chan->coc_tx.mtu, chan->coc_rx.mtu);
}
#endif

Expand Down

0 comments on commit 7d46958

Please sign in to comment.