public Omron() { foreach (string str in Hid.Hid.DevicePaths) { try { dev = new Device(str); if (dev.VendorID == 0x0590 && dev.ProductID == 0x0028) break; } catch (Win32Exception) { } dev = null; } if (dev == null) throw new Exception("device not found"); mode = 0; }
private int omron_check_mode(Device dev, Int32 mode) { int ret = 0; if (this.mode == mode) return 0; ret = omron_set_mode(mode); if (ret == 0) { this.mode = mode; omron_send_clear(); return 0; } return ret; }