moved raspberry and router gpio to pi_as_powerwitch on github
[svn42.git] / door_daemon / options.c
index e67706e..f5835a2 100644 (file)
@@ -6,8 +6,9 @@
  *  This file is part of door_daemon.
  *
  *  door_daemon is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  door_daemon is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -170,7 +171,7 @@ int options_parse(options_t* opt, int argc, char* argv[])
     PARSE_STRING_PARAM("-C","--chroot", opt->chroot_dir_)
     PARSE_STRING_PARAM("-P","--write-pid", opt->pid_file_)
     PARSE_STRING_LIST("-L","--log", opt->log_targets_)
-    PARSE_STRING_PARAM("-d","--device", opt->ttyusb_dev_)
+    PARSE_STRING_PARAM("-d","--device", opt->door_dev_)
     PARSE_STRING_PARAM("-s","--socket", opt->command_sock_)
     else 
       return i;
@@ -199,8 +200,8 @@ void options_default(options_t* opt)
   opt->pid_file_ = NULL;
   string_list_init(&opt->log_targets_);
 
-  opt->ttyusb_dev_ = strdup("/dev/ttyUSB0");
-  opt->command_sock_ = strdup("/var/run/door_daemon");
+  opt->door_dev_ = strdup("/dev/door");
+  opt->command_sock_ = strdup("/var/run/door_daemon/cmd.sock");
 }
 
 void options_clear(options_t* opt)
@@ -220,8 +221,8 @@ void options_clear(options_t* opt)
     free(opt->pid_file_);
   string_list_clear(&opt->log_targets_);
 
-  if(opt->ttyusb_dev_)
-    free(opt->ttyusb_dev_);
+  if(opt->door_dev_)
+    free(opt->door_dev_);
   if(opt->command_sock_)
     free(opt->command_sock_);
 }
@@ -238,8 +239,8 @@ void options_print_usage()
   printf("            [-L|--log] <target>:<level>[,<param1>[,<param2>..]]\n");
   printf("                                                add a log target, can be invoked several times\n");
 
-  printf("            [-d|--device] <tty device>          the device file e.g. /dev/ttyUSB0\n");
-  printf("            [-s|--command-sock] <unix sock>     the command socket e.g. /var/run/door_daemon\n");
+  printf("            [-d|--device] <tty device>          the device file e.g. /dev/door\n");
+  printf("            [-s|--command-sock] <unix sock>     the command socket e.g. /var/run/door_daemon/cmd.sock\n");
 }
 
 void options_print(options_t* opt)
@@ -256,6 +257,6 @@ void options_print(options_t* opt)
   printf("log_targets: \n");
   string_list_print(&opt->log_targets_, "  '", "'\n");
 
-  printf("ttyusb_dev: '%s'\n", opt->ttyusb_dev_);
+  printf("door_dev: '%s'\n", opt->door_dev_);
   printf("command_sock: '%s'\n", opt->command_sock_);
 }