First version

Dependencies:   mbed EthernetInterface mbed-rto

Receiver.h

Committer:
albireo987
Date:
2018-05-16
Revision:
81:56e9873f29df
Parent:
76:c0c7c3f37be2

File content as of revision 81:56e9873f29df:

#include "rtos.h"
#include "Interpreter.h"
#include "TCPlistener.h"

#ifndef RECEIVER_H
#define RECEIVER_H
    /**
    * A class used to receive commands via TCP and execute them.
    */
    class Receiver{
        private:
            Queue<int,8>* queue;
            Interpreter interpreter;
            TCPlistener listener;
            char command[512];
        public:
            /**
            *@param queue The queue where received and interpreted commands will we pushed.
            */
            Receiver(Queue<int,8>* queue);
            
            /**
            *Start a loop that will receive packets, and push their contents on the queue.
            *This method should be called last.
            */
            void start();
    };
#endif