1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2024-11-23 08:06:13 +01:00
CommandStation-EX/DCCEXParser.h

35 lines
1005 B
C
Raw Normal View History

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-11 14:35:16 +02:00
DCCEXParser();
void loop(Stream & pstream);
2020-05-25 14:38:18 +02:00
private:
static const int MAX_PARAMS=10; // longest command sent in
static const int MAX_BUFFER=50; // longest command sent in
2020-06-11 14:35:16 +02:00
Stream & stream;
byte bufferLength=0;
bool inCommandPayload=false;
2020-06-11 14:35:16 +02:00
char buffer[MAX_BUFFER+2];
int splitValues( int result[MAX_PARAMS]);
void parse(Stream & stream, const char * command);
bool parseT(Stream & stream, int params, int p[]);
bool parseZ(Stream & stream, int params, int p[]);
bool parseS(Stream & stream, int params, int p[]);
static bool stashBusy;
static Stream & stashStream;
static int stashP[MAX_PARAMS];
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
};
#define BOARD_NAME "not yet configured"
2020-05-27 10:40:12 +02:00
#endif