Пример #1
0
 /// <summary>
 /// Trigger the event Port Connected
 /// </summary>
 /// <param name="args"></param>
 public void onPortConnected(SerialDataPortEventArgs args)
 {
     if (PortConnected != null)
     {
         PortConnected(this, args);
     }
 }
Пример #2
0
 private void serial_PortConnected(object sener, SerialDataPortEventArgs args)
 {
     connectingTimer.Stop();
     disconnectedTimer.Stop();
     connState = CONN_STATE.CONNECTED;
     this.ConnectionStateChanged(connState);
     timer.Start();
 }
Пример #3
0
 /// <summary>
 /// Open seial port connection
 /// </summary>
 public new bool Open()
 {
     try
     {
         base.Open();
         SerialDataPortEventArgs args = new SerialDataPortEventArgs();
         args.PortName = this.PortName;
         onPortConnected(args);
         return(true);
     }
     catch
     {
         return(false);
     }
 }