Home | History | Annotate | Download | only in test-scripts
      1 #!/usr/bin/python
      2 
      3 import dbus, flimflam, sys
      4 
      5 if (len(sys.argv) < 4):
      6     print "Usage: %s <device-name> <property> <value>" % (sys.argv[0])
      7     sys.exit(1)
      8 
      9 (_, name, property_key, value) = sys.argv
     10 
     11 flim = flimflam.FlimFlam()
     12 device = flim.FindElementByNameSubstring('Device', name)
     13 if property_key in ["BgscanShortInterval", "RoamThreshold", "ScanInterval" ]:
     14     device.SetProperty(property_key, dbus.UInt16(value))
     15 elif property_key in [ "BgscanSignalThreshold", ]:
     16     device.SetProperty(property_key, dbus.Int32(value))
     17 elif property_key in ["Cellular.AllowRoaming", "Powered"]:
     18     device.SetProperty(property_key,
     19                        dbus.Boolean(value.lower() in ("true", "1")))
     20 else:
     21     device.SetProperty(property_key, value)
     22