GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — listdevs: Also print portpath for non root hubs · Raghuvardhan-Reddy78/libusb@ebac6ac

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • examples
    • listdevs.c
  • libusb
    • version_nano.h
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎examples/listdevs.c‎

Copy file name to clipboardExpand all lines: examples/listdevs.c
+15-2Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
static void print_devs(libusb_device **devs)
2525
{
2626
libusb_device *dev;
27-
int i = 0;
27+
int i = 0, j = 0;
28+
uint8_t path[8];
2829

2930
while ((dev = devs[i++]) != NULL) {
3031
struct libusb_device_descriptor desc;
@@ -34,9 +35,21 @@ static void print_devs(libusb_device **devs)
3435
return;
3536
}
3637

37-
printf("%04x:%04x (bus %d, device %d)\n",
38+
printf("%04x:%04x (bus %d, device %d)",
3839
desc.idVendor, desc.idProduct,
3940
libusb_get_bus_number(dev), libusb_get_device_address(dev));
41+
42+
r = libusb_get_port_path(NULL, dev, path, sizeof(path));
43+
if (r > 0)
44+
printf(" path: ");
45+
j = 0;
46+
while(j < r) {
47+
printf("%d", path[j]);
48+
j++;
49+
if (j < r)
50+
printf(".");
51+
}
52+
printf("\n");
4053
}
4154
}
4255

Collapse file

‎libusb/version_nano.h‎

Copy file name to clipboard
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
#define LIBUSB_NANO 10691
1+
#define LIBUSB_NANO 10692

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.