Configuration Client

The Configuration Client model is a foundation model defined by the Bluetooth Mesh specification. It provides functionality for configuring most parameters of a mesh node, including encryption keys, model configuration and feature enabling.

The Configuration Client model communicates with a Configuration Server model using the device key of the target node. The Configuration Client model may communicate with servers on other nodes or self-configure through the local Configuration Server model.

All configuration functions in the Configuration Client API have net_idx and addr as their first parameters. These should be set to the network index and primary unicast address that the target node was provisioned with.

The Configuration Client model is optional, and it must only be instantiated on the primary element if present in the Composition Data.

API reference

group bt_mesh_cfg_cli

Configuration Client Model.

Defines

BT_MESH_MODEL_CFG_CLI(cli_data)

Generic Configuration Client model composition data entry.

Parameters:
BT_MESH_PUB_PERIOD_100MS(steps)

Helper macro to encode model publication period in units of 100ms.

Parameters:
  • steps – Number of 100ms steps.

Returns:

Encoded value that can be assigned to bt_mesh_cfg_cli_mod_pub.period

BT_MESH_PUB_PERIOD_SEC(steps)

Helper macro to encode model publication period in units of 1 second.

Parameters:
  • steps – Number of 1 second steps.

Returns:

Encoded value that can be assigned to bt_mesh_cfg_cli_mod_pub.period

BT_MESH_PUB_PERIOD_10SEC(steps)

Helper macro to encode model publication period in units of 10 seconds.

Parameters:
  • steps – Number of 10 second steps.

Returns:

Encoded value that can be assigned to bt_mesh_cfg_cli_mod_pub.period

BT_MESH_PUB_PERIOD_10MIN(steps)

Helper macro to encode model publication period in units of 10 minutes.

Parameters:
  • steps – Number of 10 minute steps.

Returns:

Encoded value that can be assigned to bt_mesh_cfg_cli_mod_pub.period

Functions

int bt_mesh_cfg_cli_node_reset(uint16_t net_idx, uint16_t addr, bool *status)

Reset the target node and remove it from the network.

Parameters:
  • net_idx – Network index to encrypt with.

  • addr – Target node address.

  • status – Status response parameter

Returns:

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

int bt_mesh_cfg_cli_comp_data_get(uint16_t net_idx, uint16_t addr, uint8_t page, uint8_t *rsp, struct net_buf_simple *comp)

Get the target node’s composition data.

If the other device does not have the given composition data page, it will return the largest page number it supports that is less than the requested page index. The actual page the device responds with is returned in rsp.

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

Parameters:
  • net_idx – Network index to encrypt with.

  • addr – Target node address.

  • page – Composition data page, or 0xff to request the first available page.

  • rsp – Return parameter for the returned page number, or NULL.

  • comp – Composition data buffer to fill.

Returns:

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

int bt_mesh_cfg_cli_beacon_get(uint16_t net_idx, uint16_t addr, uint8_t *status)

Get the target node’s network beacon state.

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

Parameters:
Returns:

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

int bt_mesh_cfg_cli_krp_get(uint16_t net_idx, uint16_t addr, uint16_t key_net_idx, uint8_t *status, uint8_t *phase)

Get the target node’s network key refresh phase state.

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

Parameters:
  • net_idx – Network index to encrypt with.

  • addr – Target node address.

  • key_net_idx – Network key index.

  • status – Status response parameter.

  • phase – Pointer to the Key Refresh variable to fill.

Returns:

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

int bt_mesh_cfg_cli_krp_set(uint16_t net_idx, uint16_t addr, uint16_t key_net_idx, uint8_t transition, uint8_t *status, uint8_t *phase)

Set the target node’s network key refresh phase parameters.

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

Parameters:
  • net_idx – Network index to encrypt with.

  • addr – Target node address.

  • key_net_idx – Network key index.

  • transition – Transition parameter.

  • status – Status response parameter.

  • phase – Pointer to the new Key Refresh phase. Will return the actual Key Refresh phase after updating.

Returns:

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

int bt_mesh_cfg_cli_beacon_set(uint16_t net_idx, uint16_t addr, uint8_t val, uint8_t *status)

Set the target node’s network beacon state.

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

Parameters:
Returns:

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

int bt_mesh_cfg_cli_ttl_get(uint16_t net_idx, uint16_t addr, uint8_t *ttl)

Get the target node’s Time To Live value.

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

Parameters:
  • net_idx – Network index to encrypt with.

  • addr – Target node address.

  • ttl – TTL response buffer.

Returns:

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

int bt_mesh_cfg_cli_ttl_set(uint16_t net_idx, uint16_t addr, uint8_t val, uint8_t *ttl)

Set the target node’s Time To Live value.

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

Parameters:
  • net_idx – Network index to encrypt with.

  • addr – Target node address.

  • val – New Time To Live value.

  • ttl – TTL response buffer.

Returns:

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

int bt_mesh_cfg_cli_friend_get(uint16_t net_idx, uint16_t addr, uint8_t *status)

Get the target node’s Friend feature status.

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

Parameters:
Returns:

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

int bt_mesh_cfg_cli_friend_set(uint16_t net_idx, uint16_t addr, uint8_t val, uint8_t *status)

Set the target node’s Friend feature state.

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

Parameters:
Returns:

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

int bt_mesh_cfg_cli_gatt_proxy_get(uint16_t net_idx, uint16_t addr, uint8_t *status)

Get the target node’s Proxy feature state.

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

Parameters:
Returns:

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

int bt_mesh_cfg_cli_gatt_proxy_set(uint16_t net_idx, uint16_t addr, uint8_t val, uint8_t *status)

Set the target node’s Proxy feature state.

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

Parameters:
Returns:

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

int bt_mesh_cfg_cli_net_transmit_get(uint16_t net_idx, uint16_t addr, uint8_t *transmit)

Get the target node’s network_transmit state.

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

Parameters:
  • net_idx – Network index to encrypt with.

  • addr – Target node address.

  • transmit – Network transmit response parameter. Returns the encoded network transmission parameters on success. Decoded with BT_MESH_TRANSMIT_COUNT and BT_MESH_TRANSMIT_INT.

Returns:

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

int bt_mesh_cfg_cli_net_transmit_set(uint16_t net_idx, uint16_t addr, uint8_t val, uint8_t *transmit)

Set the target node’s network transmit parameters.

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

See also

BT_MESH_TRANSMIT.

