2020-05-24 20:59:49 +02:00
|
|
|
#include <Arduino.h>
|
2020-05-25 14:38:18 +02:00
|
|
|
class StringParser
|
2020-05-24 20:59:49 +02:00
|
|
|
{
|
2020-05-25 14:38:18 +02:00
|
|
|
public:
|
2020-05-26 00:03:11 +02:00
|
|
|
static void loop(Stream & stream, void (*callback)(Stream & stream, const char * data) );
|
2020-05-25 14:38:18 +02:00
|
|
|
static int parse(const char * com, int result[], byte maxResults);
|
2020-05-25 20:59:47 +02:00
|
|
|
static void print( const __FlashStringHelper* input...);
|
|
|
|
static void send(Stream & serial, const __FlashStringHelper* input...);
|
|
|
|
private:
|
|
|
|
static void send(Stream & serial, const __FlashStringHelper* input,va_list args);
|
|
|
|
|
2020-05-26 00:03:11 +02:00
|
|
|
static byte bufferLength;
|
|
|
|
static bool inCommandPayload;
|
|
|
|
static const byte MAX_BUFFER=100;
|
|
|
|
static char buffer[MAX_BUFFER];
|
2020-05-24 20:59:49 +02:00
|
|
|
};
|