summaryrefslogtreecommitdiffstats
path: root/src/stkagent.c
diff options
context:
space:
mode:
authorGuillaume Lucas <guillaumex.lucas@intel.com>2010-11-30 13:21:50 +0000
committerDenis Kenzior <denkenz@gmail.com>2010-11-30 08:20:42 -0600
commit8b0307a6218fccb9be5a1e099699b2e96c784392 (patch)
tree7ed51435690c8842d720274be954557c397bed0a /src/stkagent.c
parent5154d5e38de1c44856da34377b63e590ad69b7d6 (diff)
downloadofono-8b0307a6218fccb9be5a1e099699b2e96c784392.tar.bz2
stk: Add busy error for the display text command
According to the sequence 1.2 of the ETSI TS 102 384 a busy screen error should be returns for the display text proactive command when the ME is not able to display the text.
Diffstat (limited to 'src/stkagent.c')
-rw-r--r--src/stkagent.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/stkagent.c b/src/stkagent.c
index 83150400..e1a6f483 100644
--- a/src/stkagent.c
+++ b/src/stkagent.c
@@ -41,6 +41,7 @@
enum allowed_error {
ALLOWED_ERROR_GO_BACK = 0x1,
ALLOWED_ERROR_TERMINATE = 0x2,
+ ALLOWED_ERROR_BUSY = 0x4,
};
struct stk_agent {
@@ -62,6 +63,7 @@ struct stk_agent {
#define ERROR_PREFIX OFONO_SERVICE ".Error"
#define GOBACK_ERROR ERROR_PREFIX ".GoBack"
#define TERMINATE_ERROR ERROR_PREFIX ".EndSession"
+#define BUSY_ERROR ERROR_PREFIX ".Busy"
static void stk_agent_send_noreply(struct stk_agent *agent, const char *method)
{
@@ -194,6 +196,12 @@ static int check_error(struct stk_agent *agent, DBusMessage *reply,
goto out;
}
+ if ((allowed_errors & ALLOWED_ERROR_BUSY) &&
+ g_str_equal(err.name, BUSY_ERROR)) {
+ *out_result = STK_AGENT_RESULT_BUSY;
+ goto out;
+ }
+
result = -EINVAL;
out:
@@ -376,8 +384,8 @@ static void display_text_cb(DBusPendingCall *call, void *data)
gboolean remove_agent;
if (check_error(agent, reply,
- ALLOWED_ERROR_GO_BACK | ALLOWED_ERROR_TERMINATE,
- &result) == -EINVAL) {
+ ALLOWED_ERROR_GO_BACK | ALLOWED_ERROR_TERMINATE |
+ ALLOWED_ERROR_BUSY, &result) == -EINVAL) {
remove_agent = TRUE;
goto error;
}