public bool Open(LibUsbDevice dev) { if (IsValid) { return(true); } this = LibUsbAPI.usb_open(dev); if (IsValid) { return(true); } return(false); }
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); }
public bool Close() { if (!IsValid) { return(true); } int ret = LibUsbAPI.usb_close(this); mPtr = IntPtr.Zero; if (ret == 0) { return(true); } return(false); }