Parameters:
  • net_idx – Network index to encrypt with.

  • addr – Target node address.

  • val – New encoded network transmit parameters.

  • transmit – Network transmit response parameter. Returns the encoded network transmission parameters on success. Decoded with BT_MESH_TRANSMIT_COUNT and BT_MESH_TRANSMIT_INT.

Returns:

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

int bt_mesh_cfg_cli_relay_get(uint16_t net_idx, uint16_t addr, uint8_t *status, uint8_t *transmit)

Get the target node’s Relay feature state.

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

Parameters:
Returns:

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

int bt_mesh_cfg_cli_relay_set(uint16_t net_idx, uint16_t addr, uint8_t new_relay, uint8_t new_transmit, uint8_t *status, uint8_t *transmit)

Set the target node’s Relay parameters.

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

See also

BT_MESH_TRANSMIT.

Parameters:
Returns:

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

int bt_mesh_cfg_cli_net_key_add(uint16_t net_idx, uint16_t addr, uint16_t key_net_idx, const uint8_t net_key[16], uint8_t *status)

Add a network key to the target node.

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

Parameters:
  • net_idx – Network index to encrypt with.

  • addr – Target node address.

  • key_net_idx – Network key index.

  • net_key – Network key.

  • status – Status response parameter.

Returns:

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

int bt_mesh_cfg_cli_net_key_get(uint16_t net_idx, uint16_t addr, uint16_t *keys, size_t *key_cnt)

Get a list of the target node’s network key indexes.

This method can be used asynchronously by setting keys or key_cnt as NULL. This way the method will not wait for response and will return immediately after sending the command.

Parameters:
  • net_idx – Network index to encrypt with.

  • addr – Target node address.

  • keys – Net key index list response parameter. Will be filled with all the returned network key indexes it can fill.

  • key_cnt – Net key index list length. Should be set to the capacity of the keys list when calling. Will return the number of returned network key indexes upon success.

Returns:

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

int bt_mesh_cfg_cli_net_key_del(uint16_t net_idx, uint16_t addr, uint16_t key_net_idx, uint8_t *status)

Delete a network key from the target node.

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

Parameters:
  • net_idx – Network index to encrypt with.

  • addr – Target node address.

  • key_net_idx – Network key index.

  • status – Status response parameter.

Returns:

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

int bt_mesh_cfg_cli_app_key_add(uint16_t net_idx, uint16_t addr, uint16_t key_net_idx, uint16_t key_app_idx, const uint8_t app_key[16], uint8_t *status)

Add an application key to the target node.

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

Parameters:
  • net_idx – Network index to encrypt with.

  • addr – Target node address.

  • key_net_idx – Network key index the application key belongs to.

  • key_app_idx – Application key index.

  • app_key – Application key.

  • status – Status response parameter.

Returns:

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

int bt_mesh_cfg_cli_app_key_get(uint16_t net_idx, uint16_t addr, uint16_t key_net_idx, uint8_t *status, uint16_t *keys, size_t *key_cnt)

Get a list of the target node’s application key indexes for a specific network key.

This method can be used asynchronously by setting status and ( keys or key_cnt ) as NULL. This way the method will not wait for response and will return immediately after sending the command.

Parameters:
  • net_idx – Network index to encrypt with.

  • addr – Target node address.

  • key_net_idx – Network key index to request the app key indexes of.

  • status – Status response parameter.

  • keys – App key index list response parameter. Will be filled with all the returned application key indexes it can fill.

  • key_cnt – App key index list length. Should be set to the capacity of the keys list when calling. Will return the number of returned application key indexes upon success.

Returns:

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

int bt_mesh_cfg_cli_app_key_del(uint16_t net_idx, uint16_t addr, uint16_t key_net_idx, uint16_t key_app_idx, uint8_t *status)

Delete an application key from the target node.

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

Parameters:
  • net_idx – Network index to encrypt with.

  • addr – Target node address.

  • key_net_idx – Network key index the application key belongs to.

  • key_app_idx – Application key index.

  • status – Status response parameter.

Returns:

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

int bt_mesh_cfg_cli_mod_app_bind(uint16_t net_idx, uint16_t addr, uint16_t elem_addr, uint16_t mod_app_idx, uint16_t mod_id, uint8_t *status)

Bind an application to a SIG model on the target node.

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

Parameters:
  • net_idx – Network index to encrypt with.

  • addr – Target node address.

  • elem_addr – Element address the model is in.

  • mod_app_idx – Application index to bind.

  • mod_id – Model ID.

  • status – Status response parameter.

Returns:

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

int bt_mesh_cfg_cli_mod_app_unbind(uint16_t net_idx, uint16_t addr, uint16_t elem_addr, uint16_t mod_app_idx, uint16_t mod_id, uint8_t *status)

Unbind an application from a SIG model on the target node.

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

Parameters:
  • net_idx – Network index to encrypt with.

  • addr – Target node address.

  • elem_addr – Element address the model is in.

  • mod_app_idx – Application index to unbind.

  • mod_id – Model ID.

  • status – Status response parameter.

Returns:

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

int bt_mesh_cfg_cli_mod_app_bind_vnd(uint16_t net_idx, uint16_t addr, uint16_t elem_addr, uint16_t mod_app_idx, uint16_t mod_id, uint16_t cid, uint8_t *status)

Bind an application to a vendor model on the target node.

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

Parameters:
  • net_idx – Network index to encrypt with.

  • addr – Target node address.

  • elem_addr – Element address the model is in.

  • mod_app_idx – Application index to bind.

  • mod_id – Model ID.

  • cid – Company ID of the model.

  • status – Status response parameter.

Returns:

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

int bt_mesh_cfg_cli_mod_app_unbind_vnd(uint16_t net_idx, uint16_t addr, uint16_t elem_addr, uint16_t mod_app_idx, uint16_t mod_id, uint16_t cid, uint8_t *status)

Unbind an application from a vendor model on the target node.

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

Parameters:
  • net_idx – Network index to encrypt with.

  • addr – Target node address.

  • elem_addr – Element address the model is in.

  • mod_app_idx – Application index to unbind.

  • mod_id – Model ID.

  • cid – Company ID of the model.

  • status – Status response parameter.

Returns:

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

int bt_mesh_cfg_cli_mod_app_get(uint16_t net_idx, uint16_t addr, uint16_t elem_addr, uint16_t mod_id, uint8_t *status, uint16_t *apps, size_t *app_cnt)

Get a list of all applications bound to a SIG model on the target node.

This method can be used asynchronously by setting status and ( apps or app_cnt ) as NULL. This way the method will not wait for response and will return immediately after sending the command.

Parameters:
  • net_idx – Network index to encrypt with.

  • addr – Target node address.

  • elem_addr – Element address the model is in.

  • mod_id – Model ID.

  • status – Status response parameter.

  • apps – App index list response parameter. Will be filled with all the returned application key indexes it can fill.

  • app_cnt – App index list length. Should be set to the capacity of the apps list when calling. Will return the number of returned application key indexes upon success.

Returns:

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

int bt_mesh_cfg_cli_mod_app_get_vnd(uint16_t net_idx, uint16_t addr, uint16_t elem_addr, uint16_t mod_id, uint16_t cid, uint8_t *status, uint16_t *apps, size_t *app_cnt)

Get a list of all applications bound to a vendor model on the target node.

This method can be used asynchronously by setting status and ( apps or app_cnt ) as NULL. This way the method will not wait for response and will return immediately after sending the command.

Parameters:
  • net_idx – Network index to encrypt with.

  • addr – Target node address.

  • elem_addr – Element address the model is in.

  • mod_id – Model ID.

  • cid – Company ID of the model.

  • status – Status response parameter.

  • apps – App index list response parameter. Will be filled with all the returned application key indexes it can fill.

  • app_cnt – App index list length. Should be set to the capacity of the apps list when calling. Will return the number of returned application key indexes upon success.

Returns:

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

int bt_mesh_cfg_cli_mod_pub_get(uint16_t net_idx, uint16_t addr, uint16_t elem_addr, uint16_t mod_id, struct bt_mesh_cfg_cli_mod_pub *pub, uint8_t *status)

Get publish parameters for a SIG model on the target node.

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

Parameters:
  • net_idx – Network index to encrypt with.

  • addr – Target node address.

  • elem_addr – Element address the model is in.

  • mod_id – Model ID.

  • pub – Publication parameter return buffer.

  • status – Status response parameter.

Returns:

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

int bt_mesh_cfg_cli_mod_pub_get_vnd(uint16_t net_idx, uint16_t addr, uint16_t elem_addr, uint16_t mod_id, uint16_t cid, struct bt_mesh_cfg_cli_mod_pub *pub, uint8_t *status)

Get publish parameters for a vendor model on the target node.

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

Parameters:
  • net_idx – Network index to encrypt with.

  • addr – Target node address.

  • elem_addr – Element address the model is in.

  • mod_id – Model ID.

  • cid – Company ID of the model.

  • pub – Publication parameter return buffer.

  • status – Status response parameter.

Returns:

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

int bt_mesh_cfg_cli_mod_pub_set(uint16_t net_idx, uint16_t addr, uint16_t elem_addr, uint16_t mod_id, struct bt_mesh_cfg_cli_mod_pub *pub, uint8_t *status)

Set publish parameters for a SIG model on the target node.

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

pub shall not be NULL.

Parameters:
  • net_idx – Network index to encrypt with.

  • addr – Target node address.

  • elem_addr – Element address the model is in.

  • mod_id – Model ID.

  • pub – Publication parameters.

  • status – Status response parameter.

Returns:

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

int bt_mesh_cfg_cli_mod_pub_set_vnd(uint16_t net_idx, uint16_t addr, uint16_t elem_addr, uint16_t mod_id, uint16_t cid, struct bt_mesh_cfg_cli_mod_pub *pub, uint8_t *status)

Set publish parameters for a vendor model on the target node.

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

pub shall not be NULL.

Parameters:
  • net_idx – Network index to encrypt with.

  • addr – Target node address.

  • elem_addr – Element address the model is in.

  • mod_id – Model ID.

  • cid – Company ID of the model.

  • pub – Publication parameters.

  • status – Status response parameter.

Returns:

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

int bt_mesh_cfg_cli_mod_sub_add(uint16_t net_idx, uint16_t addr, uint16_t elem_addr, uint16_t sub_addr, uint16_t mod_id, uint8_t *status)

Add a group address to a SIG model’s subscription list.

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

Parameters:
  • net_idx – Network index to encrypt with.

  • addr – Target node address.

  • elem_addr – Element address the model is in.

  • sub_addr – Group address to add to the subscription list.

  • mod_id – Model ID.

  • status – Status response parameter.

Returns:

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

int bt_mesh_cfg_cli_mod_sub_add_vnd(uint16_t net_idx, uint16_t addr, uint16_t elem_addr, uint16_t sub_addr, uint16_t mod_id, uint16_t cid, uint8_t *status)

Add a group address to a vendor model’s subscription list.

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

Parameters:
  • net_idx – Network index to encrypt with.

  • addr – Target node address.

  • elem_addr – Element address the model is in.

  • sub_addr – Group address to add to the subscription list.

  • mod_id – Model ID.

  • cid – Company ID of the model.

  • status – Status response parameter.

Returns:

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

int bt_mesh_cfg_cli_mod_sub_del(uint16_t net_idx, uint16_t addr, uint16_t elem_addr, uint16_t sub_addr, uint16_t mod_id, uint8_t *status)

Delete a group address in a SIG model’s subscription list.

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

Parameters:
  • net_idx – Network index to encrypt with.

  • addr – Target node address.

  • elem_addr – Element address the model is in.

  • sub_addr – Group address to add to the subscription list.

  • mod_id – Model ID.

  • status – Status response parameter.

Returns:

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

int bt_mesh_cfg_cli_mod_sub_del_vnd(uint16_t net_idx, uint16_t addr, uint16_t elem_addr, uint16_t sub_addr, uint16_t mod_id, uint16_t cid, uint8_t *status)

Delete a group address in a vendor model’s subscription list.

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

Parameters:
  • net_idx – Network index to encrypt with.

  • addr – Target node address.

  • elem_addr – Element address the model is in.

  • sub_addr – Group address to add to the subscription list.

  • mod_id – Model ID.

  • cid – Company ID of the model.

  • status – Status response parameter.

Returns:

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

int bt_mesh_cfg_cli_mod_sub_overwrite(uint16_t net_idx, uint16_t addr, uint16_t elem_addr, uint16_t sub_addr, uint16_t mod_id, uint8_t *status)

Overwrite all addresses in a SIG model’s subscription list with a group address.

Deletes all subscriptions in the model’s subscription list, and adds a single group address instead.

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

Parameters:
  • net_idx – Network index to encrypt with.

  • addr – Target node address.

  • elem_addr – Element address the model is in.

  • sub_addr – Group address to add to the subscription list.

  • mod_id – Model ID.

  • status – Status response parameter.

