From 80ec1decc49c72efec2a8b87c06245c92c0ab807 Mon Sep 17 00:00:00 2001 From: Michael Biebl Date: Thu, 11 Feb 2021 18:11:46 +0100 Subject: New upstream version 1.29.90 --- examples/python/dbus/show-bssids.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'examples/python/dbus/show-bssids.py') diff --git a/examples/python/dbus/show-bssids.py b/examples/python/dbus/show-bssids.py index b56822fb..17364e49 100755 --- a/examples/python/dbus/show-bssids.py +++ b/examples/python/dbus/show-bssids.py @@ -1,5 +1,5 @@ #!/usr/bin/env python -# SPDX-License-Identifier: GPL-2.0+ +# SPDX-License-Identifier: GPL-2.0-or-later # # Copyright (C) 2010 Red Hat, Inc. # @@ -7,6 +7,11 @@ # This example prints out all the AP BSSIDs that all Wi-Fi devices on the # machine can see. Useful for location-based services like Skyhook that # can geolocate you based on the APs you can see. +# +# Note that with NetworkManager clients are required to request scanning. +# If you don't do that, the scan list may be outdated. That means, you would +# check the LastScan property, and if necessary call RequestScan() first. +# After RequestScan(), you wait until the LastScan property gets bumped again. import dbus @@ -30,7 +35,7 @@ for d in devices: # Make sure the device is enabled before we try to use it state = prop_iface.Get("org.freedesktop.NetworkManager.Device", "State") - if state <= 2: + if state <= 20: # NM_DEVICE_STATE_UNAVAILABLE continue # Get device's type; we only want wifi devices -- cgit 1.3.0-6-gf8a5