nRF Connect SDK API 2.8.99
Loading...
Searching...
No Matches
gen_battery_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_BATTERY_CLI_H__
15#define BT_MESH_GEN_BATTERY_CLI_H__
16
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
25
32#define BT_MESH_BATTERY_CLI_INIT(_status_handler) \
33 { \
34 .status_handler = _status_handler, \
35 }
36
43#define BT_MESH_MODEL_BATTERY_CLI(_cli) \
44 BT_MESH_MODEL_CB(BT_MESH_MODEL_ID_GEN_BATTERY_CLI, \
45 _bt_mesh_battery_cli_op, &(_cli)->pub, \
46 BT_MESH_MODEL_USER_DATA(struct bt_mesh_battery_cli, \
47 _cli), \
48 &_bt_mesh_battery_cli_cb)
49
63 void (*const status_handler)(
64 struct bt_mesh_battery_cli *cli, struct bt_mesh_msg_ctx *ctx,
65 const struct bt_mesh_battery_status *status);
66
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_BATTERY_OP_GET,
75 BT_MESH_BATTERY_MSG_LEN_GET)];
77 const struct bt_mesh_model *model;
78};
79
99 struct bt_mesh_msg_ctx *ctx,
100 struct bt_mesh_battery_status *rsp);
101
103extern const struct bt_mesh_model_op _bt_mesh_battery_cli_op[];
104extern const struct bt_mesh_model_cb _bt_mesh_battery_cli_cb;
107#ifdef __cplusplus
108}
109#endif
110
111#endif /* BT_MESH_GEN_BATTERY_CLI_H__ */
112
int bt_mesh_battery_cli_get(struct bt_mesh_battery_cli *cli, struct bt_mesh_msg_ctx *ctx, struct bt_mesh_battery_status *rsp)
Get the status of the bound srv.
void(*const status_handler)(struct bt_mesh_battery_cli *cli, struct bt_mesh_msg_ctx *ctx, const struct bt_mesh_battery_status *status)
Battery status message handler.
Definition gen_battery_cli.h:63
struct bt_mesh_model_pub pub
Definition gen_battery_cli.h:70
const struct bt_mesh_model * model
Definition gen_battery_cli.h:77
struct net_buf_simple pub_buf
Definition gen_battery_cli.h:72
uint8_t pub_data[BT_MESH_MODEL_BUF_LEN(BT_MESH_BATTERY_OP_GET, BT_MESH_BATTERY_MSG_LEN_GET)]
Definition gen_battery_cli.h:75
struct bt_mesh_msg_ack_ctx ack_ctx
Definition gen_battery_cli.h:68
Definition gen_battery_cli.h:55
Definition gen_battery.h:79