bluekitchen / btstack

Dual-mode Bluetooth stack, with small memory footprint.
http://bluekitchen-gmbh.com
Other
1.72k stars 610 forks source link

HID: Interrupt channel closed immediately #263

Closed rayPopo closed 4 years ago

rayPopo commented 4 years ago

hi: i use esp32 sim nintendo switch pro controller with btstack.but INTERRUPT only opened 0.5 sec. i used https://github.com/Molorius/esp-idf/tree/feature/btclassic-hid-device to do this project same ok.

this is btstack log

BTstack: setup [00:00:00.070] LOG -- btstack_run_loop_freertos.c.301: run loop init, task 0x3ffbba3c, queue item size 8 [00:00:00.079] LOG -- main.c.271: transport_register_packet_handler [00:00:00.101] LOG -- btstack_tlv.c.48: TLV Instance 0x3f4097b0 [00:00:00.437] LOG -- l2cap.c.3550: L2CAP_REGISTER_SERVICE psm 0x1 mtu 65535 [00:00:00.438] LOG -- l2cap.c.3550: L2CAP_REGISTER_SERVICE psm 0x13 mtu 700 [00:00:00.440] LOG -- l2cap.c.3550: L2CAP_REGISTER_SERVICE psm 0x11 mtu 700 [00:00:00.447] LOG -- hci.c.3060: hci_power_control: 1, current mode 0 [00:00:00.453] LOG -- main.c.208: transport_init [00:00:00.457] LOG -- main.c.224: transport_open I (462) BTDM_INIT: BT controller compile version [acab313] I (468) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE I (542) phy: phy_version: 4009, e7844c0, Jul 15 2019, 13:20:06, 0, 0 [00:00:00.856] LOG -- hci.c.4203: BTSTACK_EVENT_STATE 1 [00:00:00.857] EVT <= 60 01 01 [00:00:00.857] CMD => 03 0C 00 BTstack: execute run loop [00:00:00.858] EVT <= 6E 00 [00:00:00.861] EVT <= 0E 04 05 03 0C 00 [00:00:00.865] CMD => 01 10 00 [00:00:00.868] EVT <= 0E 0C 05 01 10 00 08 0E 03 08 60 00 0E 03 [00:00:00.873] LOG -- hci.c.2001: Manufacturer: 0x0060 [00:00:00.878] EVT <= 6E 00 [00:00:00.881] CMD => 14 0C 00 [00:00:00.884] EVT <= 0E FC 05 14 0C 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [00:00:00.952] LOG -- hci.c.1899: local name: [00:00:00.956] LOG -- hci.c.1658: Received local name, need baud change 0 [00:00:00.963] EVT <= 6E 00 [00:00:00.965] CMD => 02 10 00 [00:00:00.968] EVT <= 0E 44 05 02 10 00 BF FF FF 03 CC FF EF FF 3F FF FC 1F F2 0F E8 FE 3F F7 8F FF 1C 00 04 00 61 F7 FF FF 7F 38 C0 FF 7F FF FF 0F 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [00:00:00.988] LOG -- hci.c.2012: Local supported commands summary 0x3f [00:00:00.995] EVT <= 6E 00 [00:00:00.997] CMD => 09 10 00 [00:00:01.000] EVT <= 0E 0A 05 09 10 00 56 BE 6D 12 CF A4 [00:00:01.005] LOG -- hci.c.1956: Local Address, Status: 0x00: Addr: A4:CF:12:6D:BE:56 [00:00:01.013] EVT <= 6E 00 [00:00:01.016] CMD => 05 10 00 [00:00:01.019] EVT <= 0E 0B 05 05 10 00 FD 03 FF 09 00 04 00 [00:00:01.024] LOG -- hci.c.1916: hci_read_buffer_size: ACL size module 1021 -> used 1021, count 9 / SCO size 255, count 4 [00:00:01.035] EVT <= 6E 00 [00:00:01.037] CMD => 03 10 00 [00:00:01.040] EVT <= 0E 0C 05 03 10 00 BF EE CD FE DB FF 7B 87 [00:00:01.046] LOG -- hci.c.1983: Packet types cc18, eSCO 1 [00:00:01.051] LOG -- hci.c.1986: BR/EDR support 1, LE support 0 [00:00:01.057] EVT <= 6E 00 [00:00:01.060] CMD => 33 0C 07 00 04 3C 14 00 0A 00 [00:00:01.064] EVT <= 0E 04 05 33 0C 00 [00:00:01.068] EVT <= 6E 00 [00:00:01.071] CMD => 31 0C 01 03 [00:00:01.074] EVT <= 0E 04 05 31 0C 00 [00:00:01.077] EVT <= 6E 00 [00:00:01.080] CMD => 01 0C 08 FF FF FF FF FF FF FF 1F [00:00:01.085] EVT <= 0E 04 05 01 0C 00 [00:00:01.088] EVT <= 6E 00 [00:00:01.091] CMD => 56 0C 01 01 [00:00:01.094] EVT <= 0E 04 05 56 0C 00 [00:00:01.098] EVT <= 6E 00 [00:00:01.100] CMD => 18 0C 02 00 60 [00:00:01.104] EVT <= 0E 04 05 18 0C 00 [00:00:01.107] EVT <= 6E 00 [00:00:01.110] CMD => 0F 08 02 00 00 [00:00:01.114] EVT <= 0E 04 05 0F 08 00 [00:00:01.117] EVT <= 6E 00 [00:00:01.120] CMD => 24 0C 03 08 25 00 [00:00:01.123] EVT <= 0E 04 05 24 0C 00 [00:00:01.127] EVT <= 6E 00 [00:00:01.130] CMD => 13 0C F8 4A 6F 79 2D 43 6F 6E 28 52 29 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [00:00:01.197] EVT <= 0E 04 05 13 0C 00 [00:00:01.201] EVT <= 6E 00 [00:00:01.203] CMD => 52 0C F1 00 0B 09 4A 6F 79 2D 43 6F 6E 28 52 29 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [00:00:01.269] EVT <= 0E 04 05 52 0C 00 [00:00:01.273] EVT <= 6E 00 [00:00:01.275] CMD => 45 0C 01 00 [00:00:01.278] EVT <= 0E 04 05 45 0C 00 [00:00:01.282] EVT <= 6E 00 [00:00:01.285] CMD => 1A 0C 01 03 [00:00:01.288] EVT <= 0E 04 05 1A 0C 00 [00:00:01.291] LOG -- hci.c.4327: BTSTACK_EVENT_DISCOVERABLE_ENABLED 1 [00:00:01.298] EVT <= 66 01 01 [00:00:01.300] EVT <= 6E 00 [00:00:01.303] LOG -- hci.c.1460: HCI_INIT_WRITE_SYNCHRONOUS_FLOW_CONTROL_ENABLE [00:00:01.310] CMD => 2F 0C 01 01 [00:00:01.313] EVT <= 0E 04 05 2F 0C 00 [00:00:01.317] LOG -- hci.c.2017: synchronous_flow_control_enabled = 1 [00:00:01.323] EVT <= 6E 00 [00:00:01.326] CMD => 5B 0C 01 01 [00:00:01.329] EVT <= 0E 04 05 5B 0C 00 [00:00:01.333] LOG -- hci.c.1522: hci_init_done -> HCI_STATE_WORKING [00:00:01.339] LOG -- hci.c.4203: BTSTACK_EVENT_STATE 2 [00:00:01.344] EVT <= 60 01 02 [00:00:01.346] LOG -- main.c.345: transport: configure SCO over HCI, result 0x0000 BTstack up and running at A4:CF:12:6D:BE:56 [00:00:01.358] EVT <= 6E 00 [00:00:01.979] EVT <= 04 0A 50 A0 E7 E9 B6 98 3C 04 00 01 [00:00:01.979] LOG -- hci.c.2127: Connection_incoming: 98:B6:E9:E7:A0:50, type 1 [00:00:01.980] LOG -- hci.c.187: create_connection_for_addr 98:B6:E9:E7:A0:50, type ff [00:00:01.988] LOG -- hci.c.3567: sending hci_accept_connection_request, remote eSCO 0 [00:00:01.996] CMD => 09 04 07 50 A0 E7 E9 B6 98 01 [00:00:02.001] EVT <= 0F 04 00 05 09 04 [00:00:02.004] EVT <= 6E 00 [00:00:02.010] EVT <= 03 0B 00 80 00 50 A0 E7 E9 B6 98 01 00 [00:00:02.012] LOG -- hci.c.2151: Connection_complete (status=0) 98:B6:E9:E7:A0:50 [00:00:02.019] LOG -- hci.c.2164: New connection: handle 128, 98:B6:E9:E7:A0:50 [00:00:02.026] LOG -- hci.c.4272: BTSTACK_EVENT_NR_CONNECTIONS_CHANGED 1 [00:00:02.033] EVT <= 61 01 01 [00:00:02.036] CMD => 1B 04 02 80 00 [00:00:02.039] EVT <= 1B 03 80 00 05 [00:00:02.042] EVT <= 38 04 80 00 40 1F [00:00:02.046] EVT <= 38 04 80 00 80 0C [00:00:02.050] ACL <= 80 20 0A 00 06 00 01 00 0A 02 02 00 02 00 [00:00:02.056] EVT <= 32 09 50 A0 E7 E9 B6 98 03 00 02 [00:00:02.060] EVT <= 31 06 50 A0 E7 E9 B6 98 [00:00:02.065] EVT <= 0F 04 00 05 1B 04 [00:00:02.068] EVT <= 0B 0B 00 80 00 BF FE CF FE DB FF 7B 87 [00:00:02.074] LOG -- hci.c.2217: HCI_EVENT_READ_REMOTE_SUPPORTED_FEATURES_COMPLETE, bonding flags 6, eSCO 1 [00:00:02.083] EVT <= 6E 00 [00:00:02.086] ACL => 80 00 10 00 0C 00 01 00 0B 02 08 00 02 00 00 00 80 02 00 00 [00:00:02.093] EVT <= 6E 00 [00:00:02.096] CMD => 35 0C 05 01 80 00 01 00 [00:00:02.100] EVT <= 6E 00 [00:00:02.103] LOG -- hci.c.3626: IO Capability Request received, stack bondable 1, io cap 3 [00:00:02.111] LOG -- hci.c.4411: gap_mitm_protection_required_for_security_level 0 [00:00:02.118] CMD => 2B 04 09 50 A0 E7 E9 B6 98 03 00 04 [00:00:02.123] EVT <= 13 05 01 80 00 01 00 [00:00:02.127] ACL <= 80 20 0A 00 06 00 01 00 0A 03 02 00 03 00 [00:00:02.133] EVT <= 0E 0A 05 2B 04 00 50 A0 E7 E9 B6 98 [00:00:02.138] EVT <= 6E 00 [00:00:02.180] ACL => 80 00 14 00 10 00 01 00 0B 03 0C 00 03 00 00 00 06 00 00 00 00 00 00 00 [00:00:02.180] EVT <= 6E 00 [00:00:02.180] CMD => 35 0C 05 01 80 00 01 00 [00:00:02.184] EVT <= 6E 00 [00:00:02.208] EVT <= 13 05 01 80 00 01 00 [00:00:02.214] EVT <= 33 0A 50 A0 E7 E9 B6 98 7F 12 08 00 [00:00:02.214] CMD => 2C 04 06 50 A0 E7 E9 B6 98 [00:00:02.215] EVT <= 0E 0A 05 2C 04 00 50 A0 E7 E9 B6 98 [00:00:02.218] EVT <= 6E 00 [00:00:02.227] EVT <= 36 07 00 50 A0 E7 E9 B6 98 [00:00:02.234] EVT <= 18 17 50 A0 E7 E9 B6 98 42 2D D7 43 40 4F 0A 6F 73 B7 18 89 D2 EB 8B 37 04 [00:00:02.235] LOG -- hci.c.386: gap_store_link_key_for_bd_addr: 98:B6:E9:E7:A0:50, type 4 [00:00:02.243] LOG -- btstack_link_key_db_tlv.c.151: tag_for_addr 42544c0f, tag_for_empy 42544c0e, tag_for_lowest_seq_nr 42544c0f [00:00:02.253] LOG -- btstack_link_key_db_tlv.c.165: store with tag 42544c0f [00:00:02.262] EVT <= 08 04 00 80 00 01 [00:00:02.263] CMD => 08 14 02 80 00 [00:00:02.267] ACL <= 80 20 0C 00 08 00 01 00 02 04 04 00 11 00 50 00 [00:00:02.273] LOG -- l2cap.c.1892: create channel 0x3ffcf8f4, local_cid 0x0041 [00:00:02.280] LOG -- hci.c.4436: gap_request_security_level requested level 0, planned level 0, current level 0 [00:00:02.290] LOG -- hci.c.4303: hci_emit_security_level 0 for handle 80 [00:00:02.296] EVT <= E0 03 80 00 00 [00:00:02.300] LOG -- l2cap.c.2262: l2cap - security level update for handle 0x0080 [00:00:02.307] LOG -- l2cap.c.2272: channel 0x3ffcf8f4, cid 0041 - state 5: actual 0 >= required 0? [00:00:02.316] LOG -- l2cap.c.969: L2CAP_EVENT_INCOMING_CONNECTION addr 98:B6:E9:E7:A0:50 handle 0x80 psm 0x11 local_cid 0x41 remote_cid 0x50 [00:00:02.328] EVT <= 72 0E 50 A0 E7 E9 B6 98 80 00 11 00 41 00 50 00 [00:00:02.335] LOG -- l2cap.c.2383: L2CAP_ACCEPT_CONNECTION local_cid 0x41 [00:00:02.341] EVT <= 0E 07 05 08 14 00 80 00 10 [00:00:02.346] LOG -- hci.c.2028: Handle 8004x key Size: 16 [00:00:02.351] LOG -- hci.c.4303: hci_emit_security_level 2 for handle 80 [00:00:02.357] EVT <= E0 03 80 00 02 [00:00:02.361] LOG -- l2cap.c.2262: l2cap - security level update for handle 0x0080 [00:00:02.368] LOG -- l2cap.c.2272: channel 0x3ffcf8f4, cid 0041 - state 17: actual 2 >= required 0? [00:00:02.377] EVT <= 6E 00 [00:00:02.380] ACL => 80 00 10 00 0C 00 01 00 03 04 08 00 41 00 50 00 00 00 00 00 [00:00:02.387] EVT <= 6E 00 [00:00:02.390] ACL => 80 00 10 00 0C 00 01 00 04 01 08 00 50 00 00 00 01 02 BC 02 [00:00:02.397] LOG -- l2cap.c.1130: l2cap_stop_rtx for local cid 0x41 [00:00:02.403] LOG -- l2cap.c.1139: l2cap_start_rtx for local cid 0x41 [00:00:02.409] EVT <= 13 05 01 80 00 01 00 [00:00:02.413] ACL <= 80 20 0C 00 08 00 01 00 02 05 04 00 13 00 53 00 [00:00:02.419] LOG -- l2cap.c.1892: create channel 0x3ffcf9c0, local_cid 0x0042 [00:00:02.426] LOG -- hci.c.4436: gap_request_security_level requested level 0, planned level 0, current level 2 [00:00:02.436] LOG -- hci.c.4303: hci_emit_security_level 2 for handle 80 [00:00:02.443] EVT <= E0 03 80 00 02 [00:00:02.446] LOG -- l2cap.c.2262: l2cap - security level update for handle 0x0080 [00:00:02.454] LOG -- l2cap.c.2272: channel 0x3ffcf9c0, cid 0042 - state 5: actual 2 >= required 0? [00:00:02.462] LOG -- l2cap.c.969: L2CAP_EVENT_INCOMING_CONNECTION addr 98:B6:E9:E7:A0:50 handle 0x80 psm 0x13 local_cid 0x42 remote_cid 0x53 [00:00:02.475] EVT <= 72 0E 50 A0 E7 E9 B6 98 80 00 13 00 42 00 53 00 I (2481) INT: Incoming [00:00:02.484] LOG -- l2cap.c.2383: L2CAP_ACCEPT_CONNECTION local_cid 0x42 [00:00:02.491] LOG -- l2cap.c.2272: channel 0x3ffcf8f4, cid 0041 - state 11: actual 2 >= required 0? [00:00:02.500] ACL <= 80 20 10 00 0C 00 01 00 04 06 08 00 41 00 00 00 01 02 BC 02 [00:00:02.507] LOG -- l2cap.c.2588: L2CAP signaling handler code 4, state 11 [00:00:02.514] LOG -- l2cap.c.2439: Remote MTU 700 [00:00:02.518] EVT <= 13 05 01 80 00 01 00 [00:00:02.522] ACL <= 80 20 0E 00 0A 00 01 00 05 01 06 00 41 00 00 00 00 00 [00:00:02.529] LOG -- l2cap.c.2588: L2CAP signaling handler code 5, state 11 [00:00:02.535] LOG -- l2cap.c.1130: l2cap_stop_rtx for local cid 0x41 [00:00:02.542] LOG -- l2cap.c.2519: l2cap_signaling_handle_configure_response [00:00:02.549] EVT <= 6E 00 [00:00:02.551] ACL => 80 00 10 00 0C 00 01 00 03 05 08 00 42 00 53 00 00 00 00 00 [00:00:02.559] EVT <= 6E 00 [00:00:02.561] ACL => 80 00 10 00 0C 00 01 00 04 02 08 00 53 00 00 00 01 02 BC 02 [00:00:02.568] LOG -- l2cap.c.1130: l2cap_stop_rtx for local cid 0x42 [00:00:02.574] LOG -- l2cap.c.1139: l2cap_start_rtx for local cid 0x42 [00:00:02.581] EVT <= 6E 00 [00:00:02.583] ACL => 80 00 12 00 0E 00 01 00 05 06 0A 00 50 00 00 00 00 00 01 02 BC 02 [00:00:02.591] LOG -- l2cap.c.935: L2CAP_EVENT_CHANNEL_OPENED status 0x0 addr 98:B6:E9:E7:A0:50 handle 0x80 psm 0x11 local_cid 0x41 remote_cid 0x50 local_mtu 700, remote_mtu 700, flush_timeout 0 [00:00:02.608] EVT <= 70 18 00 50 A0 E7 E9 B6 98 80 00 11 00 41 00 50 00 BC 02 BC 02 00 00 01 00 00 [00:00:02.617] EVT <= 13 05 01 80 00 01 00 [00:00:02.621] ACL <= 80 20 10 00 0C 00 01 00 04 07 08 00 42 00 00 00 01 02 BC 02 [00:00:02.628] LOG -- l2cap.c.2588: L2CAP signaling handler code 4, state 11 [00:00:02.635] LOG -- l2cap.c.2439: Remote MTU 700 [00:00:02.640] EVT <= 13 05 01 80 00 01 00 [00:00:02.643] ACL <= 80 20 0E 00 0A 00 01 00 05 02 06 00 42 00 00 00 00 00 [00:00:02.650] LOG -- l2cap.c.2588: L2CAP signaling handler code 5, state 11 [00:00:02.657] LOG -- l2cap.c.1130: l2cap_stop_rtx for local cid 0x42 [00:00:02.663] LOG -- l2cap.c.2519: l2cap_signaling_handle_configure_response [00:00:02.670] EVT <= 13 05 01 80 00 01 00 [00:00:02.674] EVT <= 6E 00 [00:00:02.677] ACL => 80 00 12 00 0E 00 01 00 05 07 0A 00 53 00 00 00 00 00 01 02 BC 02 [00:00:02.685] LOG -- l2cap.c.935: L2CAP_EVENT_CHANNEL_OPENED status 0x0 addr 98:B6:E9:E7:A0:50 handle 0x80 psm 0x13 local_cid 0x42 remote_cid 0x53 local_mtu 700, remote_mtu 700, flush_timeout 0 [00:00:02.701] EVT <= 70 18 00 50 A0 E7 E9 B6 98 80 00 13 00 42 00 53 00 BC 02 BC 02 00 00 01 00 00 I (2710) INT: Connected [00:00:02.713] EVT <= 13 05 01 80 00 01 00 [00:00:02.717] EVT <= 38 04 80 00 80 0C [00:00:02.721] EVT <= 6E 00 [00:00:02.723] CMD => 35 0C 05 01 80 00 06 00 [00:00:02.728] EVT <= 6E 00 [00:00:02.773] EVT <= 1B 03 80 00 01 [00:00:02.846] EVT <= 1B 03 80 00 05 [00:00:02.848] ACL <= 80 20 0C 00 08 00 01 00 06 08 04 00 42 00 53 00 [00:00:02.848] LOG -- l2cap.c.2588: L2CAP signaling handler code 6, state 12 [00:00:02.852] ACL => 80 00 0C 00 08 00 01 00 07 08 04 00 42 00 53 00 [00:00:02.858] LOG -- l2cap.c.963: L2CAP_EVENT_CHANNEL_CLOSED local_cid 0x42 [00:00:02.865] EVT <= 71 02 42 00 I (2868) INT: Closed [00:00:02.871] LOG -- l2cap.c.1898: free channel 0x3ffcf9c0, local_cid 0x0042 [00:00:02.878] LOG -- l2cap.c.1130: l2cap_stop_rtx for local cid 0x42 [00:00:02.884] EVT <= 6E 00 [00:00:02.887] CMD => 35 0C 05 01 80 00 01 00 [00:00:02.891] EVT <= 6E 00 [00:00:02.893] CMD => 1A 0C 01 02 [00:00:02.897] EVT <= 0E 04 05 1A 0C 00 [00:00:02.900] LOG -- hci.c.4327: BTSTACK_EVENT_DISCOVERABLE_ENABLED 0 [00:00:02.906] EVT <= 66 01 00 [00:00:02.909] EVT <= 6E 00 [00:00:02.914] ACL <= 80 20 0C 00 08 00 01 00 06 09 04 00 41 00 50 00 [00:00:02.918] LOG -- l2cap.c.2588: L2CAP signaling handler code 6, state 12 [00:00:02.925] ACL => 80 00 0C 00 08 00 01 00 07 09 04 00 41 00 50 00 [00:00:02.931] LOG -- l2cap.c.963: L2CAP_EVENT_CHANNEL_CLOSED local_cid 0x41 [00:00:02.938] EVT <= 71 02 41 00 [00:00:02.941] LOG -- l2cap.c.1898: free channel 0x3ffcf8f4, local_cid 0x0041 [00:00:02.948] LOG -- l2cap.c.1130: l2cap_stop_rtx for local cid 0x41 [00:00:02.954] EVT <= 13 05 01 80 00 01 00 [00:00:02.958] EVT <= 6E 00 [00:00:02.960] CMD => 35 0C 05 01 80 00 01 00 [00:00:02.965] EVT <= 6E 00 [00:00:02.983] EVT <= 13 05 01 80 00 01 00 [00:00:03.049] EVT <= 38 04 80 00 40 1F [00:00:05.419] EVT <= 05 04 00 80 00 13 [00:00:05.420] LOG -- hci.c.928: Connection closed: handle 0x80, 98:B6:E9:E7:A0:50 [00:00:05.420] LOG -- hci.c.4272: BTSTACK_EVENT_NR_CONNECTIONS_CHANGED 0 [00:00:05.426] EVT <= 61 01 00

this esp-idf log

<== 04 0e 04 05 24 0c 00 ==> 01 3a 0c 04 01 33 8b 9e <== 04 0e 04 05 3a 0c 00 ==> 01 1e 0c 04 00 08 12 00 <== 04 0e 04 05 1e 0c 00 ==> 01 1a 0c 01 01 <== 04 0e 04 05 1a 0c 00 ==> 01 24 0c 03 08 05 00 <== 04 0e 04 05 24 0c 00 ==> 01 1a 0c 01 03 <== 04 0e 04 05 1a 0c 00 <== 04 04 0a 50 a0 e7 e9 b6 98 3c 04 00 01

D (2234) BT_L2CAP: l2c_link_adjust_allocation num_hipri: 0 num_lowpri: 1 low_quota: 9 round_robin_quota: 0 qq: 9 D (2244) BT_L2CAP: l2c_link_adjust_allocation LCB 0 Priority: 0 XmitQuota: 9 D (2254) BT_L2CAP: SentNotAcked: 0 RRUnacked: 0

==> 01 09 04 07 50 a0 e7 e9 b6 98 01 <== 04 0f 04 00 05 09 04 <== 04 03 0b 00 80 00 50 a0 e7 e9 b6 98 01 00 <== 04 1b 03 80 00 05 ==> 01 1f 04 02 80 00 <== 04 0f 04 00 05 1f 04 <== 04 1c 05 00 80 00 12 35 ==> 01 1d 04 02 80 00 <== 04 0f 04 00 05 1d 04 <== 04 0c 08 00 80 00 08 0f 00 09 24 ==> 01 1b 04 02 80 00 <== 04 0f 04 00 05 1b 04 <== 04 0b 0b 00 80 00 bf fe cf fe db ff 7b 87 ==> 01 19 04 0a 50 a0 e7 e9 b6 98 01 00 00 00 <== 04 0f 04 00 05 19 04 <== 04 38 04 80 00 40 1f <== 02 80 20 0a 00 06 00 01 00 0a 02 02 00 02 00 D (2314) BT_L2CAP: l2cu_send_peer_info_req: type 0x0002 <== 04 07 ff 00 50 a0 e7 e9 b6 98 4e 69 6e 74 65 6e 64 6f 20 53 77 69 74 63 68 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 <== 04 32 09 50 a0 e7 e9 b6 98 03 00 02 <== 04 31 06 50 a0 e7 e9 b6 98 ==> 02 80 20 0a 00 06 00 01 00 0a 02 02 00 02 00 ==> 01 0d 08 04 80 00 04 00 <== 04 13 05 01 80 00 01 00 <== 02 80 20 10 00 0c 00 01 00 0b 02 08 00 02 00 00 00 b8 00 00 00 <== 04 0e 06 05 0d 08 00 80 00 ==> 01 35 0c 05 01 80 00 01 00 ==> 01 1c 04 03 80 00 01 ==> 02 80 20 10 00 0c 00 01 00 0b 02 08 00 02 00 00 00 b8 00 00 00 ==> 01 2b 04 09 50 a0 e7 e9 b6 98 01 00 03 <== 04 0e 0a 04 2b 04 00 50 a0 e7 e9 b6 98 D (2444) BT_L2CAP: l2cu_send_peer_info_req: type 0x0003 ==> 02 80 20 0a 00 06 00 01 00 0a 03 02 00 03 00 <== 04 13 05 01 80 00 01 00 <== 02 80 20 0a 00 06 00 01 00 0a 03 02 00 03 00 ==> 01 35 0c 05 01 80 00 01 00 ==> 02 80 20 14 00 10 00 01 00 0b 03 0c 00 03 00 00 00 d2 00 00 00 00 00 00 00 <== 04 13 05 01 80 00 01 00 <== 02 80 20 14 00 10 00 01 00 0b 03 0c 00 03 00 00 00 02 00 00 00 00 00 00 00 <== 04 13 05 01 80 00 01 00 ==> 01 35 0c 05 01 80 00 01 00 <== 04 33 0a 50 a0 e7 e9 b6 98 69 08 0c 00 ==> 01 2c 04 06 50 a0 e7 e9 b6 98 <== 04 0e 0a 04 2c 04 00 50 a0 e7 e9 b6 98 <== 04 36 07 00 50 a0 e7 e9 b6 98 <== 04 18 17 50 a0 e7 e9 b6 98 d5 6a e4 2f 66 a9 18 a7 1f 98 ab 35 02 bb 71 bb 04 <== 04 0f 04 00 05 1c 04 <== 02 80 20 0c 00 08 00 01 00 02 04 04 00 01 00 40 00 <== 04 23 0d 00 80 00 01 02 0f 00 00 00 00 00 00 00 ==> 01 35 0c 05 01 80 00 01 00 D (2604) BT_L2CAP: CID:0x0040 FCR Mode:0 Priority:2 TxDataRate:1 RxDataRate:1 Quota:200 D (2614) BT_L2CAP: L2CAP - st: CLOSED evt: 10 D (2614) BT_L2CAP: L2CAP - st: TERM_W4_SEC_COMP evt: 7 I (2624) BT_L2CAP: L2CAP - Calling Connect_Ind_Cb(), CID: 0x0040 I (2624) BT_L2CAP: L2CA_ErtmConnectRsp() CID: 0x0040 Result: 0 Status: 0 BDA: 98b6e9e7a050 p_ertm_info:0x0 D (2634) BT_L2CAP: L2CAP - st: W4_L2CA_CON_RSP evt: 22 ==> 02 80 20 10 00 0c 00 01 00 03 04 08 00 40 00 40 00 00 00 00 00 I (2654) BT_L2CAP: L2CA_ConfigReq() CID 0x0040: fcr_present:0 (mode 0) mtu_present:1 (672) D (2654) BT_L2CAP: L2CAP - st: CONFIG evt: 24 <== 04 13 05 01 80 00 01 00 <== 02 80 20 10 00 0c 00 01 00 04 05 08 00 40 00 00 00 01 02 4c 06 ==> 01 35 0c 05 01 80 00 01 00 ==> 02 80 20 10 00 0c 00 01 00 04 04 08 00 40 00 00 00 01 02 a0 02 ==> 01 1c 04 03 80 00 02 <== 04 0f 04 00 05 1c 04 D (2694) BT_L2CAP: L2CAP - st: CONFIG evt: 14 <== 04 13 05 01 80 00 01 00 <== 02 80 20 0e 00 0a 00 01 00 05 04 06 00 40 00 00 00 00 00 <== 04 23 0d 00 80 00 02 02 7f 0b 00 00 00 00 00 00 ==> 01 35 0c 05 01 80 00 01 00 D (2714) BT_L2CAP: l2c_fcr_process_peer_cfg_req() CFG fcr_present:0 fcr.mode:0 CCB FCR mode:0 preferred: 0 allowed:1 D (2724) BT_L2CAP: L2CAP - Calling Config_Req_Cb(), CID: 0x0040, C-bit 0 I (2734) BT_L2CAP: L2CA_ConfigRsp() CID: 0x0040 Result: 0 MTU present:0 Flush TO:0 FCR:0 FCS:0 D (2734) BT_L2CAP: L2CAP - st: CONFIG evt: 25 ==> 02 80 20 0e 00 0a 00 01 00 05 05 06 00 40 00 00 00 00 00 D (2754) BT_L2CAP: L2CAP - st: CONFIG evt: 15 <== 04 13 05 01 80 00 01 00 <== 02 80 20 11 00 0d 00 40 00 02 00 00 00 08 35 03 19 12 00 00 15 00 ==> 01 35 0c 05 01 80 00 01 00 D (2764) BT_L2CAP: CID:0x0040 FCR Mode:0 Priority:2 TxDataRate:1 RxDataRate:1 Quota:200 I (2774) BT_L2CAP: L2CAP - Calling Config_Rsp_Cb(), CID: 0x0040 ==> 01 0f 04 04 80 00 18 cc <== 04 0f 04 00 05 0f 04 <== 04 1d 05 00 80 00 18 cc ==> 01 0d 08 04 80 00 04 00 <== 04 0e 06 05 0d 08 00 80 00 D (2804) BT_L2CAP: L2CAP - st: OPEN evt: 20 I (2804) BT_L2CAP: L2CA_DataWrite() CID: 0x0040 Len: 10 D (2814) BT_L2CAP: L2CAP - st: OPEN evt: 30 ==> 02 80 20 0e 00 0a 00 40 00 03 00 00 00 05 00 00 00 00 00 I (2824) BT_L2CAP: L2CA_SetDesireRole() new:x1, disallow_switch:0 I (2834) GAP: ESP_BT_GAP_AUTH_CMPL_EVT <== 04 13 05 01 80 00 01 00 <== 02 80 20 0c 00 08 00 01 00 06 06 04 00 40 00 40 00 ==> 01 35 0c 05 01 80 00 01 00 D (2844) BT_L2CAP: L2CAP - st: OPEN evt: 17 I (2844) BT_L2CAP: L2CAP - Calling Disconnect_Ind_Cb(), CID: 0x0040 Conf Needed I (2854) BT_L2CAP: L2CA_DisconnectRsp() CID: 0x0040 D (2864) BT_L2CAP: L2CAP - st: W4_L2CA_DISC_RSP evt: 28 ==> 02 80 20 0c 00 08 00 01 00 07 06 04 00 40 00 40 00 <== 04 13 05 01 80 00 01 00 <== 02 80 20 0c 00 08 00 01 00 02 07 04 00 01 00 41 00 ==> 01 35 0c 05 01 80 00 01 00 D (2904) BT_L2CAP: CID:0x0041 FCR Mode:0 Priority:2 TxDataRate:1 RxDataRate:1 Quota:200 D (2904) BT_L2CAP: L2CAP - st: CLOSED evt: 10 D (2914) BT_L2CAP: L2CAP - st: TERM_W4_SEC_COMP evt: 7 I (2914) BT_L2CAP: L2CAP - Calling Connect_Ind_Cb(), CID: 0x0041 I (2924) BT_L2CAP: L2CA_ErtmConnectRsp() CID: 0x0041 Result: 0 Status: 0 BDA: 98b6e9e7a050 p_ertm_info:0x0 D (2934) BT_L2CAP: L2CAP - st: W4_L2CA_CON_RSP evt: 22 ==> 02 80 20 10 00 0c 00 01 00 03 07 08 00 41 00 41 00 00 00 00 00 I (2944) BT_L2CAP: L2CA_ConfigReq() CID 0x0041: fcr_present:0 (mode 0) mtu_present:1 (672) D (2954) BT_L2CAP: L2CAP - st: CONFIG evt: 24 ==> 02 80 20 10 00 0c 00 01 00 04 05 08 00 41 00 00 00 01 02 a0 02 <== 04 13 05 01 80 00 01 00 <== 02 80 20 10 00 0c 00 01 00 04 08 08 00 41 00 00 00 01 02 4c 06 <== 04 13 05 01 80 00 01 00 <== 02 80 20 0e 00 0a 00 01 00 05 05 06 00 41 00 00 00 00 00 ==> 01 35 0c 05 01 80 00 01 00 ==> 01 35 0c 05 01 80 00 01 00 D (2994) BT_L2CAP: L2CAP - st: CONFIG evt: 14 D (2994) BT_L2CAP: l2c_fcr_process_peer_cfg_req() CFG fcr_present:0 fcr.mode:0 CCB FCR mode:0 preferred: 0 allowed:1 D (3004) BT_L2CAP: L2CAP - Calling Config_Req_Cb(), CID: 0x0041, C-bit 0 I (3014) BT_L2CAP: L2CA_ConfigRsp() CID: 0x0041 Result: 0 MTU present:0 Flush TO:0 FCR:0 FCS:0 D (3024) BT_L2CAP: L2CAP - st: CONFIG evt: 25 ==> 02 80 20 0e 00 0a 00 01 00 05 08 06 00 41 00 00 00 00 00 D (3034) BT_L2CAP: L2CAP - st: CONFIG evt: 15 D (3044) BT_L2CAP: CID:0x0041 FCR Mode:0 Priority:2 TxDataRate:1 RxDataRate:1 Quota:200 I (3044) BT_L2CAP: L2CAP - Calling Config_Rsp_Cb(), CID: 0x0041 <== 04 13 05 01 80 00 01 00 <== 02 80 20 11 00 0d 00 41 00 02 00 00 00 08 35 03 19 11 24 00 15 00 ==> 01 35 0c 05 01 80 00 01 00 D (3064) BT_L2CAP: L2CAP - st: OPEN evt: 20 I (3074) BT_L2CAP: L2CA_DataWrite() CID: 0x0041 Len: 14 D (3074) BT_L2CAP: L2CAP - st: OPEN evt: 30 ==> 02 80 20 12 00 0e 00 41 00 03 00 00 00 09 00 01 00 01 00 01 00 00 00 <== 04 13 05 01 80 00 01 00 <== 02 80 20 17 00 13 00 41 00 04 00 01 00 0e 00 01 00 00 06 3c 35 05 0a 00 00 ff ff 00 ==> 01 35 0c 05 01 80 00 01 00 D (3104) BT_L2CAP: L2CAP - st: OPEN evt: 20 I (3114) BT_L2CAP: L2CA_DataWrite() CID: 0x0041 Len: 436 D (3114) BT_L2CAP: L2CAP - st: OPEN evt: 30 ==> 02 80 20 b8 01 b4 01 41 00 05 00 01 01 af 01 ac 36 01 a9 09 00 00 0a 00 01 00 00 09 00 01 35 03 19 11 24 09 00 04 35 0d 35 06 19 01 00 09 00 11 35 03 19 00 11 09 00 06 35 09 09 65 6e 09 00 6a 09 01 00 09 00 09 35 08 35 06 19 11 24 09 01 00 09 00 0d 35 0f 35 0d 35 06 19 01 00 09 00 13 35 03 19 00 11 09 01 00 25 10 57 69 72 65 6c 65 73 73 20 47 61 6d 65 70 61 64 09 01 01 25 07 47 61 6d 65 70 61 64 09 01 02 25 08 4e 69 6e 74 65 6e 64 6f 09 02 00 09 01 00 09 02 01 09 01 11 09 02 02 08 04 09 02 03 08 33 09 02 04 28 00 09 02 05 28 01 09 02 06 35 d3 36 00 cf 08 22 26 00 cb 05 01 15 00 09 04 a1 01 85 30 05 01 05 09 19 01 29 0a 15 00 25 01 75 01 95 0a 55 00 65 00 81 02 05 09 19 0b 29 0e 15 00 25 01 75 01 95 04 81 02 75 01 95 02 81 03 0b 01 00 01 00 a1 00 0b 30 00 01 00 0b 31 00 01 00 0b 32 00 01 00 0b 35 00 01 00 15 00 27 ff ff 00 00 75 10 95 04 81 02 c0 0b 39 00 01 00 15 00 25 07 35 00 46 3b 01 65 14 75 04 95 01 81 02 05 09 19 0f 29 12 15 00 25 01 75 01 95 04 81 02 75 08 95 34 81 03 06 00 ff 85 21 09 01 75 08 95 3f 81 03 85 81 09 02 75 08 95 3f 81 03 85 01 09 03 75 08 95 3f 91 83 85 10 09 04 75 08 95 3f 91 83 85 80 09 05 75 08 95 3f 91 83 85 82 09 06 75 08 95 3f 91 83 c0 09 02 07 35 08 35 06 09 04 09 09 01 00 09 02 08 28 00 09 02 09 28 01 09 02 0a 28 01 09 02 0b 09 01 00 09 02 0c 09 0c 80 09 02 0d 28 00 09 02 0e 28 00 00 <== 04 13 05 01 80 00 01 00 <== 02 80 20 0c 00 08 00 01 00 06 09 04 00 41 00 41 00 ==> 01 35 0c 05 01 80 00 01 00 D (3254) BT_L2CAP: L2CAP - st: OPEN evt: 17 I (3254) BT_L2CAP: L2CAP - Calling Disconnect_Ind_Cb(), CID: 0x0041 Conf Needed I (3264) BT_L2CAP: L2CA_DisconnectRsp() CID: 0x0041 D (3274) BT_L2CAP: L2CAP - st: W4_L2CA_DISC_RSP evt: 28 ==> 02 80 20 0c 00 08 00 01 00 07 09 04 00 41 00 41 00 <== 04 13 05 01 80 00 01 00 <== 04 08 04 00 80 00 01 <== 02 80 20 0c 00 08 00 01 00 02 0a 04 00 11 00 42 00 ==> 01 35 0c 05 01 80 00 01 00 D (3354) BT_L2CAP: CID:0x0042 FCR Mode:0 Priority:2 TxDataRate:1 RxDataRate:1 Quota:200 D (3354) BT_L2CAP: L2CAP - st: CLOSED evt: 10 D (3364) BT_L2CAP: L2CAP - st: TERM_W4_SEC_COMP evt: 7 I (3364) BT_L2CAP: L2CAP - Calling Connect_Ind_Cb(), CID: 0x0042 I (3374) BT_L2CAP: L2CA_ErtmConnectRsp() CID: 0x0042 Result: 0 Status: 0 BDA: 98b6e9e7a050 p_ertm_info:0x0 D (3384) BT_L2CAP: L2CAP - st: W4_L2CA_CON_RSP evt: 22 ==> 02 80 20 10 00 0c 00 01 00 03 0a 08 00 42 00 42 00 00 00 00 00 I (3394) BT_L2CAP: L2CA_ConfigReq() CID 0x0042: fcr_present:0 (mode 0) mtu_present:1 (80) D (3404) BT_L2CAP: L2CAP - st: CONFIG evt: 24 <== 04 13 05 01 80 00 01 00 <== 02 80 20 0c 00 08 00 01 00 02 0b 04 00 13 00 43 00 <== 02 80 20 10 00 0c 00 01 00 04 0c 08 00 42 00 00 00 01 02 bc 02 ==> 01 35 0c 05 01 80 00 01 00 ==> 01 35 0c 05 01 80 00 01 00 ==> 02 80 20 10 00 0c 00 01 00 04 06 08 00 42 00 00 00 01 02 50 00 D (3434) BT_L2CAP: CID:0x0042 FCR Mode:0 Priority:2 TxDataRate:1 RxDataRate:1 Quota:200 <== 04 13 05 01 80 00 01 00 <== 02 80 20 0e 00 0a 00 01 00 05 06 06 00 42 00 00 00 00 00 ==> 01 35 0c 05 01 80 00 01 00 D (3464) BT_L2CAP: CID:0x0043 FCR Mode:0 Priority:2 TxDataRate:1 RxDataRate:1 Quota:200 D (3464) BT_L2CAP: L2CAP - st: CLOSED evt: 10 D (3474) BT_L2CAP: L2CAP - st: TERM_W4_SEC_COMP evt: 7 I (3474) BT_L2CAP: L2CAP - Calling Connect_Ind_Cb(), CID: 0x0043 I (3484) BT_L2CAP: L2CA_ErtmConnectRsp() CID: 0x0043 Result: 0 Status: 0 BDA: 98b6e9e7a050 p_ertm_info:0x0 D (3494) BT_L2CAP: L2CAP - st: W4_L2CA_CON_RSP evt: 22 ==> 02 80 20 10 00 0c 00 01 00 03 0b 08 00 43 00 43 00 00 00 00 00 I (3504) BT_L2CAP: L2CA_ConfigReq() CID 0x0043: fcr_present:0 (mode 0) mtu_present:1 (80) D (3514) BT_L2CAP: L2CAP - st: CONFIG evt: 24 ==> 02 80 20 28 00 24 00 01 00 04 07 20 00 43 00 00 00 01 02 50 00 03 16 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 <== 04 13 05 01 80 00 01 00 <== 02 80 20 10 00 0c 00 01 00 04 0d 08 00 43 00 00 00 01 02 bc 02
==> 01 35 0c 05 01 80 00 01 00 D (3544) BT_L2CAP: L2CAP - st: CONFIG evt: 14 D (3554) BT_L2CAP: l2c_fcr_process_peer_cfg_req() CFG fcr_present:0 fcr.mode:0 CCB FCR mode:0 preferred: 0 allowed:1 <== 04 13 05 01 80 00 01 00 <== 02 80 20 26 00 22 00 01 00 05 07 1e 00 43 00 00 00 00 00 03 16 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==> 01 35 0c 05 01 80 00 01 00 D (3584) BT_L2CAP: L2CAP - Calling Config_Req_Cb(), CID: 0x0042, C-bit 0 I (3584) BT_L2CAP: L2CA_ConfigRsp() CID: 0x0042 Result: 0 MTU present:0 Flush TO:0 FCR:0 FCS:0 D (3594) BT_L2CAP: L2CAP - st: CONFIG evt: 25 ==> 02 80 20 0e 00 0a 00 01 00 05 0c 06 00 42 00 00 00 00 00 D (3604) BT_L2CAP: L2CAP - st: CONFIG evt: 15 D (3614) BT_L2CAP: CID:0x0042 FCR Mode:0 Priority:2 TxDataRate:1 RxDataRate:1 Quota:200 D (3624) BT_L2CAP: CID:0x0043 FCR Mode:0 Priority:2 TxDataRate:1 RxDataRate:1 Quota:200 <== 04 13 05 01 80 00 01 00 I (3634) BT_L2CAP: L2CAP - Calling Config_Rsp_Cb(), CID: 0x0042 D (3634) BT_L2CAP: L2CAP - st: CONFIG evt: 14 D (3644) BT_L2CAP: l2c_fcr_process_peer_cfg_req() CFG fcr_present:0 fcr.mode:0 CCB FCR mode:0 preferred: 0 allowed:1 D (3654) BT_L2CAP: L2CAP - Calling Config_Req_Cb(), CID: 0x0043, C-bit 0 I (3654) BT_L2CAP: L2CA_ConfigRsp() CID: 0x0043 Result: 0 MTU present:0 Flush TO:0 FCR:0 FCS:0 D (3664) BT_L2CAP: L2CAP - st: CONFIG evt: 25 ==> 02 80 20 0e 00 0a 00 01 00 05 0d 06 00 43 00 00 00 00 00 D (3674) BT_L2CAP: L2CAP - st: CONFIG evt: 15 <== 04 13 05 01 80 00 01 00 <== 04 38 04 80 00 80 0c D (3684) BT_L2CAP: CID:0x0042 FCR Mode:0 Priority:2 TxDataRate:1 RxDataRate:1 Quota:200 D (3694) BT_L2CAP: CID:0x0043 FCR Mode:0 Priority:2 TxDataRate:1 RxDataRate:1 Quota:200 I (3704) BT_L2CAP: L2CAP - Calling Config_Rsp_Cb(), CID: 0x0043 I (3714) BT_L2CAP: L2CA_SetDesireRole() new:x1, disallow_switch:0 W (3714) BT: HID 98:b6:e9:e7:a0:50 connected ==> 01 1a 0c 01 02 <== 04 0e 04 05 1a 0c 00 ==> 01 1a 0c 01 00 <== 04 0e 04 05 1a 0c 00 <== 04 1b 03 80 00 01 <== 04 14 06 00 80 00 02 18 00

mringwal commented 4 years ago

Hi. Thanks for the two logs. I've converted the one from BTstack.

esp32-nes-hid.pklg.zip

The log looks good so far: incoming connection, encryption setup, l2cap channels for Control and Interrupt are configured and open. Then, the remote disconnects them.

Do you know if there's a tool similar to BTstack's tool/create_packet_log.py to convert the log from Bluedroid into something Wireshark can display? I can see log messages that contain 'disconnect' as well, but then it continues somehow.

rayPopo commented 4 years ago

thanks for you reponse,i modifid create_packet_log.py and convert bluedroid to wireshark format log e.pklg.zip

rayPopo commented 4 years ago

and i got a other source code write by bluez from my friend. emu pro controller success. this is log bluez.pklg.zip

mringwal commented 4 years ago

Can you confirm the setup again? I understand that you want to simulate an Nintendo Switch Pro Controller (an HID device) with the ESP32, is this correct?

Can you unpair and make new logs that include the first connection? During the first connection, the remote (the Nintendo Switch?) will do an SDP query for HID. You can then compare the SDP responses.

The most important part is the HID Descriptor. Did you copy the one from an original device?

In the log from Bluedroid, I can see "Service Name: Wireless Gamepad". but don't see where hat comes from in the example you have mentioned: https://github.com/Molorius/esp-idf/tree/feature/btclassic-hid-device

rayPopo commented 4 years ago

thanks for you reqonse.

Can you confirm the setup again? I understand that you want to simulate an Nintendo Switch Pro Controller (an HID device) with the ESP32, is this correct?

Yes. i had simulate DS4 and wiimote by esp32 sucessed(DS4 need a real DS4 for auth report),but Pro Controller failed.

Can you unpair and make new logs that include the first connection? During the first connection, the remote (the Nintendo Switch?) will do an SDP query for HID. You can then compare the SDP responses.

Yes. log.pklg.zip

The most important part is the HID Descriptor. Did you copy the one from an original device?

Yes.

this my source https://github.com/rayPopo/esp32_switch_pro

In the log from Bluedroid, I can see "Service Name: Wireless Gamepad". but don't see where hat comes from in the example you have mentioned: https://github.com/Molorius/esp-idf/tree/feature/btclassic-hid-device

i modify esp-hid/components/bt/bluedroid/stack/hid/hidd_api.cc HID_DevAddRecord function and change param subclass to emu gamepad type. subclass == 1 is wiimote, subclass == 2 is DS4 and subclass == 3 is nintendo switch pro controller

hidd_api.cc.zip

rayPopo commented 4 years ago

sorry. i found bluedroid hid-device desc not pro controller sdp, i change it like pro controller sdp. but bluedroid still not disconnect. i don't known why. this is correct sdp bluedroid log. Archive.zip

mringwal commented 4 years ago

hi. please try with update on develop branch. Might be similar to https://github.com/bluekitchen/btstack/issues/268

mringwal commented 4 years ago

Did not get more feedback. Closing it for now. Feel free to open with updated information.