Add complib client and TCP communication

This commit is contained in:
Konstantin Lampalzer 2022-05-22 23:00:57 +02:00
parent 1a033c8b03
commit a484bc2137
35 changed files with 815 additions and 232 deletions

View file

@ -1,6 +1,8 @@
#ifndef COMPLIB_SERVER_MESSAGEBUILDER_HPP
#define COMPLIB_SERVER_MESSAGEBUILDER_HPP
#include <cstdint>
#include <array>
#include "CompLib.pb.h"
#include "include/Robot.hpp"

View file

@ -0,0 +1,20 @@
#ifndef COMPLIB_SERVER_TCPSOCKETSERVER_HPP
#define COMPLIB_SERVER_TCPSOCKETSERVER_HPP
#include <thread>
#define SOCKET_PATH "/tmp/compLib"
#define SOCKET_BUFFER_SIZE 128
class TCPSocketServer {
public:
TCPSocketServer();
private:
[[noreturn]] void server_loop();
std::thread server_thread;
};
#endif //COMPLIB_SERVER_TCPSOCKETSERVER_HPP

View file

@ -4,7 +4,7 @@
#include <thread>
#define SOCKET_PATH "/tmp/compLib"
#define SOCKET_BUFFER_SIZE 64
#define SOCKET_BUFFER_SIZE 128
class UnixSocketServer {
public: