Examples of syncSubmit()


Examples of javax.usb.UsbDevice.syncSubmit()

      // scan for all 3 data rates
      for (int b = 0; b < 3; b++) {
        // set data rate
        UsbControlIrp irp = usbDevice.createUsbControlIrp((byte) 0x40,
            REQUEST_SET_DATA_RATE, (short) b, (short) 0);
        usbDevice.syncSubmit(irp);

        irp = usbDevice.createUsbControlIrp((byte) 0x40,
            REQUEST_START_SCAN_CHANNELS, (short) 0, (short) 125);
        irp.setData(packet);
        // irp.setLength(packet.length);
View Full Code Here

Examples of javax.usb.UsbDevice.syncSubmit()

        irp = usbDevice.createUsbControlIrp((byte) 0x40,
            REQUEST_START_SCAN_CHANNELS, (short) 0, (short) 125);
        irp.setData(packet);
        // irp.setLength(packet.length);
        usbDevice.syncSubmit(irp);

        irp = usbDevice.createUsbControlIrp((byte) 0xc0,
            REQUEST_GET_SCAN_CHANNELS, (short) 0, (short) 0);
        irp.setData(rdata);
        usbDevice.syncSubmit(irp);
View Full Code Here

Examples of javax.usb.UsbDevice.syncSubmit()

        usbDevice.syncSubmit(irp);

        irp = usbDevice.createUsbControlIrp((byte) 0xc0,
            REQUEST_GET_SCAN_CHANNELS, (short) 0, (short) 0);
        irp.setData(rdata);
        usbDevice.syncSubmit(irp);
        for (int i = 0; i < irp.getActualLength(); i++) {
          String uri = URI_PREFIX + rdata[i] + "/" + DATA_RATES[b];
          result.add(uri);
          if (log.isDebugEnabled())
            log.debug("Channel found: " + rdata[i] + " Data rate: "
View Full Code Here

Examples of javax.usb.UsbPipe.syncSubmit()

     
      boolean insync = false;
           
      while(connected) {
        try {
          usbPipe.syncSubmit(buffer);
         
          // get the number of samples
          byte nSamples = buffer[54];
 
          // fetch the total number of hits, divided over 2 bytes (litle endian)
View Full Code Here

Examples of org.jnode.driver.bus.usb.USBControlPipe.syncSubmit()

     */
    public void reset() throws USBException {
        final USBControlPipe pipe = storageDeviceData.getDevice().getDefaultControlPipe();
        final USBRequest req = pipe.createRequest(new SetupPacket(USB_DIR_OUT
            | USB_TYPE_CLASS | USB_RECIP_INTERFACE, 0xFF, 0, 0, 0), null);
        pipe.syncSubmit(req, GET_TIMEOUT);
    }

    /**
     * Get max logical unit allowed by device. Device not support multiple LUN <i>may</i> stall.
     *
 
View Full Code Here

Examples of org.jnode.driver.bus.usb.USBControlPipe.syncSubmit()

        log.info("*** Get max lun ***");
        final USBControlPipe pipe = usbDev.getDefaultControlPipe();
        final USBPacket packet = new USBPacket(1);
        final USBRequest req = pipe.createRequest(new SetupPacket(USB_DIR_IN
            | USB_TYPE_CLASS | USB_RECIP_INTERFACE, 0xFE, 0, 0, 1), packet);
        pipe.syncSubmit(req, GET_TIMEOUT);
        log.debug("*** Request data     : " + req.toString());
        log.debug("*** Request status   : 0x" + NumberUtils.hex(req.getStatus(), 4));
        if (req.getStatus() == USBREQ_ST_COMPLETED) {
            storageDeviceData.setMaxLun(packet.getData()[0]);
        } else if (req.getStatus() == USBREQ_ST_STALLED) {
View Full Code Here

Examples of org.jnode.driver.bus.usb.USBControlPipe.syncSubmit()

    public void testCommand() throws USBException {
        final USBControlPipe pipe = usbDevice.getDefaultControlPipe();
        final USBRequest req = pipe.createRequest(
                new SetupPacket(USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_DEVICE, 0x20, 0, 0, 0), null);
        pipe.syncSubmit(req, GET_TIMEOUT);
    }

    public USBDevice getUsbDevice() {
        return usbDevice;
    }
View Full Code Here

Examples of org.jnode.driver.bus.usb.USBControlPipe.syncSubmit()

    private void readPortStatus(int port, PortStatus data) throws USBException {
        testPort(port);
        final USBControlPipe pipe = dev.getDefaultControlPipe();
        final USBRequest req =
            pipe.createRequest(new SetupPacket(USB_DIR_IN | USB_RT_PORT, USB_REQ_GET_STATUS, 0, port + 1, 4), data);
        pipe.syncSubmit(req, GET_TIMEOUT);
    }

}
View Full Code Here

Examples of org.jnode.driver.bus.usb.USBDataPipe.syncSubmit()

            USBDataPipe outPipe = ((USBDataPipe) storageDeviceData.getBulkOutEndPoint().getPipe());
            USBRequest req = outPipe.createRequest(cbw);
            if (timeout <= 0) {
                outPipe.asyncSubmit(req);
            } else {
                outPipe.syncSubmit(req, timeout);
            }
            //
            CSW csw = new CSW();
            csw.setSignature(US_BULK_CS_SIGN);
            USBDataPipe inPipe = ((USBDataPipe) storageDeviceData.getBulkInEndPoint().getPipe());
View Full Code Here

Examples of org.jnode.driver.bus.usb.USBDataPipe.syncSubmit()

            USBDataPipe inPipe = ((USBDataPipe) storageDeviceData.getBulkInEndPoint().getPipe());
            USBRequest resp = inPipe.createRequest(csw);
            if (timeout <= 0) {
                inPipe.asyncSubmit(resp);
            } else {
                inPipe.syncSubmit(resp, timeout);
            }
        } catch (USBException e) {
            e.printStackTrace();
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.