summaryrefslogtreecommitdiffstats
path: root/hcid/adapter.c
diff options
context:
space:
mode:
authorAlok Barsode <alok.barsode@azingo.com>2008-07-09 13:31:49 +0530
committerLuiz Augusto von Dentz <luiz.dentz@indt.org.br>2008-07-28 10:34:54 -0300
commitd8b1e6017c0198bc996f9f9518037d69902b7830 (patch)
tree05502c1fde848460f683761ff64cf6bc66915dfb /hcid/adapter.c
parenta2335a65bb61313b3e46be861c90ca8bdb786eb8 (diff)
Adding device_set_agent.
Signed-off-by: Alok Barsode <alok.barsode@azingo.com>
Diffstat (limited to 'hcid/adapter.c')
-rw-r--r--hcid/adapter.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/hcid/adapter.c b/hcid/adapter.c
index 753a1c47..15209333 100644
--- a/hcid/adapter.c
+++ b/hcid/adapter.c
@@ -257,7 +257,7 @@ static void device_agent_removed(struct agent *agent, void *user_data)
struct adapter *adapter;
adapter = device_get_adapter(device);
- device->agent = NULL;
+ device_set_agent(device, NULL);
l = g_slist_find_custom(adapter->auth_reqs, agent,
auth_info_agent_cmp);
@@ -279,6 +279,7 @@ static struct bonding_request_info *bonding_request_new(DBusConnection *conn,
struct device *device;
const char *name = dbus_message_get_sender(msg);
const gchar *destination;
+ struct agent *agent;
debug("bonding_request_new(%s)", address);
@@ -287,10 +288,13 @@ static struct bonding_request_info *bonding_request_new(DBusConnection *conn,
return NULL;
destination = device_get_address(device);
- device->agent = agent_create(adapter, name, agent_path,
+ agent = agent_create(adapter, name, agent_path,
capability,
device_agent_removed,
device);
+
+ device_set_agent(device, agent);
+
debug("Temporary agent registered for hci%d/%s at %s:%s",
adapter->dev_id, destination, name,
agent_path);
@@ -765,7 +769,7 @@ void adapter_remove_device(DBusConnection *conn, struct adapter *adapter,
if (agent) {
agent_destroy(agent, FALSE);
- device->agent = NULL;
+ device_set_agent(device, NULL);
}
adapter->devices = g_slist_remove(adapter->devices, device);