Interprets Commands received char by char.

Files at this revision

API Documentation at this revision

Comitter:
sepp_nepp
Date:
Thu Oct 31 10:47:57 2019 +0000
Parent:
0:b4341838304c
Commit message:
Debugging done.

Changed in this revision

CMD_Interpreter.cpp Show annotated file Show diff for this revision Revisions of this file
CMD_Interpreter.h Show annotated file Show diff for this revision Revisions of this file
diff -r b4341838304c -r 5934744ac614 CMD_Interpreter.cpp
--- a/CMD_Interpreter.cpp	Tue Jun 25 11:21:00 2019 +0000
+++ b/CMD_Interpreter.cpp	Thu Oct 31 10:47:57 2019 +0000
@@ -20,6 +20,7 @@
   MyState = isStartNew;
   AllCommands = NULL;
   NumCommands = 0;
+  InvalidCommand = false;
 }
 
 void Interpreter::FillCommands( int aNumCommands, const  EXE_CMD_TYPE *ACommands  )
@@ -150,7 +151,9 @@
             }
         else { CmdNr++; } // go on serarching
       } // while   
-    // if ( !Found )  { CmdInval(cmd.Command) ;  } // call invalid command function
+    if ( !Found )  { // CmdInval(cmd.Command) ;   // call invalid command function
+        InvalidCommand = true; 
+        }
     return Found;
 }
 
diff -r b4341838304c -r 5934744ac614 CMD_Interpreter.h
--- a/CMD_Interpreter.h	Tue Jun 25 11:21:00 2019 +0000
+++ b/CMD_Interpreter.h	Thu Oct 31 10:47:57 2019 +0000
@@ -45,6 +45,7 @@
     bool ProcessPresentCommands( void );
     RD_CMD_TYPE ParseCommand( void );
     bool executeCommand(RD_CMD_TYPE cmd);
+    bool InvalidCommand;
     void PrtCmdHelp  ( Serial *aSerial ); // Display list of Commands
     // void GetLastMessage( string LastMsg); // not possible to implement at the moment
   public: // the reading mechanics