From 8eb658f5ea28cccf302e5bbcad0c384ba563ee6d Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Wed, 27 Oct 2010 12:20:37 -0500 Subject: mbmmodem: Notify core about handled commands --- drivers/mbmmodem/stk.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'drivers') diff --git a/drivers/mbmmodem/stk.c b/drivers/mbmmodem/stk.c index f2790571..87a2dd0e 100644 --- a/drivers/mbmmodem/stk.c +++ b/drivers/mbmmodem/stk.c @@ -179,12 +179,26 @@ static void stki_notify(GAtResult *result, gpointer user_data) static void stkn_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, "*STKN:") == 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 stkend_notify(GAtResult *result, gpointer user_data) -- cgit v1.2.3