Zürcher Eliteeinheit / Mbed 2 deprecated ROME2_P4

Dependencies:   ROME2_P2 mbed

Fork of ROME2_P3 by Zürcher Eliteeinheit

Committer:
matajarb
Date:
Thu Apr 26 12:22:58 2018 +0000
Revision:
6:67263dc2c2cf
s?mme du schluch

Who changed what in which revision?

UserRevisionLine numberNew contents of line
matajarb 6:67263dc2c2cf 1 /*
matajarb 6:67263dc2c2cf 2 * SerialServer.h
matajarb 6:67263dc2c2cf 3 * Copyright (c) 2018, ZHAW
matajarb 6:67263dc2c2cf 4 * All rights reserved.
matajarb 6:67263dc2c2cf 5 */
matajarb 6:67263dc2c2cf 6
matajarb 6:67263dc2c2cf 7 #ifndef SERIAL_SERVER_H_
matajarb 6:67263dc2c2cf 8 #define SERIAL_SERVER_H_
matajarb 6:67263dc2c2cf 9
matajarb 6:67263dc2c2cf 10 #include <cstdlib>
matajarb 6:67263dc2c2cf 11 #include <string>
matajarb 6:67263dc2c2cf 12 #include <mbed.h>
matajarb 6:67263dc2c2cf 13 #include "IMU.h"
matajarb 6:67263dc2c2cf 14 #include "Controller.h"
matajarb 6:67263dc2c2cf 15
matajarb 6:67263dc2c2cf 16 using namespace std;
matajarb 6:67263dc2c2cf 17
matajarb 6:67263dc2c2cf 18 /**
matajarb 6:67263dc2c2cf 19 * This class implements a communication server using a serial interface.
matajarb 6:67263dc2c2cf 20 */
matajarb 6:67263dc2c2cf 21 class SerialServer {
matajarb 6:67263dc2c2cf 22
matajarb 6:67263dc2c2cf 23 public:
matajarb 6:67263dc2c2cf 24
matajarb 6:67263dc2c2cf 25 SerialServer(Serial& serial, IMU& imu, Controller& controller);
matajarb 6:67263dc2c2cf 26 virtual ~SerialServer();
matajarb 6:67263dc2c2cf 27
matajarb 6:67263dc2c2cf 28 private:
matajarb 6:67263dc2c2cf 29
matajarb 6:67263dc2c2cf 30 static const float PERIOD;
matajarb 6:67263dc2c2cf 31 static const int BUFFER_SIZE = 64;
matajarb 6:67263dc2c2cf 32
matajarb 6:67263dc2c2cf 33 Serial& serial;
matajarb 6:67263dc2c2cf 34 IMU& imu;
matajarb 6:67263dc2c2cf 35 Controller& controller;
matajarb 6:67263dc2c2cf 36 string input;
matajarb 6:67263dc2c2cf 37 string output;
matajarb 6:67263dc2c2cf 38 Ticker ticker;
matajarb 6:67263dc2c2cf 39
matajarb 6:67263dc2c2cf 40 void receive();
matajarb 6:67263dc2c2cf 41 void transmit();
matajarb 6:67263dc2c2cf 42 };
matajarb 6:67263dc2c2cf 43
matajarb 6:67263dc2c2cf 44 #endif /* SERIAL_SERVER_H_ */
matajarb 6:67263dc2c2cf 45