Thanks for taking the time to educate me on what happens during HotSync. It doesn't sound like it should be that hard, but after your explanation, it all makes sense. And I guess that's why there aren't a lot of people jumping on the bandwagon to write code like this - it's just easier to tell the person to press the HotSync button.
Again, many thanks, stefan "Robert McKenzie" <[EMAIL PROTECTED]> wrote in message news:80082@palm-dev-forum... > > It is so hard to find out how to initiate a HotSync from the desktop because > it is so hard to do so. > > It is so hard to do so because the existing architecture was set up > presupposing that it will only be initiated from the device. > > Let me summarize the salient features of the existing architecture. > > On a desktop, hotsync.exe is continually polling the serial (or usb, or ...) > port for an incoming packet from the device. When the user initiates a > hotsync from the device, system software on the device grabs the serial port > and sends out our mysterious "let's start a sync" packet to the desktop. > The desktop catches it, sends back a confirmation packet, then the great > hotsync technology springs fearlessly (dashingly tossing its cape over its > mighty figurative shoulder) to action (in a single bound...). > > In order for a desktop to get through to the device with any information, > you would have to first wrest the port from hotsync.exe. Then you could > send out anything you wanted to the device. But nobody would be listening > -- at least nobody in the PalmOS. Unless some software has grabbed the > devices serial connection and is looking for packets, any incoming > information just gets tossed on the floor. Well, you ask, why doesn't the > PalmOS put its ear to the serial port? Battery life, I cry. Keeping the > serial port open eats juice! Dead batteries annoy users. Not good. (This > scheme was all determined long before anyone started putting rechargeable > batteries into PalmOS devices, by the way.) > > But, of course, it can be done. Here is a thumbnail sketch of how one might > do it. > > #1. Write a device application that wakes up periodically (say on an > alarm), grabs the serial port, and listens for packets for a while (say for > 100ms). > > #2. Write a desktop application that disables hotsync and periodically (say > every 50 ms) sends out an "I am here" packet. > > When the device application gets the desktop "I am here" ping, it responds > with a "so am I" acknowledgement. > > When the desktop wants to sync, have it send not a simple "I am here" > packet, but a "I want to sync" packet. When the device application gets an > "I want to sync", have it respond with an "let's sync" response. > > When the device app wants to sync (it catches and swallows the appropriate > key down), it waits for the next packet from the desktop and replies with a > "let's sync" packet. > > After the device app sends a "let's sync" packet, it goes to sleep for a few > seconds (to let the desktop get ready), then sends out the sync key down > (which it carefully doesn't catch!) to start the device side of a sync. > > After the desktop app gets a "let's sync" packet, it releases the serial > port and fires up hotsync.exe. > > The sync runs as normal. > > After the sync is over, have hotsync.exe notify your desktop app. Have the > desktop app euthanize hotsync.exe and resume its pinging. Also restore > state on your device app. > > Did I mention that the device app ought to figure out if it is not in the > cradle and slow down its wakeup frequency? Oh and there are a few gazillion > other little details to watch out for. > > For a (possibly different) approach, you might try contacting John Sutton > [mailto:[EMAIL PROTECTED]]. > > bob mckenzie, palmsource pdx > > -----Original Message----- > From: stefan [mailto:[EMAIL PROTECTED]] > Sent: Friday, March 15, 2002 1:11 PM > To: Palm Developer Forum > Subject: Desktop HotSync Program > > > Why is it so hard to find out how to initiate a HotSync from an application > running on the desktop?? It seems like writing a VB program that > incorporates the capability to start a HotSync would be a nice feature, yet > Palm seems to have buried the ability to do this. > > Hasn't anyone else ever wanted to write a program that could initiate a > HotSync?? If so, what did you do to accomplish this?? > > Thanks, > stefan > > > > -- > For information on using the Palm Developer Forums, or to unsubscribe, > please see http://www.palmos.com/dev/support/forums/ > > -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