Returns:

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

int bt_mesh_cfg_cli_mod_sub_overwrite_vnd(uint16_t net_idx, uint16_t addr, uint16_t elem_addr, uint16_t sub_addr, uint16_t mod_id, uint16_t cid, uint8_t *status)

Overwrite all addresses in a vendor model’s subscription list with a group address.

Deletes all subscriptions in the model’s subscription list, and adds a single group address instead.

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

Parameters:
  • net_idx – Network index to encrypt with.

  • addr – Target node address.

  • elem_addr – Element address the model is in.

  • sub_addr – Group address to add to the subscription list.

  • mod_id – Model ID.

  • cid – Company ID of the model.

  • status – Status response parameter.

Returns:

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

int bt_mesh_cfg_cli_mod_sub_va_add(uint16_t net_idx, uint16_t addr, uint16_t elem_addr, const uint8_t label[16], uint16_t mod_id, uint16_t *virt_addr, uint8_t *status)

Add a virtual address to a SIG model’s subscription list.

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

Parameters:
  • net_idx – Network index to encrypt with.

  • addr – Target node address.

  • elem_addr – Element address the model is in.

  • label – Virtual address label to add to the subscription list.

  • mod_id – Model ID.

  • virt_addr – Virtual address response parameter.

  • status – Status response parameter.

Returns:

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

int bt_mesh_cfg_cli_mod_sub_va_add_vnd(uint16_t net_idx, uint16_t addr, uint16_t elem_addr, const uint8_t label[16], uint16_t mod_id, uint16_t cid, uint16_t *virt_addr, uint8_t *status)

Add a virtual address to a vendor model’s subscription list.

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

Parameters:
  • net_idx – Network index to encrypt with.

  • addr – Target node address.

  • elem_addr – Element address the model is in.

  • label – Virtual address label to add to the subscription list.

  • mod_id – Model ID.

  • cid – Company ID of the model.

  • virt_addr – Virtual address response parameter.

  • status – Status response parameter.

Returns:

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

int bt_mesh_cfg_cli_mod_sub_va_del(uint16_t net_idx, uint16_t addr, uint16_t elem_addr, const uint8_t label[16], uint16_t mod_id, uint16_t *virt_addr, uint8_t *status)

Delete a virtual address in a SIG model’s subscription list.

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

Parameters:
  • net_idx – Network index to encrypt with.

  • addr – Target node address.

  • elem_addr – Element address the model is in.

  • label – Virtual address parameter to add to the subscription list.

  • mod_id – Model ID.

  • virt_addr – Virtual address response parameter.

  • status – Status response parameter.

Returns:

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

int bt_mesh_cfg_cli_mod_sub_va_del_vnd(uint16_t net_idx, uint16_t addr, uint16_t elem_addr, const uint8_t label[16], uint16_t mod_id, uint16_t cid, uint16_t *virt_addr, uint8_t *status)

Delete a virtual address in a vendor model’s subscription list.

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

Parameters:
  • net_idx – Network index to encrypt with.

  • addr – Target node address.

  • elem_addr – Element address the model is in.

  • label – Virtual address label to add to the subscription list.

  • mod_id – Model ID.

  • cid – Company ID of the model.

  • virt_addr – Virtual address response parameter.

  • status – Status response parameter.

Returns:

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

int bt_mesh_cfg_cli_mod_sub_va_overwrite(uint16_t net_idx, uint16_t addr, uint16_t elem_addr, const uint8_t label[16], uint16_t mod_id, uint16_t *virt_addr, uint8_t *status)

Overwrite all addresses in a SIG model’s subscription list with a virtual address.

Deletes all subscriptions in the model’s subscription list, and adds a single group address instead.

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

Parameters:
  • net_idx – Network index to encrypt with.

  • addr – Target node address.

  • elem_addr – Element address the model is in.

  • label – Virtual address label to add to the subscription list.

  • mod_id – Model ID.

  • virt_addr – Virtual address response parameter.

  • status – Status response parameter.

Returns:

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

int bt_mesh_cfg_cli_mod_sub_va_overwrite_vnd(uint16_t net_idx, uint16_t addr, uint16_t elem_addr, const uint8_t label[16], uint16_t mod_id, uint16_t cid, uint16_t *virt_addr, uint8_t *status)

Overwrite all addresses in a vendor model’s subscription list with a virtual address.

Deletes all subscriptions in the model’s subscription list, and adds a single group address instead.

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

Parameters:
  • net_idx – Network index to encrypt with.

  • addr – Target node address.

  • elem_addr – Element address the model is in.

  • label – Virtual address label to add to the subscription list.

  • mod_id – Model ID.

  • cid – Company ID of the model.

  • virt_addr – Virtual address response parameter.

  • status – Status response parameter.

Returns:

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

int bt_mesh_cfg_cli_mod_sub_get(uint16_t net_idx, uint16_t addr, uint16_t elem_addr, uint16_t mod_id, uint8_t *status, uint16_t *subs, size_t *sub_cnt)

Get the subscription list of a SIG model on the target node.

This method can be used asynchronously by setting status and ( subs or sub_cnt ) as NULL. This way the method will not wait for response and will return immediately after sending the command.

Parameters:
  • net_idx – Network index to encrypt with.

  • addr – Target node address.

  • elem_addr – Element address the model is in.

  • mod_id – Model ID.

  • status – Status response parameter.

  • subs – Subscription list response parameter. Will be filled with all the returned subscriptions it can fill.

  • sub_cnt – Subscription list element count. Should be set to the capacity of the subs list when calling. Will return the number of returned subscriptions upon success.

Returns:

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

int bt_mesh_cfg_cli_mod_sub_get_vnd(uint16_t net_idx, uint16_t addr, uint16_t elem_addr, uint16_t mod_id, uint16_t cid, uint8_t *status, uint16_t *subs, size_t *sub_cnt)

Get the subscription list of a vendor model on the target node.

This method can be used asynchronously by setting status and ( subs or sub_cnt ) as NULL. This way the method will not wait for response and will return immediately after sending the command.

Parameters:
  • net_idx – Network index to encrypt with.

  • addr – Target node address.

  • elem_addr – Element address the model is in.

  • mod_id – Model ID.

  • cid – Company ID of the model.

  • status – Status response parameter.

  • subs – Subscription list response parameter. Will be filled with all the returned subscriptions it can fill.

  • sub_cnt – Subscription list element count. Should be set to the capacity of the subs list when calling. Will return the number of returned subscriptions upon success.

Returns:

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

int bt_mesh_cfg_cli_hb_sub_set(uint16_t net_idx, uint16_t addr, struct bt_mesh_cfg_cli_hb_sub *sub, uint8_t *status)

Set the target node’s Heartbeat subscription parameters.

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

sub shall not be null.

Parameters:
  • net_idx – Network index to encrypt with.

  • addr – Target node address.

  • sub – New Heartbeat subscription parameters.

  • status – Status response parameter.

Returns:

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

int bt_mesh_cfg_cli_hb_sub_get(uint16_t net_idx, uint16_t addr, struct bt_mesh_cfg_cli_hb_sub *sub, uint8_t *status)

Get the target node’s Heartbeat subscription parameters.

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

Parameters:
  • net_idx – Network index to encrypt with.

  • addr – Target node address.

  • sub – Heartbeat subscription parameter return buffer.

  • status – Status response parameter.

Returns:

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

int bt_mesh_cfg_cli_hb_pub_set(uint16_t net_idx, uint16_t addr, const struct bt_mesh_cfg_cli_hb_pub *pub, uint8_t *status)

Set the target node’s Heartbeat publication parameters.

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

pub shall not be NULL;

Note

The target node must already have received the specified network key.

Parameters:
  • net_idx – Network index to encrypt with.

  • addr – Target node address.

  • pub – New Heartbeat publication parameters.

  • status – Status response parameter.

Returns:

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

int bt_mesh_cfg_cli_hb_pub_get(uint16_t net_idx, uint16_t addr, struct bt_mesh_cfg_cli_hb_pub *pub, uint8_t *status)

Get the target node’s Heartbeat publication parameters.

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

Parameters:
  • net_idx – Network index to encrypt with.

  • addr – Target node address.

  • pub – Heartbeat publication parameter return buffer.

  • status – Status response parameter.

Returns:

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

int bt_mesh_cfg_cli_mod_sub_del_all(uint16_t net_idx, uint16_t addr, uint16_t elem_addr, uint16_t mod_id, uint8_t *status)

Delete all group addresses in a SIG model’s subscription list.

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

Parameters:
  • net_idx – Network index to encrypt with.

  • addr – Target node address.

  • elem_addr – Element address the model is in.

  • mod_id – Model ID.

  • status – Status response parameter.

Returns:

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

int bt_mesh_cfg_cli_mod_sub_del_all_vnd(uint16_t net_idx, uint16_t addr, uint16_t elem_addr, uint16_t mod_id, uint16_t cid, uint8_t *status)

Delete all group addresses in a vendor model’s subscription list.

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

Parameters:
  • net_idx – Network index to encrypt with.

  • addr – Target node address.

  • elem_addr – Element address the model is in.

  • mod_id – Model ID.

  • cid – Company ID of the model.

  • status – Status response parameter.

Returns:

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

int bt_mesh_cfg_cli_net_key_update(uint16_t net_idx, uint16_t addr, uint16_t key_net_idx, const uint8_t net_key[16], uint8_t *status)

Update a network key to the target node.

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

Parameters:
  • net_idx – Network index to encrypt with.

  • addr – Target node address.

  • key_net_idx – Network key index.

  • net_key – Network key.

  • status – Status response parameter.

Returns:

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

int bt_mesh_cfg_cli_app_key_update(uint16_t net_idx, uint16_t addr, uint16_t key_net_idx, uint16_t key_app_idx, const uint8_t app_key[16], uint8_t *status)

Update an application key to the target node.

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

Parameters:
  • net_idx – Network index to encrypt with.

  • addr – Target node address.

  • key_net_idx – Network key index the application key belongs to.

  • key_app_idx – Application key index.

  • app_key – Application key.

  • status – Status response parameter.

Returns:

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

int bt_mesh_cfg_cli_node_identity_set(uint16_t net_idx, uint16_t addr, uint16_t key_net_idx, uint8_t new_identity, uint8_t *status, uint8_t *identity)

Set the Node Identity parameters.

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

Parameters:
  • net_idx – Network index to encrypt with.

  • addr – Target node address.

  • new_identity – New identity state. Must be one of BT_MESH_NODE_IDENTITY_STOPPED or BT_MESH_NODE_IDENTITY_RUNNING

  • key_net_idx – Network key index the application key belongs to.

  • status – Status response parameter.

  • identity – Identity response parameter.

Returns:

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

int bt_mesh_cfg_cli_node_identity_get(uint16_t net_idx, uint16_t addr, uint16_t key_net_idx, uint8_t *status, uint8_t *identity)

Get the Node Identity parameters.

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

Parameters:
  • net_idx – Network index to encrypt with.

  • addr – Target node address.

  • key_net_idx – Network key index the application key belongs to.

  • status – Status response parameter.

  • identity – Identity response parameter. Must be one of BT_MESH_NODE_IDENTITY_STOPPED or BT_MESH_NODE_IDENTITY_RUNNING

Returns:

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

int bt_mesh_cfg_cli_lpn_timeout_get(uint16_t net_idx, uint16_t addr, uint16_t unicast_addr, int32_t *polltimeout)

Get the Low Power Node Polltimeout parameters.

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

Parameters:
  • net_idx – Network index to encrypt with.

  • addr – Target node address.

  • unicast_addr – LPN unicast address.

  • polltimeout – Poll timeout response parameter.

Returns:

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

int32_t bt_mesh_cfg_cli_timeout_get(void)

Get the current transmission timeout value.

Returns:

The configured transmission timeout in milliseconds.

void bt_mesh_cfg_cli_timeout_set(int32_t timeout)

Set the transmission timeout value.

Parameters:
  • timeout – The new transmission timeout.

int bt_mesh_comp_p0_get(struct bt_mesh_comp_p0 *comp, struct net_buf_simple *buf)

Create a composition data page 0 representation from a buffer.

The composition data page object will take ownership over the buffer, which should not be manipulated directly after this call.

This function can be used in combination with bt_mesh_cfg_cli_comp_data_get to read out composition data page 0 from other devices:

NET_BUF_SIMPLE_DEFINE(buf, BT_MESH_RX_SDU_MAX);
struct bt_mesh_comp_p0 comp;

err = bt_mesh_cfg_cli_comp_data_get(net_idx, addr, 0, &page, &buf);
if (!err) {
        bt_mesh_comp_p0_get(&comp, &buf);
}
Parameters:
  • buf – Network buffer containing composition data.

  • comp – Composition data structure to fill.

