public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [Bluez-users] Connecting to a two-way headset
@ 2008-02-17 17:07 mountain rides
  2008-02-18  2:38 ` Leszek Koltunski
  2008-02-18 15:25 ` Guillaume Bedot
  0 siblings, 2 replies; 6+ messages in thread
From: mountain rides @ 2008-02-17 17:07 UTC (permalink / raw)
  To: bluez-users


Hi,

Apologies if I'm asking a repeated question, but my search just now didn't =
pick up any answers.

I'm trying to get a speaker-and-microphone headset working.

More exactly . . .

I have a new Sony Ericsson HBH-PV702 Bluetooth headset - that is, a headset=
 not with just speakers, but with both a speaker and microphone.  =


I also have a Dell Inspiron 6400 with Bluetooth built-in, on which I'm runn=
ing Debian Lenny (Linux 2.6.22-3-amd64 #1 SMP Sun Nov 4 18:18:09 UTC 2007 x=
86_64 GNU/Linux).

I would like to use the headset with Twinkle, which is also installed and o=
ften used (with a run-of-the-mill wired headset).

I have several bluetooth-related Debian packages installed, for example: "b=
luetooth" (3.24-1+b1); "bluetooth-alsa" (0.5cvs20070327-1); "bluetooth-audi=
o" (3.4-1+b1); "bluez-gnome" (0.13-1); "bluez-utils" (3.24-1+b1); "gnome-bl=
uetooth" (0.9.1-1); "gnome-vfs-obexftp" (0.4-1); "libbluetooth2" (3.24-1); =
"libbtctl4" (0.9.0-2); libgnomebt0 (0.9.1-1); "libsbc0" (0.0cvs20070728-1);=
 etc.  (This, according to Synaptic.)

>>From the headset's user's manual, I have learned that to connect it to anot=
her device, I must first "prepare" the headset - which I assume means put i=
t into "pairing" mode by pressing both volume-up and volume-down buttons si=
multaneously until the LED alternates red/green.

I learned from various sources on the net, that to connect my computer to t=
he headset, as the root user I must run the command:

hcitool scan

to discern the headset's (what-I'm-calling-"MAC") address:

Scanning ...
	00:1C:A4:20:CE:BE	HBH-PV702

And, once I have that address, I can use it with the hcitool cc command to =
connect to the headset

hcitool cc 00:1C:A4:20:CE:BE

The response to which in /var/log/syslog is

22:45:56 NetworkManager:  [1202852568.559130] nm_hal_device_added(): New de=
vice added (hal udi is '/org/freedesktop/Hal/devices/bluetooth_acl_1ca420ce=
be'). =

22:45:56 hcid[3320]: link_key_request (sba=3D00:16:CF:CF:09:16, dba=3D00:1C=
:A4:20:CE:BE)
22:45:57 NetworkManager:  [1202852571.034919] nm_hal_device_removed(): Devi=
ce removed (hal udi is '/org/freedesktop/Hal/devices/bluetooth_acl_1ca420ce=
be'). =


So my question is:

Is this right?  (It seems strange to me that the device would be removed on=
e second after it has been added.) =


If so, what would be the next step towards using the headset?  If not, how =
can I make it what it should be?

Or am I going about this completely the wrong way?

In case it helps to answer those questions, I'll provide a couple other thi=
ngs I've noticed:

I have a what is called a "Bluetooth Applet" in what I call my desktop's ta=
skbar.  When I right-click on it and select "Browse Devices", I get a one-i=
tem list of devices: "HBH-PV702 Headset".  The first time I ran

hcitool info 00:1C:A4:20:CE:BE

I was prompted by a graphical (rather than command-line) prompt (seemingly =
from the applet) saying "Pairing request for device: HBH-PV702 (00:1C:A4:20=
:CE:BE) Enter passkey for authentication:"

I entered "0000" (as mentioned in the headset's user's manual) and clicked =
the prompt's "OK" button, and the following was then printed in the command=
-prompt window where I had entered the hcitool info command:

BD Address:  00:1C:A4:20:CE:BE
LMP Version: 1.2 (0x2) LMP Subversion: 0x73b
Manufacturer: Cambridge Silicon Radio (10)
Features: 0xfc 0xfe 0x0f 0x00 0x08 0x08 0x00 0x00
	    =

	     =

	     =

	   =

	  =


Moreover, a padlock-icon also appeared in the applet's device-list between =
"HBH-PV702" and "Headset".  What this padlock means . . .  I have no idea.

But that passkey prompt was a one-time-only phenomenon.  Every subsequent h=
citool info command returns the same response in the command-prompt window =
- with no further prompt for a "passkey".  And the padlock remains.

I get the impression I'm way off track.


_________________________________________________________________
Climb to the top of the charts!=A0Play the word scramble challenge with sta=
r power.
http://club.live.com/star_shuffle.aspx?icid=3Dstarshuffle_wlmailtextlink_jan
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Bluez-users] Connecting to a two-way headset
  2008-02-17 17:07 [Bluez-users] Connecting to a two-way headset mountain rides
