Hi,
On 6 September 2010 11:21, Jeevaka Badrappan
<jeevaka.badrappan(a)elektrobit.com> wrote:
---
src/stk.c | 137 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-
src/stkutil.c | 22 +++++++++
src/stkutil.h | 13 +++++
3 files changed, 169 insertions(+), 3 deletions(-)
diff --git a/src/stk.c b/src/stk.c
index 3fda2af..5d84141 100644
--- a/src/stk.c
+++ b/src/stk.c
@@ -56,10 +56,8 @@ struct ofono_stk {
void (*cancel_cmd)(struct ofono_stk *stk);
GQueue *envelope_q;
DBusMessage *pending;
-
struct stk_timer timers[8];
guint timers_source;
-
int timeout;
int short_timeout;
struct stk_agent *session_agent;
@@ -1590,6 +1588,136 @@ static gboolean handle_command_set_up_call(const struct
stk_command *cmd,
return FALSE;
}
+static void send_ussd_callback( int error, int dcs, const unsigned char *msg,
+ int msg_len, void *userdata)
+{
+ struct ofono_stk *stk = userdata;
+ struct ofono_error failure = { .type = OFONO_ERROR_TYPE_FAILURE };
+ struct stk_response rsp;
+ enum sms_charset charset;
+
+ if (stk->pending_cmd->send_ussd.alpha_id &&
+ stk->pending_cmd->send_ussd.alpha_id[0])
+ stk_alpha_id_unset(stk);
+
+ switch (error) {
+ case OFONO_USSD_FAILURE_NONE:
+ memset(&rsp, 0, sizeof(rsp));
+
+ rsp.result.type = STK_RESULT_TYPE_SUCCESS;
+
+ if (!cbs_dcs_decode(dcs, NULL, NULL, &charset,
+ NULL, NULL, NULL))
+ rsp.send_ussd.text.dcs = -1;
+ else
+ rsp.send_ussd.text.dcs = charset;
What is the meaning of that -1? I don't see this value handled in stkutil.
The rest of this patch looks okay to me, but you have some formatting
issues: space after '(' above, and the first hunk removes empty lines.
Other than that I think Denis might want you to split this patch into
stk patch and stkutil patch.
With regards to 1/2 he'll probably want one patch for atmodem, one for
isimodem, one for include, one for plugin, etc. Also I think it's
fair to assume that the charset is IRA and there's not need to account
for other possibilities, but other might have different opinions. And
I'm not sure if the enum sms_charset values change should be global,
or translation should be done here in stk.c.
Best regards