summaryrefslogtreecommitdiffstats
path: root/src/ussd.c
diff options
context:
space:
mode:
authorPekka Pessi <Pekka.Pessi@nokia.com>2010-09-16 20:32:46 +0300
committerDenis Kenzior <denkenz@gmail.com>2010-09-16 13:46:25 -0500
commit217c161cf5cdcbcdbd92542bbbe2a705ba35bf23 (patch)
tree58a3ccecc86c078f375f1acdb035480449e1e489 /src/ussd.c
parent4b8f2b037cdd2926a18b2c8dc98e738e7c907082 (diff)
downloadofono-217c161cf5cdcbcdbd92542bbbe2a705ba35bf23.tar.bz2
ussd: debug log notifys
Diffstat (limited to 'src/ussd.c')
-rw-r--r--src/ussd.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/ussd.c b/src/ussd.c
index 57390f1f..bbb9aed1 100644
--- a/src/ussd.c
+++ b/src/ussd.c
@@ -350,6 +350,43 @@ static int ussd_status_to_failure_code(int status)
return 0;
}
+static char const *ussd_status_name(int status)
+{
+ switch (status) {
+ case OFONO_USSD_STATUS_NOTIFY:
+ return "NOTIFY";
+ case OFONO_USSD_STATUS_ACTION_REQUIRED:
+ return "ACTION_REQUIRED";
+ case OFONO_USSD_STATUS_TERMINATED:
+ return "TERMINATED";
+ case OFONO_USSD_STATUS_LOCAL_CLIENT_RESPONDED:
+ return "LOCAL_CLIENT_RESPONDED";
+ case OFONO_USSD_STATUS_NOT_SUPPORTED:
+ return "NOT_SUPPORTED";
+ case OFONO_USSD_STATUS_TIMED_OUT:
+ return "TIMED_OUT";
+ }
+
+ return "????";
+}
+
+static const char *ussd_state_name(enum ussd_state state)
+{
+ switch (state) {
+ case USSD_STATE_IDLE:
+ return "IDLE";
+ case USSD_STATE_ACTIVE:
+ return "ACTIVE";
+ case USSD_STATE_RESPONSE_SENT:
+ return "RESPONSE_SENT";
+ case USSD_STATE_USER_ACTION:
+ return "USER_ACTION";
+ }
+
+ return "????";
+}
+
+
void ofono_ussd_notify(struct ofono_ussd *ussd, int status, int dcs,
const unsigned char *data, int data_len)
{
@@ -362,6 +399,10 @@ void ofono_ussd_notify(struct ofono_ussd *ussd, int status, int dcs,
DBusMessageIter iter;
DBusMessageIter variant;
+ DBG("status: %d %s, state: %d %s",
+ status, ussd_status_name(status),
+ ussd->state, ussd_state_name(ussd->state));
+
if (ussd->req &&
(status == OFONO_USSD_STATUS_NOTIFY ||
status == OFONO_USSD_STATUS_TERMINATED ||