4 #ifndef AUBO_SDK_SOCKET_INTERFACE_H 5 #define AUBO_SDK_SOCKET_INTERFACE_H 11 #include <aubo/global_config.h> 14 namespace common_interface {
46 int socketOpen(
const std::string &address,
int port,
47 const std::string &socket_name =
"socket_0");
71 int socketClose(
const std::string &socket_name =
"socket_0");
97 int socketReadAsciiFloat(
int number,
const std::string &variable,
98 const std::string &socket_name =
"socket_0");
124 int socketReadBinaryInteger(
int number,
const std::string &variable,
125 const std::string &socket_name =
"socket_0");
150 int socketReadByteList(
int number,
const std::string &variable,
151 const std::string &socket_name =
"socket_0");
196 int socketReadString(
const std::string &variable,
197 const std::string &socket_name =
"socket_0",
198 const std::string &prefix =
"",
199 const std::string &suffix =
"",
200 bool interpret_escape =
false);
223 int socketReadAllString(
const std::string &variable,
224 const std::string &socket_name =
"socket_0");
245 int socketSendByte(
char value,
const std::string &socket_name =
"socket_0");
265 int socketSendInt(
int value,
const std::string &socket_name =
"socket_0");
292 int socketSendLine(
const std::string &str,
293 const std::string &socket_name =
"socket_0");
319 int socketSendString(
const std::string &str,
320 const std::string &socket_name =
"socket_0");
338 int socketSendAllString(
bool is_check,
const std::vector<char> &str,
339 const std::string &socket_name =
"socket_0");
347 #define Socket_DECLARES \ 348 _INST(Socket, 3, socketOpen, address, port, socket_name) \ 349 _INST(Socket, 1, socketClose, socket_name) \ 350 _FUNC(Socket, 3, socketReadAsciiFloat, number, variable, socket_name) \ 351 _FUNC(Socket, 3, socketReadBinaryInteger, number, variable, socket_name) \ 352 _FUNC(Socket, 3, socketReadByteList, number, variable, socket_name) \ 353 _FUNC(Socket, 5, socketReadString, variable, socket_name, prefix, suffix, interpret_escape) \ 354 _FUNC(Socket, 2, socketReadAllString, variable, socket_name) \ 355 _INST(Socket, 2, socketSendByte, value, socket_name) \ 356 _INST(Socket, 2, socketSendInt, value, socket_name) \ 357 _INST(Socket, 2, socketSendLine, str, socket_name) \ 358 _INST(Socket, 2, socketSendString, str, socket_name) \ 359 _INST(Socket, 3, socketSendAllString, is_check, str, socket_name)
std::shared_ptr< Socket > SocketPtr