mirror of
https://github.com/ivabus/pantry
synced 2024-11-23 00:45:07 +03:00
bbaf2cda4e
* new file: projects/libusb.info/compat/package.yml * -ludev flag ? * hmm, clang? * hmm * oh... +gcc. working for me * systemd.io contains 'libudev' * more tests
23 lines
No EOL
409 B
C
23 lines
No EOL
409 B
C
#include <stdio.h>
|
|
#include <usb.h>
|
|
|
|
int main(void)
|
|
{
|
|
struct usb_bus *busses;
|
|
struct usb_bus *bus;
|
|
|
|
usb_init();
|
|
usb_find_busses();
|
|
usb_find_devices();
|
|
|
|
busses = usb_get_busses();
|
|
for (bus = busses; bus; bus = bus->next) {
|
|
struct usb_device *dev;
|
|
for (dev = bus->devices; dev; dev = dev->next) {
|
|
printf("%04x:%04x\n",
|
|
dev->descriptor.idVendor, dev->descriptor.idProduct);
|
|
}
|
|
}
|
|
|
|
return 0;
|
|
} |