From: Philippe Nunes <philippe.nunes@linux.intel.com>
To: ofono@ofono.org
Subject: [PATCH v2 2/4] stkagent: Add new API to get digit response on single key press
Date: Tue, 28 Aug 2012 15:21:20 +0200 [thread overview]
Message-ID: <1346160082-11077-3-git-send-email-philippe.nunes@linux.intel.com> (raw)
In-Reply-To: <1346160082-11077-1-git-send-email-philippe.nunes@linux.intel.com>
[-- Attachment #1: Type: text/plain, Size: 2081 bytes --]
---
src/stkagent.c | 32 ++++++++++++++++++++++++++++++++
src/stkagent.h | 5 +++++
2 files changed, 37 insertions(+)
diff --git a/src/stkagent.c b/src/stkagent.c
index 7c3f697..63b82f3 100644
--- a/src/stkagent.c
+++ b/src/stkagent.c
@@ -584,6 +584,38 @@ int stk_agent_request_digit(struct stk_agent *agent, const char *text,
return 0;
}
+int stk_agent_request_quick_digit(struct stk_agent *agent, const char *text,
+ const struct stk_icon_id *icon,
+ stk_agent_string_cb cb, void *user_data,
+ ofono_destroy_func destroy, int timeout)
+{
+ DBusConnection *conn = ofono_dbus_get_connection();
+
+ agent->msg = dbus_message_new_method_call(agent->bus, agent->path,
+ OFONO_SIM_APP_INTERFACE,
+ "RequestQuickDigit");
+ if (agent->msg == NULL)
+ return -ENOMEM;
+
+ dbus_message_append_args(agent->msg,
+ DBUS_TYPE_STRING, &text,
+ DBUS_TYPE_BYTE, &icon->id,
+ DBUS_TYPE_INVALID);
+
+ if (dbus_connection_send_with_reply(conn, agent->msg, &agent->call,
+ timeout) == FALSE ||
+ agent->call == NULL)
+ return -EIO;
+
+ agent->user_cb = cb;
+ agent->user_data = user_data;
+ agent->user_destroy = destroy;
+
+ dbus_pending_call_set_notify(agent->call, get_digit_cb, agent, NULL);
+
+ return 0;
+}
+
static void get_key_cb(DBusPendingCall *call, void *data)
{
struct stk_agent *agent = data;
diff --git a/src/stkagent.h b/src/stkagent.h
index 6e267fc..f66f038 100644
--- a/src/stkagent.h
+++ b/src/stkagent.h
@@ -102,6 +102,11 @@ int stk_agent_request_digit(struct stk_agent *agent, const char *text,
stk_agent_string_cb cb, void *user_data,
ofono_destroy_func destroy, int timeout);
+int stk_agent_request_quick_digit(struct stk_agent *agent, const char *text,
+ const struct stk_icon_id *icon,
+ stk_agent_string_cb cb, void *user_data,
+ ofono_destroy_func destroy, int timeout);
+
int stk_agent_request_key(struct stk_agent *agent, const char *text,
const struct stk_icon_id *icon,
ofono_bool_t unicode_charset,
--
1.7.9.5
next prev parent reply other threads:[~2012-08-28 13:21 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-28 13:21 [PATCH v2 0/4] Immediate digit response Philippe Nunes
2012-08-28 13:21 ` [PATCH v2 1/4] doc: Add new STK Agent API to get digit response on single key press Philippe Nunes
2012-08-30 21:58 ` Denis Kenzior
2012-08-28 13:21 ` Philippe Nunes [this message]
2012-08-30 22:00 ` [PATCH v2 2/4] stkagent: Add new " Denis Kenzior
2012-08-28 13:21 ` [PATCH v2 3/4] stk: Ask for immediate digit response if specified by command qualifier Philippe Nunes
2012-08-30 22:02 ` Denis Kenzior
2012-08-28 13:21 ` [PATCH v2 4/4] test: Update with RequestQuickDigit API Philippe Nunes
2012-08-30 22:05 ` Denis Kenzior
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1346160082-11077-3-git-send-email-philippe.nunes@linux.intel.com \
--to=philippe.nunes@linux.intel.com \
--cc=ofono@ofono.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox