Chapter 6 – UDP Socket Services
Multi-Tech Systems, Inc. AT Commands for Wireless Modems with IP Connectivity (S000333D)
35
#LUDPSTART Open an UDP Session in Listen Mode
Definition:
Once an IP link is established, and if no other TCP/IP stack resource is active, this command sent by
the attached host directs the TCP/IP stack to initiate the UDP session in listen mode on the specified
UDP local port UDPPORT. Depending on the UDPSERV parameter content, there are two possible
combinations:
•
If UDPSERV is 255.255.255.255, the IP address filter feature is turned off. The UDP session will be
effective upon reception of the first datagram, supplying the remote port number and the remote IP
address of the session. The host can then transmit to the (remote port or remote IP) address.
•
If UDPSERV holds a valid IP address (or existing/found alphanumeric IP address), only the remote
with the UDPSERV IP address will be authorized to send datagrams to this UDP socket (i.e., the IP
address filter feature is activated). The UDP session will be effective upon reception of the first
datagram, supplying the remote port number of the session. The host can then transmit to the
(remote port, UDPSERV) address. Datagrams can then only be received from this (remote port,
UDPSERV) address.
As long as the first datagram is not received, UDPSTOP can be issued to cancel the UDP session.
Once the first datagram has been received, the only way to stop the UDP session for the host is to
issue an <ETX> character.
Note:
The TCP/IP stack will only interpret an <ETX> character as a close request if it is not preceded
by a <DLE> character. As a consequence, an <ETX> character must be sent (even in payload data) as
<DLE><ETX>, and <DLE> character as <DLE><DLE>. The attached host must then decode the UDP
socket flow to remove these escape characters.
Values:
Read parameters:
UDPPORT
UDPSERV
UDPTXDELAY
Syntax:
AT#LUDPSTART
Command
Possible Responses
AT#LUDPSTART
Note: Active
listen mode
OK_Info_WaitingForData
Notes: This message signals that the remote allowed UDP peer has sent its first
datagram to the local UDP socket.
The UDP connection is now effective. All data from the attached host /
remote UDP peer is immediately transferred by the TCP/IP stack to the
remote UDP peer / attached host.
Attached host may close this UDP session by sending an <ETX> character.
If an error occurs, the TCP/IP stack issues and <ETX> character on the
serial port before sending the appropriate error message.
AT#LUDPSTART OK_Info_WaitingForData
...
...
...
<ETX>
OK_Info_SocketClosed
OK
Note: The UDP socket is closed.
AT#LUDPSTART #CME ERROR: <value>
Note: An error has occurred during the UDP session creation. If this error occurs
once the UDP session is effective, it is preceded by an <ETX> character.
#LUDPSTOP Close a Listening Mode UDP Session
Definition:
This command directs the TCP/IP stack to close a UDP listening mode session (previously launched by
the AT#LUDPSTART command).
Values:
Read parameters:
UDPPORT
UDPSERV
UDPTXDELAY
Syntax:
AT#LUDPSTOP
Command
Possible Responses
AT#LUDPSTOP
Note: Stop UDP listening
OK
Note:
The local listening port is closed in the TCP/IP stack.