Skip to contentSkip to conversation

Concurrent hcitool commands

Bluez-users J. Carlos Alvarez 3 participants 5 messages May 24, 2007 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

Hi, we are trying to use hcitool to retrieve some information about =

several devices and we need to do it in parallel (several scripts =

concurrently call "hcitool name XX:XX:XX:XX:XX" using the same local =

device looking for the name of several remote devices).

Doing this we found that some responses received from different remote =

devices were mixed, we obtained the same device name from two different =

remote devices.

The following is a simple way to check this behaviour:
---------------------------------------------------------------

[root@localhost~]# hcitool -i hci0 name 00:12:D1:DB:9A:E3
Nokia E70
[root@localhost~]# hcitool -i hci0 name 00:13:FD:FC:DE:50
Nokia 6680
[root@localhost~]# hcitool -i hci0 name 00:12:D1:DB:9A:E3 & hcitool -i =

hci0 name 00:13:FD:FC:DE:50
[1] 14223
Nokia E70
Nokia E70
[1]+ Done hcitool -i hci0 name 00:12:D1:DB:9A:E3
---------------------------------------------------------------

- The first command gets the right name of our E70 phone:
"Nokia E70"

- The second one also gets the right name of our 6680 phone:
"Nokia 6680"

- But if we invoke both commands concurrently, both "hcitool" calls get =

the same name as the device response:
"Nokia E70"
"Nokia E70"

Are we doing something wrong?

Is there any technical limitation related to this kind of requests so we =

must to do these calls serially?

Is this a bug?

Thanks in advance,

Juan Carlos

-- =

Juan Carlos Alvarez [email protected]
---------------------------------------------------------------------
MOVILOK Interactividad M=F3vil http://www.movilok.com
Isaac Newton, 1 tlf: +34 918.046.105
Parque Tecnol=F3gico de Madrid
28760 Tres Cantos - Madrid
---------------------------------------------------------------------
"Computers are useless. They can only give you answers."
(Pablo Ruiz Picasso)

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Bluez-users mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users

maintainer
#1 lore raw

Hi Juan Carlos,

Quoted 34 lines

we are trying to use hcitool to retrieve some information about several devices and we need to do it in parallel (several scripts concurrently call "hcitool name XX:XX:XX:XX:XX" using the same local device looking for the name of several remote devices).

Doing this we found that some responses received from different remote devices were mixed, we obtained the same device name from two different remote devices.

The following is a simple way to check this behaviour:
---------------------------------------------------------------

[root@localhost~]# hcitool -i hci0 name 00:12:D1:DB:9A:E3
Nokia E70
[root@localhost~]# hcitool -i hci0 name 00:13:FD:FC:DE:50
Nokia 6680
[root@localhost~]# hcitool -i hci0 name 00:12:D1:DB:9A:E3 & hcitool -i 
hci0 name 00:13:FD:FC:DE:50
[1] 14223
Nokia E70
Nokia E70
[1]+  Done                    hcitool -i hci0 name 00:12:D1:DB:9A:E3
---------------------------------------------------------------

- The first command gets the right name of our E70 phone:
"Nokia E70"

- The second one also gets the right name of our 6680 phone:
"Nokia 6680"

- But if we invoke both commands concurrently, both "hcitool" calls get the same name as the device response:
"Nokia E70"
"Nokia E70"

Quoted 4 lines

Are we doing something wrong?

Is there any technical limitation related to this kind of requests so we must to do these calls serially?

this is a known limitation. And in general you can't execute name request in parallel anyway. Every name request involves a baseband page and that takes time and these can't be done in parallel. However some chips create the illusion that they can.

I would advise you to use the D-Bus interface since it does the name resolving in the background and automatically caches the resolved device names for you. No need to fiddle around with low-level commands.

And in case of Bluetooth 2.1 devices with extended inquiry it will deliver the remote name for free with the inquiry response. That all works already and is completely hidden via D-Bus. So nothing for you to worry about.

Regards

Marcel

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Bluez-users mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users

#2 lore raw

Thanks a lot, Marcel.

Juan Carlos

Quoted 63 lines · Marcel Holtmann

Hi Juan Carlos,

Quoted 34 lines

we are trying to use hcitool to retrieve some information about several devices and we need to do it in parallel (several scripts concurrently call "hcitool name XX:XX:XX:XX:XX" using the same local device looking for the name of several remote devices).

Doing this we found that some responses received from different remote devices were mixed, we obtained the same device name from two different remote devices.

The following is a simple way to check this behaviour:
---------------------------------------------------------------

[root@localhost~]# hcitool -i hci0 name 00:12:D1:DB:9A:E3
Nokia E70
[root@localhost~]# hcitool -i hci0 name 00:13:FD:FC:DE:50
Nokia 6680
[root@localhost~]# hcitool -i hci0 name 00:12:D1:DB:9A:E3 & hcitool -i 
hci0 name 00:13:FD:FC:DE:50
[1] 14223
Nokia E70
Nokia E70
[1]+  Done                    hcitool -i hci0 name 00:12:D1:DB:9A:E3
---------------------------------------------------------------

- The first command gets the right name of our E70 phone:
"Nokia E70"

- The second one also gets the right name of our 6680 phone:
"Nokia 6680"

- But if we invoke both commands concurrently, both "hcitool" calls get the same name as the device response:
"Nokia E70"
"Nokia E70"

Quoted 5 lines

Are we doing something wrong?

Is there any technical limitation related to this kind of requests so we must to do these calls serially?

this is a known limitation. And in general you can't execute name request in parallel anyway. Every name request involves a baseband page and that takes time and these can't be done in parallel. However some chips create the illusion that they can.

I would advise you to use the D-Bus interface since it does the name resolving in the background and automatically caches the resolved device names for you. No need to fiddle around with low-level commands.

And in case of Bluetooth 2.1 devices with extended inquiry it will deliver the remote name for free with the inquiry response. That all works already and is completely hidden via D-Bus. So nothing for you to worry about.

Regards

Marcel

Quoted 11 lines

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Bluez-users mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Bluez-users mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users

#3 lore raw
In reply to Marcel Holtmann

Hello Marcel

Quoted 10 lines · Marcel Holtmann
Quoted 5 lines

we are trying to use hcitool to retrieve some information about several devices and we need to do it in parallel (several scripts concurrently call "hcitool name XX:XX:XX:XX:XX" using the same local device looking for the name of several remote devices).

I would advise you to use the D-Bus interface since it does the name resolving in the background and automatically caches the resolved device names for you. No need to fiddle around with low-level commands.

Is there any example of d-bus usage in the sources somewhere (maybe an example of a simple client that use this interface for a simple task) ?

Thanks You!
choi

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Bluez-users mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users

maintainer
#4 lore raw

Hi Choi,

Quoted 3 lines

Is there any example of d-bus usage in the sources somewhere (maybe an example of a simple client that use this interface for a simple task) ?

look a the bluez-gnome source code.

Regards

Marcel

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Bluez-users mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users