Code example for UsbEndpoint

Methods: getDirection, getType

0
			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; 
		} 
		 
		UsbDeviceConnection connection = mUsbManager.openDevice(mDevice);
		if (connection == null) {
			Log.e(TAG, "Getting DeviceConnection failed!");
			return false;