diff options
author | Denis Kenzior <denkenz@gmail.com> | 2010-10-27 12:13:34 -0500 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2010-10-27 12:25:48 -0500 |
commit | 412ce05fdef660183a3ed59a697a00da0e420604 (patch) | |
tree | bdd384b066210106c94dd3a331956aae246e43ff /drivers | |
parent | 51aecde6cc886797b05ecc516047300fb0dab84c (diff) |
calypsomodem: Notify core about handled commands
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/calypsomodem/stk.c | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/drivers/calypsomodem/stk.c b/drivers/calypsomodem/stk.c index 052e1f98..334abc6a 100644 --- a/drivers/calypsomodem/stk.c +++ b/drivers/calypsomodem/stk.c @@ -209,13 +209,26 @@ static void sata_notify(GAtResult *result, gpointer user_data) static void satn_notify(GAtResult *result, gpointer user_data) { + struct ofono_stk *stk = user_data; + GAtResultIter iter; + const guint8 *pdu; + gint len; + DBG(""); - /* - * Proactive command has been handled by the modem. Should - * the core be notified? For now we just ignore it because - * we must not respond to the command. - */ + /* Proactive command has been handled by the modem. */ + g_at_result_iter_init(&iter, result); + + if (g_at_result_iter_next(&iter, "%SATN:") == FALSE) + return; + + if (g_at_result_iter_next_hexstring(&iter, &pdu, &len) == FALSE) + return; + + if (len == 0) + return; + + ofono_stk_proactive_command_handled_notify(stk, len, pdu); } static void calypso_stk_register(gboolean ok, GAtResult *result, |