Fax Modem (250-3581) Fax Class 1 Operation Faxback Doc. # 5882 4.1 FAX I/O PROCESSING The fax I/O Interface supports asynchronous serial and parallel interfaces. The interface rate is 19200 bps. Start and stop elements are removed from the transmit data, and added to the receive data. Both transmit and receive data is buffered. Flow control using XON/XOFF (DC1/DC3) or RTS/CTS is provided. Unique control character strings are identified, filtered, or reinserted into the I/O data stream. These control characters and their resultant action are described below. 4.1.1 DTE TO FAX MODEM TRANSMIT DATA STREAM Characters Detected Action Taken Recognize as a string terminator, and take appropriate action. Replace with single character. 4.1.2 FAX MODEM TO DTE RECEIVE DATA STREAM Characters Detected Action Taken Insert extra ahead of . The FAX Modem also identifies the end of a frame by inserting into the data stream after the FCS bytes. 4.1.3 FAX MODE SELECTION Fax class 1 commands are identified in Table 4-1 and defined in 4.2 Fax modes and rates are determined by the AT+F commands as described in 4.2. 4.1.4 FAX ORIGINATION Origination of fax calls is made using the ATD command. Upon completion of the dial function, a calling tone at 100 Hz, width a cadence of 0.5 seconds ON, and 3 seconds OFF is transmitted. The FAX Modem automatically enters mode +FRH=3 and sends the CONNECT message to the DTE when FSK flags are detected from the remote. 4.1.5 FAX ANSWERING Answering of fax calls is identical to answering of data calls with the exception that the FAX Modem enters the fax handshaking mode instead of the handshaking mode after going off-hook. If +FAE=0, the FAX Modem, after sending answer tone, automatically enters fax mode (+FTH=3), sends the CONNECT message to the DTE, and starts sending FSK flags. If +FAE=1, the FAX Modem determines if the caller is a data FAX Modem or fax FAX Modem and sends the DATA or FAX result code, respectively, to the DTE. TABLE 4-1 FAX CLASS 1 COMMANDS ┌───────────────────────────────────────────────────┐ │COMMAND FUNCTION │ ├───────────────────────────────────────────────────┤ │SERVICE CLASS ID │ ├───────────────────────────────────────────────────┤ │+FCLASS SERVICE CLASS │ ├───────────────────────────────────────────────────┤ │FAX CLASS 1 COMMANDS │ ├───────────────────────────────────────────────────┤ │+FTS=n Stop Transmission and Wait │ ├───────────────────────────────────────────────────┤ │+FTR=n Receive Silence │ ├───────────────────────────────────────────────────┤ │+FTM=n Transmit Data │ ├───────────────────────────────────────────────────┤ │+FTM=-n Receive Data │ ├───────────────────────────────────────────────────┤ │+FTH=n Transmit Data with HDLC Framing│ ├───────────────────────────────────────────────────┤ │+FRH=n Receive Data with HDLC Framing │ └───────────────────────────────────────────────────┘ 4.1.6 FAX CONTROL TRANSMISSION Fax control transmission is initiated by the AT+FTH=n command. After this command is issued, the code generates the CONNECT message and transmits carrier in the modulation scheme specified by the parameter "n". The FAX Modem then transmits HDLC flags for a minimum of 1 second. The FAX Modem continues to transmit the FDKC flags until it receives a character from the DTE. When characters are received from the DTE, the FAX Modem adds start and end flags, performs zero-bit insertion, generates FCS, and deletes character pairs before transmitting the characters to remote fax machine. Each . is considered as the end of frame maker and is not transmitted. All data received from the DTE after is ignored by the FAX Modem until the FAX Modem generates either the CONNECT, OK or ERROR result codes. If no more data is in the transmit buffer and the final bit was a 1 (bit 4 of the second byte received from the DTE), the FAX Modem generates the OK result code and returns to the command mode. If the final bit was a 0, the FAX Modem generates the CONNECT message and waits for further dat from the DTE while transmitting HDLC flags. If no more data is received before 5 seconds elapse, the FAX Modem drop carriers, goes on-hook, and generates the ERROR result code. 4.1.7 FAX CONTROL RECEPTION Fax control reception is initiated using the AT+FRH=n command. After this command is issued, the FAX Modem looks for carrier in the modulation scheme specified by the parameter "n". If no carrier is detected before the period of time specified by register S7 expires, the FAX Modem generates the NO CARRIER message and returns to command mode. If carrier is detected that is not the one specified by the parameter n, the FAX Modem generates the +FCERROR message and returns to the command mode. If the specified carrier is detected, the FAX Modem generates the CONNECT message and enters the HDLC receive mode. In HDLC receive mode, the FAX Modem receives HDLC frames from the remote fax machine, strips the flags, performs zero-bit deletion, performs error checking, and handles character pairs before passing the data to the DTE. The FAX Modem prefixes each character with another character before sending it to the DTE. After the last byte in the frame, the FAX Modem sends to the DTE marking the end of the frame. The FAX Modem then generates either the OK message if no error were detected or the ERROR message if errors were detected, (FCS is incorrect), and returns to the command mode. While in command mode, the FAX Modem continues to receive data in the selected modulation scheme, and sends the data after sending the CONNECT message to the DTE when the DTE reissues the +FRH command with the same parameter. If the DTE issues the +FRH command with a different parameter, the FAX Modem clear all buffers and proceeds as described previously. If carrier is lost while in command mode and the DTE reissues the +FRH command with the same parameter, and there is no data in the buffer, the FAX Modem sends the ERROR result code to the DTE and returns to the command mode. If there is data in the buffer, the FAX Modem sends the next frame of buffered data to the DTE, followed by , and either the ERROR result code if errors were detected, or the OK result code if no errors were detected. The FAX Modem then returns to the command mode. The FAX Modem concludes an error is detected if the carrier is lost for any period of time during or before the reception of a frame, If carrier is lost or a time period longer than the time specified by the Register S10. The FAX Modem finishes delivering the data in the receive buffer (if any) to the DTE, sends , generates the ERROR message, and returns to command mode. All subsequent data received from the remote is discarded. If the FAX Modem detects a frame abort sequence (seven consecutive ones with an zero insertion), while it is waiting for a frame beginning flag (it was receiving HDLC flags), it will wait for the HDLC flags again until either carrier is lost, or the DTE aborts the process by sending an abort character or by dropping DTR with &D2 in effect. If the frame abort sequence is detected while the FAX Modem is receiving a frame, it finishes delivering the data in the receive buffer (if any) to the DTE, sends , generates the ERROR message, and returns to the command mode. The FAX Modem keeps looking for HDLC flags followed by more data from the remote, with the selected modulation scheme. If the FAX Modem detects a receive buffer overflow condition, it concludes that there was a FCS error in that frame. The FAX Modem will receive more frames only if a starting flag is detected and there is room in the receive buffer. If a starting flag is detected and there is no room in the buffer, the FAX Modem discards all data in that frame. If the FAX Modem receives any character from the DTE after the +FRH command (except flow control characters if software flow control is in effect), or if the FAX Modem detects a high-to-low transition of the DTR signal while &D1 is in effect. It sends to the DTE, generates OK result code, and returns to command mode. The receive buffer is cleared and all data received from the remote is discarded. If the FAX Modem detects a DTR drop while &D2 is in effect, it goes on-hook, sends to the DTE, generates OK result code, and returns to command effect. If the FAX Modem detects a DTR drop while &D3 is in effect, the FAX Modem performs a warm reset. 4.1.8 FAX DATA TRANSMISSION Fax data transmission is initiated by the AT+FTM=n command. After this command is issued, the FAX Modem generates the CONNECT message and transmits carrier in the modulation scheme specified by the parameter n. The FAX Modem then transmits constant 1 bits for a minimum of one second and continues to transmit constant 1 bits until it receives a character from the DTE. When data is received from the DTE, the FAX Modem deletes start and stop bits and deletes all character pairs before transmitting the data to the remote. Each DLE> sequence is transmitted as a single . is considered as the end of stream marker, and is not transmitted. All data received from the DTE after the is ignored by the FAX Modem until the FAX Modem generates either the CONNECT, OK, or ERROR result code. If no more data is in the transmit buffer, and the last transmitted character was not an ASCII NULL, the FAX Modem generates the OK result code and returns to the command mode. If the last character transmitted was an ASCII NULL, the FAX Modem generates the CONNECT message to the DTE and waits for further data from the DTE while transmit NULLs to the remote. If more data is received before five seconds elapse, the FAX Modem continues to transmit the data as described in the previous paragraph. If five seconds elapse and no data is received from the DTE, the FAX Modem drops carrier, goes on-hook, and generates the ERROR result codes. 4.1.9 FAX DATA RECEPTION Fax data reception is initiated using the AT+FRM=n command. After this command is issued, the FAX Modem looks for carrier in the modulation scheme specified by the parameter "n", if no carrier is detected before the period of time specified by register S7, the FAX Modem generates the NO CARRIER message and returns to command mode. If the carrier is detected that is not the one specified by the parameter "n", the FAX Modem generates the +FCERROR message and returns to the command mode. Ifthe specified carrier is detected, the FAX Modem generates the CONNECT message and enters the data receive mode. While in data receive mode, the FAX Modem receives data from the remote, adds start and stop bits, and handles character pairs before passing the data to the DTE. The FAX Modem prefixes each character with another character before sending it to the DTE. If carrier is lost for a time period longer than the time specified by the register S10, the FAX Modem finishes delivering the data in the receive buffer (if any) to the DTE, sends , generates the NO CARRIER result code, and returns to the command mode. All subsequent data received from the remote is discarded. If the FAX Modem detects a receive buffer overflow condition, it stops receiving from the remote until there is room in the receive buffer. The FAX Modem informs the DTE of the buffer overflow after it sends to the DTE the last character that was stored in the buffer before the overflow occurred. If the FAX Modem receives any character from the DTE after the +FRM command (except flow control characters if software flow control is in effect), or if the FAX Modem detects a high-to-low transition of the DTR signal while &D1 is in effect, it sends to the DTE, generates the OK result received from the remote and is discarded. If loss of DTR is detected while &D2 is in effect, the FAX Modem goes on- hook, sends followed by OK result code to the DTE, and returns to command mode. Ifthe FAX Modem detects a DTR drop while &D3 is in effect, the FAX Modem performs a warm reset. 4.2 EXAMPLES Examples of calling (transmitting) and answering (receiving) one page using fax class 1 commands. ┌──────────────────────┬──────────────────────────┐ │+FCLASS=n │ SELECT SERVICE CLASS │ ├──────────────────────┼──────────────────────────┤ │+FCLASS = 0 │ Select Data Mode │ ├──────────────────────┼──────────────────────────┤ │+FCLASS = 1 │ Select Facsimile Class 1 │ │──────────────────────┼──────────────────────────┤ │+FCLASS = 2 │ Select Facsimile Class 2 │ └──────────────────────┴──────────────────────────┘ +F? REPORT ACTIVE CONFIGURATION +F? Interrogates the FAX Modem to determine the active configuration. Typical responses are: +FAE? 0 If auto answer is disabled; 1 if auto answer is enabled. +FCLASS? 0 If in data mode; 1 if in fax class 1. +F =? REPORT OPERATING CAPABILITIES +F,command> +? Can be used to determine the operating capabilities of the FAX Modem. Typical responses are: +FAE = ? 0, 1 +FCLASS =? 0, 1, 2 +FTM =? 3, 24, 48, 72, 96 +FRM =? 3, 24, 48, 72, 96 +FAEn DATA/FAX AUTO ANSWER +FAEn allows the DTE to either restrict answering to class 1, or to automatically detect whether the calling station is a fax class 1 FAX Modem or data FAX Modem and answer accordingly. n = 0 Disable data/fax auto answer mode (default). The FAX Modem answers as a FAX Modem only,. n =1 Enable data/fax auto answer mode. The FAX Modem answers as a fax or data FAX Modem. +FTS = n STOP TRANSMISSION AND WAIT +FTS = n Causes the FAX Modem to terminate a transmission and wait for "n" 10 milliseconds intervals before responding with the OK result code. An ERROR response code results if this command is issued while the FAX Modem is on-hook. +FRS = n RECEIVE SILENCE +FRS = n Causes the FAX Modem to report back to the DTE with an OK result code after n 10 millisecond intervals of silence have been detected on the line. This command is aborted if any character is received from the DTE. The FAX Modem discards the aborting character and issues an OK result code. An ERROR response code results if this command is issued while the FAX Modem is on-hook. +FTM = n TRANSMIT DATA +FTM = n Causes the FAX Modem to transmit data using the modulation defined below. An ERROR response code results if this command is issued while the FAX Modem is on-hook. +FTM = 3 V.21ch.2 300 bps +FTM = 24 V.27ter 2400 bps +FTM = 48 V.27ter 4800 bps +FTM = 72 V.29 7200 bps +FTM = 96 V.29 9600 bps +FRM = n RECEIVE DATA +FRM = n Causes the FAX Modem to enter the receiver mode using the modulation defined below. An ERROR response code result if this command is issued while the FAX Modem is on-hook. +FRM = 3 V.21ch.2 300 bps +FRM = 24 V.27ter 2400 bps +FRM = 48 V.27ter 4800 bps +FRM = 96 V.29 7200 bps +FRM = 96 V.29 9600 bps +FTH = n TRANSMIT DATA WITH HDLC FRAMING +FTH = n Causes the FAX Modem to transmit data using HDLC protocol and the modulation defined below. An ERROR response code result if this command is issued while the FAX Modem is on-hook. +FTH = 3 V.21ch.2 300 bps +FTH = 24 V.27ter 2400 bps +FTH = 48 V.27ter 4800 bps +FTH = 72 V.29 7200 bps +FTH = 96 V.29 9600 bps +FRH = n RECEIVE DATA WITH HDLC FRAMING +FRH = n Causes the FAX Modem to receive farms using HDLC protocol and the modulation defined below. An ERROR response code results if this command is issued while the FAX Modem is on-hook. +FRH = 3 V.21Ch.2 300 bps +FRH = 24 V.27ter 2400 bps +FRH = 48 V.27ter 4800 bps +FRH = 72 V.29 7200 bps +FRH = 96 V.29 9600 bps (SMC-04/07/94)