diff options
author | Gustavo F. Padovan <padovan@profusion.mobi> | 2011-09-26 14:26:58 -0300 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2011-09-26 13:38:19 -0500 |
commit | 9667db0b142908bf95d570edf6fd482256d881ae (patch) | |
tree | 3023a73453258a91492863d4623582c585dfba0a /plugins/telit.c | |
parent | c30e7265d9a5771ed969328c42dc09975410a4c1 (diff) | |
download | ofono-9667db0b142908bf95d570edf6fd482256d881ae.tar.bz2 |
telit: add #RSEN notify
RSEN URC tells if the SAP Client was enabled or not
Diffstat (limited to 'plugins/telit.c')
-rw-r--r-- | plugins/telit.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/plugins/telit.c b/plugins/telit.c index cc10668a..1f950aa3 100644 --- a/plugins/telit.c +++ b/plugins/telit.c @@ -105,6 +105,22 @@ static GAtChat *open_device(struct ofono_modem *modem, return chat; } +static void telit_rsen_notify(GAtResult *result, gpointer user_data) +{ + struct ofono_modem *modem = user_data; + int status; + GAtResultIter iter; + + DBG("%p", modem); + + g_at_result_iter_init(&iter, result); + + if (!g_at_result_iter_next(&iter, "#RSEN:")) + return; + + g_at_result_iter_next_number(&iter, &status); +} + static void rsen_enable_cb(gboolean ok, GAtResult *result, gpointer user_data) { struct ofono_modem *modem = user_data; @@ -131,6 +147,9 @@ static int telit_sap_enable(struct ofono_modem *modem) if (data->chat == NULL) return -EINVAL; + g_at_chat_register(data->chat, "#RSEN:", telit_rsen_notify, + FALSE, modem, NULL); + g_at_chat_send(data->chat, "AT#NOPT=3", NULL, NULL, NULL, NULL); /* Set SAP functionality */ |