|
| 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") |
|
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