Skip to contentSkip to conversation

how to recognize whether the connected device is a headset

Bluez-users Chen Bin 3 participants 8 messages Oct 21, 2004 – Oct 22, 2004 Bluetooth drivers

lore
Share & tools
lore

Chen Bin

author
#0 lore raw

Hi all,

Thanks very much for previous help from Holtman, and I happen a new problem when I try to find out whether a connected device is a headset.

It can't be browsed using sdptool in both connected mode and discovery mode(paring state), I wonder how I can know its charactics after connected?

My phone will be appeared in 3G conference next month, so I am very anxious about the bluetooth feature...

Holtman, any idea?

Thanks in advance!

Chen

-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users

#1 lore raw
Quoted 8 lines · Chen Bin

Hi all,

Thanks very much for previous help from Holtman, and I happen a new problem when I try to find out whether a connected device is a headset.

It can't be browsed using sdptool in both connected mode and discovery mode(paring state), I wonder how I can know its charactics after connected?

You can look at the device class first.
And instead of browsing try to search for the profile instead with

sdptool search --bdaddr <add> <uuid>

You are supposed to use the headset uuid (0x1108), but you can use the L2CAP-UUID (0x100) just as well. This little trick will list almost every service of a device, even if it's not in the public browse group.

Fred

Signature · 13 lines
Fred Schaettgen
[email protected]


-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users
maintainer
#2 lore raw
In reply to Chen Bin

Hi Chen,

Quoted 6 lines

Thanks very much for previous help from Holtman, and I happen a new problem when I try to find out whether a connected device is a headset.

It can't be browsed using sdptool in both connected mode and discovery mode(paring state), I wonder how I can know its charactics after connected?

actually the class of device value can be inside the inquiry cache and you will see it when a remote device requests a connection. However we don't really store these information together with the connection to make them available afterwards. Any patch is welcome.

What I don't get is why you can't browse when the device is connected? Run "hcidump -X" as root and show it to us so we can see what happens.

Quoted 2 lines

My phone will be appeared in 3G conference next month, so I am very anxious about the bluetooth feature...

What does this mean? Is it good or is it bad? And btw my first name is Marcel and not Holtmann.

Regards

Marcel

-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users

author
#3 lore raw

Hi Marcel,

Below is the infomation I got when I am connecting to a headset and using 'sdptool browse 00:0D:18:02:4F:C0' to find out the service provided by the headset:

binch@debian:/new/bt/mBluetooth$ sdptool browse 00:0D:18:02:4F:C0
Browsing 00:0D:18:02:4F:C0 ...
binch@debian:/new/bt/mBluetooth$ hcitool con
Connections:

BTW: I actually have connected to the headset because when I press some key in the headset I can get some reaction on hcidump, I don't know whether hcitool con can't see the connection.

The headset is DKH-03. Thanks in advance.

The log of hcidump:

HCIDump - HCI packet analyzer ver 1.10
device: hci0 snap_len: 1028 filter: 0xffffffff < HCI Command: Create Connection (0x01|0x0005) plen 13
C0 4F 02 18 0D 00 18 CC 02 00 00 00 01

Quoted 1 line

HCI Event: Command Status (0x0f) plen 4

00 01 05 04

Quoted 1 line

HCI Event: PIN Code Request (0x16) plen 6

C0 4F 02 18 0D 00
< HCI Command: PIN Code Request Negative Reply (0x01|0x000e) plen 6
C0 4F 02 18 0D 00

Quoted 1 line

HCI Event: Command Complete (0x0e) plen 10

01 0E 04 00 C0 4F 02 18 0D 00

Quoted 1 line

HCI Event: Connect Complete (0x03) plen 11

18 29 00 C0 4F 02 18 0D 00 01 00
< HCI Command: Write Scan Enable (0x03|0x001a) plen 1
03

Quoted 1 line

HCI Event: Command Complete (0x0e) plen 4

01 1A 0C 00
< HCI Command: Write Authentication Enable (0x03|0x0020) plen 1
00

Quoted 1 line

HCI Event: Command Complete (0x0e) plen 4

01 20 0C 00
< HCI Command: Write Authentication Enable (0x03|0x0020) plen 1
00

Quoted 1 line

HCI Event: Command Complete (0x0e) plen 4

01 20 0C 00
< HCI Command: Write Encryption Mode (0x03|0x0022) plen 1
00

Quoted 1 line

HCI Event: Command Complete (0x0e) plen 4

01 22 0C 00
< HCI Command: Write Class of Device (0x03|0x0024) plen 3
00 01 00

Quoted 1 line

HCI Event: Command Complete (0x0e) plen 4

01 24 0C 00
< HCI Command: Write Local Name (0x03|0x0013) plen 248
4D 6F 62 69 6C 65 73 6F 66 74 20 28 30 29 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

Quoted 1 line

HCI Event: Command Complete (0x0e) plen 4

