Server - added 'install' make target
[tpg/opendispense2.git] / src / server / main.c
index f2f66c3..6c2f691 100644 (file)
@@ -54,6 +54,8 @@ void sigint_handler()
 void PrintUsage(const char *progname)
 {
        fprintf(stderr, "Usage: %s\n", progname);
+       fprintf(stderr, "  -f,--configfile\n");
+       fprintf(stderr, "        Set the config file path (default `dispsrv.conf')\n");
        fprintf(stderr, "  -d    Set debug level (0 - 2, default 0)\n");
        fprintf(stderr, "  --[dont-]daemonise\n");
        fprintf(stderr, "        Run (or explicitly don't run) the server disconnected from the terminal\n");
@@ -83,6 +85,7 @@ int main(int argc, char *argv[])
                                break;
                        default:
                                // Usage Error
+                               fprintf(stderr, "Unknown option '-%c'\n", arg[1]);
                                PrintUsage(argv[0]);
                                return -1;
                        }
@@ -101,6 +104,7 @@ int main(int argc, char *argv[])
                        }
                        else {
                                // Usage error
+                               fprintf(stderr, "Unknown option '%s'\n", arg);
                                PrintUsage(argv[0]);
                                return -1;
                        }
@@ -123,7 +127,7 @@ int main(int argc, char *argv[])
        giServer_Port        = Config_GetValue_Int("server_port", 0);
        gsItemListFile       = Config_GetValue("items_file", 0);
 
-       gbNoCostMode         = Config_GetValue_Bool("test_mode", 0);
+       gbNoCostMode         = (Config_GetValue_Bool("test_mode", 0) == 1);
 
        signal(SIGINT, sigint_handler);
        signal(SIGTERM, sigint_handler);
@@ -226,6 +230,7 @@ int InitSerial(const char *File, int BaudRate)
        {
        case 1200:      baud = B1200;   break;
        case 9600:      baud = B9600;   break;
+       case 115200:    baud = B115200; break;
        default:        close(fd);      return -1;
        }
        

UCC git Repository :: git.ucc.asn.au