/// <summary> /// Load available serial ports /// </summary> private void loadAvailableComports() { string[] serialPorts = SerialPortHdlr.getAvailableSerialPorts(); foreach (string com in serialPorts) { cmbBoxBlueBoxSerialPorts.Items.Add(com); cmbBoxSnifferSerialPorts.Items.Add(com); } }
/// <summary> /// Close serial port /// </summary> /// <returns></returns> public bool closeSnifferPort() { bool disconnecion_success = false; if ((null != SnifferSerialPort) && SnifferSerialPort.isPortOpen()) { SnifferSerialPort.ClosePort(); SnifferSerialPort = null; disconnecion_success = true; } return(disconnecion_success); }
/// <summary> /// Close serial port /// </summary> /// <returns></returns> public bool closeAVCLANPort() { bool disconnecion_success = false; if ((null != AVCLANSerialPort) && AVCLANSerialPort.isPortOpen()) { AVCLANSerialPort.ClosePort(); AVCLANSerialPort = null; disconnecion_success = true; foreach (var view in AVCLAN_Listeners) { view.Value.setCommunicationStatus(CommunicationStatus.DISABLE); } } return(disconnecion_success); }
/// <summary> /// Open Serial Port /// </summary> /// <param name="com_port"></param> /// <returns></returns> public bool connectSnifferPort(string com_port) { bool connection_success = false; if (null == SnifferSerialPort) { SnifferSerialPort = new SerialPortHdlr("57600", "0", "1", "8", com_port, new SerialPortHdlr.ReportIncomingData(SnifferPortIncomingData)); if (SnifferSerialPort.OpenPort()) { connection_success = true; } else { SnifferSerialPort = null; } } return(connection_success); }
/// <summary> /// Open Serial Port /// </summary> /// <param name="com_port"></param> /// <returns></returns> public bool connectAVCLANPort(string com_port) { bool connection_success = false; if (null == AVCLANSerialPort) { AVCLANSerialPort = new SerialPortHdlr("57600", "0", "1", "8", com_port, new SerialPortHdlr.ReportIncomingData(AVCLANPortIncomingData)); if (AVCLANSerialPort.OpenPort()) { connection_success = true; foreach (var view in AVCLAN_Listeners) { view.Value.setCommunicationStatus(CommunicationStatus.ENABLE); } } else { AVCLANSerialPort = null; } } return(connection_success); }