nRF5 SDK for Mesh v5.0.0
scene_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 SCENE_COMMON_H__
39 #define SCENE_COMMON_H__
40 
41 #include <stdint.h>
42 #include "model_common.h"
43 
56 #define SCENE_COMPANY_ID 0xFFFF
57 
61 #define SCENE_REGISTER_SCENE_NUMBER_MIN (1)
62 
67 #define SCENE_NUMBER_NO_SCENE (0x0000)
68 
69 /* See "@tagMeshDevPr, section 4.1.3". 0 is a prohibited value for property ID, so it can represent
70  * "no property id" without concern for a collision.
71  */
72 #define SCENE_NO_PROPERTY_ID 0
73 
75 #define SCENE_SCENES_MAX (65535)
76 
85 #ifndef SCENE_REGISTER_ARRAY_SIZE
86 #define SCENE_REGISTER_ARRAY_SIZE (16)
87 #endif
88 
92 typedef enum
93 {
101 
103 typedef struct
104 {
105  uint16_t scene_number;
107 
108 
110 typedef struct
111 {
112  uint16_t scene_number;
113  uint8_t tid;
115 
117 typedef struct
118 {
119  uint8_t status_code;
120  uint16_t current_scene;
121  uint16_t target_scene;
122  uint32_t remaining_time_ms;
124 
126 typedef struct
127 {
128  uint8_t status_code;
129  uint16_t current_scene;
130  uint16_t scenes[SCENE_REGISTER_ARRAY_SIZE];
132 
134 typedef struct
135 {
136  uint16_t scene_number;
138 
140 #endif /* SCENE_COMMON_H__ */
uint32_t remaining_time_ms
Remaining transition time in milliseconds.
Definition: scene_common.h:122
Parameters for the Scene Register Status message.
Definition: scene_common.h:126
Parameters for the Scene Recall message.
Definition: scene_common.h:110
uint16_t current_scene
Scene number of a current scene.
Definition: scene_common.h:129
Parameters for the Scene Delete message.
Definition: scene_common.h:134
The previous operation is failed because register was full.
Definition: scene_common.h:97
#define SCENE_REGISTER_ARRAY_SIZE
Scene Register size definitions.
Definition: scene_common.h:86
uint8_t status_code
Status code for the last operation.
Definition: scene_common.h:119
Parameters for the Scene Store message.
Definition: scene_common.h:103
uint8_t tid
Transaction ID.
Definition: scene_common.h:113
scene_status_t
Status code values used by scene_status_params_t and scene_register_status_params_t.
Definition: scene_common.h:92
uint16_t scene_number
Number of the scene to be stored.
Definition: scene_common.h:112
uint16_t target_scene
Scene number of a target scene.
Definition: scene_common.h:121
uint16_t current_scene
Scene number of a current scene.
Definition: scene_common.h:120
uint8_t status_code
Status code for the last operation.
Definition: scene_common.h:128
uint16_t scene_number
Number of the scene to be deleted.
Definition: scene_common.h:136
The previous operation is valid.
Definition: scene_common.h:95
Parameters for the Scene Status message.
Definition: scene_common.h:117
uint16_t scene_number
Number of the scene to be stored.
Definition: scene_common.h:105
The previous operation is failed because scene was not found.
Definition: scene_common.h:99

Documentation feedback | Developer Zone | Subscribe | Updated