X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flibmarklin%2Fcommand.h;h=e6123c31b625390842c09b7aa22fea64065a18dc;hb=02c9a9779954d993cb73fe5f7a72b0847e87f633;hp=6075ab2e210d8085f8342f102b50df2cf4280ec7;hpb=3e9c210ddc036cd015228504cc0803c909e27f84;p=r2c2.git diff --git a/source/libmarklin/command.h b/source/libmarklin/command.h index 6075ab2..e6123c3 100644 --- a/source/libmarklin/command.h +++ b/source/libmarklin/command.h @@ -1,33 +1,41 @@ /* $Id$ This file is part of the MSP Märklin suite -Copyright © 2006-2008 Mikkosoft Productions, Mikko Rasa +Copyright © 2007-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 { +public: + sigc::signal signal_done; + private: - std::string cmd; - bool sent; + Cmd cmd; + unsigned char data[128]; + unsigned len; + bool sent; public: - sigc::signal signal_done; + Command(Cmd, const unsigned char *, unsigned); - Command(const std::string &); + void send(int); + bool is_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