这个页面的 最新开发版本 可能比这个发布的 2.3-beta.1 版本新。

专用信标客户端

私有信标客户端模型是由蓝牙网格规范定义的基础模型。它通过 CONFIG_BT_MESH_PRIV_BEACON_CLI 选项启用。

专用信标客户端模型在 Bluetooth Mesh Protocol Specification 版本1.1中引入,并提供配置 专用信标服务器 模型的功能。

专用信标功能通过定期随机化信标输入数据,为不同的蓝牙网状信标添加隐私。这保护网格节点不被网格网络外部的设备跟踪,并隐藏网络的 IV 索引、IV 更新和密钥刷新状态。

专用信标客户端模型与 专用信标服务器 模型,使用目标节点的设备密钥。专用信标客户端模型可以与其他节点上的服务器通信,或者通过本地专用信标服务器模型进行自我配置。

专用信标客户端 API 中的所有配置函数都将 net_idxaddr 作为其第一个参数。这些应该设置为网络索引和为目标节点提供的主单播地址。

如果存在,则只能在主元素上实例化专用信标客户端模型。

API 参考

group bt_mesh_priv_beacon_cli

Defines

BT_MESH_MODEL_PRIV_BEACON_CLI(cli_data)

Private Beacon Client model composition data entry.

参数:

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.

参数:
  • net_idx – Network index to encrypt with.

  • addr – Target node address.

  • val – New Private Beacon value. Returns response status on success.

返回:

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.

参数:
  • net_idx – Network index to encrypt with.

  • addr – Target node address.

  • val – Response buffer for Private Beacon value.

返回:

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.

参数:
  • net_idx – Network index to encrypt with.

  • addr – Target node address.

  • val – New Private GATT Proxy value. Returns response status on success.

返回:

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.

参数:
  • net_idx – Network index to encrypt with.

  • addr – Target node address.

  • val – Response buffer for Private GATT Proxy value.

返回:

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.

参数:
  • net_idx – Network index to encrypt with.

  • addr – Target node address.

  • val – New Private Node Identity value. Returns response status on success.

返回:

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.

参数:
  • 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.

返回:

0 on success, or (negative) error code otherwise.

struct bt_mesh_priv_beacon

Private Beacon

Public Members

uint8_t enabled

Private beacon is enabled

uint8_t rand_interval

Random refresh interval (in 10 second steps), or 0 to keep current value.

struct bt_mesh_priv_node_id

Private Node Identity

Public Members

uint16_t net_idx

Index of the NetKey.

uint8_t state

Private Node Identity state

uint8_t status

Response status code.

struct bt_mesh_priv_beacon_cli_cb

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.

struct bt_mesh_priv_beacon_cli

Mesh Private Beacon Client model

Public Members

const struct bt_mesh_priv_beacon_cli_cb *cb

Optional callback for Private Beacon Client Status messages.