cancel
Showing results for 
Search instead for 
Did you mean: 

WICED Smart Bluetooth

MiTo_1583836
Contributor II

I reworked the Hello_Client and Hello_Sensor to enable the pairing with passkey. There is a defined at the top of the hello_sensor.c and hello_client.c : #define PASSKEY_PAIRING. This is used to turn ON this feature (over Just Work or OOB).

The client initiate a scan and does connect with the sensor. The sensor is in charge of initiating the security request calling: lesmp_sendSecurityRequest();

The passkey is set right after the call lesmp_setPairingParam() early during the xxx_create() for both the client and the sensor.

The pairing on the client side is set with: lesmp_setPairingParam() with LESMP_IO_CAP_DISP_KEYBOARD_ONLY. The client is also set with lesmp_setSMPRole(LESMP_ROLE_RESPONDERS);

The sensor lesmp_setPairingParam() is called with LESMP_IO_CAP_DISP_ONLY. So the pairing key is displayed on the sensor and entered on the client.

I am getting stuck at the beginning of the third phase of the pairing during the key distribution. I do see the exchange of pairing information and the authentication of the link (see SM_PAIRING_CONFIRM in the air capture attached to this post). After that I am getting stuck.


Also I have the feeling that I am not even getting that far if I remove the lesmp_setSMPRole(LESMP_ROLE_RESPONDERS) in the client code.

I need to understand why I cannot complete the pairing process/key exchanges at this stage of the game. Am I missing a call in the code?


The sample code of the sensor and the client is attached to this post.

Attached:

Sniff_Air_traffic_Capture_Pairing_not_completed: capture of the traffic between the Master and Slave.

Source code for the Master and Slave (.c/.h files).

0 Likes
1 Solution
MiTo_1583836
Contributor II

The code that supports this scenario will be part of the next release WICED Smart SDK v2.2.2.

View solution in original post

9 Replies
MichaelF_56
Moderator
Moderator

79rpm

We spoke with the developers today as promised and they asked for a little more time to look into this one.

vik86 arvinds victorz

0 Likes
MichaelF_56
Moderator
Moderator

I received the following from the developers with the understanding that the code below the else{} block will resolve the issue you reported.

void hello_sensor_smp_bond_result(LESMP_PARING_RESULT  result)
{
    ble_trace1("\rhello_sample, bond result %02x", result);

    // do some noise
    bleprofile_BUZBeep(bleprofile_p_cfg->buz_on_ms);

    if (result == LESMP_PAIRING_RESULT_BONDED)
    {
        // saving bd_addr in nvram
        UINT8 *bda;
        UINT8 writtenbyte;

        bda =(UINT8 *)emconninfo_getPeerAddr();

        memcpy(hello_sensor_hostinfo.bdaddr, bda, sizeof(BD_ADDR));
        hello_sensor_hostinfo.characteristic_client_configuration = 0;
        hello_sensor_hostinfo.number_of_blinks = 0;

        writtenbyte = bleprofile_WriteNVRAM(VS_BLE_HOST_LIST, sizeof(hello_sensor_hostinfo), (UINT8 *)&hello_sensor_hostinfo);
        ble_trace1("\rNVRAM write:%04x", writtenbyte);
    }
    else
    {
       // Pairing failed. So disconnect with remote user terminated connection (no need to say why?).
       blecm_disconnect(BT_ERROR_CODE_REMOTE_USER_TERMINATED_CONNECTION);    // IF this does not compile, try blecm_disconnect(0x13);
    }
}

Let us know if this works.

0 Likes
MiTo_1583836
Contributor II

This does not solve the issue.               

0 Likes
MichaelF_56
Moderator
Moderator

79rpm

Does vik86 fully understand the problem? He and arvinds developed this fix to eliminate what they thought was the issue based on the last concall.

In a paragraph, could you describe the fundamental problem to me again so that I can ask for more specific guidance from them.

I believe the intent is to have the slave initiate the pairing request correct?  As opposed to the master.

0 Likes
MiTo_1583836
Contributor II

As a short summary and based on our previous discussion we are trying to get the pairing process started by the peripheral instead of the central.I understand the current sample in the SDK does not cover this scenario and needs to be adjusted.

0 Likes
MichaelF_56
Moderator
Moderator

Correct.


Per our discussion yesterday, the Passkey mechanism on the part works and vik86 will re-write our Hello_Sensor and Hello_Client samples apps such that the pairing mechanism is swapped to recognize the role reversal that customer is looking to achieve.

0 Likes
Anonymous
Not applicable

Is there any updates to this issue ? I was redirected here by boont because I face a similar issue Re: hello_client pairing with passkey

0 Likes
MiTo_1583836
Contributor II

The code that supports this scenario will be part of the next release WICED Smart SDK v2.2.2.

View solution in original post