Class2SFLOCmd: AT+FLO=1
Class2HFLOCmd: AT+FLO=2
+# The modem performs copy quality correction (in Class 2... gasp!)
+# always, thus it's not a good idea to use host-based CQ. The
+# query response is incorrect, also.
+Class2CQQueryCmd: "!0-2"
+Class2CQCmd: AT+FCQ=1
+
# If your line supports Caller-ID, you may want to uncomment this...
# QualifyCID: etc/cid # you must create this file
# ModemResetCmds: AT+VCID=1
Class2APCmd: AT+FAP=1,1,1
Class2BUGCmd: AT+FBU=0 # early firmware is buggy
-Class2CQCmd: AT+FCQ=1,0
Class2SendRTC: yes
Class2UseHex: yes
+# Some firmwares do not report copy quality correction, although it
+# is present and cannot be disabled. Thus modem-based CQ must be used.
+Class2CQQueryCmd: "!(00-02),(00-02)"
+Class2CQCmd: AT+FCQ=1,0
+
# versions that respond to AT+FFC=? with non-zero data support RTFCC
# Class2RTFCC: yes
Class2APCmd: AT+FAP=1,1,1
Class2BUGCmd: AT+FBU=0 # early firmware is buggy
-Class2CQCmd: AT+FCQ=1,0
Class2SendRTC: yes
Class2UseHex: yes
+# Some firmwares do not report copy quality correction, although it
+# is present and cannot be disabled. Thus modem-based CQ must be used.
+Class2CQQueryCmd: "!(00-02),(00-02)"
+Class2CQCmd: AT+FCQ=1,0
+
# versions that respond to AT+FFC=? with non-zero data support RTFCC
# Class2RTFCC: yes
* If the modem is capable, then enable it using the configured
* commands. If the modem is incapable of doing copy quality
* checking, then the host will do the work.
+ *
+ * The recommendation for AT+FCQ varies significantly between
+ * the Class 2 and Class 2.0 specification.
+ *
+ * An assumption is made that Class2CQCmd, if configured, enables
+ * all available copy quality services (or disables them if none
+ * are available).
*/
cqCmds = "";
- if (doQuery(conf.class2CQQueryCmd, s) && FaxModem::parseRange(s, modemCQ)) {
- if (modemCQ >>= 1)
- cqCmds = conf.class2CQCmd;
- } else
- modemCQ = 0;
- static const char* whatCQ[4] = { "no", "1D", "2D", "1D+2D" };
- modemSupports("%s copy quality checking%s", whatCQ[modemCQ&3],
- (modemCQ && cqCmds == "" ? " (but not enabled)" : ""));
+ sendCQ = 0;
+ if (serviceType == SERVICE_CLASS2) {
+ /*
+ * The AT+FCQ=? response indicates which compression
+ * formats are copy-quality checked.
+ */
+ if (doQuery(conf.class2CQQueryCmd, s) && FaxModem::parseRange(s, modemCQ)) {
+ if (modemCQ >>= 1)
+ cqCmds = conf.class2CQCmd;
+ } else
+ modemCQ = 0;
+ static const char* whatCQ[4] = { "no", "1D", "2D", "1D+2D" };
+ modemSupports("%s copy quality checking%s", whatCQ[modemCQ&3],
+ (modemCQ && cqCmds == "" ? " (but not enabled)" : ""));
+ } else { // SERVICE_CLASS20, SERVICE_CLASS21
+ /*
+ * The AT+FCQ=? response indicates whether or not copy-quality
+ * checking and/or correction are supported. Host CQ cannot
+ * be used if the modem performs copy-quality correction.
+ */
+ cqCmds = conf.class2CQCmd;
+ if (doQuery(conf.class2CQQueryCmd, s) && FaxModem::vparseRange(s, 0, 2, &modemCQ, &sendCQ)) {
+ modemCQ >>= 1;
+ sendCQ >>= 1;
+ } else {
+ modemCQ = 0;
+ sendCQ = 0;
+ }
+ static const char* whatCQ[4] = { "no", "checking", "correction", "checking and correction" };
+ if (modemCQ)
+ modemSupports("receiving copy quality %s", whatCQ[modemCQ&3]);
+ else modemSupports("no receiving copy quality services");
+ if (sendCQ)
+ modemSupports("sending copy quality %s%s", whatCQ[sendCQ&3],
+ (sendCQ && cqCmds == "" ? " (but not enabled)" : ""));
+ else modemSupports("no sending copy quality services");
+ }
+ /*
+ * In Class 2 we follow spec defaults and assume that if cqCmds is null
+ * that CQ is not enabled. In Class 2.0/2.1 we follow spec default and
+ * assume the opposite. In order to know otherwise we'd need to make
+ * sense of AT+FCQ? and incorporate that in the messages above.
+ */
+ if (serviceType == SERVICE_CLASS2)
+ if (cqCmds == "") modemCQ = 0;
+ else { // SERVICE_CLASS20, SERVICE_CLASS21
+ if (cqCmds == "" && modemCQ) modemCQ = 1;
+ }
/*
* Deduce if modem supports T.class2-defined suport for
* subaddress, selective polling address, and passwords.
fxStr hardFlowCmd; // hardware flow control command
u_int serviceType; // modem service required
u_int modemCQ; // copy quality capabilities mask
+ u_int sendCQ; // sending copy quality capabilities mask
bool xmitWaitForXON; // if true, wait for XON when sending
bool hostDidCQ; // if true, copy quality done on host
* Have host do copy quality checking if the modem does not
* support checking for this data format and if the configuration
* parameters indicate CQ checking is to be done.
+ *
+ * If the modem is performing copy quality correction then
+ * the host cannot perform copy quality checking.
*/
- hostDidCQ = (modemCQ & BIT(params.df)) == 0 && checkQuality();
+ if (serviceType == SERVICE_CLASS2)
+ hostDidCQ = (modemCQ & BIT(params.df)) == 0 && checkQuality();
+ else
+ hostDidCQ = modemCQ == 0 && checkQuality();
+ protoTrace("Copy quality checking performed by %s", hostDidCQ ? "host" : "modem");
+
bool pageRecvd = recvPageDLEData(tif, hostDidCQ, params, emsg);
// be careful about flushing here -- otherwise we lose +FPTS codes
The command used to set a polling identifier.
This string is inserted into the format ``\s-1%s="<id>"\s+1''.
.TP
+.B Class2CQCmd
+The command to use to set up parameters for copy quality checking.
+For example, for an Everex 24/96D modem this parameter might be set to
+``\s-1AT+FCQ=1\enAT+FBADMUL=20\enAT+FBADLIN=10\s+1''.
+.B Class2CQCmd
+should be configured to set-up all available copy quality services
+available per
+.B Class2CQQueryCmd.
+To disable features that are available, configure
+.B Class2CQQueryCmd
+with a ``!'', and then set
+.B Class2CQCmd
+accordingly.
+.TP
.B Class2CQQueryCmd
The command to send to the modem to get the copy quality capabilities string.
If the parameter begins with a ``!'', then the remainder of the
.B PercentGoodLines
and
.B MaxConsecutiveBadLines
-for parameters used to do server copy quality checking.
+for parameters used to do server copy quality checking. If copy quality
+checking is configured to be done by the modem then it is not done by the server.
.TP
.B Class2CRCmd
The command to use to enable the reception of facsimile.
.TP
-.B Class2CQCmd
-The command to use to set up parameters for copy quality checking.
-For example, for an Everex 24/96D modem this parameter might be set to
-``\s-1AT+FCQ=1\enAT+FBADMUL=20\enAT+FBADLIN=10\s+1''.
-.TP
.B Class2DCCCmd
The command used to set modem capabilities.
This string is inserted into the format