summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClaudio Takahasi <claudio.takahasi@openbossa.org>2006-09-20 13:35:15 +0000
committerClaudio Takahasi <claudio.takahasi@openbossa.org>2006-09-20 13:35:15 +0000
commitf48070d99f3e13acf1f0abab9a6988d2e2043367 (patch)
treebb4d6f7c3deaf3386a4d3dcb94b53615662b2b4c
parentd75af5636343673c811abfd5ae3fb09e5fab47fd (diff)
DiscoveryCompleted was not being sent properly: unregistering path, stopping device, initiated by non D-Bus
-rw-r--r--hcid/dbus.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/hcid/dbus.c b/hcid/dbus.c
index 2541ef47..3e5b5bf5 100644
--- a/hcid/dbus.c
+++ b/hcid/dbus.c
@@ -399,7 +399,7 @@ static void reply_pending_requests(const char *path, struct hci_dbus_data *pdata
pdata->discovery_cancel = NULL;
}
- if (pdata->discovery_requestor) {
+ if (pdata->disc_active) {
/* Send discovery completed signal if there isn't name to resolve */
message = dbus_message_new_signal(path, ADAPTER_INTERFACE,
"DiscoveryCompleted");
@@ -665,13 +665,6 @@ int hcid_dbus_stop_device(uint16_t id)
error("Getting %s path data failed!", path);
return -1;
}
-
- message = dev_signal_factory(pdata->dev_id, "ModeChanged",
- DBUS_TYPE_STRING, &scan_mode,
- DBUS_TYPE_INVALID);
-
- send_reply_and_unref(connection, message);
-
/* cancel pending timeout */
if (pdata->timeout_id) {
g_timeout_remove(pdata->timeout_id);
@@ -681,6 +674,13 @@ int hcid_dbus_stop_device(uint16_t id)
/* check pending requests */
reply_pending_requests(path, pdata);
+ message = dev_signal_factory(pdata->dev_id, "ModeChanged",
+ DBUS_TYPE_STRING, &scan_mode,
+ DBUS_TYPE_INVALID);
+
+ send_reply_and_unref(connection, message);
+
+
cancel_passkey_agent_requests(pdata->passkey_agents, path, NULL);
release_passkey_agents(pdata, NULL);
@@ -1030,17 +1030,17 @@ void hcid_dbus_inquiry_complete(bdaddr_t *local)
pdata->discovery_cancel = NULL;
}
- if (pdata->disc_active) {
- /* Send discovery completed signal if there isn't name to resolve */
- message = dbus_message_new_signal(path, ADAPTER_INTERFACE,
- "DiscoveryCompleted");
- send_reply_and_unref(connection, message);
- }
-
/* reset the discover type for standard inquiry only */
pdata->discover_type &= ~STD_INQUIRY;
}
+ if (pdata->disc_active) {
+ /* Send discovery completed signal if there isn't name to resolve */
+ message = dbus_message_new_signal(path, ADAPTER_INTERFACE,
+ "DiscoveryCompleted");
+ send_reply_and_unref(connection, message);
+ }
+
/* tracks D-Bus and NON D-Bus */
pdata->disc_active = 0;
done: