May I suggest that you repeat this with an Android phone instead.
1) Download the WICED Smart Explorer from Play Store
2) In hello_sensor.c, uncomment #define PASSKEY_PAIRING
3) Compile, download and run the app (remember to set switch 2 to OFF and press RESET button)
4) Use the Smart Explorer to scan and you will find "Hello"
5) Try to connect and you will be prompted to enter the passkey.
6) Try to enter a correct one and an incorrect one to see the difference
I'm using I-phone LightBlue.
LightBlue App can connect without entering passkey.
Did you have any additional findings to this issue?
I don't have an answer yet.
I checked the bleprofile configuration, but paring is failed when I enable security.
Can you share your configuration?
Thank you for keeping your eye on this issue.
What I'd like to know is
1. Is it possible that the PASSKEY is available while the peripheral and central are "LESMP_IO_CAP_DISP_NO_IO".
What you've talked looks like the actions between mobile app and peripheral.
2. In case of "impossible", what is the method of bonding my devices with others through security?
At least, I'd like to make unintended devices which does not have specific keys not paired or bonded with my board
I know there is whitelist which cares bd_addr, but I'd like to know if there is another method available.
Do the following changes in Hello_Sensor
void hello_sensor_smp_bond_result(LESMP_PARING_RESULT result)
ble_trace3("hello_sample, bond result %02x smpinfo addr type:%d emconninfo type:%d\n",
result, lesmp_pinfo->lesmpkeys_bondedInfo.adrType, emconninfo_getPeerAddrType());
// do some noise
if (result == LESMP_PAIRING_RESULT_BONDED)
// saving bd_addr in nvram
bda = (UINT8 *)emconninfo_getPeerPubAddr();
memcpy(hello_sensor_hostinfo.bdaddr, bda, sizeof(BD_ADDR));
hello_sensor_hostinfo.characteristic_client_configuration = 0;
hello_sensor_hostinfo.number_of_blinks = 0;
ble_trace2("Bond successful %08x%04x\n", (bda << 24) + (bda << 16) + (bda << 8) + bda, (bda << 8) + bda);
writtenbyte = bleprofile_WriteNVRAM(NVRAM_ID_HOST_LIST, sizeof(hello_sensor_hostinfo), (UINT8 *)&hello_sensor_hostinfo);
ble_trace1("NVRAM write:%04x\n", writtenbyte);
ble_trace1("\rdisconnecting...... %02x", result);
// 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);
And you should see for a different passkey set it would not connect.