static void Main(string[] args) { var ecos = new ECoSConnect(); var ip = args[0]; new Thread(() => ecos.StartHandler(ip)).Start(); Thread.Sleep(500); SendTests(ecos); try { for (;;) { var lineToSend = C.ReadLine(); if (string.IsNullOrEmpty(lineToSend)) { continue; } lineToSend = lineToSend.Trim(); if (lineToSend.Length <= 0) { continue; } IsQuit(lineToSend); ecos.SendMessage(lineToSend); } } catch { ecos.Disconnect(); Environment.Exit(0); } }
static void SendTests(ECoSConnect ecos) { if (ecos == null) { return; } for (int i = 0; i < 8; ++i) { for (int j = 257; j < 275; ++j) { var m = string.Format("get(1000, cv[{0}:{1}])\r\n", i, j); ecos.SendMessage(m); Thread.Sleep(100); } } }