c - Device not found libusb debian -
i have small problem libusb.i want open usb port, port never found. result of lsusb command :
bus 001 device 001: id 1d6b:0002 linux foundation 2.0 root hub bus 002 device 001: id 1d6b:0002 linux foundation 2.0 root hub bus 003 device 001: id 1d6b:0002 linux foundation 2.0 root hub bus 004 device 001: id 1d6b:0003 linux foundation 3.0 root hub bus 001 device 002: id 8087:0024 intel corp. integrated rate matching hub bus 002 device 002: id 8087:0024 intel corp. integrated rate matching hub bus 003 device 002: id 0461:4e22 primax electronics, ltd bus 001 device 003: id 046d:c326 logitech, inc. bus 001 device 004: id 080c:0300 datalogic s.p.a. gryphon d120 barcode scanner
so in main.c try open 1 usb port :
libusb_open_device_with_vid_pid(null, vid, pid);
so main.c :
#include <stdio.h> #include <libusb-1.0/libusb.h> #include <errno.h> #define vid 0x0461 #define pid 0x4e22 static struct libusb_device_handle *devh = null; int main(int argc,char** argv) { libusb_init(null); devh = libusb_open_device_with_vid_pid(null, vid, pid); if (devh == null ) { printf("not found\n"); return -1; } }
if test port usb none found
Comments
Post a Comment