Returns:

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

struct bt_mesh_comp_p0_elem *bt_mesh_comp_p0_elem_pull(const struct bt_mesh_comp_p0 *comp, struct bt_mesh_comp_p0_elem *elem)

Pull a composition data page 0 element from a composition data page 0 instance.

Each call to this function will pull out a new element from the composition data page, until all elements have been pulled.

Parameters:
  • comp – Composition data page

  • elem – Element to fill.

Returns:

A pointer to elem on success, or NULL if no more elements could be pulled.

uint16_t bt_mesh_comp_p0_elem_mod(struct bt_mesh_comp_p0_elem *elem, int idx)

Get a SIG model from the given composition data page 0 element.

Parameters:
  • elem – Element to read the model from.

  • idx – Index of the SIG model to read.

Returns:

The Model ID of the SIG model at the given index, or 0xffff if the index is out of bounds.

struct bt_mesh_mod_id_vnd bt_mesh_comp_p0_elem_mod_vnd(struct bt_mesh_comp_p0_elem *elem, int idx)

Get a vendor model from the given composition data page 0 element.

Parameters:
  • elem – Element to read the model from.

  • idx – Index of the vendor model to read.

Returns:

The model ID of the vendor model at the given index, or {0xffff, 0xffff} if the index is out of bounds.

struct bt_mesh_comp_p1_elem *bt_mesh_comp_p1_elem_pull(struct net_buf_simple *buf, struct bt_mesh_comp_p1_elem *elem)

Pull a Composition Data Page 1 Element from a composition data page 1 instance.

Each call to this function will pull out a new element from the composition data page, until all elements have been pulled.

Parameters:
  • buf – Composition data page 1 buffer

  • elem – Element to fill.

Returns:

A pointer to elem on success, or NULL if no more elements could be pulled.

struct bt_mesh_comp_p1_model_item *bt_mesh_comp_p1_item_pull(struct bt_mesh_comp_p1_elem *elem, struct bt_mesh_comp_p1_model_item *item)

Pull a Composition Data Page 1 Model Item from a Composition Data Page 1 Element.

Each call to this function will pull out a new item from the Composition Data Page 1 Element, until all items have been pulled.

Parameters:
  • elem – Composition data page 1 Element

  • item – Model Item to fill.

Returns:

A pointer to item on success, or NULL if no more elements could be pulled.

struct bt_mesh_comp_p1_ext_item *bt_mesh_comp_p1_pull_ext_item(struct bt_mesh_comp_p1_model_item *item, struct bt_mesh_comp_p1_ext_item *ext_item)

Pull Extended Model Item contained in Model Item.

Each call to this function will pull out a new element from the Extended Model Item, until all elements have been pulled.

Parameters:
  • item – Model Item to pull Extended Model Items from

  • ext_item – Extended Model Item to fill

Returns:

A pointer to ext_item on success, or NULL if item could not be pulled

struct bt_mesh_comp_p2_record *bt_mesh_comp_p2_record_pull(struct net_buf_simple *buf, struct bt_mesh_comp_p2_record *record)

Pull a Composition Data Page 2 Record from a composition data page 2 instance.

Each call to this function will pull out a new element from the composition data page, until all elements have been pulled.

Parameters:
  • buf – Composition data page 2 buffer

  • record – Record to fill.

Returns:

A pointer to record on success, or NULL if no more elements could be pulled.

int bt_mesh_key_idx_unpack_list(struct net_buf_simple *buf, uint16_t *dst_arr, size_t *dst_cnt)

Unpack a list of key index entries from a buffer.

On success, dst_cnt is set to the amount of unpacked key index entries.

Parameters:
  • buf – Message buffer containing encoded AppKey or NetKey Indexes.

  • dst_arr – Destination array for the unpacked list.

  • dst_cnt – Size of the destination array.

Returns:

0 on success.

Returns:

-EMSGSIZE if dst_arr size is to small to parse full message.

struct bt_mesh_cfg_cli_cb
#include <cfg_cli.h>

Mesh Configuration Client Status messages callback.

Public Members

void (*comp_data)(struct bt_mesh_cfg_cli *cli, uint16_t addr, uint8_t page, struct net_buf_simple *buf)

Optional callback for Composition data messages.

Handles received Composition data messages from a server.

Note

For decoding buf, please refer to bt_mesh_comp_p0_get and bt_mesh_comp_p1_elem_pull.

Param cli:

Client that received the status message.

Param addr:

Address of the sender.

Param page:

Composition data page.

Param buf:

Composition data buffer.

void (*mod_pub_status)(struct bt_mesh_cfg_cli *cli, uint16_t addr, uint8_t status, uint16_t elem_addr, uint16_t mod_id, uint16_t cid, struct bt_mesh_cfg_cli_mod_pub *pub)

Optional callback for Model Pub status messages.

Handles received Model Pub status messages from a server.

Param cli:

Client that received the status message.

Param addr:

Address of the sender.

Param status:

Status code for the message.

Param elem_addr:

Address of the element.

Param mod_id:

Model ID.

Param cid:

Company ID.

Param pub:

Publication configuration parameters.

void (*mod_sub_status)(struct bt_mesh_cfg_cli *cli, uint16_t addr, uint8_t status, uint16_t elem_addr, uint16_t sub_addr, uint32_t mod_id)

Optional callback for Model Sub Status messages.

Handles received Model Sub Status messages from a server.

Param cli:

Client that received the status message.

Param addr:

Address of the sender.

Param status:

Status Code for requesting message.

Param elem_addr:

The unicast address of the element.

Param sub_addr:

The sub address.

Param mod_id:

The model ID within the element.

void (*mod_sub_list)(struct bt_mesh_cfg_cli *cli, uint16_t addr, uint8_t status, uint16_t elem_addr, uint16_t mod_id, uint16_t cid, struct net_buf_simple *buf)

Optional callback for Model Sub list messages.

Handles received Model Sub list messages from a server.

Note

The buf parameter should be decoded using net_buf_simple_pull_le16 in iteration, as long as buf->len is greater than or equal to 2.

Param cli:

Client that received the status message.

Param addr:

Address of the sender.

Param status:

Status code for the message.

Param elem_addr:

Address of the element.

Param mod_id:

Model ID.

Param cid:

Company ID.

Param buf:

Message buffer containing subscription addresses.

void (*node_reset_status)(struct bt_mesh_cfg_cli *cli, uint16_t addr)

