public inbox for cygwin-apps@cygwin.com
 help / color / mirror / Atom feed
* tcgetattr() doesn't support 50 baud
@ 2006-06-23  9:42 Lapo Luchini
  2006-06-23 11:26 ` [PATCH] " Lapo Luchini
  0 siblings, 1 reply; 3+ messages in thread
From: Lapo Luchini @ 2006-06-23  9:42 UTC (permalink / raw)
  To: cygwin-apps; +Cc: Troy Curtiss

http://cygwin.com/cgi-bin/cvsweb.cgi/src/winsup/cygwin/fhandler_serial.cc?rev=1.66&content-type=text/x-cvsweb-markup&cvsroot=src
http://ecos.sourceware.org/ml/cygwin-patches/2005-q3/msg00071.html

It seems that support for 50 baud rate was forgotten, so... tcgetattr
returns "EINVAL" if the serial is set that way.
Setting it to 50 baud using tcsetattr works correctly though.

For the one of you wondering why on earth should anyone use 50 baud, the
answer is: DCF77 serial receivers ;-)

I'll try and add the support for B50 in in and send a patch ASAP.

-- 
Lapo Luchini
lapo@lapo.it (OpenPGP & X.509)
www.lapo.it (Jabber, ICQ, MSN)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] tcgetattr() doesn't support 50 baud
  2006-06-23  9:42 tcgetattr() doesn't support 50 baud Lapo Luchini
@ 2006-06-23 11:26 ` Lapo Luchini
  2006-06-23 12:05   ` Corinna Vinschen
  0 siblings, 1 reply; 3+ messages in thread
From: Lapo Luchini @ 2006-06-23 11:26 UTC (permalink / raw)
  To: cygwin-apps

Lapo Luchini wrote:
> I'll try and add the support for B50 in in and send a patch ASAP.
>   
Modified, patched, and tested:

--- fhandler_serial.cc.orig    2006-01-16 18:14:36.000000000 +0100
+++ fhandler_serial.cc    2006-06-23 11:49:26.000000000 +0200
@@ -608,6 +608,9 @@
      0 is an invalid bitrate in Win32 */
       dropDTR = true;
       break;
+    case B50:
+      state.BaudRate = 50;
+      break;
     case B110:
       state.BaudRate = CBR_110;
       break;
@@ -915,6 +918,9 @@
   /* -------------- Baud rate ------------------ */
   switch (state.BaudRate)
     {
+    case 50:
+    t->c_ospeed = t->c_ispeed = B50;
+    break;
     case CBR_110:
     t->c_ospeed = t->c_ispeed = B110;
     break;


-- 
Lapo Luchini
lapo@lapo.it (OpenPGP & X.509)
www.lapo.it (Jabber, ICQ, MSN)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] tcgetattr() doesn't support 50 baud
  2006-06-23 11:26 ` [PATCH] " Lapo Luchini
@ 2006-06-23 12:05   ` Corinna Vinschen
  0 siblings, 0 replies; 3+ messages in thread
From: Corinna Vinschen @ 2006-06-23 12:05 UTC (permalink / raw)
  To: cygwin-apps

On Jun 23 13:26, Lapo Luchini wrote:
> Lapo Luchini wrote:
> > I'll try and add the support for B50 in in and send a patch ASAP.
> >   
> Modified, patched, and tested:
> 
> --- fhandler_serial.cc.orig    2006-01-16 18:14:36.000000000 +0100
> +++ fhandler_serial.cc    2006-06-23 11:49:26.000000000 +0200
> @@ -608,6 +608,9 @@
>       0 is an invalid bitrate in Win32 */
>        dropDTR = true;
>        break;
> +    case B50:
> +      state.BaudRate = 50;
> +      break;
>      case B110:
>        state.BaudRate = CBR_110;
>        break;
> @@ -915,6 +918,9 @@
>    /* -------------- Baud rate ------------------ */
>    switch (state.BaudRate)
>      {
> +    case 50:
> +    t->c_ospeed = t->c_ispeed = B50;
> +    break;
>      case CBR_110:
>      t->c_ospeed = t->c_ispeed = B110;
>      break;

Thanks for the patch, but

- this is the wrong list, use cygwin-patches, please.
- A ChangeLog entry is missing.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-06-23 12:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-06-23  9:42 tcgetattr() doesn't support 50 baud Lapo Luchini
2006-06-23 11:26 ` [PATCH] " Lapo Luchini
2006-06-23 12:05   ` Corinna Vinschen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).