Skip to contentSkip to conversation

Meaning of hcitool -i dev con

Bluez-devel Jui-Hao Chiang 2 participants 5 messages Jun 26, 2008 – Jun 27, 2008 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

Hi, dear all:
I am currently using Cyber-Blue Bluetooth USB adapter and Motorola Razr V3 for experiments.
My goal is to use one adapter to open 3 SCO connections with 3 V3 cell phones. The chan_mobile in Asterisk gives me the way to connect the adapter to one phone. But when I use hcitool -i hci1 con to show the connections, I don't know how to explain the output (00:19:2C:D5:90:DF is cell phone's address):

Connections:

	> SCO 00:19:2C:D5:90:DF handle 2 state 1 lm SLAVE
	< ACL 00:19:2C:D5:90:DF handle 1 state 1 lm MASTER ENCRYPT

Does this mean that the USB adapter is playing TWO roles (master and slave) at the same moment??

Hope some one can give some hint.
Best regards

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

#1 lore raw
Quoted 17 lines · Jui-Hao Chiang <windtracekimo <at> gmail.com> writes:

Hi, dear all:
I am currently using Cyber-Blue Bluetooth USB adapter and Motorola Razr V3 for experiments.
My goal is to use one adapter to open 3 SCO connections with 3 V3 cell phones. The chan_mobile in Asterisk gives me the way to connect the adapter to one phone. But when I use hcitool -i hci1 con to show the connections, I don't know how to explain the output (00:19:2C:D5:90:DF is cell phone's address):

Connections:

	> SCO 00:19:2C:D5:90:DF handle 2 state 1 lm SLAVE
	< ACL 00:19:2C:D5:90:DF handle 1 state 1 lm MASTER ENCRYPT

Does this mean that the USB adapter is playing TWO roles (master and slave) at the same moment??

Quoted 9 lines

Hope some one can give some hint.
Best regards

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php

I just tried to use the following to query the link mode of the adapter [command]
hcitool -i hci1 cmd 0x02 0x0009 0x02 0x00
[output]
< HCI Command: ogf 0x02, ocf 0x0009, plen 2
02 00

Quoted 1 line

HCI Event: 0x0e plen 7

01 09 08 00 02 00 00
(If I did not make anything wrong)
0x02 is the OGF for Link Policy Command
0x0009 is the OCF for HCI_Role_Discovery
0x02 0x00 is the unit16 of connection handle

At the same time, I use "hcidump -i hci1 -w log" to listen, and then use wireshark to view the log.
The last byte of HCI Event shows the current role is Master for this connection handle.
So it seems confusing that "hcitool -i hci1 con" shows "Slave".

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

maintainer
#2 lore raw
In reply to Jui-Hao Chiang

Hi,

Quoted 8 lines

I am currently using Cyber-Blue Bluetooth USB adapter and Motorola Razr V3 for experiments.
My goal is to use one adapter to open 3 SCO connections with 3 V3 cell phones. The chan_mobile in Asterisk gives me the way to connect the adapter to one phone. But when I use hcitool -i hci1 con to show the connections, I don't know how to explain the output (00:19:2C:D5:90:DF is cell phone's address):

Quoted 6 lines

Connections:

	> SCO 00:19:2C:D5:90:DF handle 2 state 1 lm SLAVE
	< ACL 00:19:2C:D5:90:DF handle 1 state 1 lm MASTER ENCRYPT

Does this mean that the USB adapter is playing TWO roles (master and slave) at the same moment??

that is for the SCO connection. The ACL connection is the one that counts. The SCO depends on the ACL connection.

Actually the the SCO/eSCO connections don't have a link mode. It is an issue how these information are presented.

Regards

Marcel

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

#3 lore raw
Quoted 9 lines · Marcel Holtmann <marcel <at> holtmann.org> writes:
Quoted 5 lines
	> SCO 00:19:2C:D5:90:DF handle 2 state 1 lm SLAVE
	< ACL 00:19:2C:D5:90:DF handle 1 state 1 lm MASTER ENCRYPT

Does this mean that the USB adapter is playing TWO roles (master and slave) at the same moment??

that is for the SCO connection. The ACL connection is the one that counts. The SCO depends on the ACL connection.

Quoted 7 lines

Actually the the SCO/eSCO connections don't have a link mode. It is an issue how these information are presented.

Regards

Marcel

Thank you for the explanation.
This explains the output from hci command and hcidump.
Your words also reminds me that standard has said "before creating SCO, a ACL link must exist".
But I am still confused about the handle.
If ACL first use handle 0, does that mean the upcoming SCO will use handle 0? Or another one?

If you have some time, please also try to look at my previous post "Multiple SCO connections".

Sincerely,
Jui-Hao

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Bluez-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

maintainer
#4 lore raw

Hi,

Quoted 12 lines
Quoted 12 lines
Quoted 5 lines
	> SCO 00:19:2C:D5:90:DF handle 2 state 1 lm SLAVE
	< ACL 00:19:2C:D5:90:DF handle 1 state 1 lm MASTER ENCRYPT

Does this mean that the USB adapter is playing TWO roles (master and slave) at the same moment??

that is for the SCO connection. The ACL connection is the one that counts. The SCO depends on the ACL connection.

Actually the the SCO/eSCO connections don't have a link mode. It is an issue how these information are presented.

Quoted 7 lines

Thank you for the explanation.
This explains the output from hci command and hcidump.
Your words also reminds me that standard has said "before creating SCO, a ACL link must exist".
But I am still confused about the handle.
If ACL first use handle 0, does that mean the upcoming SCO will use handle 0? Or another one?

the handle 0 is invalid first of all. The ACL link gets a handle and the SCO link gets its own handle. Like you see it in the example above.

Regards

Marcel

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel