On Sun, 2002-07-14 at 00:27, Oded Arbel wrote:
> >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)

May I know where use_crtscts is from? In order to support the
"disable-crtscts" directive, I have added "disable_crtscts" attribute
into the ModemDef structure in smsc_at2.h.

By default, Kannel opens the serial port with hardware flow control.
What I did was merely turn it off when it sees "disable-crtscts = true"
in the configuration file.

What you have done appears convoluted and requires the addition of 2
directives rather than 1. I think my original patch is simpler and it
has been tested to work.

Regards,
Eric Yeo



Reply via email to