nRF Connect SDK API 0.1.0
Loading...
Searching...
No Matches
scheduler_cli.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2021 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5 */
6
14#ifndef BT_MESH_SCHEDULER_CLI_H__
15#define BT_MESH_SCHEDULER_CLI_H__
16
18
19#ifdef __cplusplus
20extern "C" {
21#endif
22
24
31#define BT_MESH_MODEL_SCHEDULER_CLI(_cli) \
32 BT_MESH_MODEL_CB(BT_MESH_MODEL_ID_SCHEDULER_CLI, \
33 _bt_mesh_scheduler_cli_op, \
34 &(_cli)->pub, \
35 BT_MESH_MODEL_USER_DATA(struct bt_mesh_scheduler_cli,\
36 _cli), \
37 &_bt_mesh_scheduler_cli_cb)
38
48 struct bt_mesh_msg_ctx *ctx,
49 uint16_t schedules);
50
60 struct bt_mesh_msg_ctx *ctx,
61 uint8_t idx,
62 const struct bt_mesh_schedule_entry *action);
63
64 /* Composition data entry pointer. */
65 const struct bt_mesh_model *model;
66 /* Model publication parameters. */
67 struct bt_mesh_model_pub pub;
68 /* Publication message */
69 struct net_buf_simple pub_msg;
70 /* Publication message buffer. */
71 uint8_t buf[BT_MESH_MODEL_BUF_LEN(BT_MESH_SCHEDULER_OP_ACTION_STATUS,
72 BT_MESH_SCHEDULER_MSG_LEN_ACTION_STATUS)];
73 /* Ack context */
74 struct bt_mesh_msg_ack_ctx ack_ctx;
75 /* Action index expected in the Ack. */
76 uint8_t ack_idx;
77};
78
97 struct bt_mesh_msg_ctx *ctx,
98 uint16_t *rsp);
99
120 struct bt_mesh_msg_ctx *ctx,
121 uint8_t idx,
122 struct bt_mesh_schedule_entry *rsp);
123
145 struct bt_mesh_msg_ctx *ctx,
146 uint8_t idx,
147 const struct bt_mesh_schedule_entry *entry,
148 struct bt_mesh_schedule_entry *rsp);
149
165 struct bt_mesh_msg_ctx *ctx,
166 uint8_t idx,
167 const struct bt_mesh_schedule_entry *entry);
168
170extern const struct bt_mesh_model_op _bt_mesh_scheduler_cli_op[];
171extern const struct bt_mesh_model_cb _bt_mesh_scheduler_cli_cb;
174#ifdef __cplusplus
175}
176#endif
177
178#endif /* BT_MESH_SCHEDULER_CLI_H__ */
179
int bt_mesh_scheduler_cli_action_set(struct bt_mesh_scheduler_cli *cli, struct bt_mesh_msg_ctx *ctx, uint8_t idx, const struct bt_mesh_schedule_entry *entry, struct bt_mesh_schedule_entry *rsp)
Set the appropriate Scheduler Action.
int bt_mesh_scheduler_cli_action_get(struct bt_mesh_scheduler_cli *cli, struct bt_mesh_msg_ctx *ctx, uint8_t idx, struct bt_mesh_schedule_entry *rsp)
Get the appropriate Scheduler Action status.
int bt_mesh_scheduler_cli_get(struct bt_mesh_scheduler_cli *cli, struct bt_mesh_msg_ctx *ctx, uint16_t *rsp)
Get the current Schedule Register status.
int bt_mesh_scheduler_cli_action_set_unack(struct bt_mesh_scheduler_cli *cli, struct bt_mesh_msg_ctx *ctx, uint8_t idx, const struct bt_mesh_schedule_entry *entry)
Set the appropriate Scheduler Action without requesting a response.
Definition: scheduler.h:91
struct bt_mesh_msg_ack_ctx ack_ctx
Definition: scheduler_cli.h:74
void(* status_handler)(struct bt_mesh_scheduler_cli *cli, struct bt_mesh_msg_ctx *ctx, uint16_t schedules)
Scheduler Status message callback.
Definition: scheduler_cli.h:47
struct bt_mesh_model_pub pub
Definition: scheduler_cli.h:67
uint8_t ack_idx
Definition: scheduler_cli.h:76
const struct bt_mesh_model * model
Definition: scheduler_cli.h:65
struct net_buf_simple pub_msg
Definition: scheduler_cli.h:69
uint8_t buf[BT_MESH_MODEL_BUF_LEN(BT_MESH_SCHEDULER_OP_ACTION_STATUS, BT_MESH_SCHEDULER_MSG_LEN_ACTION_STATUS)]
Definition: scheduler_cli.h:72
void(* action_status_handler)(struct bt_mesh_scheduler_cli *cli, struct bt_mesh_msg_ctx *ctx, uint8_t idx, const struct bt_mesh_schedule_entry *action)
Scheduler Action Status message callback.
Definition: scheduler_cli.h:59
Definition: scheduler_cli.h:40