Serial Programming/Modems and AT Commands/Commands A - M

From Wikibooks, open books for an open world
Jump to navigation Jump to search

Serial Programming: Introduction and OSI Network Model -- RS-232 Wiring and Connections -- Typical RS232 Hardware Configuration -- 8250 UART -- DOS -- MAX232 Driver/Receiver Family -- TAPI Communications In Windows -- Linux and Unix -- Java -- Hayes-compatible Modems and AT Commands -- Universal Serial Bus (USB) -- Forming Data Packets -- Error Correction Methods -- Two Way Communication -- Packet Recovery Methods -- Serial Data Networks -- Practical Application Development -- IP Over Serial Connections

Hayes-compatable Modems and AT Commands References: -- Special AT Commands and Character Sequences -- AT Commands A - M -- AT Commands N - Z -- AT& Commands

AT Commands A - M[edit | edit source]

This module explains the AT commands A to M as used by a "generic" Hayes-compatible modem. Different modems use slightly different commands. However, this list is supposed to be as "generic" as possible, and should not be extended with modem-specific commands. Instead it is recommended to provide such command lists in an Appendix.

A: Answer Command[edit | edit source]

Syntax:

A

Description:

The command initiates handshake as answering side. No next commands in this command line are proceeded. If handshake succeeds, modem sends successful message ("CONNECT...") to serial line and serial line switches to data mode, otherwise failure message is sent and serial line remains in command mode.

Result Codes:

Result Codes
Code Description
CONNECT Handshaking succeeds
NO CARRIER Handshake failed

CONNECT message usually contains speed, protocol and other details of succeeded connection and may be preceded with other messages of connection details.

Related Commands and Registers:

B: Select Communication Standard[1][edit | edit source]

Syntax:[1]

B[0|1]    (original Hayes)
B[number] (extensions)

Description:

In original Hayes modems, it selects protocols for 300bps and 1200bps handshake: B0 selects CCITT protocols; B1 selects Bell protocols.

Some vendors (e.g. Rockwell) extends it to limit connection speed (e.g. B15 - no more than 28800 bps).

Result Codes:

Result Codes
Code Description
OK Speed/protocol selection succeeded
ERROR Speed/protocol selection failed

Related Commands and Registers:

  • A: Answer
  • D: Dial
  • +MS: Speed and protocol selection

C: Carrier Control Selection[edit | edit source]

Syntax:

'''ATC0''' The carrier detect (CD) override is always on (default)
'''ATC1''' The modem sends the carrier detect signal when it makes connection
         with another modem and drops the signal when it disconnects.

Description:

Controls the carrier detect signal sent by the modem to the computer. .

DTE Interface:

If AT&C1, the carrier detect enters into a true state when a connection is made. The carrier detect returns to a false state after the connection is dropped.

Aborting Events:

None

Related Commands and Registers:

D: Dial Command[edit | edit source]

Syntax:

D [T|P|digits|misc]

Description:

The command initiates dialing a number using pulse or tone dialing. The dial string can be rather flexible. Almost all of the modem's default settings can be overridden in the dial string. Dialing is controlled by providing dial modifiers after the D command.

Dial Modifiers:

0-9
Digits. This results in the corresponding DTMF tone being sent (tone dialing), or the corresponding number of pulses (pulse dialing) being sent.
A-D, #, *
(Tone dialing only) Tone dialing supports six more characters, which can be dialed in addition to the numbers 0-9. However, these characters can trigger special functions in the telephone network and should only be used if their function is required in a particular network.
NOTE, one of the nastiest things which can be triggered in some public networks with these characters is a test of the tariff time switch. The test consists of a rapid increase of the counter, which can end up at the phone bill as a huge debt.
P
Pulse Dialing Modifier. Indicates that all following numbers should be dialed using pulse dialing, until a T modifier is encountered. The modifier is persistent. It not only affects the current dialing, but also any other dialing (until a T modifier is encountered or the modem is reset).
T
Tone Dialing Modifier. Indicates that all following numbers should be dialed using DTMF dialing, until a P modifier is encountered. The modifier is persistent. It not only affects the current dialing, but also any other dialing (until a P modifier is encountered or the modem is reset).
W
Wait for Second Dial Tone. This is useful when working behind a PABX. Typically to dial out from behind a PABX it is first necessary to seize an external line by dialing a special number, and then waiting for the public line's dial tone before continuing.
,
Delay. The modem will pause for the delay configured in register S8 before continuing dialing. This is useful when dealing with old, slow mechanical telephone equipment, as well as working in special PABX configurations. Some PABX need some time to seize a line, but provide no progress indication when they have done so. Note, if a second dial tone is provided, then the W modifier is a much better choice over the , modifier.
@
Wait for Silence. This is another modifier which is helpful in dealing with special PABX configurations. The modem waits for at least five seconds of silence before continuing dialing. Silence is defined as no signal in the call progress indication frequency band, not as absolute silence (not as absence of line noise).
If the modem doesn't detect these five seconds of silence prior to the expiration of the S7 call abort timer, the modem stops the dialing (call abortion), and returns a NO ANSWER result code. This is somewhat counter intuitive, since the modem is waiting for silence as an answer. If busy detection is enabled, some modems return a BUSY answer code instead. Which is also arguable.
If an answer tone from some remote modem arrives while waiting for the five seconds of silence, the modem initiates the handshake procedure and aborts dialing. If the handshake succeeds the modem is on-line.
!
Flash. A flash is a special signal send to some telephone equipment, like a phone exchange. The flash is send by (ab)using the hook. The modem goes on-hook for a specific time. That time is exchange-equipment / telecom-standard specific. It has to be shorter than the on-hook time which is interpreted by the exchange as call/dialing abortion. The flash time can be configured via the modem's S29 register. Some PABX require a flash if they are supposed to seize a public line.
;
Return to Command State after Dialing. This modifier indicates the end of the dialing, but instead of requesting the modem to go into the call progress state, the modem will return to the command line. This enables additional AT commands to be sent to the modem while it is still off-hook. These additional commands may be placed after the ; on the same command line, or can be sent on additional command lines.
To continue the call, an additional dial command, e.g. a single ATD<CR> needs to be sent, which will transition the modem's state to enter call progress.
Alternatively, the call can be aborted by sending the on-hock command ATH0<CR>.
S=n
Dial Stored Telephone Number. Dial one of four (n = 0 ... 3) telephone dial strings. See the &Z command for how to store a number in the modem.
R
Originate Call in Answer Mode. Originate the call, but behave as being called instead. The modem expects that handshake negotiation is reversed. This is often not implemented in today's modems, and the modifier is ignored.

