efax FAX class 2 VS class 2.0 selection

* Note when selecting modems for fax remember to pick the right modem class.
* Fax Class 2  is NOT the same as Class 2.0
* AT+FCLASS=?  will show the supporting class.  usually 0,1,2,2.0,6,8   see below for definition.

efax.c for linux works really easy and compatible with class 2 modems only, NOT 2.0. USR modems are not supported.

=================

/usr/bin/efax -d /dev/cua1 -t 25639432 ./testline2.txt

==================




  The following class 2 commands are supported and implemented per EIA PN2388

  (8/20/90).



  Command Style



+<command>=<value>      Execute a command or set a parameter

+<command>?     Read possible settings

+<command>=?    Read current setting



Supported Commands (per EIA PN2388 8/20/90)



+FAA=n          Auto answer mode parameter

                n=0     DCE to answer as set by +FCLASS

                n=1     DCE can answer and auto. determine calling type



+FCLASS=n               Service class selection

                n=0     Set to modem mode

                n=2     Set to Class 2 mode

                n=6     Set to ZFAX mode

                n=8     Set to Voice mode



+FBOR=n         Phase C data bit order

                n=0     Select direct bit order

                n=1     Select reversed bit order in receiving mode



+FCIG="string"          Local fax station ID string, for polling Rx.



+FCON           DCE response, Fax connection made



+FCR=n          Capability to receive parameter

                n=0     DCE will not receive message data or poll a remote



+FDCC=vr,br,wd,ln,df,ec,bf,st   DCE capabilities parameters

                           vr=0 Vertical resolution ,Normal 98 lpi

                           vr=1 Vertical resolution ,Fine 196 lpi

                           br=0 Bit rate ,2400 bit/s V.27ter

                           br=1 Bit rate ,4800 bit/s V.27ter

                           br=2 Bit rate ,7200 bit/s V.29 or V.17

                           br=3 Bit rate ,9600 bit/s V.29 or V.17

                           br=4 Bit rate ,12000 bit/s V.17

                           br=5 Bit rate ,14400 bit/s V.17

                           wd=0 Page Width,1728 pixels in 215mm

                           wd=1 Page Width,2048 pixels in 255mm

                           wd=2 Page Width,2432 pixels in 303mm

                           ln=0 Page length,A4 297mm

                           ln=1 page length,B4 364mm

                           ln=2 page length,unlimited length

                           df=0 Data compression format,1-D modified Huffman

                           df=1 Data compression format,2-D modified Read

                           ec=0 Error correction disabled

                           bf=0 disable Binary file transfer

                           st=0 minimum scan time/line 0 ms

                           st=1 minimum scan time/line 5 ms

                           st=2 10 ms (normal) , 5 ms (fine)

                           st=3 minimum scan time/line 10ms

                           st=4 20 ms (normal) , 10ms (fine)

                           st=5 minimum scan time/line 20ms

                           st=6 40 ms (normal) , 20ms (fine)

                           st=7 minimum scan time/line 40ms



+FDCS=vr,br,wd,ln,df,ec,bf,st   Current session parameter; refer to +FDCC command



+FDIS=vr,br,wd,ln,df,ec,bf,st   Current session negotiation parameter; refer to +FDCC command



+FDR            Receive phase C data command; initiates document reception



+FDT=df,vr,wd,in                Transmit phase C data command; releases the DCE to proceed with negotiation



+FET=n          End the page or document command

                n=0     More pages; same document

                n=1     End of document; another document follows

                n=2     No more pages or documents

                n=4     Procedure interrupt: another page follows

                n=5     Procedure interrupt: end of document, another document follows

                n=6     Procedure interrupt: end of document



+FLID="string"          Local ID string parameter



+FLPL=n         Document for polling command

                n=0     Indicate that the DTE has no document for polling

                n=1     Indicate document available for polling



+FMDL?          Request DCE model



+FMFR?          Request DCE manufacturer



