Eric Yeo wrote:
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 
Yep :-)
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.
Got all that - but still I think the logic you imploy is not correct: since CRTSCTS is already being set for the modem device, its kind of silly to set it and then disable it again - instead, simply enable it if needed (disable-crtscts not being set). I submit exhibit A - smsc_at2 disable-crtscts patch, the Oded way ;-)

-- 
Oded Arbel
m-Wise mobile solutions

--- gw/smsc_at2.c       2002-06-06 17:09:24.000000000 +0000
+++ gw/smsc_at2.c       2002-07-13 14:22:47.000000000 +0000
@@ -79,7 +79,8 @@
     tios.c_oflag &= ~ONLCR; /* no NL to CR-NL mapping outgoing */
     tios.c_iflag |= IGNPAR; /* ignore parity */
     tios.c_iflag &= ~INPCK;
-    tios.c_cflag |= CRTSCTS; /* enable hardware flow control */
+    if (privdata->modem->use_crtscts)
+       tios.c_cflag |= CRTSCTS; /* enable hardware flow control */
     tios.c_cc[VSUSP] = 0; /* otherwhise we can not send CTRL Z */
 
     /*
@@ -2053,6 +2131,9 @@
         modem->message_storage = cfg_get(grp, octstr_imm("message-storage"));
 
         cfg_get_bool(&modem->enable_mms, grp, octstr_imm("enable-mms"));
+       
+       cfg_get_bool(&modem->use_crtscts, grp, octstr_imm("disable-crtscts"));
+       modem->use_crtscts = !modem->use_crtscts;
 
         /*     
         if (modem->message_storage == NULL)

Reply via email to