mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-03-29 04:20:20 +00:00
libusb: print usb info in ports
This commit is contained in:
parent
f85342b49f
commit
24a31dc762
@ -91,8 +91,26 @@ static btstack_packet_callback_registration_t hci_event_callback_registration;
|
||||
static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size){
|
||||
UNUSED(channel);
|
||||
UNUSED(size);
|
||||
uint8_t i;
|
||||
uint8_t usb_path_len;
|
||||
const uint8_t * usb_path;
|
||||
|
||||
if (packet_type != HCI_EVENT_PACKET) return;
|
||||
|
||||
switch (hci_event_packet_get_type(packet)){
|
||||
case HCI_EVENT_TRANSPORT_USB_INFO:
|
||||
usb_path_len = hci_event_transport_usb_info_get_path_len(packet);
|
||||
usb_path = hci_event_transport_usb_info_get_path(packet);
|
||||
// print device path
|
||||
printf("USB device 0x%04x/0x%04x, path: ",
|
||||
hci_event_transport_usb_info_get_vendor_id(packet),
|
||||
hci_event_transport_usb_info_get_product_id(packet));
|
||||
for (i=0;i<usb_path_len;i++){
|
||||
if (i) printf("-");
|
||||
printf("%02x", usb_path[i]);
|
||||
}
|
||||
printf("\n");
|
||||
break;
|
||||
case BTSTACK_EVENT_STATE:
|
||||
switch(btstack_event_state_get_state(packet)){
|
||||
case HCI_STATE_WORKING:
|
||||
|
@ -118,8 +118,26 @@ static void local_version_information_handler(uint8_t * packet){
|
||||
static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size){
|
||||
UNUSED(channel);
|
||||
UNUSED(size);
|
||||
uint8_t i;
|
||||
uint8_t usb_path_len;
|
||||
const uint8_t * usb_path;
|
||||
|
||||
if (packet_type != HCI_EVENT_PACKET) return;
|
||||
|
||||
switch (hci_event_packet_get_type(packet)){
|
||||
case HCI_EVENT_TRANSPORT_USB_INFO:
|
||||
usb_path_len = hci_event_transport_usb_info_get_path_len(packet);
|
||||
usb_path = hci_event_transport_usb_info_get_path(packet);
|
||||
// print device path
|
||||
printf("USB device 0x%04x/0x%04x, path: ",
|
||||
hci_event_transport_usb_info_get_vendor_id(packet),
|
||||
hci_event_transport_usb_info_get_product_id(packet));
|
||||
for (i=0;i<usb_path_len;i++){
|
||||
if (i) printf("-");
|
||||
printf("%02x", usb_path[i]);
|
||||
}
|
||||
printf("\n");
|
||||
break;
|
||||
case BTSTACK_EVENT_STATE:
|
||||
switch (btstack_event_state_get_state(packet)){
|
||||
case HCI_STATE_WORKING:
|
||||
|
Loading…
x
Reference in New Issue
Block a user