Exemple #1
0
        public bool Open(LibUsbDevice dev)
        {
            if (IsValid)
            {
                return(true);
            }

            this = LibUsbAPI.usb_open(dev);
            if (IsValid)
            {
                return(true);
            }

            return(false);
        }
Exemple #2
0
        public bool Close()
        {
            if (mPtr == IntPtr.Zero)
            {
                return(true);
            }

            int ret = LibUsbAPI.usb_free_async(ref this);

            if (mPtr == IntPtr.Zero && ret == 0)
            {
                return(true);
            }

            return(false);
        }
Exemple #3
0
        public bool Close()
        {
            if (!IsValid)
            {
                return(true);
            }

            int ret = LibUsbAPI.usb_close(this);

            mPtr = IntPtr.Zero;
            if (ret == 0)
            {
                return(true);
            }

            return(false);
        }