feat: usb device auto disconnect
This commit is contained in:
@@ -294,6 +294,7 @@ static void hci_packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *p
|
||||
}
|
||||
|
||||
case HCI_EVENT_DISCONNECTION_COMPLETE: {
|
||||
tud_disconnect();
|
||||
gap_connectable_control(1);
|
||||
gap_discoverable_control(1);
|
||||
const uint8_t reason = hci_event_disconnection_complete_get_reason(packet);
|
||||
@@ -390,6 +391,8 @@ 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));
|
||||
|
||||
tud_connect();
|
||||
} else {
|
||||
printf("[L2CAP] Unknown Channel psm: 0x%02X", psm);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user