Bluetooth: Mesh: add optional OOB info to ext scan report

Even though the OOB information is optional we can add it
to extended scan reports in cases there is detected unprovisoned
devices.

Referring to MshPRT section 4.4.5.3:
When the Remote Provisioning Extended Scan procedure completes without
receiving an advertisement from the unprovisioned device, the
OOBInformation and AdvStructures fields shall be skipped. When the
obtained data is empty, the AdvStructures field shall be skipped. The
Status field shall be set to Success.

and referring to MshPRT section 4.3.4.9:
The OOBInformation field contains the OOB Information of either the
unprovisioned device or the Remote Provisioning Server.

Signed-off-by: Alperen Şener <alperen.sener@nordicsemi.no>
This commit is contained in:
Alperen Şener 2023-09-11 15:47:39 +02:00 committed by Carles Cufí
parent 07ece0cb1d
commit f6a9fc1202

View file

@ -267,13 +267,15 @@ static void scan_ext_report_send(void)
bt_mesh_model_msg_init(&buf, RPR_OP_EXTENDED_SCAN_REPORT);
net_buf_simple_add_u8(&buf, BT_MESH_RPR_SUCCESS);
net_buf_simple_add_mem(&buf, srv.scan.dev->uuid, 16);
if (!(srv.scan.dev->flags & BT_MESH_RPR_UNPROV_FOUND)) {
if (srv.scan.dev->flags & BT_MESH_RPR_UNPROV_FOUND) {
net_buf_simple_add_le16(&buf, srv.scan.dev->oob);
} else {
LOG_DBG("not found");
goto send;
}
if (srv.scan.dev->flags & BT_MESH_RPR_UNPROV_EXT_ADV_RXD) {
net_buf_simple_add_le16(&buf, srv.scan.dev->oob);
net_buf_simple_add_mem(&buf, srv.scan.adv_data->data,
srv.scan.adv_data->len);
LOG_DBG("adv data: %s",