summaryrefslogtreecommitdiffstats
path: root/input/manager.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2007-05-09 10:05:28 +0000
committerJohan Hedberg <johan.hedberg@nokia.com>2007-05-09 10:05:28 +0000
commite4d113429614e120642e00e3a0a67c0ef62778ce (patch)
tree7af1d48f8cf9bb2de0e528ebb38402fadf6b9eb6 /input/manager.c
parentbb02c974cc53e2a8ef9e01293070b339f00a33c4 (diff)
Add support for FinishRemoteServiceTransaction
Diffstat (limited to 'input/manager.c')
-rw-r--r--input/manager.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/input/manager.c b/input/manager.c
index de4ad0e3..230740e2 100644
--- a/input/manager.c
+++ b/input/manager.c
@@ -383,6 +383,41 @@ failed:
return FALSE;
}
+static void finish_sdp_transaction(bdaddr_t *dba)
+{
+ char address[18], *addr_ptr = address;
+ DBusMessage *msg, *reply;
+ DBusError derr;
+
+ ba2str(dba, address);
+
+ msg = dbus_message_new_method_call("org.bluez", "/org/bluez/hci0",
+ "org.bluez.Adapter",
+ "FinishRemoteServiceTransaction");
+ if (!msg) {
+ error("Unable to allocate new method call");
+ return;
+ }
+
+ dbus_message_append_args(msg, DBUS_TYPE_STRING, &addr_ptr,
+ DBUS_TYPE_INVALID);
+
+ dbus_error_init(&derr);
+ reply = dbus_connection_send_with_reply_and_block(connection, msg,
+ -1, &derr);
+
+ dbus_message_unref(msg);
+
+ if (dbus_error_is_set(&derr) || dbus_set_error_from_message(&derr, reply)) {
+ error("FinishRemoteServiceTransaction(%s) failed: %s",
+ address, derr.message);
+ dbus_error_free(&derr);
+ return;
+ }
+
+ dbus_message_unref(reply);
+}
+
static void hid_record_reply(DBusPendingCall *call, void *data)
{
DBusMessage *reply = dbus_pending_call_steal_reply(call);
@@ -404,6 +439,8 @@ static void hid_record_reply(DBusPendingCall *call, void *data)
goto fail;
}
+ finish_sdp_transaction(&pr->dst);
+
if (!dbus_message_get_args(reply, &derr,
DBUS_TYPE_ARRAY, DBUS_TYPE_BYTE, &rec_bin, &len,
DBUS_TYPE_INVALID)) {