Exemplo n.º 1
0
GAtPPP *g_at_ppp_new_from_io(GAtIO *io)
{
	GAtHDLC *hdlc;
	GAtPPP *ppp;

	hdlc = g_at_hdlc_new_from_io(io);
	if (hdlc == NULL)
		return NULL;

	ppp = ppp_init_common(hdlc, FALSE, 0);
	g_at_hdlc_unref(hdlc);

	return ppp;
}
Exemplo n.º 2
0
GAtHDLC *g_at_hdlc_new(GIOChannel *channel)
{
	GAtIO *io;
	GAtHDLC *hdlc;

	io = g_at_io_new(channel);
	if (io == NULL)
		return NULL;

	hdlc = g_at_hdlc_new_from_io(io);
	g_at_io_unref(io);

	return hdlc;
}
Exemplo n.º 3
0
GAtPPP *g_at_ppp_server_new_from_io(GAtIO *io, const char *local)
{
	GAtHDLC *hdlc;
	GAtPPP *ppp;
	guint32 ip;

	if (local == NULL)
		ip = 0;
	else if (inet_pton(AF_INET, local, &ip) != 1)
		return NULL;

	hdlc = g_at_hdlc_new_from_io(io);
	if (hdlc == NULL)
		return NULL;

	ppp = ppp_init_common(hdlc, TRUE, ip);
	g_at_hdlc_unref(hdlc);

	return ppp;
}