BT SCAN FILTER FAILED

52832 ncs2.5.1 BT SCAN UUID FILTER FAILED(

#define BT_UUID_SELF_VAL \
    BT_UUID_128_ENCODE(0xd6ac0003, 0x8de3, 0xa9ec, 0x1fbd, 0xd623ede12a82)

    // (0x822ae1ed, 0x23d6, 0xbd1f, 0xeca9, 0xe38d0300acd6)
   

#define BT_UUID_SELF BT_UUID_DECLARE_128(BT_UUID_SELF_VAL)

) 

static void scan_init(void)
{
    int err;

    struct bt_scan_init_param param = {
        .connect_if_match = 1
    };

    bt_scan_init(&param);
    bt_scan_cb_register(&scan_cb);

    err = bt_scan_filter_add(BT_SCAN_FILTER_TYPE_UUID, BT_UUID_SELF);
    if (err) {
        printk("Scanning filters cannot be set (err %d)\n", err);
    }

    err = bt_scan_filter_enable(BT_SCAN_UUID_FILTER, false);
    if (err) {
        printk("Filters cannot be turned on (err %d)\n", err);
    }
    printk("scan_init Success \n");
   
   
}
void start_scan(void)
{
    int err;
    /* This demo doesn't require active scan */
    err = bt_scan_start(BT_SCAN_TYPE_SCAN_ACTIVE);
    if (err) {
        printk("Scanning failed to start (err %d)\n", err);
        return;
    }


    printk("Scanning successfully started\n");
}

when i start scan and open ble log, The MAC address of the target was scanned, but the protocol stack was not filtered
target MAC  and UUID here
  • Hi

    I'm sorry, but you need to be a bit more specific on what you're struggling with here. Is the filter you're trying to set not working correctly, or are you expecting some information on the scanning side missing or what? You're saying that the protocol stack isn't filtered, what do you refer to here exactly, the Bluetooth LE vs. Classic protocol or something else? If the prior, then that is because the nRF52 series only support Bluetooth LE, and won't be able to filter or detect Bluetooth classic devices.

    Best regards,

    Simon

Related