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.

Extended models

None.

Persistent storage

None.

Shell commands

The Bluetooth mesh shell subsystem provides a set of commands to interact with the Light xyL Client model instantiated on a device.

To make these commands available, enable the following Kconfig options:

mesh models xyl instance get-all

Print all instances of the Light xyL Client model on the device.

mesh models xyl instance set <ElemIdx>

Select the Light xyL Client model instantiated on the specified element ID. This instance will be used in message sending. If no model instance is selected, the first model instance found on the device will be used by default.

  • ElemIdx - Element index where the model instance is found.

mesh models xyl get

Get the Light xyL state value of the bound server.

mesh models xyl set <Light> <X> <Y> [TransTime(ms) [Delay(ms)]]

Set the Light xyL state value and wait for a response.

  • Light - Lightness level to set.

  • X - x level to set.

  • Y - y level to set.

  • TransTime - If present, defines the transition time in the message in milliseconds.

  • Delay - If present, defines the delay in the message in milliseconds.

mesh models xyl set-unack <Light> <X> <Y> [TransTime(ms) [Delay(ms)]]

Set the Light xyL state value without requesting a response.

  • Light - Lightness level to set.

  • X - x level to set.

  • Y - y level to set.

  • TransTime - If present, defines the transition time in the message in milliseconds.

  • Delay - If present, defines the delay in the message in milliseconds.

mesh models xyl target-get

Get the Light xyL target state value of the bound server.

mesh models xyl default-get

Get the default xyL value of the bound server.

mesh models xyl default-set <Light> <X> <Y>

Set the default xyL value of the server and wait for a response.

  • Light - Default lightness level to be set.

  • X - Default x level to be set.

  • Y - Default y level to be set.

mesh models xyl default-set-unack <Light> <X> <Y>

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

  • Light - Default lightness level to be set.

  • X - Default x level to be set.

  • Y - Default y level to be set.

mesh models xyl range-get

Get the Light xyL Range state value of the bound server.

mesh models xyl range-set <XMin> <YMin> <XMax> <YMax>

Set the Light xyL Range state value and wait for a response.

  • XMin - Minimum allowed x value.

  • YMin - Minimum allowed y value.

  • XMax - Maximum allowed x value.

  • YMax - Maximum allowed y value.

mesh models xyl range-set-unack <XMin> <YMin> <XMax> <YMax>

Set the Light xyL Range state value without requesting a response.

  • XMin - Minimum allowed x value.

  • YMin - Minimum allowed y value.

  • XMax - Maximum allowed x value.

  • YMax - Maximum allowed y value.

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

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

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

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

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

  • set[in] xyL state to set.

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

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

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

  • set[in] xyL state to set.

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

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

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

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

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

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

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

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

  • set[in] Default xyL value to set.

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

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

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

  • set[in] Default xyL value to set.

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

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

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

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

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

  • set[in] Range to set.

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

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

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

  • set[in] Range state to set.

Return values:
  • 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.

Param cli:

[in] Client that received the status message.

Param ctx:

[in] Context of the message.

Param status:

[in] 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.

Param cli:

[in] Client that received the status message.

Param ctx:

[in] Context of the message.

Param status:

[in] 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.

Param cli:

[in] Client that received the status message.

Param ctx:

[in] Context of the message.

Param status:

[in] 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.

Param cli:

[in] Client that received the status message.

Param ctx:

[in] Context of the message.

Param status:

[in] 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_msg_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.