public bool CloseShutter(CustomConfig config) { Connect(); RelayDeviceWrapper.usb_relay_device_close_all_relay_channel(Hd); RelayDeviceWrapper.usb_relay_device_close(Hd); Hd = 0; return(true); }
public bool Capture(CustomConfig config) { Connect(); RelayDeviceWrapper.usb_relay_device_close_all_relay_channel(Hd); Thread.Sleep(500); RelayDeviceWrapper.usb_relay_device_open_all_relay_channel(Hd); RelayDeviceWrapper.usb_relay_device_close(Hd); Hd = 0; return(true); }
public static usb_relay_device_info?usb_relay_device_enumerate() { IntPtr x = RelayDeviceWrapper.Pusb_relay_device_enumerate(); if (x == IntPtr.Zero) { return(null); } usb_relay_device_info a = (usb_relay_device_info)Marshal.PtrToStructure(x, typeof(usb_relay_device_info)); return(a); }
private void Connect() { if (Hd != 0) { return; } var dev = RelayDeviceWrapper.usb_relay_device_enumerate(); if (dev == null) { throw new Exception("No usb relay device found !"); } Hd = RelayDeviceWrapper.usb_relay_device_open_with_serial_number(dev.Value.serial_number, dev.Value.serial_number.Length); }