IsOutside boolean added to config and insertData. Readme updated

This commit is contained in:
2017-08-27 22:04:17 +02:00
parent 27ed59b52f
commit 18c7d610b9
8 changed files with 32 additions and 10 deletions

View File

@@ -57,11 +57,12 @@ int cfgreadsensornodes(sensornode *nodes, int nodecount) {
/* Only output the record if all of the expected fields are present. */
const char *ip;
if (!config_setting_lookup_string(sensornodesetting, "ip", &ip))
int outside;
if (!(config_setting_lookup_string(sensornodesetting, "ip", &ip) && config_setting_lookup_int(sensornodesetting, "outside", &outside)))
continue;
strcpy(currentNode->ip, ip);
currentNode->isoutside = outside;
//if (i < count - 1) { //stop at last item
currentNode->next = malloc(sizeof(sensornode));
currentNode = currentNode->next;