ian rau / Mbed 2 deprecated ProjectVLC

Dependencies:   EthernetInterface mbed-rto mbed

Fork of ProjectVLC by Klaas Govaerts

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Interpreter.h Source File

Interpreter.h

00001 #include "rtos.h"
00002 #include "TCPlistener.h"
00003 
00004 #ifndef INTERPRETER_H
00005 #define INTERPRETER_H
00006     
00007     /**
00008     * Class used to interpret text commands.
00009     */
00010     class Interpreter{
00011         private:
00012             /**
00013             * Convert a direction such as left, right, up, down to the corresponding number (0, 1, 2 or 3).
00014             * Invalid directions (or ignore) will return 4.
00015             * @param command A character array representing the direction.
00016             */
00017             int directionToNumber(char* direction);
00018             Queue<int,8>* queue;
00019             int LED[8];
00020         public:
00021             
00022             /**
00023             * @param queue A pointer to the queue where the results will be written.
00024             */
00025             Interpreter (Queue<int,8>* queue);
00026             
00027             /**
00028             * Interprets a text command, and push the result on the queue.
00029             * Syntax:
00030             * The number of the LED
00031             * Dash (-)
00032             * The orientation (left,right,up,down or ignore).
00033             * Multiple LEDS can be set up in one command, by using a whitespace.
00034             * Example: 0-left 1-right 2-up
00035             * @param command A character array representing the command.
00036             */
00037             void executeCommand(char* command);
00038     };
00039 #endif