]> git.tdb.fi Git - r2c2.git/blob - source/serial/serial.h
Strip Id tags and copyright notices from files
[r2c2.git] / source / serial / serial.h
1 #ifndef SERIAL_H_
2 #define SERIAL_H_
3
4 #include <msp/core/application.h>
5 #include <msp/io/serial.h>
6 #include "network/client.h"
7
8 class Serial: public Msp::Application
9 {
10 private:
11         Msp::IO::EventDispatcher event_disp;
12         R2C2::Catalogue catalogue;
13         R2C2::Client client;
14         Msp::IO::Serial serial_port;
15         R2C2::NetTrain *train;
16         bool reverse;
17         char rx_buf[3];
18         unsigned rx_fill;
19
20         static Msp::Application::RegApp<Serial> reg;
21
22 public:
23         Serial(int, char **);
24
25 private:
26         virtual void tick();
27         void train_added(R2C2::NetTrain &);
28         void error(const std::string &);
29         void set_train(R2C2::NetTrain *);
30         void next_train();
31         void prev_train();
32         void data_available();
33 };
34
35 #endif