4#ifndef AUBO_SDK_SERIAL_INTERFACE_H
5#define AUBO_SDK_SERIAL_INTERFACE_H
11#include <aubo/global_config.h>
14namespace common_interface {
61 int serialOpen(
const std::string &device,
int baud,
float stop_bits,
62 int even,
const std::string &serial_name =
"serial_0");
124 const std::string &serial_name =
"serial_0");
160 const std::string &serial_name =
"serial_0");
219 const std::string &serial_name =
"serial_0",
220 const std::string &prefix =
"",
221 const std::string &suffix =
"",
222 bool interpret_escape =
false);
322 const std::string &serial_name =
"serial_0");
356 const std::string &serial_name =
"serial_0");
387 const std::string &serial_name =
"serial_0");
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")
发送带有换行符的字符串到服务器 以ASCII编码通过串口发送字符串<str>,并在末尾添加换行符。不期望有响应。
int serialSendString(const std::string &str, const std::string &serial_name="serial_0")
发送字符串到服务器 以ASCII编码通过串口发送字符串<str>。不期望有响应。
int serialClose(const std::string &serial_name="serial_0")
关闭TCP/IP串口通信 关闭与服务器的串口连接。
int serialReadByteList(int number, const std::string &variable, const std::string &serial_name="serial_0")
从串口读取指定数量的字节。字节为网络字节序。一次最多可读取30个值。 返回读取到的数字列表(int列表,长度=number+1)。
int serialSendInt(int value, const std::string &serial_name="serial_0")
发送一个整数(int32_t)到服务器 通过串口发送整数 。以网络字节序发送。不期望有响应。
int serialReadByte(const std::string &variable, const std::string &serial_name="serial_0")
从串口读取指定数量的字节。字节为网络字节序。一次最多可读取30个值。
int serialSendByte(char value, const std::string &serial_name="serial_0")
发送一个字节到服务器 通过串口发送字节 。不期望有响应。可用于发送特殊的ASCII字符;10为换行符,2为文本开始,3为文本结束。
int serialOpen(const std::string &device, int baud, float stop_bits, int even, const std::string &serial_name="serial_0")
打开TCP/IP以太网通信串口
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)
从串口读取所有数据,并将数据作为字符串返回。 字节为网络字节序。
std::shared_ptr< Serial > SerialPtr