Click to See Complete Forum and Search --> : Serial port programming


KenHorse
12-19-2004, 02:16 PM
I posted this in the Technical groups when perhaps, I should have posted it here. So please forgive the bandwidth :D


I am currently using /dev/ttyS1 in a standalone binary that uses only Xon/Xoff for handshaking. This means DTR, RTS, etc aren't being used. The thing is, this binary obviously "opens and "closes" the serial port as part of its operation.

I'm hoping to set RTS to one state for 1 second , then reset it back to its original state, then call this binary. I want to use RTS as a "reset" line for an embedded processor. I would have to do this external of the binary obviously.

I have a few questions regarding this:

1) I know I can use ioctl() for setting and resetting RTS. But would the act of closing the device force RTS to a different state than it was left when port is closed (I need RTS to be high, until I specifically tell it to go low)

2) Is there anyway to manipulate RTS via a shell script?

Thanks in advance for any answers!

glasdave
12-19-2004, 02:44 PM
Maybe this will point you in a direction.]http://www.modem.com/glossary/[/URL]

KenHorse
12-20-2004, 01:53 PM
Originally posted by glasdave
Maybe this will point you in a direction.]http://www.modem.com/glossary/[/URL]


that's a bad URL, although I looked over the site in general and didn't see anything of interest.

Perhaps you could clarify what you had in mind?

bwkaz
12-25-2004, 11:24 PM
Doesn't the kernel serial driver set one of the control lines high (or low, whatever) when you open the port, and reset it when you close the port? DSR perhaps?

Otherwise, if you can't make it use whatever other line that is, you could do the ioctl to set RTS high, then sleep(1), then do the ioctl to set RTS low. Keep the serial device file open between calls to ioctl.