From 303b6178275280b67115c47efdf372bf02b22d19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Fillod=2C=20F8CFE?= Date: Fri, 6 Feb 2009 17:28:38 +0000 Subject: [PATCH] added RIG_CONF_BUTTON git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2623 7ae35d74-ebe9-4afe-98af-79ac388436b8 --- tests/rigctl_parse.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c index ee1ffeb7a..717052dcd 100644 --- a/tests/rigctl_parse.c +++ b/tests/rigctl_parse.c @@ -6,7 +6,7 @@ * It takes commands in interactive mode as well as * from command line options. * - * $Id: rigctl_parse.c,v 1.15 2009-01-05 02:20:59 mrtembry Exp $ + * $Id: rigctl_parse.c,v 1.16 2009-02-06 17:28:38 fillods Exp $ * * * This program is free software; you can redistribute it and/or @@ -550,8 +550,11 @@ int print_conf_list(const struct confparams *cfp, rig_ptr_t data) case RIG_CONF_CHECKBUTTON: printf("\tCheck button.\n"); break; + case RIG_CONF_BUTTON: + printf("\tButton.\n"); + break; default: - printf("\tUnkown conf\n"); + printf("\tUnknown conf\n"); } return 1; /* !=0, we want them all ! */ @@ -1104,6 +1107,9 @@ declare_proto_rig(set_level) return -RIG_EINVAL; /* no such parameter */ switch (cfp->type) { + case RIG_CONF_BUTTON: + /* arg is ignored */ + break; case RIG_CONF_CHECKBUTTON: case RIG_CONF_COMBO: sscanf(arg2, "%d", &val.i); @@ -1158,6 +1164,10 @@ declare_proto_rig(get_level) fprintf(fout, "%s: ", cmd->arg2); switch (cfp->type) { + case RIG_CONF_BUTTON: + /* there's not sense in retrieving value of stateless button */ + return -RIG_EINVAL; + case RIG_CONF_CHECKBUTTON: case RIG_CONF_COMBO: fprintf(fout, "%d\n", val.i); @@ -1253,6 +1263,9 @@ declare_proto_rig(set_parm) return -RIG_EINVAL; /* no such parameter */ switch (cfp->type) { + case RIG_CONF_BUTTON: + /* arg is ignored */ + break; case RIG_CONF_CHECKBUTTON: case RIG_CONF_COMBO: sscanf(arg2, "%d", &val.i); @@ -1307,6 +1320,9 @@ declare_proto_rig(get_parm) fprintf(fout, "%s: ", cmd->arg2); switch (cfp->type) { + case RIG_CONF_BUTTON: + /* there's not sense in retrieving value of stateless button */ + return -RIG_EINVAL; case RIG_CONF_CHECKBUTTON: case RIG_CONF_COMBO: fprintf(fout, "%d\n", val.i);