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:
@@ -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);
|
||||
};
|
||||
Reference in New Issue
Block a user