From: Benoit Monin <benoit.monin@laposte.net>
To: ofono@ofono.org
Subject: Set username and password with create-context
Date: Tue, 22 Jun 2010 09:16:00 +0000 [thread overview]
Message-ID: <14587206.98572.1277198155336.JavaMail.www@wwinf8402> (raw)
In-Reply-To: <25118539.98442.1277198076995.JavaMail.www@wwinf8402>
[-- Attachment #1: Type: text/plain, Size: 1657 bytes --]
Add the possibility to set the username and the password
with create-context, in complement of the APN.
Signed-off-by: Benoît Monin
---
test/create-context | 28 +++++++++++++++++++++++-----
1 files changed, 23 insertions(+), 5 deletions(-)
diff --git a/test/create-context b/test/create-context
index 4523c3a..c9ffeac 100755
--- a/test/create-context
+++ b/test/create-context
@@ -32,10 +32,28 @@ for path in properties["Modems"]:
context = dbus.Interface(bus.get_object('org.ofono', path),
'org.ofono.PrimaryDataContext')
- try:
- context.SetProperty("AccessPointName", sys.argv[1])
- except IndexError:
- print "Usage: %s " % sys.argv[0]
+ if len(sys.argv) == 2:
+ AccessPointName = sys.argv[1]
+ Username = ""
+ Password = ""
+ elif len(sys.argv) == 3:
+ AccessPointName = sys.argv[1]
+ Username = ""
+ Password = sys.argv[2]
+ elif len(sys.argv) == 4:
+ AccessPointName = sys.argv[1]
+ Username = sys.argv[2]
+ Password = sys.argv[3]
+ else:
+ print "Usage:"
+ print "\t%s " % sys.argv[0]
+ print "\t%s
" % sys.argv[0]
+ print "\t%s
" % sys.argv[0]
exit(1)
- print "Setting APN of %s to %s" % (path, sys.argv[1])
+ context.SetProperty("AccessPointName", AccessPointName)
+ print "Setting APN of %s to \"%s\"" % (path, AccessPointName)
+ context.SetProperty("Username", Username)
+ print "Setting username of %s to \"%s\"" % (path, Username)
+ context.SetProperty("Password", Password)
+ print "Setting password of %s to \"%s\"" % (path, Password)
--
Une messagerie gratuite, garantie à vie et des services en plus, ça vous tente ?
Je crée ma boîte mail www.laposte.net
next prev parent reply other threads:[~2010-06-22 9:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-22 9:14 Option (hso) modem and PAP Benoit Monin
2010-06-22 9:16 ` Benoit Monin [this message]
2010-06-22 9:16 ` hso : swap username and password for PAP Benoit Monin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=14587206.98572.1277198155336.JavaMail.www@wwinf8402 \
--to=benoit.monin@laposte.net \
--cc=ofono@ofono.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox