int to_send = (read - bytes_sent > 512 ? 512 : read - bytes_sent);
res = libusb_bulk_transfer(dev, 1, &page[bytes_sent], to_send, &transferred, 0);
int to_send = (read - bytes_sent > 512 ? 512 : read - bytes_sent);
res = libusb_bulk_transfer(dev, 1, &page[bytes_sent], to_send, &transferred, 0);