|
Webcam Tracker
V1.0
Using openCV and an Arduino Uno
|
Parses the serial input for commands. More...
#include <CommandParser.h>
Public Types | |
| enum | COMMANDS { WAITING , PAN_TILT , PAN_TILT_OFFSET , HOME , ERROR } |
Public Member Functions | |
| uint8_t | parse () |
| Reads serial input and checks for commands. More... | |
| char * | getCommand () |
| Get the command buffer. More... | |
Static Public Member Functions | |
| static CommandParser * | initialize () |
| Creates a new instance of the class if there isn't one. More... | |
Private Member Functions | |
| CommandParser () | |
| Constructor of the class. | |
| uint8_t | createBuffer () |
| Checks the serial port for input if the character is a line feed(LF) or carriage return(CR) the end of a command is signaled. More... | |
| uint8_t | checkCommand () |
| Checks the buffer for a command Checks the buffer to see if there is a known command. If there isn't one, returns a command error. More... | |
Private Attributes | |
| char | ch |
| Last read character from serial port. | |
| char | buf [255] |
| All characters read from serial port. | |
| uint8_t | bufIndex |
| Location index off the last character placed in the buffer. | |
Static Private Attributes | |
| static CommandParser * | instance = 0 |
| pointer to current used instance | |
Parses the serial input for commands.
Parser commands
|
private |
Checks the serial port for input if the character is a line feed(LF) or carriage return(CR) the end of a command is signaled.
|
private |
Checks the buffer for a command Checks the buffer to see if there is a known command. If there isn't one, returns a command error.
|
static |
Creates a new instance of the class if there isn't one.
| uint8_t CommandParser::parse | ( | ) |
Reads serial input and checks for commands.
| char * CommandParser::getCommand | ( | ) |