public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
From: Marcel Holtmann <marcel@holtmann.org>
To: BlueZ development <bluez-devel@lists.sourceforge.net>
Subject: Re: [Bluez-devel] Error connecting after inquiry
Date: Thu, 12 Apr 2007 09:46:16 +0200	[thread overview]
Message-ID: <1176363976.7049.10.camel@violet> (raw)
In-Reply-To: <1d49725d0704112005q6b90105dtc9e2e6affc647f63@mail.gmail.com>

Hi Donnie,

> I am developing an application that connects to the Nintendo Wii
> remote, which is a bluetooth device, using BlueZ.  The API allows a
> bdaddr to be supplied, or not.  If it is not supplied, the API invokes
> a search function that does an hci_inquiry to get all available
> devices, hci_open_dev to get a device connection, then traverses the
> array, calling hci_remote_name and checking the class for each item
> returned from hci_inquiry until a Wiimote is found, closes the hci
> device, and returns the bdaddr of the Wiimote.  The calling function
> then opens a couple of L2CAP sockets and proceeds to communicate with
> the device. 
> 
> Here's my problem: many users receive errors on the L2CAP socket open
> only when a bdaddr is not supplied, but it works fine when the bdaddr
> is provided (thus skipping the search procedure described above).
> I've verified that the bdaddr returned by the search function is, in
> fact, identical to that supplied, so the parameters to the socket open
> call are identical.  It happens every time on some machines, and never
> on others - to my knowledge, there are no intermittently failing
> machines.  Any ideas? 

run "hcidump -X -V" as root to see what actually happens. You are using
threads and this might be a simply race condition.

However you also resolve the names for devices that don't have the
Wiimote device class. That is not needed at all. And a failing name is
not a reason to abort the whole search procedure. It can happen.

And you might wanna thing about doing this with our D-Bus API since it
is doing everything for you. Including telling you the RSSI values so
you can pick the one really next to you.

Regards

Marcel



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

  reply	other threads:[~2007-04-12  7:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-12  3:05 [Bluez-devel] Error connecting after inquiry Donnie Smith
2007-04-12  7:46 ` Marcel Holtmann [this message]
  -- strict thread matches above, loose matches on Subject: below --
2007-04-12 19:42 Donnie Smith
2007-04-12 20:13 ` Marcel Holtmann
2007-04-14 16:01 Donnie Smith
2007-04-18 23:49 ` 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=1176363976.7049.10.camel@violet \
    --to=marcel@holtmann.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox