~ubuntu-branches/ubuntu/utopic/ofono/utopic-proposed

« back to all changes in this revision

Viewing changes to test/cdma-set-credentials

  • Committer: Package Import Robot
  • Author(s): Mathieu Trudel-Lapierre
  • Date: 2012-08-22 19:59:08 UTC
  • mfrom: (1.4.3)
  • mto: This revision was merged to the branch mainline in revision 21.
  • Revision ID: package-import@ubuntu.com-20120822195908-20ccett2uhgcz7f6
Tags: upstream-1.9
ImportĀ upstreamĀ versionĀ 1.9

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/python
 
2
 
 
3
import dbus
 
4
import sys
 
5
 
 
6
bus = dbus.SystemBus()
 
7
 
 
8
manager = dbus.Interface(bus.get_object('org.ofono', '/'),
 
9
                                                'org.ofono.Manager')
 
10
 
 
11
modems = manager.GetModems()
 
12
 
 
13
for path, properties in modems:
 
14
        if "org.ofono.cdma.ConnectionManager" not in properties["Interfaces"]:
 
15
                continue
 
16
 
 
17
        cm = dbus.Interface(bus.get_object('org.ofono', path),
 
18
                                        'org.ofono.cdma.ConnectionManager')
 
19
 
 
20
        print "Connecting CDMA Packet Data Service on modem %s..." % path
 
21
 
 
22
        if len(sys.argv) > 1:
 
23
                cm.SetProperty("Username", (sys.argv[1]))
 
24
                print "Setting Username to %s" % (sys.argv[1])
 
25
 
 
26
        if len(sys.argv) > 2:
 
27
                cm.SetProperty("Password", (sys.argv[2]))
 
28
                print "Setting Password to %s" % (sys.argv[2])