Hi,
I am trying to filter an iBeacon sample using a modified version of the central_hr_code.
Changes on the central_hr_code:
Added 128-bit UUID definition:
#define BT_UUID_IBEACON_VAL \ BT_UUID_128_ENCODE(0x18ee1516, 0x016b, 0x4bec, 0xad96, 0xbcb96d166e97) /** @brief Throughput Service UUID. */ #define BT_UUID_IBEACON \ BT_UUID_DECLARE_128(BT_UUID_IBEACON_VAL) static struct bt_uuid *uuid128 = BT_UUID_IBEACON;
Added 128-bit filter. Commented out hr filter:
err = bt_scan_filter_add(BT_SCAN_FILTER_TYPE_UUID, uuid128);
if (err) {
printk("Scanning filters cannot be set\n");
return;
}
//err = bt_scan_filter_add(BT_SCAN_FILTER_TYPE_UUID, BT_UUID_HRS);
//if (err) {
// printk("Scanning filters cannot be set (err %d)\n", err);
// return;
//}
Commented out PHY CODED features:
/* Use active scanning and disable duplicate filtering to handle any
* devices that might update their advertising data at runtime. */
struct bt_le_scan_param scan_param = {
.type = BT_LE_SCAN_TYPE_ACTIVE,
.interval = BT_GAP_SCAN_FAST_INTERVAL,
.window = BT_GAP_SCAN_FAST_WINDOW,
// Option to use PHY CODED for range extension
// .options = BT_LE_SCAN_OPT_CODED | BT_LE_SCAN_OPT_NO_1M
};
No changes have been made on the iBeacon side. Why the central device cannot filter the iBeacon UUID? At the moment I don't have any filter match report while scanning.
Thanks