]> git.ipfire.org Git - thirdparty/HylaFAX.git/commitdiff
Bug 638: add support for "Class1RMPersistence: 0"
authorLee Howard <faxguy@howardsilvan.com>
Mon, 11 Apr 2005 05:18:24 +0000 (05:18 +0000)
committerLee Howard <faxguy@howardsilvan.com>
Mon, 11 Apr 2005 05:18:24 +0000 (05:18 +0000)
faxd/Class1Recv.c++
man/hylafax-config.4f

index e09786c9f0de66033e0f48096bfe1c3f27fe5733..e1f2285be586c6b7523ed4cea84dd3c211f492d0 100644 (file)
@@ -526,10 +526,10 @@ Class1Modem::recvPage(TIFF* tif, u_int& ppm, fxStr& emsg, const fxStr& id)
                 */
                fxStr rmCmd(curcap[HasShortTraining(curcap)].value, rmCmdFmt);
                u_short attempts = 0;
-               while ((rmResponse == AT_NOTHING || rmResponse == AT_FCERROR) && attempts++ < conf.class1RMPersistence) {
+               do {
                    (void) atCmd(rmCmd, AT_NOTHING);
-                   rmResponse = atResponse(rbuf, conf.t2Timer);
-               }
+                   rmResponse = atResponse(rbuf, conf.class1RMPersistence ? conf.t2Timer : conf.t2Timer - conf.t4Timer);
+               } while ((rmResponse == AT_NOTHING || rmResponse == AT_FCERROR) && attempts++ < conf.class1RMPersistence);
                if (rmResponse == AT_CONNECT) {
                    /*
                     * The message carrier was recognized;
@@ -870,10 +870,10 @@ Class1Modem::raiseRecvCarrier(bool& dolongtrain, fxStr& emsg)
     else rmCmd = fxStr(curcap[HasShortTraining(curcap)].value, rmCmdFmt);
     u_short attempts = 0;
     lastResponse = AT_NOTHING;
-    while ((lastResponse == AT_NOTHING || lastResponse == AT_FCERROR) && attempts++ < conf.class1RMPersistence) {
+    do {
        (void) atCmd(rmCmd, AT_NOTHING);
-       lastResponse = atResponse(rbuf, conf.t2Timer);
-    }
+       lastResponse = atResponse(rbuf, conf.class1RMPersistence ? conf.t2Timer : conf.t2Timer - conf.t4Timer);
+    } while ((lastResponse == AT_NOTHING || lastResponse == AT_FCERROR) && attempts++ < conf.class1RMPersistence);
     if (lastResponse == AT_FRH3 && waitFor(AT_CONNECT,0)) {
        gotRTNC = true;
        gotEOT = false;
@@ -921,7 +921,8 @@ Class1Modem::recvPageECMData(TIFF* tif, const Class2Params& params, fxStr& emsg)
            if (!useV34) {
                gotRTNC = false;
                if (!raiseRecvCarrier(dolongtrain, emsg) && !gotRTNC) {
-                   if (lastResponse == AT_FCERROR && atCmd(rhCmd, AT_CONNECT)) {
+                   if (wasTimeout()) abortReceive();   // return to command mode
+                   if (lastResponse != AT_NOCARRIER && atCmd(rhCmd, AT_CONNECT, conf.t2Timer)) {
                        // sender is transmitting V.21 instead, we may have
                        // missed the first signal attempt, but should catch
                        // the next attempt.  This "simulates" adaptive receive.
@@ -934,7 +935,6 @@ Class1Modem::recvPageECMData(TIFF* tif, const Class2Params& params, fxStr& emsg)
                            prevPage++;
                        }
                        free(block);
-                       if (wasTimeout()) abortReceive();       // return to command mode
                        return (false);
                    }
                }
@@ -1120,7 +1120,8 @@ Class1Modem::recvPageECMData(TIFF* tif, const Class2Params& params, fxStr& emsg)
                                else {
                                    gotRTNC = false;
                                    if (!raiseRecvCarrier(dolongtrain, emsg) && !gotRTNC) {
-                                       if (lastResponse == AT_FCERROR && atCmd(rhCmd, AT_CONNECT)) {
+                                       if (wasTimeout()) abortReceive();       // return to command mode
+                                       if (lastResponse != AT_NOCARRIER && atCmd(rhCmd, AT_CONNECT, conf.t2Timer)) {
                                            // simulate adaptive receive
                                            emsg = "";          // clear the failure
                                            gotRTNC = true;
@@ -1131,7 +1132,6 @@ Class1Modem::recvPageECMData(TIFF* tif, const Class2Params& params, fxStr& emsg)
                                                prevPage++;
                                            }
                                            free(block);
-                                           if (wasTimeout()) abortReceive();   // return to command mode
                                            return (false);
                                        }
                                    } else gotprimary = true;
index d5fca102d1ccf57eb0eb25998386f9ed9b6912ba..eaed4ba839ebc1a0cde4f331e6b5f09ba27d816e 100644 (file)
@@ -2350,6 +2350,13 @@ For those modems that support
 .B Class1RMPersistence
 should probably not be set at 1, although +FCERROR should almost never occur
 with such modems.
+.IP
+If the modem does not support the reporting of +FCERROR or adaptive reception
+control, then
+.B Class1RMPersistence
+should probably be set at 0, which causes the timeout looking for the high-speed
+data carrier to be shortened, thus increasing the likelihood of recovery from
+any dissynchronization.
 .TP
 .B Class1SendMsgDelay
 The time, in milliseconds, to delay just before sending the image data.