01 13 0C 00
< HCI Command: Create Connection (0x01|0x0005) plen 13
C0 4F 02 18 0D 00 18 CC 02 00 00 00 01

Quoted 1 line

HCI Event: Command Status (0x0f) plen 4

00 01 05 04

Quoted 1 line

HCI Event: PIN Code Request (0x16) plen 6

C0 4F 02 18 0D 00
< HCI Command: PIN Code Request Reply (0x01|0x000d) plen 23
C0 4F 02 18 0D 00 04 30 30 30 30 00 00 00 00 00 00 00 00 00 00 00 00

Quoted 1 line

HCI Event: Command Complete (0x0e) plen 10

01 0D 04 00 C0 4F 02 18 0D 00

Quoted 1 line

HCI Event: Link Key Notification (0x18) plen 23

C0 4F 02 18 0D 00 7F EE 97 25 9C CB 7E 48 C1 20 A8 A9 15 A2 62 4E 00

Quoted 1 line

HCI Event: Connect Complete (0x03) plen 11

00 29 00 C0 4F 02 18 0D 00 01 00
< HCI Command: Write Link Policy Settings (0x02|0x000d) plen 4
29 00 0F 00

Quoted 1 line

HCI Event: Page Scan Repetition Mode Change (0x20) plen 7

C0 4F 02 18 0D 00 01

Quoted 1 line

HCI Event: Command Complete (0x0e) plen 6

01 0D 08 00 29 00
< ACL data: handle 0x0029 flags 0x02 dlen 12

    L2CAP(s): Connect req: psm 1 scid 0x0040
Quoted 1 line

HCI Event: Number of Completed Packets (0x13) plen 5

01 29 00 01 00

Quoted 1 line

ACL data: handle 0x0029 flags 0x02 dlen 16

    L2CAP(s): Connect rsp: dcid 0x0113 scid 0x0040 result 1 status 2
Quoted 1 line

ACL data: handle 0x0029 flags 0x02 dlen 16

    L2CAP(s): Connect rsp: dcid 0x0113 scid 0x0040 result 0 status 0
< ACL data: handle 0x0029 flags 0x02 dlen 12
    L2CAP(s): Config req: dcid 0x0113 flags 0x0000 clen 0
Quoted 1 line

HCI Event: Number of Completed Packets (0x13) plen 5

01 29 00 01 00

Quoted 1 line

ACL data: handle 0x0029 flags 0x02 dlen 14

    L2CAP(s): Config rsp: scid 0x0040 flags 0x0000 result 0 clen 0
Quoted 1 line

ACL data: handle 0x0029 flags 0x02 dlen 16

    L2CAP(s): Config req: dcid 0x0040 flags 0x0000 clen 4
    MTU 48
< ACL data: handle 0x0029 flags 0x02 dlen 14
    L2CAP(s): Config rsp: scid 0x0113 flags 0x0000 result 0 clen 0
< ACL data: handle 0x0029 flags 0x02 dlen 24
    L2CAP(d): cid 0x0113 len 20 [psm 1]
        SDP SSA Req: tid 0x0 len 0xf
          pat uuid-16 0x1002 (PubBrwsGrp)
          max 0xffff
          aid(s) 0x0000 - 0xffff
          cont 00
Quoted 1 line

HCI Event: Number of Completed Packets (0x13) plen 5

01 29 00 01 00

Quoted 1 line

HCI Event: Number of Completed Packets (0x13) plen 5

01 29 00 01 00

Quoted 1 line

ACL data: handle 0x0029 flags 0x02 dlen 14

    L2CAP(d): cid 0x0040 len 10 [psm 1]
        SDP SSA Rsp: tid 0x0 len 0x5
          cnt 0x2
          cont 00
< ACL data: handle 0x0029 flags 0x02 dlen 12
    L2CAP(s): Disconn req: dcid 0x0113 scid 0x0040
Quoted 1 line

HCI Event: Number of Completed Packets (0x13) plen 5

01 29 00 01 00

Quoted 1 line

ACL data: handle 0x0029 flags 0x02 dlen 12

    L2CAP(s): Disconn rsp: dcid 0x0113 scid 0x0040

< HCI Command: Disconnect (0x01|0x0006) plen 3
29 00 13

Quoted 1 line

HCI Event: Command Status (0x0f) plen 4

00 01 06 04

Quoted 1 line

HCI Event: Disconn Complete (0x05) plen 4

00 29 00 16

Chen

Quoted 28 lines · 在2004年10月22日的01:41,Marcel Holtmann写道:

Hi Chen,

Quoted 6 lines

Thanks very much for previous help from Holtman, and I happen a new problem when I try to find out whether a connected device is a headset.

It can't be browsed using sdptool in both connected mode and discovery mode(paring state), I wonder how I can know its charactics after connected?

actually the class of device value can be inside the inquiry cache and you will see it when a remote device requests a connection. However we don't really store these information together with the connection to make them available afterwards. Any patch is welcome.

What I don't get is why you can't browse when the device is connected? Run "hcidump -X" as root and show it to us so we can see what happens.

