summaryrefslogtreecommitdiff
path: root/cethcan/main.c
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@diac24.net>2013-03-25 23:01:50 +0100
committerDavid Lamparter <equinox@diac24.net>2013-03-25 23:01:50 +0100
commit1b5e4f4ba195ad4ed02cfac6129c386c4aeaf7cd (patch)
tree585729717365831250afc150b95f51809d1330f5 /cethcan/main.c
parent2de09bbd1dc380734946b2389f1177f48ae0b4e5 (diff)
cethcan: more code
Diffstat (limited to 'cethcan/main.c')
-rw-r--r--cethcan/main.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/cethcan/main.c b/cethcan/main.c
index 6d79a9f..0794254 100644
--- a/cethcan/main.c
+++ b/cethcan/main.c
@@ -7,7 +7,7 @@ int main(int argc, char **argv)
int optch = 0;
const char *cfgfile = "cethcan.json";
json_error_t je;
- json_t *config, *ethercfg;
+ json_t *config, *ethercfg, *lightcfg;
do {
optch = getopt(argc, argv, "c:");
@@ -47,6 +47,13 @@ int main(int argc, char **argv)
return 1;
}
+ lightcfg = json_object_get(config, "lights");
+ for (size_t i = 0; i < json_array_size(lightcfg); i++) {
+ json_t *c = json_array_get(lightcfg, i);
+ if (light_init_conf(c))
+ return 1;
+ }
+
event_base_loop(ev_base, 0);
return 0;
}