Exemplo n.º 1
0
        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);
                    }
                }
            }
        }
Exemplo n.º 2
0
        private void AddNewAnalyticsDataToDeviceMemory(Control changedControl)
        {
            if (changedControl.ShouldKeepAnalytics())
            {
                List <byte> analyticsBuffer = HeepDeviceAnalytics.GetDeviceAnalyticsByteArray(changedControl, myID);
                HeepLanguage.AddBufferToBuffer(deviceMemory, analyticsBuffer);

                HeepCommunications.SendAnalytics(myID, deviceMemory);
            }
        }
Exemplo n.º 3
0
        private void AddNewAnalyticsDataToDeviceMemory(Control changedControl)
        {
            if (changedControl.ShouldKeepAnalytics())
            {
                Console.WriteLine("Hello");

                List <byte> analyticsBuffer = HeepDeviceAnalytics.GetDeviceAnalyticsByteArray(changedControl, myID);
                HeepLanguage.AddBufferToBuffer(deviceMemory, analyticsBuffer);
                NonVolatileData.WriteMemoryToFile(deviceMemory);

                HeepCommunications.SendAnalytics(myID, deviceMemory);
            }
        }
Exemplo n.º 4
0
        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);
            }
        }
Exemplo n.º 5
0
 public void StartListening()
 {
     HeepCommunications.SendDeviceContext(this);
     HeepCommunications.StartHeepServer(this, interruptServer);
 }
Exemplo n.º 6
0
 public HeepDevice(DeviceID theID)
 {
     SetDeviceID(theID);
     interruptServer = HeepCommunications.GetHeepInterruptServer();
 }
Exemplo n.º 7
0
 public void StartListening()
 {
     HeepCommunications.StartHeepServer(this, interruptServer);
 }