+#endif /* UCLINUX */
+
+/* Emulation of separate gnokiid binary for uClinux */
+
+#ifdef UCLINUX
+
+static int gnokiid(int argc, char *argv[])
+{
+ bool DebugMode; /* When true, run in debug mode */
+ char *Model; /* Model from .gnokiirc file. */
+ char *Port; /* Port from .gnokiirc file */
+ char *Initlength; /* Init length from .gnokiirc file */
+ char *Connection; /* Connection type from .gnokiirc file */
+ char *BinDir; /* Directory of the mgnokiidev command */
+
+ /* evaluate for presence of "--debug" argument in parameter */
+ DebugMode = false;
+ if(argc>0)
+ {
+ if( strcmp(argv[0],"--debug" ))
+ {
+ usage();
+ return -1;
+ }
+ else
+ DebugMode = true;
+ }
+
+#ifdef DEBUG
+ fprintf (stderr, _("Entering gnokiid mode...\n"));
+#endif
+
+ if (CFG_ReadConfig(&Model, &Port, &Initlength, &Connection, &BinDir, true) < 0)
+ return(-1);
+
+ if (VM_Initialise(Model, Port, Initlength, GCT_FBUS, BinDir, DebugMode, true, ""/*SynchronizeTime*/) == false)
+ return (-1);
+
+ VM_Terminate();
+
+ return 0;
+}
+
+#endif /* UCLINUX */
+
+#ifndef UCLINUX
+