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