private void SendOutput(Control toSend) { // Send the current value of the control if (toSend.GetControlDirection() == Control.CtrlInputOutput.output) { for (int i = 0; i < vertices.Count; i++) { if (vertices [i].GetTXControlID() == toSend.GetID()) { List <byte> sendBuffer; if (toSend.GetType().Equals(typeof(BufferControl))) { sendBuffer = HeepLanguage.GetSetValCOPBufferControlBuffer(vertices[i].GetRXControlID(), ((BufferControl)(toSend)).GetBuffer()); } else { sendBuffer = HeepLanguage.GetSetValCOPBuffer(vertices [i].GetRXControlID(), toSend.GetCurValue()); } IPAddress sendIP = vertices [i].GetDestIP(); HeepCommunications.SendBufferToIP(sendBuffer, sendIP); } } } }
private static void DeviceSearchWorker(object currentIP) { Console.WriteLine((IPAddress)currentIP); List <byte> Buffer = new List <byte>(); Buffer.Add((byte)0x09); try{ List <byte> returnedCode = HeepCommunications.SendBufferToIP(Buffer, (IPAddress)currentIP); HeepParser.ParseROP(returnedCode); } catch (Exception e) { Console.Write("FAILED: "); Console.Write(e.Data); } }