9#ifndef DVG_STREAMCOMMAND_H_
10#define DVG_STREAMCOMMAND_H_
79 const char *_empty =
"";
116 const uint8_t *EOL, uint8_t EOL_len);
133 int8_t
available(
bool debug_info =
false);
149 for (uint16_t i = 0; i < _max_len; ++i) {
int parseIntInString(const char *str_in, uint16_t pos=0)
Safely parse an integer value in C-string str_in from of position pos.
Definition: DvG_StreamCommand.cpp:203
bool parseBoolInString(const char *str_in, uint16_t pos=0)
Safely parse a boolean value in C-string str_in from of position pos.
Definition: DvG_StreamCommand.cpp:190
float parseFloatInString(const char *str_in, uint16_t pos=0)
Safely parse a float value in C-string str_in from of position pos.
Definition: DvG_StreamCommand.cpp:182
Class to manage listening to a stream, such as Serial or Wire, for incoming binary commands (or binar...
Definition: DvG_StreamCommand.h:100
int8_t available(bool debug_info=false)
Poll the stream for incoming bytes and append them one-by-one to the command buffer buffer....
Definition: DvG_StreamCommand.cpp:120
DvG_BinaryStreamCommand(Stream &stream, uint8_t *buffer, uint16_t max_len, const uint8_t *EOL, uint8_t EOL_len)
Construct a new DvG_BinaryStreamCommand object.
Definition: DvG_StreamCommand.cpp:106
uint16_t getCommandLength()
Return the length of the command without the EOL sentinel in bytes, only when a complete command has ...
Definition: DvG_StreamCommand.cpp:163
void reset()
Empty the command buffer.
Definition: DvG_StreamCommand.h:148
Class to manage listening to a stream, such as Serial or Wire, for incoming ASCII commands (or ASCII ...
Definition: DvG_StreamCommand.h:32
DvG_StreamCommand(Stream &stream, char *buffer, uint16_t max_len)
Construct a new DvG_StreamCommand object.
Definition: DvG_StreamCommand.cpp:43
void reset()
Empty the command buffer.
Definition: DvG_StreamCommand.h:67
char * getCommand()
Return the reference to the command buffer only when a complete command has been received....
Definition: DvG_StreamCommand.cpp:91
bool available()
Poll the stream for incoming characters and append them one-by-one to the command buffer buffer....
Definition: DvG_StreamCommand.cpp:52