liblightify
node.h
Go to the documentation of this file.
1 /*
2  liblightify -- library to control OSRAM's LIGHTIFY
3 
4 Copyright (c) 2015, Tobias Frost <tobi@coldtobi.de>
5 All rights reserved.
6 
7 Redistribution and use in source and binary forms, with or without
8 modification, are permitted provided that the following conditions are met:
9  * Redistributions of source code must retain the above copyright
10  notice, this list of conditions and the following disclaimer.
11  * Redistributions in binary form must reproduce the above copyright
12  notice, this list of conditions and the following disclaimer in the
13  documentation and/or other materials provided with the distribution.
14  * Neither the name of the author nor the
15  names of its contributors may be used to endorse or promote products
16  derived from this software without specific prior written permission.
17 
18 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
19 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
22 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
25 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 */
29 
30 /*
31  * node.h
32  *
33  * Created on: 13.08.2015
34  * Author: tobi
35  */
36 
37 #ifndef SRC_NODE_H_
38 #define SRC_NODE_H_
39 
40 
41 #ifdef HAVE_CONFIG_H
42 #include "config.h"
43 #endif
44 
45 #include <stdint.h>
46 
47 struct lightify_node;
48 
49 // IMPORTANT NOTE //
50 // THIS API WILL ONLY MODIFY THE CACHED DATA -- They do NOT query the actual hardware.
51 
58 int lightify_node_new(struct lightify_ctx *ctx, struct lightify_node** newnode);
59 
65 int lightify_node_remove(struct lightify_node* node);
66 
67 
74 
81 
91 int lightify_node_set_name(struct lightify_node* node, char *name);
92 
93 
104 int lightify_node_set_nodeadr(struct lightify_node* node, uint64_t adr);
105 
115 int lightify_node_set_zoneadr(struct lightify_node* node, uint16_t adr);
116 
117 
127 int lightify_node_set_grpadr(struct lightify_node* node, uint16_t adr);
128 
129 
137 
138 
145 int lightify_node_set_red(struct lightify_node* node, int red);
146 
147 
154 int lightify_node_set_green(struct lightify_node* node, int green);
155 
156 
162 int lightify_node_set_blue(struct lightify_node* node, int blue);
163 
164 
170 int lightify_node_set_white(struct lightify_node* node, int white);
171 
172 
179 int lightify_node_set_cct(struct lightify_node* node, int cct);
180 
188 
195 int lightify_node_set_onoff(struct lightify_node* node, uint8_t on);
196 
203 int lightify_node_set_online_status(struct lightify_node* node, uint8_t state);
204 
211 int lightify_node_set_stale(struct lightify_node *node, int stale);
212 
213 #endif /* SRC_NODE_H_ */
lightify_node_type
Definition: liblightify.h:105
int lightify_node_set_brightness(struct lightify_node *node, int brightness)
Definition: node.c:268
int lightify_node_set_red(struct lightify_node *node, int red)
Definition: node.c:213
int lightify_node_remove(struct lightify_node *node)
Definition: node.c:117
int lightify_node_set_name(struct lightify_node *node, char *name)
Definition: node.c:151
int lightify_node_set_grpadr(struct lightify_node *node, uint16_t adr)
Definition: node.c:191
int lightify_node_set_onoff(struct lightify_node *node, uint8_t on)
Definition: node.c:280
struct lightify_node * lightify_node_get_prevnode(struct lightify_node *node)
Definition: node.c:145
int lightify_node_set_cct(struct lightify_node *node, int cct)
Definition: node.c:257
int lightify_node_set_nodeadr(struct lightify_node *node, uint64_t adr)
Definition: node.c:169
int lightify_node_set_white(struct lightify_node *node, int white)
Definition: node.c:246
int lightify_node_set_lamptype(struct lightify_node *node, enum lightify_node_type)
Definition: node.c:202
int lightify_node_set_stale(struct lightify_node *node, int stale)
Definition: node.c:307
int lightify_node_set_green(struct lightify_node *node, int green)
Definition: node.c:235
int lightify_node_set_blue(struct lightify_node *node, int blue)
Definition: node.c:224
struct lightify_node * lightify_node_get_nextnode(struct lightify_node *node)
Definition: node.c:140
int lightify_node_new(struct lightify_ctx *ctx, struct lightify_node **newnode)
Definition: node.c:80
int lightify_node_set_zoneadr(struct lightify_node *node, uint16_t adr)
Definition: node.c:180
int lightify_node_set_online_status(struct lightify_node *node, uint8_t state)
Definition: node.c:291
int blue
Definition: node.c:65
struct lightify_ctx * ctx
Definition: node.c:46
int white
Definition: node.c:66
char * name
Definition: node.c:61
int red
Definition: node.c:63
int green
Definition: node.c:64
int brightness
Definition: node.c:69
int cct
Definition: node.c:67