diff options
Diffstat (limited to 'cethcan/main.c')
-rw-r--r-- | cethcan/main.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/cethcan/main.c b/cethcan/main.c index d6c5bbf..5bdca0a 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, *lightcfg; + json_t *config, *ethercfg, *lightcfg, *socancfg; do { optch = getopt(argc, argv, "c:"); @@ -54,6 +54,13 @@ int main(int argc, char **argv) return 1; } + socancfg = json_object_get(config, "socketcan"); + for (size_t i = 0; i < json_array_size(socancfg); i++) { + json_t *c = json_array_get(socancfg, i); + if (socan_init(c)) + return 1; + } + http_init(); event_base_loop(ev_base, 0); |