2020-06-04 21:55:18 +02:00
|
|
|
#ifndef DCCEXParser_h
|
|
|
|
#define DCCEXParser_h
|
|
|
|
struct DCCEXParser
|
2020-05-25 14:38:18 +02:00
|
|
|
{
|
2020-06-10 18:31:26 +02:00
|
|
|
DCCEXParser(Stream & myStream);
|
|
|
|
void loop();
|
2020-05-25 14:38:18 +02:00
|
|
|
private:
|
2020-06-10 18:31:26 +02:00
|
|
|
|
2020-06-07 14:48:42 +02:00
|
|
|
static const int MAX_PARAMS=10; // longest command sent in
|
2020-06-10 18:31:26 +02:00
|
|
|
static const int MAX_BUFFER=50; // longest command sent in
|
2020-06-03 15:26:49 +02:00
|
|
|
|
2020-06-10 18:31:26 +02:00
|
|
|
Stream & stream;
|
|
|
|
byte bufferLength=0;
|
|
|
|
bool inCommandPayload=false;
|
|
|
|
char buffer[MAX_BUFFER];
|
|
|
|
void parse(const char * command);
|
|
|
|
int splitValues( int result[MAX_PARAMS]);
|
|
|
|
|
|
|
|
bool parseT(int params, int p[]);
|
|
|
|
bool parseZ(int params, int p[]);
|
|
|
|
bool parseS( int params, int p[]);
|
|
|
|
|
2020-06-07 14:48:42 +02:00
|
|
|
|
|
|
|
static bool stashBusy;
|
|
|
|
static Stream & stashStream;
|
2020-06-10 18:31:26 +02:00
|
|
|
static int stashP[MAX_PARAMS];
|
2020-06-07 14:48:42 +02:00
|
|
|
static bool stashCallback(Stream & stream, int p[MAX_PARAMS]);
|
|
|
|
static void callback_W(int result);
|
|
|
|
static void callback_B(int result);
|
|
|
|
static void callback_R(int result);
|
|
|
|
|
2020-05-25 14:38:18 +02:00
|
|
|
};
|
2020-06-03 15:26:49 +02:00
|
|
|
|
|
|
|
#define BOARD_NAME "not yet configured"
|
2020-05-27 10:40:12 +02:00
|
|
|
#endif
|