nRF Connect SDK API 0.1.0
Loading...
Searching...
No Matches
gen_ponoff_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_PONOFF_CLI_H__
14#define BT_MESH_GEN_PONOFF_CLI_H__
15
18
19#ifdef __cplusplus
20extern "C" {
21#endif
22
24
31#define BT_MESH_PONOFF_CLI_INIT(_power_onoff_status_handler) \
32 { \
33 .status_handler = _power_onoff_status_handler, \
34 }
35
42#define BT_MESH_MODEL_PONOFF_CLI(_cli) \
43 BT_MESH_MODEL_CB(BT_MESH_MODEL_ID_GEN_POWER_ONOFF_CLI, \
44 _bt_mesh_ponoff_cli_op, &(_cli)->pub, \
45 BT_MESH_MODEL_USER_DATA( \
46 struct bt_mesh_ponoff_cli, _cli), \
47 &_bt_mesh_ponoff_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(BT_MESH_PONOFF_OP_SET,
63 BT_MESH_PONOFF_MSG_LEN_SET)];
65 struct bt_mesh_msg_ack_ctx ack_ctx;
66
73 void (*const status_handler)(struct bt_mesh_ponoff_cli *cli,
74 struct bt_mesh_msg_ctx *ctx,
75 enum bt_mesh_on_power_up on_power_up);
76};
77
99 struct bt_mesh_msg_ctx *ctx,
100 enum bt_mesh_on_power_up *rsp);
101
124 struct bt_mesh_msg_ctx *ctx,
125 enum bt_mesh_on_power_up on_power_up,
126 enum bt_mesh_on_power_up *rsp);
127
141 struct bt_mesh_ponoff_cli *cli, struct bt_mesh_msg_ctx *ctx,
142 enum bt_mesh_on_power_up on_power_up);
143
145extern const struct bt_mesh_model_op _bt_mesh_ponoff_cli_op[];
146extern const struct bt_mesh_model_cb _bt_mesh_ponoff_cli_cb;
149#ifdef __cplusplus
150}
151#endif
152
153#endif /* BT_MESH_GEN_PONOFF_CLI_H__ */
154
int bt_mesh_ponoff_cli_on_power_up_get(struct bt_mesh_ponoff_cli *cli, struct bt_mesh_msg_ctx *ctx, enum bt_mesh_on_power_up *rsp)
Get the OnPowerUp state of a server.
int bt_mesh_ponoff_cli_on_power_up_set_unack(struct bt_mesh_ponoff_cli *cli, struct bt_mesh_msg_ctx *ctx, enum bt_mesh_on_power_up on_power_up)
Set the OnPowerUp state of a server without requesting a response.
int bt_mesh_ponoff_cli_on_power_up_set(struct bt_mesh_ponoff_cli *cli, struct bt_mesh_msg_ctx *ctx, enum bt_mesh_on_power_up on_power_up, enum bt_mesh_on_power_up *rsp)
Set the OnPowerUp state of a server.
bt_mesh_on_power_up
Definition: gen_ponoff.h:24
struct net_buf_simple pub_buf
Definition: gen_ponoff_cli.h:60
struct bt_mesh_model_pub pub
Definition: gen_ponoff_cli.h:58
struct bt_mesh_msg_ack_ctx ack_ctx
Definition: gen_ponoff_cli.h:65
void(*const status_handler)(struct bt_mesh_ponoff_cli *cli, struct bt_mesh_msg_ctx *ctx, enum bt_mesh_on_power_up on_power_up)
OnPowerUp status message handler.
Definition: gen_ponoff_cli.h:73
const struct bt_mesh_model * model
Definition: gen_ponoff_cli.h:56
uint8_t pub_data[BT_MESH_MODEL_BUF_LEN(BT_MESH_PONOFF_OP_SET, BT_MESH_PONOFF_MSG_LEN_SET)]
Definition: gen_ponoff_cli.h:63
Definition: gen_ponoff_cli.h:54