+FPTS=n         Page transfer status

                n=1     Received page good

                n=2     Page bad; retrain requested

                n=3     Page good; retrain requested

                n=4     Page bad; procedure interrupt requested

                n=5     Page good; procedure interrupt requested



+FNS="<string of Hex>"  Non-standard frame FIF octet string



+FREV?          Request DCE revision



+FSPL=n         Enable polling command

                n=0     Disable polling

                n=1     Enable polling



  All other +F commands are not supported but the modem will respond OK.  In

  many cases this means "don't care".  See PN 2388 for command details.



The Class 2 Responses

ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ



RESPONSE                        FUNCTION AND DESCRIPTION

ÄÄÄÄÄÄÄÄÄ                       ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ



+FCIG:"String"                  Report remote ID response CIG



+FCFR                           Confirmation to receive prompt



+FCON                           Facsimile connection response



+FCSI:"String"                  Report remote ID response CSI



+FDCS:vr,br,wd,ln,df,ec,bf,st   Report session parameters response ,refer to

                                +FDCC=.... command



+FDIS:vr,br,wd,ln,df,ec,bf,st   Report remote capabilities response,refer to

                                +FDCC=.... command



+FDTC:vr,br,wd,ln,df,ec,bf,st   Report remote capabilities response ,refer to

                                +FDCC=.... command



+FET:n                          Post page message response,refer to +FET=n command



+FHNG:nnn                       Call termination status response

                        nnn=00  Normal and proper end of connection

                        nnn=10  Transmit error on phase A hangup code

                        nnn=20  Transmit error on phase B hangup code

                        nnn=40  Transmit error on phase C hangup code

                        nnn=50  Transmit error on phase D hangup code

                        nnn=70  Receive error on phase B hangup code

                        nnn=90  Receive error on phase C hangup code

                        nnn=100 Receive error on phase D hangup code



+FNSC:"HEX string"              Report the non-standard facilities command frame

                                For example the polling security ID



+FNSF:"HEX string"              Report the non-standard facilities frame response



+FPOLL                          Remote polling indication



+FPTS:n                         Receive page transfer status response,refer to

                                +FPTS=n command



+FTSI:"String"                  Report remote ID response TSI



+FVOICE                         Transition to Voice response.



Class 2 Fax Examples

ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ

Legend:

    1.  "------>"    :Command from DTE(computer) to DCE(ZyXEL series modem)

    2.  "<------"    :Response from DCE(ZyXEL series modem) to DTE(computer)

    3.  "<XON>"      :ASCII <DC1> character ,049 decimal ,031 hexdecimal

    4.  "<DLE>"      :ASCII <DLE> character ,016 decimal ,010 hexdecimal

    5.  "<ETX>"      :ASCII <ETX> character ,003 decimal

    6.  "<DC2>"      :ASCII <DC2> character ,050 decimal ,032 hexdecimal

    7.  "<XOFF>"     :ASCII <DC3> character ,051 decimal ,033 hexdecimal

    8.  "(T.4 DATA)" :Refer to CCITT blue book volume VII T.4



Example 1: Send 2 pages FAX message  (refer to Example 2)



Direction   Command or response        description

ÄÄÄÄÄÄÄÄÄ   ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ        ÄÄÄÄÄÄÄÄÄÄÄÄÄ

------>     AT&F                       ;Initinalze Modem to Default setting.

<------     OK

------>     AT+FCLASS=2                ;after any AT command the baud

                                        rate will detected automatically

<------     OK

------>     AT+FLID=886 35 783734      ;Local ID string

<------     OK

------>     AT+FDCC=1                  ;set to fine resolution mode

<------     OK

------>     ATDT027718546              ;Dial out the number

<------     +FCON                      ;Fax connection response

<------     +FNSF:00 00 00 00

<------     +FCSI:999 2 7718546        ;report the remote fax identification

<------     +FDIS:1,5,0,2,0,0,0,0      ;report the remote fax machine capability

<------     OK

