- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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).
Solved! Go to Solution.
- Labels:
-
Security
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The code that supports this scenario will be part of the next release WICED Smart SDK v2.2.2.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This does not solve the issue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The code that supports this scenario will be part of the next release WICED Smart SDK v2.2.2.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content