[PATCH 1/2] Fix: Username and Password must be set after context is created.
Sjur Brændeland
sjur.brandeland at stericsson.com
Mon Feb 1 09:23:33 PST 2010
Hi Marcel.
Marcel Holtmann wrote:
>> len = sprintf(buf, "AT+CGDCONT=%u,\"IP\"", ctx->cid);
>>
>> if (ctx->apn)
>> snprintf(buf + len, sizeof(buf) - len - 3, ",\"%s\"",
>> ctx->apn);
>>
>> + /* Set username and password. Must be done after context creation */
>> + len = strlen(buf);
>> + sprintf(buf+len, ";*EIAAUW=%d,1,\"%s\",\"%s\"", ctx->cid,
>> + ctx->username, ctx->password);
>> +
>> if (g_at_chat_send(gcd->chat, buf, none_prefix,
>> ste_cgdcont_cb, cbd, g_free) > 0)
>> return;
>
> this looks pretty much complicated and I prefer we don't use this
> crazy concat of AT commands. Also it violates the coding style.
>
> There is no problem to just use g_at_chat_send twice since it will
> queue the commands for you properly. However if this really depends
> on CGDCONT succeeding, then we better do it in the callback.
We originally did send EIAAUW in the callback, but Denis changed this
because MBM did it EIAAUW before CGDCONT.
> And we might wanna check if MBM cards behave similar and ensure that
> STE and MBM cards use a similar code flow.
When testing this EIAAUW fails if there are no prior PDP context on the modem.
Most likely this is the case with the MBM module as well, but I have not tested this.
BR/Sjur
More information about the ofono
mailing list