3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-21 22:09:23 +01:00

test: utility to set device mode

There was no way to stop ap/adhoc once started.
This commit is contained in:
James Prestwood 2018-07-19 09:22:27 -07:00 committed by Denis Kenzior
parent a68e958f29
commit c6a35d9005

18
test/set-mode Executable file
View File

@ -0,0 +1,18 @@
#!/usr/bin/python3
import dbus
import sys
if len(sys.argv) != 3:
print('Usage: %s <device> <mode>' % sys.argv[0])
exit(1)
if sys.argv[2] not in ['station', 'ap', 'ad-hoc']:
print('<mode> must be station, ap or ad-hoc')
exit(1)
bus = dbus.SystemBus()
device = dbus.Interface(bus.get_object('net.connman.iwd', sys.argv[1]),
'org.freedesktop.DBus.Properties')
device.Set('net.connman.iwd.Device', 'Mode', sys.argv[2])