4 #ifndef AUBO_SDK_SOCKET_INTERFACE_H 5 #define AUBO_SDK_SOCKET_INTERFACE_H 11 #include <aubo/global_config.h> 14 namespace common_interface {
40 int socketOpen(
const std::string &address,
int port,
41 const std::string &socket_name =
"socket_0");
59 int socketClose(
const std::string &socket_name =
"socket_0");
85 int socketReadAsciiFloat(
int number,
const std::string &variable,
86 const std::string &socket_name =
"socket_0");
112 int socketReadBinaryInteger(
int number,
const std::string &variable,
113 const std::string &socket_name =
"socket_0");
138 int socketReadByteList(
int number,
const std::string &variable,
139 const std::string &socket_name =
"socket_0");
178 int socketReadString(
const std::string &variable,
179 const std::string &socket_name =
"socket_0",
180 const std::string &prefix =
"",
181 const std::string &suffix =
"",
182 bool interpret_escape =
false);
199 int socketReadAllString(
const std::string &variable,
200 const std::string &socket_name =
"socket_0");
221 int socketSendByte(
char value,
const std::string &socket_name =
"socket_0");
241 int socketSendInt(
int value,
const std::string &socket_name =
"socket_0");
262 int socketSendLine(
const std::string &str,
263 const std::string &socket_name =
"socket_0");
283 int socketSendString(
const std::string &str,
284 const std::string &socket_name =
"socket_0");
302 int socketSendAllString(
bool is_check,
const std::vector<char> &str,
303 const std::string &socket_name =
"socket_0");
311 #define Socket_DECLARES \ 312 _INST(Socket, 3, socketOpen, address, port, socket_name) \ 313 _INST(Socket, 1, socketClose, socket_name) \ 314 _FUNC(Socket, 3, socketReadAsciiFloat, number, variable, socket_name) \ 315 _FUNC(Socket, 3, socketReadBinaryInteger, number, variable, socket_name) \ 316 _FUNC(Socket, 3, socketReadByteList, number, variable, socket_name) \ 317 _FUNC(Socket, 5, socketReadString, variable, socket_name, prefix, suffix, interpret_escape) \ 318 _FUNC(Socket, 2, socketReadAllString, variable, socket_name) \ 319 _INST(Socket, 2, socketSendByte, value, socket_name) \ 320 _INST(Socket, 2, socketSendInt, value, socket_name) \ 321 _INST(Socket, 2, socketSendLine, str, socket_name) \ 322 _INST(Socket, 2, socketSendString, str, socket_name) \ 323 _INST(Socket, 3, socketSendAllString, is_check, str, socket_name)
std::shared_ptr< Socket > SocketPtr