Re: TrainingPeaks WKO+ Version 22 build 105

2009-02-26 Thread Juan Lang
Hi Chris,

On Wed, Feb 25, 2009 at 4:14 PM, Chris Teague chris.tea...@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




Re: TrainingPeaks WKO+ Version 22 build 105

2009-02-25 Thread Chris Teague
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.
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?

On Fri, Feb 20, 2009 at 8:07 AM, Juan Lang juan.l...@gmail.com wrote:
 Hi Chris!

 I think I know how to implement this feature of Win32 serial comm, but
 before I attempted I wanted to broadcast my intent to do so.  Is
 anyone else working on this, or in the serial.c area that would like
 to discuss it?

 No one that I know of is working in this area.  Periodically someone
 might work on serial comm stuff, particularly Uwe Bonnes, but in
 general this area languishes until someone motivated comes along.

 So please, work away :)  Out of curiosity, which device are you playing with?

 Cheers,
 --Juan





TrainingPeaks WKO+ Version 22 build 105

2009-02-20 Thread Chris Teague
I'm trying to use WKO, it is software which communicates via USB to an
external device (watch/heart rate monitor/bike odometer) using FTDI
drivers.  When I plug in the device dmesg tells me it's recognized and
placed on /dev/ttyUSB0.  I've put a link to that inside of
.wine/dosdevices/com1.  I still can't get communication to work, on
stdout I get the following message repeated many times:
fixme:comm:wait_on EV_RXFLAG not handled

I think I know how to implement this feature of Win32 serial comm, but
before I attempted I wanted to broadcast my intent to do so.  Is
anyone else working on this, or in the serial.c area that would like
to discuss it?

Software is available as demo here:
http://home.trainingpeaks.com/wko-desktop-software/download.aspx




Re: TrainingPeaks WKO+ Version 22 build 105

2009-02-20 Thread Juan Lang
Hi Chris!

 I think I know how to implement this feature of Win32 serial comm, but
 before I attempted I wanted to broadcast my intent to do so.  Is
 anyone else working on this, or in the serial.c area that would like
 to discuss it?

No one that I know of is working in this area.  Periodically someone
might work on serial comm stuff, particularly Uwe Bonnes, but in
general this area languishes until someone motivated comes along.

So please, work away :)  Out of curiosity, which device are you playing with?

Cheers,
--Juan