diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2008-11-01 01:17:12 +0100 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2008-11-01 01:17:12 +0100 |
commit | 063167c27c3e2cf9ac647a617abf345451de0787 (patch) | |
tree | 4d3785ccadef402b42770d0a07135ced49b96a57 /src/manager.c | |
parent | 81a1e13f79d3e6e7b2044e9d35592e490b01e65b (diff) |
Make FindAdapter return the any object if present
Diffstat (limited to 'src/manager.c')
-rw-r--r-- | src/manager.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/manager.c b/src/manager.c index c43ef5b8..3b3f52df 100644 --- a/src/manager.c +++ b/src/manager.c @@ -189,7 +189,12 @@ static DBusMessage *find_adapter(DBusConnection *conn, /* hci_devid() would make sense to use here, except it is restricted to devices which are up */ - if (!strncmp(pattern, "hci", 3) && strlen(pattern) >= 4) + if (!strcmp(pattern, "any") || !strcmp(pattern, "00:00:00:00:00:00")) { + path = adapter_any_get_path(); + if (path != NULL) + goto done; + dev_id = -1; + } if (!strncmp(pattern, "hci", 3) && strlen(pattern) >= 4) dev_id = atoi(pattern + 3); else dev_id = find_by_address(pattern); @@ -207,14 +212,15 @@ static DBusMessage *find_adapter(DBusConnection *conn, if (!adapter) return no_such_adapter(msg); + path = adapter_get_path(adapter); + +done: reply = dbus_message_new_method_return(msg); if (!reply) return NULL; - path = adapter_get_path(adapter); - dbus_message_append_args(reply, DBUS_TYPE_OBJECT_PATH, &path, - DBUS_TYPE_INVALID); + DBUS_TYPE_INVALID); return reply; } |