nRF5 SDK for Mesh v5.0.0
light_lightness_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_LIGHTNESS_MESSAGES_H__
39 #define LIGHT_LIGHTNESS_MESSAGES_H__
40 
41 #include <stdint.h>
42 #include "light_lightness_common.h"
52 #define LIGHT_LIGHTNESS_SET_MINLEN 3
53 
54 #define LIGHT_LIGHTNESS_SET_MAXLEN 5
55 
57 #define LIGHT_LIGHTNESS_LINEAR_SET_MINLEN 3
58 
59 #define LIGHT_LIGHTNESS_LINEAR_SET_MAXLEN 5
60 
62 #define LIGHT_LIGHTNESS_DEFAULT_SET_LEN 2
63 
65 #define LIGHT_LIGHTNESS_RANGE_SET_LEN 4
66 
68 #define LIGHT_LIGHTNESS_STATUS_MINLEN 2
69 
70 #define LIGHT_LIGHTNESS_STATUS_MAXLEN 5
71 
73 #define LIGHT_LIGHTNESS_LINEAR_STATUS_MINLEN 2
74 
75 #define LIGHT_LIGHTNESS_LINEAR_STATUS_MAXLEN 5
76 
78 #define LIGHT_LIGHTNESS_LAST_STATUS_LEN 2
79 
81 #define LIGHT_LIGHTNESS_DEFAULT_STATUS_LEN 2
82 
84 #define LIGHT_LIGHTNESS_RANGE_STATUS_LEN 5
85 
87 typedef enum
88 {
89  LIGHT_LIGHTNESS_OPCODE_GET = 0x824B,
90  LIGHT_LIGHTNESS_OPCODE_SET = 0x824C,
91  LIGHT_LIGHTNESS_OPCODE_SET_UNACKNOWLEDGED = 0x824D,
92  LIGHT_LIGHTNESS_OPCODE_STATUS = 0x824E,
93  LIGHT_LIGHTNESS_OPCODE_LINEAR_GET = 0x824F,
94  LIGHT_LIGHTNESS_OPCODE_LINEAR_SET = 0x8250,
95  LIGHT_LIGHTNESS_OPCODE_LINEAR_SET_UNACKNOWLEDGED = 0x8251,
96  LIGHT_LIGHTNESS_OPCODE_LINEAR_STATUS = 0x8252,
97  LIGHT_LIGHTNESS_OPCODE_LAST_GET = 0x8253,
98  LIGHT_LIGHTNESS_OPCODE_LAST_STATUS = 0x8254,
99  LIGHT_LIGHTNESS_OPCODE_DEFAULT_GET = 0x8255,
100  LIGHT_LIGHTNESS_OPCODE_DEFAULT_STATUS = 0x8256,
101  LIGHT_LIGHTNESS_OPCODE_RANGE_GET = 0x8257,
102  LIGHT_LIGHTNESS_OPCODE_RANGE_STATUS = 0x8258,
103  LIGHT_LIGHTNESS_OPCODE_DEFAULT_SET = 0x8259,
104  LIGHT_LIGHTNESS_OPCODE_DEFAULT_SET_UNACKNOWLEDGED = 0x825A,
105  LIGHT_LIGHTNESS_OPCODE_RANGE_SET = 0x825B,
106  LIGHT_LIGHTNESS_OPCODE_RANGE_SET_UNACKNOWLEDGED = 0x825C,
107 } light_lightness_opcode_t;
108 
112 typedef struct __attribute((packed))
113 {
114  uint16_t lightness;
115  uint8_t tid;
116  uint8_t transition_time;
117  uint8_t delay;
119 
121 typedef struct __attribute((packed))
122 {
123  uint16_t lightness;
124  uint8_t tid;
125  uint8_t transition_time;
126  uint8_t delay;
128 
130 typedef struct __attribute((packed))
131 {
132  uint16_t lightness;
134 
136 typedef struct __attribute((packed))
137 {
138  uint16_t range_min;
139  uint16_t range_max;
141 
143 typedef struct __attribute((packed))
144 {
145  uint16_t present_lightness;
146  uint16_t target_lightness;
147  uint8_t remaining_time;
149 
151 typedef struct __attribute((packed))
152 {
153  uint16_t present_lightness;
154  uint16_t target_lightness;
155  uint8_t remaining_time;
157 
159 typedef struct __attribute((packed))
160 {
161  uint16_t lightness;
163 
165 typedef struct __attribute((packed))
166 {
167  uint16_t lightness;
169 
171 typedef struct __attribute((packed))
172 {
173  uint8_t status;
174  uint16_t range_min;
175  uint16_t range_max;
177 
179 #endif /* LIGHT_LIGHTNESS_MESSAGES_H__ */
uint8_t delay
Encoded message execution delay in 5 millisecond steps.
Message format for the Light Lightness Last Status message (actual/perceptually uniform state)...
uint16_t present_lightness
The present value of the lightness state.
uint16_t range_min
The value of the lightness range min state.
Message format for the Light Lightness Default Status message (actual/perceptually uniform state)...
uint16_t lightness
The value of the lightness last state.
Message format for the Light Lightness Default Set message.
uint8_t tid
Transaction number for application.
uint16_t range_min
The value of the lightness range min state.
Message format for the Light Lightness Linear Status message.
Message format for the Light Lightness Status message (actual/perceptually uniform state)...
Packed message structure typedefs are used for packing and unpacking byte stream. ...
uint16_t target_lightness
The target value of the lightness state (optional)
uint16_t range_max
The value of the lightness range max state.
uint8_t remaining_time
Encoded remaining time.
Message format for the Light Lightness Linear Set message.
uint16_t target_lightness
The target value of the linear lightness state (optional)
uint8_t tid
Transaction number for application.
uint16_t present_lightness
The present value of the linear lightness state.
uint16_t lightness
The value of the lightness last state.
uint8_t transition_time
Encoded transition time value.
Message format for the Light Lightness Range Status message.
uint16_t range_max
The value of the lightness range max state.
Message format for the Light Lightness Range Set message.
uint8_t transition_time
Encoded transition time value.
uint8_t remaining_time
Encoded remaining time.
uint8_t delay
Encoded message execution delay in 5 millisecond steps.

Documentation feedback | Developer Zone | Subscribe | Updated