nRF Connect SDK API 2.8.99
Loading...
Searching...
No Matches
light_ctrl.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
13#ifndef BT_MESH_LIGHT_CTRL_H__
14#define BT_MESH_LIGHT_CTRL_H__
15
18
19#ifdef __cplusplus
20extern "C" {
21#endif
22
151
186
193static inline const struct bt_mesh_sensor_format *
224
226#define BT_MESH_LIGHT_CTRL_OP_MODE_GET BT_MESH_MODEL_OP_2(0x82, 0x91)
227#define BT_MESH_LIGHT_CTRL_OP_MODE_SET BT_MESH_MODEL_OP_2(0x82, 0x92)
228#define BT_MESH_LIGHT_CTRL_OP_MODE_SET_UNACK BT_MESH_MODEL_OP_2(0x82, 0x93)
229#define BT_MESH_LIGHT_CTRL_OP_MODE_STATUS BT_MESH_MODEL_OP_2(0x82, 0x94)
230#define BT_MESH_LIGHT_CTRL_OP_OM_GET BT_MESH_MODEL_OP_2(0x82, 0x95)
231#define BT_MESH_LIGHT_CTRL_OP_OM_SET BT_MESH_MODEL_OP_2(0x82, 0x96)
232#define BT_MESH_LIGHT_CTRL_OP_OM_SET_UNACK BT_MESH_MODEL_OP_2(0x82, 0x97)
233#define BT_MESH_LIGHT_CTRL_OP_OM_STATUS BT_MESH_MODEL_OP_2(0x82, 0x98)
234#define BT_MESH_LIGHT_CTRL_OP_LIGHT_ONOFF_GET BT_MESH_MODEL_OP_2(0x82, 0x99)
235#define BT_MESH_LIGHT_CTRL_OP_LIGHT_ONOFF_SET BT_MESH_MODEL_OP_2(0x82, 0x9A)
236#define BT_MESH_LIGHT_CTRL_OP_LIGHT_ONOFF_SET_UNACK \
237 BT_MESH_MODEL_OP_2(0x82, 0x9B)
238#define BT_MESH_LIGHT_CTRL_OP_LIGHT_ONOFF_STATUS BT_MESH_MODEL_OP_2(0x82, 0x9C)
239#define BT_MESH_LIGHT_CTRL_OP_PROP_GET BT_MESH_MODEL_OP_2(0x82, 0x9D)
240#define BT_MESH_LIGHT_CTRL_OP_PROP_SET BT_MESH_MODEL_OP_1(0x62)
241#define BT_MESH_LIGHT_CTRL_OP_PROP_SET_UNACK BT_MESH_MODEL_OP_1(0x63)
242#define BT_MESH_LIGHT_CTRL_OP_PROP_STATUS BT_MESH_MODEL_OP_1(0x64)
243
244#define BT_MESH_LIGHT_CTRL_MSG_LEN_MODE_GET 0
245#define BT_MESH_LIGHT_CTRL_MSG_LEN_MODE_SET 1
246#define BT_MESH_LIGHT_CTRL_MSG_LEN_MODE_STATUS 1
247#define BT_MESH_LIGHT_CTRL_MSG_LEN_OM_GET 0
248#define BT_MESH_LIGHT_CTRL_MSG_LEN_OM_SET 1
249#define BT_MESH_LIGHT_CTRL_MSG_LEN_OM_STATUS 1
250#define BT_MESH_LIGHT_CTRL_MSG_LEN_LIGHT_ONOFF_GET 0
251#define BT_MESH_LIGHT_CTRL_MSG_MINLEN_LIGHT_ONOFF_SET 2
252#define BT_MESH_LIGHT_CTRL_MSG_MINLEN_LIGHT_ONOFF_STATUS 1
253#define BT_MESH_LIGHT_CTRL_MSG_LEN_PROP_GET 2
254#define BT_MESH_LIGHT_CTRL_MSG_MINLEN_PROP_SET 2
255#define BT_MESH_LIGHT_CTRL_MSG_MINLEN_PROP_STATUS 2
256
257#if CONFIG_BT_MESH_LIGHT_CTRL_SRV_REG
258#define BT_MESH_LIGHT_CTRL_SRV_REG_CFG_INIT \
259 { \
260 .ki.up = CONFIG_BT_MESH_LIGHT_CTRL_SRV_REG_KIU, \
261 .ki.down = CONFIG_BT_MESH_LIGHT_CTRL_SRV_REG_KID, \
262 .kp.up = CONFIG_BT_MESH_LIGHT_CTRL_SRV_REG_KPU, \
263 .kp.down = CONFIG_BT_MESH_LIGHT_CTRL_SRV_REG_KPD, \
264 .accuracy = CONFIG_BT_MESH_LIGHT_CTRL_SRV_REG_ACCURACY, \
265 }
266
267#define BT_MESH_LIGHT_CTRL_SRV_LUX_INIT \
268 .centilux = { \
269 CONFIG_BT_MESH_LIGHT_CTRL_SRV_REG_LUX_STANDBY * 100, \
270 CONFIG_BT_MESH_LIGHT_CTRL_SRV_REG_LUX_ON * 100, \
271 CONFIG_BT_MESH_LIGHT_CTRL_SRV_REG_LUX_PROLONG * 100 \
272 }
273#else
274#define BT_MESH_LIGHT_CTRL_SRV_LUX_INIT
275#endif
276
277#define BT_MESH_LIGHT_CTRL_SRV_CFG_INIT \
278 { \
279 .occupancy_delay = \
280 CONFIG_BT_MESH_LIGHT_CTRL_SRV_OCCUPANCY_DELAY, \
281 .fade_on = \
282 CONFIG_BT_MESH_LIGHT_CTRL_SRV_TIME_FADE_ON, \
283 .on = (MSEC_PER_SEC * CONFIG_BT_MESH_LIGHT_CTRL_SRV_TIME_ON), \
284 .fade_prolong = \
285 CONFIG_BT_MESH_LIGHT_CTRL_SRV_TIME_FADE_PROLONG, \
286 .prolong = (MSEC_PER_SEC * \
287 CONFIG_BT_MESH_LIGHT_CTRL_SRV_TIME_PROLONG), \
288 .fade_standby_auto = \
289 CONFIG_BT_MESH_LIGHT_CTRL_SRV_TIME_FADE_STANDBY_AUTO, \
290 .fade_standby_manual = \
291 CONFIG_BT_MESH_LIGHT_CTRL_SRV_TIME_FADE_STANDBY_MANUAL,\
292 .light = { \
293 CONFIG_BT_MESH_LIGHT_CTRL_SRV_LVL_STANDBY, \
294 CONFIG_BT_MESH_LIGHT_CTRL_SRV_LVL_ON, \
295 CONFIG_BT_MESH_LIGHT_CTRL_SRV_LVL_PROLONG, \
296 }, \
297 BT_MESH_LIGHT_CTRL_SRV_LUX_INIT \
298 }
301#ifdef __cplusplus
302}
303#endif
304
305#endif /* BT_MESH_LIGHT_CTRL_H__ */
306
bt_mesh_light_ctrl_prop
Definition light_ctrl.h:24
@ BT_MESH_LIGHT_CTRL_PROP_ILLUMINANCE_STANDBY
Definition light_ctrl.h:49
@ BT_MESH_LIGHT_CTRL_PROP_LIGHTNESS_STANDBY
Definition light_ctrl.h:76
@ BT_MESH_LIGHT_CTRL_PROP_TIME_FADE_ON
Definition light_ctrl.h:103
@ BT_MESH_LIGHT_CTRL_PROP_LIGHTNESS_PROLONG
Definition light_ctrl.h:67
@ BT_MESH_LIGHT_CTRL_PROP_TIME_FADE_PROLONG
Definition light_ctrl.h:94
@ BT_MESH_LIGHT_CTRL_PROP_REG_ACCURACY
Definition light_ctrl.h:85
@ BT_MESH_LIGHT_CTRL_PROP_ILLUMINANCE_ON
Definition light_ctrl.h:31
@ BT_MESH_LIGHT_CTRL_PROP_TIME_FADE_STANDBY_MANUAL
Definition light_ctrl.h:121
@ BT_MESH_LIGHT_CTRL_PROP_LIGHTNESS_ON
Definition light_ctrl.h:58
@ BT_MESH_LIGHT_CTRL_PROP_TIME_OCCUPANCY_DELAY
Definition light_ctrl.h:130
@ BT_MESH_LIGHT_CTRL_PROP_ILLUMINANCE_PROLONG
Definition light_ctrl.h:40
@ BT_MESH_LIGHT_CTRL_PROP_TIME_PROLONG
Definition light_ctrl.h:139
@ BT_MESH_LIGHT_CTRL_PROP_TIME_ON
Definition light_ctrl.h:148
@ BT_MESH_LIGHT_CTRL_PROP_TIME_FADE_STANDBY_AUTO
Definition light_ctrl.h:112
static const struct bt_mesh_sensor_format * bt_mesh_lc_prop_format_get(uint16_t id)
Get the sensor format for the given Light Lightness Control property ID.
Definition light_ctrl.h:194
bt_mesh_light_ctrl_coeff
Definition light_ctrl.h:153
@ BT_MESH_LIGHT_CTRL_COEFF_KPD
Definition light_ctrl.h:176
@ BT_MESH_LIGHT_CTRL_COEFF_KIU
Definition light_ctrl.h:168
@ BT_MESH_LIGHT_CTRL_COEFF_KID
Definition light_ctrl.h:160
@ BT_MESH_LIGHT_CTRL_COEFF_KPU
Definition light_ctrl.h:184
#define BT_MESH_PROP_ID_LIGHT_CTRL_AMB_LUXLEVEL_STANDBY
Definition properties.h:115
#define BT_MESH_PROP_ID_LIGHT_CTRL_REG_KPU
Definition properties.h:131
#define BT_MESH_PROP_ID_LIGHT_CTRL_REG_KIU
Definition properties.h:127
#define BT_MESH_PROP_ID_LIGHT_CTRL_TIME_FADE_STANDBY_AUTO
Definition properties.h:137
#define BT_MESH_PROP_ID_LIGHT_CTRL_TIME_RUN_ON
Definition properties.h:145
#define BT_MESH_PROP_ID_LIGHT_CTRL_LIGHTNESS_ON
Definition properties.h:117
#define BT_MESH_PROP_ID_LIGHT_CTRL_AMB_LUXLEVEL_ON
Definition properties.h:111
#define BT_MESH_PROP_ID_LIGHT_CTRL_TIME_FADE_STANDBY_MANUAL
Definition properties.h:139
#define BT_MESH_PROP_ID_LIGHT_CTRL_REG_ACCURACY
Definition properties.h:123
#define BT_MESH_PROP_ID_LIGHT_CTRL_TIME_PROLONG
Definition properties.h:143
#define BT_MESH_PROP_ID_LIGHT_CTRL_TIME_FADE_ON
Definition properties.h:135
#define BT_MESH_PROP_ID_LIGHT_CTRL_REG_KID
Definition properties.h:125
#define BT_MESH_PROP_ID_LIGHT_CTRL_LIGHTNESS_PROLONG
Definition properties.h:119
#define BT_MESH_PROP_ID_LIGHT_CTRL_TIME_OCCUPANCY_DELAY
Definition properties.h:141
#define BT_MESH_PROP_ID_LIGHT_CTRL_LIGHTNESS_STANDBY
Definition properties.h:121
#define BT_MESH_PROP_ID_LIGHT_CTRL_TIME_FADE
Definition properties.h:133
#define BT_MESH_PROP_ID_LIGHT_CTRL_AMB_LUXLEVEL_PROLONG
Definition properties.h:113
#define BT_MESH_PROP_ID_LIGHT_CTRL_REG_KPD
Definition properties.h:129
const struct bt_mesh_sensor_format bt_mesh_sensor_format_perceived_lightness
const struct bt_mesh_sensor_format bt_mesh_sensor_format_illuminance
const struct bt_mesh_sensor_format bt_mesh_sensor_format_coefficient
const struct bt_mesh_sensor_format bt_mesh_sensor_format_percentage_8
const struct bt_mesh_sensor_format bt_mesh_sensor_format_time_millisecond_24
Definition sensor.h:442