nRF Connect SDK API 0.1.0
Loading...
Searching...
No Matches
gen_lvl_cli.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2019 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5 */
6
13#ifndef BT_MESH_GEN_LVL_CLI_H__
14#define BT_MESH_GEN_LVL_CLI_H__
15
17
18#ifdef __cplusplus
19extern "C" {
20#endif
21
22struct bt_mesh_lvl_cli;
23
31#define BT_MESH_LVL_CLI_INIT(_status_handler) \
32 { \
33 .status_handler = _status_handler, \
34 }
35
42#define BT_MESH_MODEL_LVL_CLI(_cli) \
43 BT_MESH_MODEL_CB(BT_MESH_MODEL_ID_GEN_LEVEL_CLI, _bt_mesh_lvl_cli_op, \
44 &(_cli)->pub, \
45 BT_MESH_MODEL_USER_DATA(struct bt_mesh_lvl_cli, \
46 _cli), \
47 &_bt_mesh_lvl_cli_cb)
48
56 const struct bt_mesh_model *model;
58 struct bt_mesh_model_pub pub;
59 /* Publication buffer */
60 struct net_buf_simple pub_buf;
61 /* Publication data */
62 uint8_t pub_data[BT_MESH_MODEL_BUF_LEN(
63 BT_MESH_LVL_OP_DELTA_SET, BT_MESH_LVL_MSG_MAXLEN_DELTA_SET)];
65 struct bt_mesh_msg_ack_ctx ack_ctx;
67 uint8_t tid;
68
75 void (*const status_handler)(struct bt_mesh_lvl_cli *cli,
76 struct bt_mesh_msg_ctx *ctx,
77 const struct bt_mesh_lvl_status *status);
78};
79
99 struct bt_mesh_msg_ctx *ctx,
100 struct bt_mesh_lvl_status *rsp);
101
123 struct bt_mesh_msg_ctx *ctx,
124 const struct bt_mesh_lvl_set *set,
125 struct bt_mesh_lvl_status *rsp);
126
141 struct bt_mesh_msg_ctx *ctx,
142 const struct bt_mesh_lvl_set *set);
143
171 struct bt_mesh_msg_ctx *ctx,
172 const struct bt_mesh_lvl_delta_set *delta_set,
173 struct bt_mesh_lvl_status *rsp);
174
196 struct bt_mesh_lvl_cli *cli, struct bt_mesh_msg_ctx *ctx,
197 const struct bt_mesh_lvl_delta_set *delta_set);
198
231 struct bt_mesh_msg_ctx *ctx,
232 const struct bt_mesh_lvl_move_set *move_set,
233 struct bt_mesh_lvl_status *rsp);
234
261 struct bt_mesh_msg_ctx *ctx,
262 const struct bt_mesh_lvl_move_set *move_set);
263
265extern const struct bt_mesh_model_op _bt_mesh_lvl_cli_op[];
266extern const struct bt_mesh_model_cb _bt_mesh_lvl_cli_cb;
269#ifdef __cplusplus
270}
271#endif
272
273#endif /* BT_MESH_GEN_LVL_CLI_H__ */
274
int bt_mesh_lvl_cli_move_set_unack(struct bt_mesh_lvl_cli *cli, struct bt_mesh_msg_ctx *ctx, const struct bt_mesh_lvl_move_set *move_set)
Trigger a continuous level change in the server without requesting a response.
int bt_mesh_lvl_cli_get(struct bt_mesh_lvl_cli *cli, struct bt_mesh_msg_ctx *ctx, struct bt_mesh_lvl_status *rsp)
Get the status of the bound server.
int bt_mesh_lvl_cli_delta_set_unack(struct bt_mesh_lvl_cli *cli, struct bt_mesh_msg_ctx *ctx, const struct bt_mesh_lvl_delta_set *delta_set)
Trigger a differential level state change in the server without requesting a response.
int bt_mesh_lvl_cli_delta_set(struct bt_mesh_lvl_cli *cli, struct bt_mesh_msg_ctx *ctx, const struct bt_mesh_lvl_delta_set *delta_set, struct bt_mesh_lvl_status *rsp)
Trigger a differential level state change in the server.
int bt_mesh_lvl_cli_set(struct bt_mesh_lvl_cli *cli, struct bt_mesh_msg_ctx *ctx, const struct bt_mesh_lvl_set *set, struct bt_mesh_lvl_status *rsp)
Set the level state in the server.
int bt_mesh_lvl_cli_set_unack(struct bt_mesh_lvl_cli *cli, struct bt_mesh_msg_ctx *ctx, const struct bt_mesh_lvl_set *set)
Set the level state in the server without requesting a response.
int bt_mesh_lvl_cli_move_set(struct bt_mesh_lvl_cli *cli, struct bt_mesh_msg_ctx *ctx, const struct bt_mesh_lvl_move_set *move_set, struct bt_mesh_lvl_status *rsp)
Trigger a continuous level change in the server.
struct net_buf_simple pub_buf
Definition: gen_lvl_cli.h:60
void(*const status_handler)(struct bt_mesh_lvl_cli *cli, struct bt_mesh_msg_ctx *ctx, const struct bt_mesh_lvl_status *status)
Level status message handler.
Definition: gen_lvl_cli.h:75
uint8_t pub_data[BT_MESH_MODEL_BUF_LEN(BT_MESH_LVL_OP_DELTA_SET, BT_MESH_LVL_MSG_MAXLEN_DELTA_SET)]
Definition: gen_lvl_cli.h:63
struct bt_mesh_msg_ack_ctx ack_ctx
Definition: gen_lvl_cli.h:65
struct bt_mesh_model_pub pub
Definition: gen_lvl_cli.h:58
const struct bt_mesh_model * model
Definition: gen_lvl_cli.h:56
uint8_t tid
Definition: gen_lvl_cli.h:67
Definition: gen_lvl_cli.h:54
Definition: gen_lvl.h:45
Definition: gen_lvl.h:65
Definition: gen_lvl.h:29
Definition: gen_lvl.h:83