[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: HAL transition [Re: gnome 2.12 unstable status]



Hi, I checked, test and fixed some stupid thing on my first patch, I
think now it is ok. Since check the own work is not a nonsense anymore
in my Country, I attach it ;)

The patch is against bluez-pin 0.25.


Il giorno mer, 14/12/2005 alle 14.17 +0100, Loïc Minier ha scritto:
> On Wed, Dec 14, 2005, Daniele Cruciani wrote:
> > I patched bluez-utils and bluez-pin for compiling/working with hal in
> > experimental, but I thing there are newer release upstream that do work
> > with newer hal.
> 
>  It's nice to hear you prepared a bluez-pin patch too: I also tried
>  building both bluez-utils and bluez-pin for experimental's HAL/DBUS,
>  but could only get the bluez-utils part working.
> 
>  Maybe you can replace the patch in #338794 with your work?
> 
> > Does anyone planed to upload newer release of bluez in experimental? (I
> > think it is a must in the road even before kde transition)
> 
>  You should talk with the bluez maintainer directly, he seems to be the
>  upstream of the project too, and is probably in the best place to
>  answer that.
> 
-- 
Daniele Cruciani
http://www.smartango.com/
pub   1024D/79F0444B 2005-04-21 [expires: 2007-04-21]
Key fingerprint = CC22 ECBD 6F3C 0980 8E76  D61C 148E 3B00 79F0 444B
uid   Daniele Cruciani <daniele@smartango.com>
http://www.smartango.com/files/daniele.asc
diff -ur BLUE2/bluez-pin-0.25/debian/changelog bluez-pin-0.25/debian/changelog
--- BLUE2/bluez-pin-0.25/debian/changelog	2005-12-18 17:02:50.000000000 +0100
+++ bluez-pin-0.25/debian/changelog	2005-12-21 14:07:14.000000000 +0100
@@ -1,3 +1,9 @@
+bluez-pin (0.25-2) unstable; urgency=low
+
+  * patched and rebuild against dbus 0.50 (build with 0.60 as well)
+
+ -- Daniele Cruciani <daniele@smartango.com>  Wed, 21 Dec 2005 14:06:49 +0100
+
 bluez-pin (0.25-1) unstable; urgency=low
 
   * New upstream version 
diff -ur BLUE2/bluez-pin-0.25/debian/control bluez-pin-0.25/debian/control
--- BLUE2/bluez-pin-0.25/debian/control	2005-12-18 17:02:50.000000000 +0100
+++ bluez-pin-0.25/debian/control	2005-12-21 14:06:01.000000000 +0100
@@ -2,7 +2,7 @@
 Section: net
 Priority: optional
 Maintainer: Phil Blundell <pb@nexus.co.uk>
-Build-Depends: debhelper (>> 3.0.0), dbus-glib-1-dev (>= 0.22), libgtk2.0-dev, libbluetooth1-dev, libglade2-dev, libgconf2-dev
+Build-Depends: debhelper (>> 3.0.0), libdbus-glib-1-dev (>= 0.50), libgtk2.0-dev, libbluetooth1-dev, libglade2-dev, libgconf2-dev
 Standards-Version: 3.5.2
 
 Package: bluez-pin
diff -ur BLUE2/bluez-pin-0.25/main.c bluez-pin-0.25/main.c
--- BLUE2/bluez-pin-0.25/main.c	2005-04-19 05:01:12.000000000 +0200
+++ bluez-pin-0.25/main.c	2005-12-18 18:39:50.000000000 +0100
@@ -47,7 +47,7 @@
     return bluez_pin_handle_dbus_request (connection, message);
 
   if (dbus_message_is_signal (message,
-                              DBUS_INTERFACE_ORG_FREEDESKTOP_LOCAL,
+                              DBUS_INTERFACE_LOCAL,
                               "Disconnected"))
     exit (0);
   
@@ -84,7 +84,7 @@
   dbus_connection_register_object_path (connection, new_object_path, &dbus_vtable, NULL);
   dbus_connection_register_object_path (connection, old_object_path, &dbus_vtable, NULL);
 
-  dbus_bus_acquire_service (connection, NEW_SERVICE_NAME, 0, &error);
+  dbus_bus_request_name (connection, NEW_SERVICE_NAME, 0, &error);
   if (dbus_error_is_set (&error))
     {
       fprintf (stderr, "Failed to acquire %s service: %s\n", NEW_SERVICE_NAME, error.message);
@@ -92,7 +92,7 @@
       errors++;
     }
 
-  dbus_bus_acquire_service (connection, OLD_SERVICE_NAME, 0, &error);
+  dbus_bus_request_name (connection, OLD_SERVICE_NAME, 0, &error);
   if (dbus_error_is_set (&error))
     {
       fprintf (stderr, "Failed to acquire %s service: %s\n", OLD_SERVICE_NAME, error.message);
diff -ur BLUE2/bluez-pin-0.25/pin-dbus.c bluez-pin-0.25/pin-dbus.c
--- BLUE2/bluez-pin-0.25/pin-dbus.c	2004-03-08 23:48:01.000000000 +0100
+++ bluez-pin-0.25/pin-dbus.c	2005-12-21 15:33:57.000000000 +0100
@@ -41,9 +41,11 @@
 {
   DBusMessageIter iter;
 
-  dbus_message_append_iter_init (message, &iter);
+  dbus_message_iter_init_append (message, &iter);
   if (pin)
-    dbus_message_iter_append_string (&iter, pin);
+    dbus_message_iter_append_basic (&iter,
+				    dbus_message_type_from_string("string"),
+				    pin);
 
   dbus_connection_send (connection, message, NULL);
 
@@ -86,7 +88,7 @@
     goto error;
   }
 
-  out = dbus_message_iter_get_boolean (&iter);
+  dbus_message_iter_get_basic (&iter,&out);
 
   if (! dbus_message_iter_next (&iter))
     {
@@ -95,12 +97,15 @@
       goto error;
     }
 
-  type = dbus_message_iter_get_arg_type (&iter);
-
-  if (type != DBUS_TYPE_ARRAY
-      || ! dbus_message_iter_get_byte_array (&iter, &bytes, &nbytes)
-      || nbytes != sizeof (bdaddr))
-  {
+  if ((dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_ARRAY)
+      || (dbus_message_iter_get_element_type(&iter) != DBUS_TYPE_BYTE))
+    {
+      reply = dbus_message_new_error (message, WRONG_ARGS_ERROR,
+				      "Byte array expected, other type given");
+      goto error;
+    }
+  dbus_message_iter_get_fixed_array(&iter, &bytes, &nbytes);
+  if(nbytes != sizeof(bdaddr)) {
     reply = dbus_message_new_error (message, WRONG_ARGS_ERROR,
 				    "Byte array expected, other type given");
     goto error;

Reply to: