| Hayes Command Set |
Article Index for Hayes |
Website Links For Hayes |
Information AboutHayes Command Set |
| CATEGORIES ABOUT HAYES COMMAND SET | |
| modems | |
|
Most dialup Modem s follow to a large extent the specifications of the Hayes Command Set, a specific programming language originally developed for the Hayes Smartmodem 300 baud modem. The modem initialization string consists of a series of commands. It prepares the modem for communications, setting such features as dialing mode ( Tone or Pulse ), waits, detection of the busy signal and many other settings. Newer modem communications programs reset the initializations string for users according to which menu options they have selected or according to the enabled features. With Windows or Macs, for instance, the user does not see or type these commands, or even know about them. HISTORY Prior to the introduction of the Bulletin Board System (BBS), modems typically operated on direct-dial Telephone Line s that always began and ended with a single modem at each end. The user would usually dial the phone manually before connecting, or pick it up if it rang. In a few cases the computers themselves had to call a selection of numbers, and for this task they used a separate "dialer", plugged into a different Input/output port on the computer (typically an RS-232 port). When Dennis Hayes designed his first "smart modem" in 1977, he encountered a problem that no previous modem manufacturer had faced: how to tell the modem what phone-number to dial, using only one port. One solution could have used a separate set of "command pins" dedicated to sending and receiving commands. Another could have used a signal pin indicating that the modem should interpret incoming data as a command. Instead, in order to save money, Hayes chose to re-use the existing data pins with no modification. The modem could switch itself to one of two modes: # Data Mode in which the modem sends the data to the Remote modem. (A modem in data mode treats everything it receives from the computer as data and sends it across the phone line). # Command Mode in which data is interpreted as commands to the Local modem (commands that the local modem should execute). To switch from data to command mode an Escape Sequence string of three plus signs ("+++") followed by a pause of about a second was sent (to go to the command mode without losing the connection), and to switch back you sent the ''online'' command, O. In actual use many of the commands automatically switched to the online mode after completion, and it is rare for a user to use the online command explicitly. This use of In-band Signalling leads to a potential serious problem: what if the data being sent in data mode contains three plus signs? This could happen randomly quite easily, and it would happen any time someone attempted to send data describing the system – this document for instance. In order to reduce the chance of this problem the pause at the end of the escape sequence was required, if any other data was received within one second of the three plus signs, it was not the escape sequence and would be sent as-is. The command set includes commands for various phone-line manipulations, dialing and hanging up for instance. It also includes various controls to set up the modem, including a set of ''register commands'' which allowed the user to directly set the various memory locations in the original Hayes modem. The command set was copied largely verbatim, including the meaning of the registers, by almost all early 300 baud modem manufacturers, of which there were quite a few. The expansion to 1200 and 2400 baud required the addition of a small set of new commands, some of them prefixed with a & to denote those dedicated to new functionality. However Hayes was slow to move to higher speeds or the use of compression, and three other companies led the way here – Microcom , U.S. Robotics and Telebit . All three used their own additional command sets instead of waiting for Hayes to lead the way. Soon a plethora of new models appeared, including new ones from Hayes, following one sort of standard or another. Things became simpler again during the widespread introduction of 14.4 and 28.8 kbaud modems in the early 1990s. Slowly a set of commands based heavily on the original Hayes extended set using "&" commands became popular, and then universal. The only other command-set still popular, the US Robotics set, has survived due to the popularity of US Robotics devices. The command set was unprotected, but the concept of a "guard time" after the escape sequence was patented. In the late 1980s Hayes started enforcing the patent, charging $1 per modem that used it. Many later modems thus did not implement the guard time; this eventually (when modems began to be used to dial up to the Internet) led to a nasty denial-of-service attack involving an ICMP echo request ("ping") packet containing three plusses and ATH, the hangup command. EXAMPLE SESSION The following represents two computers, computer A and computer B, both with modems attached, and the user controlling the modems with Terminal Emulator software. Terminal emulator software typically allows the user to send Hayes commands directly to the modem, and to see the responses. In this example, the user of computer A makes the modem dial the phone number of modem B at phone number 555-1234. Note that after every command and response, there is a Carriage Return sent to complete the command. Modem A Modem B User at modem A issues dial command. ATDT5551234 Modem A begins dialing. Modem B's phone line rings, and the modem reports it. ''RING'' Computer at modem B issues answer command. ATA The modems connect, and both modems report ''"connect"''. (In practice, most modems report more information after the word CONNECT specifying the speed of the connection.) Also, at this time, both modems will raise the DCD, or Data Carrier Detect signal, on the serial port. ''CONNECT CONNECT'' When the modems are connected, any characters typed at either side will appear on the other side. The person at computer A starts typing. The characters pass through the modem and appear on computer B's screen. (User A may not see his own typed characters depending on the Duplex setting). abcdef ''abcdef'' The person at computer B issues the modem escape command. (Alternately, and more commonly, the computer B could drop the DTR, or Data Terminal Ready signal, to achieve a hangup, without needing to use +++ or ATH.) +++ The modem acknowledges it. ''OK'' The person at computer B issues a hang up command. ATH Both modems acknowledge the connection has ended. Modem B says OK because that's the expected result of the command; modem A says NO CARRIER to report the connection was interrupted from the remote side. The modems on both sides drop their DCD signals as well. ''NO CARRIER OK'' DESCRIPTION The following is a partial list of the Hayes command set. (also called the AT commands, AT is short for ''attention''). The Hayes Command Set can be divided into four groups:
A ''register'' is a specific physical location in memory. Modems have small amounts of memory onboard. This fourth set of commands is used to enter values in a particular register (memory location). The register will be storing a particular variable (alpha-numeric information) which is utilized by the modem and communication software. For example, S7=60 instructs your computer to “Set register #7 to the value 60”. Although most commands are defined by a letter-number combination (L0, L1 etc.), the use of a zero is optional. In this example, L0 is the same as a plain L. Keep this in mind when reading the table below. Here are some of the most important characters that may appear in the modem initialization string. These characters normally should not be changed.
When in data mode an Escape Sequence is used to return the modem to command mode. The normal escape sequence is three plus signs ("+++"), and to disambiguate it from possible real data, a guard timer is used: it must be preceded by a pause, not have any pauses between the plus signs, and be followed by a pause; by default a "pause" is one second and "no pause" is anything less. COMPATIBILITY While the original Hayes command set was a huge leap forward, with time many problems set in, almost none of them due to Hayes per se:
For example, setting up hardware or software handshaking often required many different commands for different modems. This undermined the handy universality of the basic "AT" command set.
As a result of all this, Eventually many comm programs had to give up any sense of being able to talk to all "hayes compatible" modems, and instead the programs had to try to determine the modem type from its responses, or provide the user with some option whereby they could enter whatever special commands it took to coerce this particular modem into acting properly. THE BASIC HAYES COMMAND SET VOICE COMMAND SET Main article: Voice Modem Command Set Modems with voice or answering-machine capabilities support a superset of these commands to enable digital audio playback and recording. SEE ALSO EXTERNAL LINKS
|
|
|