-/* $Id$
-
-This file is part of the MSP Märklin suite
-Copyright © 2010 Mikkosoft Productions, Mikko Rasa
-Distributed under the GPL
-*/
-
#ifndef SERIAL_H_
#define SERIAL_H_
#include <msp/io/serial.h>
#include "network/client.h"
-class Serial: public Msp::Application
+class Serial: public Msp::RegisteredApplication<Serial>
{
private:
Msp::IO::EventDispatcher event_disp;
- Marklin::Catalogue catalogue;
- Marklin::Client client;
+ R2C2::Catalogue catalogue;
+ R2C2::Client client;
Msp::IO::Serial serial_port;
- Marklin::NetTrain *train;
+ R2C2::NetTrain *train;
+ bool reverse;
char rx_buf[3];
unsigned rx_fill;
- static Msp::Application::RegApp<Serial> reg;
-
public:
Serial(int, char **);
private:
virtual void tick();
- void train_added(Marklin::NetTrain &);
+ void train_added(R2C2::NetTrain &);
void error(const std::string &);
- void set_train(Marklin::NetTrain *);
+ void set_train(R2C2::NetTrain *);
void next_train();
void prev_train();
void data_available();