The Hayes protocol simulates the use of the Hayes-compatible telephone modem, and uses standard AT commands. Some AT commands have no sense in the radio modem and are therefore ignored, although the radio modem does returns an OK to them (e.g. ATWn, AT&Nn). It is used for substituting a telephone line.
The Hayes protocol uses maintenance packets for finding out if one of the stations has been forcibly disconnected. In the case of a loss of the connection the protocol terminates the connection.
The Hayes protocol uses these signals of the RS-232C interface: Rx,
Tx, RTS, CTS, DTR, DSR and CD. The RI signal is not used. RTS and CTS
signals are used as a hand shake (if set up in the
The Hayes protocol is not suitable (due to large overheads) for short transmissions, when transmitting small volumes of data, because at least one exchange of overhead packets is required for making a connection.
Controlling and setting up all values is carried out:
by the user using the terminal (using AT commands), examples:
AT<CR> it is 0x41 54 0D or: AT<CR><LF> it is 0x41 54 0D 0A response: <CR><LF>OK<CR><LF> it is 0x0D 0A 4F 4B 0D 0A more complex AT command: ATD1234<CR> it is 0x41 54 44 31 32 33 34 0D
Characters in commands can be written in lower and upper case, decimal numbers or 0x hex.
using service access – SETR (by directly setting S-registers)
See chapterSection 4, “Configuration Parameters”
DTE – Data Terminal Equipment.
The Hayes protocol is configured using AT command or by setting the S-registers.
The radio modem can be in two defined states –
OFF LINE – the modem is hung up
ON LINE – the modem is connected, and here we define two states –
AT commands used in the radio modem –
|+++||transition from ON LINE – transmission of data to the command mode, connection not interrupted, return to ON LINE status – transmission of date by ATO command|
|A/||repeats the previous command|
|AT?1||help screen No.1|
|AT?S||returns the S-register values|
|ATQ0||response to commands on|
|ATQ1||response to commands off|
|ATV0||numerical response to command set (e.g. 1), also S14, bit 0x04|
|ATV1||character response to command set (e.g. Connect)|
|ATE0||local echo off, also S14, bit 0x01|
|ATE1||local echo on|
|ATI,I0||returns own number (network address)|
|ATDn||calls entered “n” address, after CONNECT switches to ON LINE – data transmission|
|ATDn;||calls entered “n” address, after CONNECT remains in command mode, does not switch to ON LINE – data transmission (switches to it after ATO or ATO0)|
|ATH,H0||cancels connection (before ATH it must switch from ON LINE – transmission of date to command mode +++), switches to OFF LINE|
|ATO,O0||return from command mode to ON LINE – data transmission|
|ATA||“manual” response to call (if S0=0)|
|AT&C0||signal CD in MR25 is still ON, i.e. S14 bit 0x2=1|
|AT&C1||signal CD in CU switches according to state of connection, i.e. S14 bit 0x2=0 (ON LINE CD=ON, OFF LINE CD=OFF)|
|ATZ||termination of connection, renewal of protocol user profile FLASH memory, reset of protocol|
|AT&F||sets default parameters (S-registers) in Hayes protocol “Set default configuration profile”|
|AT&D0||ignores DTR status, S14 bit 0x10=0|
|AT&D2||for DTR->OFF:, hangs up, command mode, automatic response off, i.e. S14 bit 0x10=1|
|AT&V||returns S-register values in RAM (active profile) and FLASH (stored profile)|
|ATSn=y||sets S-register n to value y|
|ATSn?||Returns register value n|
|ATXn||Selection of set of possible return codes (significant if S14 0x08=1, i.e.permitted response)|
|S0||S0=0 is not picked up automatically, an ATA command must arrive|
|S0 > 0 the autoanswer function is switched on after the first RING tone|
|S2||Escape code character – ESC – special character, used for switching from ON LINE to OFF LINE, default „+“ 2BH (043)|
|S3||Carriage return character – CARRIAGE RETURN, default ODH (013)|
|S4||Linefeed character – LINE FEED, default 0AH (010)|
|S5||Backspace character – BACKSPACE, default 08H (008)|
|S7||Connect timeout (sec.) – part of the time (added to the time defined by registed S29) over which the modem waits for a response to a call for making a connection. If by the time S7+S29 no response CONNECT arrives from the called modem, the modem sends a NO ANSWER message to the connected DTE|
|S10||Carrier loss hangup timeout (10 sec.) – time in tens of seconds after which the connection is automatically terminated, if there is no communication, e.g. due to a loss of the radio connection. If it is set to 0, the connection is not terminated automatically (it is configured on the calling modem side)|
|S12||Escape code quard time (1/50 sec.) – time delay in tens of milliseconds before and after the sequence of three ESC commands for converting the modem from ON LINE – transmission of data to the command mode|
|S14||Flags– command echo, resulting code S14|
|S15||S15=n ~ ATXn Set of return codes.|
|S29||Dial delay (1/10 sec.) dial delay between RING and CONNECT sec/10 configured on the calling modem side)|
There is no sense in setting up other registers in the radio modem.
There are 5 sets of return codes (X0, X1, X2, X3 and X4) in register S15 . There settings are given in the table.
Return codes are only displayed if they are permitted, i.e. response to commands – ATQ0 is on.
ATV0/ATV1 – numerical/character response
Switching on the modem
After connecting the supply voltage the radio modem is set to the command mode and configuration parameters stored permanently in memory are uploaded. In this state the modem accepts commands and communicates only with the connected computer. The CD signal is not active. In this state the required configuration can be set up.
Making a connection without the autoanswer function
We can make a call for a connection using command ATDn, where n is the address of the called radio modem. If the called radio modem is prepared for communication it sends RING information to its computer which means that it has been called. After executing command ATA (if no autoanswer is set) on the called computer the calling radio modem is informed about the connection that has been made and sends CONNECT information to its computer. ATA needs to be sent by time S29, otherwise the connection will not be made. After sending command ATA the period in register S29 is counted again (from the beginning irrespective of how much time has elapsed), and after it has elapsed CONNECT information is sent.
Register S0=0 – without the autoanswer function. An ATA command is necessary for making a connection.
Making a connection with the autoanswer function
Register S0>0 – with the autoanswer function. The calling radio modem accepts a connection automatically without the need to enter an ATA command. A RING occurs only once, irrespective of how many “rings” are set in register S0.
The called radio modem is informed by a return message that confirmation has been received and the called radio modem also sends CONNECT information to its computer. CONNECT information is sent upon expiry of the period set in register S29. At this moment the radio modem comes ON LINE – data transmission, activates the CD signal and is capable of communicating with its reciprocal radio modem.
Radio modem not responding
If the called radio modem does not respond within the time given by the sum of registers S7+S29, the calling modem according to registers S7+S29 returns NO ANSWER information to the computer. This state also applies to the situation where the modem does not respond and also to the situation when DTE does not respond.
If the called radio modem has already made a connection with another radio modem we receive a BUSY reply on calling for a connection.
Switching to command mode
In the state ON LINE – data transmission all characters that the computer sends to the modem are transferred to the reciprocal radio modem. An exception is a sequence of three ESCAPE characters, which switch the radio modem from the ON LINE – data transmission state to the command mode (command mode – communication with the mode commences by means of AT commands without the need to interrupt the connection). Before and after this sequence there must be at least the space set in register S12. If the radio modem was switched to command mode, the connection was not interrupted, and then back to the ON LINE – data transmission state it is possible to get using command ATO Pokud byl radiový modem přepnut do příkazového módu, nebylo spojení přerušeno a zpět do stavu ON LINE – přenos dat je možné se dostat příkazem ATO.
Terminating a connection
A connection can be terminated either by setting signal DTR OFF (AT&D2) or sending a command ATH, ATH0. If we want to terminate a connection using a command it is first necessary to set the radio modem to the command mode. In the command mode we can terminate a connection using command ATH or ATH0. Termination of a connection on one radio modem is transmitted to a second radio modem. A message about termination of the connection is sent to the second radio modem and this radio modem sends NO CARRIER information to the connected computer. Both radio modems switch to the OFF LINE state. After termination of the connection it is possible to make a connection with another radio modem.
If a radio connection is lost both protocols carry out termination of the connection independently after the set timeout. Timeout for recognising a loss of connection is set in register S10. If register S10=0 the connection is not checked. For recognising a radio connection loss maintenance packets are used. Maintenance packets are sent if no user communication takes place and they are sent by both modems independently. Maintenance packets are always sent at the end of time S10/3 from both sides. If communication is interrupted a NO CARRIER command is sent to both modems upon expiry of period S10. Both radio modems switch to the OFF LINE state.
S registers S10 and S29 are configured on the calling modem side so that it is possible to ensure a relationship to other parameters. These values are sent in a BEL packet to the called modem.
Types of Hayes protocol packets
|Meaning of packet||Morse data packet (typ 0A)|
|BEL||0x02 + S10 + S29|
The Hayes protocol can be configured –
using AT commands (see help AT?, AT?1, AT?S)
in the modem menu
SPe0tit is possible to set up a default set of S-registers using the command
set de(f)ault, or some of the user sets of S-registers using the appropriate command. Individual S-registers can also be set up separately.
Register values in SETR are displayed in hexadecimal but are entered in decimal.
This setting is stored either in FLASH memory using the
(w)ritecommand, or is activated using the
(I)nitcommand. If these parameters are not initialised the protocol will not work with them.
HAYES parameters: set de(f)ault, best of: (g)alaxy, (H)oneywell master (h)oneywell slave S registers: 01 00 2B 0D 0A 08 00 0C 00 00 06 00 32 00 04 04 00 00 00 00 00 00 00 00 00 00 00 00 00 0A 00 ATE0 AT&C1 ATV1 ATQ0 AT&D0 ATX4 (SXX=YY) (a)ddress:00000000h (c)mdmode:0001h (s)tate:0000h hang (r)eason:0000h (m)ode:0000 (C)RLF timeout:0000ms (D)irect DCD:0000 (q)uit >>
Meaning of parameters –
Pre-set S-registers –
Default parameters –
HAYES parameters: set de(f)ault
Pre-set S-registers for special applications –
best of: (g)alaxy, (H)oneywell master (h)oneywell slave
Register values in individual pre-settings –
Register default Honeywell master honeywell slave galaxy S0 01 01 00 04 S2 2B 2B 2B 2B S3 0D 0D 0D 0D S4 0A 0A 0A 0A S5 08 08 08 08 S7 0C 0C 0C 0C S10 06 06 06 06 S12 32 32 32 32 S14 04 10 14 10 S15 04 00 04 04 S29 0A 00 00 32
S registers: 01 00 2B 0D 0A 08 00 0C 00 00 06 00 32 00 04 04 00 00 00 00 00 00 00 00 00 00 00 00 00 0A 00 ATE0 AT&C1 ATV1 ATQ0 AT&D0 ATX4 (SXX=YY)
ATE0 AT&C1 ATV1 ATQ0 AT&D0– distributed register S14
ATX4– register S15
Status of connection (does not set up, just shows current status of communication)
(a)ddress:00000000h (c)mdmode:0000h (s)tate:0000h hang (r)eason:0002h (m)ode:0000
(a)ddress:00000000h– address of modem with which there is (was) a connection
0 - line– ON LINE mode – data transmission
1 - command– command mode
(s)tate:0000h– state the modem is in
0 - off line– hung up
1 - on line– connected from local station
2 - rmt on line– connection was called up by the other side (see address)
3 - connecting
4 - rmt connecting– attempt to connect initialised by other side
5 - hanging up
hang (r)eason:0000h– reason for cancelling connection (0,1,2,3 and 7), or not making connection (4,5 and 6)
0-init– initialisation of protocol
1-rmt– hung up from other side
2-loc– hung up locally (ATH)
3-carrier loss– after switching off radio modem
5-ata wait– ATA wait time elapsed
6-dial– S07 time elapsed (connect timeout)
7-dtr– signal DTR OFF (locally)
(m)ode:0000– special setting (default settings recommended)
(C)RLF timeout:0000ms– if a non-zero timeout is set packets are only sent if CLRF arrives or if the set timeout elapses
(D)irect DCD:0000– on setting the DCD signal do not wait for S29 (dial delay) to elapse
(D)irect DCD:0001– signal DCD is set up after ATDx (x = any character)
(D)irect DCD:000L– signal DCD is set up after ATDL (signal DCD is set up after sending the set character for ATD)