2014-03-11 16:39:22 +00:00
|
|
|
#!/usr/bin/python3
|
2010-08-16 15:07:28 +00:00
|
|
|
|
|
|
|
import sys
|
|
|
|
import dbus
|
|
|
|
|
|
|
|
bus = dbus.SystemBus()
|
|
|
|
|
|
|
|
manager = dbus.Interface(bus.get_object('org.ofono', '/'),
|
|
|
|
'org.ofono.Manager')
|
|
|
|
|
2010-09-09 19:37:37 +00:00
|
|
|
modems = manager.GetModems()
|
|
|
|
|
2011-06-08 13:56:28 +00:00
|
|
|
if (len(sys.argv) == 2):
|
|
|
|
path = sys.argv[1]
|
|
|
|
else:
|
|
|
|
path = modems[0][0]
|
2010-08-16 15:07:28 +00:00
|
|
|
|
|
|
|
ussd = dbus.Interface(bus.get_object('org.ofono', path),
|
|
|
|
'org.ofono.SupplementaryServices')
|
|
|
|
|
2010-08-16 17:09:30 +00:00
|
|
|
properties = ussd.GetProperties()
|
|
|
|
state = properties["State"]
|
|
|
|
|
2014-03-11 16:39:18 +00:00
|
|
|
print("State: %s" % (state))
|
2010-08-16 17:09:30 +00:00
|
|
|
|
|
|
|
if state != "idle":
|
|
|
|
ussd.Cancel()
|