private void ProcessMessageFromThermostat(string receivedMessage)
        {
            HeatmiserState state = new HeatmiserState();

            byte[] dcbExtracted = new byte[292];
            Array.Copy(Encoding.ASCII.GetBytes(receivedMessage), 7, dcbExtracted, 0, 292);

            state.SetFromDCB(dcbExtracted);
            this.currentState = state;
        }
        public HeatmiserState SendMessageToThermostat(byte[] message)
        {
            byte[] recBuffer = SocketsHelper.SendMessageToSocketAndReadSynchroniously(this.localEndPoint, this.targetEndPoint,
                                                                                      message, ProtocolType.Tcp, false);

            if (recBuffer != null)
            {
                HeatmiserState state        = new HeatmiserState();
                byte[]         dcbExtracted = new byte[292];
                Array.Copy(recBuffer, 7, dcbExtracted, 0, 292);

                state.SetFromDCB(dcbExtracted);

                return(state);
            }
            return(null);
        }