diff options
author | Denis Kenzior <denkenz@gmail.com> | 2010-07-07 14:33:32 -0500 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2010-07-08 14:27:34 -0500 |
commit | a6edf2c803fbd32f34d0c443345b3c84fc73a070 (patch) | |
tree | bd7fe4f38bdc4b598d68281cebd7d47543648fe5 /src | |
parent | d2dc0480db25d6aff634ea5cc0081997467ecfe7 (diff) | |
download | ofono-a6edf2c803fbd32f34d0c443345b3c84fc73a070.tar.bz2 |
stk: Get rid of bin to hex converter
That much code for a debug message is pretty silly. Perhaps an
ofono_debug_hexdump function is in order.
Diffstat (limited to 'src')
-rw-r--r-- | src/stk.c | 19 |
1 files changed, 3 insertions, 16 deletions
@@ -556,8 +556,7 @@ void ofono_stk_proactive_command_notify(struct ofono_stk *stk, { struct ofono_error error = { .type = OFONO_ERROR_TYPE_FAILURE }; struct stk_response rsp; - char *buf; - int i, err; + int err; gboolean respond = TRUE; /* @@ -570,26 +569,17 @@ void ofono_stk_proactive_command_notify(struct ofono_stk *stk, */ stk_proactive_command_cancel(stk); - buf = g_try_malloc(length * 2 + 1); - if (!buf) - return; - - for (i = 0; i < length; i ++) - sprintf(buf + i * 2, "%02hhx", pdu[i]); - stk->pending_cmd = stk_command_new_from_pdu(pdu, length); if (!stk->pending_cmd) { - ofono_error("Can't parse proactive command: %s", buf); + ofono_error("Can't parse proactive command"); /* * Nothing we can do, we'd need at least Command Details * to be able to respond with an error. */ - goto done; + return; } - ofono_debug("Proactive command PDU: %s", buf); - memset(&rsp, 0, sizeof(rsp)); switch (stk->pending_cmd->status) { @@ -638,9 +628,6 @@ void ofono_stk_proactive_command_notify(struct ofono_stk *stk, err = stk_respond(stk, &rsp, stk_command_cb); if (err) stk_command_cb(&error, stk); - -done: - g_free(buf); } int ofono_stk_driver_register(const struct ofono_stk_driver *d) |