From: Dmitriy Paliy <dmitriy.paliy@nokia.com>
To: linux-bluetooth@vger.kernel.org
Cc: Dmitriy Paliy <dmitriy.paliy@nokia.com>
Subject: [PATCH 2/2] Add ERROR response on AT+BLDN command for maemo6
Date: Wed, 23 Mar 2011 15:58:32 +0200 [thread overview]
Message-ID: <1300888712-19442-2-git-send-email-dmitriy.paliy@nokia.com> (raw)
In-Reply-To: <1300888712-19442-1-git-send-email-dmitriy.paliy@nokia.com>
Response on AT+BLDN command in maemo6 telephony driver is added to be
sent after confirmation from csd back-end. Both ERROR or OK codes are
sent only after asynchronous response on D-Bus call is available.
---
audio/telephony-maemo6.c | 26 +++++++++++++++++++++++---
1 files changed, 23 insertions(+), 3 deletions(-)
diff --git a/audio/telephony-maemo6.c b/audio/telephony-maemo6.c
index 18e7e90..e727955 100644
--- a/audio/telephony-maemo6.c
+++ b/audio/telephony-maemo6.c
@@ -622,6 +622,28 @@ static void remove_pending(DBusPendingCall *call)
pending_req_finalize(req);
}
+static void last_number_call_reply(DBusPendingCall *call, void *user_data)
+{
+ DBusError err;
+ DBusMessage *reply;
+ void *telephony_device = user_data;
+
+ reply = dbus_pending_call_steal_reply(call);
+
+ dbus_error_init(&err);
+ if (dbus_set_error_from_message(&err, reply)) {
+ error("csd replied with an error: %s, %s",
+ err.name, err.message);
+ dbus_error_free(&err);
+ telephony_dial_number_rsp(telephony_device,
+ CME_ERROR_AG_FAILURE);
+ } else
+ telephony_dial_number_rsp(telephony_device, CME_ERROR_NONE);
+
+ dbus_message_unref(reply);
+ remove_pending(call);
+}
+
void telephony_last_dialed_number_req(void *telephony_device)
{
int ret;
@@ -630,13 +652,11 @@ void telephony_last_dialed_number_req(void *telephony_device)
ret = send_method_call(CSD_CALL_BUS_NAME, CSD_CALL_PATH,
CSD_CALL_INTERFACE, "CreateFromLast",
- NULL, NULL,
+ last_number_call_reply, telephony_device,
DBUS_TYPE_INVALID);
if (ret < 0)
telephony_dial_number_rsp(telephony_device,
CME_ERROR_AG_FAILURE);
- else
- telephony_dial_number_rsp(telephony_device, CME_ERROR_NONE);
}
static const char *memory_dial_lookup(int location)
--
1.7.1
next prev parent reply other threads:[~2011-03-23 13:58 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-23 13:58 [PATCH 1/2] Add handling of pending D-Bus calls in maemo6 Dmitriy Paliy
2011-03-23 13:58 ` Dmitriy Paliy [this message]
-- strict thread matches above, loose matches on Subject: below --
2011-03-25 16:44 [PATCH 0/2 v2] " Dmitriy Paliy
2011-03-25 16:44 ` [PATCH 2/2] Add ERROR response on AT+BLDN command for maemo6 Dmitriy Paliy
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=1300888712-19442-2-git-send-email-dmitriy.paliy@nokia.com \
--to=dmitriy.paliy@nokia.com \
--cc=linux-bluetooth@vger.kernel.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