1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2025-07-28 09:53:45 +02:00

RMFT Hooks (#112)

These hooks do NOT require RMFT code to be present.... but they offer the hooks that RMFT will need when available.

authored-by: Asbelos <asbelos@btinternet.com>
This commit is contained in:
Fred
2021-01-05 13:05:17 -05:00
committed by GitHub
parent 42075f838e
commit 0618a0bd72
4 changed files with 23 additions and 1 deletions

View File

@@ -221,11 +221,16 @@ int DCCEXParser::splitHexValues(int result[MAX_PARAMS], const byte *cmd)
}
FILTER_CALLBACK DCCEXParser::filterCallback = 0;
FILTER_CALLBACK DCCEXParser::filterRMFTCallback = 0;
AT_COMMAND_CALLBACK DCCEXParser::atCommandCallback = 0;
void DCCEXParser::setFilter(FILTER_CALLBACK filter)
{
filterCallback = filter;
}
void DCCEXParser::setRMFTFilter(FILTER_CALLBACK filter)
{
filterRMFTCallback = filter;
}
void DCCEXParser::setAtCommandCallback(AT_COMMAND_CALLBACK callback)
{
atCommandCallback = callback;
@@ -245,6 +250,8 @@ void DCCEXParser::parse(Print *stream, byte *com, bool blocking)
if (filterCallback)
filterCallback(stream, opcode, params, p);
if (filterRMFTCallback && opcode!='\0')
filterRMFTCallback(stream, opcode, params, p);
// Functions return from this switch if complete, break from switch implies error <X> to send
switch (opcode)