Modern modems accept and support a number of additional modifiers.


Clipboard

To do:


E: Command State Character Echo Selection[edit | edit source]

Syntax:

E[0|1]

Description:

Switches character echo on (1) or off (0) when in the command state. Given no argument, assumes 0.

Character echoing is usually not desired when controlling a modem via some software program. It is useful for debugging purposes, and when the modem is controlled manually, e.g. via some generic terminal program.

Result Codes:

Result Codes
Code Description
OK Parameter was valid
ERROR Bad number specified; must be either 0 or 1.

F: On-line State Character Echo Selection[edit | edit source]

Command Description Template

Syntax:

<The syntax of the command, when necessary in EBNF>

Description:

<Description of the command, including information about the purpose and effects>

Result Codes:

Result Codes
Code Description
OK Parameter was valid <description of success>
ERROR Otherwise <description of failure>

Related Commands and Registers:

  • <Link list of related commands and registers>

H: Hook Command Options[edit | edit source]

Syntax:MiscModemState.java

H[0|1]

Description:

Controls if the modem goes on-hook (disconnects from the phone line), or off-hook (connects to the phone line). The wording is taken from normal telephone usage, where someone takes the handset off the hook (off-hook) when intending to place a call. The terminology is counter-intuitive for modems, since off-hook indicates the modem goes on-line, and on-hook indicates the modem goes off-line.

H

or

H0
The modem will release the phone line (going on-hook) if the modem is currently on-line (off-hook). The command is also typically used to terminate a modem's self-test or automatic line test mode - if provided by a particular modem. The modem will go into command mode after the command. In order to issue the command while on-line, and while not in command mode, the escape code sequence need to be sent prior to the command, to force the modem in command mode first.
H1
If on-hook (off-line), the modem will go off-hook (on-line), and remain in command mode. Typically, the next command in command mode is a D dial command. If the inactivity timer S7 expires while off-hook, the modem goes back on-hook (off-line). This behavior prevents accidental blocking of a phone line by broken DTE software which manages to go off-hook but for whatever reason doesn't use the seized line.

Result Codes:

Result Codes
Code Description
OK Parameter was valid.
ERROR Otherwise.

Related Commands and Registers:

  • A: Answer
  • D: Dial

I: Internal Memory Tests[edit | edit source]

Command Description Template

Syntax:

<The syntax of the command, when necessary in EBNF>

Description:

<Description of the command, including information about the purpose and effects>

Result Codes:

Result Codes
Code Description
OK Parameter was valid <description of success>
ERROR Otherwise <description of failure>

Related Commands and Registers:

  • <Link list of related commands and registers>

L: Speaker Volume Level Selection[edit | edit source]

Command Description Template

Syntax:

<The syntax of the command, when necessary in EBNF>

Description:

<Description of the command, including information about the purpose and effects>

Result Codes:

Result Codes
Code Description
OK Parameter was valid <description of success>
ERROR Otherwise <description of failure>

Related Commands and Registers:

  • <Link list of related commands and registers>

M: Speaker On/Off Selection[edit | edit source]

Syntax:

M[0|1|2|3]

Description:

0
switches the internal speaker always off.
1
switches the internal speaker off when connected and on otherwise.
2
switches the internal speaker always on.
3
switches the internal speaker on when not connected or during retrains, and off during normal connection.

Some vendors add additional modes.

Result Codes:

Result Codes
Code Description
OK Speaker mode setting succeeded.
ERROR Speaker mode setting failed.

Related Commands and Registers:

  • L: Set internal speaker loudness

Serial Programming: Introduction and OSI Network Model -- RS-232 Wiring and Connections -- Typical RS232 Hardware Configuration -- 8250 UART -- DOS -- MAX232 Driver/Receiver Family -- TAPI Communications In Windows -- Linux and Unix -- Java -- Hayes-compatible Modems and AT Commands -- Universal Serial Bus (USB) -- Forming Data Packets -- Error Correction Methods -- Two Way Communication -- Packet Recovery Methods -- Serial Data Networks -- Practical Application Development -- IP Over Serial Connections

Hayes-compatable Modems and AT Commands References: -- Special AT Commands and Character Sequences -- AT Commands A - M -- AT Commands N - Z -- AT& Commands

  1. use this group