3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-12-22 13:02:44 +01:00

auto-t: add python API for StationDebug.Scan

This commit is contained in:
James Prestwood 2021-08-12 16:12:29 -07:00 committed by Denis Kenzior
parent dffff73e89
commit c7466cd56a

View File

@ -242,6 +242,10 @@ class StationDebug(IWDDBusAbstract):
def autoconnect(self):
return self._properties['AutoConnect']
def scan(self, frequencies):
frequencies = dbus.Array([dbus.UInt16(f) for f in frequencies])
self._iface.Scan(frequencies)
class Device(IWDDBusAbstract):
'''
Class represents a network device object: net.connman.iwd.Device
@ -585,6 +589,12 @@ class Device(IWDDBusAbstract):
IWD_STATION_DEBUG_INTERFACE)
self._station_debug_if.Roam(dbus.ByteArray.fromhex(address.replace(':', '')))
def debug_scan(self, frequencies):
if not self._station_debug:
self._station_debug = StationDebug(self._object_path)
self._station_debug.scan(frequencies)
def __str__(self, prefix = ''):
return prefix + 'Device: ' + self.device_path + '\n'\
+ prefix + '\tName:\t\t' + self.name + '\n'\