Skip to content

Commit

Permalink
Bluetooth: ATT: Move setting of initial MTU to att_chan_new
Browse files Browse the repository at this point in the history
The L2CAP MTU can and should be set already during the channel setup.

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
  • Loading branch information
alwa-nordic authored and carlescufi committed Apr 24, 2023
1 parent a2dc61a commit 3de6f7c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions subsys/bluetooth/host/att.c
Original file line number Diff line number Diff line change
Expand Up @@ -3039,11 +3039,6 @@ static void bt_att_connected(struct bt_l2cap_chan *chan)

atomic_set_bit(att_chan->flags, ATT_CONNECTED);

if (!bt_att_is_enhanced(att_chan)) {
le_chan->tx.mtu = BT_ATT_DEFAULT_LE_MTU;
le_chan->rx.mtu = BT_ATT_DEFAULT_LE_MTU;
}

att_chan_mtu_updated(att_chan);

k_work_init_delayable(&att_chan->timeout_work, att_timeout);
Expand Down Expand Up @@ -3255,6 +3250,11 @@ static struct bt_att_chan *att_chan_new(struct bt_att *att, atomic_val_t flags)
chan->att = att;
att_chan_attach(att, chan);

if (!bt_att_is_enhanced(chan)) {
chan->chan.tx.mtu = BT_ATT_DEFAULT_LE_MTU;
chan->chan.rx.mtu = BT_ATT_DEFAULT_LE_MTU;
}

return chan;
}

Expand Down

0 comments on commit 3de6f7c

Please sign in to comment.