3434#include " ur_client_library/types.h"
3535#include " ur_client_library/log.h"
3636#include " ur_client_library/ur/robot_receive_timeout.h"
37+ #include " ur_client_library/ur/version_information.h"
3738#include < cstring>
3839#include < endian.h>
3940#include < condition_variable>
@@ -62,6 +63,17 @@ enum class FreedriveControlMessage : int32_t
6263 FREEDRIVE_START = 1 , // /< Represents command to start freedrive mode.
6364};
6465
66+ struct ReverseInterfaceConfig
67+ {
68+ uint32_t port = 50001 ; // !< Port the server is started on
69+ std::function<void (bool )> handle_program_state = [](bool ) {
70+ return ;
71+ }; // !< Function handle to a callback on program state changes.
72+ std::chrono::milliseconds step_time = std::chrono::milliseconds(8 ); // !< The robots step time
73+ uint32_t keepalive_count = 0 ; // !< Number of allowed timeout reads on the robot.
74+ VersionInformation robot_software_version = VersionInformation(); // !< The robot software version.
75+ };
76+
6577/* !
6678 * \brief The ReverseInterface class handles communication to the robot. It starts a server and
6779 * waits for the robot to connect via its URCaps program.
@@ -79,9 +91,12 @@ class ReverseInterface
7991 * \param handle_program_state Function handle to a callback on program state changes.
8092 * \param step_time The robots step time
8193 */
94+ [[deprecated(" Use ReverseInterfaceConfig instead of port, handle_program_state and step_time parameters" )]]
8295 ReverseInterface (uint32_t port, std::function<void (bool )> handle_program_state,
8396 std::chrono::milliseconds step_time = std::chrono::milliseconds(8 ));
8497
98+ ReverseInterface (const ReverseInterfaceConfig& config);
99+
85100 /* !
86101 * \brief Disconnects possible clients so the reverse interface object can be safely destroyed.
87102 */
@@ -167,6 +182,8 @@ class ReverseInterface
167182 socket_t client_fd_;
168183 comm::TCPServer server_;
169184
185+ VersionInformation robot_software_version_;
186+
170187 template <typename T>
171188 size_t append (uint8_t * buffer, T& val)
172189 {
0 commit comments