If adapter was set to Discoverable and DiscoverableTimeout is greater than zero we should not store the Discoverable adapter info as long as it is a non-persistent state. This way, we don't need to worry about updating the Discoverable stored value once the timeout expires. --- src/adapter.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/adapter.c b/src/adapter.c index 25501c4..35a4715 100644 --- a/src/adapter.c +++ b/src/adapter.c @@ -2269,8 +2269,12 @@ static void set_mode_complete(struct btd_adapter *adapter) if (err != 0) error("unable to set mode: %s", mode2str(pending->mode)); + if (adapter->mode == MODE_DISCOVERABLE && adapter->discov_timeout > 0) + goto done; + store_adapter_info(adapter); +done: session_unref(pending); } -- 1.8.0.1 -- 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