]> git.ipfire.org Git - thirdparty/HylaFAX.git/commitdiff
Handle +FCERROR after most +FRH=3 command
authorAidan Van Dyk <aidan@ifax.com>
Wed, 14 Mar 2007 18:28:08 +0000 (18:28 +0000)
committerAidan Van Dyk <aidan@ifax.com>
Wed, 14 Mar 2007 18:28:08 +0000 (18:28 +0000)
Based on lee's work:

|  commit 59402ed3aa2b67f9472138542edb5f110bb1a753
|  Author: Lee Howard <faxguy@howardsilvan.com>
|  Date:   Mon Jun 26 16:56:53 2006 +0000
|
|    this gets us to handle most cases where +FCERROR would be received in response
|        to +FRH=3 from an inconsiderate modem

|  commit 22a62e0ac61594c3b408dba8d8529242111d70be
|  Author: Lee Howard <faxguy@howardsilvan.com>
|  Date:   Fri Jun 30 15:25:34 2006 +0000
|
|    slow down the speed of the loop in the +FRH=3/+FCERROR loop

CHANGES
faxd/Class1.c++

diff --git a/CHANGES b/CHANGES
index 38eb1e73c9e9f4d83bebbdd02554cc243a04c298..a22e58296c1442083e887cf63d0c58ca1d7d33b3 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,7 @@
 
 Changelog since HylaFAX 4.3.3
 
+* Handle +FCERROR after most +FRH=3 commands (12 Mar 2007)
 * We can't rely on the timeout value to know if CONNECT has been seen (12 Mar 2007)
 * Calculate PPM/PPS waiter instead of using T1
 * Improve response handling of AT+FRH=3 (12 Mar 2007)
index a50be5e0590351376016e364128dc8805f5ae368..4a4506b4c262f82f2cda2c4668fe69e4aa1b96ab 100644 (file)
@@ -1381,7 +1381,21 @@ Class1Modem::recvFrame(HDLCFrame& frame, u_char dir, long ms, bool readPending,
        return (gotframe);
     }
     startTimeout(ms);
-    if (!readPending) readPending = atCmd(rhCmd, AT_NOTHING, 0) && waitFor(AT_CONNECT, 0);
+    if (!readPending) {
+       /*
+        * Hopefully the modem is smart enough to *not* do +FCERROR after +FRH=3,
+        * as it is only a stumbling-block for us and cannot be beneficial.  But,
+        * in case it adheres blindly to the spec, we'll repeat ourselves here
+        * until we timeout or we do get the V.21 carrier.  We do slow the looping
+        * with a pause to prevent unwanted massive amounts of tracing.  The pause 
+        * needs to be short enough, though, that the modem will still pick up
+        * any V.21 signalling if it misses that much of the startup.
+        */
+       do {
+           readPending = atCmd(rhCmd, AT_NOTHING, 0) && waitFor(AT_CONNECT, 0);
+           if (lastResponse == AT_FCERROR) pause(200);
+       } while (lastResponse == AT_FCERROR && !wasTimeout());
+    }
     if (readPending) {
         stopTimeout("waiting for HDLC flags");
         if (wasTimeout()){