Optional callback for Node Reset Status messages.

Handles received Node Reset Status messages from a server.

Param cli:

Client that received the status message.

Param addr:

Address of the sender.

void (*beacon_status)(struct bt_mesh_cfg_cli *cli, uint16_t addr, uint8_t status)

Optional callback for Beacon Status messages.

Handles received Beacon Status messages from a server.

Param cli:

Client that received the status message.

Param addr:

Address of the sender.

Param status:

Status Code for requesting message.

void (*ttl_status)(struct bt_mesh_cfg_cli *cli, uint16_t addr, uint8_t status)

Optional callback for Default TTL Status messages.

Handles received Default TTL Status messages from a server.

Param cli:

Client that received the status message.

Param addr:

Address of the sender.

Param status:

Status Code for requesting message.

void (*friend_status)(struct bt_mesh_cfg_cli *cli, uint16_t addr, uint8_t status)

Optional callback for Friend Status messages.

Handles received Friend Status messages from a server.

Param cli:

Client that received the status message.

Param addr:

Address of the sender.

Param status:

Status Code for requesting message.

void (*gatt_proxy_status)(struct bt_mesh_cfg_cli *cli, uint16_t addr, uint8_t status)

Optional callback for GATT Proxy Status messages.

Handles received GATT Proxy Status messages from a server.

Param cli:

Client that received the status message.

Param addr:

Address of the sender.

Param status:

Status Code for requesting message.

void (*network_transmit_status)(struct bt_mesh_cfg_cli *cli, uint16_t addr, uint8_t status)

Optional callback for Network Transmit Status messages.

Handles received Network Transmit Status messages from a server.

Param cli:

Client that received the status message.

Param addr:

Address of the sender.

Param status:

Status Code for requesting message.

void (*relay_status)(struct bt_mesh_cfg_cli *cli, uint16_t addr, uint8_t status, uint8_t transmit)

Optional callback for Relay Status messages.

Handles received Relay Status messages from a server.

Param cli:

Client that received the status message.

Param addr:

Address of the sender.

Param status:

Status Code for requesting message.

Param transmit:

The relay retransmit count and interval steps.

void (*net_key_status)(struct bt_mesh_cfg_cli *cli, uint16_t addr, uint8_t status, uint16_t net_idx)

Optional callback for NetKey Status messages.

Handles received NetKey Status messages from a server.

Param cli:

Client that received the status message.

Param addr:

Address of the sender.

Param status:

Status Code for requesting message.

Param net_idx:

The index of the NetKey.

void (*net_key_list)(struct bt_mesh_cfg_cli *cli, uint16_t addr, struct net_buf_simple *buf)

Optional callback for Netkey list messages.

Handles received Netkey list messages from a server.

Note

The buf parameter should be decoded using the bt_mesh_key_idx_unpack_list helper function.

Param cli:

Client that received the status message.

Param addr:

Address of the sender.

Param buf:

Message buffer containing key indexes.

void (*app_key_status)(struct bt_mesh_cfg_cli *cli, uint16_t addr, uint8_t status, uint16_t net_idx, uint16_t app_idx)

Optional callback for AppKey Status messages.

Handles received AppKey Status messages from a server.

Param cli:

Client that received the status message.

Param addr:

Address of the sender.

Param status:

Status Code for requesting message.

Param net_idx:

The index of the NetKey.

Param app_idx:

The index of the AppKey.

void (*app_key_list)(struct bt_mesh_cfg_cli *cli, uint16_t addr, uint8_t status, uint16_t net_idx, struct net_buf_simple *buf)

Optional callback for Appkey list messages.

Handles received Appkey list messages from a server.

Note

The buf parameter should be decoded using the bt_mesh_key_idx_unpack_list helper function.

Param cli:

Client that received the status message.

Param addr:

Address of the sender.

Param status:

Status code for the message.

Param net_idx:

The index of the NetKey.

Param buf:

Message buffer containing key indexes.

void (*mod_app_status)(struct bt_mesh_cfg_cli *cli, uint16_t addr, uint8_t status, uint16_t elem_addr, uint16_t app_idx, uint32_t mod_id)

Optional callback for Model App Status messages.

Handles received Model App Status messages from a server.

Param cli:

Client that received the status message.

Param addr:

Address of the sender.

Param status:

Status Code for requesting message.

Param elem_addr:

The unicast address of the element.

Param app_idx:

The sub address.

Param mod_id:

The model ID within the element.

void (*mod_app_list)(struct bt_mesh_cfg_cli *cli, uint16_t addr, uint8_t status, uint16_t elem_addr, uint16_t mod_id, uint16_t cid, struct net_buf_simple *buf)

Optional callback for Model App list messages.

Handles received Model App list messages from a server.

Note

The buf parameter should be decoded using the bt_mesh_key_idx_unpack_list helper function.

Param cli:

Client that received the status message.

Param addr:

Address of the sender.

Param status:

Status code for the message.

Param elem_addr:

Address of the element.

Param mod_id:

Model ID.

Param cid:

Company ID.

Param buf:

Message buffer containing key indexes.

void (*node_identity_status)(struct bt_mesh_cfg_cli *cli, uint16_t addr, uint8_t status, uint16_t net_idx, uint8_t identity)

Optional callback for Node Identity Status messages.

Handles received Node Identity Status messages from a server.

Param cli:

Client that received the status message.

Param addr:

Address of the sender.

Param status:

Status Code for requesting message.

Param net_idx:

The index of the NetKey.

Param identity:

The node identity state.

void (*lpn_timeout_status)(struct bt_mesh_cfg_cli *cli, uint16_t addr, uint16_t elem_addr, uint32_t timeout)

Optional callback for LPN PollTimeout Status messages.

Handles received LPN PollTimeout Status messages from a server.

Param cli:

Client that received the status message.

Param addr:

Address of the sender.

Param elem_addr:

The unicast address of the LPN.

Param timeout:

Current value of PollTimeout timer of the LPN.

void (*krp_status)(struct bt_mesh_cfg_cli *cli, uint16_t addr, uint8_t status, uint16_t net_idx, uint8_t phase)

Optional callback for Key Refresh Phase status messages.

Handles received Key Refresh Phase status messages from a server.

Param cli:

Client that received the status message.

Param addr:

Address of the sender.

Param status:

Status code for the message.

Param net_idx:

The index of the NetKey.

Param phase:

Phase of the KRP.

void (*hb_pub_status)(struct bt_mesh_cfg_cli *cli, uint16_t addr, uint8_t status, struct bt_mesh_cfg_cli_hb_pub *pub)

Optional callback for Heartbeat pub status messages.

Handles received Heartbeat pub status messages from a server.

Param cli:

Client that received the status message.

Param addr:

Address of the sender.

Param status:

Status code for the message.

Param pub:

HB publication configuration parameters.

void (*hb_sub_status)(struct bt_mesh_cfg_cli *cli, uint16_t addr, uint8_t status, struct bt_mesh_cfg_cli_hb_sub *sub)

Optional callback for Heartbeat Sub status messages.

Handles received Heartbeat Sub status messages from a server.

Param cli:

Client that received the status message.

Param addr:

Address of the sender.

Param status:

Status code for the message.

Param sub:

HB subscription configuration parameters.

struct bt_mesh_cfg_cli
#include <cfg_cli.h>

Mesh Configuration Client Model Context.

Public Members

const struct bt_mesh_model *model

Composition data model entry pointer.

const struct bt_mesh_cfg_cli_cb *cb

Optional callback for Mesh Configuration Client Status messages.

struct bt_mesh_cfg_cli_mod_pub
#include <cfg_cli.h>

Model publication configuration parameters.

Public Members

uint16_t addr

Publication destination address.

const uint8_t *uuid

Virtual address UUID, or NULL if this is not a virtual address.

uint16_t app_idx

Application index to publish with.

bool cred_flag

Friendship credential flag.

uint8_t ttl

Time To Live to publish with.

uint8_t period

Encoded publish period.

uint8_t transmit

Encoded transmit parameters.

See also

BT_MESH_TRANSMIT

struct bt_mesh_cfg_cli_hb_sub
#include <cfg_cli.h>

Heartbeat subscription configuration parameters.

Public Members

uint16_t src

Source address to receive Heartbeat messages from.

uint16_t dst

Destination address to receive Heartbeat messages on.

uint8_t period

Logarithmic subscription period to keep listening for.

The decoded subscription period is (1 << (period - 1)) seconds, or 0 seconds if period is 0.

uint8_t count

Logarithmic Heartbeat subscription receive count.

The decoded Heartbeat count is (1 << (count - 1)) if count is between 1 and 0xfe, 0 if count is 0 and 0xffff if count is 0xff.

Ignored in Heartbeat subscription set.

uint8_t min

Minimum hops in received messages, ie the shortest registered path from the publishing node to the subscribing node.

A Heartbeat received from an immediate neighbor has hop count = 1.

Ignored in Heartbeat subscription set.

uint8_t max

Maximum hops in received messages, ie the longest registered path from the publishing node to the subscribing node.

A Heartbeat received from an immediate neighbor has hop count = 1.

Ignored in Heartbeat subscription set.

struct bt_mesh_cfg_cli_hb_pub
#include <cfg_cli.h>

Heartbeat publication configuration parameters.

Public Members

uint16_t dst

Heartbeat destination address.

uint8_t count

Logarithmic Heartbeat count.

Decoded as (1 << (count - 1)) if count is between 1 and 0x11, 0 if count is 0, or “indefinitely” if count is 0xff.

When used in Heartbeat publication set, this parameter denotes the number of Heartbeat messages to send.

When returned from Heartbeat publication get, this parameter denotes the number of Heartbeat messages remaining to be sent.

uint8_t period

Logarithmic Heartbeat publication transmit interval in seconds.

Decoded as (1 << (period - 1)) if period is between 1 and 0x11. If period is 0, Heartbeat publication is disabled.

uint8_t ttl

Publication message Time To Live value.

uint16_t feat

Bitmap of features that trigger Heartbeat publications.

Legal values are BT_MESH_FEAT_RELAY, BT_MESH_FEAT_PROXY, BT_MESH_FEAT_FRIEND and BT_MESH_FEAT_LOW_POWER

uint16_t net_idx

Network index to publish with.

struct bt_mesh_comp_p0
#include <cfg_cli.h>

Parsed Composition data page 0 representation.

Should be pulled from the return buffer passed to bt_mesh_cfg_cli_comp_data_get using bt_mesh_comp_p0_get.

Public Members

uint16_t cid

Company ID.

uint16_t pid

Product ID.

uint16_t vid

Version ID.

uint16_t crpl

Replay protection list size.

uint16_t feat

Supported features, see BT_MESH_FEAT_SUPPORTED.

struct bt_mesh_comp_p0_elem
#include <cfg_cli.h>

Composition data page 0 element representation.

Public Members

uint16_t loc

Element location.

size_t nsig

The number of SIG models in this element.

size_t nvnd

The number of vendor models in this element.

struct bt_mesh_comp_p1_elem
#include <cfg_cli.h>

Composition data page 1 element representation.

Public Members

size_t nsig

The number of SIG models in this element.

size_t nvnd

The number of vendor models in this element.

struct bt_mesh_comp_p1_model_item
#include <cfg_cli.h>

Composition data page 1 model item representation.

Public Members

bool cor_present

Corresponding_Group_ID field indicator.

bool format

Determines the format of Extended Model Item.

uint8_t ext_item_cnt

Number of items in Extended Model Items.

uint8_t cor_id

Buffer containing Extended Model Items.

If cor_present is set to 1 it starts with Corresponding_Group_ID

struct bt_mesh_comp_p1_item_short
#include <cfg_cli.h>

Extended Model Item in short representation.

Public Members

uint8_t elem_offset

Element address modifier.

uint8_t mod_item_idx

Model Index.

struct bt_mesh_comp_p1_item_long
#include <cfg_cli.h>

Extended Model Item in long representation.

Public Members

uint8_t elem_offset

Element address modifier.

uint8_t mod_item_idx

Model Index.

struct bt_mesh_comp_p1_ext_item
#include <cfg_cli.h>

Extended Model Item.

Public Members

struct bt_mesh_comp_p1_item_short short_item

Item in short representation.

struct bt_mesh_comp_p1_item_long long_item

Item in long representation.

struct bt_mesh_comp_p2_record
#include <cfg_cli.h>

Composition data page 2 record parsing structure.

Public Members

uint16_t id

Mesh profile ID.

uint8_t x

Major version.

uint8_t y

Minor version.

uint8_t z

Z version.

struct bt_mesh_comp_p2_record version

Mesh Profile Version.

struct net_buf_simple *elem_buf

Element offset buffer.

struct net_buf_simple *data_buf

Additional data buffer.