/* * URCLinterface.h * * Created on: Jan 14, 2019 * Author: emanuele */ #ifndef URCLINTERFACE_H_ #define URCLINTERFACE_H_ #include "clientMessage.h" #include #include #include #include #include #include using namespace std; using namespace boost::asio; using ip::tcp; class UR_CLinterface { public: UR_CLinterface(shared_ptr); virtual ~UR_CLinterface(); bool connect(const char* ip, uint16_t port); void disconnect(); void sendCommand(std::string command); void sendPose(pose_t pos); void sendJointPose(jointPose_t pos); void readData(); void parseData(); clientData_t clientData; private: shared_ptr log; boost::asio::io_service io_service; boost::asio::streambuf receive_buffer; boost::system::error_code error; tcp::socket* rsocket; uint32_t lastDataLen=0; unsigned char* lastData=NULL; bool firstMessage=true; }; #endif /* URCLINTERFACE_H_ */