summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2007-01-25 15:55:57 +0000
committerMarcel Holtmann <marcel@holtmann.org>2007-01-25 15:55:57 +0000
commit6275fe42cd4792e0e2da05ea164c4e212d23c6e7 (patch)
treefa6b46a7b1c25715b7254740392c032e47982f21
parent2dc29f58476b10b1f92e73eddc6c6cb45b645887 (diff)
Allow more than one external service
-rw-r--r--hcid/dbus-service.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/hcid/dbus-service.c b/hcid/dbus-service.c
index 5dda35a9..14798521 100644
--- a/hcid/dbus-service.c
+++ b/hcid/dbus-service.c
@@ -611,12 +611,17 @@ static int register_service(struct service *service)
DBusConnection *conn = get_dbus_connection();
DBusMessage *signal;
- snprintf(obj_path, sizeof(obj_path) - 1, "/org/bluez/service_%s",
- service->filename);
+ if (service->external) {
+ snprintf(obj_path, sizeof(obj_path) - 1,
+ "/org/bluez/external_%s", service->ident);
+ } else {
+ snprintf(obj_path, sizeof(obj_path) - 1,
+ "/org/bluez/service_%s", service->filename);
- /* Don't include the .service part in the path */
- suffix = strstr(obj_path, SERVICE_SUFFIX);
- *suffix = '\0';
+ /* Don't include the .service part in the path */
+ suffix = strstr(obj_path, SERVICE_SUFFIX);
+ *suffix = '\0';
+ }
debug("Registering service object: ident=%s, name=%s (%s)",
service->ident, service->name, obj_path);
@@ -920,7 +925,7 @@ static struct service *create_external_service(const char *ident,
return NULL;
}
- service->filename = g_strdup("external.service");
+ service->filename = NULL;
service->name = g_strdup(name);
service->descr = g_strdup(description);
service->ident = g_strdup(ident);