summaryrefslogtreecommitdiffstats
path: root/hcid
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2007-01-15 22:05:01 +0000
committerJohan Hedberg <johan.hedberg@nokia.com>2007-01-15 22:05:01 +0000
commit078c6000ad9bded489a318ca515d5c4585bc7573 (patch)
treedd1ee42aa666e9f8740fbd5eee196ebe429a1fd7 /hcid
parent6cfaa54f617b72bb9c34253a5bb0de35ebfb905a (diff)
Send ServiceRegistered and ServiceUnregistered at appropriate times
Diffstat (limited to 'hcid')
-rw-r--r--hcid/dbus-service.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/hcid/dbus-service.c b/hcid/dbus-service.c
index a0c51ecb..27564642 100644
--- a/hcid/dbus-service.c
+++ b/hcid/dbus-service.c
@@ -701,6 +701,7 @@ int register_service(char *path, struct service *service)
{
char obj_path[PATH_MAX], *slash;
DBusConnection *conn = get_dbus_connection();
+ DBusMessage *signal;
path[strlen(path) - strlen(SERVICE_SUFFIX)] = '\0';
slash = strrchr(path, '/');
@@ -718,6 +719,17 @@ int register_service(char *path, struct service *service)
services = g_slist_append(services, strdup(obj_path));
+ signal = dbus_message_new_signal(BASE_PATH, MANAGER_INTERFACE,
+ "ServiceRegistered");
+ if (!signal)
+ return -ENOMEM;
+
+ dbus_message_append_args(signal,
+ DBUS_TYPE_STRING, &service->object_path,
+ DBUS_TYPE_INVALID);
+
+ send_message_and_unref(conn, signal);
+
return 0;
}
@@ -757,6 +769,17 @@ int unregister_service(const char *sender, const char *path)
static void release_service(struct service *service)
{
+ DBusMessage *signal;
+
+ signal = dbus_message_new_signal(BASE_PATH, MANAGER_INTERFACE,
+ "ServiceUnregistered");
+ if (signal) {
+ dbus_message_append_args(signal,
+ DBUS_TYPE_STRING, &service->object_path,
+ DBUS_TYPE_INVALID);
+ send_message_and_unref(get_dbus_connection(), signal);
+ }
+
if (service->records)
unregister_service_records(service->records);