
Research & Development
Page
16
of
16
Revision 1.3
2002/7 From 3JTech
Flow Control
Host iChip/iChip LAN Software Flow Control
When issuing an AT+iEMB command to generate a binary Email, or an AT+iSSND
command to transfer data to a socket, the host transfers a binary data stream to the
iChip. At times, this stream may be very large. Once the iChip establishes an SMTP
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:
1. While the iChip is logging on to the Internet and establishing a connection, the host
proceeds to send its data stream to the iChip. During this time the iChip receives data
from the host, but cannot send it out.
2. When sending MIME attachments the iChip encodes the binary data, using base64.
This inflates binary data roughly in the order of 30%. Thus, more data needs to be
transmitted than is received from the host.
3. When using a TCP/IP socket, the iChip may need to retransmit packets.
The amount of buffer space available in the iChip to accommodate for this imbalance
is limited. Therefore, a flow control scheme is required to regulate host
Ù
iChip
communications. The FLW iChip/iChip LAN 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 or +iSSND
prefixes, the iChip/iChip LAN will issue 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 the iChip/iChip LAN will issue 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 may continue to transfer
the data stream within no more than 30 seconds.
3. If an error occurs during the Internet session, while the host is transferring the data
stream (or while paused), the iChip/iChip LAN will issue an ‘ERROR’ control
character, if some error occurred. Immediately after issuing this control character, the
iChip/iChip LAN will abort the Internet session and issue an ‘I/ERROR (error
number)’ string. The host must cease transmitting the data stream when the ‘ERROR’