a

Dependencies:   mbed mbed-rtos

Committer:
alexpirciu
Date:
Thu Mar 28 07:44:42 2019 +0000
Revision:
1:ceee5a608e7c
assa

Who changed what in which revision?

UserRevisionLine numberNew contents of line
alexpirciu 1:ceee5a608e7c 1 /**
alexpirciu 1:ceee5a608e7c 2 ******************************************************************************
alexpirciu 1:ceee5a608e7c 3 * @file CommandInterpreter.hpp
alexpirciu 1:ceee5a608e7c 4 * @author RBRO/PJ-IU
alexpirciu 1:ceee5a608e7c 5 * @version V1.0.0
alexpirciu 1:ceee5a608e7c 6 * @date day-month-2017
alexpirciu 1:ceee5a608e7c 7 * @brief This file contains the class declaration for the command interpreter
alexpirciu 1:ceee5a608e7c 8 * functionality.
alexpirciu 1:ceee5a608e7c 9 ******************************************************************************
alexpirciu 1:ceee5a608e7c 10 */
alexpirciu 1:ceee5a608e7c 11
alexpirciu 1:ceee5a608e7c 12 /* Inclusion guard */
alexpirciu 1:ceee5a608e7c 13 #ifndef COMMAND_INTERPRETER_HPP
alexpirciu 1:ceee5a608e7c 14 #define COMMAND_INTERPRETER_HPP
alexpirciu 1:ceee5a608e7c 15
alexpirciu 1:ceee5a608e7c 16 /* The mbed library */
alexpirciu 1:ceee5a608e7c 17 #include <mbed.h>
alexpirciu 1:ceee5a608e7c 18 #include <Move/move.hpp>
alexpirciu 1:ceee5a608e7c 19 #include <Queue/queue.hpp>
alexpirciu 1:ceee5a608e7c 20
alexpirciu 1:ceee5a608e7c 21 //! CTimer class.
alexpirciu 1:ceee5a608e7c 22 /*!
alexpirciu 1:ceee5a608e7c 23 * It is used for implementing the interpreter of commands received by Nucleo.
alexpirciu 1:ceee5a608e7c 24 * */
alexpirciu 1:ceee5a608e7c 25 class CCommandInterpreter
alexpirciu 1:ceee5a608e7c 26 {
alexpirciu 1:ceee5a608e7c 27 public:
alexpirciu 1:ceee5a608e7c 28 /* Constuctor */
alexpirciu 1:ceee5a608e7c 29 CCommandInterpreter(Move& f_car);
alexpirciu 1:ceee5a608e7c 30 /* Interpret character */
alexpirciu 1:ceee5a608e7c 31 inline void interpretChar(unsigned char f_c);
alexpirciu 1:ceee5a608e7c 32 /* Execute command */
alexpirciu 1:ceee5a608e7c 33 inline void executeCommand();
alexpirciu 1:ceee5a608e7c 34 private:
alexpirciu 1:ceee5a608e7c 35 /* Reset */
alexpirciu 1:ceee5a608e7c 36 inline void reset();
alexpirciu 1:ceee5a608e7c 37 /* Interpret command */
alexpirciu 1:ceee5a608e7c 38 inline void intepretCommand();
alexpirciu 1:ceee5a608e7c 39 /* buffer */
alexpirciu 1:ceee5a608e7c 40 CQueue<unsigned char, 7> m_buffer;
alexpirciu 1:ceee5a608e7c 41 /* reference to MOVE object */
alexpirciu 1:ceee5a608e7c 42 Move& m_car;
alexpirciu 1:ceee5a608e7c 43 unsigned char m_commandID;
alexpirciu 1:ceee5a608e7c 44 /* command value */
alexpirciu 1:ceee5a608e7c 45 float m_commandValue;
alexpirciu 1:ceee5a608e7c 46 /* speed value */
alexpirciu 1:ceee5a608e7c 47 float m_speedValue;
alexpirciu 1:ceee5a608e7c 48 /* angle value */
alexpirciu 1:ceee5a608e7c 49 float m_angleValue;
alexpirciu 1:ceee5a608e7c 50 };
alexpirciu 1:ceee5a608e7c 51
alexpirciu 1:ceee5a608e7c 52 #endif