Bluetooth: Mesh: Fix usage of Identity and NRPA adv options for proxy

Both options are kind of mutually exclusive and can't be used together.
Also, USE_IDENTITY is used for debug purpose and could be useful when
debugging Private Proxy as well. Since CONFIG_BT_MESH_DEBUG_USE_ID_ADDR
is not allowed to be used in production, it is fine to use it for
Private Proxy advertisements as well.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
This commit is contained in:
Pavel Vasilyev 2023-08-17 11:43:51 +02:00 committed by Carles Cufí
commit 065e7571eb

View file

@ -51,11 +51,12 @@ LOG_MODULE_REGISTER(bt_mesh_gatt);
#define ADV_OPT_USE_NAME 0
#endif
#define ADV_OPT_USE_NRPA(private) ((private) ? BT_LE_ADV_OPT_USE_NRPA : 0)
#define ADV_OPT_ADDR(private) (IS_ENABLED(CONFIG_BT_MESH_DEBUG_USE_ID_ADDR) ? \
BT_LE_ADV_OPT_USE_IDENTITY : (private) ? BT_LE_ADV_OPT_USE_NRPA : 0)
#define ADV_OPT_PROXY(private) \
(BT_LE_ADV_OPT_CONNECTABLE | BT_LE_ADV_OPT_SCANNABLE | ADV_OPT_USE_NRPA(private) | \
BT_LE_ADV_OPT_ONE_TIME | ADV_OPT_USE_IDENTITY | ADV_OPT_USE_NAME)
(BT_LE_ADV_OPT_CONNECTABLE | BT_LE_ADV_OPT_SCANNABLE | ADV_OPT_ADDR(private) | \
BT_LE_ADV_OPT_ONE_TIME | ADV_OPT_USE_NAME)
static void proxy_send_beacons(struct k_work *work);
static int proxy_send(struct bt_conn *conn,