summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlok Barsode <alok.barsode@azingo.com>2008-09-03 12:48:04 +0530
committerAlok Barsode <alok.barsode@azingo.com>2008-09-03 12:48:04 +0530
commitc2193535f413360a45dbcdd017f13755367f2599 (patch)
tree8fc1f79d5afed8b05d3dc22a83911ad2a9f31056 /src
parent3692b8262294723c1fcfc75e759e59570557f949 (diff)
Adding adapter_add_active_conn.
Diffstat (limited to 'src')
-rw-r--r--src/adapter.c16
-rw-r--r--src/adapter.h2
-rw-r--r--src/dbus-hci.c16
3 files changed, 19 insertions, 15 deletions
diff --git a/src/adapter.c b/src/adapter.c
index 5f11b853..dd5a6762 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -2902,6 +2902,22 @@ struct agent *adapter_get_agent(struct adapter *adapter)
return adapter->agent;
}
+void adapter_add_active_conn(struct adapter *adapter, bdaddr_t *bdaddr,
+ uint16_t handle)
+{
+ struct active_conn_info *dev;
+
+ if (!adapter || !adapter->active_conn)
+ return;
+
+ dev = g_new0(struct active_conn_info, 1);
+
+ bacpy(&dev->bdaddr, bdaddr);
+ dev->handle = handle;
+
+ adapter->active_conn = g_slist_append(adapter->active_conn, dev);
+}
+
int btd_register_adapter_driver(struct btd_adapter_driver *driver)
{
adapter_drivers = g_slist_append(adapter_drivers, driver);
diff --git a/src/adapter.h b/src/adapter.h
index 1fdf2684..9374654e 100644
--- a/src/adapter.h
+++ b/src/adapter.h
@@ -175,6 +175,8 @@ void adapter_update_oor_devices(struct adapter *adapter);
void adapter_remove_oor_device(struct adapter *adapter, char *peer_addr);
void adapter_mode_changed(struct adapter *adapter, uint8_t scan_mode);
struct agent *adapter_get_agent(struct adapter *adapter);
+void adapter_add_active_conn(struct adapter *adapter, bdaddr_t *bdaddr,
+ uint16_t handle);
struct btd_adapter_driver {
const char *name;
diff --git a/src/dbus-hci.c b/src/dbus-hci.c
index 604011f0..79cb8d30 100644
--- a/src/dbus-hci.c
+++ b/src/dbus-hci.c
@@ -110,20 +110,6 @@ static int active_conn_find_by_handle(const void *data, const void *user_data)
return -1;
}
-static int active_conn_append(GSList **list, bdaddr_t *bdaddr,
- uint16_t handle)
-{
- struct active_conn_info *dev;
-
- dev = g_new0(struct active_conn_info, 1);
-
- bacpy(&dev->bdaddr, bdaddr);
- dev->handle = handle;
-
- *list = g_slist_append(*list, dev);
- return 0;
-}
-
DBusMessage *new_authentication_return(DBusMessage *msg, uint8_t status)
{
switch (status) {
@@ -1130,7 +1116,7 @@ void hcid_dbus_conn_complete(bdaddr_t *local, uint8_t status, uint16_t handle,
}
/* add in the active connetions list */
- active_conn_append(&adapter->active_conn, peer, handle);
+ adapter_add_active_conn(adapter, peer, handle);
}
}