Light xyL Client

The xyl Client model remotely controls the state of the Light xyL Server model.

Unlike the server model, the client only creates a single model instance in the mesh composition data. The Light xyL Client can send messages to the Light xyL Server and the Light xyL Setup Server, as long as it has the right application keys.

API documentation

Header file: include/bluetooth/mesh/light_xyl_cli.h
Source file: subsys/bluetooth/mesh/light_xyl_cli.c
group bt_mesh_light_xyl_cli

API for the Light xyL Client model.

Defines

BT_MESH_MODEL_LIGHT_XYL_CLI(_cli)

Light XYL Client model composition data entry.

Parameters

Functions

int bt_mesh_light_xyl_get(struct bt_mesh_light_xyl_cli *cli, struct bt_mesh_msg_ctx *ctx, struct bt_mesh_light_xyl_status *rsp)

Get the Light xyL state of the bound server.

This call is blocking if the rsp buffer is non-NULL. Otherwise, this function will return.

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

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

  • [in] rsp: Status response buffer, or NULL to keep from blocking.

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

  • -EALREADY: A blocking request is already in progress.

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

  • -EAGAIN: The device has not been provisioned.

  • -ETIMEDOUT: The request timed out without a response.

int bt_mesh_light_xyl_set(struct bt_mesh_light_xyl_cli *cli, struct bt_mesh_msg_ctx *ctx, const struct bt_mesh_light_xyl_set_params *set, struct bt_mesh_light_xyl_status *rsp)

Set the xyL state of the server.

This call is blocking if the rsp buffer is non-NULL. Otherwise, this function will return.

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

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

  • [in] set: xyL state to set.

  • [in] rsp: Response status buffer, or NULL to keep from blocking.

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

  • -EALREADY: A blocking request is already in progress.

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

  • -EAGAIN: The device has not been provisioned.

  • -ETIMEDOUT: The request timed out without a response.

int bt_mesh_light_xyl_set_unack(struct bt_mesh_light_xyl_cli *cli, struct bt_mesh_msg_ctx *ctx, const struct bt_mesh_light_xyl_set_params *set)

Set the xyL state of the server without requesting a response.

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

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

  • [in] set: xyL state to set.

Return Value
  • 0: Successfully sent the message.

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

  • -EAGAIN: The device has not been provisioned.

int bt_mesh_light_xyl_target_get(struct bt_mesh_light_xyl_cli *cli, struct bt_mesh_msg_ctx *ctx, struct bt_mesh_light_xyl_status *rsp)

Get the Light xyL target state of the bound server.

This call is blocking if the rsp buffer is non-NULL. Otherwise, this function will return.

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

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

  • [in] rsp: Status response buffer, or NULL to keep from blocking.

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

  • -EALREADY: A blocking request is already in progress.

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

  • -EAGAIN: The device has not been provisioned.

  • -ETIMEDOUT: The request timed out without a response.

int bt_mesh_light_xyl_default_get(struct bt_mesh_light_xyl_cli *cli, struct bt_mesh_msg_ctx *ctx, struct bt_mesh_light_xyl *rsp)

Get the Light xyL default state of the bound server.

This call is blocking if the rsp buffer is non-NULL. Otherwise, this function will return.

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

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

  • [in] rsp: Status response buffer, or NULL to keep from blocking.

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

  • -EALREADY: A blocking request is already in progress.

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

  • -EAGAIN: The device has not been provisioned.

  • -ETIMEDOUT: The request timed out without a response.

int bt_mesh_light_xyl_default_set(struct bt_mesh_light_xyl_cli *cli, struct bt_mesh_msg_ctx *ctx, const struct bt_mesh_light_xyl *set, struct bt_mesh_light_xyl *rsp)

Set the default xyL value of the server.

This call is blocking if the rsp buffer is non-NULL. Otherwise, this function will return.

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

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

  • [in] set: Default xyL value to set.

  • [in] rsp: Response status buffer, or NULL to keep from blocking.

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

  • -EALREADY: A blocking request is already in progress.

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

  • -EAGAIN: The device has not been provisioned.

  • -ETIMEDOUT: The request timed out without a response.

