nRF5 SDK for Mesh v5.0.0
light_lightness_common.h
1 /* Copyright (c) 2010 - 2020, Nordic Semiconductor ASA
2  * All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without modification,
5  * are permitted provided that the following conditions are met:
6  *
7  * 1. Redistributions of source code must retain the above copyright notice, this
8  * list of conditions and the following disclaimer.
9  *
10  * 2. Redistributions in binary form, except as embedded into a Nordic
11  * Semiconductor ASA integrated circuit in a product or a software update for
12  * such product, must reproduce the above copyright notice, this list of
13  * conditions and the following disclaimer in the documentation and/or other
14  * materials provided with the distribution.
15  *
16  * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
17  * contributors may be used to endorse or promote products derived from this
18  * software without specific prior written permission.
19  *
20  * 4. This software, with or without modification, must only be used with a
21  * Nordic Semiconductor ASA integrated circuit.
22  *
23  * 5. Any software provided in binary form under this license must not be reverse
24  * engineered, decompiled, modified and/or disassembled.
25  *
26  * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
27  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
28  * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
29  * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
30  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
32  * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
35  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36  */
37 
38 #ifndef LIGHT_LIGHTNESS_COMMON_H__
39 #define LIGHT_LIGHTNESS_COMMON_H__
40 
41 #include <stdint.h>
42 #include "model_common.h"
43 
53 #define LIGHT_LIGHTNESS_COMPANY_ID 0xFFFF
54 
59 #define LIGHT_LIGHTNESS_RANGE_MIN (1)
60 
65 #define LIGHT_LIGHTNESS_LAST_MIN (1)
66 
72 #ifndef LIGHT_LIGHTNESS_DEFAULT_RANGE_MIN
73 #define LIGHT_LIGHTNESS_DEFAULT_RANGE_MIN (0x1)
74 #endif
75 
81 #ifndef LIGHT_LIGHTNESS_DEFAULT_RANGE_MAX
82 #define LIGHT_LIGHTNESS_DEFAULT_RANGE_MAX (0xFFFF)
83 #endif
84 
93 #ifndef LIGHT_LIGHTNESS_DEFAULT_ON_POWERUP
94 #define LIGHT_LIGHTNESS_DEFAULT_ON_POWERUP (0x2)
95 #endif
96 
103 #ifndef LIGHT_LIGHTNESS_DEFAULT_LIGHTNESS_ACTUAL
104 #define LIGHT_LIGHTNESS_DEFAULT_LIGHTNESS_ACTUAL (0x0)
105 #endif
106 
115 #ifndef LIGHT_LIGHTNESS_DEFAULT_LIGHTNESS_LAST
116 #define LIGHT_LIGHTNESS_DEFAULT_LIGHTNESS_LAST (0xFFFF)
117 #endif
118 
125 #ifndef LIGHT_LIGHTNESS_DEFAULT_LIGHTNESS_DEFAULT
126 #define LIGHT_LIGHTNESS_DEFAULT_LIGHTNESS_DEFAULT (0x0)
127 #endif
128 
132 #ifndef LIGHT_LIGHTNESS_DEFAULT_DTT
133 #define LIGHT_LIGHTNESS_DEFAULT_DTT (0x0)
134 #endif
135 
137 typedef enum
138 {
146 
147 
154 typedef struct
155 {
156  uint16_t lightness;
157  uint8_t tid;
159 
161 typedef struct
162 {
163  uint16_t lightness;
164  uint8_t tid;
166 
168 typedef struct
169 {
170  uint16_t lightness;
172 
174 typedef struct
175 {
176  uint16_t range_min;
177  uint16_t range_max;
179 
183 typedef struct
184 {
185  int32_t delta_lightness;
186  uint8_t tid;
188 
192 typedef struct
193 {
194  int16_t delta;
195  uint8_t tid;
197 
199 typedef struct
200 {
201  uint8_t on_powerup;
203 
205 typedef struct
206 {
207  uint8_t on_powerup;
209 
210 
212 typedef struct
213 {
214  uint32_t dtt_ms;
216 
217 
219 typedef struct
220 {
221  uint32_t dtt_ms;
223 
224 
226 typedef struct
227 {
228  uint16_t present_lightness;
229  uint16_t target_lightness;
230  uint32_t remaining_time_ms;
232 
234 typedef struct
235 {
236  uint16_t present_lightness;
237  uint16_t target_lightness;
238  uint32_t remaining_time_ms;
240 
242 typedef struct
243 {
244  uint16_t lightness;
246 
248 typedef struct
249 {
250  uint16_t lightness;
252 
254 typedef struct
255 {
256  uint8_t status;
257  uint16_t range_min;
258  uint16_t range_max;
260 
264 typedef struct
265 {
266  uint8_t onpowerup;
267  uint16_t actual_lightness;
268  uint16_t last_lightness;
269  uint16_t default_lightness;
272 
274 #endif /* LIGHT_LIGHTNESS_COMMON_H__ */
int16_t delta
Value of the Lightness move value.
Message format for the light_lightness Linear set message.
uint8_t status
The status of the last operation.
Parameters for the light_lightness Linear Status message.
uint16_t range_min
The value of the lightness range min state.
Parameters for the DTT Set message.
Message format for the light_lightness Default set message.
Parameters for the light_lightness Last Status message.
uint16_t range_max
The value of the lightness range max state.
uint16_t range_max
The value of the lightness range max state.
uint16_t lightness
Value of the Lightness state.
Unpacked message structure typedefs are used for API interfaces and for implementing model code...
Parameters for the Power OnOff Set message.
The provided range set values are valid.
light_lightness_range_status_t
Status values for light_lightness_range_status_params_t.
uint16_t lightness
The value of the Lightness last state.
The provided value for Range Max cannot be set.
uint16_t target_lightness
The target value of the Linear Lightness state (optional)
Message format for the light_lightness delta set "message".
uint16_t actual_lightness
The saved value of the light lightness actual state.
The provided value for Range Min cannot be set.
uint8_t onpowerup
The saved value of the generic on powerup state.
Parameters for the light_lightness Default Status message.
Parameter format for code while booting - the stored values will be read and passed to the model to d...
Parameters for the DTT Status message.
uint16_t lightness
Value of the Lightness Linear state.
uint16_t present_lightness
The present value of the Linear Lightness state.
uint16_t lightness
Value of the Lightness state.
light_lightness_range_status_params_t range
The saved value of the light lightness range state.
uint16_t lightness
The value of the Lightness default state.
uint32_t remaining_time_ms
Remaining time value in milliseconds.
uint16_t present_lightness
The present value of the Lightness state.
uint16_t target_lightness
The target value of the Lightness state (optional)
Message format for the light_lightness move set "message".
Message format for the light_lightness Range set message.
Parameters for the light_lightness Status message.
uint16_t range_min
The value of the lightness range min state.
Parameters for the light_lightness Range Status message.
uint16_t default_lightness
The saved value of the light lightness default state.
Parameters for the Power OnOff Status message.
uint32_t remaining_time_ms
Remaining time value in milliseconds.
int32_t delta_lightness
Value of the Lightness delta value.
uint16_t last_lightness
The saved value of the light lightness last state.

Documentation feedback | Developer Zone | Subscribe | Updated