]> git.ipfire.org Git - thirdparty/HylaFAX.git/commitdiff
This is a patch that Lee has used for a while:
authorAidan Van Dyk <aidan@ifax.com>
Fri, 21 Jul 2006 08:46:17 +0000 (08:46 +0000)
committerAidan Van Dyk <aidan@ifax.com>
Fri, 21 Jul 2006 08:46:17 +0000 (08:46 +0000)
  This replaces the usage of Class1SendMsgDelay with Class1SwitchingCmd, which
  I believe will be a more reliable approach.

CHANGES
config/class1
config/class1.0
etc/faxaddmodem.sh.in
faxd/Class1Send.c++
faxd/ModemConfig.c++
faxd/ModemConfig.h
man/hylafax-config.4f

diff --git a/CHANGES b/CHANGES
index 1e564ce476a9ebcc8e1557ff7899ecdb755e3def..81b87951d18eb81a5665cb5ba02e8f75ca49a99a 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,7 @@
 
 Changelog since HylaFAX 4.3.0
 
+* replace Class1SendMsgDelay with Class1SwitchingCmd (20 Jul 2006)
 * fix faxaddmodem config parsing for Digicom Leonardo modems(19 Jul 2006)
 * don't skip initial NSF bytes in station ID search when no
   known T.35 manufacturer ID was used (18 Jul 2006)
index cb6a7d4c194e79871090130fb04fac4eb1302c88..82f18bea29a10a8a2cef8816f2d12f3defaef3b7 100644 (file)
@@ -112,7 +112,6 @@ Class1Cmd:          AT+FCLASS=1     # command to enter class 1
 Class1PPMWaitCmd:      AT+FTS=7        # command to stop and wait before PPM
 Class1TCFWaitCmd:      AT+FTS=7        # command to stop and wait before TCF
 Class1EOPWaitCmd:      AT+FTS=9        # command to stop and wait before EOP
-Class1SendMsgDelay:    200             # 75ms delay after training
 Class1SwitchingCmd:    AT+FRS=7        # silence between HDLC recv and trans
 Class1TrainingRecovery:        1500            # 1.5sec delay after training failure
 Class1RecvAbortOK:     200             # wait 200ms for abort response
index fc08f5d5d2f808aaaa1f7607c82b0740fb1f54d4..8f75ec3e2454b1b6af9d98f307ac35a71e7eb928 100644 (file)
@@ -114,8 +114,7 @@ Class1Cmd:          AT+FCLASS=1.0   # command to enter class 1.0
 Class1PPMWaitCmd:      AT+FTS=7        # command to stop and wait before PPM
 Class1TCFWaitCmd:      AT+FTS=7        # command to stop and wait before TCF
 Class1EOPWaitCmd:      AT+FTS=9        # command to stop and wait before EOP
-Class1SendMsgDelay:    200             # 75ms delay after training
-Class1SwitchingDelay:  75              # 150ms delay in switching transmission direction
+Class1SwitchingCmd:    AT+FRS=7        # command to stop and listen for silence
 Class1TrainingRecovery:        1500            # 1.5sec delay after training failure
 Class1RecvAbortOK:     200             # wait 200ms for abort response
 Class1FrameOverhead:   4               # 4 byte overhead in recvd HDLC frames
index 3ef21c7321def89638ed4724fdb756ba1d22a110..dad30fddaa8551cef97b2d16c5eb87e26850d5ea 100644 (file)
@@ -1335,7 +1335,6 @@ Class1Parameters="
     Class1MsgRecvHackCmd
     Class1RecvAbortOK
     Class1RecvIdentTimer
-    Class1SendMsgDelay
     Class1SwitchingCmd
     Class1TCFMaxNonZero
     Class1TCFMinRun
@@ -1604,7 +1603,6 @@ AT        Class1EOPWaitCmd        \
        Maximum time to wait for OK after aborting a receive (ms)
 #      Class1RecvIdentTimer    \
        Maximum wait for initial identification frame (ms)
-#      Class1SendMsgDelay      Delay after completing training (ms)
 #      Class1SwitchingCmd      \
        Command to ensure silence after receiving HDLC and before sending
 #      Class1TCFRecvTimeout    Timeout for receiving TCF (ms)
