4#ifndef AUBO_SDK_SERIAL_INTERFACE_H
5#define AUBO_SDK_SERIAL_INTERFACE_H
11#include <aubo/global_config.h>
14namespace common_interface {
41 int serialOpen(
const std::string &device,
int baud,
float stop_bits,
42 int even,
const std::string &serial_name =
"serial_0");
77 const std::string &serial_name =
"serial_0");
99 const std::string &serial_name =
"serial_0");
135 const std::string &serial_name =
"serial_0",
136 const std::string &prefix =
"",
137 const std::string &suffix =
"",
138 bool interpret_escape =
false);
195 const std::string &serial_name =
"serial_0");
214 const std::string &serial_name =
"serial_0");
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)
int serialSendAllString(bool is_check, const std::vector< char > &str, const std::string &serial_name="serial_0")
int serialSendLine(const std::string &str, const std::string &serial_name="serial_0")
Sends a string with a newline character to the server - useful for communicatin with the UR dashboard...
int serialSendString(const std::string &str, const std::string &serial_name="serial_0")
Sends a string to the server Sends the string <str> through the serial in ASCII coding.
int serialClose(const std::string &serial_name="serial_0")
Closes TCP/IP serial communication Closes down the serial connection to the server.
int serialReadByteList(int number, const std::string &variable, const std::string &serial_name="serial_0")
Reads a number of bytes from the serial.
int serialSendInt(int value, const std::string &serial_name="serial_0")
Sends an int (int32_t) to the server Sends the int through the serial.
int serialReadByte(const std::string &variable, const std::string &serial_name="serial_0")
Reads a number of bytes from the serial.
int serialSendByte(char value, const std::string &serial_name="serial_0")
Sends a byte to the server Sends the byte through the serial.
int serialOpen(const std::string &device, int baud, float stop_bits, int even, const std::string &serial_name="serial_0")
Open TCP/IP ethernet communication serial
int serialReadString(const std::string &variable, const std::string &serial_name="serial_0", const std::string &prefix="", const std::string &suffix="", bool interpret_escape=false)
Reads all data from the serial and returns the data as a string.
std::shared_ptr< Serial > SerialPtr