Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Message-ID: <4086A1D2.7A8A84DA@iee.org> Date: Wed, 21 Apr 2004 17:31:14 +0100 From: Don Sharp MIME-Version: 1.0 To: gnuwin32 Subject: Re: stty under cygwin References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 21 Apr 2004 16:31:17.0220 (UTC) FILETIME=[11FBCA40:01C427BE] X-IsSubscribed: yes Dave Korn wrote: > > > -----Original Message----- > > From: cygwin-owner On Behalf Of bertrand marquis > > Sent: 21 April 2004 16:41 > > > i need to use stty to send commands through the serial port > > under cygwin: > > That's not what stty is for. > > > stty > > 1:0:cbd:0:3:1c:7f:15:4:5:1:0:11:13:1a:0:12:f:17:16:0:0:0:0:0:0 > > :0:0:0:0:0:0:0:0:0:0 > > < /dev/ttyS0 > > > > but stty answer me that 1:...:0 is a wrong argument ? > > I'm using the last version of cygwin and the serial port is working > > > > anyone has an idea ? > > #1: You've completely misunderstood stty. It allows you to set parameters > such as baud rate, flow control, char translation, etc. for a serial port. > It's not for sending data in or out of it. > > #2: That string of colon-separated hex numbers doesn't mean anything to > stty. None of the arguments it understands come in that form. > > #3: If you're trying to send something out the serial port, you should be > using "> /dev/ttyS0", not "< /dev/ttyS0". You're telling stty to take any > standard input it requires from the serial port. That's not going to work. > > #4: Haven't you ever heard of the "--help" option, or the "man" or "info" > utilities? Repeat after me: > > stty --help > man stty > info stty > > over and over again until you've got it memorized! Suggest you look at the -g option to stty $ stty -g 50e:9:b0:d1f:0:f:0:0:4:8:3:15:16:1:1c:12:11:13:1a:0:0:17 Cheers Don Sharp > > #5: At a guess, you want to turn those hex numbers into actual bytes sent > out the serial port. Why do you have 'cbd' as one of them? That's too > large for a byte-sized value. > > #6: To send data out the serial port, use echo or cat (depending where the > data is), and redirect it to the serial port with >/dev/ttyS0. > > #7: I dunno how you'd get hex numbers converted into actual bytes at the > command line. You need a command that does the opposite of "od". Assuming > there was such a thing, you could then write > > echo > 1:0:cbd:0:3:1c:7f:15:4:5:1:0:11:13:1a:0:12:f:17:16:0:0:0:0:0:0:0:0:0:0:0:0:0 > :0:0:0 | [opposite-of-od] | cat > /dev/ttyS0 > > (that's all one line; sorry about any wrapping). > > cheers, > DaveK > -- > Can't think of a witty .sigline today.... > > -- > 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/ -- 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/