Modem Identification
Modem identification is the initial concern for most communications
software. The communications software determines the type of modem (e.g.,
is it a Hayes modem, a high-speed modem, what features does it support ­p;
error-control or compression?) to control the commands available to the
modem. By limiting the AT command controller portion of the software to
work with a known set of modems (such as Hayes Vseries modems), you can
control the complexity of your software.
Knowing the type of modem in use allows assumptions about modem characteristics,
such as maximum transmission rate, support of Vseries AT commands or specific
commands such as L or X. This is an advantage if you are designing a general
application for an environment where you cannot assume the type of modem
in use.
The I0 - Display Product Code and I4 command
options make this process simple. The I0 response indicates the speed category
of the modem. In the initial versions of Smartmodem 1200, I0 returned the
three digit response: 120. New responses were added for modems supporting
2400 bits/s, 9600 bits/s, and other products.
The result of the I0 command is a number which identifies the category of
modem product. Some I0 values identify a unique product which has specific
behaviors. 960, for example, identifies a Vseries product capable of 9600
bits/s, which has additional commands and behaviors.
The I4 command option provides a reliable means of communicating specific
features and modulation protocols to software. The responses to the I4 command
are strings delimited by <CR>and beginning with a lowercase letter
and typically followed by a hex-character bit-map. New result strings may
be returned with those expected. Fields once designated as reserved that
held a zero may now have values assigned. The strings may also be of different
lengths than previously implemented.
The I4 command is the best way for software to determine the modem type
and capability, if the following guidelines are considered:
1. I0 or I4 commands should be issued at 1200 bits/s. All Hayes products
(including the Smartmodem 300) respond to AT commands at 1200 bits/s. Most
other brands also respond at 1200 bits/s. You can switch to a higher transmission
rate once the modem is identified.
2. Result codes should be parsed as strings surrounded by <CR>t<LF>.
The strings begin with a lower-case letter followed by up to 39 characters.
3. After all result code strings have been sent, an OK result is returned
that obeys the V and Q command settings.
4. ERROR, OK, or a numeric result in response to the I4 command should be
expected. These results may be returned by products shipped before the I4
command was introduced, or by non-Hayes products.
5. The length of the strings may be different than anticipated. If shorter
than expected, empty positions should be assumed zeros. If longer than expected,
extra characters should be ignored.
6. Some non-Hayes brand modems return unpredictable results in response
to I0 or I4 commands.
The following is an example I4 command and response:
AT E0 V1 Q0 S0=0 I4 <CR>
response:
<CR><LF>a087840C004424<CR><LF>
<CR><LF>bF60410000<CR><LF>
<CR><LF>cUS<CR><LF>
<CR><LF>m0000000001001FFFF<CR><LF>
<CR><LF>OK<CR><LF>
Note: Each I4 result is surrounded by <CR><LF> not all
responses are hex-strings and some responses may not be expected.
Click here to return to the Contents page.