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.
API documentation
include/bluetooth/mesh/light_xyl_cli.h
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
_cli – [in] Pointer to a Light xyL Client model instance.
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.
-
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)
-
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.
-
struct bt_mesh_model *model
-
BT_MESH_MODEL_LIGHT_XYL_CLI(_cli)