summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2006-12-18 12:35:18 +0000
committerJohan Hedberg <johan.hedberg@nokia.com>2006-12-18 12:35:18 +0000
commitc5809179683c8fd513b339b2eff6f70df952496b (patch)
tree27068d1891906820b847b84ea384c756460548e4
parent539522aa346cd7d49f5665ee83a5659e3464d83c (diff)
Code cleanup
-rw-r--r--hcid/dbus-hci.c30
1 files changed, 7 insertions, 23 deletions
diff --git a/hcid/dbus-hci.c b/hcid/dbus-hci.c
index ade38520..8b006077 100644
--- a/hcid/dbus-hci.c
+++ b/hcid/dbus-hci.c
@@ -203,24 +203,6 @@ static int active_conn_append(struct slist **list, bdaddr_t *bdaddr,
return 0;
}
-static int active_conn_remove(struct slist **list, uint16_t handle)
-{
- struct active_conn_info *dev;
- struct slist *l;
-
- l = slist_find(*list, &handle, active_conn_find_by_handle);
- if (!l)
- return -1;
-
- dev = l->data;
-
- *list = slist_remove(*list, dev);
-
- free(dev);
-
- return 0;
-}
-
DBusMessage *new_authentication_return(DBusMessage *msg, uint8_t status)
{
switch (status) {
@@ -1440,7 +1422,7 @@ void hcid_dbus_inquiry_result(bdaddr_t *local, bdaddr_t *peer, uint32_t class,
memset(&match, 0, sizeof(struct remote_dev_info));
bacpy(&match.bdaddr, peer);
match.name_status = NAME_SENT;
- /* if found: don't sent the name again */
+ /* if found: don't send the name again */
l = slist_find(adapter->found_devices, &match,
(cmp_func_t) found_device_cmp);
if (l)
@@ -1659,7 +1641,7 @@ void hcid_dbus_conn_complete(bdaddr_t *local, uint8_t status, uint16_t handle,
if (adapter->bonding)
adapter->bonding->hci_status = status;
} else {
- /* Sent the remote device connected signal */
+ /* Send the remote device connected signal */
message = dev_signal_factory(adapter->dev_id,
"RemoteDeviceConnected",
DBUS_TYPE_STRING, &peer_addr,
@@ -1756,14 +1738,16 @@ void hcid_dbus_disconn_complete(bdaddr_t *local, uint8_t status,
bonding_request_free(adapter->bonding);
adapter->bonding = NULL;
}
- /* Sent the remote device disconnected signal */
+
+ /* Send the remote device disconnected signal */
message = dev_signal_factory(adapter->dev_id,
"RemoteDeviceDisconnected",
DBUS_TYPE_STRING, &peer_addr,
DBUS_TYPE_INVALID);
-
send_message_and_unref(connection, message);
- active_conn_remove(&adapter->active_conn, handle);
+
+ adapter->active_conn = slist_remove(adapter->active_conn, dev);
+ free(dev);
failed:
if (peer_addr)