Lost support for baud rate of 230400 after minor Cygwin upgrade

David le Comte david.lecomte@avegasystems.com
Thu Feb 15 23:28:00 GMT 2007


Hi all,

_Background:_

Two days ago, I upgraded my Cygwin to extend my "admin" components so that
I could use cron.  When I did this I found that a program I had previously
written to set a baudrate on a serial port to 230400bps is now failing, 
whereas
before it was OK.  Note that using stty -F /dev/comX where X is the
"Comm port number" still works, ie it can still set the baud rate to 230400
(or even 250000).

Here is my C code:
   /if ((cfsetispeed(&t,local_rate) != -1) && 
(cfsetospeed(&t,local_rate) != -1))
    {
      if (tcsetattr(rtnval,TCSANOW,&t) == -1)
      {
        rtnval = -1;
          fprintf(stderr,"tcsetattr() could not handle the selected baud 
rate.\n");
        }
    }
    else
    {
      rtnval = -1;
      fprintf(stderr,"cfsetispeed() or cfsetopseed() couldnt handle the 
selecetd baud rate.\n");
    }
  }
/Prior to the day before yesterday, the cfsetispeed() and cfsetospeed() 
and tcsetattr() calls
all worked, now tcsetattr() is returning -1 on any baud rate above 115200.

I have attached two cygcheck -svr outputs.  One from a month ago, and
one from this morning.

In an earlier posting, it was noted that whilst Windows had informal 
support for
_any_ baudrate above 115200, Cygwin did not.  It was noted that for 
baudrates
above 115200, Windows XP would pass (via SetCommState()?) the actual
(long) value of the baudrate, to the vendor's driver, which would then 
either
handle it (or not).  This was in contrast to 115200 or lower baud rates, 
where it
would pass a number "#defined" (In the form SBR_nnnnnn) in an include file.

It was suggested that I might attempt to volunteer to first define what 
standard
baudrates that might exist above 115200, and then add these to the list of
defined baudrates in sys/termios.h, and recompile cfsetispeed() and
cfsetospeed(),  and, assumedly(?) tcsetattr() to accept these new defines.
Then, I suppose? I would need to modify fhandler_serial.cc to extend what
it used to do (I guess?) for 230400 and 250000, to an extended list of
baud rates?  [ If there are steps I've got wrong or missed - please jump in
and tell me]

Now, at the time, I found out by experimentation, and from what I found
in my termios.h file, that Cygwin did support 230400 and 250000 bps.
I decided that, whilst I would have liked to go as high as 9216000 bps,
that I could live with 230400.  Now, though, that has been lost.

_Questions:

_a) Is it possible for me to rewind my current version of Cygwin to get 
something that
    will support cron and the two baud rates above 115200 that 
tcsetattr() used to support?
    (ie 230400 and 250000).

b) If not, can someone please give me pointers on how I might download the
    appropriate Cygwin source files, and modify and recompile them.  
Please Note
    that whilst I have the Australian equivalent of a U.S. BSEE, and I 
did do Comp. Sci
    as a Minor in my Bachelor of Science degree, I am principally an 
electronics design
    engineer who writes embedded code to support the H/W I design.  
Similarly I write
    the odd shell script or C program to generate test files etc.  Ie 
"talk slow" :-)

_Postscript:_

I received no response to the following list of baudrates that I proposed.
I list them again for your interest:
230400
250000
460800
500000
921600
and possibly?,
1000000
1843200

regards,

David le Comte
Avega Systems
Sydney
Australia
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: prev_cygcheck
URL: <http://cygwin.com/pipermail/cygwin/attachments/20070215/d4f31ad1/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: latest_cygcheck
URL: <http://cygwin.com/pipermail/cygwin/attachments/20070215/d4f31ad1/attachment-0001.ksh>
-------------- next part --------------
--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


More information about the Cygwin mailing list