summaryrefslogtreecommitdiff
path: root/cethcan/main.c
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@diac24.net>2013-06-01 00:23:31 +0000
committerroot <root@beaglebone.(none)>2013-06-01 00:23:31 +0000
commitae9fdcca4cbe82f00166912a9ab78dffdf5be492 (patch)
treeb10fd3ae6ddb6faa3f1c965774b3e3181de1130f /cethcan/main.c
parentb7e8785f3c304423bf8b766c378252d59541d581 (diff)
cethcan: beancounters support
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 5bdca0a..cc3522b 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, *socancfg;
+ json_t *config, *ethercfg, *lightcfg, *beancfg, *socancfg;
do {
optch = getopt(argc, argv, "c:");
@@ -54,6 +54,13 @@ int main(int argc, char **argv)
return 1;
}
+ beancfg = json_object_get(config, "beans");
+ for (size_t i = 0; i < json_array_size(beancfg); i++) {
+ json_t *c = json_array_get(beancfg, i);
+ if (bean_init_conf(c))
+ 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);