]> git.ipfire.org Git - thirdparty/HylaFAX.git/commitdiff
[Bug 302] support MultiTech Real-Time Fax Compression Conversion
authorDarren Nickerson <darren.nickerson@ifax.com>
Tue, 11 Jun 2002 21:25:16 +0000 (21:25 +0000)
committerDarren Nickerson <darren.nickerson@ifax.com>
Tue, 11 Jun 2002 21:25:16 +0000 (21:25 +0000)
Thanks to the close cooperation between Lee and Steve@MultiTech, this
is an almost overnight reality. Thanks fellas!
This patch implements RTFCC via a Class2RTFCC config option, and changes
the default prototype config for the MT5634ZBA/ZPX-PCI-V92 modems to
not receive in MMR..., since HylaFAX is apparently unable to receive an
MMR fax properly [Bug 223]

config/lucent-mt-20
config/lucent-mt-21
faxd/Class20.c++
faxd/Class2Send.c++
faxd/FaxSend.c++
faxd/ModemConfig.c++
faxd/ModemConfig.h
man/hylafax-config.4f

index 39a0d237945dca11c2f073786d9d6c2c87da3ea4..e3109e36552c124262a447d5ed9486330fe5de8b 100644 (file)
@@ -5,6 +5,7 @@
 
 #
 # CONFIG: CLASS2.0:"Multi-Tech Systems"-"MT5634ZBA"-*
+# CONFIG: CLASS2.0:"Multi-Tech Systems"-"MT5634ZPX"-*
 #
 # BEGIN-SERVER
 # END-SERVER
@@ -21,3 +22,9 @@ Class2BUGCmd:         AT+FBU=0                # early firmware is buggy
 Class2CQCmd:           AT+FCQ=1,0
 Class2SendRTC:         yes
 Class2UseHex:          yes
+
+# versions that respond to AT+FFC=? with non-zero data support RTFCC
+# Class2RTFCC:         yes
+
+# unfortunately, HylaFAX can't currently receive in MMR
+ModemAnswerCmd:                AT+FCC=01,05,02,02,02,01,00,07,7F;A
index ec07a0f56274425b151e4878574a1973b60cefd3..3d9b747e805ff547c5ff6b7dc5e962a6884b5dc2 100644 (file)
@@ -5,6 +5,7 @@
 
 #
 # CONFIG: CLASS2.1:"Multi-Tech Systems"-"MT5634ZBA"-*
+# CONFIG: CLASS2.1:"Multi-Tech Systems"-"MT5634ZPX"-*
 #
 # BEGIN-SERVER
 # END-SERVER
@@ -21,3 +22,9 @@ Class2BUGCmd:         AT+FBU=0        # early firmware is buggy
 Class2CQCmd:           AT+FCQ=1,0
 Class2SendRTC:         yes
 Class2UseHex:          yes
+
+# versions that respond to AT+FFC=? with non-zero data support RTFCC
+# Class2RTFCC:         yes
+
+# unfortunately, HylaFAX can't currently receive in MMR
+ModemAnswerCmd:                AT+FCC=7F,0D,02,02,02,01,00,07,7F;A
index abbf30536c5fc3fbe51104a73b7f286062689dea..5ef1db63122c94b85e0240a71c5cf67079808679 100644 (file)
@@ -126,6 +126,31 @@ Class20Modem::abortDataTransfer()
 bool
 Class20Modem::sendPage(TIFF* tif, u_int pageChop)
 {
+    /*
+     * Support MT5634ZBA-V92 real-time fax compression conversion:
+     * AT+FFC=? gives us non-zero data if RTFCC is supported.
+     * Firstly, we must have set our FCC to MMR support (+FCC=,,,,3), and
+     * we may need to have ECM enabled (+FCC=,,,,,1) if we intend to
+     * allow RTFCC to send in MMR.  Now we send <DLE><char> where char =
+     *    6Bh  -  if we formatted the image in MH
+     *    6Ch  -  if we formatted the image in MR
+     *    6Eh  -  if we formatted the image in MMR
+     */
+    if (conf.class2RTFCC) {
+       protoTrace("Enable Real-Time Fax Compression Conversion");
+       uint32 g3opts = 0;
+       char rtfcc[2];
+       rtfcc[0] = DLE;
+       TIFFGetField(tif, TIFFTAG_GROUP3OPTIONS, &g3opts);
+       if (g3opts&GROUP3OPT_2DENCODING == DF_2DMMR)
+           rtfcc[1] = 0x6E;    // MMR
+       else if (g3opts&GROUP3OPT_2DENCODING == DF_2DMR)
+           rtfcc[1] = 0x6C;    // MR
+       else
+           rtfcc[1] = 0x6B;    // MH
+       putModemData(rtfcc, sizeof (rtfcc));
+       }
+
     protoTrace("SEND begin page");
     if (flowControl == FLOW_XONXOFF)
        setXONXOFF(FLOW_XONXOFF, FLOW_NONE, ACT_FLUSH);
index 6e6210cd4813809d7bbd850c7d64f8f55e36b94e..7a6b7c9295b76f5bfd3f31e0be3d63e00af9c301 100644 (file)
@@ -224,9 +224,10 @@ Class2Modem::sendPhaseB(TIFF* tif, Class2Params& next, FaxMachineInfo& info,
        /*
         * Check the next page to see if the transfer
         * characteristics change.  If so, update the
-        * current T.30 session parameters.
+        * current T.30 session parameters.  Don't send DIS if
+        * using RTFCC, although unsetting params may be better.
         */
-       if (pageInfoChanged(params, next)) {
+       if (pageInfoChanged(params, next) && !conf.class2RTFCC) {
            if (!class2Cmd(disCmd, next)) {
                emsg = "Unable to set session parameters";
                break;
index 6a7ff50b98b826d4a1b31dd1d9e1b85944c738ee..039899634d4def18ef03f070f4dc7991e0ede766 100644 (file)
@@ -515,7 +515,7 @@ FaxServer::sendSetupParams1(TIFF* tif,
     if (!TIFFGetField(tif, TIFFTAG_GROUP3OPTIONS, &g3opts))
        g3opts = 0;
     if (g3opts & GROUP3OPT_2DENCODING) {
-       if (!clientInfo.getSupports2DEncoding()) {
+       if (!clientInfo.getSupports2DEncoding() and !class2RTFCC) {
            emsg = "Document was encoded with 2DMR,"
                   " but client does not support this data format";
            return (send_reformat);
@@ -640,7 +640,7 @@ FaxServer::sendSetupParams(TIFF* tif, Class2Params& params, const FaxMachineInfo
        traceProtocol("USE %s", params.pageWidthName());
        traceProtocol("USE %s", params.pageLengthName());
        traceProtocol("USE %s", params.verticalResName());
-       traceProtocol("USE %s", params.dataFormatName());
+       traceProtocol("USE %s image data", params.dataFormatName());
     } else if (status == send_reformat) {
        traceServer(emsg);
     } else if (status == send_failed) {
index 844f1e74215ea416b9f7a5cf99b17351134f15fd..c6cf1e68a457595872d4c406f5f089a45465a5d9 100644 (file)
@@ -217,6 +217,7 @@ ModemConfig::setupConfig()
     waitForConnect     = false;                // unique modem answer response
     class2XmitWaitForXON = true;               // default per Class 2 spec
     class2SendRTC      = false;                // default per Class 2 spec
+    class2RTFCC                = false;                // real-time fax comp. conv.
     class2UseHex       = false;                // historical behavior
     class1TCFRecvHack  = false;                // historical behavior
     setVolumeCmds("ATM0 ATL0M1 ATL1M1 ATL2M1 ATL3M1");
@@ -554,6 +555,8 @@ ModemConfig::setConfigItem(const char* tag, const char* value)
         rtnHandling = getRTNHandling(value);
     else if (streq(tag, "class2usehex"))
        class2UseHex = getBoolean(value);
+    else if (streq(tag, "class2rtfcc"))
+       class2RTFCC = getBoolean(value);
     else
        return (false);
     return (true);
index 5180530d4a61848f7ad5cd4131574f0e142ff13d..36fdbe380aa9adc7fb2a6a912780ebba61df1e72 100644 (file)
@@ -151,6 +151,7 @@ public:
     fxStr      class2MINSPCmd;         // cmd to setup min transmit speed
     fxStr      class2RecvDataTrigger;  // send to start recv
     bool       class2XmitWaitForXON;   // wait for XON before send
+    bool       class2RTFCC;            // real-time fax compression conversion
     bool       class2SendRTC;          // append RTC to page data on transmit
                                        // for class 2.0:
     fxStr      class2PIECmd;           // cmd to set proc interrupt handling
index c22a7a15d2d982ec07339248f996937fb01deb27..4f40a63eafe63df959f1dd1206ea24206985e7e4 100644 (file)
@@ -324,6 +324,7 @@ Class2PTSCmd        string  \s-1AT+FPS\s+1  Class 2.0: command to set received page statu
 Class2PTSQueryCmd      string  \s-1AT+FPTS?\s+1        Class 2.0: command to query received page status
 Class2RecvDataTrigger  string  \s-1``\e22''\s+1        Class 2.0: character to send to trigger recv
 Class2RELCmd   string  \-      Class 2.0: command to enable byte-aligned \s-1EOL\s+1 codes
+Class2RTFCC    boolean \s-1No\s+1      Class 2.0: enable real-time fax compression conversion
 Class2SACmd     string \s-1AT+FSA\s+1  Class 2.0: set destination subaddress string
 Class2SendRTC  boolean \s-1No\s+1      Class 2.0: append \s-1RTC\s+1 to page data on transmit
 Class2SFLOCmd  string  \s-1AT+FLO=1\s+1        Class 2.0: command to set software flow control
@@ -2262,6 +2263,14 @@ will be marked to indicate that
 codes are byte-aligned; otherwise they will be marked as
 not (necessarily) having byte-aligned codes.
 .TP
+.B Class2RTFCC
+Whether or not to enable MultiTech's Real-Time Fax Compression Conversion
+which is available in later firmware revisions for the MT5634ZBA-V92 and 
+MT5634ZPX-PCI-V92 models.  RTFCC allows HylaFAX to convert the image 
+compression between MH MR and MMR formats regardless of how faxq formatted 
+the image file.  If RTFCC is available with your firmware, then the 
+response to ``AT+FFC=?'' is non-zero.
+.TP
 .B Class2SACmd
 A largely unused option for modems supporting ITU-T.32, Class 2.1, 
 standards.  This command would be used to set up the destination