1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2025-07-29 18:33:44 +02:00

AYSNC prog cmds from Wifi/Ethernet

prog track commands from wifi/ethernet will no longer block loop while waiting
for ACK
This commit is contained in:
Asbelos
2021-03-08 10:40:32 +00:00
parent df4bae365d
commit 36e38bf861
7 changed files with 114 additions and 102 deletions

View File

@@ -20,6 +20,7 @@
#define DCCEXParser_h
#include <Arduino.h>
#include "FSH.h"
#include "RingStream.h"
typedef void (*FILTER_CALLBACK)(Print * stream, byte & opcode, byte & paramCount, int p[]);
typedef void (*AT_COMMAND_CALLBACK)(const byte * command);
@@ -28,7 +29,7 @@ struct DCCEXParser
{
DCCEXParser();
void loop(Stream & stream);
void parse(Print * stream, byte * command, bool blocking);
void parse(Print * stream, byte * command, RingStream * ringStream);
void parse(const FSH * cmd);
void flush();
static void setFilter(FILTER_CALLBACK filter);
@@ -51,12 +52,16 @@ struct DCCEXParser
bool parsef(Print * stream, int params, int p[]);
bool parseD(Print * stream, int params, int p[]);
static Print * getAsyncReplyStream();
static void commitAsyncReplyStream();
static bool stashBusy;
static byte stashTarget;
static Print * stashStream;
static RingStream * stashRingStream;
static int stashP[MAX_COMMAND_PARAMS];
bool stashCallback(Print * stream, int p[MAX_COMMAND_PARAMS]);
bool stashCallback(Print * stream, int p[MAX_COMMAND_PARAMS], RingStream * ringStream);
static void callback_W(int result);
static void callback_B(int result);
static void callback_R(int result);