diff options
Diffstat (limited to 'examples/python/dbus/show-bssids.py')
| -rwxr-xr-x | examples/python/dbus/show-bssids.py | 9 |
1 files changed, 7 insertions, 2 deletions
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 |