rome2_p6 imported

Dependencies:   mbed

Committer:
Appalco
Date:
Fri May 18 13:54:25 2018 +0000
Revision:
5:957580f33e52
Parent:
0:351a2fb21235
fixed tolerance and wayponts

Who changed what in which revision?

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