From 687e76b5bbe658a901f6b1faa3a94680a5eec8c6 Mon Sep 17 00:00:00 2001 From: serxoz Date: Wed, 12 Jul 2023 14:01:23 +0200 Subject: [PATCH] Cambio en includes. Pinta idVendor e idProduct --- Makefile | 2 +- mpfm.c | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) 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) {