------>     AT+FDT

<------     +FDCS:1,5,0,2,0,0,0,0      ;report the current session parameter

<------     CONNECT

<------     <XON>

------>     (T.4 DATA)                 ;T.4 data,need to take care of flow control

------>     <DLE> <ETX>                ;return to control

<------     OK

------>     AT+FET=0                   ;End of page more to follow.

<------     +FPTS:1

<------     OK

------>     AT+FDT

<------     CONNECT

<------     <XON>

------>     (T.4 DATA)                 ;T.4 data,need to take care of flow control

------>     <DLE> <ETX>                ;return to control

<------     OK

------>     AT+FET=2                   ;End of document and session.

<------     +FPTS:1

<------     +FHNG:00                   ;Fax transmition completed with no error

<------     OK

<------     NO CARRIER                 ;Modem response,indicate line is terminate



Example 2: Received 2 pages FAX message  (refer to Example 1)



Direction   Command or response        description

ÄÄÄÄÄÄÄÄÄ   ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ        ÄÄÄÄÄÄÄÄÄÄÄÄÄ

------>     AT&F                       ;Initinalze Modem to Default setting.

<------     OK

------>     AT+FCLASS=2                ;set Modem to Class 2 fax mode

<------     OK

------>     AT+FLID=999 2 7718546      ;local ID string

<------     OK

------>     AT+FCR=1                   ;Enable FAX receive

<------     OK

------>     AT+FDCC=1                  ;set to fine resolution

<------     OK

<------     RING                       ;Remote FAX machine Dial in

<------     RING

------>     ATA                        ;Computer answer the call

<------     +FCON                      ;Fax connection response

<------     +FTSI:886 35 783734        ;report the remote fax identification

<------     +FDCS:1,5,0,2,0,0,0,0      ;report the remote fax machine capability

<------     OK

------>     AT+FDR

<------     +FCFR                      ;confirm for FAX receive

<------     +FTSI:886 35 783734

<------     +FDCS:1,5,0,2,0,0,0,0      ;report the remote fax machine capability

<------     CONNECT

------>     <DC2>

<------     (T.4 DATA)                 ;T.4 data,need to take care of flow control

<------     <DLE> <ETX>

<------     +FPTS:1                    ;Page good

<------     +FET:0                     ;more pages follow

<------     OK

------>     AT+FDR

<------     CONNECT

------>     <DC2>

<------     (T.4 DATA)                 ;T.4 data,need to take care of flow control

<------     <DLE> <ETX>                ;return to control

<------     +FPTS:1                    ;Page good

<------     +FET:2                     ;no more pages or document

<------     OK

------>     AT+FDR

<------     +FHNG:000                  ;Fax receiving completed with no error

<------     OK



Example 3: Send 1 page then Polling Receive 2 pages (refer to Example 4)



Direction   Command or response        description

ÄÄÄÄÄÄÄÄÄ   ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ        ÄÄÄÄÄÄÄÄÄÄÄÄÄ

------>     AT&F                       ;Initinalze Modem to Default setting.

<------     OK

------>     AT+FCLASS=2

<------     OK

------>     AT+FLID=035782439

<------     OK

------>     AT+FCR=1

<------     OK

------>     AT+FBOR=0

<------     OK

------>     AT+FDCC=1,5

<------     OK

------>     AT+FSPL=1                  ;enable polling

<------     OK

------>     AT+FCIG=001 886 35 782439  ;local FAX ID ,for polling

<------     OK

------>     at+fclass?                 ;make sure is class 2 mode?if necessary

<------     2

<------     OK

------>     ATDT783734

<------     +FCON

<------     +FNSF:00 00 00 00

<------     +FCSI:035783734

<------     +FDIS:1,5,0,2,1,0,0,0

<------     +FPOLL                     ;report the remote FAX has document for

<------     OK                         ;polling

------>     AT+FDT

<------     +FDCS:0,5,0,2,0,0,0,0

<------     CONNECT