@ 2008-02-18  2:38 ` Leszek Koltunski
  2008-02-18 15:25 ` Guillaume Bedot
  1 sibling, 0 replies; 6+ messages in thread
From: Leszek Koltunski @ 2008-02-18  2:38 UTC (permalink / raw)
  To: BlueZ users




> I have several bluetooth-related Debian packages installed, for 
> example: "bluetooth" (3.24-1+b1); "bluetooth-alsa" (0.5cvs20070327-1); 
> "bluetooth-audio" (3.4-1+b1);  "bluez-gnome" (0.13-1); "bluez-utils"
> (3.24-1+b1); "gnome-bluetooth" (0.9.1-1); "gnome-vfs-obexftp" (0.4-1); 
> "libbluetooth2" (3.24-1); "libbtctl4" (0.9.0-2); libgnomebt0 (0.9.1-1); 
> "libsbc0" (0.0cvs20070728-1); etc.  (This, according to Synaptic.)

You have a strange mixture of packages. If all you're trying to do 
(bluetooth-wise) is use your bt headset, those are all the packages you 
need:

- bluez-gnome
- bluez-utils
- bluez-audio 
- libbluetooth2

'bluetooth' is just a metapackage (empty package that pulls in all 
bluetooth-related things ) bluetooth-alsa is a part of an older project, 
not related to this ML. 'bluetooth-audio' - ditto. gnome-bluetooth - I 
have no idea. gnome-vfs-obexftp - that's for browsing remote filesystems 
over bluetooth. libbtctl4, libgnomebt0, libsbc0 - obsolete libraries


> From the headset's user's manual, I have learned that to connect it to 
>another device, I must first "prepare" the headset - which I assume 
> means put it into "pairing" mode by pressing both volume-up and 
> volume-down buttons simultaneously until the LED alternates red/green.
>
> I learned from various sources on the net, that to connect my computer 
> to the headset, as the root user I must run the command:
>
> hcitool scan
>
> to discern the headset's (what-I'm-calling-"MAC") address:
>
> Scanning ...
> 	00:1C:A4:20:CE:BE	HBH-PV702
>
> And, once I have that address, I can use it with the hcitool cc command 
> to connect to the headset
>
> hcitool cc 00:1C:A4:20:CE:BE
>

No, that's not true. Since you're already paired with the Headset, all you 
need to do now is start playing music :) ( and possibly switch the audio 
service on ) 
Follow http://wiki.bluez.org/wiki/HOWTO/AudioDevices

> I have a what is called a "Bluetooth Applet" in what I call my 
> desktop's taskbar.  When I right-click on it and select "Browse 
Devices", I get a one-item list of devices: "HBH-PV702 Headset".

Cool! that means you're paired already. No need to do any 'hcitool scan - 
hcitool cc' magic anymore.

The first time I ran
>
> hcitool info 00:1C:A4:20:CE:BE
>
> I was prompted by a graphical (rather than command-line) prompt 
> (seemingly from the applet) saying "Pairing request for device:
> HBH-PV702 (00:1C:A4:20:CE:BE) Enter passkey for authentication:"
>
> I entered "0000" (as mentioned in the headset's user's manual) and 
> clicked the prompt's "OK" button, and the following was then
> printed in the command-prompt window where I had entered the hcitool 
> info command:

That was the pairing process. As you say, a one-time phenomenon.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Bluez-users] Connecting to a two-way headset
@ 2008-02-18 11:45 Peter Wurmsdobler
  2008-02-19  2:49 ` Leszek Koltunski
  2008-02-19 20:26 ` Stefan Seyfried
  0 siblings, 2 replies; 6+ messages in thread
From: Peter Wurmsdobler @ 2008-02-18 11:45 UTC (permalink / raw)
  To: BlueZ users

Hello,

 >> I was prompted by a graphical (rather than command-line) prompt
 >> (seemingly from the applet) saying "Pairing request for device:
 >> HBH-PV702 (00:1C:A4:20:CE:BE) Enter passkey for authentication:"
How is this "BlueTooth Applet" actually triggered such that it prompts 
the user? What does it do (what code should I look in to understand)? 
How would I replace what the Applet does by something else in an 
embedded application, i.e. without gnome and kde?

It is perhaps difficult not only for me to accept working bluez 
components without understanding the underlying mechanisms.

Regards,
peter


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Bluez-users] Connecting to a two-way headset
  2008-02-17 17:07 [Bluez-users] Connecting to a two-way headset mountain rides
  2008-02-18  2:38 ` Leszek Koltunski
@ 2008-02-18 15:25 ` Guillaume Bedot
  1 sibling, 0 replies; 6+ messages in thread
From: Guillaume Bedot @ 2008-02-18 15:25 UTC (permalink / raw)
  To: BlueZ users

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

Hello,

Le dimanche 17 février 2008 à 17:07 +0000, mountain rides a écrit :
> Hi,
> 
> Apologies if I'm asking a repeated question, but my search just now didn't pick up any answers.
> 
> I'm trying to get a speaker-and-microphone headset working.
> 
> More exactly . . .
> 
> I have a new Sony Ericsson HBH-PV702 Bluetooth headset - that is, a headset not with just speakers, but with both a speaker and microphone.  
> 
> I also have a Dell Inspiron 6400 with Bluetooth built-in

You're mixing a bluetooth 2.0 chip and a bluetooth 1.2 headset, you may
need, in addition of wise suggestions from Leszek, to use this kernel
patch.

Regards,

Guillaume B.


[-- Attachment #2: also-accept-sco-links-v2.patch --]
[-- Type: text/x-patch, Size: 542 bytes --]

--- net/bluetooth/hci_event.c.orig	2008-02-18 14:02:20.000000000 +0100
+++ net/bluetooth/hci_event.c	2008-02-18 15:19:04.000000000 +0100
@@ -1313,8 +1313,15 @@
 	hci_dev_lock(hdev);
 
 	conn = hci_conn_hash_lookup_ba(hdev, ev->link_type, &ev->bdaddr);
-	if (!conn)
-		goto unlock;
+	if (!conn) {
+		if (ev->link_type==SCO_LINK) {
+			conn = hci_conn_hash_lookup_ba(hdev, ESCO_LINK, &ev->bdaddr);
+			if (!conn)
+				goto unlock;
+			else
+				conn->type=SCO_LINK;
+			}
+	}
 
 	if (!ev->status) {
 		conn->handle = __le16_to_cpu(ev->handle);

[-- Attachment #3: Type: text/plain, Size: 228 bytes --]

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

[-- Attachment #4: Type: text/plain, Size: 164 bytes --]

_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Bluez-users] Connecting to a two-way headset
  2008-02-18 11:45 Peter Wurmsdobler
@ 2008-02-19  2:49 ` Leszek Koltunski
  2008-02-19 20:26 ` Stefan Seyfried
  1 sibling, 0 replies; 6+ messages in thread
From: Leszek Koltunski @ 2008-02-19  2:49 UTC (permalink / raw)
  To: BlueZ users



On Mon, 18 Feb 2008, Peter Wurmsdobler wrote:

> It is perhaps difficult not only for me to accept working bluez
> components without understanding the underlying mechanisms.

I second Peter here. We really need a 'big picture' document.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Bluez-users] Connecting to a two-way headset
  2008-02-18 11:45 Peter Wurmsdobler
  2008-02-19  2:49 ` Leszek Koltunski
@ 2008-02-19 20:26 ` Stefan Seyfried
  1 sibling, 0 replies; 6+ messages in thread
From: Stefan Seyfried @ 2008-02-19 20:26 UTC (permalink / raw)
  To: BlueZ users

Peter Wurmsdobler schrieb:
> Hello,
> =

>  >> I was prompted by a graphical (rather than command-line) prompt
>  >> (seemingly from the applet) saying "Pairing request for device:
>  >> HBH-PV702 (00:1C:A4:20:CE:BE) Enter passkey for authentication:"
> How is this "BlueTooth Applet" actually triggered such that it prompts =

> the user? What does it do (what code should I look in to understand)? =

> How would I replace what the Applet does by something else in an =

> embedded application, i.e. without gnome and kde?

I'll try to provide a little piece of the big picture here. Beware: i am not
an expert on the matter and it might not be totally accurate, but it should=
 be
mostly correct.

The applet is acting as a "passkey-agent". To do this, it registers itself =
as
one at the hcid (via DBus).
If hcid now detects that it needs a passkey, it asks the registered passkey
agent for the passkey (via a DBus signal), the passkey-agent then asks the
user and provides the passkey to hcid (again via DBus).
hcid then uses the passkey to generate a link key, which is stored on the d=
isk
and later used for subsequent connections to the same device.
If there is no passkey agent registered at the time the passkey is needed,
access is denied.

Question that popped up, but that i can't answer offhand:
- can there be more than one passkey agent at a time? (not sure, but why no=
t?)
- where can i find a sample implementation? (answer: in passkey-agent.c)

> It is perhaps difficult not only for me to accept working bluez =

> components without understanding the underlying mechanisms.

This is why it is a good idea to put the "Big Picture Document" together :-)

Thanks,
-- =

Stefan Seyfried
R&D Team Mobile Devices            |              "Any ideas, John?"
SUSE LINUX Products GmbH, N=FCrnberg | "Well, surrounding them's out."

This footer brought to you by insane German lawmakers:
SUSE Linux Products GmbH, GF: Markus Rex, HRB 16746 (AG N=FCrnberg)

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-02-19 20:26 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-17 17:07 [Bluez-users] Connecting to a two-way headset mountain rides
2008-02-18  2:38 ` Leszek Koltunski
2008-02-18 15:25 ` Guillaume Bedot
  -- strict thread matches above, loose matches on Subject: below --
2008-02-18 11:45 Peter Wurmsdobler
2008-02-19  2:49 ` Leszek Koltunski
2008-02-19 20:26 ` Stefan Seyfried

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox