/* Function for disabling the use of whitelist for scanning.  */
static void whitelist_disable(void)
/* Function for disabling the use of whitelist for scanning.  */
static void whitelist_disable(void)
{
    uint32_t err_code;
    if ((m_scan_mode == BLE_WHITELIST_SCAN) && !m_whitelist_temporarily_disabled)
    {
        m_whitelist_temporarily_disabled = true;
        err_code = sd_ble_gap_scan_stop();
        if (err_code == NRF_SUCCESS)
        {
            scan_start();
        }
        else if (err_code != NRF_ERROR_INVALID_STATE)
        {
            APP_ERROR_CHECK(err_code);
        }
    }
    m_whitelist_temporarily_disabled = true;
}