fprintf(stdout, _(" usage: gnokii [--help] [--version]\n"
));
+
+#ifdef UCLINUX
+ fprintf(stdout, _(
+" gnokii --ir <command> [<command args>...]\n"
+ ));
+#endif /* UCLINUX */
+
#ifndef UCLINUX
+ fprintf(stdout, _(
" gnokii --monitor [-noloop|-nl]\n"
));
#endif /* UCLINUX */
{
int c, i, rc = -1;
- int nargc = argc-2;
+ int nargc;
char **nargv;
/* Every option should be in this array. */
if (CFG_ReadConfig(&model, &Port, &Initlength, &Connection, &BinDir, false) < 0) {
exit(-1);
}
+ if (argc>1 && !strcmp(argv[1],"--ir")) {
+ argc--;
+ argv[1]=argv[0];
+ argv++;
+ Connection="infrared";
+ }
/* Handle command line arguments. */
if((nargv = malloc(sizeof(char *) * argc)) != NULL) {
+ nargc = argc-2;
for(i = 2; i < argc; i++)
nargv[i-2] = argv[i];
nargv[argc-2] = NULL; /* required by gnokiid() for execv(3) */
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;
fprintf (stderr, _("Initializing 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)
+ if (VM_Initialise(model, Port, Initlength, GetConnectionTypeFromString(Connection), BinDir, DebugMode, true, ""/*SynchronizeTime*/) == false)
return (-1);
if (argc>0) {