1
0
mirror of https://gitlab.com/obbart/universal_robots_ros_driver.git synced 2026-04-10 10:00:48 +02:00

Major refactor

This commit is contained in:
Simon Rasmussen
2017-04-27 06:40:03 +02:00
parent 46f4e493cf
commit c59bfc78cc
22 changed files with 825 additions and 423 deletions

View File

@@ -6,14 +6,25 @@
#include <mutex>
#include <atomic>
#include <string>
#include "ur_modern_driver/ur/stream.h"
#include "ur_modern_driver/tcp_socket.h"
class URServer
class URServer : private TCPSocket
{
private:
int socket_fd_ = -1;
int port_;
SocketState state_;
TCPSocket client_;
protected:
virtual bool open(int socket_fd, struct sockaddr *address, size_t address_len)
{
return ::bind(socket_fd, address, address_len) == 0;
}
public:
URServer(int port);
URStream accept();
std::string getIP();
bool bind();
bool accept();
bool write(const uint8_t* buf, size_t buf_len, size_t &written);
};