This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Manage wrong passkey

Hi, I am try to manage situation when a wrong PIN code is provided from Master control Panel.

Using an NRF51822 with S110 I receive this code:

BLE_GAP_SEC_STATUS_CONFIRM_VALUE

wich is what I espected, but if I try to send a disconnection :

case BLE_GAP_EVT_AUTH_STATUS:
        
        m_auth_status = p_ble_evt->evt.gap_evt.params.auth_status;
					
        if(m_auth_status.auth_status == BLE_GAP_SEC_STATUS_CONFIRM_VALUE){
		   err_code = sd_ble_gap_disconnect(m_conn_handle , BLE_HCI_LOCAL_HOST_TERMINATED_CONNECTION);
					}
    
        break;

I receive this error: NRF_ERROR_INVALID_STATE

So my question is how to behave in case of wrong PIN code received.

Thanks

Parents Reply Children
No Data
Related