summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2006-09-21 21:40:11 +0000
committerMarcel Holtmann <marcel@holtmann.org>2006-09-21 21:40:11 +0000
commit6eff5843d007147dcf54d100a0eb8af0306081f7 (patch)
tree83d25af403b330a81072eab58f7497de77310c3e
parentd0ad1ca444111052434130ea7fb810319bff8f63 (diff)
Allow standard inquiry while periodic inquiry is active
-rw-r--r--hcid/dbus-adapter.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/hcid/dbus-adapter.c b/hcid/dbus-adapter.c
index 0a0fae55..5ac2f2aa 100644
--- a/hcid/dbus-adapter.c
+++ b/hcid/dbus-adapter.c
@@ -2386,7 +2386,7 @@ static DBusHandlerResult handle_dev_discover_devices_req(DBusConnection *conn, D
if (!dbus_message_has_signature(msg, DBUS_TYPE_INVALID_AS_STRING))
return error_invalid_arguments(conn, msg);
- if (dbus_data->disc_active || dbus_data->pdisc_active)
+ if (dbus_data->disc_active)
return error_discover_in_progress(conn, msg);
pending_remote_name_cancel(dbus_data);
@@ -2427,15 +2427,11 @@ static DBusHandlerResult handle_dev_discover_devices_req(DBusConnection *conn, D
}
method = dbus_message_get_member(msg);
- /*
- * In the future, if we allow standard inquiry when there is active
- * periodic inquiry: the name resolve flag must NOT be overwritten.
- */
if (strcmp("DiscoverDevicesWithoutNameResolving", method) == 0)
dbus_data->discover_type |= STD_INQUIRY;
- else
+ else
dbus_data->discover_type |= (STD_INQUIRY | RESOLVE_NAME);
-
+
dbus_data->discovery_requestor = strdup(dbus_message_get_sender(msg));
reply = dbus_message_new_method_return(msg);
@@ -2468,6 +2464,7 @@ static DBusHandlerResult handle_dev_cancel_discovery_req(DBusConnection *conn, D
if (!dbus_data->discovery_requestor ||
strcmp(dbus_data->discovery_requestor, dbus_message_get_sender(msg)))
return error_not_authorized(conn, msg);
+
/*
* Cleanup the discovered devices list and send the cmd
* to cancel inquiry or cancel remote name request
@@ -2478,11 +2475,11 @@ static DBusHandlerResult handle_dev_cancel_discovery_req(DBusConnection *conn, D
return error_no_such_adapter(conn, msg);
else
return error_failed(conn, msg, -err);
-
}
/* Reply before send DiscoveryCompleted */
dbus_data->discovery_cancel = dbus_message_ref(msg);
+
return DBUS_HANDLER_RESULT_HANDLED;
}