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

#include <socket.h>

Public 成员函数

 Socket ()
 
virtual ~Socket ()
 
int socketOpen (const std::string &address, int port, const std::string &socket_name="socket_0")
 Open TCP/IP ethernet communication socket. 更多...
 
int socketClose (const std::string &socket_name="socket_0")
 Closes TCP/IP socket communication Closes down the socket connection to the server. 更多...
 
int socketReadAsciiFloat (int number, const std::string &variable, const std::string &socket_name="socket_0")
 Reads a number of ascii formatted floats from the socket. 更多...
 
int socketReadBinaryInteger (int number, const std::string &variable, const std::string &socket_name="socket_0")
 Reads a number of 32 bit integers from the socket. 更多...
 
int socketReadByteList (int number, const std::string &variable, const std::string &socket_name="socket_0")
 Reads a number of bytes from the socket. 更多...
 
int socketReadString (const std::string &variable, const std::string &socket_name="socket_0", const std::string &prefix="", const std::string &suffix="", bool interpret_escape=false)
 Reads all data from the socket and returns the data as a string. 更多...
 
int socketReadAllString (const std::string &variable, const std::string &socket_name="socket_0")
 Instruction std::vector<char> 更多...
 
int socketSendByte (char value, const std::string &socket_name="socket_0")
 Sends a byte to the server Sends the byte through the socket. 更多...
 
int socketSendInt (int value, const std::string &socket_name="socket_0")
 Sends an int (int32_t) to the server Sends the int through the socket. 更多...
 
int socketSendLine (const std::string &str, const std::string &socket_name="socket_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 socket in ASCII coding. 更多...
 
int socketSendString (const std::string &str, const std::string &socket_name="socket_0")
 Sends a string to the server Sends the string <str> through the socket in ASCII coding. 更多...
 
int socketSendAllString (bool is_check, const std::vector< char > &str, const std::string &socket_name="socket_0")
 

Protected 属性

void * d_
 

详细描述

在文件 socket.h16 行定义.

构造及析构函数说明

arcs::common_interface::Socket::Socket ( )
virtual arcs::common_interface::Socket::~Socket ( )
virtual

成员函数说明

int arcs::common_interface::Socket::socketClose ( const std::string &  socket_name = "socket_0")

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

Instruction

参数
socket_name
返回
Python函数原型
socketClose(self: pyaubo_sdk.Socket, arg0: str) -> int
Lua函数原型
socketClose(socket_name: string) -> nil
int arcs::common_interface::Socket::socketOpen ( const std::string &  address,
int  port,
const std::string &  socket_name = "socket_0" 
)

Open TCP/IP ethernet communication socket.

Instruction

参数
address
port
socket_name
返回
Python函数原型
socketOpen(self: pyaubo_sdk.Socket, arg0: str, arg1: int, arg2: str) -> int
Lua函数原型
socketOpen(address: string, port: number, socket_name: string) -> nil
int arcs::common_interface::Socket::socketReadAllString ( const std::string &  variable,
const std::string &  socket_name = "socket_0" 
)

Instruction std::vector<char>

参数
variable
socket_name
返回
Python函数原型
socketReadAllString(self: pyaubo_sdk.Socket, arg0: str, arg1: str) -> int
Lua函数原型
socketReadAllString(variable: string, socket_name: string) -> number
int arcs::common_interface::Socket::socketReadAsciiFloat ( int  number,
const std::string &  variable,
const std::string &  socket_name = "socket_0" 
)

Reads a number of ascii formatted floats from the socket.

A maximum of 30 values can be read in one command. A list of numbers read (list of floats, length=number+1)

Instruction

Result will be store in a register named reg_key. Use getFloatVec to retrive data

参数
number
variable
socket_name
返回
Python函数原型
socketReadAsciiFloat(self: pyaubo_sdk.Socket, arg0: int, arg1: str, arg2: str) -> int
Lua函数原型
socketReadAsciiFloat(number: number, variable: string, socket_name: string) -> number
int arcs::common_interface::Socket::socketReadBinaryInteger ( int  number,
const std::string &  variable,
const std::string &  socket_name = "socket_0" 
)

Reads a number of 32 bit integers from the socket.

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)

Instruction

std::vector<int>

参数
number
variable
socket_name
返回
Python函数原型
socketReadBinaryInteger(self: pyaubo_sdk.Socket, arg0: int, arg1: str, arg2: str) -> int
Lua函数原型
socketReadBinaryInteger(number: number, variable: string, socket_name: string) -> number
int arcs::common_interface::Socket::socketReadByteList ( int  number,
const std::string &  variable,
const std::string &  socket_name = "socket_0" 
)

Reads a number of bytes from the socket.

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)

Instruction

std::vector<char>

参数
number
variable
socket_name
返回
Python函数原型
socketReadByteList(self: pyaubo_sdk.Socket, arg0: int, arg1: str, arg2: str) -> int
Lua函数原型
socketReadByteList(number: number, variable: string, socket_name: string) -> number
int arcs::common_interface::Socket::socketReadString ( const std::string &  variable,
const std::string &  socket_name = "socket_0",
const std::string &  prefix = "",
const std::string &  suffix = "",
bool  interpret_escape = false 
)

Reads all data from the socket 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 socket. The "prefix" specifies the start of the substring (message) extracted from the socket. The data up to the end of the "prefix" will be ignored and removed from the socket. The "suffix" specifies the end of the substring (message) extracted from the socket. Any remaining data on the socket, after the "suffix", will be preserved. E.g. if the socket 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<"

Instruction

std::string

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

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

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

Instruction

参数
value
socket_name
返回
Python函数原型
socketSendByte(self: pyaubo_sdk.Socket, arg0: str, arg1: str) -> int
Lua函数原型
socketSendByte(value: string, socket_name: string) -> nil
int arcs::common_interface::Socket::socketSendInt ( int  value,
const std::string &  socket_name = "socket_0" 
)

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

Send in network byte order. Expects no response

Instruction

参数
value
socket_name
返回
Python函数原型
socketSendInt(self: pyaubo_sdk.Socket, arg0: int, arg1: str) -> int
Lua函数原型
socketSendInt(value: number, socket_name: string) -> nil
int arcs::common_interface::Socket::socketSendLine ( const std::string &  str,
const std::string &  socket_name = "socket_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 socket in ASCII coding.

Expects no response.

Instruction

参数
str
socket_name
返回
Python函数原型
socketSendLine(self: pyaubo_sdk.Socket, arg0: str, arg1: str) -> int
Lua函数原型
socketSendLine(str: string, socket_name: string) -> nil
int arcs::common_interface::Socket::socketSendString ( const std::string &  str,
const std::string &  socket_name = "socket_0" 
)

Sends a string to the server Sends the string <str> through the socket in ASCII coding.

Expects no response.

Instruction

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

类成员变量说明

void* arcs::common_interface::Socket::d_
protected

在文件 socket.h306 行定义.


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