summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.dentz@openbossa.org>2008-03-13 22:02:58 +0000
committerLuiz Augusto von Dentz <luiz.dentz@openbossa.org>2008-03-13 22:02:58 +0000
commiteda0dd9fa1dbb5b69fd6318ee6c5fe36bf544582 (patch)
treea43bb2fc9ae7a5fc8c6af32b8fe48b1a431a7447
parent9153a3bd00723be62d2c78b3590c90bab14d7cf0 (diff)
Introduce RegisterAgent and UnregisterAgent adapter methods.
-rw-r--r--hcid/adapter.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/hcid/adapter.c b/hcid/adapter.c
index 88cd6728..b6cfd269 100644
--- a/hcid/adapter.c
+++ b/hcid/adapter.c
@@ -3545,6 +3545,36 @@ static DBusHandlerResult find_device(DBusConnection *conn,
return send_message_and_unref(conn, reply);
}
+static DBusHandlerResult register_agent(DBusConnection *conn,
+ DBusMessage *msg, void *data)
+{
+ char *agent;
+
+ if (!hcid_dbus_use_experimental())
+ return error_unknown_method(conn, msg);
+
+ if (!dbus_message_get_args(msg, NULL, DBUS_TYPE_OBJECT_PATH, &agent,
+ DBUS_TYPE_INVALID))
+ return error_invalid_arguments(conn, msg, NULL);
+
+ return DBUS_HANDLER_RESULT_HANDLED;
+}
+
+static DBusHandlerResult unregister_agent(DBusConnection *conn,
+ DBusMessage *msg, void *data)
+{
+ char *agent;
+
+ if (!hcid_dbus_use_experimental())
+ return error_unknown_method(conn, msg);
+
+ if (!dbus_message_get_args(msg, NULL, DBUS_TYPE_OBJECT_PATH, &agent,
+ DBUS_TYPE_INVALID))
+ return error_invalid_arguments(conn, msg, NULL);
+
+ return DBUS_HANDLER_RESULT_HANDLED;
+}
+
const char *major_class_str(uint32_t class)
{
uint8_t index = (class >> 8) & 0x1F;
@@ -3646,6 +3676,8 @@ static DBusMethodVTable adapter_methods[] = {
{ "CreateDevice", create_device, "s", "o" },
{ "RemoveDevice", remove_device, "o", "" },
{ "FindDevice", find_device, "s", "o" },
+ { "RegisterAgent", register_agent, "o", "" },
+ { "UnregisterAgent", unregister_agent, "o", "" },
/* Deprecated */
{ "GetInfo", adapter_get_info,
"", "a{sv}" },