Open Source Telephony
 help / color / mirror / Atom feed
From: Benoit Monin <benoit.monin@laposte.net>
To: ofono@ofono.org
Subject: [PATCH] Set username and password with create-context
Date: Mon, 27 Sep 2010 14:37:20 +0200	[thread overview]
Message-ID: <27648846.26052.1285591040517.JavaMail.www@wwinf8219> (raw)
In-Reply-To: <4701421.25982.1285590974586.JavaMail.www@wwinf8219>

[-- Attachment #1: Type: text/plain, Size: 1623 bytes --]


Add the possibility to set the username and the password
with create-context, in complement of the APN.
---
test/create-context | 28 +++++++++++++++++++++++-----
1 files changed, 23 insertions(+), 5 deletions(-)

diff --git a/test/create-context b/test/create-context
index 6777ba7..6e42053 100755
--- a/test/create-context
+++ b/test/create-context
@@ -27,10 +27,28 @@ for path, properties in modems:
context = dbus.Interface(bus.get_object('org.ofono', path),
'org.ofono.ConnectionContext')

- 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


  reply	other threads:[~2010-09-27 12:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-27 12:36 Option (hso) modem and PAP Benoit Monin
2010-09-27 12:37 ` Benoit Monin [this message]
2010-09-27 12:38 ` [PATCH] hso : swap username and password for PAP Benoit Monin
2010-09-28  0:29   ` Denis Kenzior
2010-09-28  8:03     ` 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=27648846.26052.1285591040517.JavaMail.www@wwinf8219 \
    --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