nRF Connect SDK API 2.8.99
Loading...
Searching...
No Matches
light_temp_srv.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_LIGHT_TEMP_SRV_H__
15#define BT_MESH_LIGHT_TEMP_SRV_H__
16
20#if IS_ENABLED(CONFIG_EMDS) && IS_ENABLED(CONFIG_BT_SETTINGS)
21#include "emds/emds.h"
22#endif
23
24#ifdef __cplusplus
25extern "C" {
26#endif
27
29
37#define BT_MESH_LIGHT_TEMP_SRV_INIT(_handlers) \
38 { \
39 .lvl = BT_MESH_LVL_SRV_INIT( \
40 &_bt_mesh_light_temp_srv_lvl_handlers), \
41 .pub = { .msg = NET_BUF_SIMPLE(BT_MESH_MODEL_BUF_LEN( \
42 BT_MESH_LIGHT_TEMP_STATUS, \
43 BT_MESH_LIGHT_CTL_MSG_MAXLEN_TEMP_STATUS)) }, \
44 .handlers = _handlers, \
45 }
46
56#define BT_MESH_MODEL_LIGHT_TEMP_SRV(_srv, ...) \
57 BT_MESH_MODEL_LVL_SRV(&(_srv)->lvl), \
58 BT_MESH_MODEL_METADATA_CB( \
59 BT_MESH_MODEL_ID_LIGHT_CTL_TEMP_SRV, \
60 _bt_mesh_light_temp_srv_op, &(_srv)->pub, \
61 BT_MESH_MODEL_USER_DATA(struct bt_mesh_light_temp_srv, _srv), \
62 &_bt_mesh_light_temp_srv_cb, __VA_ARGS__)
63
65#define BT_MESH_LIGHT_CTL_TEMP_RANGE_METADATA_ID 0x0004
66
73#define BT_MESH_LIGHT_CTL_TEMP_RANGE_METADATA(range_min, range_max) \
74 BT_MESH_MODELS_METADATA_ENTRY(4, BT_MESH_LIGHT_CTL_TEMP_RANGE_METADATA_ID, \
75 ((uint16_t[]){(range_min), (range_max)}))
76
95 void (*const set)(struct bt_mesh_light_temp_srv *srv,
96 struct bt_mesh_msg_ctx *ctx,
97 const struct bt_mesh_light_temp_set *set,
98 struct bt_mesh_light_temp_status *rsp);
99
108 void (*const get)(struct bt_mesh_light_temp_srv *srv,
109 struct bt_mesh_msg_ctx *ctx,
110 struct bt_mesh_light_temp_status *rsp);
111
119 void (*const range_update)(
120 struct bt_mesh_light_temp_srv *srv, struct bt_mesh_msg_ctx *ctx,
121 const struct bt_mesh_light_temp_range *old_range,
122 const struct bt_mesh_light_temp_range *new_range);
123
132 void (*const default_update)(
133 struct bt_mesh_light_temp_srv *srv, struct bt_mesh_msg_ctx *ctx,
134 const struct bt_mesh_light_temp *old_default,
135 const struct bt_mesh_light_temp *new_default);
136};
137
146 const struct bt_mesh_model *model;
152 struct bt_mesh_model_pub pub;
157
164 struct __packed {
168
169#if IS_ENABLED(CONFIG_EMDS) && IS_ENABLED(CONFIG_BT_SETTINGS)
172#endif
173};
174
194 struct bt_mesh_msg_ctx *ctx,
195 const struct bt_mesh_light_temp_status *status);
196
198extern const struct bt_mesh_model_op _bt_mesh_light_temp_srv_op[];
199extern const struct bt_mesh_model_cb _bt_mesh_light_temp_srv_cb;
200extern const struct bt_mesh_lvl_srv_handlers
201 _bt_mesh_light_temp_srv_lvl_handlers;
204#ifdef __cplusplus
205}
206#endif
207
208#endif /* BT_MESH_LIGHT_TEMP_SRV_H__ */
209
int bt_mesh_light_temp_srv_pub(struct bt_mesh_light_temp_srv *srv, struct bt_mesh_msg_ctx *ctx, const struct bt_mesh_light_temp_status *status)
Publish the current CTL Temperature status.
Definition light_ctl_srv.h:65
Definition light_ctl.h:102
Definition light_ctl.h:78
void(*const range_update)(struct bt_mesh_light_temp_srv *srv, struct bt_mesh_msg_ctx *ctx, const struct bt_mesh_light_temp_range *old_range, const struct bt_mesh_light_temp_range *new_range)
The Temperature Range state has changed.
Definition light_temp_srv.h:119
void(*const get)(struct bt_mesh_light_temp_srv *srv, struct bt_mesh_msg_ctx *ctx, struct bt_mesh_light_temp_status *rsp)
Get the CTL Temperature state.
Definition light_temp_srv.h:108
void(*const default_update)(struct bt_mesh_light_temp_srv *srv, struct bt_mesh_msg_ctx *ctx, const struct bt_mesh_light_temp *old_default, const struct bt_mesh_light_temp *new_default)
The Default Light Temperature has changed.
Definition light_temp_srv.h:132
void(*const set)(struct bt_mesh_light_temp_srv *srv, struct bt_mesh_msg_ctx *ctx, const struct bt_mesh_light_temp_set *set, struct bt_mesh_light_temp_status *rsp)
Set the Light Temperature state.
Definition light_temp_srv.h:95
Definition light_temp_srv.h:78
const struct bt_mesh_light_temp_srv_handlers * handlers
Definition light_temp_srv.h:156
struct bt_mesh_light_temp_srv::@157 transient
struct bt_mesh_light_temp_range range
Definition light_temp_srv.h:161
uint16_t corrective_delta
Definition light_temp_srv.h:163
const struct bt_mesh_model * model
Definition light_temp_srv.h:146
struct bt_mesh_light_temp dflt
Definition light_temp_srv.h:159
struct bt_mesh_lvl_srv lvl
Definition light_temp_srv.h:144
struct bt_mesh_tid_ctx prev_transaction
Definition light_temp_srv.h:154
struct bt_mesh_model_pub pub
Definition light_temp_srv.h:152
const struct bt_mesh_light_ctl_srv * ctl
Definition light_temp_srv.h:150
Definition light_temp_srv.h:142
Definition light_ctl.h:92
Definition light_ctl.h:42
Definition gen_lvl_srv.h:52
Definition gen_lvl_srv.h:143
Definition model_types.h:46
Definition emds.h:46
Definition emds.h:31