diff options
author | Daniel Wagner <daniel.wagner@bmw-carit.de> | 2011-03-31 10:02:36 +0200 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2011-03-31 12:41:05 +0200 |
commit | ea00714b732925c1397ad4deade211c3b6654310 (patch) | |
tree | a51cea87a06caf3d98188930172a9009c847355e /src/dbus.c | |
parent | 3b7821cbb84d6a1efb0d610d8591cb4ca1585846 (diff) | |
download | connman-ea00714b732925c1397ad4deade211c3b6654310.tar.gz connman-ea00714b732925c1397ad4deade211c3b6654310.tar.bz2 connman-ea00714b732925c1397ad4deade211c3b6654310.zip |
dbus: Add connman_dbus_setting_changed_*()
Diffstat (limited to 'src/dbus.c')
-rw-r--r-- | src/dbus.c | 86 |
1 files changed, 86 insertions, 0 deletions
@@ -270,6 +270,92 @@ dbus_bool_t connman_dbus_property_changed_array(const char *path, return TRUE; } +dbus_bool_t connman_dbus_setting_changed_basic(const char *owner, + const char *path, const char *key, + int type, void *val) +{ + DBusMessage *msg; + DBusMessageIter array, dict; + + if (owner == NULL || path == NULL) + return FALSE; + + msg = dbus_message_new_method_call(owner, path, + CONNMAN_NOTIFICATION_INTERFACE, + "Update"); + if (msg == NULL) + return FALSE; + + dbus_message_iter_init_append(msg, &array); + connman_dbus_dict_open(&array, &dict); + + connman_dbus_dict_append_basic(&dict, key, type, val); + + connman_dbus_dict_close(&array, &dict); + + g_dbus_send_message(connection, msg); + + return TRUE; +} + +dbus_bool_t connman_dbus_setting_changed_dict(const char *owner, + const char *path, const char *key, + connman_dbus_append_cb_t function, + void *user_data) +{ + DBusMessage *msg; + DBusMessageIter array, dict; + + if (owner == NULL || path == NULL) + return FALSE; + + msg = dbus_message_new_method_call(owner, path, + CONNMAN_NOTIFICATION_INTERFACE, + "Update"); + if (msg == NULL) + return FALSE; + + dbus_message_iter_init_append(msg, &array); + connman_dbus_dict_open(&array, &dict); + + connman_dbus_dict_append_dict(&dict, key, function, user_data); + + connman_dbus_dict_close(&array, &dict); + + g_dbus_send_message(connection, msg); + + return TRUE; +} + +dbus_bool_t connman_dbus_setting_changed_array(const char *owner, + const char *path, const char *key, int type, + connman_dbus_append_cb_t function, + void *user_data) +{ + DBusMessage *msg; + DBusMessageIter array, dict; + + if (owner == NULL || path == NULL) + return FALSE; + + msg = dbus_message_new_method_call(owner, path, + CONNMAN_NOTIFICATION_INTERFACE, + "Update"); + if (msg == NULL) + return FALSE; + + dbus_message_iter_init_append(msg, &array); + connman_dbus_dict_open(&array, &dict); + + connman_dbus_dict_append_array(&dict, key, type, function, user_data); + + connman_dbus_dict_close(&array, &dict); + + g_dbus_send_message(connection, msg); + + return TRUE; +} + DBusConnection *connman_dbus_get_connection(void) { if (connection == NULL) |