]> git.tdb.fi Git - r2c2.git/blob - packets.h
06701214e591f7897ab29547fd899e93c46a5ae9
[r2c2.git] / packets.h
1 /* $Id$
2
3 This file is part of R²C²
4 Copyright © 2009-2011  Mikkosoft Productions, Mikko Rasa
5 Distributed under the GPL
6 */
7
8 #ifndef R2C2_NET_PACKETS_H_
9 #define R2C2_NET_PACKETS_H_
10
11 #include <string>
12
13 namespace R2C2 {
14
15 struct DriverStatePacket
16 {
17         char power;
18         char halt;
19 };
20
21 struct EmergencyPacket
22 {
23         std::string message;
24 };
25
26 struct TrainInfoPacket
27 {
28         unsigned address;
29         std::string loco_type;
30         std::string name;
31 };
32
33 struct TrainControlPacket
34 {
35         unsigned address;
36         std::string control;
37         float value;
38 };
39
40 struct TrainFunctionPacket
41 {
42         unsigned address;
43         unsigned functions;
44 };
45
46 struct TrainStatusPacket
47 {
48         unsigned address;
49         std::string status;
50 };
51
52 struct RouteInfoPacket
53 {
54         std::string name;
55 };
56
57 struct TrainRoutePacket
58 {
59         unsigned address;
60         std::string route;
61 };
62
63 struct ErrorPacket
64 {
65         std::string message;
66 };
67
68 } // namespace R2C2
69
70 #endif