nRF5 SDK for Mesh v5.0.0
light_ctl_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_CTL_COMMON_H__
39 #define LIGHT_CTL_COMMON_H__
40 
41 #include <stdint.h>
42 #include "model_common.h"
43 #include "nrf_mesh_assert.h"
44 
56 #define LIGHT_CTL_COMPANY_ID (0xFFFF)
57 
59 #define LIGHT_CTL_TEMPERATURE_UNKNOWN (0xFFFF)
60 
62 #define LIGHT_CTL_TEMPERATURE_MIN_LIMIT (0x0320)
63 
64 #define LIGHT_CTL_TEMPERATURE_MAX_LIMIT (0x4E20)
65 
67 #ifndef LIGHT_CTL_DEFAULT_TEMPERATURE
68 #define LIGHT_CTL_DEFAULT_TEMPERATURE (8000)
69 #endif
70 
72 #ifndef LIGHT_CTL_DEFAULT_TEMPERATURE_DEFAULT
73 #define LIGHT_CTL_DEFAULT_TEMPERATURE_DEFAULT (8000)
74 #endif
75 
78 #ifndef LIGHT_CTL_DEFAULT_ALLOWED_TEMPERATURE_MIN
79 #define LIGHT_CTL_DEFAULT_ALLOWED_TEMPERATURE_MIN (0x0320)
80 #endif
81 
84 #ifndef LIGHT_CTL_DEFAULT_ALLOWED_TEMPERATURE_MAX
85 #define LIGHT_CTL_DEFAULT_ALLOWED_TEMPERATURE_MAX (0x4E20)
86 #endif
87 
89 #ifndef LIGHT_CTL_DEFAULT_DELTA_UV
90 #define LIGHT_CTL_DEFAULT_DELTA_UV (0)
91 #endif
92 
94 #ifndef LIGHT_CTL_DEFAULT_DELTA_UV_DEFAULT
95 #define LIGHT_CTL_DEFAULT_DELTA_UV_DEFAULT (0)
96 #endif
97 
99 typedef enum
100 {
108 
109 
116 typedef struct
117 {
118  uint16_t lightness;
119  uint32_t temperature32;
120  uint16_t delta_uv;
121  uint8_t tid;
123 
125 typedef struct
126 {
127  uint32_t temperature32;
128  uint16_t delta_uv;
129  uint8_t tid;
131 
133 typedef struct
134 {
138 
140 typedef struct
141 {
142  uint16_t lightness;
143  uint32_t temperature32;
144  uint16_t delta_uv;
146 
152 typedef struct
153 {
155  uint8_t tid;
157 
163 typedef struct
164 {
166  uint8_t tid;
168 
170 typedef struct
171 {
172  uint16_t present_lightness;
174  uint16_t target_lightness;
176  uint32_t remaining_time_ms;
178 
180 typedef struct
181 {
183  uint16_t present_delta_uv;
185  uint16_t target_delta_uv;
186  uint32_t remaining_time_ms;
188 
190 typedef struct
191 {
192  uint8_t status_code;
196 
198 typedef struct
199 {
200  uint16_t lightness;
201  uint32_t temperature32;
202  uint16_t delta_uv;
204 
207 typedef struct
208 {
210  uint8_t onpowerup;
212  uint32_t temperature32;
216  uint16_t delta_uv;
222 
224 #endif /* LIGHT_CTL_COMMON_H__ */
uint16_t present_delta_uv
The present value of the Delta UV state.
The provided MAXIMUM range set value is invalid.
uint32_t temperature32
Value of the Temperature32 Default state.
uint32_t temperature32
Value of the Temperature32 state.
Message format for the Light CTL Temperature Move Set "message".
light_ctl_range_status_t
Status values for light_ctl_temperature_range_status_params_t.
uint16_t lightness
Value of the Lightness state.
uint32_t temperature32_range_max
Value of the Temperature32 range max state.
uint16_t default_delta_uv
Stores Default UV state value.
The provided MINIMUM range set value is invalid.
Parameters for the Light CTL Default Status message.
uint8_t tid
Transaction ID.
uint32_t target_temperature32
The target value of the Temperature32 state (optional)
uint32_t remaining_time_ms
Remaining time value in milliseconds.
uint16_t delta_uv
Stores Delta UV state value.
uint16_t present_lightness
The present value of the Lightness state.
uint32_t temperature32_range_min
The value of Temperature32 Range min state.
uint8_t status_code
Status code for the requesting message.
uint16_t delta_uv
Value of the Delta UV state.
Message format for the CTL Temperature Set message.
The provided range set values are valid.
uint16_t target_lightness
The target value of the Lightness state (optional)
uint32_t temperature32_range_min
Value of the Temperature32 range min state.
Storage format for model states while booting - the stored values will be read and passed to the mode...
int32_t delta_temperature
Value of the temperature move value.
uint32_t remaining_time_ms
Remaining time value in milliseconds.
uint32_t temperature32
The value of the Temperature32 state.
uint32_t temperature32
Value of the Temperature32 state.
uint16_t delta_uv
The value of the Delta UV state.
uint16_t delta_uv
Value of the Delta UV Default state.
uint32_t target_temperature32
The target value of the Temperature32 state (optional)
uint32_t default_temperature32
Stores represented Temperature32 state value.
uint32_t temperature32_range_max
The value of Temperature32 Range max state.
uint32_t temperature32
Stores represented CTL Temperature state value.
Message format for the CTL Default Set message.
light_ctl_temperature_range_set_params_t temperature32_range
Stores represented Temperature range value.
uint16_t lightness
The value of the Lightness state.
uint32_t present_temperature32
The present value of the Temperature32 state.
Message format for the CTL delta set "message".
Parameters for the Light CTL Temperature Status message.
Parameters for the Light CTL Status message.
Message format for the CTL Temperature Range Set message.
Parameters for the Light CTL Temperature Range Status message.
uint16_t target_delta_uv
The target value of the Delta UV state (optional)
uint8_t onpowerup
Stores OnPowerUp state value.
uint16_t lightness
Value of the Lightness Default state.
uint16_t delta_uv
Value of the Delta UV state.
uint32_t present_temperature32
The present value of the Temperature32 state.
Unpacked message structure typedefs are used for API interfaces and for implementing model code...
int32_t delta_temperature
Value of the Temperature delta value.

Documentation feedback | Developer Zone | Subscribe | Updated