-
- /* Handle command line arguments. */
-
- if (argc >= 2 && strcmp(argv[1], "--help") == 0) {
- usage();
- exit(0);
- }
-
- /* Display version, copyright and build information. */
-
- if (argc >= 2 && strcmp(argv[1], "--version") == 0) {
- version();
- exit(0);
- }
-
- if (argc >= 2 && strcmp(argv[1], "--debug") == 0) {
- DebugMode = true;
- } else {
- DebugMode = false;
- }
-
- if (!strcmp(Connection, "infrared")) {
- connection=GCT_Infrared;
- }
-
- TerminateThread=false;
-
- if (VM_Initialise(Model, Port, Initlength, connection, BinDir, DebugMode, true) == false) {
- exit (-1);
- }
-
- while (1) {
- if (TerminateThread==true) {
- VM_Terminate();
- exit(1);
- }
- sleep (1);
- }
- exit (0);
+ /* Handle command line arguments. */
+
+ if (argc >= 2 && strcmp(argv[1], "--help") == 0) {
+ usage();
+ exit(0);
+ }
+
+ /* Display version, copyright and build information. */
+
+ if (argc >= 2 && strcmp(argv[1], "--version") == 0) {
+ version();
+ exit(0);
+ }
+
+ if (argc >= 2 && strcmp(argv[1], "--debug") == 0) {
+ DebugMode = true;
+ }
+ else {
+ DebugMode = false;
+ }
+
+ connection=GetConnectionTypeFromString(Connection);
+
+ /* MBUS wasn't tested */
+ if (connection!=GCT_FBUS && connection!=GCT_MBUS &&
+ connection!=GCT_Infrared && connection!=GCT_Tekram) {
+ fprintf(stdout,_("Incorrect connection type!\n"));
+ exit(0);
+ }
+
+ TerminateThread=false;
+
+ if (VM_Initialise(Model, Port, Initlength, connection, BinDir, DebugMode, true, SynchronizeTime) == false)
+ exit (-1);
+
+ while (1) {
+ if (TerminateThread==true) {
+ VM_Terminate();
+ exit(1);
+ }
+ sleep (1);
+ }
+ exit (0);