Exemplo n.º 1
0
 public ErrorCodes hotplug_register_callback(IntPtr ctx, HotplugEventType eventType, HotplugFlags flags,
                                             int vendorID, int productID, int deviceClass,
                                             HotplugCallback callback, IntPtr userData,
                                             out IntPtr callbackHandle)
 {
     return(NativeMethods.libusb_hotplug_register_callback(ctx, eventType, flags, vendorID, productID, deviceClass, callback, userData, out callbackHandle));
 }
Exemplo n.º 2
0
        public Context(LogLevel debug_level = LogLevel.None)
        {
            var ret = NativeMethods.libusb_init(ref handle);

            NativeMethods.libusb_set_debug(handle, debug_level);
            if (ret != 0)
            {
                throw new Exception(string.Format("Error: {0} while trying to initialize libusb", ret));
            }

            // instantiate our callback handler
            this._hotplugCallbackHandler = new HotplugCallback(HandleHotplugCallback);
        }
Exemplo n.º 3
0
 internal static extern ErrorCodes libusb_hotplug_register_callback(IntPtr ctx, HotplugEventType eventType, HotplugFlags flags,
                                                                    int vendorID, int productID, int deviceClass,
                                                                    HotplugCallback callback, IntPtr userData,
                                                                    out IntPtr callbackHandle);