/* Command response callback function for sd_ble_gap_sec_params_reply BLE command. 
Callback for decoding the command response return code. */
static uint32_t gap_sec_params_reply_rsp_dec(const uint8_t *p_buffer, uint16_t length)
/* Command response callback function for sd_ble_gap_sec_params_reply BLE command. 
Callback for decoding the command response return code. */
static uint32_t gap_sec_params_reply_rsp_dec(const uint8_t *p_buffer, uint16_t length)
{
    uint32_t result_code   = 0;
    uint32_t err_code = ble_gap_sec_params_reply_rsp_dec(p_buffer, length,
                            m_output_params.gap_sec_params_reply_out_params.p_sec_keyset, &result_code);
    APP_ERROR_CHECK(err_code);
    if (result_code)
    {
        err_code = app_ble_gap_sec_context_destroy(m_output_params.gap_sec_params_reply_out_params.conn_handle);
        SER_ASSERT(err_code == NRF_SUCCESS, err_code);
    }
    return result_code;
}