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

NCS scan_adv example doesn't work on nrf52811

Hi All,

I tried NCS example scan_adv to test nrf52811 however it's stopped on bt_enable()

the log as:

[16:36:13:020] *** Booting Zephyr OS build v2.4.0-ncs1-1699-gcdc4c217fbd0 ***␍␊

[16:36:13:025] Starting Scanner/Advertiser Demo␍␊

[16:36:13:028] Bluetooth init failed (err -35)␍␊

[16:36:13:031] [00:00:00.008,666] <0x1b>[0m<inf> sdc_hci_driver: SoftDevice Controller build revision: ␍␊

[16:36:13:039] d4 43 b5 cf 63 22 e9 d4 ed 8a 24 d0 4c a1 f7 b1 |.C..c".. ..$.L...␍␊

[16:36:13:048] a4 26 85 75 |.&.u <0x1b>[0m␍␊

[16:36:13:058] [00:00:00.008,697] <0x1b>[1;31m<err> bt_hci_core: HCI driver open failed (-35)<0x1b>[0m␍␊

I verified nrf52840 it's working.

Is there any issue to run scan_adv on nrf52811 ?

BR,

Sam

  • Hi Hung,

    Thanks.

    BTW is there detail explaining on adv_type of scan callback type

    scan_cb(const bt_addr_le_t *addr, int8_t rssi, uint8_t adv_type,
    struct net_buf_simple *buf)

    I want to tell ADV/SCAN RESPONSE, 1M/CODED from the adv_type.

    BR,

    Sam

  • Hi Hung,

    BTW I tried to scan for only coded phy with

    static struct bt_le_scan_param m_scan_param = {
    .type = BT_LE_SCAN_TYPE_PASSIVE,
    .options = BT_LE_SCAN_OPT_CODED | BT_LE_SCAN_OPT_NO_1M,
    .interval = 0x0010,
    .window = 0x0010,
    };

    However the scan seems on obey the option. scan_cb still return 1M reports only.

    (adv_type 0/2/3 )

    BR,

    Sam

  • Hi Sam, 
    It's the following enum: 

    /** Advertising PDU types */
    enum {
    /** Scannable and connectable advertising. */
    BT_GAP_ADV_TYPE_ADV_IND = 0x00,
    /** Directed connectable advertising. */
    BT_GAP_ADV_TYPE_ADV_DIRECT_IND = 0x01,
    /** Non-connectable and scannable advertising. */
    BT_GAP_ADV_TYPE_ADV_SCAN_IND = 0x02,
    /** Non-connectable and non-scannable advertising. */
    BT_GAP_ADV_TYPE_ADV_NONCONN_IND = 0x03,
    /** Additional advertising data requested by an active scanner. */
    BT_GAP_ADV_TYPE_SCAN_RSP = 0x04,
    /** Extended advertising, see advertising properties. */
    BT_GAP_ADV_TYPE_EXT_ADV = 0x05,
    };

    Inside gap.h

    If it's CODED, the flag adv_type should be BT_GAP_ADV_TYPE_EXT_ADV , but you need to check the primary_phy&secondary_phy as well to check which exact PHY used. 
    It's inside the bt_le_scan_recv_info struct. 

Related