int bt_mesh_light_xyl_default_set_unack(struct bt_mesh_light_xyl_cli *cli, struct bt_mesh_msg_ctx *ctx, const struct bt_mesh_light_xyl *set)

Set the default xyL value of the server without requesting a response.

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

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

  • [in] set: Default xyL value to set.

Return Value
  • 0: Successfully sent the message.

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

  • -EAGAIN: The device has not been provisioned.

int bt_mesh_light_xyl_range_get(struct bt_mesh_light_xyl_cli *cli, struct bt_mesh_msg_ctx *ctx, struct bt_mesh_light_xyl_range_status *rsp)

Get the Light xyL state of the bound server.

This call is blocking if the rsp buffer is non-NULL. Otherwise, this function will return.

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

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

  • [in] rsp: Status response buffer, or NULL to keep from blocking.

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

  • -EALREADY: A blocking request is already in progress.

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

  • -EAGAIN: The device has not been provisioned.

  • -ETIMEDOUT: The request timed out without a response.

int bt_mesh_light_xyl_range_set(struct bt_mesh_light_xyl_cli *cli, struct bt_mesh_msg_ctx *ctx, const struct bt_mesh_light_xy_range *set, struct bt_mesh_light_xyl_range_status *rsp)

Set the xyL Range of the server.

This call is blocking if the rsp buffer is non-NULL. Otherwise, this function will return.

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

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

  • [in] set: Range to set.

  • [in] rsp: Response status buffer, or NULL to keep from blocking.

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

  • -EALREADY: A blocking request is already in progress.

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

  • -EAGAIN: The device has not been provisioned.

  • -ETIMEDOUT: The request timed out without a response.

  • -EFAULT: Invalid input range.

int bt_mesh_light_xyl_range_set_unack(struct bt_mesh_light_xyl_cli *cli, struct bt_mesh_msg_ctx *ctx, const struct bt_mesh_light_xy_range *set)

Set the xyL Range of the server without requesting a response.

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

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

  • [in] set: Range state to set.

Return Value
  • 0: Successfully sent the message.

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

  • -EAGAIN: The device has not been provisioned.

  • -EFAULT: Invalid input range.

struct bt_mesh_light_xyl_cli_handlers
#include <light_xyl_cli.h>

Light xyL Client state access handlers.

Public Members

void (*const xyl_status)(struct bt_mesh_light_xyl_cli *cli, struct bt_mesh_msg_ctx *ctx, const struct bt_mesh_light_xyl_status *status)

xyL status message handler.

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

  • [in] ctx: Context of the message.

  • [in] status: xyL status contained in the message.

void (*const target_status)(struct bt_mesh_light_xyl_cli *cli, struct bt_mesh_msg_ctx *ctx, const struct bt_mesh_light_xyl_status *status)

xyL target status message handler.

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

  • [in] ctx: Context of the message.

  • [in] status: Target xyL status contained in the message.

void (*const range_status)(struct bt_mesh_light_xyl_cli *cli, struct bt_mesh_msg_ctx *ctx, const struct bt_mesh_light_xyl_range_status *status)

xyL Range status message handler.

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

  • [in] ctx: Context of the message.

  • [in] status: xyL Range state of the server.

void (*const default_status)(struct bt_mesh_light_xyl_cli *cli, struct bt_mesh_msg_ctx *ctx, const struct bt_mesh_light_xyl *status)

Default parameter status message handler.

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

  • [in] ctx: Context of the message.

  • [in] status: Default xyL value of the server.

struct bt_mesh_light_xyl_cli
#include <light_xyl_cli.h>

Light xyL Client instance.

Public Members

struct bt_mesh_model *model

Model entry.

struct bt_mesh_model_pub pub

Publish parameters.

struct bt_mesh_model_ack_ctx ack_ctx

Acknowledged message tracking.

uint8_t tid

Current transaction ID.

const struct bt_mesh_light_xyl_cli_handlers *handlers

Handler function structure.