Allow use of from_io constructor
cover Allow use of from_io constructor
Create a way to get the GAtIO object from GAtChat. Use it to call g_at_ppp_new_from_io so that g_at_chat_suspend will work properly.
Kristen Carlson Accardi (3):
gsmdial: use g_at_chat_suspend
gatchat: implement g_at_chat_get_io()
gsmdial: use g_at_ppp_new_from_io()
gatchat/gatchat.c | 8 ++++++++ gatchat/gatchat.h | 2 ++ gatchat/gsmdial.c | 14 +++++++------- 3 files changed, 17 insertions(+), 7 deletions(-)
PATCH 1/3 gsmdial: use g_at_chat_suspend
--- gatchat/gsmdial.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-)
gatchat/gsmdial.c +4 -4
@@ -235,6 +235,8 @@ static void ppp_connect(const char *iface, const char *ip,static void ppp_disconnect (GAtPPPDisconnectReason reason,gpointer user_data) {g_print ("PPP Link down: %d\n" , reason); +g_at_chat_resume (control); +g_at_chat_resume (modem); }static void connect_cb (gboolean ok,GAtResult *result,gpointer user_data)
@@ -253,10 +255,8 @@ static void connect_cb(gboolean ok, GAtResult *result, gpointer user_data)* shutdown gatchat or else it tries to take all the input * from the modem and does not let PPP get it. */ -g_at_chat_unref (control); - control =NULL ; -g_at_chat_unref (modem); - modem =NULL ; +g_at_chat_suspend (control); +g_at_chat_suspend (modem);/* open ppp */ ppp =g_at_ppp_new (channel);
Signature · 1 line
1.6.6.1
PATCH 2/3 gatchat: implement g_at_chat_get_io()
In reply to Kristen Carlson Accardi--- gatchat/gatchat.c | 8 ++++++++ gatchat/gatchat.h | 2 ++ 2 files changed, 10 insertions(+), 0 deletions(-)
gatchat/gatchat.c +8 -0
@@ -876,6 +876,14 @@ GIOChannel *g_at_chat_get_channel(GAtChat *chat)return g_at_io_get_channel (chat->io); } +GAtIO *g_at_chat_get_io (GAtChat *chat) +{ +if (chat ==NULL ) +return NULL ; + +return chat->io; +} +GAtChat *g_at_chat_ref (GAtChat *chat) {if (chat ==NULL )
gatchat/gatchat.h +2 -0
@@ -29,6 +29,7 @@ extern "C" {#include "gatresult.h" #include "gatsyntax.h" #include "gatutil.h" +#include "gatio.h" struct _GAtChat ;
@@ -42,6 +43,7 @@ GAtChat *g_at_chat_new(GIOChannel *channel, GAtSyntax *syntax);GAtChat *g_at_chat_new_blocking (GIOChannel *channel,GAtSyntax *syntax);GIOChannel *g_at_chat_get_channel (GAtChat *chat); +GAtIO *g_at_chat_get_io (GAtChat *chat);GAtChat *g_at_chat_ref (GAtChat *chat);void g_at_chat_unref (GAtChat *chat);
Signature · 1 line
1.6.6.1
PATCH 3/3 gsmdial: use g_at_ppp_new_from_io()
In reply to Kristen Carlson Accardi--- gatchat/gsmdial.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
gatchat/gsmdial.c +3 -3
@@ -241,7 +241,7 @@ static void ppp_disconnect(GAtPPPDisconnectReason reason, gpointer user_data)static void connect_cb (gboolean ok,GAtResult *result,gpointer user_data) { -GIOChannel *channel; +GAtIO *io;if (!ok) {g_print ("Unable to define context\n" );
@@ -249,7 +249,7 @@ static void connect_cb(gboolean ok, GAtResult *result, gpointer user_data) }/* get the data IO channel */ - channel =g_at_chat_get_channel (modem); + io =g_at_chat_get_io (modem);/* * shutdown gatchat or else it tries to take all the input
@@ -259,7 +259,7 @@ static void connect_cb(gboolean ok, GAtResult *result, gpointer user_data)g_at_chat_suspend (modem);/* open ppp */ - ppp =g_at_ppp_new (channel); + ppp =g_at_ppp_new_from_io (io);if (!ppp) {g_print ("Unable to create PPP object\n" );exit (1 );
Signature · 1 line
1.6.6.1
Hi Kristen,
Quoted 8 lines
Create a way to get the GAtIO object from GAtChat. Use it to call
g_at_ppp_new_from_ioso thatg_at_chat_suspendwill work properly.Kristen Carlson Accardi (3):
gsmdial: useg_at_chat_suspend
gatchat: implementg_at_chat_get_io()
gsmdial: useg_at_ppp_new_from_io()
Quoted 5 lines
gatchat/gatchat.c | 8 ++++++++ gatchat/gatchat.h | 2 ++ gatchat/gsmdial.c | 14 +++++++------- 3 files changed, 17 insertions(+), 7 deletions(-)
All three have been applied, thanks.
Regards,
-Denis