The latest development version of this page may be more current than this released 2.3-beta.2 version.

Opcode Aggregator Client

The Opcodes Aggregator Client model is a foundation model defined by the Bluetooth Mesh specification. It is an optional model, enabled through the CONFIG_BT_MESH_OP_AGG_CLI option.

Introduced in Bluetooth Mesh Protocol Specification version 1.1, the Opcode Aggregator Client model supports the functionality of sending a series of Access Layer messages to nodes that support the Opcode Aggregator Server model.

The Opcodes Aggregator Client model communicates with the Opcodes Aggregator Server model using either the target node’s device key or an application key configured by the Configuration Client.

If present, the Opcodes Aggregator Client model must only be instantiated on the primary element.

Upon initialization, the Opcode Aggregator Client model is implicitly bound to the device key. It should be bound to the same application key used by the client models that generate the message sequence.

To be able to aggregate a message from a client model, it should support an asynchronous API, for example through callbacks.

API Reference

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.

Parameters:
  • 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.

Returns:

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.

Returns:

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.

Returns:

true if it is started, otherwise false.

size_t bt_mesh_op_agg_cli_seq_tailroom(void)

Get Opcodes Aggregator context tailroom.

Returns:

Remaning tailroom of Opcodes Aggregator SDU.

int32_t bt_mesh_op_agg_cli_timeout_get(void)

Get the current transmission timeout value.

Returns:

The configured transmission timeout in milliseconds.

void bt_mesh_op_agg_cli_timeout_set(int32_t timeout)

Set the transmission timeout value.

Parameters:

timeout – The new transmission timeout.