Ble_scan.h header file is not found while I`m working on the code below I`m searching for BLE scan code for nearby devices on PCA10040e board.

#include "nrf_sdh.h"
#include "nrf_sdh_ble.h"
#include "app_error.h"
#include "ble_scan.h"
#include "ble_gap.h"

#define APP_BLE_CONN_CFG_TAG 1 /**< A tag identifying the SoftDevice BLE configuration. */
#define APP_BLE_OBSERVER_PRIO 3 /**< Application's BLE observer priority. You shouldn't need to modify this value. */

#define SCAN_WINDOW 15000 /**< Scan window duration in milliseconds. */
#define SCAN_INTERVAL 12000 /**< Scan interval duration in milliseconds. */
#define SCAN_TIMEOUT 120000 /**< Scan timeout duration in milliseconds. */

#define SCAN_BUFFER_SIZE 10 /**< Maximum number of scan results to buffer. */

NRF_SDH_BLE_OBSERVER(m_ble_observer, APP_BLE_OBSERVER_PRIO, ble_scan_init, NULL);

static ble_scan_t m_scan;

static ble_gap_scan_params_t const m_scan_params =
{
.active = 1,
.interval = SCAN_INTERVAL,
.window = SCAN_WINDOW,
.timeout = SCAN_TIMEOUT,
.scan_phys = BLE_GAP_PHY_1MBPS,
.buffer = {SCAN_BUFFER_SIZE, 0},
};

/**@brief Scan event handler.
*
* @param[in] p_scan_evt Scan event.
*/
static void scan_evt_handler(scan_evt_t const * p_scan_evt)
{
switch (p_scan_evt->scan_evt_id)
{
case NRF_BLE_SCAN_EVT_CONNECTING_ERROR:
// Error while connecting to peer.
break;

case NRF_BLE_SCAN_EVT_SCAN_TIMEOUT:
// The scan has timed out.
break;

case NRF_BLE_SCAN_EVT_FILTER_MATCH:
{
// A device has been found that matches the filter criteria.
// Extract the advertising report from the event.
nrf_ble_scan_evt_filter_match_t * p_filter_match = &p_scan_evt->data.filter_match;
nrf_ble_scan_evt_filter_match_t filter_match = *p_filter_match;

// Extract the advertising data from the report.
ble_gap_evt_adv_report_t * p_adv_report = &filter_match.p_adv_report;

// Check if the found device is the desired device.
if (is_desired_device(p_adv_report))
{
// The desired device has been found.
// Extract the MAC address of the device.
ble_gap_addr_t gap_address = p_adv_report->peer_addr;

// Print the MAC address of the device.
printf("MAC address: %02X:%02X:%02X:%02X:%02X:%02X\n",
gap_address.addr[0], gap_address.addr[1], gap_address.addr[2],
gap_address.addr[3], gap_address.addr[4], gap_address.addr[5]);

// Print the RSSI value of the device.
printf("RSSI value: %d\n", p_adv_report->rssi);
}
break;
}
/**@brief Initialize the BLE scan module.
*/
void ble_scan_init(void)
{
ret_code_t err_code;

err_code = ble_scan_init(&m_scan, &m_scan_params, scan_evt_handler);
APP_ERROR_CHECK(err_code);
}

int main(void)
{
ret_code_t err_code = nrf_sdh_enable_request();
APP_ERROR_CHECK(err_code);

// Configure the BLE stack using the default settings.
// Fetch the start address of the application RAM.
uint32_t ram_start = 0;
err_code = nrf_sdh_ble_default_cfg_set(APP_BLE_CONN_CFG_TAG, &ram_start);
APP_ERROR_CHECK(err_code);

// Enable BLE stack.
err_code = nrf_sdh_ble_enable(&ram_start);
APP_ERROR_CHECK(err_code);

// Start BLE scanning.
err_code = ble_scan_start(&m_scan);
APP_ERROR_CHECK(err_code);

// Enter main loop.
for (;;)
{
// Wait for an event.
}
}   

Related