14#ifndef BT_MESH_SCENE_SRV_H__
15#define BT_MESH_SCENE_SRV_H__
18#include <zephyr/settings/settings.h>
19#include <zephyr/toolchain.h>
20#include <zephyr/sys/slist.h>
26#ifndef CONFIG_BT_MESH_SCENES_MAX
27#define CONFIG_BT_MESH_SCENES_MAX 0
36#define BT_MESH_SCENE_ENTRY_SIG(_name) \
37 static const STRUCT_SECTION_ITERABLE( \
38 bt_mesh_scene_entry, bt_mesh_scene_entry_sig_##_name)
46#define BT_MESH_SCENE_ENTRY_VND(_name) \
47 static const STRUCT_SECTION_ITERABLE( \
48 bt_mesh_scene_entry, bt_mesh_scene_entry_vnd_##_name)
58#define BT_MESH_MODEL_SCENE_SRV(_srv) \
59 BT_MESH_MODEL_CB(BT_MESH_MODEL_ID_SCENE_SRV, _bt_mesh_scene_srv_op, \
61 BT_MESH_MODEL_USER_DATA(struct bt_mesh_scene_srv, \
63 &_bt_mesh_scene_srv_cb), \
64 BT_MESH_MODEL_CB(BT_MESH_MODEL_ID_SCENE_SETUP_SRV, \
65 _bt_mesh_scene_setup_srv_op, NULL, \
66 BT_MESH_MODEL_USER_DATA(struct bt_mesh_scene_srv, \
68 &_bt_mesh_scene_setup_srv_cb)
93 struct k_work_delayable work;
100 const struct bt_mesh_model *model;
102 const struct bt_mesh_model *setup_mod;
104 struct bt_mesh_model_pub pub;
106 struct net_buf_simple pub_msg;
108 uint8_t buf[BT_MESH_MODEL_BUF_LEN(BT_MESH_SCENE_OP_STATUS,
109 BT_MESH_SCENE_MSG_MAXLEN_STATUS)];
120 struct bt_mesh_mod_id_vnd
vnd;
137 ssize_t (*
store)(
const struct bt_mesh_model *model, uint8_t data[]);
153 void (*
recall)(
const struct bt_mesh_model *model,
const uint8_t data[],
212 struct bt_mesh_msg_ctx *ctx);
239extern const struct bt_mesh_model_cb _bt_mesh_scene_srv_cb;
240extern const struct bt_mesh_model_op _bt_mesh_scene_srv_op[];
241extern const struct bt_mesh_model_cb _bt_mesh_scene_setup_srv_cb;
242extern const struct bt_mesh_model_op _bt_mesh_scene_setup_srv_op[];
uint16_t bt_mesh_scene_srv_current_scene_get(const struct bt_mesh_scene_srv *srv)
Get the current scene.
void bt_mesh_scene_invalidate(const struct bt_mesh_model *mod)
Notify the Scene Server that a Scene entry has changed.
#define CONFIG_BT_MESH_SCENES_MAX
Definition scene_srv.h:27
int bt_mesh_scene_srv_pub(struct bt_mesh_scene_srv *srv, struct bt_mesh_msg_ctx *ctx)
Publish the current Scene status.
uint16_t bt_mesh_scene_srv_target_scene_get(const struct bt_mesh_scene_srv *srv)
Get the target scene.
int bt_mesh_scene_srv_set(struct bt_mesh_scene_srv *srv, uint16_t scene, struct bt_mesh_model_transition *transition)
Set the current Scene.
Definition model_types.h:37
struct bt_mesh_mod_id_vnd vnd
Definition scene_srv.h:120
void(* recall)(const struct bt_mesh_model *model, const uint8_t data[], size_t len, struct bt_mesh_model_transition *transition)
Recall a scene based on the given scene data.
Definition scene_srv.h:153
void(* recall_complete)(const struct bt_mesh_model *model)
Recall a scene is completed.
Definition scene_srv.h:169
union bt_mesh_scene_entry::@160 id
ssize_t(* store)(const struct bt_mesh_model *model, uint8_t data[])
Store the current state as a scene.
Definition scene_srv.h:137
uint16_t sig
Definition scene_srv.h:118
size_t maxlen
Definition scene_srv.h:123
Definition scene_srv.h:114
uint16_t count
Definition scene_srv.h:75
uint16_t all[0]
Definition scene_srv.h:73
Definition scene_srv.h:71
Definition model_types.h:46