nRF Connect SDK API 2.8.99
Loading...
Searching...
No Matches
lightness_cli.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2020 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5 */
6
14#ifndef BT_MESH_LIGHTNESS_CLI_H__
15#define BT_MESH_LIGHTNESS_CLI_H__
16
18
19#ifdef __cplusplus
20extern "C" {
21#endif
22
24
33#define BT_MESH_LIGHTNESS_CLI_INIT(_handlers) \
34 { \
35 .handlers = _handlers, \
36 }
37
44#define BT_MESH_MODEL_LIGHTNESS_CLI(_cli) \
45 BT_MESH_MODEL_CB(BT_MESH_MODEL_ID_LIGHT_LIGHTNESS_CLI, \
46 _bt_mesh_lightness_cli_op, &(_cli)->pub, \
47 BT_MESH_MODEL_USER_DATA(struct bt_mesh_lightness_cli, \
48 _cli), \
49 &_bt_mesh_lightness_cli_cb)
50
60 void (*const light_status)(
61 struct bt_mesh_lightness_cli *cli, struct bt_mesh_msg_ctx *ctx,
62 const struct bt_mesh_lightness_status *status);
63
70 void (*const default_status)(struct bt_mesh_lightness_cli *cli,
71 struct bt_mesh_msg_ctx *ctx,
72 uint16_t default_light);
73
80 void (*const range_status)(
81 struct bt_mesh_lightness_cli *cli, struct bt_mesh_msg_ctx *ctx,
82 const struct bt_mesh_lightness_range_status *status);
83
90 void (*const last_light_status)(struct bt_mesh_lightness_cli *cli,
91 struct bt_mesh_msg_ctx *ctx,
92 uint16_t last);
93};
94
101 const struct bt_mesh_model *model;
103 struct bt_mesh_model_pub pub;
104 /* Publication buffer */
105 struct net_buf_simple pub_buf;
106 /* Publication data */
107 uint8_t pub_data[BT_MESH_MODEL_BUF_LEN(
108 BT_MESH_LIGHTNESS_OP_SET, BT_MESH_LIGHTNESS_MSG_MAXLEN_SET)];
110 struct bt_mesh_msg_ack_ctx ack_ctx;
112 uint8_t tid;
115};
116
139 struct bt_mesh_msg_ctx *ctx,
140 struct bt_mesh_lightness_status *rsp);
141
166 struct bt_mesh_msg_ctx *ctx,
167 const struct bt_mesh_lightness_set *set,
168 struct bt_mesh_lightness_status *rsp);
169
187 struct bt_mesh_lightness_cli *cli, struct bt_mesh_msg_ctx *ctx,
188 const struct bt_mesh_lightness_set *set);
189
209 struct bt_mesh_msg_ctx *ctx,
211
232 struct bt_mesh_msg_ctx *ctx,
233 const struct bt_mesh_lightness_range *range,
235
250 struct bt_mesh_lightness_cli *cli, struct bt_mesh_msg_ctx *ctx,
251 const struct bt_mesh_lightness_range *range);
252
272 struct bt_mesh_msg_ctx *ctx, uint16_t *rsp);
273
294 struct bt_mesh_msg_ctx *ctx,
295 uint16_t default_light, uint16_t *rsp);
296
313 struct bt_mesh_msg_ctx *ctx,
314 uint16_t default_light);
315
338 struct bt_mesh_msg_ctx *ctx, uint16_t *rsp);
339
341extern const struct bt_mesh_model_op _bt_mesh_lightness_cli_op[];
342extern const struct bt_mesh_model_cb _bt_mesh_lightness_cli_cb;
345#ifdef __cplusplus
346}
347#endif
348
349#endif /* BT_MESH_LIGHTNESS_CLI_H__ */
350
int bt_mesh_lightness_cli_range_set(struct bt_mesh_lightness_cli *cli, struct bt_mesh_msg_ctx *ctx, const struct bt_mesh_lightness_range *range, struct bt_mesh_lightness_range_status *rsp)
Set the Light Range state in the server.
int bt_mesh_lightness_cli_default_get(struct bt_mesh_lightness_cli *cli, struct bt_mesh_msg_ctx *ctx, uint16_t *rsp)
Get the Default Light of the bound server.
int bt_mesh_lightness_cli_last_get(struct bt_mesh_lightness_cli *cli, struct bt_mesh_msg_ctx *ctx, uint16_t *rsp)
Get the last non-zero Light Level of the bound server.
int bt_mesh_lightness_cli_light_set_unack(struct bt_mesh_lightness_cli *cli, struct bt_mesh_msg_ctx *ctx, const struct bt_mesh_lightness_set *set)
Set the Light Level of the server without requesting a response.
int bt_mesh_lightness_cli_range_get(struct bt_mesh_lightness_cli *cli, struct bt_mesh_msg_ctx *ctx, struct bt_mesh_lightness_range_status *rsp)
Get the Light Range of the bound server.
int bt_mesh_lightness_cli_light_set(struct bt_mesh_lightness_cli *cli, struct bt_mesh_msg_ctx *ctx, const struct bt_mesh_lightness_set *set, struct bt_mesh_lightness_status *rsp)
Set the Light Level of the server.
int bt_mesh_lightness_cli_default_set_unack(struct bt_mesh_lightness_cli *cli, struct bt_mesh_msg_ctx *ctx, uint16_t default_light)
Set the Default Light state in the server without requesting a response.
int bt_mesh_lightness_cli_light_get(struct bt_mesh_lightness_cli *cli, struct bt_mesh_msg_ctx *ctx, struct bt_mesh_lightness_status *rsp)
Get the Light Level of the bound server.
int bt_mesh_lightness_cli_default_set(struct bt_mesh_lightness_cli *cli, struct bt_mesh_msg_ctx *ctx, uint16_t default_light, uint16_t *rsp)
Set the Default Light state in the server.
int bt_mesh_lightness_cli_range_set_unack(struct bt_mesh_lightness_cli *cli, struct bt_mesh_msg_ctx *ctx, const struct bt_mesh_lightness_range *range)
Set the Light Range state in the server without requesting a response.
void(*const range_status)(struct bt_mesh_lightness_cli *cli, struct bt_mesh_msg_ctx *ctx, const struct bt_mesh_lightness_range_status *status)
Light Range status message handler.
Definition lightness_cli.h:80
void(*const light_status)(struct bt_mesh_lightness_cli *cli, struct bt_mesh_msg_ctx *ctx, const struct bt_mesh_lightness_status *status)
Light Level status message handler.
Definition lightness_cli.h:60
void(*const default_status)(struct bt_mesh_lightness_cli *cli, struct bt_mesh_msg_ctx *ctx, uint16_t default_light)
Default Light status message handler.
Definition lightness_cli.h:70
void(*const last_light_status)(struct bt_mesh_lightness_cli *cli, struct bt_mesh_msg_ctx *ctx, uint16_t last)
Last non-zero Light Level status message handler.
Definition lightness_cli.h:90
Definition lightness_cli.h:52
const struct bt_mesh_lightness_cli_handlers *const handlers
Definition lightness_cli.h:114
struct bt_mesh_msg_ack_ctx ack_ctx
Definition lightness_cli.h:110
struct net_buf_simple pub_buf
Definition lightness_cli.h:105
struct bt_mesh_model_pub pub
Definition lightness_cli.h:103
uint8_t tid
Definition lightness_cli.h:112
uint8_t pub_data[BT_MESH_MODEL_BUF_LEN(BT_MESH_LIGHTNESS_OP_SET, BT_MESH_LIGHTNESS_MSG_MAXLEN_SET)]
Definition lightness_cli.h:108
const struct bt_mesh_model * model
Definition lightness_cli.h:101
Definition lightness_cli.h:99
Definition lightness.h:64
Definition lightness.h:58
Definition lightness.h:30
Definition lightness.h:44