bus.executeAndWait(cmd, timeout);
if (!cmd.isFinished()) {
throw new TimeoutException("Timeout in SCSI command");
} else if (cmd.hasError()) {
throw new SCSIException("Command error 0x" + NumberUtils.hex(cmd.getError(), 2));
} else {
return cmd.getDataTransfered();
}
}