Hello,
I'm using VS Code and Zephyr to develeop a application for the nRF52840. I am currently scanning for devices, however the device i am looking for uses a random private resolvable address.
Currently i already have a hardcoded list of IRK values. The BLE addresses found while scanning are processed by the device_found() function.
However i cannot find any method to check if these match any of my IRK values using Zephyr. I know that some SoftDevices have this option, however they are not available in vscode.
Do you have any recommendations on how to approach this?
Please see my code below:
static void device_found(const bt_addr_le_t *addr, int8_t rssi, uint8_t type, struct net_buf_simple *ad)
{
if (type == BT_GAP_ADV_TYPE_ADV_SCAN_IND || type == BT_GAP_ADV_TYPE_ADV_IND)
{
struct scan_result res = {
.addr = addr,
.rssi = rssi,
};
bt_data_parse(ad, eir_found, &res);
}
}
static void start_scan(void)
{
int err;
struct bt_le_scan_param scan_param = {
.type = BT_LE_SCAN_TYPE_PASSIVE,
.options = BT_LE_SCAN_OPT_NONE,
.interval = BT_GAP_SCAN_FAST_INTERVAL,
.window = BT_GAP_SCAN_FAST_WINDOW,
};
err = bt_le_scan_start(&scan_param, device_found);
if (err)
{
printk("Scanning failed to start (err %d)\n", err);
return;
}
printk("Scanning successfully started\n");
}