All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johan Hedberg <johan.hedberg@nokia.com>
To: bluez-devel@lists.sourceforge.net
Subject: Re: [Bluez-devel] [PATCH] Make RemoteName D-BUS method non-blocking
Date: Wed, 19 Oct 2005 20:45:49 +0300	[thread overview]
Message-ID: <20051019174549.GA15795@localhost.localdomain> (raw)
In-Reply-To: <9307f5f20510190803g3f78775dr4d817acc0cd18171@mail.gmail.com>

Hi,

On Wed, Oct 19, 2005, P. Durante wrote:
> - receive the dbus method_call asking to perform some hci command
> - save the call_message somewhere ( a pointer )
> - fill the hci command packet
> - save a structure containing the packet and the aforementioned
> pointer in a queue ( this structure contains other things, like a
> timeout object to know when the command didn't complete in time, but
> let's get over that )
> - send the hci command packet
> - move it to another queue
> - return to the main loop
> [you could use the glib main loop if you like ( or that 'scary'
> glib-ectomy in bluez-utils :) but I wanted to avoid such a dependency
> for a daemon and wrote my own main loop adapter.]
> 
> when some data is ready on the hci control socket ( you have one of
> those for each active device )
> - read the generated event
> - see if it corresponds to one of the pending commands in the queue (
> this part includes some dirty magic to avoid messing things up if you
> send twice the same command )
> - if so, read the event data and send the method_reply over dbus (
> using the pointer you saved before )

What you describe is pretty much as I have implemented the bluetooth
D-BUS applications that are part of maemo (www.maemo.org, osso-bttools
and osso-gwconnect packages). For those I had the luxury of using glib
so doing things asynchronously was quite simple.

The results of the Inquiry and RemoteName methods are already sent as
D-BUS signals, so it doesn't necessarely make sense to send the
information a second time in the D-BUS method returns. However, there
will for sure come scerarios where we need to store information in some
queue, return to the mainloop, and retreive the information from the
queue when the appropriate event comes.

Since I don't have a very clear picture of what kind of mainloop Marcel
would like to use when we move the development over to bluetoothd from
hcid, I have intentionally tried to stay away from touching features
which would require doing things asychronously as you describe ;-)

Johan


-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

  reply	other threads:[~2005-10-19 17:45 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-19 14:07 [Bluez-devel] [PATCH] Make RemoteName D-BUS method non-blocking Johan Hedberg
2005-10-19 15:03 ` P. Durante
2005-10-19 17:45   ` Johan Hedberg [this message]
2005-10-19 22:58 ` Marcel Holtmann
2005-10-20  7:05   ` Johan Hedberg
2005-10-20  7:52     ` Marcel Holtmann
2005-10-20  8:37       ` Johan Hedberg
2005-10-20  9:02         ` Marcel Holtmann
2005-10-20  9:50           ` Johan Hedberg
2005-10-20 10:16             ` Marcel Holtmann
2005-10-20 11:21               ` Johan Hedberg
2005-10-20 13:37                 ` Johan Hedberg
2005-10-22 12:58                 ` Marcel Holtmann

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=20051019174549.GA15795@localhost.localdomain \
    --to=johan.hedberg@nokia.com \
    --cc=bluez-devel@lists.sourceforge.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.