#include #include #include using namespace std; using std::hex; void dump(char* str, unsigned char *data, int size) { int i; int j; cout << str; for(i=0; i < size; i++ ){ j=data[i]; cout << " " << setfill('0') << setw(2) << hex << j; } } void transact(libusb_device_handle * dev_handle, unsigned char *data, int tx_len, unsigned char *result, int rx_len) { int r; dump((char *)"Sending ...:", data, tx_len); cout << " "; r = libusb_control_transfer(dev_handle, LIBUSB_REQUEST_TYPE_CLASS |LIBUSB_RECIPIENT_INTERFACE, 0x09, 0x200, 0x0, data, tx_len, 5000); if(r != 8) { cout<<"Write Error "<