Examples of USBEndPoint


Examples of javax.usb.UsbEndpoint

    if (iDesc.bNumEndpoints() != 2) {
      log.error("Could not find endpoints");
      return;
    }
    for (Object o : mIntf.getUsbEndpoints()) {
      UsbEndpoint e = (UsbEndpoint) o;
      if (e.getDirection() == UsbConst.ENDPOINT_DIRECTION_IN)
        mEpIn = e;
      else
        mEpOut = e;

    }
View Full Code Here

Examples of javax.usb.UsbEndpoint

    this.usbInterface = usbInterface;
    List usbEndpoints = usbInterface.getUsbEndpoints();

    for (int i = 0; i < usbEndpoints.size(); i++)
    {
      UsbEndpoint endpoint = (UsbEndpoint) usbEndpoints.get(i);

      if (UsbConst.ENDPOINT_DIRECTION_IN == endpoint.getDirection())
      {
        inEndpoint = endpoint;
      }
      else if (UsbConst.ENDPOINT_DIRECTION_OUT == endpoint.getDirection())
      {
        outEndpoint = endpoint;
      }
    }
View Full Code Here

Examples of org.jnode.driver.bus.usb.USBEndPoint

                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) {
                    this.bulkInEndPoint = ep;
                    log.info("*** Set bulk in endpoint");
                } else {
                    this.bulkOutEndPoint = ep;
                    log.info("*** Set bulk out endpoint");
                }
            } else if ((ep.getDescriptor().getAttributes() & USB_ENDPOINT_XFERTYPE_MASK) == USB_ENDPOINT_XFER_INT) {
                this.intrEndPoint = ep;
                log.info("*** Set interrupt endpoint");
            }
        }

View Full Code Here

Examples of org.jnode.driver.bus.usb.USBEndPoint

        UsbBtDevice.setUsbDevice(dev);
        final USBConfiguration conf = dev.getConfiguration(0);
        final USBInterface intf = conf.getInterface(0);
        final InterfaceDescriptor iDesc = intf.getDescriptor();

        USBEndPoint bulkInEndpoint[] = new USBEndPoint[8];
        USBEndPoint bulkOutEndpoint[] = new USBEndPoint[8];
        USBEndPoint intrInEndpoint[] = new USBEndPoint[8];

        int num_bulk_in = 0;
        int num_bulk_out = 0;
        int num_bulk_intr = 0;

        USBEndPoint ep = null;

        for (int i = 0; i < iDesc.getNumEndPoints(); i++) {
            ep = intf.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) {
                    bulkInEndpoint[num_bulk_in] = ep;
                    num_bulk_in++;
                    log.debug("*** Set bulk in endpoint");
                } else {
                    bulkOutEndpoint[num_bulk_out] = ep;
                    num_bulk_out++;
                    log.debug("*** Set bulk out endpoint");
                }
            } else if ((ep.getDescriptor().getAttributes() & USB_ENDPOINT_XFERTYPE_MASK) == USB_ENDPOINT_XFER_INT) {
                intrInEndpoint[num_bulk_intr] = ep;
                num_bulk_intr++;
                log.debug("*** Set interrupt endpoint");
            }
        }
View Full Code Here

Examples of org.jnode.driver.bus.usb.USBEndPoint

    public void createTDs(UHCIPipe pipe) {
        final USBPacket dataPacket = getDataPacket();
        int offset = 0;
        int length = dataPacket.getSize();
        final USBEndPoint ep = pipe.getEndPoint();
        final int dataPid = (ep.getDescriptor().isDirIn() ? USB_PID_IN : USB_PID_OUT);
        final int maxPacketSize = pipe.getMaxPacketSize();
        TransferDescriptor firstTD = null;

        while (length > 0) {

            // Create the TD for this part of the data packet
            final int curlen = Math.min(length, maxPacketSize);
            final TransferDescriptor dataTD;
            final boolean ioc = (curlen == length);
            dataTD = pipe.createTD(dataPid, ep.getDataToggle(), dataPacket.getData(), offset, curlen, ioc);
            // Add the TD to the list
            if (firstTD == null) {
                firstTD = dataTD;
            } else {
                firstTD.append(dataTD, false);
            }

            // Update fields
            ep.toggle();
            length -= curlen;
            offset += curlen;
        }
        this.firstTD = firstTD;
    }
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.