Quoted 2 lines

My phone will be appeared in 3G conference next month, so I am very anxious about the bluetooth feature...

What does this mean? Is it good or is it bad? And btw my first name is Marcel and not Holtmann.

Regards

Marcel

maintainer
#4 lore raw

Hi Chen,

Quoted 4 lines

Below is the infomation I got when I am connecting to a headset and using 'sdptool browse 00:0D:18:02:4F:C0' to find out the service provided by the headset:

Quoted 8 lines
binch@debian:/new/bt/mBluetooth$ sdptool browse 00:0D:18:02:4F:C0
Browsing 00:0D:18:02:4F:C0 ...
binch@debian:/new/bt/mBluetooth$ hcitool con
Connections:

BTW: I actually have connected to the headset because when I press some key in the headset I can get some reaction on hcidump, I don't know whether hcitool con can't see the connection.

according to your dump, you are already disconnected at that time and you really shouldn't play with "hcitool cc ...", because this creation of a connection is not really recognized by the kernel. Use the L2CAP or RFCOMM sockets instead.

In general a headset don't reacts on requests for the public browse group and so you must search for a specific service.

	sdptool search --bdaddr <bdaddr> {hs|hf}
Quoted 3 lines

The headset is DKH-03.

Quoted 1 line

From what company and what does "hcitool info ..." say about this

headset?

Regards

Marcel

-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users

author
#5 lore raw
In reply to Marcel Holtmann

HI Marcel,

Quoted 5 lines · 在2004年10月22日的01:41,Marcel Holtmann写道:

Hi Chen,

Quoted 3 lines

Thanks very much for previous help from Holtman, and I happen a new problem when I try to find out whether a connected device is a headset.

Quoted 8 lines
Quoted 3 lines

It can't be browsed using sdptool in both connected mode and discovery mode(paring state), I wonder how I can know its charactics after connected?

actually the class of device value can be inside the inquiry cache and you will see it when a remote device requests a connection. However we don't really store these information together with the connection to make them available afterwards. Any patch is welcome.

Can you tell me exactly how I can obtain the class of device, including using which API or tool or which C file I need to check? I only know the sdp approach (code in sdptool.c) to check the services provided by device.

Quoted 9 lines

What I don't get is why you can't browse when the device is connected? Run "hcidump -X" as root and show it to us so we can see what happens.

Quoted 2 lines

My phone will be appeared in 3G conference next month, so I am very anxious about the bluetooth feature...

What does this mean? Is it good or is it bad? And btw my first name is Marcel and not Holtmann.

Sorry,Marcel. What I am anxious about is this task is very urgent, the bluetooth feature is very important(my boss says), if I can't complish...

Sorry for expressing my individual trifle in this list...

Chen

maintainer
#6 lore raw

Hi Chen,

Quoted 9 lines
Quoted 4 lines

actually the class of device value can be inside the inquiry cache and you will see it when a remote device requests a connection. However we don't really store these information together with the connection to make them available afterwards. Any patch is welcome.

Can you tell me exactly how I can obtain the class of device, including using which API or tool or which C file I need to check? I only know the sdp approach (code in sdptool.c) to check the services provided by device.

this must be done inside the kernel code and actually there is still the case where the master connects without a previous inquiry and so the class of device can be unknown.

Quoted 10 lines
Quoted 5 lines
Quoted 2 lines

My phone will be appeared in 3G conference next month, so I am very anxious about the bluetooth feature...

What does this mean? Is it good or is it bad? And btw my first name is Marcel and not Holtmann.

Sorry,Marcel. What I am anxious about is this task is very urgent, the bluetooth feature is very important(my boss says), if I can't complish...

Sorry for expressing my individual trifle in this list...

this is ok, but remember that your company wants to make money with a product and we don't ;)

Regards

Marcel

-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users

author
#7 lore raw
In reply to Marcel Holtmann

Oh I have made a mistake in my previous mail, the hcitool con 's output is right for when I press a button in headset, the headset is automatic connected to my BT device, the link_key is requested so I can avoid enter PIN code.

Chen

Quoted 28 lines · 在2004年10月22日的01:41,Marcel Holtmann写道:

Hi Chen,

Quoted 6 lines

Thanks very much for previous help from Holtman, and I happen a new problem when I try to find out whether a connected device is a headset.

It can't be browsed using sdptool in both connected mode and discovery mode(paring state), I wonder how I can know its charactics after connected?

actually the class of device value can be inside the inquiry cache and you will see it when a remote device requests a connection. However we don't really store these information together with the connection to make them available afterwards. Any patch is welcome.

What I don't get is why you can't browse when the device is connected? Run "hcidump -X" as root and show it to us so we can see what happens.

Quoted 2 lines

My phone will be appeared in 3G conference next month, so I am very anxious about the bluetooth feature...

What does this mean? Is it good or is it bad? And btw my first name is Marcel and not Holtmann.

Regards

Marcel