4 #ifndef AUBO_SDK_SERIAL_INTERFACE_H 5 #define AUBO_SDK_SERIAL_INTERFACE_H 11 #include <aubo/global_config.h> 14 namespace common_interface {
41 int serialOpen(
const std::string &device,
int baud,
float stop_bits,
42 int even,
const std::string &serial_name =
"serial_0");
58 int serialClose(
const std::string &serial_name =
"serial_0");
76 int serialReadByte(
const std::string &variable,
77 const std::string &serial_name =
"serial_0");
98 int serialReadByteList(
int number,
const std::string &variable,
99 const std::string &serial_name =
"serial_0");
134 int serialReadString(
const std::string &variable,
135 const std::string &serial_name =
"serial_0",
136 const std::string &prefix =
"",
137 const std::string &suffix =
"",
138 bool interpret_escape =
false);
157 int serialSendByte(
char value,
const std::string &serial_name =
"serial_0");
175 int serialSendInt(
int value,
const std::string &serial_name =
"serial_0");
194 int serialSendLine(
const std::string &str,
195 const std::string &serial_name =
"serial_0");
213 int serialSendString(
const std::string &str,
214 const std::string &serial_name =
"serial_0");
232 int serialSendAllString(
bool is_check,
const std::vector<char> &str,
233 const std::string &serial_name =
"serial_0");
241 #define Serial_DECLARES \ 242 _INST(Serial, 5, serialOpen, device, baud, stop_bits, even, serial_name) \ 243 _INST(Serial, 1, serialClose, serial_name) \ 244 _FUNC(Serial, 2, serialReadByte, variable, serial_name) \ 245 _FUNC(Serial, 3, serialReadByteList, number, variable, serial_name) \ 246 _FUNC(Serial, 5, serialReadString, variable, serial_name, prefix, suffix, interpret_escape) \ 247 _INST(Serial, 2, serialSendByte, value, serial_name) \ 248 _INST(Serial, 2, serialSendInt, value, serial_name) \ 249 _INST(Serial, 2, serialSendLine, str, serial_name) \ 250 _INST(Serial, 2, serialSendString, str, serial_name) \ 251 _INST(Serial, 3, serialSendAllString, is_check, str, serial_name)
std::shared_ptr< Serial > SerialPtr