Hi Fellow NCS-ers, I understand that the configuration setting CONFIG_BT_EXT_ADV, CONFIG_BT_CTLR_SCAN_REQ_NOTIFY, and bt_le_ext_adv_create() with the appropriate callback function will allow me to receive scan-requests reports similar to nRF52 SDKs. To get the rssi of the scan-requests, I would also need to set CONFIG_BT_CTLR_SCAN_REQ_RSSI. My question is how would I then parse the rssi value from the bt_le_ext_adv_cb.scanned callback? In the callback, the returned bt_le_ext_adv_scanned_info struct only has an "addr" field but not an rssi field?
My current code snippet looks like...
#define ADV_MIN_INTERVAL 0x160
#define ADV_MAX_INTERVAL 0x190
#define ADV_OPTIONS (BT_LE_ADV_OPT_SCANNABLE | BT_LE_ADV_OPT_NOTIFY_SCAN_REQ)
static const struct bt_le_adv_param adv_parameters = {
.options = ADV_OPTIONS,
.interval_min = ADV_MIN_INTERVAL,
.interval_max = ADV_MAX_INTERVAL,
};
void on_scanned(struct bt_le_ext_adv *adv, struct bt_le_ext_adv_scanned_info *info)
{
LOG_INF("on_scanned");
// get the mac address of the scanned device, and rssi
char addr[BT_ADDR_LE_STR_LEN];
bt_addr_le_to_str(info->addr, addr, sizeof(addr));
//...etc
}
void on_sent(struct bt_le_ext_adv *adv, struct bt_le_ext_adv_sent_info *info)
{
LOG_INF("on_sent");
}
struct bt_le_ext_adv_cb cb =
{
.sent = on_sent,
.scanned = on_scanned
};
static int start_advertising(void)
{
int err;
err = bt_le_ext_adv_create(&adv_parameters, &cb, &adv_ext);
if (err) {
LOG_WRN("Create ext adv err %d\n", err);
return err;
}
//...etc
}