X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flibmarklin%2Fcontrol.cpp;h=30e99e6e4f5266cfa1878735bf3a4a21ded55920;hb=93ca5f1774e218c313edd88024f82c80714d8e7c;hp=4f63cc20be086e90e4c56c7e2d768665444a2044;hpb=dcc8378d809e5d2e53db77234559b0556195e693;p=r2c2.git diff --git a/source/libmarklin/control.cpp b/source/libmarklin/control.cpp index 4f63cc2..30e99e6 100644 --- a/source/libmarklin/control.cpp +++ b/source/libmarklin/control.cpp @@ -1,7 +1,7 @@ /* $Id$ This file is part of the MSP Märklin suite -Copyright © 2007-2008 Mikkosoft Productions, Mikko Rasa +Copyright © 2007-2009 Mikkosoft Productions, Mikko Rasa Distributed under the GPL */ @@ -216,7 +216,11 @@ void Control::tick() if(serial_fd>=0) queue.front().send(serial_fd); else + { + Reply reply = Reply::simulate(queue.front().get_command()); + queue.front().signal_done.emit(reply); queue.erase(queue.begin()); + } } } @@ -240,7 +244,7 @@ void Control::event_query_done(const Reply &reply) command(CMD_EVENT_TURNOUT).signal_done.connect(sigc::mem_fun(this, &Control::turnout_event_done)); if(data[0]&0x04) command(CMD_EVENT_SENSOR).signal_done.connect(sigc::mem_fun(this, &Control::sensor_event_done)); - if(data[1]&0x40) + if((data[0]&0x80) && (data[1]&0x40)) command(CMD_STATUS).signal_done.connect(sigc::mem_fun(this, &Control::status_done)); }