summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.dentz@openbossa.org>2008-03-20 19:52:55 +0000
committerLuiz Augusto von Dentz <luiz.dentz@openbossa.org>2008-03-20 19:52:55 +0000
commitd5dd4c0246576a171b1067ae098bb751c4f261c6 (patch)
tree8f6d70dca11b949785c90a25d67317272068ad4e
parent9f18f0a1905bc091f37999bf4cb418cdbcfaedb7 (diff)
Add adapter to agent_create.
-rw-r--r--hcid/adapter.c2
-rw-r--r--hcid/agent.c5
-rw-r--r--hcid/agent.h4
3 files changed, 6 insertions, 5 deletions
diff --git a/hcid/adapter.c b/hcid/adapter.c
index 6deb93b5..62b17334 100644
--- a/hcid/adapter.c
+++ b/hcid/adapter.c
@@ -3836,7 +3836,7 @@ static DBusHandlerResult register_agent(DBusConnection *conn,
name = dbus_message_get_sender(msg);
- agent = agent_create(name, path, NULL,
+ agent = agent_create(adapter, name, path, NULL,
(agent_remove_cb) agent_removed, adapter);
if (!agent) {
dbus_message_unref(reply);
diff --git a/hcid/agent.c b/hcid/agent.c
index f7fdca1d..edd8cf05 100644
--- a/hcid/agent.c
+++ b/hcid/agent.c
@@ -150,14 +150,15 @@ static gboolean agent_timeout(struct agent *agent)
return FALSE;
}
-struct agent *agent_create(const char *name, const char *path,
- const char *address,
+struct agent *agent_create(struct adapter *adapter, const char *name,
+ const char *path, const char *address,
agent_remove_cb cb, void *remove_cb_data)
{
struct agent *agent;
agent = g_new0(struct agent, 1);
+ agent->adapter = adapter;
agent->name = g_strdup(name);
agent->path = g_strdup(path);
agent->remove_cb = cb;
diff --git a/hcid/agent.h b/hcid/agent.h
index e17e513e..9a4fed70 100644
--- a/hcid/agent.h
+++ b/hcid/agent.h
@@ -32,8 +32,8 @@ typedef void (*agent_passkey_cb) (struct agent *agent, DBusError *err,
typedef void (*agent_remove_cb) (struct agent *agent, void *user_data);
-struct agent *agent_create(const char *name, const char *path,
- const char *address,
+struct agent *agent_create(struct adapter *adapter, const char *name,
+ const char *path, const char *address,
agent_remove_cb cb, void *remove_cb_data);
int agent_destroy(struct agent *agent, gboolean exited);