nRF Connect SDK API 0.1.0
Loading...
Searching...
No Matches
light_sat_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_SAT_SRV_H__
15#define BT_MESH_LIGHT_SAT_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_SAT_SRV_INIT(_handlers) \
38 { \
39 .handlers = _handlers, \
40 .lvl = BT_MESH_LVL_SRV_INIT( \
41 &_bt_mesh_light_sat_srv_lvl_handlers), \
42 .range = BT_MESH_LIGHT_HSL_OP_RANGE_DEFAULT, \
43 }
44
51#define BT_MESH_MODEL_LIGHT_SAT_SRV(_srv) \
52 BT_MESH_MODEL_LVL_SRV(&(_srv)->lvl), \
53 BT_MESH_MODEL_CB(BT_MESH_MODEL_ID_LIGHT_HSL_SAT_SRV, \
54 _bt_mesh_light_sat_srv_op, &(_srv)->pub, \
55 BT_MESH_MODEL_USER_DATA(struct bt_mesh_light_sat_srv, \
56 _srv), \
57 &_bt_mesh_light_sat_srv_cb)
58
77 void (*const set)(struct bt_mesh_light_sat_srv *srv,
78 struct bt_mesh_msg_ctx *ctx,
79 const struct bt_mesh_light_sat *set,
80 struct bt_mesh_light_sat_status *rsp);
81
91 void (*const get)(struct bt_mesh_light_sat_srv *srv,
92 struct bt_mesh_msg_ctx *ctx,
93 struct bt_mesh_light_sat_status *rsp);
94
103 void (*const default_update)(struct bt_mesh_light_sat_srv *srv,
104 struct bt_mesh_msg_ctx *ctx,
105 uint16_t old_default,
106 uint16_t new_default);
107
116 void (*const range_update)(
117 struct bt_mesh_light_sat_srv *srv,
118 struct bt_mesh_msg_ctx *ctx,
119 const struct bt_mesh_light_hsl_range *old_range,
120 const struct bt_mesh_light_hsl_range *new_range);
121};
122
132
134 const struct bt_mesh_model *model;
140 struct bt_mesh_model_pub pub;
142 struct net_buf_simple buf;
144 uint8_t pub_data[BT_MESH_MODEL_BUF_LEN(
145 BT_MESH_LIGHT_SAT_OP_STATUS,
146 BT_MESH_LIGHT_HSL_MSG_MAXLEN_SAT_STATUS)];
149
153 uint16_t dflt;
154 struct __packed {
156 uint16_t last;
158
159#if IS_ENABLED(CONFIG_EMDS) && IS_ENABLED(CONFIG_BT_SETTINGS)
162#endif
163};
164
184 struct bt_mesh_msg_ctx *ctx,
185 const struct bt_mesh_light_sat_status *status);
186
188extern const struct bt_mesh_model_op _bt_mesh_light_sat_srv_op[];
189extern const struct bt_mesh_model_cb _bt_mesh_light_sat_srv_cb;
190extern const struct bt_mesh_lvl_srv_handlers
191 _bt_mesh_light_sat_srv_lvl_handlers;
194#ifdef __cplusplus
195}
196#endif
197
198#endif /* BT_MESH_LIGHT_SAT_SRV_H__ */
199
int bt_mesh_light_sat_srv_pub(struct bt_mesh_light_sat_srv *srv, struct bt_mesh_msg_ctx *ctx, const struct bt_mesh_light_sat_status *status)
Publish the current HSL Saturation status.
Definition: light_hsl.h:147
Definition: light_hsl_srv.h:94
void(*const set)(struct bt_mesh_light_sat_srv *srv, struct bt_mesh_msg_ctx *ctx, const struct bt_mesh_light_sat *set, struct bt_mesh_light_sat_status *rsp)
Set the Saturation state.
Definition: light_sat_srv.h:77
void(*const range_update)(struct bt_mesh_light_sat_srv *srv, struct bt_mesh_msg_ctx *ctx, const struct bt_mesh_light_hsl_range *old_range, const struct bt_mesh_light_hsl_range *new_range)
The valid saturation range has been updated.
Definition: light_sat_srv.h:116
void(*const get)(struct bt_mesh_light_sat_srv *srv, struct bt_mesh_msg_ctx *ctx, struct bt_mesh_light_sat_status *rsp)
Get the Saturation state.
Definition: light_sat_srv.h:91
void(*const default_update)(struct bt_mesh_light_sat_srv *srv, struct bt_mesh_msg_ctx *ctx, uint16_t old_default, uint16_t new_default)
The default saturation value has been updated.
Definition: light_sat_srv.h:103
Definition: light_sat_srv.h:60
struct bt_mesh_light_sat_srv::@151 transient
struct bt_mesh_tid_ctx prev_transaction
Definition: light_sat_srv.h:148
uint8_t pub_data[BT_MESH_MODEL_BUF_LEN(BT_MESH_LIGHT_SAT_OP_STATUS, BT_MESH_LIGHT_HSL_MSG_MAXLEN_SAT_STATUS)]
Definition: light_sat_srv.h:146
uint16_t dflt
Definition: light_sat_srv.h:153
uint16_t last
Definition: light_sat_srv.h:156
struct net_buf_simple buf
Definition: light_sat_srv.h:142
struct bt_mesh_model_pub pub
Definition: light_sat_srv.h:140
struct bt_mesh_lvl_srv lvl
Definition: light_sat_srv.h:129
const struct bt_mesh_model * model
Definition: light_sat_srv.h:134
const struct bt_mesh_light_sat_srv_handlers * handlers
Definition: light_sat_srv.h:131
const struct bt_mesh_light_hsl_srv * hsl
Definition: light_sat_srv.h:138
struct bt_mesh_light_hsl_range range
Definition: light_sat_srv.h:151
Definition: light_sat_srv.h:127
Definition: light_hsl.h:137
Definition: light_hsl.h:113
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