]> git.tdb.fi Git - r2c2.git/blob - source/libmarklin/reply.h
Rewrite command/reply system
[r2c2.git] / source / libmarklin / reply.h
1 /* $Id$
2
3 This file is part of the MSP Märklin suite
4 Copyright © 2006-2008 Mikkosoft Productions, Mikko Rasa
5 Distributed under the GPL
6 */
7
8 #ifndef LIBMARKLIN_REPLY_H_
9 #define LIBMARKLIN_REPLY_H_
10
11 #include <ostream>
12
13 namespace Marklin {
14
15 class Reply
16 {
17 private:
18         Error err;
19         unsigned char data[128];
20         unsigned len;
21
22         Reply();
23 public:
24         Error get_error() const { return err; }
25         const unsigned char *get_data() const { return data; }
26
27         static Reply read(int, Cmd);
28
29         friend std::ostream &operator<<(std::ostream &, const Reply &);
30 };
31
32
33
34 } // namespace Marklin
35
36 #endif