AT+i Programmer's Manual - SE Spezial-Electronic AG
AT+i Programmer's Manual - SE Spezial-Electronic AG
AT+i Programmer's Manual - SE Spezial-Electronic AG
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
Direct Socket Interface<br />
13.8 +iSRCV — Receive A Byte Stream from A Socket’s Input<br />
Buffer<br />
Syntax: <strong>AT+i</strong>SRCV:[,]<br />
Parameters:<br />
Command Options:<br />
Receives a byte stream from the TCP/UDP socket<br />
specified by the socket handle hn. Received data is<br />
valid only if it already resides in iChip‘s socket input<br />
buffer at the time this command is issued.<br />
A TCP/UDP socket handle of an open socket<br />
Optionally specifies the maximum number of bytes to<br />
transfer. Additional bytes may remain in the socket<br />
input buffer following this command.<br />
Must have been obtained by a previous execution of an<br />
<strong>AT+i</strong>STCP or <strong>AT+i</strong>SUDP command during the<br />
current Internet mode session. Or a socket accepted by<br />
a listening socket.<br />
If is not specified, all available bytes residing<br />
in the socket input buffer are returned.<br />
Returns:<br />
I/[:][] where,<br />
sz is the exact size of the binary data stream to follow.<br />
If the socket input buffer is empty, iChip returns<br />
I/O. In this case, stream is omitted.<br />
sz is guaranteed to be equal or less-than max, when<br />
specified.<br />
checksum is a two-byte checksum. This parameter is<br />
calculated by iChip only when it is in checksum mode<br />
(CKSM set to ‗1‘). checksum is calculated by<br />
summing all the characters in stream modulo 65536<br />
and taking two‘s complement of the result. checksum<br />
is sent as big-endian. The host application is assumed<br />
to calculate its own checksum upon receipt of stream<br />
and compare it against the checksum bytes received<br />
from iChip. If the two checksums don‘t match, the<br />
host can issue an <strong>AT+i</strong>!SRCV command, which<br />
causes iChip to re-transmit the data. The next<br />
<strong>AT+i</strong>SRCV command that the host issues causes<br />
iChip to dump all data transmitted to host in the<br />
previous <strong>AT+i</strong>SRCV command.<br />
<strong>AT+i</strong> Programmer‘s <strong>Manual</strong> Version 8.21 13-9