public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
From: Alexander H Deriziotis <deriziotis@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: non-blocking hci_inquiry()
Date: Tue, 28 Jul 2009 12:55:17 +0100	[thread overview]
Message-ID: <5eee8c670907280455ube96c5aka5a9a97149034a71@mail.gmail.com> (raw)
In-Reply-To: <5eee8c670907280453i76f4957fvcca9c3954576580d@mail.gmail.com>

Hi,

I've been playing with the linux wiimote daemon called Cwiid, and
noticed that while it's waiting for a connection from a wiimote, it's
blocking the bluetooth adapter from doing anything else.

Searching around and looking at the code, I can see it's calling
hci_inquiry() in a loop which is blocking the device.

Does a non-blocking hci_inquiry() function exist? If not, could I get
some help on how to go about writing one?

Looking around, someone mentions that it might be the ioctl() function
called within hci_inquiry() which is causing the blocking, could it be
something as trivial as playing with that?

from lib/hci.c:

int hci_inquiry(int dev_id, int len, int nrsp, const uint8_t *lap,
inquiry_info **ii, long flags)
{
[snip]
        ret = ioctl(dd, HCIINQUIRY, (unsigned long) buf);
        if (ret < 0)
                goto free;


Many thanks,

Alex

       reply	other threads:[~2009-07-28 11:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <5eee8c670907280453i76f4957fvcca9c3954576580d@mail.gmail.com>
2009-07-28 11:55 ` Alexander H Deriziotis [this message]
2009-07-28 12:31   ` non-blocking hci_inquiry() Marcel Holtmann
2009-08-12 22:37     ` Alexander H Deriziotis
2009-08-12 22:40       ` 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=5eee8c670907280455ube96c5aka5a9a97149034a71@mail.gmail.com \
    --to=deriziotis@gmail.com \
    --cc=linux-bluetooth@vger.kernel.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