X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flibmarklin%2Fcommand.h;h=a270be0af0083ca80e68f3225029a0bf4fc22c04;hb=7839b7c3d782abb5c98a24d51cae109407068c02;hp=4e4c9866d1a705c3d125d852b8deab045897bd76;hpb=1d735b80482317fd930eb47ca255ab9f1f120a7d;p=r2c2.git diff --git a/source/libmarklin/command.h b/source/libmarklin/command.h index 4e4c986..a270be0 100644 --- a/source/libmarklin/command.h +++ b/source/libmarklin/command.h @@ -1,26 +1,40 @@ +/* $Id$ + +This file is part of the MSP Märklin suite +Copyright © 2006-2008 Mikkosoft Productions, Mikko Rasa +Distributed under the GPL +*/ + #ifndef COMMAND_H_ #define COMMAND_H_ +#include #include #include #include "constants.h" namespace Marklin { +class Reply; + class Command { private: - std::string cmd; - bool sent; + Cmd cmd; + unsigned char data[128]; + unsigned len; + bool sent; public: - sigc::signal signal_done; + sigc::signal signal_done; + + Command(Cmd, const unsigned char *, unsigned); - Command(const std::string &); + void send(int); + bool get_sent() const { return sent; } + Cmd get_command() const { return cmd; } - void set_sent(bool); - const std::string &get_command() const { return cmd; } - bool get_sent() const { return sent; } + friend std::ostream &operator<<(std::ostream &, const Command &); }; } // namespace Marklin