Private Beacon Client
The Private Beacon Client model is a foundation model defined by the Bluetooth
mesh specification. It is enabled with the
CONFIG_BT_MESH_PRIV_BEACON_CLI
option.
The Private Beacon Client model is introduced in the Bluetooth Mesh Profile Specification version 1.1, and provides functionality for configuring the Private Beacon Server models.
The Private Beacons feature adds privacy to the different Bluetooth mesh beacons by periodically randomizing the beacon input data. This protects the mesh node from being tracked by devices outside the mesh network, and hides the network’s IV index, IV update and the Key Refresh state.
The Private Beacon Client model communicates with a Private Beacon Server model using the device key of the target node. The Private Beacon Client model may communicate with servers on other nodes or self-configure through the local Private Beacon Server model.
All configuration functions in the Private Beacon Client API have net_idx
and addr
as their first parameters. These should be set to the network
index and the primary unicast address the target node was provisioned with.
The Private Beacon Client model is optional, and can be instantiated on any element.
API reference
- group bt_mesh_priv_beacon_cli
Defines
-
BT_MESH_MODEL_PRIV_BEACON_CLI(cli_data)
Private Beacon Client model composition data entry.
- Parameters:
cli_data – Pointer to a Bluetooth Mesh Private Beacon Client instance.
Functions
-
int bt_mesh_priv_beacon_cli_set(uint16_t net_idx, uint16_t addr, struct bt_mesh_priv_beacon *val)
Set the target’s Private Beacon state.
- Parameters:
net_idx – Network index to encrypt with.
addr – Target node address.
val – New Private Beacon value. Returns response status on success.
- Returns:
0 on success, or (negative) error code otherwise.
-
int bt_mesh_priv_beacon_cli_get(uint16_t net_idx, uint16_t addr, struct bt_mesh_priv_beacon *val)
Get the target’s Private Beacon state.
- Parameters:
net_idx – Network index to encrypt with.
addr – Target node address.
val – Response buffer for Private Beacon value.
- Returns:
0 on success, or (negative) error code otherwise.
-
int bt_mesh_priv_beacon_cli_gatt_proxy_set(uint16_t net_idx, uint16_t addr, uint8_t *val)
Set the target’s Private GATT Proxy state.
- Parameters:
net_idx – Network index to encrypt with.
addr – Target node address.
val – New Private GATT Proxy value. Returns response status on success.
- Returns:
0 on success, or (negative) error code otherwise.
-
int bt_mesh_priv_beacon_cli_gatt_proxy_get(uint16_t net_idx, uint16_t addr, uint8_t *val)
Get the target’s Private GATT Proxy state.
- Parameters:
net_idx – Network index to encrypt with.
addr – Target node address.
val – Response buffer for Private GATT Proxy value.
- Returns:
0 on success, or (negative) error code otherwise.
-
int bt_mesh_priv_beacon_cli_node_id_set(uint16_t net_idx, uint16_t addr, struct bt_mesh_priv_node_id *val)
Set the target’s Private Node Identity state.
- Parameters:
net_idx – Network index to encrypt with.
addr – Target node address.
val – New Private Node Identity value. Returns response status on success.
- Returns:
0 on success, or (negative) error code otherwise.
-
int bt_mesh_priv_beacon_cli_node_id_get(uint16_t net_idx, uint16_t addr, uint16_t key_net_idx, struct bt_mesh_priv_node_id *val)
Get the target’s Private Node Identity state.
- Parameters:
net_idx – Network index to encrypt with.
addr – Target node address.
key_net_idx – Network index to get the Private Node Identity state of.
val – Response buffer for Private Node Identity value.
- Returns:
0 on success, or (negative) error code otherwise.
-
struct bt_mesh_priv_beacon
- #include <priv_beacon_cli.h>
Private Beacon.
-
struct bt_mesh_priv_node_id
- #include <priv_beacon_cli.h>
Private Node Identity.
-
struct bt_mesh_priv_beacon_cli_cb
- #include <priv_beacon_cli.h>
Private Beacon Client Status messages callbacks.
Public Members
-
void (*priv_beacon_status)(struct bt_mesh_priv_beacon_cli *cli, uint16_t addr, struct bt_mesh_priv_beacon *priv_beacon)
Optional callback for Private Beacon Status message.
Handles received Private Beacon Status messages from a Private Beacon server.
- Param cli:
Private Beacon client context.
- Param addr:
Address of the sender.
- Param priv_beacon:
Mesh Private Beacon state received from the server.
-
void (*priv_gatt_proxy_status)(struct bt_mesh_priv_beacon_cli *cli, uint16_t addr, uint8_t gatt_proxy)
Optional callback for Private GATT Proxy Status message.
Handles received Private GATT Proxy Status messages from a Private Beacon server.
- Param cli:
Private Beacon client context.
- Param addr:
Address of the sender.
- Param gatt_proxy:
Private GATT Proxy state received from the server.
-
void (*priv_node_id_status)(struct bt_mesh_priv_beacon_cli *cli, uint16_t addr, struct bt_mesh_priv_node_id *priv_node_id)
Optional callback for Private Node Identity Status message.
Handles received Private Node Identity Status messages from a Private Beacon server.
- Param cli:
Private Beacon client context.
- Param addr:
Address of the sender.
- Param priv_node_id:
Private Node Identity state received from the server.
-
void (*priv_beacon_status)(struct bt_mesh_priv_beacon_cli *cli, uint16_t addr, struct bt_mesh_priv_beacon *priv_beacon)
-
struct bt_mesh_priv_beacon_cli
- #include <priv_beacon_cli.h>
Mesh Private Beacon Client model.
Public Members
-
const struct bt_mesh_priv_beacon_cli_cb *cb
Optional callback for Private Beacon Client Status messages.
-
const struct bt_mesh_priv_beacon_cli_cb *cb
-
BT_MESH_MODEL_PRIV_BEACON_CLI(cli_data)