This is the documentation for the latest (main) development branch of Zephyr. If you are looking for the documentation of previous releases, use the drop-down list at the bottom of the left panel and select the desired version.

Large Composition Data Client

The Large Composition Data Client model is a foundation model defined by the Bluetooth Mesh specification. The model is optional, and is enabled through the CONFIG_BT_MESH_LARGE_COMP_DATA_CLI option.

The Large Composition Data Client model was introduced in the Bluetooth Mesh Protocol Specification version 1.1, and supports the functionality of reading pages of Composition Data that do not fit in a Config Composition Data Status message and reading the metadata of the model instances on a node that supports the Large Composition Data Server model.

The Large Composition Data Client model communicates with a Large Composition Data Server model using the device key of the node containing the target Large Composition Data Server model instance.

If present, the Large Composition Data Client model must only be instantiated on the primary element.

API reference

group bt_mesh_large_comp_data_cli

Defines

BT_MESH_MODEL_LARGE_COMP_DATA_CLI(cli_data)

Large Composition Data Client model Composition Data entry.

Parameters:

Functions

int bt_mesh_large_comp_data_get(uint16_t net_idx, uint16_t addr, uint8_t page, size_t offset, struct bt_mesh_large_comp_data_rsp *rsp)

Send Large Composition Data Get message.

This API is used to read a portion of a Composition Data Page.

This API can be used asynchronously by setting rsp as NULL. This way, the method will not wait for a response and will return immediately after sending the command.

When rsp is set, the user is responsible for providing a buffer for the Composition Data in bt_mesh_large_comp_data_rsp::data. If a buffer is not provided, the metadata won’t be copied.

Parameters:
  • net_idx – Network index to encrypt with.

  • addr – Target node element address.

  • page – Composition Data Page to read.

  • offset – Offset within the Composition Data Page.

  • rsp – Pointer to a struct storing the received response from the server, or NULL to not wait for a response.

Returns:

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

int bt_mesh_models_metadata_get(uint16_t net_idx, uint16_t addr, uint8_t page, size_t offset, struct bt_mesh_large_comp_data_rsp *rsp)

Send Models Metadata Get message.

This API is used to read a portion of a Models Metadata Page.

This API can be used asynchronously by setting rsp as NULL. This way, the method will not wait for a response and will return immediately after sending the command.

When rsp is set, a user is responsible for providing a buffer for metadata in bt_mesh_large_comp_data_rsp::data. If a buffer is not provided, the metadata won’t be copied.

Parameters:
  • net_idx – Network index to encrypt with.

  • addr – Target node element address.

  • page – Models Metadata Page to read.

  • offset – Offset within the Models Metadata Page.

  • rsp – Pointer to a struct storing the received response from the server, or NULL to not wait for a response.

Returns:

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

struct bt_mesh_large_comp_data_rsp
#include <large_comp_data_cli.h>

Large Composition Data response.

Public Members

uint8_t page

Page number.

uint16_t offset

Offset within the page.

uint16_t total_size

Total size of the page.

struct net_buf_simple *data

Pointer to allocated buffer for storing received data.

struct bt_mesh_large_comp_data_cli_cb
#include <large_comp_data_cli.h>

Large Composition Data Status messages callbacks.

Public Members

void (*large_comp_data_status)(struct bt_mesh_large_comp_data_cli *cli, uint16_t addr, struct bt_mesh_large_comp_data_rsp *rsp)

Optional callback for Large Composition Data Status message.

Handles received Large Composition Data Status messages from a Large Composition Data Server.

If the content of rsp is needed after exiting this callback, a user should deep copy it.

Param cli:

Large Composition Data Client context.

Param addr:

Address of the sender.

Param rsp:

Response received from the server.

void (*models_metadata_status)(struct bt_mesh_large_comp_data_cli *cli, uint16_t addr, struct bt_mesh_large_comp_data_rsp *rsp)

Optional callback for Models Metadata Status message.

Handles received Models Metadata Status messages from a Large Composition Data Server.

If the content of rsp is needed after exiting this callback, a user should deep copy it.

Param cli:

Large Composition Data Client context.

Param addr:

Address of the sender.

Param rsp:

Response received from the server.

struct bt_mesh_large_comp_data_cli
#include <large_comp_data_cli.h>

Large Composition Data Client model context.

Public Members

const struct bt_mesh_model *model

Model entry pointer.

struct bt_mesh_msg_ack_ctx ack_ctx

Internal parameters for tracking message responses.

const struct bt_mesh_large_comp_data_cli_cb *cb

Optional callback for Large Composition Data Status messages.