* Option (hso) modem and PAP @ 2010-09-27 12:36 Benoit Monin 2010-09-27 12:37 ` [PATCH] Set username and password with create-context Benoit Monin 2010-09-27 12:38 ` [PATCH] hso : swap username and password for PAP Benoit Monin 0 siblings, 2 replies; 5+ messages in thread From: Benoit Monin @ 2010-09-27 12:36 UTC (permalink / raw) To: ofono [-- Attachment #1: Type: text/plain, Size: 756 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] 5+ messages in thread
* [PATCH] Set username and password with create-context 2010-09-27 12:36 Option (hso) modem and PAP Benoit Monin @ 2010-09-27 12:37 ` Benoit Monin 2010-09-27 12:38 ` [PATCH] hso : swap username and password for PAP Benoit Monin 1 sibling, 0 replies; 5+ messages in thread From: Benoit Monin @ 2010-09-27 12:37 UTC (permalink / raw) To: ofono [-- 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 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH] hso : swap username and password for PAP 2010-09-27 12:36 Option (hso) modem and PAP Benoit Monin 2010-09-27 12:37 ` [PATCH] Set username and password with create-context Benoit Monin @ 2010-09-27 12:38 ` Benoit Monin 2010-09-28 0:29 ` Denis Kenzior 1 sibling, 1 reply; 5+ messages in thread From: Benoit Monin @ 2010-09-27 12:38 UTC (permalink / raw) To: ofono [-- Attachment #1: Type: text/plain, Size: 1012 bytes --] The parameters for the AT command AT$QCPDPP must be swapped for PAP in order to make to work with an Option modem. Tested with a GTM382 development kit. No idea about CHAP parameters. --- 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 e1c94ad..dc6f1b6 100644 --- a/drivers/hsomodem/gprs-context.c +++ b/drivers/hsomodem/gprs-context.c @@ -165,7 +165,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] 5+ messages in thread
* Re: [PATCH] hso : swap username and password for PAP 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 0 siblings, 1 reply; 5+ messages in thread From: Denis Kenzior @ 2010-09-28 0:29 UTC (permalink / raw) To: ofono [-- Attachment #1: Type: text/plain, Size: 1421 bytes --] Hi Benoit, On 09/27/2010 07:38 AM, Benoit Monin wrote: > > The parameters for the AT command AT$QCPDPP must be swapped for PAP in order > to make to work with an Option modem. Tested with a GTM382 development kit. > No idea about CHAP parameters. > --- > 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 e1c94ad..dc6f1b6 100644 > --- a/drivers/hsomodem/gprs-context.c > +++ b/drivers/hsomodem/gprs-context.c > @@ -165,7 +165,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); Your patch submission seems mangled: Applying: hso : swap username and password for PAP fatal: corrupt patch at line 11 Patch failed at 0001 hso : swap username and password for PAP When you have resolved this problem run "git am --resolved". If you would prefer to skip this patch, instead run "git am --skip". To restore the original branch and stop patching run "git am --abort". I went ahead and fixed this for you. Regards, -Denis ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] hso : swap username and password for PAP 2010-09-28 0:29 ` Denis Kenzior @ 2010-09-28 8:03 ` Benoit Monin 0 siblings, 0 replies; 5+ messages in thread From: Benoit Monin @ 2010-09-28 8:03 UTC (permalink / raw) To: ofono [-- Attachment #1: Type: text/plain, Size: 354 bytes --] > De : "Denis Kenzior" > > Your patch submission seems mangled: [...] > I went ahead and fixed this for you. > Oops, sorry about that. Thanks for applying the patch. > Regards, > -Denis > 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] 5+ messages in thread
end of thread, other threads:[~2010-09-28 8:03 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2010-09-27 12:36 Option (hso) modem and PAP Benoit Monin 2010-09-27 12:37 ` [PATCH] Set username and password with create-context Benoit Monin 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
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.