* Option (hso) modem and PAP
@ 2010-06-22 9:14 Benoit Monin
2010-06-22 9:16 ` Set username and password with create-context Benoit Monin
2010-06-22 9:16 ` hso : swap username and password for PAP Benoit Monin
0 siblings, 2 replies; 3+ messages in thread
From: Benoit Monin @ 2010-06-22 9:14 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 752 bytes --]
Hi,
I have been trying an Option modem with ofono recently.
It took me a while to establish a connection because the APN
we're using needs a username and password. Apparently Option
swapped the username and password of the AT command AT$QCPDPP.
Also, it seems that some other Option modem uses AT_OPDPP
instead of AT$QCPDPP, see http://www.pharscape.org/Quicksilver.html
I'll send two patches in reply to this message. The first one
adds username and password optional parameters to
test/create-context. And the second one swaps username and
password for hso modem in PAP mode.
Benoît.
--
Une messagerie gratuite, garantie à vie et des services en plus, ça vous tente ?
Je crée ma boîte mail www.laposte.net
^ permalink raw reply [flat|nested] 3+ messages in thread
* Set username and password with create-context
2010-06-22 9:14 Option (hso) modem and PAP Benoit Monin
@ 2010-06-22 9:16 ` Benoit Monin
2010-06-22 9:16 ` hso : swap username and password for PAP Benoit Monin
1 sibling, 0 replies; 3+ messages in thread
From: Benoit Monin @ 2010-06-22 9:16 UTC (permalink / raw)
To: ofono
[-- 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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* hso : swap username and password for PAP
2010-06-22 9:14 Option (hso) modem and PAP Benoit Monin
2010-06-22 9:16 ` Set username and password with create-context Benoit Monin
@ 2010-06-22 9:16 ` Benoit Monin
1 sibling, 0 replies; 3+ messages in thread
From: Benoit Monin @ 2010-06-22 9:16 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 1059 bytes --]
The parameters for the AT command AT$QCPDPP must be swapped for PAP in order
to make it work with an Option modem. Tested with a GTM382 development kit.
No idea about CHAP parameters, left unchanged.
Signed-off-by: Benoît Monin
---
drivers/hsomodem/gprs-context.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/hsomodem/gprs-context.c b/drivers/hsomodem/gprs-context.c
index 08c662f..87b6a09 100644
--- a/drivers/hsomodem/gprs-context.c
+++ b/drivers/hsomodem/gprs-context.c
@@ -166,7 +166,7 @@ static void hso_gprs_activate_primary(struct ofono_gprs_context *gc,
if (ctx->username[0] && ctx->password[0])
snprintf(buf, sizeof(buf), "AT$QCPDPP=%u,1,\"%s\",\"%s\"",
- ctx->cid, ctx->username, ctx->password);
+ ctx->cid, ctx->password, ctx->username);
else if (ctx->password[0])
snprintf(buf, sizeof(buf), "AT$QCPDPP=%u,2,,\"%s\"",
ctx->cid, ctx->password);
--
Une messagerie gratuite, garantie à vie et des services en plus, ça vous tente ?
Je crée ma boîte mail www.laposte.net
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-06-22 9:16 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-22 9:14 Option (hso) modem and PAP Benoit Monin
2010-06-22 9:16 ` Set username and password with create-context Benoit Monin
2010-06-22 9:16 ` hso : swap username and password for PAP Benoit Monin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox