From: Gustavo F. Padovan <gustavo@padovan.org>
To: ofono@ofono.org
Subject: Re: [PATCH] Add send_method_call to g_dbus
Date: Fri, 30 Apr 2010 20:40:11 -0300 [thread overview]
Message-ID: <20100430234011.GB11712@vigoh> (raw)
In-Reply-To: <1272335616.22838.121.camel@localhost.localdomain>
[-- Attachment #1: Type: text/plain, Size: 3193 bytes --]
* Marcel Holtmann <marcel@holtmann.org> [2010-04-27 04:33:36 +0200]:
> Hi Gustavo,
>
> > Puting send_method_call and send_method_call_with_reply on g_dbus will
> > avoid some code duplication and will make things easier mainly for the
> > Bluetooth plugins (HFP, DUN, SAP) inside oFono.
> > ---
> > gdbus/gdbus.h | 12 ++++
> > gdbus/object.c | 81 +++++++++++++++++++++++++++++
> > plugins/hfp.c | 154 +++++++++++++------------------------------------------
> > 3 files changed, 130 insertions(+), 117 deletions(-)
>
> first of all, we don't intermix gdbus patches with other changes.
> Remember that these commits have to be applied to BlueZ and ConnMan as
> well.
>
> > diff --git a/gdbus/gdbus.h b/gdbus/gdbus.h
> > index 47e18cf..ac488c5 100644
> > --- a/gdbus/gdbus.h
> > +++ b/gdbus/gdbus.h
> > @@ -106,12 +106,24 @@ DBusMessage *g_dbus_create_error_valist(DBusMessage *message, const char *name,
> > DBusMessage *g_dbus_create_reply(DBusMessage *message, int type, ...);
> > DBusMessage *g_dbus_create_reply_valist(DBusMessage *message,
> > int type, va_list args);
> > +DBusMessage *g_dbus_create_method_call(const char *dest, const char *path,
> > + const char *interface, const char *method,
> > + int type, va_list args);
> >
> > gboolean g_dbus_send_message(DBusConnection *connection, DBusMessage *message);
> > gboolean g_dbus_send_reply(DBusConnection *connection,
> > DBusMessage *message, int type, ...);
> > gboolean g_dbus_send_reply_valist(DBusConnection *connection,
> > DBusMessage *message, int type, va_list args);
> > +gboolean g_dbus_send_method_call(DBusConnection *connection, const char *dest,
> > + const char *path, const char *interface,
> > + const char *method, int type, ...);
> > +gboolean g_dbus_send_method_call_with_reply(DBusConnection *connection,
> > + const char *dest, const char *path,
> > + const char *interface, const char *method,
> > + DBusPendingCallNotifyFunction cb,
> > + void *user_data, DBusFreeFunction free_func,
> > + int timeout, int type, ...);
>
> Is there any real reason to export send_method_call and
> create_method_call? What are these good for and what are your expected
> users of these?
I'm trying to avoid call 3 functions every time I want call a dbus
method. Today we have to do:
dbus_message_new_method_call()
dbus_message_append_args()
g_dbus_send_message()
With the call I'm proposing we just call g_dbus_send_method_call() to
call a dbus method. HFP plugin (and soon the DUN plugin) will make use
of that function a lot. The same goes for
g_dbus_send_method_call_with_reply().
My idea could be wrong since I'm not a DBus expertise. ;)
>
> I think that a g_dbus_method_call which is always async and take a
> pending call notifier is just enough.
>
> All the other helpers are more for callbacks that have to respond to
> messages than for client usage.
>
> Regards
>
> Marcel
>
>
> _______________________________________________
> ofono mailing list
> ofono(a)ofono.org
> http://lists.ofono.org/listinfo/ofono
--
Gustavo F. Padovan
http://padovan.org
prev parent reply other threads:[~2010-04-30 23:40 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-20 6:51 [PATCH] Add send_method_call to g_dbus Gustavo F. Padovan
2010-04-20 9:32 ` Kalle Valo
2010-04-20 9:41 ` Zhenhua Zhang
2010-04-20 16:20 ` Denis Kenzior
2010-04-21 6:51 ` Kalle Valo
2010-04-27 2:33 ` Marcel Holtmann
2010-04-27 11:14 ` Johan Hedberg
2010-04-30 23:40 ` Gustavo F. Padovan [this message]
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=20100430234011.GB11712@vigoh \
--to=gustavo@padovan.org \
--cc=ofono@ofono.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