Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Disable Scan Req

Hi,

Where are scan requests sent? I'm trying to find the function that does this because I would like to disable it.

I only want to connect with a peripheral based strictly on its advertising data.  I do not want any scan requests sent.

Thanks,

Mia

Parents
  • FormerMember
    +1 FormerMember

    A scanner that sends scan requests is called an active scanner.

    ble_app_hrs_c, main.c:
    
    static void scan_start(void)
    {
      ...  
    
        m_scan_param.active   = 0; // Setting "active" to 0, will disable scan requests. 
        m_scan_param.interval = SCAN_INTERVAL;
        m_scan_param.window   = SCAN_WINDOW;
    
      ...
    }
    

     

    It is defined the following way:

    ble_gap.h
    
    /**@brief GAP scanning parameters. */
    typedef struct
    {
     ...
      uint8_t               active                 : 1; /**< If 1, perform active scanning by sending scan requests.
                                                             This parameter is ignored when used with @ref sd_ble_gap_connect. */
      ...
    } ble_gap_scan_params_t;

Reply
  • FormerMember
    +1 FormerMember

    A scanner that sends scan requests is called an active scanner.

    ble_app_hrs_c, main.c:
    
    static void scan_start(void)
    {
      ...  
    
        m_scan_param.active   = 0; // Setting "active" to 0, will disable scan requests. 
        m_scan_param.interval = SCAN_INTERVAL;
        m_scan_param.window   = SCAN_WINDOW;
    
      ...
    }
    

     

    It is defined the following way:

    ble_gap.h
    
    /**@brief GAP scanning parameters. */
    typedef struct
    {
     ...
      uint8_t               active                 : 1; /**< If 1, perform active scanning by sending scan requests.
                                                             This parameter is ignored when used with @ref sd_ble_gap_connect. */
      ...
    } ble_gap_scan_params_t;

Children
Related