This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: 1.5.18: get strange characters from rs232-port on a Windows XP machine
- From: Brian Dessent <brian at dessent dot net>
- To: cygwin at cygwin dot com
- Date: Mon, 08 Aug 2005 21:47:23 -0700
- Subject: Re: 1.5.18: get strange characters from rs232-port on a Windows XP machine
- References: <200508081714.50312.MoritzHerrmann05@gmx.de>
- Reply-to: cygwin at cygwin dot com
Moritz Herrmann wrote:
> I'm working on a little c program to receive and save strings from the
> serial-port into a local file on a Windows XP/2003 Server machine.
> The program is working very well on a linux machine but if I try to run it
> under windows I just get stupid characters like:
If you want to use the serial port under Cygwin you need to open
/dev/ttyS1 and not "com2". Remember that Cygwin is trying to emulate a
posix environment.
http://cygwin.com/cygwin-ug-net/using-specialnames.html
You can in fact open the serial devices as "com1", "com2" etc. But in
doing so you implicily tell Cygwin that you are going to use Windows
native methods to access the port, and so things like tcgetattr() and
tcsetattr() will have no effect -- you would have to use the native
win32 API serial port functions. That is why it only works if you first
initialize the port with hyperterminal.
Brian
--
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/