Technical information

Direct Socket Interface
2-38 AT+i Commands Reference Manual May 31, 2008
+iSRCV - Receive a Byte Stream from a Socket's Input
Buffer
+iGPNM - Get Peer Name for a Specified Socket
Syntax: AT+iSRCV:<hn>[,<max>]
Receives a byte stream from the TCP/UDP socket specified by
the socket handle hn. Received data is valid only if it already
resides in W24's socket input buffer at the time this command is
issued.
Parameters:
<hn> A TCP/UDP socket handle of an open socket.
<max> Optionally specifies the maximum number of bytes to transfer.
Additional bytes may remain in the socket input buffer following
this command.
Command Options:
<hn> Must have been obtained by a previous execution of an
AT+iSTCP or AT+iSUDP command during the current Internet
mode session. Or a socket accepted by a listening socket.
<max> If <max> is not specified, all available bytes residing in the
socket input buffer are returned.
Returns:
I/<sz>[:<stream>][<checksum>] where,
sz is the exact size of the binary data stream to follow.
If the socket input buffer is empty, W24 returns I/O<CR><LF>.
In this case, stream is omitted.
sz is guaranteed to be equal or less-than max, when specified.
checksum is a two-byte checksum. This parameter is calculated
by W24 only when it is in checksum mode (CKSM set to '1').
checksum is calculated by summing all the characters in stream
modulo 65536 and taking two's complement of the result.
checksum is sent as big-endian. The host application is assumed
to calculate its own checksum upon receipt of stream and
compare it against the checksum bytes received from W24. If the
two checksums don't match, the host can issue an AT+i!SRCV
command, which causes W24 to re-transmit the data. The next
AT+iSRCV command that the host issues causes W24 to dump
all data transmitted to host in the previous AT+iSRCV command.
I/ERROR If <hn> is not an open socket, or otherwise some error occurred.
Syntax: AT+iGPNM:<hn>
Retrieves peer name (<IP>:<Port>) of a remote connection to a
TCP/UDP socket specified by the socket handle <hn>.
Parameters: