[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [coldsync-hackers] modem sync success -- details for contribution



On Thu, Jan 24, 2002 at 01:35:41PM -0600, John Joseph Roets wrote:
> > > This only requires disabling 2 lines within
> > PConnection_serial.c
> >
> > 	Which two lines have you deleted?
> 
> Lines 500-501.

	In version 2.2.5, that's a blank line and the start of a
comment. Which version are you working on?

> The following lines (499-501) cause garbled data to make it to ColdSync, which
> then fails.  The modem does not need the initial handshaking to decide upon a
> speed, as does the cradle:
> 	/* Set initial rate. 9600 bps required for handshaking */
> 	cfsetispeed(&term, B9600);
> 	cfsetospeed(&term, B9600);

	Aw, crap.
	Yes, it makes sense to have a separate listen type. OTOH, it
doesn't really make sense to add a whole lot of code just because of
these two lines.
	How about a "modem" listen block flag and "-M" command-line
option? The rationalization goes as follows: the serial listen type is
applies to more than just serial lines, e.g., syncing over stdin.
Someone out there is bound to write a brain-damaged OS that allows you
to set the speed on a TCP socket or something, and the same problem
will show up. So just add a "modem" flag similar to the "transient"
flag (look for LISTENFL_TRANSIENT and PCONNFL_TRANSIENT).

	Alternately, define PCONNFL_MODEM as above; define
LISTEN_MODEM, but only use it in new_PConnection():

	switch (listenType) {
	    case LISTEN_MODEM:
		flags |= PCONNFL_MODEM;
		if (pconn_serial_open(pconn, device, protocol, flags)
		    < 0)
		...

I'm leaning toward the first solution since it says "It's a serial
line (oh, by the way, it's a modem)". The second solution is more like
"It's not a serial line, it's a modem, you fool!" which might seem
counterintuitive to the Unix-savvy.

-- 
Andrew Arensburger                      This message *does* represent the
arensb@ooblick.com                      views of ooblick.com
			  Will work for sex.

-- 
This message was sent through the coldsync-hackers mailing list.  To remove
yourself from this mailing list, send a message to majordomo@thedotin.net
with the words "unsubscribe coldsync-hackers" in the message body.  For more
information on Coldsync, send mail to coldsync-hackers-owner@thedotin.net.