/// <summary> /// Trigger the event Port Connected /// </summary> /// <param name="args"></param> public void onPortConnected(SerialDataPortEventArgs args) { if (PortConnected != null) { PortConnected(this, args); } }
private void serial_PortConnected(object sener, SerialDataPortEventArgs args) { connectingTimer.Stop(); disconnectedTimer.Stop(); connState = CONN_STATE.CONNECTED; this.ConnectionStateChanged(connState); timer.Start(); }
/// <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); } }