* [Bluez-devel] Strange hci_get_route() result
@ 2005-07-10 22:47 Ronny L Nilsson
2005-07-11 15:05 ` Marcel Holtmann
0 siblings, 1 reply; 6+ messages in thread
From: Ronny L Nilsson @ 2005-07-10 22:47 UTC (permalink / raw)
To: bluez-devel
[-- 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));
}
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [Bluez-devel] Strange hci_get_route() result
2005-07-10 22:47 [Bluez-devel] Strange hci_get_route() result Ronny L Nilsson
@ 2005-07-11 15:05 ` Marcel Holtmann
2005-07-11 18:07 ` Ronny L Nilsson
0 siblings, 1 reply; 6+ messages in thread
From: Marcel Holtmann @ 2005-07-11 15:05 UTC (permalink / raw)
To: bluez-devel
Hi Ronny,
> 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?
check the CVS. I changed the hci_get_route() lately. And the ba is the
address of the remote system.
Regards
Marcel
-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP,
AMD, and NVIDIA. To register visit http://www.hp.com/go/dualwebinar
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [Bluez-devel] Strange hci_get_route() result
2005-07-11 15:05 ` Marcel Holtmann
@ 2005-07-11 18:07 ` Ronny L Nilsson
2005-07-11 19:22 ` Marcel Holtmann
0 siblings, 1 reply; 6+ messages in thread
From: Ronny L Nilsson @ 2005-07-11 18:07 UTC (permalink / raw)
To: bluez-devel; +Cc: Albert Huang
> > 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);
> >
>
> check the CVS. I changed the hci_get_route() lately.
Hi
My lib is up to date with CVS so that's not the problem.
> And the ba is
> the address of the remote system.
Really? umm, ok. The "manual" by Albert Huang
http://people.csail.mit.edu/albert/pubs/ashuang-sm-thesis-2005.pdf
states the opposite. If you happen to already know the bdaddr of a
*local* adapter you can look up its device id with hci_get_rotue(). I
guess there is no such handy utility function then?
Thanks anyway
/Ronny
-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP,
AMD, and NVIDIA. To register visit http://www.hp.com/go/dualwebinar
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [Bluez-devel] Strange hci_get_route() result
2005-07-11 18:07 ` Ronny L Nilsson
@ 2005-07-11 19:22 ` Marcel Holtmann
2005-07-11 19:31 ` Albert Huang
0 siblings, 1 reply; 6+ messages in thread
From: Marcel Holtmann @ 2005-07-11 19:22 UTC (permalink / raw)
To: bluez-devel; +Cc: Albert Huang
Hi Albert,
> > check the CVS. I changed the hci_get_route() lately.
>
> My lib is up to date with CVS so that's not the problem.
please try again. What happens if you use NULL as address argument.
> > And the ba is
> > the address of the remote system.
>
> Really? umm, ok. The "manual" by Albert Huang
> http://people.csail.mit.edu/albert/pubs/ashuang-sm-thesis-2005.pdf
> states the opposite. If you happen to already know the bdaddr of a
> *local* adapter you can look up its device id with hci_get_rotue(). I
> guess there is no such handy utility function then?
It is really the remote address. Otherwise this function wouldn't make
any sense. We need to find a local adapter that can connect to the
remote one. This is the reason why it is called *_route().
Use hci_devid() if you wanna get the dev_id of a local adapter when you
know its address.
Regards
Marcel
-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP,
AMD, and NVIDIA. To register visit http://www.hp.com/go/dualwebinar
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Bluez-devel] Strange hci_get_route() result
2005-07-11 19:22 ` Marcel Holtmann
@ 2005-07-11 19:31 ` Albert Huang
2005-07-11 19:36 ` Marcel Holtmann
0 siblings, 1 reply; 6+ messages in thread
From: Albert Huang @ 2005-07-11 19:31 UTC (permalink / raw)
To: BlueZ Mailing List
Looks like I'm wrong. =20
just to make sure i understand - hci_get_route will return the first
dev_id that doesn't have the same bluetooth address as ba?
-albert
On 7/11/05, Marcel Holtmann <marcel@holtmann.org> wrote:
> Hi Albert,
>=20
> > > check the CVS. I changed the hci_get_route() lately.
> >
> > My lib is up to date with CVS so that's not the problem.
>=20
> please try again. What happens if you use NULL as address argument.
>=20
> > > And the ba is
> > > the address of the remote system.
> >
> > Really? umm, ok. The "manual" by Albert Huang
> > http://people.csail.mit.edu/albert/pubs/ashuang-sm-thesis-2005.pdf
> > states the opposite. If you happen to already know the bdaddr of a
> > *local* adapter you can look up its device id with hci_get_rotue(). I
> > guess there is no such handy utility function then?
>=20
> It is really the remote address. Otherwise this function wouldn't make
> any sense. We need to find a local adapter that can connect to the
> remote one. This is the reason why it is called *_route().
>=20
> Use hci_devid() if you wanna get the dev_id of a local adapter when you
> know its address.
>=20
> Regards
>=20
> Marcel
>=20
>=20
>
-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP,
AMD, and NVIDIA. To register visit http://www.hp.com/go/dualwebinar
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Bluez-devel] Strange hci_get_route() result
2005-07-11 19:31 ` Albert Huang
@ 2005-07-11 19:36 ` Marcel Holtmann
0 siblings, 0 replies; 6+ messages in thread
From: Marcel Holtmann @ 2005-07-11 19:36 UTC (permalink / raw)
To: bluez-devel
Hi Albert,
> just to make sure i understand - hci_get_route will return the first
> dev_id that doesn't have the same bluetooth address as ba?
this is correct. It is the first device we can use to connect to the
remote address ba.
Regards
Marcel
-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP,
AMD, and NVIDIA. To register visit http://www.hp.com/go/dualwebinar
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2005-07-11 19:36 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-10 22:47 [Bluez-devel] Strange hci_get_route() result Ronny L Nilsson
2005-07-11 15:05 ` 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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox