Code example for UsbEndpoint

Methods: getDirection, getType

0
 
		// endpoint should be of type bulk 
		UsbEndpoint ep = intf.getEndpoint(0);
		UsbEndpoint epOut = null;
		UsbEndpoint epIn = null;
		if (ep.getType() == UsbConstants.USB_ENDPOINT_XFER_BULK) {
			if (ep.getDirection() == UsbConstants.USB_DIR_OUT) {
				epOut = ep;
				//Toast toast = Toast.makeText(context, "endpoint 0 is out", duration); 
				//toast.show(); 
			} else { 
				epIn = ep;
				//Toast toast = Toast.makeText(context, "endpoint 0 is in", duration); // actually is in 
				//toast.show(); 
			} 
			mEndpointIn = epIn;
		} else { 
			return; 
		} 
 
		UsbEndpoint ep1 = intf.getEndpoint(1);