atmodem: Allow setting PPP debug via environment variable

This commit is contained in:
Marcel Holtmann 2010-09-20 08:28:13 +09:00
parent 5d569e2ee6
commit 9f906504a5
1 changed files with 8 additions and 0 deletions

View File

@ -65,6 +65,11 @@ struct gprs_context_data {
void *cb_data; /* Callback data */
};
static void ppp_debug(const char *str, void *data)
{
ofono_info("%s: %s", (const char *) data, str);
}
static void ppp_connect(const char *interface, const char *local,
const char *remote,
const char *dns1, const char *dns2,
@ -134,6 +139,9 @@ static gboolean setup_ppp(struct ofono_gprs_context *gc)
return FALSE;
}
if (getenv("OFONO_PPP_DEBUG"))
g_at_ppp_set_debug(gcd->ppp, ppp_debug, "PPP");
g_at_ppp_set_credentials(gcd->ppp, gcd->username, gcd->password);
/* set connect and disconnect callbacks */