1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2024-11-24 08:36:14 +01:00

Compare commits

...

6 Commits

Author SHA1 Message Date
Kcsmith0708
8e755fd672
Merge 183b824a5d into 102d6078a7 2023-11-16 05:20:41 -07:00
Harald Barth
102d6078a7 version 5.2.3 2023-11-16 08:38:39 +01:00
Harald Barth
8943f2da18 Merge branch 'devel-parsebug' into devel 2023-11-16 08:36:26 +01:00
Harald Barth
7bd2ba9b41 Bugfix: Catch stange input to parser 2023-11-16 00:27:23 +01:00
Kcsmith0708
183b824a5d
Update version.h
Added v4.1.6 Support EX-MotorShield8874
2023-08-24 13:57:09 -04:00
Kcsmith0708
50863600da
Update version.h
Updated version
4.1 thru 4.1.5
2023-04-06 11:55:50 -04:00
4 changed files with 40 additions and 18 deletions

View File

@ -210,7 +210,9 @@ int16_t DCCEXParser::splitValues(int16_t result[MAX_COMMAND_PARAMS], const byte
case 1: // skipping spaces before a param case 1: // skipping spaces before a param
if (hot == ' ') if (hot == ' ')
break; break;
if (hot == '\0' || hot == '>') if (hot == '\0')
return -1;
if (hot == '>')
return parameterCount; return parameterCount;
state = 2; state = 2;
continue; continue;
@ -304,13 +306,18 @@ void DCCEXParser::parseOne(Print *stream, byte *com, RingStream * ringStream)
#ifndef DISABLE_EEPROM #ifndef DISABLE_EEPROM
(void)EEPROM; // tell compiler not to warn this is unused (void)EEPROM; // tell compiler not to warn this is unused
#endif #endif
byte params = 0;
if (Diag::CMD) if (Diag::CMD)
DIAG(F("PARSING:%s"), com); DIAG(F("PARSING:%s"), com);
int16_t p[MAX_COMMAND_PARAMS]; int16_t p[MAX_COMMAND_PARAMS];
while (com[0] == '<' || com[0] == ' ') while (com[0] == '<' || com[0] == ' ')
com++; // strip off any number of < or spaces com++; // strip off any number of < or spaces
byte opcode = com[0]; byte opcode = com[0];
byte params = splitValues(p, com, opcode=='M' || opcode=='P'); int16_t splitnum = splitValues(p, com, opcode=='M' || opcode=='P');
if (splitnum < 0 || splitnum >= MAX_COMMAND_PARAMS) // if arguments are broken, leave but via printing <X>
goto out;
// Because of check above we are now inside byte size
params = splitnum;
if (filterCallback) if (filterCallback)
filterCallback(stream, opcode, params, p); filterCallback(stream, opcode, params, p);
@ -837,14 +844,18 @@ void DCCEXParser::parseOne(Print *stream, byte *com, RingStream * ringStream)
return; return;
default: //anything else will diagnose and drop out to <X> default: //anything else will diagnose and drop out to <X>
if (opcode >= ' ' && opcode <= '~') {
DIAG(F("Opcode=%c params=%d"), opcode, params); DIAG(F("Opcode=%c params=%d"), opcode, params);
for (int i = 0; i < params; i++) for (int i = 0; i < params; i++)
DIAG(F("p[%d]=%d (0x%x)"), i, p[i], p[i]); DIAG(F("p[%d]=%d (0x%x)"), i, p[i], p[i]);
} else {
DIAG(F("Unprintable %x"), opcode);
}
break; break;
} // end of opcode switch } // end of opcode switch
// Any fallout here sends an <X> out:// Any fallout here sends an <X>
StringFormatter::send(stream, F("<X>\n")); StringFormatter::send(stream, F("<X>\n"));
} }

View File

@ -1 +1 @@
#define GITHUB_SHA "devel-202311141013Z" #define GITHUB_SHA "devel-202311160737Z"

View File

@ -111,14 +111,15 @@ void SerialManager::loop2() {
bufferLength = 0; bufferLength = 0;
buffer[0] = '\0'; buffer[0] = '\0';
} }
else if (ch == '>') { else if (inCommandPayload) {
if (bufferLength < (COMMAND_BUFFER_SIZE-1))
buffer[bufferLength++] = ch;
if (ch == '>') {
buffer[bufferLength] = '\0'; buffer[bufferLength] = '\0';
DCCEXParser::parse(serial, buffer, NULL); DCCEXParser::parse(serial, buffer, NULL);
inCommandPayload = false; inCommandPayload = false;
break; break;
} }
else if (inCommandPayload) {
if (bufferLength < (COMMAND_BUFFER_SIZE-1)) buffer[bufferLength++] = ch;
} }
} }

View File

@ -3,7 +3,8 @@
#include "StringFormatter.h" #include "StringFormatter.h"
#define VERSION "5.2.2" #define VERSION "5.2.3"
// 5.2.3 - Bugfix: Catch stange input to parser
// 5.2.2 - Added option to allow MAX_CHARACTER_ROWS to be defined in config.h // 5.2.2 - Added option to allow MAX_CHARACTER_ROWS to be defined in config.h
// 5.2.1 - Trackmanager rework for simpler structure // 5.2.1 - Trackmanager rework for simpler structure
// 5.2.0 - ESP32: Autoreverse and booster mode support // 5.2.0 - ESP32: Autoreverse and booster mode support
@ -183,9 +184,18 @@
// TrackManager DCC & DC up to 8 Districts Architecture // TrackManager DCC & DC up to 8 Districts Architecture
// Automatic ALIAS(name) // Automatic ALIAS(name)
// Command Parser now accepts Underscore in Alias Names // Command Parser now accepts Underscore in Alias Names
// 4.1.6 Support for new EX-MotorShield8874 Dual 5Amp Shield
// 4.1.5 Bugfix LCN number parsing
// 4.1.4 Bugfix for issue #299 TurnoutDescription NULL
// 4.1.3 Bugfix: Ethernet init order
// 4.1.2 Bugfix: Ethernet shield W5100 does not report HW or link level
// 4.1.1 Bugfix: preserve turnout format // 4.1.1 Bugfix: preserve turnout format
// Bugfix: parse multiple commands in one buffer string correct // Bugfix: parse multiple commands in one buffer string correctly (ex: <s><Q>)
// Bugfix: </> command signal status in Exrail // Bugfix: </> command signal status of EX-RAIL tasks or threads
// Bugfix: EX-RAIL read long loco addr
// Bugfix: Add space character after version string 4.1.1 for JMRI parsing.
// Improved display and loop time for signals make service start to be outside the DONT_TOUCH_WIFI_CONF area
// Improve WiFi startup by making service start to be outside the DONT_TOUCH_WIFI_CONF area
// 4.1.0 ... // 4.1.0 ...
// //
// 4.0.2 EXRAIL additions: // 4.0.2 EXRAIL additions: