]> git.ipfire.org Git - thirdparty/HylaFAX.git/commitdiff
Bug 469: remove superfluous bytes from DCS
authorLee Howard <faxguy@howardsilvan.com>
Mon, 17 Nov 2003 20:07:40 +0000 (20:07 +0000)
committerLee Howard <faxguy@howardsilvan.com>
Mon, 17 Nov 2003 20:07:40 +0000 (20:07 +0000)
faxd/Class1Send.c++
util/Class2Params.c++

index 3d4d0ab3bb654d285914cd8b4ac4bc29ae208e66..f9b1e2c7228af720fa87091a686c061b203305d9 100644 (file)
@@ -502,7 +502,7 @@ Class1Modem::sendTraining(Class2Params& params, int tries, fxStr& emsg)
     }
     u_int dcs = params.getDCS();               // NB: 24-bit DCS and
     u_int dcs_xinfo = params.getXINFO();       //     32-bit extension
-    if (conf.class1ECMFrameSize == 64)
+    if (conf.class1ECMFrameSize == 64 && dcs_xinfo)
        dcs_xinfo |= DCSFRAME_64;
     /*
      * Select Class 1 capability: use params.br to hunt
index b5614ff1a3ae99615ec735adf1019ccffe042e89..cedfe1eb37fcdaa7c7f3f5a9bbc455bc548649f4 100644 (file)
@@ -327,7 +327,7 @@ Class2Params::getDCS() const
            | lnDISTab[ln&3]
            | dfDISTab[df&3]
            | stDCSTab[st&7]
-           | DCS_XTNDFIELD
+           | (getXINFO() != 0 ? DCS_XTNDFIELD : 0)
            ;
     return (dcs);
 }
@@ -338,16 +338,20 @@ Class2Params::getDCS() const
 u_int
 Class2Params::getXINFO() const
 {
-    // include support for extended resolutions
-    u_int dcs_xinfo = (1<<24) | (1<<16) | (1<<8)       // extension flags for 3 more bytes
-       | (vr & VR_R8 ? DCS_200X400 : 0)
-       | (vr & VR_R16 ? DCS_400X400 : 0)
-       | (vr & VR_200X100 ? DCS_INCHRES : 0)
-       | (vr & VR_200X200 ? DCS_INCHRES : 0)           // DCS_7MMVRES set in getDCS()
-       | (vr & VR_200X400 ? (DCS_200X400 | DCS_INCHRES) : 0)
-       | (vr & VR_300X300 ? (DCS_300X300 | DCS_INCHRES) : 0)
-       | (ec & EC_ENABLE ? DCS_ECMODE : 0)
-       | (df == DF_2DMMR ? DCS_G4COMP : 0)
+    // extension flags for 3 more bytes
+    u_int firstbyte  = 0;
+    u_int secondbyte = (1<<24);
+    u_int thirdbyte  = (1<<24) | (1<<16);
+    u_int fourthbyte = (1<<24) | (1<<16) | (1<<8);
+    u_int dcs_xinfo =
+         (vr & VR_R8 ? (DCS_200X400 | thirdbyte) : 0)
+       | (vr & VR_R16 ? (DCS_400X400 | thirdbyte) : 0)
+       | (vr & VR_200X100 ? (DCS_INCHRES | thirdbyte) : 0)
+       | (vr & VR_200X200 ? (DCS_INCHRES | thirdbyte) : 0)     // DCS_7MMVRES set in getDCS()
+       | (vr & VR_200X400 ? (DCS_200X400 | DCS_INCHRES | thirdbyte ) : 0)
+       | (vr & VR_300X300 ? (DCS_300X300 | DCS_INCHRES | thirdbyte ) : 0)
+       | (ec & EC_ENABLE ? (DCS_ECMODE | firstbyte) : 0)
+       | (df == DF_2DMMR ? (DCS_G4COMP | firstbyte) : 0)
        ;
     return (dcs_xinfo);
 }