X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flibmarklin%2Fcontrol.h;h=0ec3d5ba53022a6f3d2bde7614547d1c24703ee0;hb=ae0600f7c3df5b6ef46992b1423888dd0e9a5026;hp=0b7b8c0a00d388ed55376a2d418d7769449a6cd2;hpb=1d735b80482317fd930eb47ca255ab9f1f120a7d;p=r2c2.git diff --git a/source/libmarklin/control.h b/source/libmarklin/control.h index 0b7b8c0..0ec3d5b 100644 --- a/source/libmarklin/control.h +++ b/source/libmarklin/control.h @@ -1,3 +1,10 @@ +/* $Id$ + +This file is part of the MSP Märklin suite +Copyright © 2006-2008 Mikkosoft Productions, Mikko Rasa +Distributed under the GPL +*/ + #ifndef LIBMARKLIN_CONTROL_H_ #define LIBMARKLIN_CONTROL_H_ @@ -13,12 +20,12 @@ namespace Marklin { class Command; +class Reply; class Control { private: int serial_fd; - bool p50_enabled; bool power; std::list queue; std::map turnouts; @@ -30,6 +37,7 @@ private: Msp::Time::Timer timer; public: + sigc::signal signal_power_event; sigc::signal signal_turnout_event; sigc::signal signal_sensor_event; @@ -42,7 +50,9 @@ public: const std::map &get_sensors() const { return sensors; } unsigned get_queue_length() const { return queue.size(); } void open(const std::string &); - Command &command(const std::string &); + Command &command(Cmd); + Command &command(Cmd, unsigned char); + Command &command(Cmd, const unsigned char *, unsigned); void add_turnout(Turnout &); Turnout &get_turnout(unsigned) const; @@ -56,9 +66,10 @@ public: private: void read_all(int, char *, int); std::string read_reply(Cmd); - void event_query_done(Error, const std::string &); - void turnout_event_done(Error, const std::string &); - void sensor_event_done(Error, const std::string &); + void status_done(const Reply &); + void event_query_done(const Reply &); + void turnout_event_done(const Reply &); + void sensor_event_done(const Reply &); }; } // namespace Marklin