Skip to contentSkip to conversation

How 'respond' in BlueZ to a PIN request ?

Bluez-devel Andrea Carlevato 2 participants 2 messages Sep 14, 2005 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

Hi to all,
if i set my usb dongle in authentication mode (hciconfig hci0 auth) and connect to my bluetooth phone, (hcitool cc BTADDR) the phone ask me for the pin of my pc, and after i ve entered correctly, the connection i created.

My question is: how can i control the same thing on my bluez pc ? If i do the same (hcitool cc BTADDR) to connect another pc instead of my phone no PIN is requested and create connection fails!

I need to know this beacause i need to write a simple program that listen for l2cap connection on a socket, GIVE THE PIN, and allows the connection to be estabilished.

Thanks a lot!

Andrea

maintainer
#1 lore raw

Hi Andrea,

Quoted 5 lines

if i set my usb dongle in authentication mode (hciconfig hci0 auth) and connect to my bluetooth phone, (hcitool cc BTADDR) the phone ask me for the pin of my pc, and after i ve entered correctly, the connection i created.

Quoted 8 lines

My question is: how can i control the same thing on my bluez pc ? If i do the same (hcitool cc BTADDR) to connect another pc instead of my phone no PIN is requested and create connection fails!

I need to know this beacause i need to write a simple program that listen for l2cap connection on a socket, GIVE THE PIN, and allows the connection to be estabilished.

if you talk about L2CAP then you don't use security mode 3, which is activated after "hciconfig hci0 auth". You should only do this when you really know what you are doing. The same applies to "hcitool cc ...", because this is a testing and should not be used at all.

The L2CAP has options to require authentication and encryption. You should look at the l2test code for an example.

Regards

Marcel

-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel