11 #include <HardwareSerial.h>
Parses the serial input for commands.
Definition: CommandParser.h:18
char * getCommand()
Get the command buffer.
Definition: CommandParser.cpp:72
static CommandParser * instance
pointer to current used instance
Definition: CommandParser.h:24
COMMANDS
Definition: CommandParser.h:29
@ WAITING
Indicates parser is waiting for a command ('/n' or '/r' character)
Definition: CommandParser.h:30
@ ERROR
Indicates that the command is not recognized.
Definition: CommandParser.h:34
@ PAN_TILT
Indicates a Pan and Tilt command.
Definition: CommandParser.h:31
@ PAN_TILT_OFFSET
Indicates a Pan and Tilt offset command.
Definition: CommandParser.h:32
@ HOME
Indicates a Home command.
Definition: CommandParser.h:33
char buf[255]
All characters read from serial port.
Definition: CommandParser.h:21
CommandParser()
Constructor of the class.
Definition: CommandParser.cpp:13
uint8_t checkCommand()
Checks the buffer for a command Checks the buffer to see if there is a known command....
Definition: CommandParser.cpp:36
static CommandParser * initialize()
Creates a new instance of the class if there isn't one.
Definition: CommandParser.cpp:53
uint8_t createBuffer()
Checks the serial port for input if the character is a line feed(LF) or carriage return(CR) the end o...
Definition: CommandParser.cpp:18
uint8_t bufIndex
Location index off the last character placed in the buffer.
Definition: CommandParser.h:22
uint8_t parse()
Reads serial input and checks for commands.
Definition: CommandParser.cpp:64
char ch
Last read character from serial port.
Definition: CommandParser.h:20