On Sat, 2002-07-13 at 04:01, Oded Arbel wrote:
> Eric Yeo wrote:
> 
> >We have an old Ericsson GM12 with a custom-made serial cable that does
> >not have the control signals wired. When running Kannel 1.2.0, no
> >communications occurs. Turning off hardware flow control helps.
> >
> >Attached is a patch against Kannel 1.2.0 that add an extra directive to
> >the modems group (disable-crtscts). Might help some people.
> >
> >Regards,
> >Eric Yeo
> >
> >  
> >
> >------------------------------------------------------------------------
> >
> >Only in gateway-1.2.0-ttey/doc/alligata: alligata.tex
> >Only in gateway-1.2.0-ttey/doc/alligata: alligata.tmp
> >diff -r -c gateway-1.2.0/gw/smsc_at2.c gateway-1.2.0-ttey/gw/smsc_at2.c
> >*** gateway-1.2.0/gw/smsc_at2.c      Tue May 14 09:57:36 2002
> >--- gateway-1.2.0-ttey/gw/smsc_at2.c Fri Jul 12 15:01:54 2002
> >***************
> >*** 82,87 ****
> >--- 82,91 ----
> >      tios.c_cflag |= CRTSCTS; /* enable hardware flow control */
> >      tios.c_cc[VSUSP] = 0; /* otherwhise we can not send CTRL Z */
> >  
> >+     if (privdata->modem->disable_crtscts) {
> >+         tios.c_cflag &= ~CRTSCTS; /* disable hardware flow control */
> >+     }
> >+ 
> >  
> >
> The idea is solid, but the logic is broken - I think you should instead 
> test for disable_crtscts earlier and only turn on that bit on the 
> tios.c_cflag if it's turned off (a 'not' test).
> or better : have a use_crtscts in the modem data structure, turn the bit 
> on only if it is set, and on initialization, init the use_crtscts flag 
> to true and set it to false only if "disable-crtscts" is set in the 
> configuration.
> 
> -- 
> Oded Arbel
> m-Wise mobile solutions

Either I don't understand what you are saying or you should perhaps take
another look at the patch. The patch introduces the new directive
"disable-crtscts". If this directive is set to "true" for the modem, the
CRTSCTS bit is turned off. If the directive is missing or set to
"false", the CRTSCTS is set on as per the default.

The line "tios.c_cflag &= ~CRTSCTS" effectively turns off the CRTSCTS
bit regardless of its previous value. There is no need to "toggle" (so
to speak).

Regards,
Eric Yeo


Reply via email to