void HeartBeatThreadFunc(object obj) { int HeartBeatMissedCnt = 0; while (!HeartBeatThreadExit) { System.Threading.Thread.Sleep(1000); if (ExecHeartBeat()) { HeartBeatMissedCnt = 0; } else { HeartBeatMissedCnt++; } if (HeartBeatMissedCnt >= HeartBeatMissedCnt_MAX) { _ConnectStatus = ConnectStatusEnum.CONNECTLOST; StopHeartBeat(); if (ConnectLost != null) { CommArgs args = new CommArgs(); args.ReaderID = 0; args.addr = AddrStr; args.port = port_baud; ConnectLost.BeginInvoke(this, args, null, null); } } } }
public GPITriggerEventArgs() { comm = new CommArgs(); }
public AutoReadEventArgs() { comm = new CommArgs(); }