]> git.sur5r.net Git - tio/blobdiff - src/configfile.c
Update upstream source from tag 'upstream/2.0'
[tio] / src / configfile.c
index b8a16492ea2513f5b3c57813a3c8aa383b1914db..864380e04a79d3235a5e12e1acc30cdde6c19836 100644 (file)
@@ -42,6 +42,9 @@
 #include "options.h"
 #include "error.h"
 #include "print.h"
+#include "rs485.h"
+#include "timestamp.h"
+#include "alert.h"
 
 static struct config_t *c;
 
@@ -249,8 +252,42 @@ static int data_handler(void *user, const char *section, const char *name,
                 option.prefix_key = value[0];
             }
         }
-
+        else if (!strcmp(name, "response-wait"))
+        {
+            if (!strcmp(value, "enable"))
+            {
+                option.response_wait = true;
+            }
+            else if (!strcmp(value, "disable"))
+            {
+                option.response_wait = false;
+            }
+        }
+        else if (!strcmp(name, "response-timeout"))
+        {
+            option.response_timeout = atoi(value);
+        }
+        else if (!strcmp(name, "rs-485"))
+        {
+            if (!strcmp(value, "enable"))
+            {
+                option.rs485 = true;
+            }
+            else if (!strcmp(value, "disable"))
+            {
+                option.rs485 = false;
+            }
+        }
+        else if (!strcmp(name, "rs-485-config"))
+        {
+            rs485_parse_config(value);
+        }
+        else if (!strcmp(name, "alert"))
+        {
+            option.alert = alert_option_parse(value);
+        }
     }
+
     return 0;
 }