示例#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));
 }
示例#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);
        }
示例#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);