adjust l2cap mtu

This commit is contained in:
awalol
2026-05-13 16:45:48 +08:00
parent 462ddcb4c7
commit d3311a35d9
+8 -2
View File
@@ -17,8 +17,8 @@
#include "config.h"
#include "pico/util/queue.h"
#define MTU_CONTROL 256
#define MTU_INTERRUPT 1691
#define MTU_CONTROL 672
#define MTU_INTERRUPT 672
using std::unordered_map;
using std::vector;
@@ -395,6 +395,9 @@ static void l2cap_packet_handler(uint8_t packet_type, uint16_t channel, uint8_t
if (psm == PSM_HID_CONTROL) {
printf("[L2CAP] HID Control opened cid=0x%04X\n", local_cid);
hid_control_cid = local_cid;
const auto mtu = l2cap_get_remote_mtu_for_local_cid(hid_control_cid);
printf("[L2CAP] Remote Control MTU: %d\n",mtu);
} else if (psm == PSM_HID_INTERRUPT) {
printf("[L2CAP] HID Interrupt opened cid=0x%04X\n", local_cid);
hid_interrupt_cid = local_cid;
@@ -429,6 +432,9 @@ static void l2cap_packet_handler(uint8_t packet_type, uint16_t channel, uint8_t
memcpy(report32 + 2, packet_0x10, sizeof(packet_0x10));
bt_write(report32, sizeof(report32));
const auto mtu = l2cap_get_remote_mtu_for_local_cid(hid_interrupt_cid);
printf("[L2CAP] Remote Interrupt MTU: %d\n",mtu);
// tud_connect();
} else {
printf("[L2CAP] Unknown Channel psm: 0x%02X", psm);