]> git.tdb.fi Git - r2c2.git/blobdiff - source/libr2c2/intellibox.cpp
Don't crash if a train has no router
[r2c2.git] / source / libr2c2 / intellibox.cpp
index 4c8f2ac783b1e6fbf73bdff9aa73d2f2b1a73e2c..ec72a32734af9d38f33fa26235988ca62fccfa89 100644 (file)
@@ -1,6 +1,4 @@
-#include <fcntl.h>
-#include <termios.h>
-#include <sys/poll.h>
+#include <msp/core/maputils.h>
 #include <msp/io/print.h>
 #include <msp/time/units.h>
 #include <msp/time/utils.h>
@@ -318,6 +316,11 @@ bool Intellibox::get_sensor(unsigned addr) const
        return false;
 }
 
+float Intellibox::get_telemetry_value(const string &name) const
+{
+       throw key_error(name);
+}
+
 void Intellibox::tick()
 {
        const Time::TimeStamp t = Time::now();
@@ -554,7 +557,7 @@ void Intellibox::process_reply(const Time::TimeStamp &t)
                                        if(!sensor.state)
                                        {
                                                sensor.state = state;
-                                               signal_sensor(addr, state);
+                                               signal_sensor.emit(addr, state);
                                        }
                                }
                                else if(sensor.state)