14#ifndef BT_MESH_GEN_PONOFF_SRV_H__
15#define BT_MESH_GEN_PONOFF_SRV_H__
17#include <zephyr/bluetooth/mesh.h>
39#define BT_MESH_PONOFF_SRV_INIT(_onoff_handlers, _dtt_change_handler, \
40 _on_power_up_change_handler) \
42 .onoff = BT_MESH_ONOFF_SRV_INIT( \
43 &_bt_mesh_ponoff_onoff_intercept), \
44 .dtt = BT_MESH_DTT_SRV_INIT(_dtt_change_handler), \
45 .onoff_handlers = _onoff_handlers, \
46 .update = _on_power_up_change_handler, \
55#define BT_MESH_MODEL_PONOFF_SRV(_srv) \
56 BT_MESH_MODEL_ONOFF_SRV(&(_srv)->onoff), \
57 BT_MESH_MODEL_DTT_SRV(&(_srv)->dtt), \
58 BT_MESH_MODEL_CB(BT_MESH_MODEL_ID_GEN_POWER_ONOFF_SRV, \
59 _bt_mesh_ponoff_srv_op, &(_srv)->pub, \
60 BT_MESH_MODEL_USER_DATA( \
61 struct bt_mesh_ponoff_srv, _srv), \
62 &_bt_mesh_ponoff_srv_cb), \
63 BT_MESH_MODEL_CB(BT_MESH_MODEL_ID_GEN_POWER_ONOFF_SETUP_SRV, \
64 _bt_mesh_ponoff_setup_srv_op, NULL, \
65 BT_MESH_MODEL_USER_DATA( \
66 struct bt_mesh_ponoff_srv, _srv), \
67 &_bt_mesh_ponoff_setup_srv_cb)
84 struct bt_mesh_model_pub
pub;
88 uint8_t
pub_data[BT_MESH_MODEL_BUF_LEN(BT_MESH_PONOFF_OP_STATUS,
89 BT_MESH_PONOFF_MSG_LEN_STATUS)];
104 struct bt_mesh_msg_ctx *ctx,
142 struct bt_mesh_msg_ctx *ctx);
145extern const struct bt_mesh_model_cb _bt_mesh_ponoff_srv_cb;
146extern const struct bt_mesh_model_cb _bt_mesh_ponoff_setup_srv_cb;
147extern const struct bt_mesh_model_op _bt_mesh_ponoff_srv_op[];
148extern const struct bt_mesh_model_op _bt_mesh_ponoff_setup_srv_op[];
int bt_mesh_ponoff_srv_pub(struct bt_mesh_ponoff_srv *srv, struct bt_mesh_msg_ctx *ctx)
Publish the current OnPowerUp state.
void bt_mesh_ponoff_srv_set(struct bt_mesh_ponoff_srv *srv, enum bt_mesh_on_power_up on_power_up)
Set the OnPowerUp state of a Power OnOff server.
bt_mesh_on_power_up
Definition: gen_ponoff.h:24
Definition: gen_dtt_srv.h:54
Definition: gen_onoff_srv.h:52
Definition: gen_onoff_srv.h:92
struct bt_mesh_onoff_srv onoff
Definition: gen_ponoff_srv.h:76
const struct bt_mesh_onoff_srv_handlers *const onoff_handlers
Definition: gen_ponoff_srv.h:91
struct bt_mesh_model_pub pub
Definition: gen_ponoff_srv.h:84
struct net_buf_simple pub_buf
Definition: gen_ponoff_srv.h:86
enum bt_mesh_on_power_up on_power_up
Definition: gen_ponoff_srv.h:109
const struct bt_mesh_model * ponoff_setup_model
Definition: gen_ponoff_srv.h:82
uint8_t pub_data[BT_MESH_MODEL_BUF_LEN(BT_MESH_PONOFF_OP_STATUS, BT_MESH_PONOFF_MSG_LEN_STATUS)]
Definition: gen_ponoff_srv.h:89
void(*const update)(struct bt_mesh_ponoff_srv *srv, struct bt_mesh_msg_ctx *ctx, enum bt_mesh_on_power_up old_on_power_up, enum bt_mesh_on_power_up new_on_power_up)
Update handler.
Definition: gen_ponoff_srv.h:103
struct bt_mesh_dtt_srv dtt
Definition: gen_ponoff_srv.h:78
const struct bt_mesh_model * ponoff_model
Definition: gen_ponoff_srv.h:80
Definition: gen_ponoff_srv.h:74