Skip to content

Commit afef6e2

Browse files
jori-nordicfabiobaltieri
authored andcommitted
Bluetooth: att: precise warning messages
- Downgrade the warning emitted when we run out of channels. - Only log a warning when failing to establish channels and the error is not -ENOMEM. - Add a debug log message in that case to hint what might've happened. This should make it less confusing to the average user not aware of the stack internals. Signed-off-by: Jonathan Rico <[email protected]>
1 parent 477c0fc commit afef6e2

File tree

1 file changed

+6
-2
lines changed
  • subsys/bluetooth/host

1 file changed

+6
-2
lines changed

subsys/bluetooth/host/att.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3227,7 +3227,7 @@ static struct bt_att_chan *att_chan_new(struct bt_att *att, atomic_val_t flags)
32273227
}
32283228

32293229
if (quota == ATT_CHAN_MAX) {
3230-
BT_WARN("Maximum number of channels reached: %d", quota);
3230+
BT_DBG("Maximum number of channels reached: %d", quota);
32313231
return NULL;
32323232
}
32333233
}
@@ -3278,7 +3278,11 @@ static void att_enhanced_connection_work_handler(struct k_work *work)
32783278
const struct bt_att *att = CONTAINER_OF(dwork, struct bt_att, eatt.connection_work);
32793279
const int err = bt_eatt_connect(att->conn, att->eatt.chans_to_connect);
32803280

3281-
if (err < 0) {
3281+
if (err == -ENOMEM) {
3282+
BT_DBG("Failed to connect %d EATT channels, central has probably "
3283+
"already established some.",
3284+
att->eatt.chans_to_connect);
3285+
} else if (err < 0) {
32823286
BT_WARN("Failed to connect %d EATT channels (err: %d)",
32833287
att->eatt.chans_to_connect, err);
32843288
}

0 commit comments

Comments
 (0)