Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions SerialCommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,4 +183,10 @@ void SerialCommand::addCommand(const char *command, void (*function)())
void SerialCommand::addDefaultHandler(void (*function)())
{
defaultHandler = function;
}

// Sets the line ending character
void SerialCommand::setEOL(char eol)
{
term = eol;
}
1 change: 1 addition & 0 deletions SerialCommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ class SerialCommand
void readSerial(); // Main entry point.
void addCommand(const char *, void(*)()); // Add commands to processing dictionary
void addDefaultHandler(void (*function)()); // A handler to call when no valid command received.
void setEOL(char eol); // sets the End Of Line character

private:
char inChar; // A character read from the serial stream
Expand Down
3 changes: 2 additions & 1 deletion keywords.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ SerialCommand KEYWORD1
clearBuffer KEYWORD2
next KEYWORD2
readSerial KEYWORD2
addCommand KEYWORd2
addCommand KEYWORD2
setEOL KEYWORD2