From c2b8e0dc03f70d6158f42aa4cd7098ad3da44c13 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Tue, 20 Nov 2007 15:36:20 +0100 Subject: [PATCH] switch probe-net-bluetooth to use changesets Switch probe-net-bluetooth to use changesets. --- hald/linux/probing/probe-net-bluetooth.c | 22 +++++++++++++++++----- 1 files changed, 17 insertions(+), 5 deletions(-) diff --git a/hald/linux/probing/probe-net-bluetooth.c b/hald/linux/probing/probe-net-bluetooth.c index 69ddb0a..ec4cd25 100644 --- a/hald/linux/probing/probe-net-bluetooth.c +++ b/hald/linux/probing/probe-net-bluetooth.c @@ -41,8 +41,8 @@ #define BLUEZ_NET_SERVER_IFACE "org.bluez.network.Server" static void -get_properties (DBusConnection *conn, LibHalContext *ctx, const char *udi, - const char *id, const char *path) +get_properties (DBusConnection *conn, LibHalChangeSet *cs, + const char *id, const char *path) { DBusMessage *msg; DBusMessage *reply = NULL; @@ -100,7 +100,7 @@ get_properties (DBusConnection *conn, LibHalContext *ctx, const char *udi, HAL_INFO (("reply: %s:%s", key, value)); - libhal_device_set_property_string (ctx, udi, prop, value, &error); + libhal_changeset_set_property_string (cs, prop, value); break; } case DBUS_TYPE_INT32: @@ -111,7 +111,7 @@ get_properties (DBusConnection *conn, LibHalContext *ctx, const char *udi, HAL_INFO (("reply: %s:%d", key, value)); - libhal_device_set_property_int (ctx, udi, prop, value, &error); + libhal_changeset_set_property_int (cs, prop, value); break; } default: @@ -138,6 +138,7 @@ main (int argc, char *argv[]) char network[8] = "network"; const char *pnetwork = network; LibHalContext *ctx = NULL; + LibHalChangeSet *cs = NULL; DBusConnection *conn; DBusMessage *msg = NULL; DBusMessage *reply = NULL; @@ -217,13 +218,24 @@ main (int argc, char *argv[]) if (ctx == NULL) goto out; - get_properties (conn, ctx, udi, id, connection); + cs = libhal_device_new_changeset (udi); + if (cs == NULL) { + HAL_ERROR(("Cannot initialize changeset")); + goto out; + } + + get_properties (conn, cs, id, connection); out: if (msg) dbus_message_unref (msg); if (reply) dbus_message_unref (reply); + if (cs != NULL) { + dbus_error_init (&error); + libhal_device_commit_changeset (ctx, cs, &error); + libhal_device_free_changeset (cs); + } if (ctx != NULL) { dbus_error_init (&error); libhal_ctx_shutdown (ctx, &error); -- 1.5.3.7