Technical information

Flow Control
2-66 AT+i Commands Reference Manual May 31, 2008
Flow Control
Host -> W24 Software Flow Control
When issuing an AT+iEMB command to generate a binary e-mail, an AT+iSSND command to
transfer data to a socket, an AT+iTBSN to send a binary stream to a Telnet server, or an
AT+iFSND command to transfer a file, the host transfers a binary data stream to W24. At times,
this stream may be very large.
Once W24 establishes a connection, it acts as a pipeline, transferring data received from the host
to the Internet. However, the data rates at the host and Internet ends are not always balanced. This
happens for several reasons:
While W24 logs onto the Internet and establishes a connection, the host proceeds to send its
data stream to W24. During this time W24 receives data from the host, but cannot send it out.
When sending MIME attachments, W24 encodes the binary data using base 64. This roughly
inflates binary data by 30%. Thus, more data needs to be transmitted than is received from
the host.
When using a TCP/IP socket, W24 might need to re-transmit packets.
The amount of buffer space available in the W24 to accommodate for this imbalance is limited.
Therefore, a flow control scheme is required to regulate host<->W24 communications. The FLW
parameter is set to reflect the preferred flow control mode.
The software-driven flow control protocol is defined as follows:
1. While the host is transferring the binary stream,following the +iEMB, +iSSND, or +FSND
prefixes, W24 issues a 'WAIT' control character when it needs to pause the host. The host
application is required to monitor its serial receive line and pause the transmission when a
'WAIT' control character is received.
2. To resume the host transmission, W24 issues a 'CONTINUE' control character. The host is
required to monitor its receive line after being paused in anticipation of this control
character. Once received, the host might continue to transfer the data stream.
3. If an error occurs during the Internet session while the host is transferring the data stream (or
while paused), W24 issues an 'ERROR' control character if some error occurred.
Immediately after issuing this control character, W24 aborts the Internet session and issues
an 'I/ERROR (error number)' string. The host must cease transmitting the data stream when
the 'ERROR' control character is received.
The control characters are given in Table 2-4.
Table 2-4: Software Flow Control Characters
Control ASCII Dec ASCII Hex Mnemonic
WAIT 22 0x16 SYN
CONTINUE 24 0x18 CAN
ERROR 5 0x5 ENQ