From: <svn...@op...> - 2009-03-31 11:38:32
|
Author: bellmich Date: Tue Mar 31 13:38:25 2009 New Revision: 5484 URL: http://www.opensync.org/changeset/5484 Log: fixed documentation for migration of OSyncAnchor to OSyncSinkStateDB Modified: trunk/docs/examples/plugins/src/plugin.c trunk/docs/examples/plugins/src/simple_plugin.c trunk/docs/whitepaper/plugins.tex Modified: trunk/docs/examples/plugins/src/plugin.c ============================================================================== --- trunk/docs/examples/plugins/src/plugin.c Tue Mar 31 13:30:58 2009 (r5483) +++ trunk/docs/examples/plugins/src/plugin.c Tue Mar 31 13:38:25 2009 (r5484) @@ -38,10 +38,10 @@ //you can also use the anchor system to detect a device reset //or some parameter change here. Check the docs to see how it works //Now you get the last stored anchor from the device - OSyncAnchor *anchor = osync_objtype_sink_get_anchor(sink); + OSyncSinkStateDB *state_db = osync_objtype_sink_get_state_db(sink); osync_bool anchormatch; - if (!osync_anchor_compare(anchor, "anchor_key", "dynamic_anchor_value", &anchormatch, &error)) { + if (!osync_sink_state_equal(state_db, "anchor_key", "dynamic_anchor_value", &anchormatch, &error)) { /* anchor couldn't be compared */ goto error; } @@ -235,8 +235,8 @@ //If we use anchors we have to update it now. //Now you get/calculate the current anchor of the device - OSyncAnchor *anchor = osync_objtype_sink_get_anchor(sink); - if (!osync_anchor_update(anchor, "anchor_key", "dynamic_anchor_value", &error)) { + OSyncSinkStateDB *state_db = osync_objtype_sink_get_state_db(sink); + if (!osync_sink_state_set(state_db, "anchor_key", "dynamic_anchor_value", &error)) { goto error; } Modified: trunk/docs/examples/plugins/src/simple_plugin.c ============================================================================== --- trunk/docs/examples/plugins/src/simple_plugin.c Tue Mar 31 13:30:58 2009 (r5483) +++ trunk/docs/examples/plugins/src/simple_plugin.c Tue Mar 31 13:38:25 2009 (r5484) @@ -33,10 +33,10 @@ //you can also use the anchor system to detect a device reset //or some parameter change here. Check the docs to see how it works //Now you get the last stored anchor from the device - OSyncAnchor *anchor = osync_objtype_sink_get_anchor(sink); + OSyncSinkStateDB *state_db = osync_objtype_sink_get_state_db(sink); osync_bool anchormatch; - if (!osync_anchor_compare(anchor, "anchor_key", "dynamic_anchor_value", &anchormatch, &error)) { + if (!osync_sink_state_equal(state_db, "anchor_key", "dynamic_anchor_value", &anchormatch, &error)) { /* anchor couldn't be compared */ goto error; } @@ -166,8 +166,8 @@ //If we use anchors we have to update it now. //Now you get/calculate the current anchor of the device - OSyncAnchor *anchor = osync_objtype_sink_get_anchor(sink); - if (!osync_anchor_update(anchor, "anchor_key", "dynamic_anchor_value", &error)) + OSyncSinkStateDB *state_db = osync_objtype_sink_get_state_db(sink); + if (!osync_sink_state_set(state_db, "anchor_key", "dynamic_anchor_value", &error)) goto error; //Answer the call Modified: trunk/docs/whitepaper/plugins.tex ============================================================================== --- trunk/docs/whitepaper/plugins.tex Tue Mar 31 13:30:58 2009 (r5483) +++ trunk/docs/whitepaper/plugins.tex Tue Mar 31 13:38:25 2009 (r5484) @@ -150,7 +150,7 @@ otherwise be called for each Object Type for the same interface. It is usual at this stage to compare the stored anchor with that from the peer -using \verb|osync_anchor_compare|. If the anchor has changed then the need for +using \verb|osync_sink_state_equal|. If the anchor has changed then the need for a slow sync should be set using \verb|osync_objtype_sink_set_slowsync| This function MUST only establish a connection to the device or resource. After |