neil.young
Posts: 11
Joined: Tue Sep 02, 2008 11:38 pm

What is "Bonding"?

Tue Sep 02, 2008 11:44 pm

Hi,
newbie tries to make use of the BT SAP profile of the N95. Using "FindAndConnect" sample. Discovery - OK. Service-Selection: Returns after ~30 secs with "BT Connection could not be established" or so. MS BT stack below. First attemt to BOND (what ist BONDING?) pops up a box on my N95, asking me for a 16 digit password to choose (??). Give em one. Enter my phones PIN (??) into the box, click BOND. A box pops up on my phone, entering the PIN again, Successful. Hurray... But wait: Unbond (What is UNBOND??), entering a nonsens number into the app, click BOND, a box pops up on my phone, entering the same nonsense number - and --- successfull too... How that??? I thought, that at least the PIN is verified with the SIM and at least the GSM/3GPP authentication procedures will take place on the phone??
Where am I wrong? And - what is BOND?? And what is the 16 digit passcode good for?

TIA

Jonas
Posts: 2319
Joined: Mon Jan 09, 2006 2:20 pm
Location: Sweden

RE: What is "Bonding"?

Wed Sep 03, 2008 1:17 am

Bonding is part of the security protocol of bluetooth (note this is not a BlueTools specific feature).
The pin code is usually only four digits (don't know about any 16 digit password?) and ensures that no one can just access your phone in the subway and copy your files, or access the headset profile and listen in on your phone calls.

If bonding didn't exists, someone could just connect a bluetooth device to your phone and do just that. Now the bonding part kicks in and your phone will require you to enter a password. If you haven't requested the bonding yourself, this is the time to deny the bonding.

I hope this makes sense?

Regards,
Jonas

neil.young
Posts: 11
Joined: Tue Sep 02, 2008 11:38 pm

RE: What is "Bonding"?

Wed Sep 03, 2008 2:00 am

Hi Jonas,
thanks for your answer to my mostly stupid questions. Meanwhile I have a bit more insight, but didn't made it run up to now.

The bond code is 4 digit, indeed. But the attemtp to open the stream for the SIM access profile pops up with the 16 digits passcode box on the phone, which has to be filled with a "passcode provided by the car radio". Never mind, I don't have such a thing, but I guess, it doesn't matter, what I enter there. Just 16 digits.

But I still get the Connection failed exception...

Jonas
Posts: 2319
Joined: Mon Jan 09, 2006 2:20 pm
Location: Sweden

RE: What is "Bonding"?

Wed Sep 03, 2008 9:21 am

It is probably something specific to the SIM profile then, perhaps something to access the GSM or 3G network? It has nothing to do with bonding however. Since you are getting conection failed the code you're inputting is probably incorrect.

Regards,
Jonas

neil.young
Posts: 11
Joined: Tue Sep 02, 2008 11:38 pm

RE: What is "Bonding"?

Wed Sep 03, 2008 1:18 pm

It seems to be not a matter of inputting the wrong code, because I don't come that far.

This is the original sample code:

try
{
// Connect to service by reading its Stream
currentStream = currentService.Stream;
currentStream.BeginRead(m_buffer, 0, m_buffer.Length, new AsyncCallback(readCallback), currentStream);

...

the latter call excepts with

Stream not open.
Objektname: ServiceStream.

Discovery - OK, Service - Selection OK. But the BlueTools simply seem to not work correctly with SIM Access Profiles.

Jonas
Posts: 2319
Joined: Mon Jan 09, 2006 2:20 pm
Location: Sweden

RE: What is "Bonding"?

Wed Sep 03, 2008 1:22 pm

Possibly the SIM Access Profile requires an ACL type of link (think UDP in Internet).
BlueTools only support SCO links (think TCP in Internet).

Regards,
Jonas

neil.young
Posts: 11
Joined: Tue Sep 02, 2008 11:38 pm

RE: What is "Bonding"?

Wed Sep 03, 2008 2:50 pm

From the spec it is nothing special on top of RFCOMM.

Jonas
Posts: 2319
Joined: Mon Jan 09, 2006 2:20 pm
Location: Sweden

RE: What is "Bonding"?

Wed Sep 03, 2008 3:45 pm

Then I really don't know.

Regards,
Jonas

neil.young
Posts: 11
Joined: Tue Sep 02, 2008 11:38 pm

RE: What is "Bonding"?

Wed Sep 03, 2008 3:47 pm

Thanks for your assistance and patience.
Regards.

neil.young
Posts: 11
Joined: Tue Sep 02, 2008 11:38 pm

RE: What is "Bonding"?

Sat Oct 04, 2008 3:56 am

Just to let you know and to close this thread: The stack is absolutely capable of doing SAP. It was just a matter of the missing 128 bit encryption support, provided by my BT device. After I bought a D-LINK DBT 122 everything is fine.

Return to “BlueTools”