Hello-Sensor re-connection failure when security enabled.

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

cross mob
Anonymous
Not applicable

===

SDK: 2.1.

Tag: 920737.

app: hello-sensor.

===


Problem:

When enable hello_sensor_cfg's
encr_required = SECURITY_ENABLED | SECURITY_REQUEST

--> when phone button disconnection, device can not get plan_air_connection_down() from lower-layer

so the re-connection can not be successful.


but if

encr_required = 0

--> The disconnection from phone is ok and we can re-connect with device again.


it seems to be related with codes below,

    if (bleprofile_p_cfg->encr_required != 0)

    {

    if (emconninfo_deviceBonded())

    {

    ble_trace0("device bonded");

    }

    else

    {

    ble_trace0("device not bonded");

       lesmp_pinfo->pairingParam.AuthReq  |= LESMP_AUTH_FLAG_BONDING;

            lesmp_sendSecurityRequest();

    }

        return;

    }


so any other places go wrong??




0 Likes
1 Solution
Anonymous
Not applicable

Hi, J.T,

I re-tried the SDK 2.2 and the can not scan problem is ok now.

But for the security mechanism, still not workable in some android phone as described before.
Now we use another approach to do our SW requirement. It's ok now.

Thx.

View solution in original post

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

Did you always do a security request when you do a connection? Try doing this and see if it helps.

0 Likes
Anonymous
Not applicable

Hi, boont,

I use SDK2.1.1 version with default HelloSensor codes with security enabled, which means,

from every central connection attempt, slave will call the lesmp_sendSecurityRequest()
so it should be fine but after phone (with installed BLE APK) button disconnection, I can see
there is no dis-link message from lower-layer to app layer of device. So device is still in connection state.
This is why user can not make a connection again and in user site, phone displays dis-connected already.
Can u reproduce it?

if (bleprofile_p_cfg->encr_required != 0)

    {

    if (emconninfo_deviceBonded())

    {

    ble_trace0("device bonded");

    }

    else

    {

    ble_trace0("device not bonded");

       lesmp_pinfo->pairingParam.AuthReq  |= LESMP_AUTH_FLAG_BONDING;

            lesmp_sendSecurityRequest();

    }

        return;

    }

0 Likes

i am using a s4 installed with wiced smart explorer to talk to my hello sensor. i can always connect back to the sensor after a power reboot to the phone's bluetooth. how do you do a disconnect from your phone?

Anonymous
Not applicable

power- reboot of Bluetooth?

Hi boont,

I use a S3 and install free web apk of BLE4.0 scanner and
when phone button with disconnection (if device firmware enables with security)
and then phone button with connection again WITHOUT re-power the bluetooth.
The connection is failed always. It seems dont need to re-power the bluetooth,
only disconnect and then re-scan it but in my case, when phone rescan BLE device,
it can not find this device.

0 Likes
Anonymous
Not applicable

Leo Su,

Have you tried SDK 2.2.

Thanks

JT

0 Likes
Anonymous
Not applicable

Hi, J.T,

I re-tried the SDK 2.2 and the can not scan problem is ok now.

But for the security mechanism, still not workable in some android phone as described before.
Now we use another approach to do our SW requirement. It's ok now.

Thx.