This patch fixes the adater discovering state while powering off. Without this fix, BlueZ sends incorrect discovering state to upper layers while switching off. --- src/adapter.c | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-) diff --git a/src/adapter.c b/src/adapter.c index eb9745f..f630196 100644 --- a/src/adapter.c +++ b/src/adapter.c @@ -2319,10 +2319,17 @@ int btd_adapter_stop(struct btd_adapter *adapter) ADAPTER_INTERFACE, "Pairable", DBUS_TYPE_BOOLEAN, &prop_false); - if (adapter->discovering) + if (adapter->discovering) { emit_property_changed(connection, adapter->path, ADAPTER_INTERFACE, "Discovering", DBUS_TYPE_BOOLEAN, &prop_false); + /* + * Change the discovering state to FALSE, otherwise + * inquiry fails to start if BT is switched off and then on + * while inquiry is already active. + */ + adapter->discovering = FALSE; + } emit_property_changed(connection, adapter->path, ADAPTER_INTERFACE, "Powered", DBUS_TYPE_BOOLEAN, &prop_false); -- 1.7.0.4 -- To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html