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

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



On Tue, Jan 29, 2002 at 10:52:46AM -0600, John Joseph Roets wrote:
> > Andrew Arensburger wrote:
> > 	How about a "modem" listen block flag and "-M" command-line
> > option?
> 
> Andrew, since it appears that ColdSync need be set to the appropriate initial
> speed, and that speed _does_ need to be set (and not just deleted as I
> originally thought/posted, how about this solution:  A listen block directive
> [init_speed] is provided to allow one to override the default B9600 initial
> connect speed.  This would solve the problem for me, and likely any other device
> with strange comm settings to come.  This would make the change more generic,
> and avoid more need for like minded changes later.

	First of all, I'm confused as to why it wouldn't be sufficient
to delete the cfset{i,o}speed() calls. When the device is opened,
isn't it already set to some speed? Why not just leave it at that
speed? (Or don't you know? Perhaps this is a deep mystery.)

	Secondly, the CMP speed of 9600 bps is mandated by the HotSync
protocol for serial connections. The only exception to this is what
you've encountered, in which the Right Thing is to set it to whatever
speed the modem is already set to.
	Hence, one solution would be to make the 'modem' flag mean

	ispeed = cfgetispeed();
	ospeed = cfgetospeed();
	cfsetispeed(ispeed);
	cfsetospeed(ospeed);

A yet more generic solution would be the 'init_speed' solution you
suggested, and make 'init_speed: 0' mean "set it to the current
speed," as above.

	But I'm still curious as to why you can't just delete the two
cfset[io]speed() lines. Could you add calls to cfget[io]speed() just
before, and see what they report?

-- 
Andrew Arensburger                      This message *does* represent the
arensb@ooblick.com                      views of ooblick.com
	   Jesus saves, Moses earns, but the Mongol Hordes.

-- 
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.