Added compare inside with outside sensors; webserver template files
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user