* [Bluez-devel] [D-BUS PATCH]bluez-pin
@ 2005-10-31 18:10 Claudio Takahasi
2005-10-31 18:25 ` Marcel Holtmann
2005-10-31 18:39 ` Bastien Nocera
0 siblings, 2 replies; 3+ messages in thread
From: Claudio Takahasi @ 2005-10-31 18:10 UTC (permalink / raw)
To: bluez-devel
[-- Attachment #1: Type: text/plain, Size: 327 bytes --]
Hi,
here is the patch removing the support for old dbus versions.
The code style is a little weird, but I kept the code style :)
Who is responsible for maintain the bluez-pin?
Regards,
Claudio.
--
---------------------------------------------------------
Claudio Takahasi
Instituto Nokia de Tecnologia - INdT
[-- Attachment #2: pin_patch.patch --]
[-- Type: application/octet-stream, Size: 3135 bytes --]
--- bluez-pin-0.26.orig/pin-dbus.c 2005-09-05 16:09:13.000000000 -0300
+++ bluez-pin-0.26-dbus0.50/pin-dbus.c 2005-10-31 11:45:46.000000000 -0200
@@ -39,17 +39,11 @@
static void
bluez_pin_send_dbus_reply (DBusConnection *connection, DBusMessage *message, const char *pin)
{
-#ifndef HAVE_DBUS_MESSAGE_ITER_GET_BASIC
- DBusMessageIter iter;
- dbus_message_append_iter_init (message, &iter);
if (pin)
- dbus_message_iter_append_string (&iter, pin);
-#else
- dbus_message_append_args(message,
- DBUS_TYPE_STRING, &pin,
- DBUS_TYPE_INVALID);
-#endif
+ dbus_message_append_args(message,
+ DBUS_TYPE_STRING, &pin,
+ DBUS_TYPE_INVALID);
dbus_connection_send (connection, message, NULL);
@@ -72,6 +66,7 @@
bluez_pin_handle_dbus_request (DBusConnection *connection, DBusMessage *message)
{
DBusMessageIter iter;
+ DBusMessageIter array_iter;
gboolean out;
bdaddr_t bdaddr, sbdaddr;
int type;
@@ -92,11 +87,7 @@
goto error;
}
-#ifdef HAVE_DBUS_MESSAGE_ITER_GET_BASIC
dbus_message_iter_get_basic (&iter, &out);
-#else
- out = dbus_message_iter_get_boolean (&iter);
-#endif
if (! dbus_message_iter_next (&iter))
{
@@ -107,16 +98,13 @@
type = dbus_message_iter_get_arg_type (&iter);
-#ifdef HAVE_DBUS_MESSAGE_ITER_GET_BASIC
nbytes = 0;
- if (type == DBUS_TYPE_ARRAY)
- dbus_message_iter_get_fixed_array (&iter, &bytes, &nbytes);
+ if (type == DBUS_TYPE_ARRAY) {
+ dbus_message_iter_recurse(&iter, &array_iter);
+ dbus_message_iter_get_fixed_array (&array_iter, &bytes, &nbytes);
+ }
+
if (nbytes != sizeof (bdaddr))
-#else
- if (type != DBUS_TYPE_ARRAY
- || ! dbus_message_iter_get_byte_array (&iter, &bytes, &nbytes)
- || nbytes != sizeof (bdaddr))
-#endif
{
reply = dbus_message_new_error (message, WRONG_ARGS_ERROR,
"Byte array expected, other type given");
--- bluez-pin-0.26.orig/main.c 2005-09-05 16:11:20.000000000 -0300
+++ bluez-pin-0.26-dbus0.50/main.c 2005-10-31 10:57:14.000000000 -0200
@@ -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);
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [Bluez-devel] [D-BUS PATCH]bluez-pin
2005-10-31 18:10 [Bluez-devel] [D-BUS PATCH]bluez-pin Claudio Takahasi
@ 2005-10-31 18:25 ` Marcel Holtmann
2005-10-31 18:39 ` Bastien Nocera
1 sibling, 0 replies; 3+ messages in thread
From: Marcel Holtmann @ 2005-10-31 18:25 UTC (permalink / raw)
To: bluez-devel
Hi Claudio,
> here is the patch removing the support for old dbus versions.
that is great.
> The code style is a little weird, but I kept the code style :)
I know, but this is not my code ;)
> Who is responsible for maintain the bluez-pin?
You should mail the patch to Phil Blundell <philb@gnu.org>.
Regards
Marcel
-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Bluez-devel] [D-BUS PATCH]bluez-pin
2005-10-31 18:10 [Bluez-devel] [D-BUS PATCH]bluez-pin Claudio Takahasi
2005-10-31 18:25 ` Marcel Holtmann
@ 2005-10-31 18:39 ` Bastien Nocera
1 sibling, 0 replies; 3+ messages in thread
From: Bastien Nocera @ 2005-10-31 18:39 UTC (permalink / raw)
To: bluez-devel
On Mon, 2005-10-31 at 16:10 -0200, Claudio Takahasi wrote:
> Hi,
>
> here is the patch removing the support for old dbus versions.
>
> The code style is a little weird, but I kept the code style :)
>
> Who is responsible for maintain the bluez-pin?
GPE. I committed a few patches in my days, but the code is mostly
mature, or needs updates for new versions of d-bus. Please don't remove
the existing code, it's still being used by some distributions and would
make it impossible to upgrade any bluez utilities or libraries for some
people (like myself).
Cheers
---
Bastien Nocera <hadess@hadess.net>
-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2005-10-31 18:39 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-10-31 18:10 [Bluez-devel] [D-BUS PATCH]bluez-pin Claudio Takahasi
2005-10-31 18:25 ` Marcel Holtmann
2005-10-31 18:39 ` Bastien Nocera
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox