---
src/stk.c | 27 +++++++++++++++++++++++++++
1 files changed, 27 insertions(+), 0 deletions(-)
diff --git a/src/stk.c b/src/stk.c
index 54994df..359f8e4 100644
--- a/src/stk.c
+++ b/src/stk.c
@@ -822,6 +822,7 @@ static gboolean handle_command_send_sms(const struct stk_command
*cmd,
return FALSE;
}
+/* Note: may be called from ofono_stk_proactive_command_handled_notify */
static gboolean handle_command_set_idle_text(const struct stk_command *cmd,
struct stk_response *rsp,
struct ofono_stk *stk)
@@ -1041,6 +1042,7 @@ static gboolean handle_command_poll_interval(const struct
stk_command *cmd,
return TRUE;
}
+/* Note: may be called from ofono_stk_proactive_command_handled_notify */
static gboolean handle_command_set_up_menu(const struct stk_command *cmd,
struct stk_response *rsp,
struct ofono_stk *stk)
@@ -2407,6 +2409,7 @@ void ofono_stk_proactive_command_handled_notify(struct ofono_stk
*stk,
const unsigned char *pdu)
{
struct stk_command *cmd;
+ struct stk_response dummyrsp;
stk_proactive_command_cancel(stk);
@@ -2431,6 +2434,30 @@ void ofono_stk_proactive_command_handled_notify(struct ofono_stk
*stk,
&cmd->send_sms.text_attr,
&cmd->send_sms.icon_id);
break;
+
+ case STK_COMMAND_TYPE_SETUP_IDLE_MODE_TEXT:
+ handle_command_set_idle_text(cmd, &dummyrsp, stk);
+ break;
+
+ case STK_COMMAND_TYPE_SETUP_MENU:
+ handle_command_set_up_menu(cmd, &dummyrsp, stk);
+ break;
+
+ case STK_COMMAND_TYPE_SETUP_CALL:
+ /* TODO */
+ break;
+
+ case STK_COMMAND_TYPE_SEND_USSD:
+ stk_alpha_id_set(stk, cmd->send_ussd.alpha_id,
+ &cmd->send_ussd.text_attr,
+ &cmd->send_ussd.icon_id);
+ break;
+
+ case STK_COMMAND_TYPE_SEND_DTMF:
+ stk_alpha_id_set(stk, cmd->send_dtmf.alpha_id,
+ &cmd->send_dtmf.text_attr,
+ &cmd->send_dtmf.icon_id);
+ break;
}
stk_command_free(cmd);
--
1.7.1.86.g0e460.dirty
Show replies by date
---
drivers/calypsomodem/stk.c | 27 ++++++++++++++++++++++++---
1 files changed, 24 insertions(+), 3 deletions(-)
diff --git a/drivers/calypsomodem/stk.c b/drivers/calypsomodem/stk.c
index 052e1f9..7168fb0 100644
--- a/drivers/calypsomodem/stk.c
+++ b/drivers/calypsomodem/stk.c
@@ -209,13 +209,34 @@ 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;
+ gboolean ret;
+
DBG("");
+ /* Proactive command has been handled by the modem. */
+
+ g_at_result_iter_init(&iter, result);
+
+ if (!g_at_result_iter_next(&iter, "%SATN:"))
+ return;
+
+ ret = g_at_result_iter_next_hexstring(&iter, &pdu, &len);
+ if (!ret || len == 0)
+ return;
+
/*
- * 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.
+ * A proactive command starts with a Proactive UICC Command BER-TLV
+ * short tag (0xd0) with optional pad bytes, a Terminal Response
+ * starts with the Command Details CTLV tag (0x81).
*/
+ if (pdu[0] != 0x81)
+ ofono_stk_proactive_command_handled_notify(stk, len, pdu);
+ else
+ ofono_stk_terminal_response_sent_notify(stk, len, pdu);
}
static void calypso_stk_register(gboolean ok, GAtResult *result,
--
1.7.1.86.g0e460.dirty
Hi Andrew,
/*
- * 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.
+ * A proactive command starts with a Proactive UICC Command BER-TLV
+ * short tag (0xd0) with optional pad bytes, a Terminal Response
+ * starts with the Command Details CTLV tag (0x81).
*/
+ if (pdu[0] != 0x81)
+ ofono_stk_proactive_command_handled_notify(stk, len, pdu);
+ else
+ ofono_stk_terminal_response_sent_notify(stk, len, pdu);
}
I removed terminal_response_sent_notify from the API and took care of
this in the core. I also went ahead and fixed up the three drivers in
question. Can you double check that I didn't screw this up?
Thanks,
-Denis
---
drivers/mbmmodem/stk.c | 28 +++++++++++++++++++++++++---
1 files changed, 25 insertions(+), 3 deletions(-)
diff --git a/drivers/mbmmodem/stk.c b/drivers/mbmmodem/stk.c
index f279057..a7633ee 100644
--- a/drivers/mbmmodem/stk.c
+++ b/drivers/mbmmodem/stk.c
@@ -179,12 +179,34 @@ 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;
+ gboolean ret;
+
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:"))
+ return;
+
+ ret = g_at_result_iter_next_hexstring(&iter, &pdu, &len);
+ if (!ret || len == 0)
+ return;
+
+ /*
+ * A proactive command starts with a Proactive UICC Command BER-TLV
+ * short tag (0xd0) with optional pad bytes, a Terminal Response
+ * starts with the Command Details CTLV tag (0x81).
*/
+ if (pdu[0] != 0x81)
+ ofono_stk_proactive_command_handled_notify(stk, len, pdu);
+ else
+ ofono_stk_terminal_response_sent_notify(stk, len, pdu);
}
static void stkend_notify(GAtResult *result, gpointer user_data)
--
1.7.1.86.g0e460.dirty
---
drivers/ifxmodem/stk.c | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/drivers/ifxmodem/stk.c b/drivers/ifxmodem/stk.c
index a7ca089..3b620a4 100644
--- a/drivers/ifxmodem/stk.c
+++ b/drivers/ifxmodem/stk.c
@@ -197,6 +197,7 @@ static void sati_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;
@@ -217,6 +218,19 @@ static void satn_notify(GAtResult *result, gpointer user_data)
* command was for Setup Call then a response with AT+SATD
* is required. This is not handled properly yet.
*/
+
+ if (len == 0)
+ return;
+
+ /*
+ * A proactive command starts with a Proactive UICC Command BER-TLV
+ * short tag (0xd0) with optional pad bytes, a Terminal Response
+ * starts with the Command Details CTLV tag (0x81).
+ */
+ if (pdu[0] != 0x81)
+ ofono_stk_proactive_command_handled_notify(stk, len, pdu);
+ else
+ ofono_stk_terminal_response_sent_notify(stk, len, pdu);
}
static void satf_notify(GAtResult *result, gpointer user_data)
--
1.7.1.86.g0e460.dirty
Hi Andrew,
+ /*
+ * A proactive command starts with a Proactive UICC Command BER-TLV
+ * short tag (0xd0) with optional pad bytes, a Terminal Response
+ * starts with the Command Details CTLV tag (0x81).
+ */
+ if (pdu[0] != 0x81)
+ ofono_stk_proactive_command_handled_notify(stk, len, pdu);
+ else
+ ofono_stk_terminal_response_sent_notify(stk, len, pdu);
why are we duplicating this in every driver? Can we just not give the
whole PDU back to core and let the core separate it?
Regards
Marcel
Hi Andrew,
On 10/26/2010 03:52 AM, Andrzej Zaborowski wrote:
---
src/stk.c | 27 +++++++++++++++++++++++++++
1 files changed, 27 insertions(+), 0 deletions(-)
Patch has been applied, thanks.
Regards,
-Denis