demo versie 16/05

Dependencies:   EthernetInterface mbed-rto mbed

Fork of ProjectVLC by Klaas Govaerts

Committer:
albireo987
Date:
Wed May 16 11:15:25 2018 +0000
Revision:
80:dbda5092950e
Parent:
77:6477a4fefa70
commentaar geschreven def

Who changed what in which revision?

UserRevisionLine numberNew contents of line
KlaasGovaerts 4:0d013b7e4dea 1 #include "rtos.h"
KlaasGovaerts 6:9903a0906a72 2 #include "TCPlistener.h"
KlaasGovaerts 4:0d013b7e4dea 3
KlaasGovaerts 19:5ee34e60a31d 4 #ifndef INTERPRETER_H
KlaasGovaerts 19:5ee34e60a31d 5 #define INTERPRETER_H
KlaasGovaerts 75:31c15986b85e 6
KlaasGovaerts 75:31c15986b85e 7 /**
KlaasGovaerts 75:31c15986b85e 8 * Class used to interpret text commands.
KlaasGovaerts 75:31c15986b85e 9 */
KlaasGovaerts 19:5ee34e60a31d 10 class Interpreter{
KlaasGovaerts 4:0d013b7e4dea 11 private:
KlaasGovaerts 75:31c15986b85e 12 /**
KlaasGovaerts 75:31c15986b85e 13 * Convert a direction such as left, right, up, down to the corresponding number (0, 1, 2 or 3).
KlaasGovaerts 75:31c15986b85e 14 * Invalid directions (or ignore) will return 4.
KlaasGovaerts 75:31c15986b85e 15 * @param command A character array representing the direction.
KlaasGovaerts 75:31c15986b85e 16 */
KlaasGovaerts 4:0d013b7e4dea 17 int directionToNumber(char* direction);
KlaasGovaerts 31:915f6cb7ffa5 18 Queue<int,8>* queue;
KlaasGovaerts 28:bf62c46acb3e 19 int LED[8];
KlaasGovaerts 4:0d013b7e4dea 20 public:
KlaasGovaerts 75:31c15986b85e 21
KlaasGovaerts 75:31c15986b85e 22 /**
KlaasGovaerts 77:6477a4fefa70 23 * @param queue A pointer to the queue where the results will be written.
KlaasGovaerts 75:31c15986b85e 24 */
KlaasGovaerts 31:915f6cb7ffa5 25 Interpreter(Queue<int,8>* queue);
KlaasGovaerts 75:31c15986b85e 26
KlaasGovaerts 75:31c15986b85e 27 /**
KlaasGovaerts 75:31c15986b85e 28 * Interprets a text command, and push the result on the queue.
KlaasGovaerts 75:31c15986b85e 29 * Syntax:
KlaasGovaerts 75:31c15986b85e 30 * The number of the LED
KlaasGovaerts 75:31c15986b85e 31 * Dash (-)
KlaasGovaerts 75:31c15986b85e 32 * The orientation (left,right,up,down or ignore).
KlaasGovaerts 75:31c15986b85e 33 * Multiple LEDS can be set up in one command, by using a whitespace.
KlaasGovaerts 75:31c15986b85e 34 * Example: 0-left 1-right 2-up
KlaasGovaerts 75:31c15986b85e 35 * @param command A character array representing the command.
KlaasGovaerts 75:31c15986b85e 36 */
KlaasGovaerts 16:ffd311730575 37 void executeCommand(char* command);
KlaasGovaerts 4:0d013b7e4dea 38 };
KlaasGovaerts 4:0d013b7e4dea 39 #endif