Skip to content

Commit 35e9a11

Browse files
committed
Merge branch 'bugfix/l2cap_use_wrong_handle_v5.3' into 'release/v5.3'
fix(bt/bluedroid): Fixed the issue of using the wrong handle to handle the BTA_JV_L2CAP_READ_EVT event(v5.3) See merge request espressif/esp-idf!31278
2 parents 1316c4b + 4a91935 commit 35e9a11

File tree

1 file changed

+2
-4
lines changed
  • components/bt/host/bluedroid/btc/profile/std/l2cap

1 file changed

+2
-4
lines changed

components/bt/host/bluedroid/btc/profile/std/l2cap/btc_l2cap.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -906,7 +906,6 @@ void btc_l2cap_cb_handler(btc_msg_t *msg)
906906
fixed_queue_enqueue(slot->rx.queue, p_data_buf, FIXED_QUEUE_MAX_TIMEOUT);
907907
} else {
908908
osi_free(p_data_buf);
909-
break;
910909
}
911910
}
912911
osi_mutex_unlock(&l2cap_local_param.l2cap_slot_mutex);
@@ -945,12 +944,11 @@ void btc_l2cap_cb_handler(btc_msg_t *msg)
945944
break; // to do disconnect
946945
}
947946
memset(p_data_buf, 0, count + sizeof(BT_HDR));
948-
p_data_buf->len = BTA_JvL2capRead(p_data->data_ind.handle, slot->id, p_data_buf->data, count);
947+
p_data_buf->len = BTA_JvL2capRead(p_data->l2c_read.handle, slot->id, p_data_buf->data, count);
949948
if (p_data_buf->len > 0) {
950949
fixed_queue_enqueue(slot->rx.queue, p_data_buf, FIXED_QUEUE_MAX_TIMEOUT);
951950
} else {
952951
osi_free(p_data_buf);
953-
break;
954952
}
955953
}
956954
osi_mutex_unlock(&l2cap_local_param.l2cap_slot_mutex);
@@ -1060,7 +1058,7 @@ static ssize_t l2cap_vfs_write(int fd, const void * data, size_t size)
10601058
if (!enqueue_status) {
10611059
BTC_TRACE_DEBUG("%s tx_len:%d, fd:%d\n", __func__, fixed_queue_length(slot->tx.queue), fd);
10621060
osi_mutex_unlock(&l2cap_local_param.l2cap_slot_mutex);
1063-
//block untill under water level, be closed or time out
1061+
//block until under water level, be closed or time out
10641062
tx_event_group_val =
10651063
xEventGroupWaitBits(l2cap_local_param.tx_event_group, SLOT_WRITE_BIT(serial) | SLOT_CLOSE_BIT(serial), pdTRUE,
10661064
pdFALSE, VFS_WRITE_TIMEOUT / portTICK_PERIOD_MS);

0 commit comments

Comments
 (0)