1 /* Bluetooth: Mesh Generic OnOff, Generic Level, Lighting & Vendor Models
2  *
3  * Copyright (c) 2018 Vikrant More
4  *
5  * SPDX-License-Identifier: Apache-2.0
6  */
7 
8 #ifndef _TRANSITION_H
9 #define _TRANSITION_H
10 
11 #include "device_composition.h"
12 
13 #define UNKNOWN_VALUE 0x3F
14 #define DEVICE_SPECIFIC_RESOLUTION 10
15 
16 enum transition_types {
17 	MOVE = 0x01,
18 	NON_MOVE
19 };
20 
21 struct transition_data {
22 	bool just_started;
23 	uint8_t type;
24 	uint8_t tt;
25 	uint8_t rt;
26 	uint8_t delay;
27 	uint32_t quo_tt;
28 	uint32_t counter;
29 	uint32_t total_duration;
30 	int64_t start_timestamp;
31 
32 	struct k_timer timer;
33 };
34 
35 extern struct transition_data onoff_transition;
36 
37 extern struct k_timer dummy_timer;
38 
39 void calculate_rt(struct transition_data *transition);
40 void set_transition_values(uint8_t type);
41 
42 void onoff_handler(void);
43 void level_lightness_handler(void);
44 void level_temp_handler(void);
45 void light_lightness_actual_handler(void);
46 void light_lightness_linear_handler(void);
47 void light_ctl_handler(void);
48 void light_ctl_temp_handler(void);
49 
50 #endif
51