Code example for UsbInterface

Methods: getEndpoint, getEndpointCount

0
			appendLogText("could not find interface"); 
			return; 
		} 
		UsbInterface intf = device.getInterface(0);
		// device should have one endpoint 
		if (intf.getEndpointCount() != 1) {
			appendLogText("could not find endpoint"); 
			return; 
		} 
		// endpoint should be of type interrupt 
		UsbEndpoint ep = intf.getEndpoint(0);
		if (ep.getType() != UsbConstants.USB_ENDPOINT_XFER_INT) {
 
			appendLogText("endpoint is not interrupt type"); 
			return; 
		} 
 
		mDevice = device;
		mEndpointIntr = ep;
		if (device != null) {
			UsbDeviceConnection connection = mUsbManager.openDevice(device);