Hello All,
Right now i am working on nRF52810 custom board. I use segger studio in windows 7. i used nRF52 SDK 15.2.0 .Right now i am trying to pairing for security purpose.
I am use just working method of pairing. i initialization of pairing as shown below,
sec_param.bond = 1;
sec_param.mitm = 0;
sec_param.lesc = 0;
sec_param.keypress =0;
sec_param.io_caps = BLE_GAP_IO_CAPS_NONE;
sec_param.oob = 0;
sec_param.min_key_size = 7;
sec_param.max_key_size = 16;
sec_param.kdist_own.enc = 1;
sec_param.kdist_own.id = 1;
sec_param.kdist_peer.enc = 1;
sec_param.kdist_peer.id = 1;
I use just work because in custom board not use display or keyboard.So use this characteristic BLE_GAP_IO_CAPS_NONE. I am trying to do simple pairing with device(mobile) and done successfully pairing and bound is also create without any giving acknowledged from custom board.
My problem is that i wouldn't to do pairing successfully without giving any acknowledged from custom board and as a acknowledged i use switch. I am trying to do this type of pairing when i press switch and than got pairing successfully and than successfully connect device with BLE. And also by default pairing timeout interval is 30 second so in that time interval i press switched.And in this time interval i am not press switch. so after that time interval advertising is start and disconnect event is create.
How can i implement this pairing security.???
I trying to add while loop in PM_EVT_CONN_SEC_START this event as shown below,
case PM_EVT_CONN_SEC_START:
NRF_LOG_INFO("PM EVT CONN SEC START");
while(nrf_gpio_pin_read(switch_pin) && pairing_sample <28)
{
nrf_delay_ms(1000);
pairing_sample++;
if(pairing_sample >29)
{
pairing_sample = 0;
advertising_start(false);
break;
}
}
break;
First case: in this use infinite while loop so when i press switch after that while loop is break and got successfully pairing and connection.
Second case: after 30 second i press switch then in the device popup menu open with option of pair or cancel.
Third case: i am not press switch within time interval(30 second) after 30 second advertising not start and also device not disconnect with BLE.
So please give me suggestion how can i implement paring security as like i mention above..
Have A Nice Day!!!
Thanks & Regards,
Urvisha Andani