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(¶m);
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");
}
![](/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1719555708225v1.jpeg)
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
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
![](/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1719555708225v1.jpeg)