mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-27 06:32:19 +03:00
add button with name (wo number)
This commit is contained in:
@@ -31,7 +31,8 @@ StringCommand::StringCommand()
|
||||
commandCount(0),
|
||||
defaultHandler(NULL),
|
||||
term('\n'), // default terminator for commands, newline character
|
||||
last(NULL)
|
||||
last(NULL),
|
||||
main(NULL)
|
||||
{
|
||||
strcpy(delim, " "); // strtok_r needs a null-terminated string
|
||||
clearBuffer();
|
||||
@@ -130,3 +131,7 @@ void StringCommand::clearBuffer() {
|
||||
char *StringCommand::next() {
|
||||
return strtok_r(NULL, delim, &last);
|
||||
}
|
||||
|
||||
char *StringCommand::order() {
|
||||
return strtok_r(buffer, delim, &main);
|
||||
}
|
||||
|
||||
@@ -51,6 +51,7 @@ class StringCommand {
|
||||
void readStr(String sBuffer ); // Main entry point.
|
||||
void clearBuffer(); // Clears the input buffer.
|
||||
char *next(); // Returns pointer to next token found in command buffer (for getting arguments to commands).
|
||||
char *order();
|
||||
|
||||
private:
|
||||
// Command/handler dictionary
|
||||
@@ -70,6 +71,7 @@ class StringCommand {
|
||||
char buffer[SERIALCOMMAND_BUFFER + 1]; // Buffer of stored characters while waiting for terminator character
|
||||
byte bufPos; // Current position in the buffer
|
||||
char *last; // State variable used by strtok_r during processing
|
||||
char *main;
|
||||
};
|
||||
|
||||
#endif //StringCommand_h
|
||||
|
||||
Reference in New Issue
Block a user