diff --git a/CommandDistributor.cpp b/CommandDistributor.cpp index 4496692..de4e8bf 100644 --- a/CommandDistributor.cpp +++ b/CommandDistributor.cpp @@ -27,5 +27,5 @@ void CommandDistributor::parse(byte clientId,byte * buffer, RingStream * stream if (!parser) parser = new DCCEXParser(); parser->parse(streamer, buffer, true); // tell JMRI parser that ACKS are blocking because we can't handle the async } - else WiThrottle::getThrottle(clientId)->parse(*streamer, buffer); + else WiThrottle::getThrottle(clientId)->parse(streamer, buffer); } diff --git a/WiThrottle.cpp b/WiThrottle.cpp index 95ea07e..61f7f92 100644 --- a/WiThrottle.cpp +++ b/WiThrottle.cpp @@ -99,7 +99,7 @@ WiThrottle::~WiThrottle() { } } -void WiThrottle::parse(RingStream & stream, byte * cmdx) { +void WiThrottle::parse(RingStream * stream, byte * cmdx) { byte * cmd=cmdx; @@ -205,7 +205,7 @@ int WiThrottle::getLocoId(byte * cmd) { if (cmd[0]!='L' && cmd[0]!='S') return 0; // should not match any locos return getInt(cmd+1); } -void WiThrottle::multithrottle(Print & stream, byte * cmd){ +void WiThrottle::multithrottle(RingStream * stream, byte * cmd){ char throttleChar=cmd[1]; int locoid=getLocoId(cmd+3); // -1 for * byte * aval=cmd; @@ -256,7 +256,7 @@ void WiThrottle::multithrottle(Print & stream, byte * cmd){ } } -void WiThrottle::locoAction(Print & stream, byte* aval, char throttleChar, int cab){ +void WiThrottle::locoAction(RingStream * stream, byte* aval, char throttleChar, int cab){ // Note cab=-1 for all cabs in the consist called throttleChar. // DIAG(F("\nLoco Action aval=%c%c throttleChar=%c, cab=%d"), aval[0],aval[1],throttleChar, cab); switch (aval[0]) { @@ -334,12 +334,13 @@ int WiThrottle::WiTToDCCSpeed(int WiTSpeed) { return WiTSpeed + 1; //offset others by 1 } -void WiThrottle::loop(RingStream & stream) { +void WiThrottle::loop(RingStream * stream) { // for each WiThrottle, check the heartbeat for (WiThrottle* wt=firstThrottle; wt!=NULL ; wt=wt->nextThrottle) wt->checkHeartbeat(); // TODO... any broadcasts to be done + (void)stream; /* MUST follow this model in this loop. * stream->mark(); * send 1 digit client id, and any data diff --git a/WiThrottle.h b/WiThrottle.h index fe06cfe..161020d 100644 --- a/WiThrottle.h +++ b/WiThrottle.h @@ -28,8 +28,8 @@ struct MYLOCO { class WiThrottle { public: - static void loop(RingStream & stream); - void parse(RingStream & stream, byte * cmd); + static void loop(RingStream * stream); + void parse(RingStream * stream, byte * cmd); static WiThrottle* getThrottle( int wifiClient); static bool annotateLeftRight; private: @@ -57,9 +57,9 @@ class WiThrottle { bool lastPowerState; // last power state sent to this client int DCCToWiTSpeed(int DCCSpeed); int WiTToDCCSpeed(int WiTSpeed); - void multithrottle(Print & stream, byte * cmd); - void locoAction(Print & stream, byte* aval, char throttleChar, int cab); - void accessory(Print & stream, byte* cmd); + void multithrottle(RingStream * stream, byte * cmd); + void locoAction(RingStream * stream, byte* aval, char throttleChar, int cab); + void accessory(RingStream *, byte* cmd); void checkHeartbeat(); }; #endif