hello_client bond result always 1

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

Hello,

I have a hello_client application with some sensors and a smartphone.

The sensors can connect with bonding without a problem,

but if I connect with a smartphone, I always get as result 1 (I think this is LESMP_PAIRING_RESULT_TIMEOUT).

Somebody a Idea how I could fix this?

0 Likes
1 Solution
JaeyoungY_71
Employee
Employee
First comment on KBA 25 solutions authored 10 solutions authored

Hi Matthias,

Please add the code lesmp_setSMPRole(LESMP_ROLE_RESPONDERS); in the following line to solve this issue and connect with a smartphone.

blecen_Create();

//Add the following line

lesmp_setSMPRole(LESMP_ROLE_RESPONDERS);

Also, in the settings of your smartphone check if the device is already showing on the list. This will cause a problem as it will not attempt to pair again. You need to "forget the device" for hello_client and attempt a fresh pair. For instance, in an iOS device go to Settings->Bluetooth->My devices and select the information for the hello_client device->select"Forget This Device". Then using LightBlue when you select the hello_client device it will pop up the option to pair or not. Once you click pair the bonding should go through successfully.

Thanks,

Jaeyoung

View solution in original post

15 Replies
BoonT_56
Employee
Employee
500 likes received 250 likes received 100 likes received

Correct me if I didn't get you right but I was checking hello_client.c and the below stated that it should return 1 for successful

bonding. I couldn't locate "LESMP_PAIRING_RESULT_TIMEOUT".

if(result == LESMP_PAIRING_RESULT_BONDED)

    {

    // if bonding is successful register with the server to receive notification

    UINT16 u16 = 1;

        bleprofile_sendWriteReq(HANDLE_HELLO_SENSOR_CLIENT_CONFIGURATION_DESCRIPTOR, (UINT8 *)&u16, 2);

    }

0 Likes
Anonymous
Not applicable

Hi boont,

in lesmp.h:

typedef enum

{

   LESMP_PAIRING_RESULT_FAILED,

   LESMP_PAIRING_RESULT_TIMEOUT,

   LESMP_PAIRING_RESULT_SUCCESS,   // this does not include bonding.

   LESMP_PAIRING_RESULT_BONDED    // this implies pairing succes.

} LESMP_PARING_RESULT;

So timeout should be 1 and bonded should be 3.

0 Likes

Can you provide more details on this scenario? It's not clear what  steps would be to reproduce this. Which smartphone and OS for example. Can you describe the procedure? Do you have an air trace or HCI trace from the smartphone?

0 Likes
Anonymous
Not applicable

Hi cgariss

the error occurred while connecting other hello_sensors to my client.

At the moment I can't reproduce the error. Now I connect 4 sensors at the same time but never had this again.

But I get disc_reason 3e sometimes. Which means CONNECTION FAILED TO BE ESTABLISHED.

Could this be a problem?

How could I fix this?

0 Likes

HI, this may or may not be a problem f it is only occasional in that there could be outside factors like interference causing a connection failure. It's difficult to tell without an over the air trace from a bluetooth sniffer. Is it possible for you to try testing maybe one sensor, see if the issue is reproducible, add the next sensor, test again etc.... to see if there is a way you can repeatably cause the issue?

Best regards,

Gregg

0 Likes
Anonymous
Not applicable

Hi Gregg,

Sorry, I have no sniffer here.

I'll receive some devices I think next week. So I will try with different devices.

0 Likes
Anonymous
Not applicable

Hi cgariss

I have tested now with two sensors and also one TAG board (BCM920737TAG). I also tested with two phones (both with Android, one with 4.4.2, the other with 5.1.1).

Always with the same result: bonding always failed.

I removed most parts of my application, so I could send it to you. Perhaps you could check it?

0 Likes

Hi Matthias, can you post a link to the code?

Gregg

0 Likes

You can also send it to the admin alias I monitor (communities-list@broadcom.com) and I will make sure it gets to cgariss

Can you specify which sensors you are connecting to the phone?

0 Likes
Anonymous
Not applicable

As hardware we use the BCM920736S (the module), but the Software I sent is running on the TAG-Board with the same result.

The smartphone should just edit some settings on the board and perhaps read current measured values.

0 Likes

OK. I'll try to reproduce the scenario.

0 Likes

jaruhl

I forwarded the code you sent me to cgarissboont​ and jamesle1

0 Likes
JaeyoungY_71
Employee
Employee
First comment on KBA 25 solutions authored 10 solutions authored

Hi Matthias,

Please add the code lesmp_setSMPRole(LESMP_ROLE_RESPONDERS); in the following line to solve this issue and connect with a smartphone.

blecen_Create();

//Add the following line

lesmp_setSMPRole(LESMP_ROLE_RESPONDERS);

Also, in the settings of your smartphone check if the device is already showing on the list. This will cause a problem as it will not attempt to pair again. You need to "forget the device" for hello_client and attempt a fresh pair. For instance, in an iOS device go to Settings->Bluetooth->My devices and select the information for the hello_client device->select"Forget This Device". Then using LightBlue when you select the hello_client device it will pop up the option to pair or not. Once you click pair the bonding should go through successfully.

Thanks,

Jaeyoung

Anonymous
Not applicable

Hi Jaeyoung,

Seems to work now.

Thanks a lot.