Code example for UsbDeviceConnection

Methods: claimInterface, close

0
		if(connection == null) {
			return; 
		} 
		 
		/* Claim the required interface to gain access to it */ 
		if(connection.claimInterface(intf, true) == true) {
			thread = new Thread(this);
			thread.start();
			connected = true;
		} else { 
			/* if the interface claim failed, we should close the 
			 * connection and exit. 
			 */ 
			connection.close();
		} 
	} 
	 
	/** 
	 * @return boolean Indicates if the connection to the USB device 
	 * was successfully made. 
	 */