diff options
author | Gustavo F. Padovan <padovan@profusion.mobi> | 2010-02-15 18:40:25 -0200 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2010-02-15 16:46:17 -0600 |
commit | 400d692e6ef459fa3a98f8c2dd1f4302f39cb020 (patch) | |
tree | ad93c05f231364117c489fc89b17261349477708 | |
parent | f738a84588d3454aa036890040a543ede91ed556 (diff) | |
download | ofono-400d692e6ef459fa3a98f8c2dd1f4302f39cb020.tar.bz2 |
hfp: add watch to trigger HUP of the file descriptor
-rw-r--r-- | plugins/hfp.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/plugins/hfp.c b/plugins/hfp.c index 7b86bc8a..e37c9fc1 100644 --- a/plugins/hfp.c +++ b/plugins/hfp.c @@ -482,6 +482,14 @@ error: service_level_conn_failed(modem); } +static void hfp_disconnected_cb(gpointer user_data) +{ + struct ofono_modem *modem = user_data; + + ofono_modem_set_powered(modem, FALSE); + clear_data(modem); +} + /* either oFono or Phone could request SLC connection */ static int service_level_connection(struct ofono_modem *modem, int fd) { @@ -506,6 +514,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); |