X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flibmarklin%2Fcontrol.h;h=1d19263fb93da651807d5b0abaaa3d0978166eb5;hb=7839b7c3d782abb5c98a24d51cae109407068c02;hp=df8ea1bc3c76ad9cc51b65c0c29c81481be87644;hpb=ca5b1fcfd52a09e3d3b2c4c011dc91ac9ad19694;p=r2c2.git diff --git a/source/libmarklin/control.h b/source/libmarklin/control.h index df8ea1b..1d19263 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-2009 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; @@ -40,10 +47,13 @@ public: void set_power(bool); bool get_power() const { return power; } void set_debug(bool); + const std::map &get_turnouts() const { return turnouts; } 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; @@ -57,10 +67,10 @@ public: private: void read_all(int, char *, int); std::string read_reply(Cmd); - void status_done(Error, const std::string &); - 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