idf 5.2 的blecent 蓝牙主机无法收到SCAN_RSP

1375917982
Posts: 2
Joined: Tue Nov 08, 2022 8:33 am

idf 5.2 的blecent 蓝牙主机无法收到SCAN_RSP

Postby 1375917982 » Thu May 23, 2024 6:07 am

BLE Central cannot receive Scan response data
idf 5.2 的esp-idf\components\bt\host\nimble\nimble\apps\blecent 蓝牙主机无法收到SCAN_RSP
主动扫描和被动扫描模式,ESP32 蓝牙主机都无法收到Scan response data

Image

Code: Select all

static void
blecent_scan(void)
{
    uint8_t own_addr_type;
    struct ble_gap_disc_params disc_params;
    int rc;

    /* Figure out address to use while advertising (no privacy for now) */
    rc = ble_hs_id_infer_auto(0, &own_addr_type);
    if (rc != 0) {
        MODLOG_DFLT(ERROR, "error determining address type; rc=%d\n", rc);
        return;
    }

    /* Tell the controller to filter duplicates; we don't want to process
     * repeated advertisements from the same device.
     */
    disc_params.filter_duplicates = 1;

    /**
     * Perform a passive scan.  I.e., don't send follow-up scan requests to
     * each advertiser.
     */
    disc_params.passive = 0;

    /* Use defaults for the rest of the parameters. */
    disc_params.itvl = 0;
    disc_params.window = 0;
    disc_params.filter_policy = 0;
    disc_params.limited = 0;

    rc = ble_gap_disc(own_addr_type, BLE_HS_FOREVER, &disc_params,
                      blecent_gap_event, NULL);
    if (rc != 0) {
        MODLOG_DFLT(ERROR, "Error initiating GAP discovery procedure; rc=%d\n",
                    rc);
    }
}

Who is online

Users browsing this forum: Bing [Bot] and 44 guests