Quoting "MUDr. Tom� Hossz�" <[EMAIL PROTECTED]>:
> > ...
>
> I did some tuning, and I found out, what exactly needs to wait.
>
> setting RTS OFF, works on standard serial port immediately. but on
> USBserial, it needs some time.
> I do it this way:
>
> ioctl(port, TIOCMGET, &control); -> RTS is ON
> control &= ~(TIOCM_RTS);
> ioctl(port, TIOCMSET, &control); ->should be set RTS OFF
> ioctl(port, TIOCMGET, &control); -> this says RTS is OFF, but in
> real it is not.
>
> TIOCMSET needs some time to set RTS OFF e.g. sleep(1);
> strange is that checking for TIOCMGET without sleep says RTS is OFF so I
> cannot wait with while statement (while (RTS OFF) {TIOCMGET}).
You have to bear in mind that when you set the signal on an handshake pin on a
USB serial port, the command as to be encapsulated into a USB "packet" and sent
down the wire, along with other traffic that may be on the way.
This is unlike a "standard" serial port where you only have to do an "outb" to
the corresponding register on the serial port chip (16550, etc.). This can be
done synchronously.
Anyway, you should try to first set the serial port parameters, and only then
set the handshake pin.
If you send the byte after that, then the start bit should appear on the serial
port *just after* the handshake line is set.
If this is not enough for the device (I bet it isn't) then it is the device's
fault to need a little time to wake up, and you should sleep for the time the
device needs to wake up.
> it should be possible, because using original software on MS Windows
> doesnt have this problem. (or it uses simply sleep :-( )
It is very likely that it does sleep.
You can check this out yourself easily with an osciloscope. If you can't get
one, I wrote a million years ago a small Windows application that did a logic
analyser using the handshakes of a serial port. I can try to find it, if you
think it would be useful.
I hope this helps,
---
Paulo Marques - www.grupopie.com
"In a World without walls and fences, who needs windows and gates?"
-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel