nRF Connect SDK API 0.1.0
Loading...
Searching...
No Matches
time_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_TIME_CLI_H__
15#define BT_MESH_TIME_CLI_H__
16
17#include <bluetooth/mesh/time.h>
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
24struct bt_mesh_time_cli;
25
34#define BT_MESH_TIME_CLI_INIT(_handlers) \
35 { \
36 .handlers = _handlers, \
37 .pub = {.msg = NET_BUF_SIMPLE(BT_MESH_MODEL_BUF_LEN( \
38 BT_MESH_TIME_OP_TIME_SET, \
39 BT_MESH_TIME_MSG_LEN_TIME_SET)) } \
40 }
41
48#define BT_MESH_MODEL_TIME_CLI(_cli) \
49 BT_MESH_MODEL_CB( \
50 BT_MESH_MODEL_ID_TIME_CLI, _bt_mesh_time_cli_op, &(_cli)->pub, \
51 BT_MESH_MODEL_USER_DATA(struct bt_mesh_time_cli, _cli), \
52 &_bt_mesh_time_cli_cb)
53
68 void (*const time_status)(struct bt_mesh_time_cli *cli,
69 struct bt_mesh_msg_ctx *ctx,
70 const struct bt_mesh_time_status *status);
71
84 void (*const time_zone_status)(
85 struct bt_mesh_time_cli *cli, struct bt_mesh_msg_ctx *ctx,
86 const struct bt_mesh_time_zone_status *status);
87
100 void (*const tai_utc_delta_status)(
101 struct bt_mesh_time_cli *cli, struct bt_mesh_msg_ctx *ctx,
102 const struct bt_mesh_time_tai_utc_delta_status *status);
103
116 void (*const time_role_status)(struct bt_mesh_time_cli *cli,
117 struct bt_mesh_msg_ctx *ctx,
118 enum bt_mesh_time_role time_role);
119};
120
127 const struct bt_mesh_model *model;
129 struct bt_mesh_model_pub pub;
131 struct bt_mesh_msg_ack_ctx ack_ctx;
137};
138
156 struct bt_mesh_msg_ctx *ctx,
157 struct bt_mesh_time_status *rsp);
158
177 struct bt_mesh_msg_ctx *ctx,
178 const struct bt_mesh_time_status *set,
179 struct bt_mesh_time_status *rsp);
180
198 struct bt_mesh_msg_ctx *ctx,
199 struct bt_mesh_time_zone_status *rsp);
200
222 struct bt_mesh_msg_ctx *ctx,
223 const struct bt_mesh_time_zone_change *set,
224 struct bt_mesh_time_zone_status *rsp);
225
243 struct bt_mesh_time_cli *cli, struct bt_mesh_msg_ctx *ctx,
245
267 struct bt_mesh_time_cli *cli, struct bt_mesh_msg_ctx *ctx,
268 const struct bt_mesh_time_tai_utc_change *set,
270
288 struct bt_mesh_msg_ctx *ctx, uint8_t *rsp);
289
308 struct bt_mesh_msg_ctx *ctx, const uint8_t *set,
309 uint8_t *rsp);
310
312extern const struct bt_mesh_model_op _bt_mesh_time_cli_op[];
313extern const struct bt_mesh_model_cb _bt_mesh_time_cli_cb;
316#ifdef __cplusplus
317}
318#endif
319
320#endif /* BT_MESH_TIME_CLI_H__ */
321
int bt_mesh_time_cli_role_get(struct bt_mesh_time_cli *cli, struct bt_mesh_msg_ctx *ctx, uint8_t *rsp)
Get the Time Role state of a Time Server.
int bt_mesh_time_cli_tai_utc_delta_get(struct bt_mesh_time_cli *cli, struct bt_mesh_msg_ctx *ctx, struct bt_mesh_time_tai_utc_delta_status *rsp)
Get the UTC Delta status of a Time Server.
int bt_mesh_time_cli_role_set(struct bt_mesh_time_cli *cli, struct bt_mesh_msg_ctx *ctx, const uint8_t *set, uint8_t *rsp)
Set the Time Role state of a Time Server.
int bt_mesh_time_cli_tai_utc_delta_set(struct bt_mesh_time_cli *cli, struct bt_mesh_msg_ctx *ctx, const struct bt_mesh_time_tai_utc_change *set, struct bt_mesh_time_tai_utc_delta_status *rsp)
Schedule a UTC Delta change for the Timer Server.
int bt_mesh_time_cli_zone_set(struct bt_mesh_time_cli *cli, struct bt_mesh_msg_ctx *ctx, const struct bt_mesh_time_zone_change *set, struct bt_mesh_time_zone_status *rsp)
Schedule a Time Zone change for the Time Server.
int bt_mesh_time_cli_time_set(struct bt_mesh_time_cli *cli, struct bt_mesh_msg_ctx *ctx, const struct bt_mesh_time_status *set, struct bt_mesh_time_status *rsp)
Set the Time Status of a Time Server.
int bt_mesh_time_cli_time_get(struct bt_mesh_time_cli *cli, struct bt_mesh_msg_ctx *ctx, struct bt_mesh_time_status *rsp)
Get the current Time Status of a Time Server.
int bt_mesh_time_cli_zone_get(struct bt_mesh_time_cli *cli, struct bt_mesh_msg_ctx *ctx, struct bt_mesh_time_zone_status *rsp)
Get the Time Zone status of a Time Server.
bt_mesh_time_role
Definition: time.h:25
void(*const time_zone_status)(struct bt_mesh_time_cli *cli, struct bt_mesh_msg_ctx *ctx, const struct bt_mesh_time_zone_status *status)
Time Zone status message handler.
Definition: time_cli.h:84
void(*const time_role_status)(struct bt_mesh_time_cli *cli, struct bt_mesh_msg_ctx *ctx, enum bt_mesh_time_role time_role)
Time Role status message handler.
Definition: time_cli.h:116
void(*const tai_utc_delta_status)(struct bt_mesh_time_cli *cli, struct bt_mesh_msg_ctx *ctx, const struct bt_mesh_time_tai_utc_delta_status *status)
TAI-UTC Delta status message handler.
Definition: time_cli.h:100
void(*const time_status)(struct bt_mesh_time_cli *cli, struct bt_mesh_msg_ctx *ctx, const struct bt_mesh_time_status *status)
Time status message handler.
Definition: time_cli.h:68
Definition: time_cli.h:55
const struct bt_mesh_model * model
Definition: time_cli.h:127
struct bt_mesh_model_pub pub
Definition: time_cli.h:129
const struct bt_mesh_time_cli_handlers * handlers
Definition: time_cli.h:136
struct bt_mesh_msg_ack_ctx ack_ctx
Definition: time_cli.h:131
Definition: time_cli.h:125
Definition: time.h:45
Definition: time.h:75
Definition: time.h:59
Definition: time.h:67