public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [Bluez-devel] D-BUS fixes for hcid
@ 2004-06-16 11:27 Johan Hedberg
  2004-06-16 11:37 ` Marcel Holtmann
  0 siblings, 1 reply; 16+ messages in thread
From: Johan Hedberg @ 2004-06-16 11:27 UTC (permalink / raw)
  To: bluez-devel

[-- Attachment #1: Type: text/plain, Size: 625 bytes --]

Hi,

There are some problems with the current D-BUS pin-request handling in
hcid. The attached patch tries to address those.

Also, the bluez-pin package will need to provide a D-BUS service file
(bluez.service) so that the D-BUS daemon can activate it when needed.
This file goes usually in /usr/lib/dbus-1.0/services and it's contents
should be something like the following:

[D-BUS Service]
Name=org.bluez.PinAgent
Exec=/usr/bin/bluez-pin

You'll also need the following line in /etc/dbus-1/system.conf (at least
the debian package of D-BUS doesn't have it):
<servicedir>/usr/lib/dbus-1.0/services</servicedir>

br,
Johan

[-- Attachment #2: hcid-dbus.diff --]
[-- Type: text/plain, Size: 687 bytes --]

--- dbus.c.orig	2004-06-16 13:57:51.000000000 +0300
+++ dbus.c	2004-06-16 14:05:51.000000000 +0300
@@ -75,7 +75,8 @@
 
 	message = dbus_pending_call_get_reply(call);
 
-	if (dbus_message_is_error(message, WRONG_ARGS_ERROR))
+	if (message == NULL ||
+	    dbus_message_get_type(message) == DBUS_MESSAGE_TYPE_ERROR)
 		goto error;
 
 	dbus_message_iter_init(message, &iter);
@@ -131,6 +132,8 @@
 	dbus_message_iter_append_byte_array(&iter,
 			(unsigned char *) &ci->bdaddr, sizeof(ci->bdaddr));
 
+	dbus_message_set_auto_activation(message, TRUE);
+
 	if (dbus_connection_send_with_reply(connection, message,
 						&pending, TIMEOUT) == FALSE) {
 		syslog(LOG_ERR, "D-BUS send failed");

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2004-06-18  7:30 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-06-16 11:27 [Bluez-devel] D-BUS fixes for hcid Johan Hedberg
2004-06-16 11:37 ` Marcel Holtmann
2004-06-16 11:57   ` Johan Hedberg
2004-06-16 12:05     ` Johan Hedberg
2004-06-16 12:18     ` Marcel Holtmann
2004-06-16 12:45       ` Johan Hedberg
2004-06-16 13:06         ` Marcel Holtmann
2004-06-16 13:46           ` Johan Hedberg
2004-06-16 13:53             ` Marcel Holtmann
2004-06-16 13:58           ` Achim Bohnet
2004-06-16 14:18             ` Johan Hedberg
2004-06-16 23:06               ` Marcel Holtmann
2004-06-17  9:48                 ` Johan Hedberg
2004-06-17 12:05                   ` Marcel Holtmann
2004-06-17  7:27               ` Sjoerd Simons
2004-06-18  7:30                 ` Achim Bohnet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox