]> git.tdb.fi Git - r2c2.git/blob - protocol.cpp
ee0a1b07c5e9674f04aaa6649a8a4b4b1ae256fb
[r2c2.git] / protocol.cpp
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 #include "packets.h"
9 #include "protocol.h"
10
11 namespace R2C2 {
12
13 Protocol::Protocol()
14 {
15         add<DriverStatePacket>() (&DriverStatePacket::power)
16                 (&DriverStatePacket::halt);
17         add<EmergencyPacket>() (&EmergencyPacket::message);
18         add<TrainInfoPacket>() (&TrainInfoPacket::address)
19                 (&TrainInfoPacket::loco_type) (&TrainInfoPacket::name);
20         add<TrainControlPacket>() (&TrainControlPacket::address)
21                 (&TrainControlPacket::control) (&TrainControlPacket::value);
22         add<TrainFunctionPacket>() (&TrainFunctionPacket::address)
23                 (&TrainFunctionPacket::functions);
24         add<TrainStatusPacket>() (&TrainStatusPacket::address)
25                 (&TrainStatusPacket::status);
26         add<RouteInfoPacket>() (&RouteInfoPacket::name);
27         add<TrainRoutePacket>() (&TrainRoutePacket::address)
28                 (&TrainRoutePacket::route);
29         add<ErrorPacket>() (&ErrorPacket::message);
30 }
31
32 } // namespace R2C2