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

On-Demand Private Proxy Client

The On-Demand Private Proxy Client model is a foundation model defined by the Bluetooth Mesh specification. The model is optional, and is enabled with the CONFIG_BT_MESH_OD_PRIV_PROXY_CLI option.

Introduced in Bluetooth Mesh Protocol Specification version 1.1, the On-Demand Private Proxy Client model is used to set and retrieve the On-Demand Private GATT Proxy state. This state defines when a node advertises the Mesh Proxy Service with a Private Network Identifier Type after receiving a request PDU.

The On-Demand Private Proxy Client model communicates with the On-Demand Private Proxy Server model using the device key of the node that contains the target On-Demand Private Proxy Server model instance.

If present, the On-Demand Private Proxy Client model must only be instantiated on the primary element.

Configuration

The behavior of the On-Demand Private Proxy Client model can be configured using the transmission timeout option CONFIG_BT_MESH_OD_PRIV_PROXY_CLI_TIMEOUT. This option controls the time (in milliseconds) that the client waits for a status response message to arrive. The value can be changed at runtime using bt_mesh_od_priv_proxy_cli_timeout_set().

API Reference

group bt_mesh_od_priv_proxy_cli

Defines

BT_MESH_MODEL_OD_PRIV_PROXY_CLI(cli_data)

On-Demand Private Proxy Client model composition data entry.

Functions

int bt_mesh_od_priv_proxy_cli_get(uint16_t net_idx, uint16_t addr, uint8_t *val_rsp)

Get the target’s On-Demand Private GATT Proxy state.

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

To process the response arguments of an async method, register the od_status callback in bt_mesh_od_priv_proxy_cli struct.

Parameters:
  • net_idx – Network index to encrypt with.

  • addr – Target node address.

  • val_rsp – Response buffer for On-Demand Private GATT Proxy value.

Returns:

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

int bt_mesh_od_priv_proxy_cli_set(uint16_t net_idx, uint16_t addr, uint8_t val, uint8_t *val_rsp)

Set the target’s On-Demand Private GATT Proxy state.

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

To process the response arguments of an async method, register the od_status callback in bt_mesh_od_priv_proxy_cli struct.

Parameters:
  • net_idx – Network index to encrypt with.

  • addr – Target node address.

  • val – On-Demand Private GATT Proxy state to be set

  • val_rsp – Response buffer for On-Demand Private GATT Proxy value.

Returns:

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

void bt_mesh_od_priv_proxy_cli_timeout_set(int32_t timeout)

Set the transmission timeout value.

Parameters:

timeout – The new transmission timeout in milliseconds.

struct bt_mesh_od_priv_proxy_cli

On-Demand Private Proxy Client Model Context

Public Members

struct bt_mesh_model *model

Solicitation PDU RPL model entry pointer.

void (*od_status)(struct bt_mesh_od_priv_proxy_cli *cli, uint16_t addr, uint8_t state)

Optional callback for On-Demand Private Proxy Status messages.

Handles received On-Demand Private Proxy Status messages from a On-Demand Private Proxy server.The state param represents state of On-Demand Private Proxy server.

Param cli:

On-Demand Private Proxy client that received the status message.

Param addr:

Address of the sender.

Param state:

State value.