index 2e53304b161b9b53b1a93139bd32521f5c710758..99ed36d729b53dec7647cc471154fd934f2d7ad9 100644 (file)
@@ -323,7 +323,10 @@ Class1Modem::sendPhaseB(TIFF* tif, Class2Params& next, FaxMachineInfo& info,
             * "before sending any signals using V.27 ter/V.29/V.33/V.17 
             * modulation system"
             */
-           pause(conf.class1SendMsgDelay);
+           if (!atCmd(conf.class1SwitchingCmd, AT_OK)) {
+               protoTrace("Failure to receive silence.");
+               return (send_failed);
+           }
        }
 
        /*
@@ -1078,7 +1081,11 @@ Class1Modem::blockFrame(const u_char* bitrev, bool lastframe, u_int ppmcmd, fxSt
            if (flowControl == FLOW_XONXOFF)   
                setXONXOFF(FLOW_XONXOFF, FLOW_NONE, ACT_FLUSH);
            if (!useV34) {
-               pause(conf.class1SendMsgDelay);         // T.30 5.3.2.4
+               // T.30 5.3.2.4 (03/93) gives this to be a 75ms minimum
+               if (!atCmd(conf.class1SwitchingCmd, AT_OK)) {
+                   protoTrace("Failure to receive silence.");
+                   return (false);
+               }
                /*
                 * T.30 Section 5, Note 5 states that we must use long training
                 * on the first high-speed data message following CTC.
index 3e080d5af8ffd235c3814d9697628e000969b50a..88ca80f3418422b16767e51288782c13369fd776 100644 (file)
@@ -199,7 +199,6 @@ static struct {
 { "modemringsbeforeresponse",  &ModemConfig::ringsBeforeResponse,   0 },
 { "modemsoftresetcmddelay",    &ModemConfig::softResetCmdDelay,     3000 },
 { "class1tcfrecvtimeout",      &ModemConfig::class1TCFRecvTimeout,  4500 },
-{ "class1sendmsgdelay",                &ModemConfig::class1SendMsgDelay,    200 },
 { "class1trainingrecovery",    &ModemConfig::class1TrainingRecovery,1500 },
 { "class1recvabortok",         &ModemConfig::class1RecvAbortOK,     200 },
 { "class1rmpersistence",       &ModemConfig::class1RMPersistence,   2 },
index 4d3f528cc9f666bb0f15f518ba245626e1b2a7ef..8f563d7a913e78d925df34df4454f243a76deeb1 100644 (file)
@@ -151,7 +151,6 @@ public:
     fxStr      class1SwitchingCmd;     // after recv HDLC and before sending
     fxStr      class1MsgRecvHackCmd;   // cmd to avoid +FCERROR before image
     u_int      class1TCFRecvTimeout;   // timeout receiving TCF
-    u_int      class1SendMsgDelay;     // delay (ms) after training
     u_int      class1TrainingRecovery; // delay (ms) after failed training
     u_int      class1RecvAbortOK;      // if non-zero, OK sent after recv abort
     u_int      class1RMPersistence;    // how many times to persist through +FCERROR
index d30960b701899374f0a3b14abfd6b866b17caa3c..0f5e3ec79d8b0f906a3ec495bd901c1a47e8ccc5 100644 (file)
@@ -311,7 +311,6 @@ Class1TCFMinRun     integer \s-11000\s+1    Class 1/1.0: minimum zero run in good \s-1T
 Class1TCFRecvHack      boolean \s-1No\s+1      Class 1/1.0: deliberately look for carrier loss before TCF
 Class1TCFRecvTimeout   integer \s-14500\s+1    Class 1/1.0: max wait (ms) for \s-1TCF\s+1
 Class1TMConnectDelay   integer \s-10\s+1       Class 1/1.0: delay between +FTM CONNECT and data transmission
-Class1SendMsgDelay     integer \s-1200\s+1     Class 1/1.0: delay before sending image data
 Class1SwitchingCmd     string  \s-1AT+FRS=7\s+1        Class 1/1.0: command to ensure silence after HDLC reception
 Class1TrainingRecovery integer \s-11500\s+1    Class 1/1.0: delay after failed training
 Class1ValidateV21Frames        boolean \s-1No\s+1      Class 1/1.0: check FCS against received frames
@@ -2418,12 +2417,6 @@ 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.
-According to T.30: 5.3.2.4 this should be no less than 75 ms; however,
-in practice some receivers are slow to drop their CFR transmission
-carrier and need more time to start up their reception carrier.
-.TP
 .B Class1SwitchingCmd
 The command used to ensure that the sending facsimile device has turned
 off its modulator (i.e. loss-of-carrier)