RUI3 (RAK Unified Interface 3) - RAK4631
bg77::qiopen

Public Member Functions

String set (int, int, String, String, int)
 
String set (int, int, String, String, int, int)
 
String set (int, int, String, String, int, int, int)
 

Member Function Documentation

◆ set() [1/3]

String set ( int  ,
int  ,
String  ,
String  ,
int   
)
Description
This api opens a socket service.
Syntax
bg77.qiopen.set(contextID,connectID,service_type,IP_address/domain_name,remote_port)
Parameters
contextIDint Integer type. Context ID. Range: 1–16
connectIDint Integer type. Socket service index. Range: 0–11.
service_typeString String type. The socket service type.
  • "TCP" Start a TCP connection as a client
  • "UDP" Start a UDP connection as a client
  • "TCP LISTENER" Start a TCP server to listen for TCP incoming connections
  • "UDP SERVICE" Start a UDP service
IP_addressString String type.
  • If <service_type> is "TCP" or "UDP", it indicates the IP address of remote server,such as "220.180.239.212".
  • If <service_type> is "TCP LISTENER" or "UDP SERVICE", enter "127.0.0.1".
domain_nameString String type. Domain name address of the remote server.
remote_portint Integer type. Port number of the remote server. Range: 0–65535.
  • If <service_type> is "TCP" or "UDP", this parameter must be specified. Range: 1–65535.
  • If <service_type> is "TCP LISTENER" or "UDP SERVICE", specify this parameter as 0.
Returns
String response

◆ set() [2/3]

String set ( int  ,
int  ,
String  ,
String  ,
int  ,
int   
)
Description
This api opens a socket service.
Syntax
bg77.qiopen.set(contextID,connectID,service_type,IP_address/domain_name,remote_port,local_port)
Parameters
contextIDint Integer type. Context ID. Range: 1–16
connectIDint Integer type. Socket service index. Range: 0–11.
service_typeString String type. The socket service type.
  • "TCP" Start a TCP connection as a client
  • "UDP" Start a UDP connection as a client
  • "TCP LISTENER" Start a TCP server to listen for TCP incoming connections
  • "UDP SERVICE" Start a UDP service
IP_addressString String type.
  • If <service_type> is "TCP" or "UDP", it indicates the IP address of remote server,such as "220.180.239.212".
  • If <service_type> is "TCP LISTENER" or "UDP SERVICE", enter "127.0.0.1".
domain_nameString String type. Domain name address of the remote server.
remote_portint Integer type. Port number of the remote server. Range: 0–65535.
  • If <service_type> is "TCP" or "UDP", this parameter must be specified. Range: 1–65535.
  • If <service_type> is "TCP LISTENER" or "UDP SERVICE", specify this parameter as 0.
local_portint Integer type. Local port number. Range: 0–65535.
  • If <service_type> is "TCP LISTENER" or "UDP SERVICE", this parameter must be specified. Range: 1–65535.
  • If <service_type> is "TCP" or "UDP", this parameter can be omitted and the default value is 0. The local port will be assigned automatically if <local_port> is 0. Otherwise the local port is assigned as specified.
Returns
String response

◆ set() [3/3]

String set ( int  ,
int  ,
String  ,
String  ,
int  ,
int  ,
int   
)
Description
This api opens a socket service.
Syntax
bg77.qiopen.set(contextID,connectID,service_type,IP_address/domain_name,remote_port,local_port,access_mode)
Parameters
contextIDint Integer type. Context ID. Range: 1–16
connectIDint Integer type. Socket service index. Range: 0–11.
service_typeString String type. The socket service type.
  • "TCP" Start a TCP connection as a client
  • "UDP" Start a UDP connection as a client
  • "TCP LISTENER" Start a TCP server to listen for TCP incoming connections
  • "UDP SERVICE" Start a UDP service
IP_addressString String type.
  • If <service_type> is "TCP" or "UDP", it indicates the IP address of remote server,such as "220.180.239.212".
  • If <service_type> is "TCP LISTENER" or "UDP SERVICE", enter "127.0.0.1".
domain_nameString String type. Domain name address of the remote server.
remote_portint Integer type. Port number of the remote server. Range: 0–65535.
  • If <service_type> is "TCP" or "UDP", this parameter must be specified. Range: 1–65535.
  • If <service_type> is "TCP LISTENER" or "UDP SERVICE", specify this parameter as 0.
local_portint Integer type. Local port number. Range: 0–65535.
  • If <service_type> is "TCP LISTENER" or "UDP SERVICE", this parameter must be specified. Range: 1–65535.
  • If <service_type> is "TCP" or "UDP", this parameter can be omitted and the default value is 0. The local port will be assigned automatically if <local_port> is 0. Otherwise the local port is assigned as specified.
access_modeint Integer type. Data access mode of the socket service.
  • 0 Buffer access mode
  • 1 Direct push mode
  • 2 Transparent transmission mode
Returns
String response