rome2_p6 imported

Dependencies:   mbed

Revision:
0:351a2fb21235
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SerialServer.h	Fri May 18 12:05:32 2018 +0000
@@ -0,0 +1,46 @@
+/*
+ * SerialServer.h
+ * Copyright (c) 2018, ZHAW
+ * All rights reserved.
+ */
+
+#ifndef SERIAL_SERVER_H_
+#define SERIAL_SERVER_H_
+
+#include <cstdlib>
+#include <string>
+#include <mbed.h>
+#include "LIDAR.h"
+#include "Controller.h"
+
+using namespace std;
+
+/**
+ * This class implements a communication server using a serial interface.
+ */
+class SerialServer {
+    
+    public:
+        
+                        SerialServer(RawSerial& serial, LIDAR& lidar, Controller& controller);
+        virtual         ~SerialServer();
+        
+    private:
+        
+        static const float  PERIOD;
+        static const char   INT_TO_CHAR[];
+        static const int    BUFFER_SIZE = 64;
+        
+        RawSerial&      serial;
+        LIDAR&          lidar;
+        Controller&     controller;
+        string          input;
+        string          output;
+        Ticker          ticker;
+        
+        void            receive();
+        void            transmit();
+};
+
+#endif /* SERIAL_SERVER_H_ */
+