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

Wifi Interface WORKING

This commit is contained in:
Asbelos
2020-06-13 11:17:06 +01:00
parent 2a36ad365c
commit 8538aa1624
3 changed files with 19 additions and 10 deletions

View File

@@ -51,11 +51,11 @@ void DCCEXParser::loop(Stream & stream) {
}
}
int DCCEXParser::splitValues( int result[MAX_PARAMS]) {
int DCCEXParser::splitValues( int result[MAX_PARAMS], char * cmd) {
byte state=1;
byte parameterCount=0;
int runningValue=0;
const char * remainingCmd=buffer+1; // skips the opcode
const char * remainingCmd=cmd+1; // skips the opcode
bool signNegative=false;
// clear all parameters in case not enough found
@@ -96,12 +96,13 @@ void DCCEXParser::loop(Stream & stream) {
// See documentation on DCC class for info on this section
void DCCEXParser::parse(Print & stream, const char *com) {
// DIAG(F("\nPARSING:%s\n"),com);
DIAG(F("\nPARSING:%s\n"),com);
(void) EEPROM; // tell compiler not to warn thi is unused
int p[MAX_PARAMS];
int params=splitValues(p);
int params=splitValues(p, com);
if (com[0]=='<') com++;
// Functions return from this switch if complete, break from switch implies error <X> to send
switch(com[0]) {