* @throws DriverException
*/
public USBStorageDeviceData(USBDevice device) throws DriverException {
this.device = device;
this.usbInterface = this.device.getConfiguration(0).getInterface(0);
InterfaceDescriptor intf = this.usbInterface.getDescriptor();
this.maxLun = 0;
this.protocol = intf.getInterfaceProtocol();
this.subClass = intf.getInterfaceSubClass();
switch (this.protocol) {
case US_PR_CBI:
log.info("*** Set transport protocol to CONTROL/BULK/INTERRUPT");
break;
case US_PR_BULK:
log.info("*** Set transport protocol to BULK ONLY");
this.transport = new USBStorageBulkTransport(this);
//((USBStorageBulkTransport)USBMassStorage.getTransport()).getMaxLun(usbDev);
break;
case US_PR_SCM_ATAPI:
log.info("*** Set transport protocol to SCM ATAPI");
default:
throw new DriverException("Transport protocol not implemented.");
}
USBEndPoint ep;
for (int i = 0; i < intf.getNumEndPoints(); i++) {
ep = this.usbInterface.getEndPoint(i);
// Is it a bulk endpoint ?
if ((ep.getDescriptor().getAttributes() & USB_ENDPOINT_XFERTYPE_MASK) == USB_ENDPOINT_XFER_BULK) {
// In or Out ?
if ((ep.getDescriptor().getEndPointAddress() & USB_DIR_IN) == 0) {