]> git.ipfire.org Git - thirdparty/HylaFAX.git/commitdiff
[Bug 413] faxq may not format based on modem capabilities
authorDarren Nickerson <darren.nickerson@ifax.com>
Tue, 6 May 2003 16:02:17 +0000 (16:02 +0000)
committerDarren Nickerson <darren.nickerson@ifax.com>
Tue, 6 May 2003 16:02:17 +0000 (16:02 +0000)
This fix from Lee corrects a problem, introduced when V.34 support was added,
that would result in HylaFAX scheduling (for instance) MR formatted documents
to modems that were only capable of MH. We were increasing BR_ALL ad DF_ALL
without adjusting Class2Parms::encodeCaps() and decodeCaps(). Thanks Lee!

util/Class2Params.c++

index a2dd4df3b80c1c2051e77c9472c61efe130e5cee..1a93aa42488e91e93fcaed1ff6f1272aa2215c7e 100644 (file)
@@ -473,14 +473,15 @@ Class2Params::decode(u_int v)
 u_int
 Class2Params::encodeCaps() const
 {
+    // we can't use all of BR_ALL because we're limited to 32 bits
     return (vr&VR_ALL)
-        | ((br&BR_ALL)<<2)
-        | ((wd&WD_ALL)<<8)
-        | ((ln&LN_ALL)<<13)
-        | ((df&DF_ALL)<<16)
-        | ((ec&EC_ALL)<<18)
-        | ((bf&BF_ALL)<<20)
-        | ((st&ST_ALL)<<22)
+        | ((br&(BR_2400|BR_4800|BR_7200|BR_9600|BR_12000|BR_14400))<<8)
+        | ((wd&WD_ALL)<<14)
+        | ((ln&LN_ALL)<<19)
+        | ((df&DF_ALL)<<22)
+        | ((ec&EC_ALL)<<26)
+        | ((bf&BF_ALL)<<28)
+        | ((st&ST_ALL)<<30)
         ;
 }
 
@@ -488,13 +489,13 @@ void
 Class2Params::decodeCaps(u_int v)
 {
     vr = (v>>0)  & VR_ALL;
-    br = (v>>2)  & BR_ALL;
-    wd = (v>>8)  & WD_ALL;
-    ln = (v>>13) & LN_ALL;
-    df = (v>>16) & DF_ALL;
-    ec = (v>>18) & EC_ALL;
-    bf = (v>>20) & BF_ALL;
-    st = (v>>22) & ST_ALL;
+    br = (v>>8)  & (BR_2400|BR_4800|BR_7200|BR_9600|BR_12000|BR_14400);        // see encoding
+    wd = (v>>14) & WD_ALL;
+    ln = (v>>19) & LN_ALL;
+    df = (v>>22) & DF_ALL;
+    ec = (v>>26) & EC_ALL;
+    bf = (v>>28) & BF_ALL;
+    st = (v>>30) & ST_ALL;
 }
 
 /*