TrainingPeaks WKO+ Version 22 build 105

Juan Lang juan.lang at gmail.com
Thu Feb 26 16:21:54 CST 2009


Hi Chris,

On Wed, Feb 25, 2009 at 4:14 PM, Chris Teague <chris.teague at gmail.com> wrote:
> I'm connecting to a Saris PowerTap 2.4SL bike computer, but really
> it's a usb cradle using a standard FTDI chip.  The device enumerates
> and works fine as a ttyUSB device under Linux.  I have gotten closer
> to the root of this problem, and I now see why EV_RXFLAG was never
> implemented in Wine.  I'll explain the problem, maybe someone with
> more Wine knowledge can nudge me in the direction of a good solution.
> RXFLAG is a parameter in the COM32 interface, there is one RXFLAG
> value for each COM port.  Other per COM port parameters in the COM32
> interface are "end of file character", "parity", etc.
> RXFLAG is set to any character the user wants - and when that
> character is actually received on the COM port, a special EV_RXFLAG
> event is sent to the client.  This is used for example to implement a
> Start-of-Message in a serial protocol.

Wacky.  Well, not that wacky, I get it, but still..

> In Linux (and Wine) the per serial port device configuration data is
> stored in a standard unix termios structure associated with the file
> descriptor.  This structure has members for most of the COM32
> parameters, EOF, EOL, etc.  However, it does NOT have anything that
> would correspond to RXFLAG.  We could store RXFLAG inside of some
> unused termios member - but that feels like a really bad idea.
>
> So the crux of the problem is: How do I store per serial port
> configuration data which does not fit into termios?
>
> I have been looking at dlls/ntdll/serial.c mostly.  I see there is
> some server side serial code in server/serial.c.  Maybe I need to
> store this config data in the server, and provide access to it?
> Possibly in async_commio.hDevice?

I assume you've read enough to follow the flow of this.  I'll repeat
it, just to make sure we're on the same page.  To set the event
character, you modify a DCB structure's EvtChar member, and call
SetCommState, implemented by Wine in dlls/kernel/comm.c.  That, in
turn, calls DeviceIoControl a few times.  The relevant call is with
IOCTL_SERIAL_SET_CHARS as the IO control code.  That eventually finds
its way to set_special_chars in dlls/ntdll/serial.c, where we see this
comment:
    /* FIXME: sc->EventChar is not supported */

If you're just looking for a place to stick the new datum, yeah, the
server's the right place.  You'd probably want to add the event
character to the get_serial_info/set_serial_info requests.  See
server/protocol.def.  You could also invent a new get/set call for
this, but I'm not sure that's necessary.

Adding it is only part of it.  Actually implementing it correctly will
be harder, I assume.  I probably won't be much help there.

Good luck,
--Juan



More information about the wine-devel mailing list