Open Source Telephony
 help / color / mirror / Atom feed
* [PATCH 0/3] Allow use of from_io constructor
@ 2010-05-10 18:39 Kristen Carlson Accardi
  2010-05-10 18:39 ` [PATCH 1/3] gsmdial: use g_at_chat_suspend Kristen Carlson Accardi
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Kristen Carlson Accardi @ 2010-05-10 18:39 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 446 bytes --]

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(-)


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/3] gsmdial: use g_at_chat_suspend
  2010-05-10 18:39 [PATCH 0/3] Allow use of from_io constructor Kristen Carlson Accardi
@ 2010-05-10 18:39 ` Kristen Carlson Accardi
  2010-05-10 18:39 ` [PATCH 2/3] gatchat: implement g_at_chat_get_io() Kristen Carlson Accardi
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Kristen Carlson Accardi @ 2010-05-10 18:39 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 1013 bytes --]

---
 gatchat/gsmdial.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/gatchat/gsmdial.c b/gatchat/gsmdial.c
index a531aa3..fd9b73b 100644
--- a/gatchat/gsmdial.c
+++ b/gatchat/gsmdial.c
@@ -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);
-- 
1.6.6.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/3] gatchat: implement g_at_chat_get_io()
  2010-05-10 18:39 [PATCH 0/3] Allow use of from_io constructor Kristen Carlson Accardi
  2010-05-10 18:39 ` [PATCH 1/3] gsmdial: use g_at_chat_suspend Kristen Carlson Accardi
@ 2010-05-10 18:39 ` Kristen Carlson Accardi
  2010-05-10 18:39 ` [PATCH 3/3] gsmdial: use g_at_ppp_new_from_io() Kristen Carlson Accardi
  2010-05-10 21:26 ` [PATCH 0/3] Allow use of from_io constructor Denis Kenzior
  3 siblings, 0 replies; 5+ messages in thread
From: Kristen Carlson Accardi @ 2010-05-10 18:39 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 1193 bytes --]

---
 gatchat/gatchat.c |    8 ++++++++
 gatchat/gatchat.h |    2 ++
 2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/gatchat/gatchat.c b/gatchat/gatchat.c
index f94605f..3f238a2 100644
--- a/gatchat/gatchat.c
+++ b/gatchat/gatchat.c
@@ -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)
diff --git a/gatchat/gatchat.h b/gatchat/gatchat.h
index ea6626e..9fd7ced 100644
--- a/gatchat/gatchat.h
+++ b/gatchat/gatchat.h
@@ -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);
-- 
1.6.6.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 3/3] gsmdial: use g_at_ppp_new_from_io()
  2010-05-10 18:39 [PATCH 0/3] Allow use of from_io constructor Kristen Carlson Accardi
  2010-05-10 18:39 ` [PATCH 1/3] gsmdial: use g_at_chat_suspend Kristen Carlson Accardi
  2010-05-10 18:39 ` [PATCH 2/3] gatchat: implement g_at_chat_get_io() Kristen Carlson Accardi
@ 2010-05-10 18:39 ` Kristen Carlson Accardi
  2010-05-10 21:26 ` [PATCH 0/3] Allow use of from_io constructor Denis Kenzior
  3 siblings, 0 replies; 5+ messages in thread
From: Kristen Carlson Accardi @ 2010-05-10 18:39 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 1093 bytes --]

---
 gatchat/gsmdial.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/gatchat/gsmdial.c b/gatchat/gsmdial.c
index fd9b73b..cfdec87 100644
--- a/gatchat/gsmdial.c
+++ b/gatchat/gsmdial.c
@@ -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);
-- 
1.6.6.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 0/3] Allow use of from_io constructor
  2010-05-10 18:39 [PATCH 0/3] Allow use of from_io constructor Kristen Carlson Accardi
                   ` (2 preceding siblings ...)
  2010-05-10 18:39 ` [PATCH 3/3] gsmdial: use g_at_ppp_new_from_io() Kristen Carlson Accardi
@ 2010-05-10 21:26 ` Denis Kenzior
  3 siblings, 0 replies; 5+ messages in thread
From: Denis Kenzior @ 2010-05-10 21:26 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 547 bytes --]

Hi Kristen,

> 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(-)
> 

All three have been applied, thanks.

Regards,
-Denis

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-05-10 21:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-10 18:39 [PATCH 0/3] Allow use of from_io constructor Kristen Carlson Accardi
2010-05-10 18:39 ` [PATCH 1/3] gsmdial: use g_at_chat_suspend Kristen Carlson Accardi
2010-05-10 18:39 ` [PATCH 2/3] gatchat: implement g_at_chat_get_io() Kristen Carlson Accardi
2010-05-10 18:39 ` [PATCH 3/3] gsmdial: use g_at_ppp_new_from_io() Kristen Carlson Accardi
2010-05-10 21:26 ` [PATCH 0/3] Allow use of from_io constructor Denis Kenzior

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox