[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [coldsync-hackers] Re: your mail
On Thu, Oct 25, 2001 at 01:51:48AM -0400, Matthew C. Weigel wrote:
> On Wed, 24 Oct 2001, Andrew Arensburger wrote:
> > DLP/PADP/SLP, whereas USB and network Hotsync use DLP over what I've
> > called "netsync", for lack of a better term. The 'protocol' argument
> > determines how pconn->dlp.read and pconn->dlp.write will be
> > initialized.
>
> ?? PConnection_usb.c calls padp_init unconditionally, it appears to me.
> That is, listenType specifies (indirectly) whether dlp.read points to
> netsync_read or padp_read.
You may be looking at an old version, then. I'm describing the
behavior as of version 2.2.0.
> > sample code showing how to use io_bind, io_connect, and io_accept is
> > ColdSync itself, but if you're familiar with bind(), connect() and
> > accept(), it'll make a bit more sense.
>
> OK, so... looking at _usb.c, I can just ignore these three?
io_connect is used to initiate a connection to a remote Palm,
much like connect(). Currently, this is only used for network
connections, so if it's not applicable to your model, you can have
osx_connect() trivially return.
io_bind and io_accept, on the other hand, are used in ordinary
circumstances, to perform functions analogous to those of bind() and
accept(). So you do need to provide them, and have them do the Right
Thing.
> > pconn_osx_open()
> > osx_read()
> > osx_write()
> > osx_close()
>
> So if I'm following this, these are the four non-trivial functions to
> implement, and
Actually, osx_read(), osx_write() and osx_close() will most
likely just be wrappers around read(), write(), and close().
> > osx_bind()
> > osx_accept()
> > osx_connect()
> > osx_drain()
> > osx_select()
>
> are the trivial/noop functions?
osx_bind() neds to call slp_bind() for serial-like
connections.
osx_accept() needs to negotiate a sync speed (CMP handshake)
for serial connections, or exchange ritual packets for netsync
connections.
If it doesn't make sense to open an OSX connection to a remote
host, then osx_connect() can simply return -1.
osx_drain() needs to make sure that all of the data that was
sent to the Palm has really gone out, and isn't buffered somewhere.
For some protocols, this is a trivial 'return 0;', but your mileage
may vary.
osx_select() needs to, in effect, perform a select() on the
given file PConnection, and wait for it to become readable or
writable, or time out.
So some of these might be trivial or noops, but you'll need to
examine your particular circumstances.
> > You'll also need to check which software protocol you're using
> > (see the various "switch (pconn->protocol)" statements in
> > PConnection_*.c).
>
> I'm not seeing these - all I see are a few references to protocol in
> slp_addr?
This was introduced in 2.2.0, to deal with Palm m500s and m505s.
--
Andrew Arensburger This message *does* represent the
arensb@ooblick.com views of ooblick.com
No, I'm tellin ya, my cat REALLY ate my 1040 form!
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.