From: Marcel Holtmann <marcel@rvs.uni-bielefeld.de>
To: BlueZ Mailing List <bluez-devel@lists.sourceforge.net>
Subject: [Bluez-devel] Changes to inquiry
Date: 22 May 2003 18:21:15 +0200 [thread overview]
Message-ID: <1053620481.17764.129.camel@pegasus> (raw)
[-- Attachment #1: Type: text/plain, Size: 746 bytes --]
Hello,
the inquiry process have some problems if devices report Bluetooth
addresses more than once. This can be seen with the Nokia cards. The
kernel inside inquiry cache is able to handle this, but the number of
responses parameter will mess this up. The most problem case is if you
want to set the number of inquiry responses to zero, which means
unlimted number of inquiry reponses until the specified time is over.
Currently a value of zero will be recoded as 200, but if you use a large
time value this number can be reached very quick and not all devices
will be found. I suppose the attached change to the Bluetooth library
and fix the kernel code to dump up to 255 devices if the num_rsp
parameter is zero.
Comments?
Regards
Marcel
[-- Attachment #2: patch-libs-inq --]
[-- Type: text/x-patch, Size: 694 bytes --]
diff -urN libs/src/hci.c libs-mh/src/hci.c
--- libs/src/hci.c Mon May 19 20:41:00 2003
+++ libs-mh/src/hci.c Thu May 22 18:02:41 2003
@@ -473,8 +473,10 @@
void *buf;
int s, err;
- if (nrsp <= 0)
- nrsp = 200; // enough ?
+ if (nrsp < 0) {
+ errno = EINVAL;
+ return -1;
+ }
if (dev_id < 0 && (dev_id = hci_get_route(NULL)) < 0) {
errno = ENODEV;
@@ -485,7 +487,11 @@
if (s < 0)
return -1;
- buf = malloc(sizeof(*ir) + (sizeof(inquiry_info) * (nrsp)));
+ if (nrsp == 0)
+ buf = malloc(sizeof(*ir) + (sizeof(inquiry_info) * 255));
+ else
+ buf = malloc(sizeof(*ir) + (sizeof(inquiry_info) * nrsp));
+
if (!buf) {
close(s);
return -1;
reply other threads:[~2003-05-22 16:21 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1053620481.17764.129.camel@pegasus \
--to=marcel@rvs.uni-bielefeld.de \
--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