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

Dose nRF52810 support Non connectable Scannable advertising?

Hello,

I am using custom board with nRF52810 (QCAA, QFN32), SDK14.2, and softdevice S112 v5.1.0/S132 v 51.10 according to the compatability matrix. I am programing the board to advertise as Non connectable - Scannable (BLE_GAP_ADV_TYPE_ADV_SCAN_IND). That is it would send advertising packet, then wait to receive scanning request from the observer, and then send the scan response to the observer.

It sends the advertising packet OK (I can see the data via observer UART), but it never sees the scan-req from the observer, and ble event BLE_GAP_EVT_SCAN_REQ_REPORT is never trigger.

I have tested the same design custom board that is built with nRF52832 and programmed with the same code and software, and there is no problem what ever. Packet sniffer also shows the scan request from the observer.

My question is "does nRF52810 support such a role of advertising (Non connectable - Scannable)?" If it does please give me advice and suggestions.

Regards
krirk

  • In SDK 15.3.0, The available advertising types are in ble_gap.h:

    /**@defgroup BLE_GAP_ADV_TYPES GAP Advertising types
     *
     * Advertising types defined in Bluetooth Core Specification v5.0, Vol 6, Part B, Section 4.4.2.
     *
     * The maximum advertising data length is defined by @ref BLE_GAP_ADV_SET_DATA_SIZE_MAX.
     * The maximum supported data length for an extended advertiser is defined by
     * @ref BLE_GAP_ADV_SET_DATA_SIZE_EXTENDED_MAX_SUPPORTED
     * Note that some of the advertising types do not support advertising data. Non-scannable types do not support
     * scan response data.
     *
     * @{ */
    #define BLE_GAP_ADV_TYPE_CONNECTABLE_SCANNABLE_UNDIRECTED                   0x01   /**< Connectable and scannable undirected
                                                                                            advertising events. */
    #define BLE_GAP_ADV_TYPE_CONNECTABLE_NONSCANNABLE_DIRECTED_HIGH_DUTY_CYCLE  0x02   /**< Connectable non-scannable directed advertising
                                                                                            events. Advertising interval is less that 3.75 ms.
                                                                                            Use this type for fast reconnections.
                                                                                            @note Advertising data is not supported. */
    #define BLE_GAP_ADV_TYPE_CONNECTABLE_NONSCANNABLE_DIRECTED                  0x03   /**< Connectable non-scannable directed advertising
                                                                                            events.
                                                                                            @note Advertising data is not supported. */
    #define BLE_GAP_ADV_TYPE_NONCONNECTABLE_SCANNABLE_UNDIRECTED                0x04   /**< Non-connectable scannable undirected
                                                                                            advertising events. */
    #define BLE_GAP_ADV_TYPE_NONCONNECTABLE_NONSCANNABLE_UNDIRECTED             0x05   /**< Non-connectable non-scannable undirected
                                                                                            advertising events. */
    #define BLE_GAP_ADV_TYPE_EXTENDED_CONNECTABLE_NONSCANNABLE_UNDIRECTED       0x06   /**< Connectable non-scannable undirected advertising
                                                                                            events using extended advertising PDUs. */
    #define BLE_GAP_ADV_TYPE_EXTENDED_CONNECTABLE_NONSCANNABLE_DIRECTED         0x07   /**< Connectable non-scannable directed advertising
                                                                                            events using extended advertising PDUs. */
    #define BLE_GAP_ADV_TYPE_EXTENDED_NONCONNECTABLE_SCANNABLE_UNDIRECTED       0x08   /**< Non-connectable scannable undirected advertising
                                                                                            events using extended advertising PDUs.
                                                                                            @note Only scan response data is supported. */
    #define BLE_GAP_ADV_TYPE_EXTENDED_NONCONNECTABLE_SCANNABLE_DIRECTED         0x09   /**< Non-connectable scannable directed advertising
                                                                                            events using extended advertising PDUs.
                                                                                            @note Only scan response data is supported. */
    #define BLE_GAP_ADV_TYPE_EXTENDED_NONCONNECTABLE_NONSCANNABLE_UNDIRECTED    0x0A   /**< Non-connectable non-scannable undirected advertising
                                                                                            events using extended advertising PDUs. */
    #define BLE_GAP_ADV_TYPE_EXTENDED_NONCONNECTABLE_NONSCANNABLE_DIRECTED      0x0B   /**< Non-connectable non-scannable directed advertising
                                                                                            events using extended advertising PDUs. */
    /**@} */
    

    But the 'Advertising' module in the SDK does not allow non-connectable advertising - you have to do it "manually":

    https://devzone.nordicsemi.com/f/nordic-q-a/47391/sdk-15-3-0-restart-non-connectable-advertising-after-timeout/188008#188008

    EDIT

    Sorry - missed your SDK version!

    This is totally different in earlier SDK versions - may not be applicable to your version, 14.2

  • Hi,

    How does your advertising_init() function look like ? Do you place any data in the srdata field?

    In ble_app_uart example we put the UUID in the srdata like this:

    static void advertising_init(void)
    {
        uint32_t               err_code;
        ble_advertising_init_t init;
    
        memset(&init, 0, sizeof(init));
    
        init.advdata.name_type          = BLE_ADVDATA_FULL_NAME;
        init.advdata.include_appearance = false;
        init.advdata.flags              = BLE_GAP_ADV_FLAGS_LE_ONLY_LIMITED_DISC_MODE;
    
        init.srdata.uuids_complete.uuid_cnt = sizeof(m_adv_uuids) / sizeof(m_adv_uuids[0]);
        init.srdata.uuids_complete.p_uuids  = m_adv_uuids;
    
        init.config.ble_adv_fast_enabled  = true;
        init.config.ble_adv_fast_interval = APP_ADV_INTERVAL;
        init.config.ble_adv_fast_timeout  = APP_ADV_TIMEOUT_IN_SECONDS;
    
        init.evt_handler = on_adv_evt;
    
        err_code = ble_advertising_init(&m_advertising, &init);
        APP_ERROR_CHECK(err_code);
    
        ble_advertising_conn_cfg_tag_set(&m_advertising, APP_BLE_CONN_CFG_TAG);
    }

    If you have data in srdata and doing scannable advertising, the SD will respond with the srdata to the central. You will not automatically get the event BLE_GAP_EVT_SCAN_REQ_REPORT when this happens, this is something that you need to explicitly enable, for v5.1.0, with sd_ble_opt_set(). You can e.g. put this at the end of advertising_init() function:

    ble_opt_t ble_options;
    memset(&ble_options, 0, sizeof(ble_options));
    ble_options.gap_opt.scan_req_report.enable = 1;
    err_code = sd_ble_opt_set(BLE_GAP_OPT_SCAN_REQ_REPORT, &ble_options);
    APP_ERROR_CHECK(err_code);

  • Hi,

    Many thanks to both of you. I have migrated my code to SDK15.3, and it is working as intended now.

    Regards

    krirk 

  • it is working

    Excellent! Now please verify the answer:

Related