Generic Default Transition Time Client

The Generic DTT Client remotely controls the transition time state of a Generic Default Transition Time Server.

The client can be used to set up the server’s default transition time behavior when changing states in other models on the same element.

API documentation

Header file: include/bluetooth/mesh/gen_dtt_cli.h
Source file: subsys/bluetooth/mesh/gen_dtt_cli.c
group bt_mesh_dtt_cli

API for the Generic Default Transition Time (DTT) Client.

Defines

BT_MESH_DTT_CLI_INIT(_status_handler)

Initialization parameters for the Generic Default Transition Time Client API.

See

bt_mesh_dtt_cli::status_handler

Parameters
  • _status_handler[in] Optional status message handler.

BT_MESH_MODEL_DTT_CLI(_cli)

Generic DTT Client model composition data entry.

Parameters

Functions

int bt_mesh_dtt_get(struct bt_mesh_dtt_cli *cli, struct bt_mesh_msg_ctx *ctx, int32_t *rsp_transition_time)

Get the Default Transition Time of the server.

This call is blocking if the rsp_transition_time buffer is non-NULL. Otherwise, this function will return, and the response will be passed to the bt_mesh_dtt_cli::status_handler callback.

Parameters
  • cli[in] Client making the request.

  • ctx[in] Message context to use for sending, or NULL to publish with the configured parameters.

  • rsp_transition_time[out] Pointer to a response buffer, or NULL to keep from blocking. The response denotes the configured transition time in milliseconds. Can be SYS_FOREVER_MS if the current state is unknown or too large to represent.

Returns 0

Successfully retrieved the status of the bound srv.

Returns -EALREADY

A blocking operation is already in progress in this model.

Returns -EAGAIN

The request timed out.

int bt_mesh_dtt_set(struct bt_mesh_dtt_cli *cli, struct bt_mesh_msg_ctx *ctx, uint32_t transition_time, int32_t *rsp_transition_time)

Set the Default Transition Time of the server.

This call is blocking if the rsp_transition_time buffer is non-NULL. Otherwise, this function will return, and the response will be passed to the bt_mesh_dtt_cli::status_handler callback.

Parameters
  • cli[in] Client model to send on.

  • ctx[in] Message context to use for sending, or NULL to publish with the configured parameters.

  • transition_time[in] Transition time to set (in milliseconds). Must be less than BT_MESH_MODEL_TRANSITION_TIME_MAX_MS.

  • rsp_transition_time[out] Pointer to a response buffer, or NULL to keep from blocking. The response denotes the configured transition time in milliseconds. Can be SYS_FOREVER_MS if the current state is unknown or too large to represent.

Returns 0

Successfully sent the message and populated the rsp_transition_time buffer.

Returns -EINVAL

The given transition time is invalid.

Returns -EALREADY

A blocking operation is already in progress in this model.

Returns -EAGAIN

The request timed out.

int bt_mesh_dtt_set_unack(struct bt_mesh_dtt_cli *cli, struct bt_mesh_msg_ctx *ctx, uint32_t transition_time)

Set the Default Transition Time of the server without requesting a response.

Parameters
  • cli[in] Client model to send on.

  • ctx[in] Message context to use for sending, or NULL to publish with the configured parameters.

  • transition_time[in] Transition time to set (in milliseconds). Must be less than BT_MESH_MODEL_TRANSITION_TIME_MAX_MS.

Returns 0

Successfully sent the message.

Returns -EINVAL

The given transition time is invalid.

Returns -EADDRNOTAVAIL

A message context was not provided and publishing is not configured.

Returns -EAGAIN

The device has not been provisioned.

struct bt_mesh_dtt_cli
#include <gen_dtt_cli.h>

Generic DTT client structure.

Should be initialized using the BT_MESH_DTT_CLI_INIT macro.

Public Members

void (*const status_handler)(struct bt_mesh_dtt_cli *cli, struct bt_mesh_msg_ctx *ctx, int32_t transition_time)

Default Transition Time status message handler.

Parameters
  • cli[in] Client that received the message.

  • ctx[in] Message context.

  • transition_time[in] Transition time presented in the message, in milliseconds.

struct bt_mesh_msg_ack_ctx ack_ctx

Response context for tracking acknowledged messages.

struct bt_mesh_model_pub pub

Model publish parameters.

struct bt_mesh_model *model

Composition data model entry pointer.