nRF Connect SDK API 0.1.0
Loading...
Searching...
No Matches
scene_cli.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2020 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5 */
6
14#ifndef BT_MESH_SCENE_CLI_H__
15#define BT_MESH_SCENE_CLI_H__
16
18
19#ifdef __cplusplus
20extern "C" {
21#endif
22
24
31#define BT_MESH_MODEL_SCENE_CLI(_cli) \
32 BT_MESH_MODEL_CB(BT_MESH_MODEL_ID_SCENE_CLI, _bt_mesh_scene_cli_op, \
33 &(_cli)->pub, \
34 BT_MESH_MODEL_USER_DATA(struct bt_mesh_scene_cli, \
35 _cli), \
36 &_bt_mesh_scene_cli_cb)
37
43 uint16_t current;
45 size_t count;
47 __packed uint16_t *scenes;
48};
49
58 void (*status)(struct bt_mesh_scene_cli *cli,
59 struct bt_mesh_msg_ctx *ctx,
60 const struct bt_mesh_scene_state *state);
61
68 void (*scene_register)(struct bt_mesh_scene_cli *cli,
69 struct bt_mesh_msg_ctx *ctx,
70 const struct bt_mesh_scene_register *reg);
71
72 /* Composition data entry pointer. */
73 const struct bt_mesh_model *model;
74 /* Model publication parameters. */
75 struct bt_mesh_model_pub pub;
76 /* Publication message */
77 struct net_buf_simple pub_msg;
78 /* Publication message buffer. */
79 uint8_t buf[BT_MESH_MODEL_BUF_LEN(BT_MESH_SCENE_OP_RECALL,
80 BT_MESH_SCENE_MSG_MAXLEN_RECALL)];
81 /* Ack context */
82 struct bt_mesh_msg_ack_ctx ack_ctx;
83 /* Transaction ID */
84 uint8_t tid;
85};
86
105 struct bt_mesh_msg_ctx *ctx,
106 struct bt_mesh_scene_state *rsp);
107
130 struct bt_mesh_msg_ctx *ctx,
131 struct bt_mesh_scene_register *rsp);
132
157 struct bt_mesh_msg_ctx *ctx, uint16_t scene,
158 struct bt_mesh_scene_register *rsp);
159
174 struct bt_mesh_msg_ctx *ctx, uint16_t scene);
175
200 struct bt_mesh_msg_ctx *ctx, uint16_t scene,
201 struct bt_mesh_scene_register *rsp);
202
217 struct bt_mesh_msg_ctx *ctx, uint16_t scene);
218
244 struct bt_mesh_msg_ctx *ctx, uint16_t scene,
245 const struct bt_mesh_model_transition *transition,
246 struct bt_mesh_scene_state *rsp);
247
267 struct bt_mesh_scene_cli *cli, struct bt_mesh_msg_ctx *ctx,
268 uint16_t scene, const struct bt_mesh_model_transition *transition);
269
271extern const struct bt_mesh_model_op _bt_mesh_scene_cli_op[];
272extern const struct bt_mesh_model_cb _bt_mesh_scene_cli_cb;
275#ifdef __cplusplus
276}
277#endif
278
279#endif /* BT_MESH_SCENE_CLI_H__ */
280
int bt_mesh_scene_cli_register_get(struct bt_mesh_scene_cli *cli, struct bt_mesh_msg_ctx *ctx, struct bt_mesh_scene_register *rsp)
Get the full scene register of a Scene Server.
int bt_mesh_scene_cli_store(struct bt_mesh_scene_cli *cli, struct bt_mesh_msg_ctx *ctx, uint16_t scene, struct bt_mesh_scene_register *rsp)
Store the current state as a scene.
int bt_mesh_scene_cli_delete_unack(struct bt_mesh_scene_cli *cli, struct bt_mesh_msg_ctx *ctx, uint16_t scene)
Delete the given scene without requesting a response.
int bt_mesh_scene_cli_get(struct bt_mesh_scene_cli *cli, struct bt_mesh_msg_ctx *ctx, struct bt_mesh_scene_state *rsp)
Get the current state of a Scene Server.
int bt_mesh_scene_cli_store_unack(struct bt_mesh_scene_cli *cli, struct bt_mesh_msg_ctx *ctx, uint16_t scene)
Store the current state as a scene without requesting a response.
int bt_mesh_scene_cli_recall(struct bt_mesh_scene_cli *cli, struct bt_mesh_msg_ctx *ctx, uint16_t scene, const struct bt_mesh_model_transition *transition, struct bt_mesh_scene_state *rsp)
Recall the given scene.
int bt_mesh_scene_cli_recall_unack(struct bt_mesh_scene_cli *cli, struct bt_mesh_msg_ctx *ctx, uint16_t scene, const struct bt_mesh_model_transition *transition)
Recall the given scene without requesting a response.
int bt_mesh_scene_cli_delete(struct bt_mesh_scene_cli *cli, struct bt_mesh_msg_ctx *ctx, uint16_t scene, struct bt_mesh_scene_register *rsp)
Delete the given scene.
bt_mesh_scene_status
Definition: scene.h:27
Definition: model_types.h:37
void(* status)(struct bt_mesh_scene_cli *cli, struct bt_mesh_msg_ctx *ctx, const struct bt_mesh_scene_state *state)
Status message callback.
Definition: scene_cli.h:58
struct bt_mesh_model_pub pub
Definition: scene_cli.h:75
struct bt_mesh_msg_ack_ctx ack_ctx
Definition: scene_cli.h:82
uint8_t buf[BT_MESH_MODEL_BUF_LEN(BT_MESH_SCENE_OP_RECALL, BT_MESH_SCENE_MSG_MAXLEN_RECALL)]
Definition: scene_cli.h:80
void(* scene_register)(struct bt_mesh_scene_cli *cli, struct bt_mesh_msg_ctx *ctx, const struct bt_mesh_scene_register *reg)
Scene register message callback.
Definition: scene_cli.h:68
struct net_buf_simple pub_msg
Definition: scene_cli.h:77
const struct bt_mesh_model * model
Definition: scene_cli.h:73
uint8_t tid
Definition: scene_cli.h:84
Definition: scene_cli.h:51
enum bt_mesh_scene_status status
Definition: scene_cli.h:41
uint16_t current
Definition: scene_cli.h:43
uint16_t * scenes
Definition: scene_cli.h:47
size_t count
Definition: scene_cli.h:45
Definition: scene_cli.h:39
Definition: scene.h:37
enum state_type state