<------     <XON>

------>     (T.4 DATA)

------>     <DLE> <ETX>

<------     OK

------>     AT+FET=1

<------     +FPTS:1

<------     OK

------>     AT+FDR

<------     +FCFR

<------     +FTSI:035783734

<------     +FDCS:0,5,0,2,0,0,0,0

<------     CONNECT

------>     <DC2>

<------     (T.4 DATA)

<------     <DLE> <ETX>

<------     +FPTS:1

<------     +FET:0

<------     OK

------>     AT+FDR

<------     CONNECT

------>     <DC2>

<------     (T.4 DATA)

<------     <DLE> <ETX>

<------     +FPTS:1

<------     +FET:2

<------     OK

------>     AT+FDR

<------     +FHNG:000

<------     OK



Example 4: Receive 1 page then Polling transmite 2 pages (refer to Example 3)



Direction   Command or response        description

ÄÄÄÄÄÄÄÄÄ   ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ        ÄÄÄÄÄÄÄÄÄÄÄÄÄ

------>     AT&F                       ;Initinalze Modem to Default setting.

<------     OK

------>     AT+FCLASS=2

<------     OK

------>     AT+FLID=035783734

<------     OK

------>     AT+FCR=1

<------     OK

------>     AT+FBOR=0

<------     OK

------>     AT+FDCC=1,,,,1

<------     OK

------>     AT+FLPL=1                  ;Document for polling command

<------     OK

<------     RING                       ;Remote FAX machine Dial in

------>     ATA

<------     +FCON

<------     +FTSI:035782439

<------     +FDCS:1,5,0,2,0,0,0,0

<------     OK

------>     AT+FDR

<------     +FCFR

<------     +FTSI:035782439

<------     +FDCS:1,5,0,2,0,0,0,0

<------     CONNECT

------>     <DC2>

<------     (T.4 DATA)

<------     <DLE> <ETX>

<------     +FPTS:1

<------     +FET:1

<------     OK

------>     AT+FDR

<------     +FNSC:AD 00 12 00 00 50 4F 4C 4C 2D 49 44 3A 31 32 33 34 20

<------     +FCIG:001 886 35 782439

<------     +FDTC:1,5,0,2,0,0,0,0

<------     OK

------>     AT+FDT

<------     +FDCS:1,5,0,2,0,0,0,0

<------     CONNECT

<------     <XON>

------>     (T.4 DATA)

------>     <DLE> <ETX>

<------     OK

------>     AT+FET=0

<------     +FPTS:1

<------     OK

------>     AT+FDT

<------     CONNECT

<------     <XON>

------>     (T.4 DATA)

------>     <DLE> <ETX>

<------     OK

------>     AT+FET=2

<------     +FPTS:1

<------     +FHNG:00

<------     OK



Example 5: Polling receive 2 pages (refer to Example 6)



Direction   Command or response        description

ÄÄÄÄÄÄÄÄÄ   ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ        ÄÄÄÄÄÄÄÄÄÄÄÄÄ

------>     AT&F                       ;Initinalze Modem to Default setting.

<------     OK

------>     AT+FCLASS=2

<------     OK

------>     AT+FLID=886-35-782439

<------     OK

------>     AT+FCR=1

<------     OK

------>     AT+FDCC=1

<------     OK

------>     AT+FSPL=1

<------     OK

------>     AT+FNS=""                  ;reset to null string

<------     OK

------>     AT+FNS="AD00120000504F4C4C2D49443A35363738"  ;Non standard Hex string

<------     OK

------>     AT+FCIG=9-0-886-35-782439

<------     OK

------>     ATDT787045

<------     +FCON

<------     +FNSF:00 00 00 00

<------     +FCSI:011-886-35-787045

<------     +FDIS:1,5,0,2,0,0,0,0

<------     +FPOLL

<------     OK

------>     AT+FDR

<------     +FCFR

<------     +FTSI:011-886-35-787045

