diff --git a/Makefile b/Makefile index 459f42a..c59a675 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ build: target/mpfm target/mpfm.service target/mpfm: mpfm.c mkdir -p target - $(CC) -std=gnu99 -O2 mpfm.c -I/usr/include/libusb-1.0 -lusb-1.0 -o target/mpfm + $(CC) -std=gnu99 -O2 mpfm.c -lusb-1.0 -o target/mpfm target/mpfm.service: mpfm.service mkdir -p target diff --git a/mpfm.c b/mpfm.c index 3a0faeb..361d88d 100644 --- a/mpfm.c +++ b/mpfm.c @@ -1,7 +1,7 @@ #include #include #include -#include +#include static int count = 0; @@ -13,6 +13,10 @@ int hotplug_callback(struct libusb_context *ctx, struct libusb_device *dev, printf("Entering callback\n"); // DEBUG (void)libusb_get_device_descriptor(dev, &desc); + printf("%04x:%04x (bus %d, device %d)\n", + desc.idVendor, desc.idProduct, + libusb_get_bus_number(dev), libusb_get_device_address(dev)); + if (LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED == event) { rc = libusb_open(dev, &dev_handle); if (LIBUSB_SUCCESS != rc) {