Example #1
0
        public override ProsthesisStateBase OnSocketMessage(ProsthesisCore.Messages.ProsthesisMessage message, TCP.ConnectionState state)
        {
            ProsthesisStateBase newState = mCurrentState.OnSocketMessage(message, state);

            if (newState != mCurrentState)
            {
                ChangeState(newState);
            }
            return(this);
        }
 private void RunThread()
 {
     while (mRunning)
     {
         IPEndPoint ipEndPoint = new IPEndPoint(IPAddress.Any, 0);
         byte[]     data       = mUDPReceiver.Receive(ref ipEndPoint);
         mParser.AddData(data, data.Length);
         while (mParser.MoveNext())
         {
             ProsthesisCore.Messages.ProsthesisMessage msg = mParser.Current;
             if (msg is ProsthesisCore.Telemetry.ProsthesisTelemetry)
             {
                 if (Received != null)
                 {
                     Received(msg as ProsthesisCore.Telemetry.ProsthesisTelemetry);
                 }
             }
             else
             {
                 mLogger.LogMessage(Logger.LoggerChannels.Network, string.Format("Telemetry receiver caught an unexpected message type {0}", msg.GetType()));
             }
         }
     }
 }
 public virtual ProsthesisStateBase OnSocketMessage(ProsthesisCore.Messages.ProsthesisMessage message, TCP.ConnectionState state)
 {
     return(this);
 }