cdma-connman: Update to the new driver API

This commit is contained in:
Guillaume Zajac 2011-07-21 06:40:43 +02:00 committed by Denis Kenzior
parent 43962ae05b
commit f1ac79ce44
1 changed files with 9 additions and 0 deletions

View File

@ -56,6 +56,8 @@ struct connman_data {
GAtChat *chat;
GAtPPP *ppp;
enum state state;
char username[OFONO_CDMA_CONNMAN_MAX_USERNAME_LENGTH + 1];
char password[OFONO_CDMA_CONNMAN_MAX_PASSWORD_LENGTH + 1];
union {
ofono_cdma_connman_cb_t down_cb; /* Down callback */
ofono_cdma_connman_up_cb_t up_cb; /* Up callback */
@ -145,6 +147,8 @@ static gboolean setup_ppp(struct ofono_cdma_connman *cm)
g_at_ppp_set_connect_function(cd->ppp, ppp_connect, cm);
g_at_ppp_set_disconnect_function(cd->ppp, ppp_disconnect, cm);
g_at_ppp_set_credentials(cd->ppp, cd->username, cd->password);
/* open the ppp connection */
g_at_ppp_open(cd->ppp, io);
@ -175,6 +179,8 @@ static void atd_cb(gboolean ok, GAtResult *result, gpointer user_data)
}
static void cdma_connman_activate(struct ofono_cdma_connman *cm,
const char *username,
const char *password,
ofono_cdma_connman_up_cb_t cb,
void *data)
{
@ -185,6 +191,9 @@ static void cdma_connman_activate(struct ofono_cdma_connman *cm,
cd->up_cb = cb;
cd->cb_data = data;
strcpy(cd->username, username);
strcpy(cd->password, password);
cd->state = STATE_ENABLING;
sprintf(buf, "ATD#777");