nRF Connect SDK API 2.8.99
Loading...
Searching...
No Matches
gen_onoff_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_ONOFF_CLI_H__
15#define BT_MESH_GEN_ONOFF_CLI_H__
16
18
19#ifdef __cplusplus
20extern "C" {
21#endif
22
24
31#define BT_MESH_ONOFF_CLI_INIT(_status_handler) \
32 { \
33 .status_handler = _status_handler, \
34 }
35
42#define BT_MESH_MODEL_ONOFF_CLI(_cli) \
43 BT_MESH_MODEL_CB(BT_MESH_MODEL_ID_GEN_ONOFF_CLI, \
44 _bt_mesh_onoff_cli_op, &(_cli)->pub, \
45 BT_MESH_MODEL_USER_DATA(struct bt_mesh_onoff_cli, \
46 _cli), \
47 &_bt_mesh_onoff_cli_cb)
48
62 void (*const status_handler)(struct bt_mesh_onoff_cli *cli,
63 struct bt_mesh_msg_ctx *ctx,
64 const struct bt_mesh_onoff_status *status);
66 uint8_t tid;
68 struct bt_mesh_msg_ack_ctx ack_ctx;
70 struct bt_mesh_model_pub pub;
71 /* Publication buffer */
72 struct net_buf_simple pub_buf;
73 /* Publication data */
74 uint8_t pub_data[BT_MESH_MODEL_BUF_LEN(BT_MESH_ONOFF_OP_SET,
75 BT_MESH_ONOFF_MSG_MAXLEN_SET)];
77 const struct bt_mesh_model *model;
78};
79
99 struct bt_mesh_msg_ctx *ctx,
100 struct bt_mesh_onoff_status *rsp);
101
124 struct bt_mesh_msg_ctx *ctx,
125 const struct bt_mesh_onoff_set *set,
126 struct bt_mesh_onoff_status *rsp);
127
143 struct bt_mesh_msg_ctx *ctx,
144 const struct bt_mesh_onoff_set *set);
145
147extern const struct bt_mesh_model_op _bt_mesh_onoff_cli_op[];
148extern const struct bt_mesh_model_cb _bt_mesh_onoff_cli_cb;
151#ifdef __cplusplus
152}
153#endif
154
155#endif /* BT_MESH_GEN_ONOFF_CLI_H__ */
156
int bt_mesh_onoff_cli_set_unack(struct bt_mesh_onoff_cli *cli, struct bt_mesh_msg_ctx *ctx, const struct bt_mesh_onoff_set *set)
Set the OnOff state in the srv without requesting a response.
int bt_mesh_onoff_cli_set(struct bt_mesh_onoff_cli *cli, struct bt_mesh_msg_ctx *ctx, const struct bt_mesh_onoff_set *set, struct bt_mesh_onoff_status *rsp)
Set the OnOff state in the srv.
int bt_mesh_onoff_cli_get(struct bt_mesh_onoff_cli *cli, struct bt_mesh_msg_ctx *ctx, struct bt_mesh_onoff_status *rsp)
Get the status of the bound srv.
struct net_buf_simple pub_buf
Definition gen_onoff_cli.h:72
struct bt_mesh_msg_ack_ctx ack_ctx
Definition gen_onoff_cli.h:68
uint8_t pub_data[BT_MESH_MODEL_BUF_LEN(BT_MESH_ONOFF_OP_SET, BT_MESH_ONOFF_MSG_MAXLEN_SET)]
Definition gen_onoff_cli.h:75
struct bt_mesh_model_pub pub
Definition gen_onoff_cli.h:70
void(*const status_handler)(struct bt_mesh_onoff_cli *cli, struct bt_mesh_msg_ctx *ctx, const struct bt_mesh_onoff_status *status)
OnOff status message handler.
Definition gen_onoff_cli.h:62
const struct bt_mesh_model * model
Definition gen_onoff_cli.h:77
uint8_t tid
Definition gen_onoff_cli.h:66
Definition gen_onoff_cli.h:54
Definition gen_onoff.h:24
Definition gen_onoff.h:40