int transferred;
res = libusb_bulk_transfer(dev, 1, (unsigned char*)&cmd, sizeof(cmd), &transferred, 0);
if (res != 0 || transferred != sizeof(cmd)) {
int transferred;
res = libusb_bulk_transfer(dev, 1, (unsigned char*)&cmd, sizeof(cmd), &transferred, 0);
if (res != 0 || transferred != sizeof(cmd)) {