nRF5 SDK for Mesh v5.0.0
light_ctl_messages.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_MESSAGES_H__
39 #define LIGHT_CTL_MESSAGES_H__
40 
41 #include <stdint.h>
42 #include "light_ctl_common.h"
52 #define LIGHT_CTL_SET_MINLEN 7
53 
54 #define LIGHT_CTL_SET_MAXLEN 9
55 
57 #define LIGHT_CTL_TEMPERATURE_SET_MINLEN 5
58 
59 #define LIGHT_CTL_TEMPERATURE_SET_MAXLEN 7
60 
62 #define LIGHT_CTL_TEMPERATURE_RANGE_SET_LEN 4
63 
65 #define LIGHT_CTL_DEFAULT_SET_LEN 6
66 
68 #define LIGHT_CTL_STATUS_MINLEN 4
69 
70 #define LIGHT_CTL_STATUS_MAXLEN 9
71 
73 #define LIGHT_CTL_TEMPERATURE_STATUS_MINLEN 4
74 
75 #define LIGHT_CTL_TEMPERATURE_STATUS_MAXLEN 9
76 
78 #define LIGHT_CTL_TEMPERATURE_RANGE_STATUS_LEN 5
79 
81 #define LIGHT_CTL_DEFAULT_STATUS_LEN 6
82 
84 typedef enum
85 {
86  LIGHT_CTL_OPCODE_GET = 0x825D,
87  LIGHT_CTL_OPCODE_SET = 0x825E,
88  LIGHT_CTL_OPCODE_SET_UNACKNOWLEDGED = 0x825F,
89  LIGHT_CTL_OPCODE_STATUS = 0x8260,
90  LIGHT_CTL_OPCODE_TEMPERATURE_GET = 0x8261,
91  LIGHT_CTL_OPCODE_TEMPERATURE_RANGE_GET = 0x8262,
92  LIGHT_CTL_OPCODE_TEMPERATURE_RANGE_STATUS = 0x8263,
93  LIGHT_CTL_OPCODE_TEMPERATURE_SET = 0x8264,
94  LIGHT_CTL_OPCODE_TEMPERATURE_SET_UNACKNOWLEDGED = 0x8265,
95  LIGHT_CTL_OPCODE_TEMPERATURE_STATUS = 0x8266,
96  LIGHT_CTL_OPCODE_DEFAULT_GET = 0x8267,
97  LIGHT_CTL_OPCODE_DEFAULT_STATUS = 0x8268,
98  LIGHT_CTL_OPCODE_DEFAULT_SET = 0x8269,
99  LIGHT_CTL_OPCODE_DEFAULT_SET_UNACKNOWLEDGED = 0x826A,
100  LIGHT_CTL_OPCODE_TEMPERATURE_RANGE_SET = 0x826B,
101  LIGHT_CTL_OPCODE_TEMPERATURE_RANGE_SET_UNACKNOWLEDGED = 0x826C,
102 } light_ctl_opcode_t;
103 
107 typedef struct __attribute((packed))
108 {
109  uint16_t lightness;
110  uint16_t temperature;
111  uint16_t delta_uv;
112  uint8_t tid;
113  uint8_t transition_time;
114  uint8_t delay;
116 
118 typedef struct __attribute((packed))
119 {
120  uint16_t temperature;
121  uint16_t delta_uv;
122  uint8_t tid;
123  uint8_t transition_time;
124  uint8_t delay;
126 
128 typedef struct __attribute((packed))
129 {
130  uint16_t range_min;
131  uint16_t range_max;
133 
135 typedef struct __attribute((packed))
136 {
137  uint16_t lightness;
138  uint16_t temperature;
139  uint16_t delta_uv;
141 
143 typedef struct __attribute((packed))
144 {
145  uint16_t present_lightness;
147  uint16_t target_lightness;
149  uint8_t remaining_time;
151 
153 typedef struct __attribute((packed))
154 {
156  uint16_t present_delta_uv;
158  uint16_t target_delta_uv;
159  uint8_t remaining_time;
161 
163 typedef struct __attribute((packed))
164 {
165  uint8_t status_code;
166  uint16_t range_min;
167  uint16_t range_max;
169 
171 typedef struct __attribute((packed))
172 {
173  uint16_t lightness;
174  uint16_t temperature;
175  uint16_t delta_uv;
177 
179 #endif /* LIGHT_CTL_MESSAGES_H__ */
Message format for the Light CTL Temperature Status message.
Message format for the Light CTL Status message.
Message format for the Light CTL Temperature Range Set message.
uint16_t delta_uv
Delta UV state to set.
uint16_t range_min
Temperature Range min state to set.
uint16_t lightness
Lightness state to set.
uint16_t range_min
Current value of Temperature Range min state.
uint8_t delay
Encoded message execution delay in 5 millisecond steps.
uint16_t present_delta_uv
The present value of the Delta UV state.
uint16_t temperature
Temperature state to set.
uint16_t temperature
Temperature state to set.
Message format for the Light CTL Temperature Range Status message.
uint16_t range_max
Temperature Range max state to set.
uint16_t target_temperature
The target value of the Temperature state (optional)
uint16_t delta_uv
The target value of the Delta UV default state.
uint8_t transition_time
Encoded transition time value.
uint16_t target_temperature
The target value of the Temperature state (optional)
uint16_t target_lightness
The target value of the Lightness state (optional)
uint16_t temperature
The target value of the Temperature default state.
uint16_t present_temperature
The present value of the Temperature state.
uint8_t tid
Transaction number for application.
uint16_t delta_uv
Delta UV state to set.
uint8_t tid
Transaction number for application.
uint16_t present_temperature
The present value of the Temperature state.
uint16_t temperature
Temperature state to set.
uint16_t present_lightness
The present value of the Lightness state.
uint8_t status_code
Status code for the requesting message.
uint16_t delta_uv
Delta UV state to set.
Message format for the Light CTL Default Status message.
uint16_t lightness
The present value of the Lightness default state.
Message format for the Light CTL Temperature Set message.
Message format for the Light CTL Default Set message.
uint16_t lightness
Lightness state to set.
uint8_t remaining_time
Encoded remaining time.
uint16_t range_max
Current value of Temperature Range max state.
uint8_t delay
Encoded message execution delay in 5 millisecond steps.
uint8_t remaining_time
Encoded remaining time.
uint8_t transition_time
Encoded transition time value.
Packed message structure typedefs are used for packing and unpacking byte stream. ...
uint16_t target_delta_uv
The target value of the Delta UV state (optional)

Documentation feedback | Developer Zone | Subscribe | Updated