From fbf89763779b6ebad6ed956d8c81bfdeb8317122 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Fri, 14 Mar 2008 20:05:52 +0000 Subject: agent_release is already called through agent_free and doesn't need to be public --- hcid/agent.c | 36 ++++++++++++++++++------------------ hcid/agent.h | 2 -- hcid/dbus-hci.c | 3 --- 3 files changed, 18 insertions(+), 23 deletions(-) (limited to 'hcid') diff --git a/hcid/agent.c b/hcid/agent.c index 2dab62e5..e0111b0b 100644 --- a/hcid/agent.c +++ b/hcid/agent.c @@ -88,6 +88,24 @@ static DBusConnection *connection = NULL; static void send_cancel_request(struct agent_request *req); +static void agent_release(struct agent *agent) +{ + DBusMessage *message; + + debug("Releasing agent %s, %s", agent->name, agent->path); + + message = dbus_message_new_method_call(agent->name, agent->path, + "org.bluez.Agent", "Release"); + if (message == NULL) { + error("Couldn't allocate D-Bus message"); + return; + } + + dbus_message_set_no_reply(message, TRUE); + + send_message_and_unref(connection, message); +} + static void agent_free(struct agent *agent) { if (!agent) @@ -549,24 +567,6 @@ static void send_cancel_request(struct agent_request *req) agent_request_free(req); } -void agent_release(struct agent *agent) -{ - DBusMessage *message; - - debug("Releasing agent %s, %s", agent->name, agent->path); - - message = dbus_message_new_method_call(agent->name, agent->path, - "org.bluez.Agent", "Release"); - if (message == NULL) { - error("Couldn't allocate D-Bus message"); - return; - } - - dbus_message_set_no_reply(message, TRUE); - - send_message_and_unref(connection, message); -} - gboolean agent_matches(struct agent *agent, const char *name, const char *path) { if (g_str_equal(agent->name, name) && g_str_equal(agent->path, path)) diff --git a/hcid/agent.h b/hcid/agent.h index bfbce0b1..7cf703af 100644 --- a/hcid/agent.h +++ b/hcid/agent.h @@ -49,8 +49,6 @@ int agent_confirm(struct agent *agent, const char *device, const char *pin, int agent_cancel(struct agent *agent); -void agent_release(struct agent *agent); - gboolean agent_matches(struct agent *agent, const char *name, const char *path); void agent_init(void); diff --git a/hcid/dbus-hci.c b/hcid/dbus-hci.c index 0e4ffbba..866ee354 100644 --- a/hcid/dbus-hci.c +++ b/hcid/dbus-hci.c @@ -401,7 +401,6 @@ int unregister_adapter_path(const char *path) release_passkey_agents(adapter, NULL); if (adapter->agent) { - agent_release(adapter->agent); agent_destroy(adapter->agent, FALSE); adapter->agent = NULL; } @@ -804,7 +803,6 @@ int hcid_dbus_stop_device(uint16_t id) release_passkey_agents(adapter, NULL); if (adapter->agent) { - agent_release(adapter->agent); agent_destroy(adapter->agent, FALSE); adapter->agent = NULL; } @@ -995,7 +993,6 @@ void hcid_dbus_bonding_process_complete(bdaddr_t *local, bdaddr_t *peer, release_passkey_agents(adapter, peer); if (adapter->agent) { - agent_release(adapter->agent); agent_destroy(adapter->agent, FALSE); adapter->agent = NULL; } -- cgit