nRF Connect SDK API 2.8.99
Loading...
Searching...
No Matches
gen_plvl_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
14#ifndef BT_MESH_GEN_PLVL_CLI_H__
15#define BT_MESH_GEN_PLVL_CLI_H__
16
18
19#ifdef __cplusplus
20extern "C" {
21#endif
22
23struct bt_mesh_plvl_cli;
24
32#define BT_MESH_PLVL_CLI_INIT(_handlers) \
33 { \
34 .handlers = _handlers, \
35 }
36
43#define BT_MESH_MODEL_PLVL_CLI(_cli) \
44 BT_MESH_MODEL_CB(BT_MESH_MODEL_ID_GEN_POWER_LEVEL_CLI, \
45 _bt_mesh_plvl_cli_op, &(_cli)->pub, \
46 BT_MESH_MODEL_USER_DATA(struct bt_mesh_plvl_cli, \
47 _cli), \
48 &_bt_mesh_plvl_cli_cb)
49
59 void (*const power_status)(struct bt_mesh_plvl_cli *cli,
60 struct bt_mesh_msg_ctx *ctx,
61 const struct bt_mesh_plvl_status *status);
62
69 void (*const default_status)(struct bt_mesh_plvl_cli *cli,
70 struct bt_mesh_msg_ctx *ctx,
71 uint16_t default_power);
72
79 void (*const range_status)(
80 struct bt_mesh_plvl_cli *cli, struct bt_mesh_msg_ctx *ctx,
81 const struct bt_mesh_plvl_range_status *status);
82
89 void (*const last_status)(struct bt_mesh_plvl_cli *cli,
90 struct bt_mesh_msg_ctx *ctx, uint16_t last);
91};
92
99 const struct bt_mesh_model *model;
101 struct bt_mesh_model_pub pub;
102 /* Publication buffer */
103 struct net_buf_simple pub_buf;
104 /* Publication data */
105 uint8_t pub_data[BT_MESH_MODEL_BUF_LEN(
106 BT_MESH_PLVL_OP_LEVEL_SET, BT_MESH_PLVL_MSG_MAXLEN_LEVEL_SET)];
108 struct bt_mesh_msg_ack_ctx ack_ctx;
110 uint8_t tid;
113};
114
134 struct bt_mesh_msg_ctx *ctx,
135 struct bt_mesh_plvl_status *rsp);
136
158 struct bt_mesh_msg_ctx *ctx,
159 const struct bt_mesh_plvl_set *set,
160 struct bt_mesh_plvl_status *rsp);
161
176 struct bt_mesh_msg_ctx *ctx,
177 const struct bt_mesh_plvl_set *set);
178
198 struct bt_mesh_msg_ctx *ctx,
199 struct bt_mesh_plvl_range_status *rsp);
200
221 struct bt_mesh_msg_ctx *ctx,
222 const struct bt_mesh_plvl_range *range,
223 struct bt_mesh_plvl_range_status *rsp);
224
239 struct bt_mesh_msg_ctx *ctx,
240 const struct bt_mesh_plvl_range *range);
241
261 struct bt_mesh_msg_ctx *ctx, uint16_t *rsp);
262
283 struct bt_mesh_msg_ctx *ctx,
284 uint16_t default_power, uint16_t *rsp);
285
302 struct bt_mesh_msg_ctx *ctx,
303 uint16_t default_power);
304
327 struct bt_mesh_msg_ctx *ctx, uint16_t *rsp);
328
330extern const struct bt_mesh_model_op _bt_mesh_plvl_cli_op[];
331extern const struct bt_mesh_model_cb _bt_mesh_plvl_cli_cb;
334#ifdef __cplusplus
335}
336#endif
337
338#endif /* BT_MESH_GEN_PLVL_CLI_H__ */
339
int bt_mesh_plvl_cli_power_set_unack(struct bt_mesh_plvl_cli *cli, struct bt_mesh_msg_ctx *ctx, const struct bt_mesh_plvl_set *set)
Set the Power Level of the server without requesting a response.
int bt_mesh_plvl_cli_default_set(struct bt_mesh_plvl_cli *cli, struct bt_mesh_msg_ctx *ctx, uint16_t default_power, uint16_t *rsp)
Set the Default Power state in the server.
int bt_mesh_plvl_cli_range_set(struct bt_mesh_plvl_cli *cli, struct bt_mesh_msg_ctx *ctx, const struct bt_mesh_plvl_range *range, struct bt_mesh_plvl_range_status *rsp)
Set the Power Range state in the server.
int bt_mesh_plvl_cli_power_set(struct bt_mesh_plvl_cli *cli, struct bt_mesh_msg_ctx *ctx, const struct bt_mesh_plvl_set *set, struct bt_mesh_plvl_status *rsp)
Set the Power Level of the server.
int bt_mesh_plvl_cli_range_get(struct bt_mesh_plvl_cli *cli, struct bt_mesh_msg_ctx *ctx, struct bt_mesh_plvl_range_status *rsp)
Get the Power Range of the bound server.
int bt_mesh_plvl_cli_power_get(struct bt_mesh_plvl_cli *cli, struct bt_mesh_msg_ctx *ctx, struct bt_mesh_plvl_status *rsp)
Get the Power Level of the bound server.
int bt_mesh_plvl_cli_default_set_unack(struct bt_mesh_plvl_cli *cli, struct bt_mesh_msg_ctx *ctx, uint16_t default_power)
Set the Default Power state in the server without requesting a response.
int bt_mesh_plvl_cli_default_get(struct bt_mesh_plvl_cli *cli, struct bt_mesh_msg_ctx *ctx, uint16_t *rsp)
Get the Default Power of the bound server.
int bt_mesh_plvl_cli_range_set_unack(struct bt_mesh_plvl_cli *cli, struct bt_mesh_msg_ctx *ctx, const struct bt_mesh_plvl_range *range)
Set the Power Range state in the server without requesting a response.
int bt_mesh_plvl_cli_last_get(struct bt_mesh_plvl_cli *cli, struct bt_mesh_msg_ctx *ctx, uint16_t *rsp)
Get the last non-zero Power Level of the bound server.
void(*const default_status)(struct bt_mesh_plvl_cli *cli, struct bt_mesh_msg_ctx *ctx, uint16_t default_power)
Default Power status message handler.
Definition gen_plvl_cli.h:69
void(*const power_status)(struct bt_mesh_plvl_cli *cli, struct bt_mesh_msg_ctx *ctx, const struct bt_mesh_plvl_status *status)
Power Level status message handler.
Definition gen_plvl_cli.h:59
void(*const last_status)(struct bt_mesh_plvl_cli *cli, struct bt_mesh_msg_ctx *ctx, uint16_t last)
Last non-zero Power Level status message handler.
Definition gen_plvl_cli.h:89
void(*const range_status)(struct bt_mesh_plvl_cli *cli, struct bt_mesh_msg_ctx *ctx, const struct bt_mesh_plvl_range_status *status)
Power Range status message handler.
Definition gen_plvl_cli.h:79
Definition gen_plvl_cli.h:51
uint8_t tid
Definition gen_plvl_cli.h:110
struct bt_mesh_msg_ack_ctx ack_ctx
Definition gen_plvl_cli.h:108
struct bt_mesh_model_pub pub
Definition gen_plvl_cli.h:101
struct net_buf_simple pub_buf
Definition gen_plvl_cli.h:103
uint8_t pub_data[BT_MESH_MODEL_BUF_LEN(BT_MESH_PLVL_OP_LEVEL_SET, BT_MESH_PLVL_MSG_MAXLEN_LEVEL_SET)]
Definition gen_plvl_cli.h:106
const struct bt_mesh_model * model
Definition gen_plvl_cli.h:99
const struct bt_mesh_plvl_cli_handlers *const handlers
Definition gen_plvl_cli.h:112
Definition gen_plvl_cli.h:97
Definition gen_plvl.h:59
Definition gen_plvl.h:53
Definition gen_plvl.h:25
Definition gen_plvl.h:39