public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
From: Ronny L Nilsson <bb@arbetsmyra.dyndns.org>
To: bluez-devel@lists.sourceforge.net
Subject: [Bluez-devel] Strange hci_get_route() result
Date: Mon, 11 Jul 2005 00:47:33 +0200	[thread overview]
Message-ID: <20050710224918.A15613CE@arbetsmyra.dyndns.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 621 bytes --]



Hi
On my system there's something fishy going on with the library function 
"hci_get_route()". When I use several dongels simultaneously it returns 
wrong value. I might be doing things wrong too of cource. This code 
below:
	str2ba("00:11:22:33:44:55", &ba);
	dev_id = hci_get_route(&ba);
	printf("%d\n", dev_id);

Prints "-1" as device id when I have one dongle attached and it prints 
"1" when I've got two. Both are incorrect, it should be 0.

However, if I apply the patch below it works much better. I find it 
very strange though if such a basic function is buggy, so what 
am I doing wrong? 

Regards
/Ronny




[-- Attachment #2: hci-lib.diff --]
[-- Type: text/x-diff, Size: 529 bytes --]

Index: libs/src/hci.c
===================================================================
RCS file: /cvsroot/bluez/libs/src/hci.c,v
retrieving revision 1.75
diff -u -p -r1.75 hci.c
--- libs/src/hci.c	9 Jul 2005 17:09:10 -0000	1.75
+++ libs/src/hci.c	10 Jul 2005 22:40:20 -0000
@@ -522,7 +522,7 @@ static int __same_bdaddr(int dd, int dev
 
 int hci_get_route(bdaddr_t *bdaddr)
 {
-	return hci_for_each_dev(HCI_UP, __other_bdaddr,
+	return hci_for_each_dev(HCI_UP, __same_bdaddr,
 				(long) (bdaddr ? bdaddr : BDADDR_ANY));
 }
 

             reply	other threads:[~2005-07-10 22:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-10 22:47 Ronny L Nilsson [this message]
2005-07-11 15:05 ` [Bluez-devel] Strange hci_get_route() result Marcel Holtmann
2005-07-11 18:07   ` Ronny L Nilsson
2005-07-11 19:22     ` Marcel Holtmann
2005-07-11 19:31       ` Albert Huang
2005-07-11 19:36         ` 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=20050710224918.A15613CE@arbetsmyra.dyndns.org \
    --to=bb@arbetsmyra.dyndns.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