struct gprs_context_data {
GAtChat *chat;
unsigned int active_context;
- char *username;
- char *password;
};
struct conn_info {
struct ofono_gprs_context *gc = cbd->user;
struct gprs_context_data *gcd = ofono_gprs_context_get_data(gc);
struct cb_data *ncbd = NULL;
+ char buf[128];
struct conn_info *conn;
- char buf[AUTH_BUF_LENGTH];
GSList *l;
dump_response("cgdcont_cb", ok, result);
return;
}
- /* Set username and password */
- sprintf(buf, "AT*EIAAUW=%d,1,\"%s\",\"%s\"", gcd->active_context,
- gcd->username, gcd->password);
-
- if (g_at_chat_send(gcd->chat, buf, none_prefix,
- NULL, NULL, NULL) == 0)
- goto error;
-
ncbd = g_memdup(cbd, sizeof(struct cb_data));
l = g_slist_find_custom(g_caif_devices, GUINT_TO_POINTER(0),
if (g_at_chat_send(gcd->chat, buf, NULL,
ste_eppsd_up_cb, ncbd, g_free) > 0)
return;
+
error:
if (ncbd)
g_free(ncbd);
{
struct gprs_context_data *gcd = ofono_gprs_context_get_data(gc);
struct cb_data *cbd = cb_data_new(cb, data);
- char buf[OFONO_GPRS_MAX_APN_LENGTH + 128];
+ char buf[AUTH_BUF_LENGTH];
int len;
if (!cbd)
goto error;
gcd->active_context = ctx->cid;
- gcd->username = g_strdup(ctx->username);
- gcd->password = g_strdup(ctx->password);
cbd->user = gc;
+ /* Set username and password */
+ sprintf(buf, "AT*EIAAUW=%d,1,\"%s\",\"%s\"", ctx->cid,
+ ctx->username, ctx->password);
+
+ if (g_at_chat_send(gcd->chat, buf, none_prefix, NULL, NULL, NULL) == 0)
+ goto error;
+
len = sprintf(buf, "AT+CGDCONT=%u,\"IP\"", ctx->cid);
if (ctx->apn)