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
  • [in] _status_handler: 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
  • [in] cli: Client making the request.

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

  • [out] rsp_transition_time: 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.

Return Value
  • 0: Successfully retrieved the status of the bound srv.

  • -EALREADY: A blocking operation is already in progress in this model.

  • -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
  • [in] cli: Client model to send on.

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

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

  • [out] rsp_transition_time: 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.

Return Value
  • 0: Successfully sent the message and populated the rsp_transition_time buffer.

  • -EINVAL: The given transition time is invalid.

  • -EALREADY: A blocking operation is already in progress in this model.

  • -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
  • [in] cli: Client model to send on.

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

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

Return Value
  • 0: Successfully sent the message.

  • -EINVAL: The given transition time is invalid.

  • -ENOTSUP: A message context was not provided and publishing is not supported.

  • -EADDRNOTAVAIL: A message context was not provided and publishing is not configured.

  • -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
  • [in] cli: Client that received the message.

  • [in] ctx: Message context.

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

struct bt_mesh_model_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.