nRF5 SDK for Mesh v5.0.0
light_lc_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_LC_MESSAGES_H__
39 #define LIGHT_LC_MESSAGES_H__
40 
41 #include <stdint.h>
42 #include "light_lc_common.h"
43 
54 #define LIGHT_LC_LIGHT_ONOFF_SET_MINLEN 2
55 
56 #define LIGHT_LC_LIGHT_ONOFF_SET_MAXLEN 4
57 
59 #define LIGHT_LC_PROPERTY_SET_STATUS_FIXED_LEN 2
60 
64 #define LIGHT_LC_PROPERTY_GET_LEN 2
65 
67 #define LIGHT_LC_MODE_SET_STATUS_LEN 1
68 
70 #define LIGHT_LC_OCCUPANCY_MODE_SET_STATUS_LEN 1
71 
73 #define LIGHT_LC_LIGHT_ONOFF_STATUS_MINLEN 1
74 
75 #define LIGHT_LC_LIGHT_ONOFF_STATUS_MAXLEN 3
76 
78 #define LIGHT_LC_PROPERTY_SET_STATUS_MINLEN 3
79 
83 typedef enum
84 {
85  LIGHT_LC_MODE_OPCODE_GET = 0x8291,
86  LIGHT_LC_MODE_OPCODE_SET = 0x8292,
87  LIGHT_LC_MODE_OPCODE_SET_UNACKNOWLEDGED = 0x8293,
88  LIGHT_LC_MODE_OPCODE_STATUS = 0x8294,
89  LIGHT_LC_OCCUPANCY_MODE_OPCODE_GET = 0x8295,
90  LIGHT_LC_OCCUPANCY_MODE_OPCODE_SET = 0x8296,
91  LIGHT_LC_OCCUPANCY_MODE_OPCODE_SET_UNACKNOWLEDGED = 0x8297,
92  LIGHT_LC_OCCUPANCY_MODE_OPCODE_STATUS = 0x8298,
93  LIGHT_LC_LIGHT_ONOFF_OPCODE_GET = 0x8299,
94  LIGHT_LC_LIGHT_ONOFF_OPCODE_SET = 0x829A,
95  LIGHT_LC_LIGHT_ONOFF_OPCODE_SET_UNACKNOWLEDGED = 0x829B,
96  LIGHT_LC_LIGHT_ONOFF_OPCODE_STATUS = 0x829C,
97  LIGHT_LC_PROPERTY_OPCODE_GET = 0x829D,
98  LIGHT_LC_PROPERTY_OPCODE_SET = 0x62,
99  LIGHT_LC_PROPERTY_OPCODE_SET_UNACKNOWLEDGED = 0x63,
100  LIGHT_LC_PROPERTY_OPCODE_STATUS = 0x64,
101 } light_lc_opcode_t;
102 
106 typedef struct __attribute((packed))
107 {
108  uint8_t mode;
110 
112 typedef struct __attribute((packed))
113 {
114  uint8_t occupancy_mode;
116 
118 typedef struct __attribute((packed))
119 {
120  uint8_t light_on_off;
121  uint8_t tid;
122  uint8_t transition_time;
123  uint8_t delay;
125 
127 typedef struct __attribute((packed))
128 {
129  uint16_t property_id;
130  uint8_t property_buffer[LIGHT_LC_PROPERTY_BUF_SIZE];
132 
134 typedef struct __attribute((packed))
135 {
136  uint16_t property_id;
138 
141 typedef struct __attribute((packed))
142 {
143  uint8_t mode;
145 
147 typedef struct __attribute((packed))
148 {
149  uint8_t occupancy_mode;
151 
153 typedef struct __attribute((packed))
154 {
157  uint8_t remaining_time;
159 
161 typedef struct __attribute((packed))
162 {
163  uint16_t property_id;
164  uint8_t property_buffer[LIGHT_LC_PROPERTY_BUF_SIZE];
166 
168 #endif /* LIGHT_LC_MESSAGES_H__ */
Packed message structure typedefs are used for packing and unpacking byte stream. ...
Message format for the Light LC Mode Status message.
uint16_t property_id
Property ID identifying a Light LC Property.
Message format for the Light LC Occupancy Mode set message.
Message format for the Light LC Light OnOff set message.
Message format for the Light LC Property Status message.
uint16_t property_id
Property ID identifying a Light LC Property.
Message format for the Light LC Occupancy Mode Status message.
Message format for the Light LC Property set message.
uint8_t mode
The target value of the Mode state.
Message format for the Light LC Property get message.
uint16_t property_id
Property ID identifying a Light LC Property.
uint8_t target_light_onoff
The target value of the Light OnOff state.
uint8_t mode
The present value of the Light LC Mode state.
uint8_t present_light_onoff
The present value of the Light OnOff state.
uint8_t transition_time
Transition time.
uint8_t light_on_off
The target value of the Light LC Light OnOff state.
uint8_t delay
Message execution delay (5 ms steps)
uint8_t occupancy_mode
The target value of the Occupancy Mode state.
uint8_t occupancy_mode
The present value of the Occupancy Mode state.
#define LIGHT_LC_PROPERTY_BUF_SIZE
Property size definitions.
uint8_t remaining_time
Remaining transition time.
Message format for the Light LC Light OnOff Status message.

Documentation feedback | Developer Zone | Subscribe | Updated