ARCS SDK API  0.24.0
Public 成员函数 | Protected 属性 | 所有成员列表
arcs::common_interface::Serial类 参考

#include <serial.h>

Public 成员函数

 Serial ()
 
virtual ~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 serialClose (const std::string &serial_name="serial_0")
 Closes TCP/IP serial communication Closes down the serial connection to the server. 更多...
 
int serialReadByte (const std::string &variable, const std::string &serial_name="serial_0")
 Reads a number of bytes from the serial. 更多...
 
int serialReadByteList (int number, const std::string &variable, const std::string &serial_name="serial_0")
 Reads a number of bytes from the 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. 更多...
 
int serialSendByte (char value, const std::string &serial_name="serial_0")
 Sends a byte to the server Sends the byte through 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 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 server Sends the string <str> through the serial in ASCII coding. 更多...
 
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 serialSendAllString (bool is_check, const std::vector< char > &str, const std::string &serial_name="serial_0")
 

Protected 属性

void * d_
 

详细描述

在文件 serial.h16 行定义.

构造及析构函数说明

arcs::common_interface::Serial::Serial ( )
virtual arcs::common_interface::Serial::~Serial ( )
virtual

成员函数说明

int arcs::common_interface::Serial::serialClose ( const std::string &  serial_name = "serial_0")

Closes TCP/IP serial communication Closes down the serial connection to the server.

参数
serial_name
返回
Python函数原型
serialClose(self: pyaubo_sdk.Serial, arg0: str) -> int
Lua函数原型
serialClose(serial_name: string) -> nil
int arcs::common_interface::Serial::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.

参数
device
baud
stop_bits
even
serial_name
返回
Python函数原型
serialOpen(self: pyaubo_sdk.Serial, arg0: str, arg1: int, arg2: float, arg3: int, arg4: str) -> int
Lua函数原型
serialOpen(device: string, baud: number, stop_bits: number, even: number, serial_name: string) -> nil
int arcs::common_interface::Serial::serialReadByte ( const std::string &  variable,
const std::string &  serial_name = "serial_0" 
)

Reads a number of bytes from the serial.

Bytes are in network byte order. A maximum of 30 values can be read in one command. A list of numbers read (list of ints, length=number+1)

参数
variable
serial_name
返回
Python函数原型
serialReadByte(self: pyaubo_sdk.Serial, arg0: str, arg1: str) -> int
Lua函数原型
serialReadByte(variable: string, serial_name: string) -> number
int arcs::common_interface::Serial::serialReadByteList ( int  number,
const std::string &  variable,
const std::string &  serial_name = "serial_0" 
)

Reads a number of bytes from the serial.

Bytes are in network byte order. A maximum of 30 values can be read in one command. A list of numbers read (list of ints, length=number+1)

参数
number
variable
serial_name
返回
Python函数原型
serialReadByteList(self: pyaubo_sdk.Serial, arg0: int, arg1: str, arg2: str) -> int
Lua函数原型
serialReadByteList(number: number, variable: string, serial_name: string) -> number
int arcs::common_interface::Serial::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.

Bytes are in network byte order.

The optional parameters "prefix" and "suffix", can be used to express what is extracted from the serial. The "prefix" specifies the start of the substring (message) extracted from the serial. The data up to the end of the "prefix" will be ignored and removed from the serial. The "suffix" specifies the end of the substring (message) extracted from the serial. Any remaining data on the serial, after the "suffix", will be preserved. E.g. if the serial server sends a string "noise>hello<", the controller can receive the "hello" by calling this script function with the prefix=">" and suffix="<". By using the "prefix" and "suffix" it is also possible send multiple string to the controller at once, because the suffix defines where the message ends. E.g. sending ">hello<>world<"

参数
variable
serial_name
prefix
suffix
interpret_escape
返回
Python函数原型
serialReadString(self: pyaubo_sdk.Serial, arg0: str, arg1: str, arg2: str, arg3: str, arg4: bool) -> int
Lua函数原型
serialReadString(variable: string, serial_name: string, prefix: string, suffix: string, interpret_escape: boolean) -> number
int arcs::common_interface::Serial::serialSendAllString ( bool  is_check,
const std::vector< char > &  str,
const std::string &  serial_name = "serial_0" 
)
参数
is_check
str
serial_name
返回
Python函数原型
serialSendAllString(self: pyaubo_sdk.Serial, arg0: bool, arg1: List[str], arg2: str) -> int
Lua函数原型
serialSendAllString(is_check: boolean, str: table, serial_name: string) -> nil
int arcs::common_interface::Serial::serialSendByte ( char  value,
const std::string &  serial_name = "serial_0" 
)

Sends a byte to the server Sends the byte through the serial.

Expects no response. Can be used to send special ASCII characters; 10 is newline, 2 is start of text, 3 is end of text.

参数
value
serial_name
返回
Python函数原型
serialSendByte(self: pyaubo_sdk.Serial, arg0: str, arg1: str) -> int
Lua函数原型
serialSendByte(value: string, serial_name: string) -> nil
int arcs::common_interface::Serial::serialSendInt ( int  value,
const std::string &  serial_name = "serial_0" 
)

Sends an int (int32_t) to the server Sends the int through the serial.

Send in network byte order. Expects no response

参数
value
serial_name
返回
Python函数原型
serialSendInt(self: pyaubo_sdk.Serial, arg0: int, arg1: str) -> int
Lua函数原型
serialSendInt(value: number, serial_name: string) -> nil
int arcs::common_interface::Serial::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 server Sends the string <str> through the serial in ASCII coding.

Expects no response.

参数
str
serial_name
返回
Python函数原型
serialSendLine(self: pyaubo_sdk.Serial, arg0: str, arg1: str) -> int
Lua函数原型
serialSendLine(str: string, serial_name: string) -> nil
int arcs::common_interface::Serial::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.

Expects no response.

参数
str
serial_name
返回
Python函数原型
serialSendString(self: pyaubo_sdk.Serial, arg0: str, arg1: str) -> int
Lua函数原型
serialSendString(str: string, serial_name: string) -> nil

类成员变量说明

void* arcs::common_interface::Serial::d_
protected

在文件 serial.h236 行定义.


该类的文档由以下文件生成: