#-------------------------------------------------## Project created by QtCreator 2014-01-14T00:03:19##-------------------------------------------------QT += core guigreaterThan(QT_MAJOR_VERSION, 4): QT += widgetsTARGET = usb_testTEMPLATE = appSOURCES += main.cpp\ mainwindow.cppHEADERS += mainwindow.hFORMS += mainwindow.uiLIBS += -lusb
#include "mainwindow.h"#include <QApplication>#include "lusb.h"//#include "lib/hidapi.h"#include <stdio.h>#include <string.h>//#include "lib/hidapi.h"int main(int argc, char *argv[]){libusb_init(NULL); QApplication a(argc, argv); MainWindow w; w.show(); return a.exec();}
#include "lusb.h"
CONFIG += link_pkgconfigPKGCONFIG += libusb-1.0
unsigned char buf[64];int returned = libusb_interrupt_transfer(handle, EP_IN, 64, 64, &ret, 1000); if (returned >= 0) {int My_buf=(int)buf[0];}