This class contains its own MonoUsbSessionHandle that is initialized with one of the overloaded MonoUsbEventHandler.Init() functions.
This class contains a static thread that execute MonoUsbApi.HandleEventsTimeout. See the Start and Stop methods.
/// <summary> /// Calls <see cref="MonoUsbEventHandler.Init()"/> and <see cref="MonoUsbEventHandler.Start"/> if <see cref="MonoUsbEventHandler.IsStopped"/> = true. /// </summary> internal static void InitAndStart() { if (!MonoUsbEventHandler.IsStopped) { return; } MonoUsbEventHandler.Init(); MonoUsbEventHandler.Start(); }
/// <summary> /// Calls <see cref="MonoUsbEventHandler.Stop"/> and <see cref="MonoUsbEventHandler.Exit"/>. /// </summary> internal static void StopAndExit() { #if LIBUSBDOTNET if (LibUsbDotNet.LudnMonoLibUsb.MonoUsbDevice.mMonoUSBProfileList != null) { LibUsbDotNet.LudnMonoLibUsb.MonoUsbDevice.mMonoUSBProfileList.Close(); } LibUsbDotNet.LudnMonoLibUsb.MonoUsbDevice.mMonoUSBProfileList = null; #endif MonoUsbEventHandler.Stop(true); MonoUsbEventHandler.Exit(); }