Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of OmniWheels by
Diff: SerialServerRes.h
- Revision:
- 2:798925c9e4a8
- Parent:
- 1:9c5af431a1f1
--- a/SerialServerRes.h Tue May 01 15:47:08 2018 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,54 +0,0 @@ -/* - * SerialServer.h - * Copyright (c) 2017, ZHAW - * All rights reserved. - * - * Created on: 05.06.2017 - * Author: Marcel Honegger - */ - -#ifndef SERIAL_SERVER_RES_H_ -#define SERIAL_SERVER_RES_H_ - -#include <cstdlib> -#include <string> -#include <vector> -#include <mbed.h> -#include "Signal.h" - -using namespace std; - - - -/** - * This class implements a communication server using a serial interface. - */ -class SerialServerRes { - - public: - - SerialServerRes(RawSerial& serial); - virtual ~SerialServerRes(); - - private: - - static const uint32_t STACK_SIZE = 2048 ; // stack size of thread, given in [bytes] - static const float PERIOD; // the period of the timer interrupt, given in [s] - static const char DELIM; - - RawSerial& serial; - string input; - string output; - vector<string> tokens; - Signal signal; - Thread thread; - Ticker ticker; - bool sendData; - int runCount; - - void sendSignal(); - void run(); - void splitString(); -}; - -#endif /* SERIAL_SERVER_H_ */