[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avrdude-dev] serial_baud_lookup unnecessary?
From: |
Joerg Wunsch |
Subject: |
Re: [avrdude-dev] serial_baud_lookup unnecessary? |
Date: |
Tue, 12 May 2009 14:39:42 +0200 |
User-agent: |
Mutt/1.5.11 |
As Gerard wrote:
> No more checks, any BAUD rate accepted. After compiling and testing with
> 195313, it turns out it works absolutely fine.
The question is: are you sure it will work with /any/ Windows driver
that way?
Technically MSDN describes the respective DCB field:
BaudRate
The baud rate at which the communications device operates. This
member can be an actual baud rate value, or one of the following
indexes.
Where "indexes" refers to the CBR_xxx constants. To me, this looks
like it might once have required the use of the CBR_xxx constants,
while the possible choice of an arbitrary baud rate has been added
later.
I'd recode it to return the CBR_xxx constants if any match could be
found, and pass the actual baud rate figure through otherwise. I
think that's the safest possible implementation.
The Posix implementation has a similar restriction, only that the
speed names are Bxxx there. As modern Posix implementations also
accept an arbitrary number for the actual baud rate, I think the same
implementation should be chosen there: try looking up the baud rate
name, and failing that, pass the baud rate figure through.
Care to submit a patch tracker?
--
cheers, J"org .-.-. --... ...-- -.. . DL8DTL
http://www.sax.de/~joerg/ NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)