Example #1
0
        /// <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);
        }
Example #2
0
        /// <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);
        }