From b79c0c437735df2ca5a194a1ef0bf6608573d0f5 Mon Sep 17 00:00:00 2001 From: gperson Date: Thu, 5 Nov 2020 15:39:37 +0100 Subject: [PATCH] ajout de code,Verifications de compilation --- src/GetUsbInfos.c | 41 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/src/GetUsbInfos.c b/src/GetUsbInfos.c index 7cdee8b..db7c30a 100644 --- a/src/GetUsbInfos.c +++ b/src/GetUsbInfos.c @@ -1,10 +1,47 @@ #include #include +#include + + + + + int main(){ - return 0; -} + + +//initiate the usb thing + + libusb_context *context; + int status=libusb_init(&context); + if(status!=0) {perror("libusb_init"); exit(-1);} + /* ... some code ... */ + libusb_exit(context); + +// actually enumerates all the usb and gives some infos abot the usb things + + libusb_device **list; + ssize_t count=libusb_get_device_list(context,&list); + if(count<0) {perror("libusb_get_device_list"); exit(-1);} + ssize_t i=0; + for(i=0;i