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

操作码聚合器客户端

操作码聚合器客户端模型是 Bluetooth Mesh 规范定义的基础模型。它是一种可选模型,通过 CONFIG_BT_MESH_OP_AGG_CLI 选项启用。

操作码聚合器客户端模型在 Bluetooth Mesh 协议规范版本1.1中引入,用于支持将一系列访问层消息发送到支持 操作码聚合器服务器 模型的节点的功能。

操作码聚合器客户端模型使用目标节点的设备密钥或配置客户端配置的应用程序密钥与操作码聚合服务器模型通信。

如果存在,则只能在主元素上实例化操作码聚合器客户端模型。

操作码聚合器客户端模型在初始化时隐式绑定到设备密钥。它应该绑定到与用于生成消息序列的客户端模型相同的应用程序密钥。

为了能够聚合来自客户端模型的消息,它应该支持异步 API,例如通过回调。

API 参考

group bt_mesh_op_agg_cli

Defines

BT_MESH_MODEL_OP_AGG_CLI

Opcodes Aggregator Client model composition data entry.

Functions

int bt_mesh_op_agg_cli_seq_start(uint16_t net_idx, uint16_t app_idx, uint16_t dst, uint16_t elem_addr)

Configure Opcodes Aggregator context.

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

  • app_idx – AppKey index to encrypt with.

  • dst – Target Opcodes Aggregator Server address.

  • elem_addr – Target node element address for the sequence message.

返回:

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

int bt_mesh_op_agg_cli_seq_send(void)

Opcodes Aggregator message send.

Uses previously configured context and sends aggregated message to target node.

返回:

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

void bt_mesh_op_agg_cli_seq_abort(void)

Abort Opcodes Aggregator context.

bool bt_mesh_op_agg_cli_seq_is_started(void)

Check if Opcodes Aggregator Sequence context is started.

返回:

true if it is started, otherwise false.

size_t bt_mesh_op_agg_cli_seq_tailroom(void)

Get Opcodes Aggregator context tailroom.

返回:

Remaning tailroom of Opcodes Aggregator SDU.

int32_t bt_mesh_op_agg_cli_timeout_get(void)

Get the current transmission timeout value.

返回:

The configured transmission timeout in milliseconds.

void bt_mesh_op_agg_cli_timeout_set(int32_t timeout)

Set the transmission timeout value.

参数:

timeout – The new transmission timeout.