Code example for UsbInterface

Methods: getEndpoint

0
			Log.e(TAG, "Getting interface failed!");
			return false; 
		} 
		 
		// endpoint addr 0x81 = input interrupt 
		ep0 = intf.getEndpoint(0); 
		if ((ep0.getType() != UsbConstants.USB_ENDPOINT_XFER_INT) || (ep0.getDirection() != UsbConstants.USB_DIR_IN)) {
			Log.e(TAG, "Getting endpoint 0 (control) failed!");
			return false; 
		} 
		 
		// endpoint addr 0x2 = output bulk 
		ep1 = intf.getEndpoint(1); 
		if ((ep1.getType() != UsbConstants.USB_ENDPOINT_XFER_BULK) || (ep1.getDirection() != UsbConstants.USB_DIR_OUT)) {
			Log.e(TAG, "Getting endpoint 1 (output) failed!");
			return false; 
		} 
		 
		// endpoint addr 0x83 = input bulk 
		ep2 = intf.getEndpoint(2); 
		if ((ep2.getType() != UsbConstants.USB_ENDPOINT_XFER_BULK) || (ep2.getDirection() != UsbConstants.USB_DIR_IN)) {
			Log.e(TAG, "Getting endpoint 2 (input) failed!");
			return false; 
		}