[hcflinux] Re: [hylafax-devel] Re: HCF driver with Hylafax

Marc Boucher marc at mbsi.ca
Wed May 29 08:43:17 EDT 2002


Hi Lee,

On Wed, May 29, 2002 at 12:37:17AM -0700, Lee Howard wrote:
> On 2002.05.28 22:15 Marc Boucher wrote:
> >On Wed, May 29, 2002 at 12:56:26AM -0400, Alok K. Dhir wrote:
> 
> >> AT+FCLASS=?
> >> +FCLASS:(0,1,1.0)
> 
> >faxaddmodem is confused by the +FCLASS: prefix in the modem's response;
> >that's easy to fix (see patch below)
> 
> >--- faxaddmodem.ORIG	Wed May 29 01:01:55 2002
> >+++ faxaddmodem	Wed May 29 01:08:46 2002
> >@@ -1178,7 +1178,7 @@
> > echo ""
> > if [ "$RESULT" = "OK" ]; then
> >     # Looks like a Class 1, 2, or 2.0 modem, get more information
> >-    case "`echo $RESPONSE | $SED -e 's/[()]//g'`" in
> >+    case "`echo $RESPONSE | $SED -e 's/\+FCLASS://' -e 's/[()]//g'`" in
> >     1)			configureClass1Modem;;
> >     2)			configureClass2Modem;;
> >     2.0)		configureClass2dot0Modem;;
> 
> This section of code changed in HylaFAX CVS last week with the initial 
> Class 2.1 support.  The particular usage of sed has not changed, but the 
> manner in which the response is parsed has changed, and in this case 
> HylaFAX CVS (to eventually become 4.1.3) will work just fine with the 
> "+FCLASS:(0,1,1.0)" response to AT+FCLASS=?.  It would not have worked if 
> the response were "+FCLASS:(1,1.0)".

Yes, I saw these changes in CVS just after sending the email. :-)

> Note, however, that if the HCF driver follows this pattern of reporting, 
> i.e.:
> 
> AT+FTM=?
> +FTM:(3,24,48,72,73,74,96,97,98,121,122,145,146)
> 
> that there will be further problems, and if it doesn't continue the 
> pattern of reporting, then the exception in the case of +FCLASS=? seems 
> unfortunate.

It does continue with this pattern. The patch below (against CVS)
implements a workaround for the problem in the places where I have hit
it until now (presently facing other blocking points due to HCF driver
issues which I'm working to solve..).

Regards
Marc


--- faxd/Class1.c++	2002/05/29 07:20:38	1.1
+++ faxd/Class1.c++	2002/05/29 07:30:43
@@ -904,6 +904,7 @@
 Class1Modem::parseQuery(const char* cp, Class1Cap caps[])
 {
     bool bracket = false, first = true;
+	char *cp2;
     
     while (cp[0]) {
 	if (cp[0] == SPACE) {		// ignore white space
@@ -911,6 +912,13 @@
 	    continue;
 	}
 
+		/* some modems, such as Conexant HCF include the original +CMD:
+		 * as prefix in the response; ignore it -marc at mbsi.ca
+		 */
+        if (cp[0]=='+' && first && (cp2 = strchr(cp, ':'))) {
+			cp = cp2 + 1;
+		}
+
         /* by a.pogoda at web.de, jan 21st 2002
          * workaround for modems sending (<item>,<item>,...), i.e. 
          * enclosed in brackets rather than just <item>,<item>,...
--- faxd/ClassModem.c++	2002/05/29 07:28:24	1.1
+++ faxd/ClassModem.c++	2002/05/29 07:31:09
@@ -1057,6 +1057,15 @@
     while (nargs-- > 0) {
 	while (cp[0] == SPACE)
 	    cp++;
+
+	/* some modems, such as Conexant HCF include the original +FCLASS:
+	 * as prefix in the response; ignore it -marc at mbsi.ca
+	 */
+	char *cp2;
+	if (cp[0]=='+' && (cp2 = strchr(cp, ':'))) {
+		cp = cp2 + 1;
+	}
+
 	char matchc;
 	bool acceptList;
 	if (cp[0] == OPAREN) {				// (<items>)



More information about the hcflinux mailing list