Example #1
0
        private static void HandleMessageReceived(FirmataMessageEventArgs eventArgs)
        {
            Console.WriteLine(@"Message: {0}", eventArgs.Value.Type);

            if (eventArgs.Value.Type == MessageType.FirmwareResponse)
            {
                Console.WriteLine("Signalling ResetEvent");
                ResetEvent.Set();
            }
        }
Example #2
0
        void session_OnMessageReceived(object sender, FirmataMessageEventArgs eventArgs)
        {
            string o;

            switch (eventArgs.Value.Type)
            {
                case MessageType.StringData:
                    o = ((StringData)eventArgs.Value.Value).Text;
                    break;

                default:
                    o = "?";
                    break;
            }

            Console.WriteLine("Message {0} received: {1}", eventArgs.Value.Type, o);
        }
 private void session_OnMessageReceived(object par_Sender, FirmataMessageEventArgs par_EventArgs)
 {
     _messagesReceived.Enqueue(par_EventArgs.Value);
 }