<------     +FDCS:1,5,0,2,0,0,0,0

<------     CONNECT

------>     <DC2>

<------     (T.4 DATA)

<------     <DLE> <ETX>

<------     +FPTS:1

<------     +FET:0

<------     OK

------>     AT+FDR

<------     CONNECT

------>     <DC2>

<------     (T.4 DATA)

<------     <DLE> <ETX>

<------     +FPTS:1

<------     +FET:2

<------     OK

------>     AT+FDR

<------     +FHNG:000

<------     OK



Example     6: Polling transmite 2 pages (refer to Example 5)



Direction   Command or response        description

ÄÄÄÄÄÄÄÄÄ   ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ        ÄÄÄÄÄÄÄÄÄÄÄÄÄ

------>     AT&F                       ;Initinalze Modem to Default setting.

<------     OK

------>     AT+FCLASS=2

<------     OK

------>     AT+FLID=011-886-35-787045

<------     OK

------>     AT+FDCC=1

<------     OK

------>     AT+FLPL=1

<------     OK

<------     RING                        ;Remote FAX machine Dial in

------>     ATA

<------     +FCON

<------     +FNSC:AD 00 12 00 00 50 4F 4C 4C 2D 49 44 3A 35 36 37 38 20

<------     +FCIG:9-0-886-35-782439

<------     +FDTC:1,5,0,2,0,0,0,0

<------     OK

------>     AT+FDT

<------     +FDCS:1,5,0,2,0,0,0,0

<------     CONNECT

<------     <XON>

------>     (T.4 DATA)

------>     <DLE> <ETX>

<------     OK

------>     AT+FET=0

<------     +FPTS:1

<------     OK

------>     AT+FDT

<------     CONNECT

<------     <XON>

------>     (T.4 DATA)

------>     <DLE> <ETX>

<------     OK

------>     AT+FET=2

<------     +FPTS:1

<------     +FHNG:00

<------     OK



Example 7: transmite FAX with procedure interrupt



Direction   Command or response        description

ÄÄÄÄÄÄÄÄÄ   ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ        ÄÄÄÄÄÄÄÄÄÄÄÄÄ

------>     AT&F                       ;Initinalze Modem to Default setting.

<------     OK

------>     AT+FCLASS=2

<------     OK

------>     ATDT782439

<------     +FCON

<------     +FNSF:00 00 00 00

<------     +FCSI:035783734

<------     +FDIS:1,5,0,2,0,0,0,0

<------     OK

------>     AT+FDT

<------     +FDCS:1,5,0,2,0,0,0,0

<------     CONNECT

<------     <XON>

------>     (T.4 DATA)

------>     <DLE> <ETX>

<------     OK

------>     AT+FET=4                   ;procedure interrupt ,more page

<------     +FPTS:5                    ;page good,procedure interrupt response

<------     +FVOICE                    ;response indicate transfer to phone.

<------     OK

<------     NO CARRIER

                                       ;operator intervension .(talk by phone)

------>     ATD

<------     +FCON

<------     +FNSF:00 00 00 00

<------     +FCSI:035783734

<------     +FDIS:1,5,0,2,0,0,0,0

<------     OK

------>     AT+FDT

<------     +FDCS:1,5,0,2,0,0,0,0

<------     CONNECT

<------     <XON>

------>     (T.4 DATA)

------>     <DLE> <ETX>

<------     OK

------>     AT+FET=2

<------     +FPTS:1

<------     +FHNG:00

<------     OK





FLOW CONTROL

ÍÍÍÍÍÍÍÍÍÍÍÍÍ

Flow control is necessary to match the DTE-DCE date rate to the line

signalling rate while Group 3 (T.4) data is in transmission or receiving.

In Class 2 FAX mode,both hardware flow control (RTS/CTS) and software flow

control (XON/XOFF) are supported.The hardware flow control is default setting.

留言

這個網誌中的熱門文章

tw quote

FPDF Big5 Font

三重幫 - 2013-09-11