Added compare inside with outside sensors; webserver template files

This commit is contained in:
2017-08-30 21:59:31 +02:00
parent 93dd54ab6d
commit e6b7bdf721
87 changed files with 84289 additions and 8 deletions

View File

@@ -6,6 +6,7 @@
config_t cfg;
const config_setting_t *pins;
const config_setting_t *compareIDs;
void cfginit(void) {
@@ -74,3 +75,19 @@ int cfgreadsensornodes(sensornode *nodes, int nodecount) {
}
return 0;
}
int cfgreadcompareidamount(void) {
compareIDs = config_lookup(&cfg, "compare_ids");
return config_setting_length(compareIDs);
}
int cfgreadcompareidvalue(int element) {
compareIDs = config_lookup(&cfg, "compare_ids");
int length = config_setting_length(compareIDs);
if (element < length) {
return config_setting_get_int_elem(compareIDs, element);
} else {
printf("No compare configuration item found.\n");
return -1;
}
}