diff options
| author | Sebastien Bacher <seb128@ubuntu.com> | 2021-02-25 11:36:45 +0100 |
|---|---|---|
| committer | Sebastien Bacher <seb128@ubuntu.com> | 2021-02-25 11:36:45 +0100 |
| commit | d92aa7f298fe84d4cf686c5ad64b73438e00d377 (patch) | |
| tree | 2f1f4c7b48cff9e63b0d0e3669bada3d9aeda72e /examples/python/dbus/show-bssids.py | |
| parent | a82e048a943092315a32d745c99e0f5635e29134 (diff) | |
| parent | 3a56bce6c0ea7ba0fe269520547740783b342e0d (diff) | |
Merge branch 'upstream/latest' of https://salsa.debian.org/utopia-team/network-manager into upstream/latest
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 |