RAK411 PROGRAMMING MANUAL
V1.7
COPYRIGHT ©
SHENZHEN RAKWIRELESS TECHNOLOGY CO., LTD
ETDX1603021415
38
dest_port
2
1-65535
Target port number
local_port
2
0-65535
Local port number
Description:
This command is to create a UDP port on the module and set remote IP address and
port number, if you create successful, the module will return a hexadecimal identifier that is
used to manage the connection. This command can create up to eight connections. Port
numbers are in sorted in ascending order.
Return Value:
Parameter
Bytes
Value
Description
<CODE>
2
0xB1,0x00
Response Code
<SOCKET_FLAG>
2
0--7
Socket identifier
<STATUS>
1
0
Command successful
-2
Failed to create
-3
Failed to bind
-4
Target port connection
error
4.3.4 UDP Server
Command:
rak_udp_server
Syntax:
typedef struct {
uint32_t cmd;
uint16_t dummy;
uint16_t port;
}rak_server_t;
Parameter:
Parameter
Bytes
Value
Description
cmd
4
0xB2,0x00,0x00,0x00
Command Code
dummy
2
Invalid data
port
2
1-65535
Local port number