Open Source Telephony
 help / color / mirror / Atom feed
* [PATCH 1/2] hfp: add watch to trigger HUP of the file descriptor
@ 2010-02-15 20:40 Gustavo F. Padovan
  2010-02-15 20:40 ` [PATCH 2/2] hfp: remove modems if bluetoothd shutdowns without calling Release Gustavo F. Padovan
  0 siblings, 1 reply; 3+ messages in thread
From: Gustavo F. Padovan @ 2010-02-15 20:40 UTC (permalink / raw)
  To: ofono

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

---
 plugins/hfp.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/plugins/hfp.c b/plugins/hfp.c
index 411cfc1..616b119 100644
--- a/plugins/hfp.c
+++ b/plugins/hfp.c
@@ -482,6 +482,17 @@ error:
 	service_level_conn_failed(modem);
 }
 
+static void hfp_disconnected_cb(gpointer user_data)
+{
+	struct ofono_modem *modem = user_data;
+	struct hfp_data *data = ofono_modem_get_data(modem);
+
+	ofono_modem_set_powered(modem, FALSE);
+
+	g_at_chat_unref(data->chat);
+	data->chat = NULL;
+}
+
 /* either oFono or Phone could request SLC connection */
 static int service_level_connection(struct ofono_modem *modem, int fd)
 {
@@ -506,6 +517,8 @@ static int service_level_connection(struct ofono_modem *modem, int fd)
 	if (!chat)
 		return -ENOMEM;
 
+	g_at_chat_set_disconnect_function(chat, hfp_disconnected_cb, modem);
+
 	if (getenv("OFONO_AT_DEBUG"))
 		g_at_chat_set_debug(chat, hfp_debug, NULL);
 
-- 
1.6.4.4


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

end of thread, other threads:[~2010-02-15 21:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-15 20:40 [PATCH 1/2] hfp: add watch to trigger HUP of the file descriptor Gustavo F. Padovan
2010-02-15 20:40 ` [PATCH 2/2] hfp: remove modems if bluetoothd shutdowns without calling Release Gustavo F. Padovan
2010-02-15 21:04   ` Denis Kenzior

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