|
From: Lukas Z. <lu...@pl...> - 2011-10-25 10:10:18
|
Hello Chris, On Oct 25, 2011, at 10:14 , Chris Frey wrote: > Thanks... I'm guessing you meant for this to go to the mailing list? :-) Yes, sorry. I just sent it again to the list. > If I wanted to just talk to a SyncML device, get latest changes, get all > changes, delete records, add/modify changes, and then disconnect, would > that be possible with libsynthesis? Unlike many of today's web APIs, a SyncML session has an awful lot of state - you can't use it to just ask for something in a REST-like manner. The order of how you have to do the read and write operations is very strict in SyncML. Much in libsynthesis is about getting this order right, including numerous workarounds for peers that do it wrong. So libsynthesis has to be in control of the sync session from start to end. On the DB backend API side, it calls out to plugins to get list of changes, read items, insert/update/delete items. On the application API side, you can edit the client settings (URL, syncmode etc. - much what you see in a phone SyncML client, or my iOS apps), then initialize a session, and then "step" through the session. This means, it's not a single syncNow() function that blocks everything for a long time, but you have your own main loop which repeatedly calls the SessionStep() API function until the sync is done. SessionStep() has different return values, and informs you when a SyncML message is ready to be delivered to the peer, or when a SyncML response is expected from the peer. So the implementation of transporting messages (via HTTP, BT, whatever) is not in libsynthesis, but must (can!) be done in the calling code. Best Regards, Lukas Zeller, plan44.ch lu...@pl... - www.plan44.ch |