test/test-call-barring \
test/test-call-forwarding \
test/test-call-settings \
- test/test-manager \
test/test-modem \
test/test-network-registration \
test/test-phonebook \
manager = dbus.Interface(bus.get_object('org.ofono', '/'),
'org.ofono.Manager')
-properties = manager.GetProperties()
-
-for path in properties["Modems"]:
- modem = dbus.Interface(bus.get_object('org.ofono', path),
- 'org.ofono.Modem')
-
- properties = modem.GetProperties()
+modems = manager.GetModems()
+for path, properties in modems:
if "org.ofono.ConnectionManager" not in properties["Interfaces"]:
continue
manager = dbus.Interface(bus.get_object('org.ofono', '/'),
'org.ofono.Manager')
-properties = manager.GetProperties()
-path = properties["Modems"][0]
+modems = manager.GetModems()
+
+path, properties = modems[0]
ussd = dbus.Interface(bus.get_object('org.ofono', path),
'org.ofono.SupplementaryServices')
manager = dbus.Interface(bus.get_object('org.ofono', '/'),
'org.ofono.Manager')
-properties = manager.GetProperties()
-
-for path in properties["Modems"]:
- modem = dbus.Interface(bus.get_object('org.ofono', path),
- 'org.ofono.Modem')
-
- properties = modem.GetProperties()
+modems = manager.GetModems()
+for path, properties in modems:
if "org.ofono.ConnectionManager" not in properties["Interfaces"]:
continue
manager = dbus.Interface(bus.get_object('org.ofono', '/'),
'org.ofono.Manager')
-properties = manager.GetProperties()
+modems = manager.GetModems()
-path = properties["Modems"][0]
+path, properties = modems[0]
manager = dbus.Interface(bus.get_object('org.ofono', path),
'org.ofono.VoiceCallManager')
manager = dbus.Interface(bus.get_object('org.ofono', '/'),
'org.ofono.Manager')
-properties = manager.GetProperties()
-
-for path in properties["Modems"]:
- modem = dbus.Interface(bus.get_object('org.ofono', path),
- 'org.ofono.Modem')
-
- properties = modem.GetProperties()
+modems = manager.GetModems()
+for path, properties in modems:
if "org.ofono.ConnectionManager" not in properties["Interfaces"]:
continue
manager = dbus.Interface(bus.get_object('org.ofono', '/'),
'org.ofono.Manager')
-properties = manager.GetProperties()
+modems = manager.GetModems()
-path = properties["Modems"][0]
+path, properties = modems[0]
manager = dbus.Interface(bus.get_object('org.ofono', path),
'org.ofono.VoiceCallManager')
else:
manager = dbus.Interface(bus.get_object('org.ofono', '/'),
'org.ofono.Manager')
- properties = manager.GetProperties()
- path = properties["Modems"][0]
+ modems = manager.GetModems()
+ path = modems[0][0]
print "Disconnecting modem %s..." % path
modem = dbus.Interface(bus.get_object('org.ofono', path),
else:
manager = dbus.Interface(bus.get_object('org.ofono', '/'),
'org.ofono.Manager')
- properties = manager.GetProperties()
- path = properties["Modems"][0]
+ modems = manager.GetModems()
+ path = modems[0][0]
print "Enabling cell broadcast on modem %s..." % path
cbs = dbus.Interface(bus.get_object('org.ofono', path),
else:
manager = dbus.Interface(bus.get_object('org.ofono', '/'),
'org.ofono.Manager')
- properties = manager.GetProperties()
- path = properties["Modems"][0]
+ modems = manager.GetModems()
+ path = modems[0][0]
print "Connecting modem %s..." % path
modem = dbus.Interface(bus.get_object('org.ofono', path),
pin = sys.argv[3]
elif len(sys.argv) == 3:
manager = dbus.Interface(bus.get_object('org.ofono', '/'),
- 'org.ofono.Manager')
- properties = manager.GetProperties()
- path = properties["Modems"][0]
+ 'org.ofono.Manager')
+ modems = manager.GetModems()
+ path = modems[0][0]
pin_type = sys.argv[1]
pin = sys.argv[2]
else:
print "Enter Pin for modem %s..." % path
simmanager = dbus.Interface(bus.get_object('org.ofono', path),
- 'org.ofono.SimManager')
+ 'org.ofono.SimManager')
simmanager.EnterPin(pin_type, pin)
else:
manager = dbus.Interface(bus.get_object('org.ofono', '/'),
'org.ofono.Manager')
- properties = manager.GetProperties()
- path = properties["Modems"][0]
+ modems = manager.GetModems()
+ path = modems[0][0]
netreg = dbus.Interface(bus.get_object('org.ofono', path),
'org.ofono.NetworkRegistration')
else:
val = str(properties[key])
print " %s = %s" % (key, val)
-
+
print
else:
manager = dbus.Interface(bus.get_object('org.ofono', '/'),
'org.ofono.Manager')
- properties = manager.GetProperties()
- path = properties["Modems"][0]
+ modems = manager.GetModems()
+ path = modems[0][0]
radiosettings = dbus.Interface(bus.get_object('org.ofono', path),
'org.ofono.RadioSettings')
manager = dbus.Interface(bus.get_object('org.ofono', '/'),
'org.ofono.Manager')
-properties = manager.GetProperties()
-
-path = properties["Modems"][0]
+modems = manager.GetModems()
+path = modems[0][0]
manager = dbus.Interface(bus.get_object('org.ofono', path),
'org.ofono.VoiceCallManager')
manager = dbus.Interface(bus.get_object('org.ofono', '/'),
'org.ofono.Manager')
-properties = manager.GetProperties()
-path = properties["Modems"][0]
+modems = manager.GetModems()
+path = modems[0][0]
ussd = dbus.Interface(bus.get_object('org.ofono', path),
'org.ofono.SupplementaryServices')
manager = dbus.Interface(bus.get_object('org.ofono', '/'),
'org.ofono.Manager')
-properties = manager.GetProperties()
-
-for path in properties["Modems"]:
- modem = dbus.Interface(bus.get_object('org.ofono', path),
- 'org.ofono.Modem')
-
- properties = modem.GetProperties()
+modems = manager.GetModems()
+for path, properties in modems:
print "[ %s ]" % (path)
if "org.ofono.VoiceCallManager" not in properties["Interfaces"]:
manager = dbus.Interface(bus.get_object('org.ofono', '/'),
'org.ofono.Manager')
-properties = manager.GetProperties()
-
-for path in properties["Modems"]:
- modem = dbus.Interface(bus.get_object('org.ofono', path),
- 'org.ofono.Modem')
-
- properties = modem.GetProperties()
+modems = manager.GetModems()
+for path, properties in modems:
print "[ %s ]" % (path)
if "org.ofono.ConnectionManager" not in properties["Interfaces"]:
manager = dbus.Interface(bus.get_object('org.ofono', '/'),
'org.ofono.Manager')
-properties = manager.GetProperties()
-
-for path in properties["Modems"]:
- modem = dbus.Interface(bus.get_object('org.ofono', path),
- 'org.ofono.Modem')
-
- properties = modem.GetProperties()
+modems = manager.GetModems()
+for path, properties in modems:
print "[ %s ]" % (path)
for key in properties.keys():
else:
val = str(properties[key])
print " %s = %s" % (key, val)
-
+
print
manager = dbus.Interface(bus.get_object('org.ofono', '/'),
'org.ofono.Manager')
-properties = manager.GetProperties()
-
-for path in properties["Modems"]:
- modem = dbus.Interface(bus.get_object('org.ofono', path),
- 'org.ofono.Modem')
-
- properties = modem.GetProperties()
+modems = manager.GetModems()
+for path, properties in modems:
print "[ %s ]" % (path)
if "org.ofono.NetworkRegistration" not in properties["Interfaces"]:
pin = sys.argv[3]
elif len(sys.argv) == 3:
manager = dbus.Interface(bus.get_object('org.ofono', '/'),
- 'org.ofono.Manager')
- properties = manager.GetProperties()
- path = properties["Modems"][0]
+ 'org.ofono.Manager')
+ modems = manager.GetModems()
+ path = modems[0][0]
pin_type = sys.argv[1]
pin = sys.argv[2]
else:
print "Lock %s %s for modem %s..." % (pin_type, pin, path)
simmanager = dbus.Interface(bus.get_object('org.ofono', path),
- 'org.ofono.SimManager')
+ 'org.ofono.SimManager')
simmanager.LockPin(pin_type, pin)
bus.add_signal_receiver(added,
bus_name="org.ofono",
+ signal_name = "ModemAdded",
+ member_keyword="member",
+ path_keyword="path",
+ interface_keyword="interface")
+
+ bus.add_signal_receiver(removed,
+ bus_name="org.ofono",
+ signal_name = "ModemRemoved",
+ member_keyword="member",
+ path_keyword="path",
+ interface_keyword="interface")
+
+ bus.add_signal_receiver(added,
+ bus_name="org.ofono",
signal_name = "ContextAdded",
member_keyword="member",
path_keyword="path",
else:
manager = dbus.Interface(bus.get_object('org.ofono', '/'),
'org.ofono.Manager')
- properties = manager.GetProperties()
- path = properties["Modems"][0]
+ modems = manager.GetModems()
+ path = modems[0][0]
print "Setting modem %s offline..." % path
modem = dbus.Interface(bus.get_object('org.ofono', path), 'org.ofono.Modem')
else:
manager = dbus.Interface(bus.get_object('org.ofono', '/'),
'org.ofono.Manager')
- properties = manager.GetProperties()
- path = properties["Modems"][0]
+ modems = manager.GetModems()
+ path = modems[0][0]
print "Setting modem %s online..." % path
modem = dbus.Interface(bus.get_object('org.ofono', path), 'org.ofono.Modem')
manager = dbus.Interface(bus.get_object('org.ofono', '/'),
'org.ofono.Manager')
-properties = manager.GetProperties()
-
-path = properties["Modems"][0]
+modems = manager.GetModems()
+path = modems[0][0]
manager = dbus.Interface(bus.get_object('org.ofono', path),
'org.ofono.VoiceCallManager')
manager = dbus.Interface(bus.get_object('org.ofono', '/'),
'org.ofono.Manager')
-properties = manager.GetProperties()
-
-for path in properties["Modems"]:
- modem = dbus.Interface(bus.get_object('org.ofono', path),
- 'org.ofono.Modem')
-
- properties = modem.GetProperties()
+modems = manager.GetModems()
+for path, properties in modems:
if "org.ofono.ConnectionManager" not in properties["Interfaces"]:
continue
manager = dbus.Interface(bus.get_object('org.ofono', '/'),
'org.ofono.Manager')
-properties = manager.GetProperties()
-
-for path in properties["Modems"]:
- modem = dbus.Interface(bus.get_object('org.ofono', path),
- 'org.ofono.Modem')
-
- properties = modem.GetProperties()
+modems = manager.GetModems()
+for path, properties in modems:
if "org.ofono.ConnectionManager" not in properties["Interfaces"]:
continue
else:
manager = dbus.Interface(bus.get_object('org.ofono', '/'),
'org.ofono.Manager')
- properties = manager.GetProperties()
- path = properties["Modems"][0]
+ modems = manager.GetModems()
+ path = modems[0][0]
print "Propose scanning for modem %s..." % path
netreg = dbus.Interface(bus.get_object('org.ofono', path),
else:
val = str(properties[key])
print " %s = %s" % (key, val)
-
+
print
manager = dbus.Interface(bus.get_object('org.ofono', '/'),
'org.ofono.Manager')
-properties = manager.GetProperties()
-
-path = properties["Modems"][0]
+modems = manager.GetModems()
+path = modems[0][0]
manager = dbus.Interface(bus.get_object('org.ofono', path),
'org.ofono.MessageManager')
topics = sys.argv[2]
elif len(sys.argv) == 2:
manager = dbus.Interface(bus.get_object('org.ofono', '/'),
- 'org.ofono.Manager')
- properties = manager.GetProperties()
- path = properties["Modems"][0]
+ 'org.ofono.Manager')
+ modems = manager.GetModems()
+ path = modems[0][0]
topics = sys.argv[1]
else:
print "%s [PATH] topics" % (sys.argv[0])
print "Setting cell broadcast topics for modem %s..." % path
cbs = dbus.Interface(bus.get_object('org.ofono', path),
- 'org.ofono.CellBroadcast')
+ 'org.ofono.CellBroadcast')
cbs.SetProperty("Topics", topics);
manager = dbus.Interface(bus.get_object('org.ofono', '/'),
'org.ofono.Manager')
-properties = manager.GetProperties()
-
-path = properties["Modems"][0]
+modems = manager.GetModems()
+path = modems[0][0]
cv = dbus.Interface(bus.get_object('org.ofono', path),
'org.ofono.CallVolume')
manager = dbus.Interface(bus.get_object('org.ofono', '/'),
'org.ofono.Manager')
-properties = manager.GetProperties()
-
-path = properties["Modems"][0]
+modems = manager.GetModems()
+path = modems[0][0]
cv = dbus.Interface(bus.get_object('org.ofono', path),
'org.ofono.CallVolume')
tech = sys.argv[2]
elif len(sys.argv) == 2:
manager = dbus.Interface(bus.get_object('org.ofono', '/'),
- 'org.ofono.Manager')
- properties = manager.GetProperties()
- path = properties["Modems"][0]
+ 'org.ofono.Manager')
+ modems = manager.GetModems()
+ path = modems[0][0]
tech = sys.argv[1]
else:
print "%s [PATH] technology" % (sys.argv[0])
print "Setting technology preference for modem %s..." % path
radiosettings = dbus.Interface(bus.get_object('org.ofono', path),
- 'org.ofono.RadioSettings')
+ 'org.ofono.RadioSettings')
radiosettings.SetProperty("TechnologyPreference", tech);
enabled = sys.argv[2]
elif len(sys.argv) == 2:
manager = dbus.Interface(bus.get_object('org.ofono', '/'),
- 'org.ofono.Manager')
- properties = manager.GetProperties()
- path = properties["Modems"][0]
+ 'org.ofono.Manager')
+ modems = manager.getmodems()
+ path = modems[0][0]
enabled = sys.argv[1]
else:
print "%s [PATH] topics" % (sys.argv[0])
print "Setting delivery report use for modem %s..." % path
sms = dbus.Interface(bus.get_object('org.ofono', path),
- 'org.ofono.MessageManager')
+ 'org.ofono.MessageManager')
sms.SetProperty("UseDeliveryReports", dbus.Boolean(enabled));
manager = dbus.Interface(bus.get_object('org.ofono', '/'),
'org.ofono.Manager')
- modems = manager.GetProperties()['Modems']
+ modems = manager.GetModems()
- cm = dbus.Interface(bus.get_object('org.ofono', modems[0]),
+ cm = dbus.Interface(bus.get_object('org.ofono', modems[0][0]),
'org.ofono.CallMeter')
cm.connect_to_signal("PropertyChanged", cm_property_changed)
manager = dbus.Interface(bus.get_object('org.ofono', '/'),
'org.ofono.Manager')
- modems = manager.GetProperties()['Modems']
+ modems = manager.GetModems()
- cb = dbus.Interface(bus.get_object('org.ofono', modems[0]),
+ cb = dbus.Interface(bus.get_object('org.ofono', modems[0][0]),
'org.ofono.CallBarring')
cb.connect_to_signal("PropertyChanged", property_changed)
manager = dbus.Interface(bus.get_object('org.ofono', '/'),
'org.ofono.Manager')
- try:
- modems = manager.GetProperties()['Modems']
- except dbus.DBusException, e:
- print "Unable to get the modem list %s" % e
+ modems = manager.GetModems()
- cf = dbus.Interface(bus.get_object('org.ofono', modems[0]),
+ cf = dbus.Interface(bus.get_object('org.ofono', modems[0][0]),
'org.ofono.CallForwarding')
cf.connect_to_signal("PropertyChanged", property_changed)
manager = dbus.Interface(bus.get_object('org.ofono', '/'),
'org.ofono.Manager')
- modems = manager.GetProperties()['Modems']
+ modems = manager.GetModems()
- cs = dbus.Interface(bus.get_object('org.ofono', modems[0]),
+ cs = dbus.Interface(bus.get_object('org.ofono', modems[0][0]),
'org.ofono.CallSettings')
cs.connect_to_signal("PropertyChanged", property_changed)
+++ /dev/null
-#!/usr/bin/python
-
-import gobject
-
-import dbus
-import dbus.mainloop.glib
-
-def property_changed(property, value):
- print "Manager property %s changed to %s" % (name, value)
-
-if __name__ == "__main__":
- dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
-
- bus = dbus.SystemBus()
-
- manager = dbus.Interface(bus.get_object('org.ofono', '/'),
- 'org.ofono.Manager')
-
- manager.connect_to_signal("PropertyChanged", property_changed)
-
- try:
- properties = manager.GetProperties()
- print properties['Modems']
- except dbus.DBusException, e:
- print "Unable to call GetProperties %s" % e
-
- mainloop = gobject.MainLoop()
- mainloop.run()
manager = dbus.Interface(bus.get_object('org.ofono', '/'),
'org.ofono.Manager')
- modems = manager.GetProperties()['Modems']
- print modems
-
- modem = dbus.Interface(bus.get_object('org.ofono', modems[0]),
+ modems = manager.GetModems()
+ modem = dbus.Interface(bus.get_object('org.ofono', modems[0][0]),
'org.ofono.Modem')
modem.connect_to_signal("PropertyChanged", property_changed)
manager = dbus.Interface(bus.get_object('org.ofono', '/'),
'org.ofono.Manager')
- modems = manager.GetProperties()['Modems']
+ modems = manager.GetModems()
- netreg = dbus.Interface(bus.get_object('org.ofono', modems[0]),
+ netreg = dbus.Interface(bus.get_object('org.ofono', modems[0][0]),
'org.ofono.NetworkRegistration')
netreg.connect_to_signal("PropertyChanged", network_property_changed)
manager = dbus.Interface(bus.get_object('org.ofono', '/'),
'org.ofono.Manager')
- try:
- modems = manager.GetProperties()['Modems']
- except dbus.DBusException, e:
- print "Unable to get the Modems property %s" % e
-
- phonebook = dbus.Interface(bus.get_object('org.ofono', modems[0]),
+ modems = manager.GetModems()
+ phonebook = dbus.Interface(bus.get_object('org.ofono', modems[0][0]),
'org.ofono.Phonebook')
print phonebook.Import(timeout=100)
manager = dbus.Interface(bus.get_object('org.ofono', '/'),
'org.ofono.Manager')
- try:
- modems = manager.GetProperties()['Modems']
- except dbus.DBusException, e:
- print "Unable to get the Modems property %s" % e
+ modems = manager.GetModems()
- cb = dbus.Interface(bus.get_object('org.ofono', modems[0]),
+ cb = dbus.Interface(bus.get_object('org.ofono', modems[0][0]),
'org.ofono.CallBarring')
cb.connect_to_signal("PropertyChanged", property_changed)
manager = dbus.Interface(bus.get_object('org.ofono', '/'),
'org.ofono.Manager')
- try:
- modems = manager.GetProperties()['Modems']
- except dbus.DBusException, e:
- print "Unable to get the Modems property %s" % e
+ modems = manager.GetModems()
- cf = dbus.Interface(bus.get_object('org.ofono', modems[0]),
+ cf = dbus.Interface(bus.get_object('org.ofono', modems[0][0]),
'org.ofono.CallForwarding')
cf.connect_to_signal("PropertyChanged", property_changed)
- ss = dbus.Interface(bus.get_object('org.ofono', modems[0]),
+ ss = dbus.Interface(bus.get_object('org.ofono', modems[0][0]),
'org.ofono.SupplementaryServices')
# Clear everything
manager = dbus.Interface(bus.get_object('org.ofono', '/'),
'org.ofono.Manager')
- try:
- modems = manager.GetProperties()['Modems']
- except dbus.DBusException, e:
- print "Unable to get the Modems property %s" % e
+ modems = manager.GetModems()
- cs = dbus.Interface(bus.get_object('org.ofono', modems[0]),
+ cs = dbus.Interface(bus.get_object('org.ofono', modems[0][0]),
'org.ofono.CallSettings')
cs.connect_to_signal("PropertyChanged", property_changed)
manager = dbus.Interface(bus.get_object("org.ofono", "/"),
"org.ofono.Manager")
- properties = manager.GetProperties()
-
- for path in properties["Modems"]:
- modem = dbus.Interface(bus.get_object('org.ofono', path),
- 'org.ofono.Modem')
-
- properties = modem.GetProperties()
+ modems = manager.GetModems()
+ for path, properties in modems:
if "org.ofono.SimToolkit" not in properties["Interfaces"]:
continue
manager = dbus.Interface(bus.get_object('org.ofono', '/'),
'org.ofono.Manager')
- try:
- modems = manager.GetProperties()['Modems']
- except dbus.DBusException, e:
- print "Unable to get the Modems property %s" % e
-
- ss = dbus.Interface(bus.get_object('org.ofono', modems[0]),
+ modems = manager.GetModems()
+ ss = dbus.Interface(bus.get_object('org.ofono', modems[0][0]),
'org.ofono.SupplementaryServices')
props = ss.GetProperties()
manager = dbus.Interface(bus.get_object('org.ofono', '/'),
'org.ofono.Manager')
- modems = manager.GetProperties()['Modems']
- modem = modems[0]
- print modems
+ modems = manager.GetModems()
+ modem = modems[0][0]
if (len(sys.argv) == 3):
modem = sys.argv[1]
pin = sys.argv[3]
elif len(sys.argv) == 3:
manager = dbus.Interface(bus.get_object('org.ofono', '/'),
- 'org.ofono.Manager')
- properties = manager.GetProperties()
- path = properties["Modems"][0]
+ 'org.ofono.Manager')
+ modems = manager.GetModems()
+ path = modems[0][0]
pin_type = sys.argv[1]
pin = sys.argv[2]
else:
print "Unlock %s %s for modem %s..." % (pin_type, pin, path)
simmanager = dbus.Interface(bus.get_object('org.ofono', path),
- 'org.ofono.SimManager')
+ 'org.ofono.SimManager')
simmanager.UnlockPin(pin_type, pin)