//Function to discover device private void FindDevice() { _arrayOfPluggedDevice = null; RFID_Device tmp = new RFID_Device(); _arrayOfPluggedDevice = tmp.getRFIDpluggedDevice(true); tmp.ReleaseDevice(); comboBoxReader.Items.Clear(); if (_arrayOfPluggedDevice != null) { foreach (rfidPluggedInfo dev in _arrayOfPluggedDevice) { if ((dev.deviceType == DeviceType.DT_SBR) || (dev.deviceType == DeviceType.DT_STR)) { DeviceInfo di = db.RecoverDevice(dev.SerialRFID); if (di != null) { comboBoxReader.Items.Add(di.DeviceName + " (" + dev.SerialRFID + ")"); } else { comboBoxReader.Items.Add(dev.SerialRFID); } } } if (comboBoxReader.Items.Count > 0) { comboBoxReader.SelectedIndex = 0; } } else { Invoke((MethodInvoker) delegate { toolStripStatusLabelInfo.Text = ResStrings.str_Quit_Live_Data; }); } }
private void FindDevice() { _arrayOfPluggedDevice = null; RFID_Device tmp = new RFID_Device(); _arrayOfPluggedDevice = tmp.getRFIDpluggedDevice(true); comboBoxSerialRFID.Items.Clear(); if (_arrayOfPluggedDevice != null) { foreach (rfidPluggedInfo dev in _arrayOfPluggedDevice) { comboBoxSerialRFID.Items.Add(dev.SerialRFID); } } else { MessageBox.Show("No device found"); } _fpDevArray = tmp.getFingerprintPluggedGUID(); tmp.ReleaseDevice(); comboBoxSerialFPMaster.Items.Clear(); comboBoxSerialFPSlave.Items.Clear(); if (_fpDevArray != null) { foreach (string fpDev in _fpDevArray) { comboBoxSerialFPMaster.Items.Add(fpDev); comboBoxSerialFPSlave.Items.Add(fpDev); } } }
/// <summary> /// <c>FindDevice</c> function, discorvers device(s). /// </summary> private void FindDevice() { _arrayOfPluggedDevice = null; RFID_Device tmp = new RFID_Device(); _arrayOfPluggedDevice = tmp.getRFIDpluggedDevice(true); buttonCreateDevice.Enabled = false; tmp.ReleaseDevice(); comboBoxDevice.Items.Clear(); if (_arrayOfPluggedDevice != null) { if (_arrayOfPluggedDevice.Length == 0) { return; } foreach (rfidPluggedInfo dev in _arrayOfPluggedDevice) { comboBoxDevice.Items.Add(dev.SerialRFID); } comboBoxDevice.SelectedIndex = 0; buttonCreateDevice.Enabled = true; } else { UpdateStatusBar("Info : No device detected"); } }
//Function to discover device private void FindDevice() { comboBoxDevice.Items.Clear(); _ethernetDevices.Clear(); RFID_Device tmp = new RFID_Device(); rfidPluggedInfo[] tmpDev = tmp.getRFIDpluggedDevice(true); tmp.ReleaseDevice(); if (tmpDev != null) { int nIndex = 0; _arrayOfPluggedDevice = new rfidPluggedInfo[tmpDev.Length]; foreach (rfidPluggedInfo dev in tmpDev) { if (dev.deviceType != DeviceType.DT_SBR && dev.deviceType != DeviceType.DT_STR) { continue; } DeviceInfo di = _db.RecoverDevice(dev.SerialRFID); string itemText = (di != null) ? di.DeviceName + " (" + dev.SerialRFID + ")" : dev.SerialRFID; comboBoxDevice.Items.Add(itemText); _arrayOfPluggedDevice[nIndex++] = dev; } } DeviceInfo[] ethernetDevices = _db.RecoverDevice(false); // bLocal = false => only looks for ethernet devices if (ethernetDevices != null) { foreach (DeviceInfo ethernetDevice in ethernetDevices) { if (ethernetDevice.deviceType != DeviceType.DT_SBR && ethernetDevice.deviceType != DeviceType.DT_STR) { continue; } comboBoxDevice.Items.Add(ethernetDevice.DeviceName); _ethernetDevices.Add(ethernetDevice.DeviceName, ethernetDevice); } } if (comboBoxDevice.Items.Count > 0) { comboBoxDevice.SelectedIndex = 0; buttonCreate.Enabled = true; } else { MessageBox.Show(ResStrings.str_No_Device_found, ResStrings.strInfo, MessageBoxButtons.OK, MessageBoxIcon.Warning); Invoke((MethodInvoker) delegate { toolStripStatusLabelInfo.Text = ResStrings.str_Quit_Live_Data; }); buttonCreate.Enabled = false; } }
//Function to discover device //This function will search all the RFID device and fingerprint plugged on the PC //Take care to choose the good value depending of the serial numbers printed on the device. private void FindDevice() { arrayOfPluggedDevice = null; RFID_Device tmp = new RFID_Device(); arrayOfPluggedDevice = tmp.getRFIDpluggedDevice(false); fpDevArray = tmp.getFingerprintPluggedGUID(); tmp.ReleaseDevice(); comboBoxDevice.Items.Clear(); if (arrayOfPluggedDevice != null) { foreach (rfidPluggedInfo dev in arrayOfPluggedDevice) { comboBoxDevice.Items.Add(dev.SerialRFID); } } comboBoxFP.Items.Clear(); if (fpDevArray != null) { foreach (string fpDev in fpDevArray) { comboBoxFP.Items.Add(fpDev); } } if ((comboBoxDevice.Items.Count > 0) && (comboBoxFP.Items.Count > 0)) { comboBoxDevice.SelectedIndex = 0; comboBoxFP.SelectedIndex = 0; buttonCreate.Enabled = true; } else { buttonCreate.Enabled = false; Invoke((MethodInvoker) delegate { toolStripStatusLabelInfo.Text = "Info : No RFID and/or Fingerprint detected - try Refresh"; }); } }
private void FindDeviceAndConnect(string serial) { arrayOfPluggedDevice = null; RFID_Device tmp = new RFID_Device(); arrayOfPluggedDevice = tmp.getRFIDpluggedDevice(false); tmp.ReleaseDevice(); if (arrayOfPluggedDevice != null) { foreach (rfidPluggedInfo dev in arrayOfPluggedDevice) { if (dev.SerialRFID.Equals(serial)) { if (device != null) { if (device.ConnectionStatus != ConnectionStatus.CS_Connected) { device.ReleaseDevice(); } } //Create a new object device = new RFID_Device(); updatelabel("Info : In Connection"); //subscribe the event device.NotifyRFIDEvent += new NotifyHandlerRFIDDelegate(rfidDev_NotifyRFIDEvent); device.Create_NoFP_Device(dev.SerialRFID, dev.portCom); break; } } } else { updatelabel("Info : No Device Detected!"); } }