diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2007-08-15 22:39:37 +0000 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2007-08-15 22:39:37 +0000 |
commit | 7502ca3e7eb95a7b349b5b9235ed50d542949f59 (patch) | |
tree | ae3e15396794a4ee9fb59c7d2a06d2be1f78b2d5 /hcid/adapter.c | |
parent | 3da5850c5f114a0f96e2b8a2f5e3866531ae9268 (diff) |
Add dummy ListDevices method
Diffstat (limited to 'hcid/adapter.c')
-rw-r--r-- | hcid/adapter.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/hcid/adapter.c b/hcid/adapter.c index 17e63f99..f73feddf 100644 --- a/hcid/adapter.c +++ b/hcid/adapter.c @@ -3097,6 +3097,29 @@ static DBusHandlerResult adapter_list_trusts(DBusConnection *conn, return send_message_and_unref(conn, reply); } +static DBusHandlerResult list_devices(DBusConnection *conn, + DBusMessage *msg, void *data) +{ + DBusMessage *reply; + DBusMessageIter iter; + DBusMessageIter array_iter; + + if (!dbus_message_has_signature(msg, DBUS_TYPE_INVALID_AS_STRING)) + return error_invalid_arguments(conn, msg); + + reply = dbus_message_new_method_return(msg); + if (!reply) + return DBUS_HANDLER_RESULT_NEED_MEMORY; + + dbus_message_iter_init_append(reply, &iter); + dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY, + DBUS_TYPE_STRING_AS_STRING, &array_iter); + + dbus_message_iter_close_container(&iter, &array_iter); + + return send_message_and_unref(conn, reply); +} + const char *major_class_str(uint32_t class) { uint8_t index = (class >> 8) & 0x1F; @@ -3328,6 +3351,8 @@ static DBusMethodVTable adapter_methods[] = { { "ListTrusts", adapter_list_trusts, "", "as" }, + { "ListDevices", list_devices, "", "as" }, + { NULL, NULL, NULL, NULL } }; |