WM620 AT
Command Manual
Copyright © Neoway Technology Co., Ltd
88
9.10 Sending UDP Data: +UDPSEND
Description
To send UDP data
The module will returns > after this command is sent. Send UDP data 50 ms to 100
ms later.
Format
AT+UDPSEND=<n>,<length><CR>
Parameter
<n>: Socket number, ranging from
0
to
5
. A UDP connection is established on the
socket.
<length>: The length of the data to be sent, ranging from 1 to 1024, unit: byte.
Return Value
If the AT command is input in correct format, the module returns >.
If the command is input in incorrect format, the module returns
ERROR
.
If the connection has not been set up, the module returns
+UDPSEND:ERROR
.
After entering the command, input the data to be sent until the module
returns >.
If the UDP data is sent successfully, the module returns
+UDPSEND:<n>,<length>
.
<length>
indicates the length of data already
sent.
Example
AT+UDPSEND=0,2
>12
OK
+UDPSEND:0,2
Send 2-byte data on socket 0. Then
send the characters to be sent 50 ms
to 100 ms after the module returns >.
The UDP data is sent successfully.
AT+UDPSEND=1,10
>
+UDPSEND:Error!TimeOut
10 seconds timed out. No data is input.
The module returns ERROR.
Remarks
Ensure that the UDP connection has been set up before sending UDP data.
9.11 Receiving UDP Data: +UDPRECV
Description
To receive UDP data
Format
+UDPRECV:<n>,<length>,<data><CR>
Parameter
<n>: Socket number, ranging from
0
to
5
<length>: The length of the data received
<data>: The data received