private UsbLinkManager() { bool result = false; try { result = AllKFunctions.LibK_Context_Init(IntPtr.Zero, IntPtr.Zero); } catch (Exception) { result = false; } if (!result) { if (Settings.DebugLevel > 0) { Log.d(TAG, "Could not initialise Usb driver."); } } UsbConnectionLock = new Object(); IsRunning = true; ConnectionMonitorThread = new MonitorConnectionsThread(); }
public void Close() { IsRunning = false; // This stops ConnectionMonitoring. ConnectionMonitorThread = null; FreeHotPlug(); }