From a8a317f6abe22f83d7bf2e9ffd3879d6af55f14b Mon Sep 17 00:00:00 2001 From: Mike Black W9MDB Date: Sat, 16 Oct 2021 09:45:24 -0500 Subject: [PATCH] Move parse_mode error message to the function itself --- src/misc.c | 3 ++- tests/rigctl_parse.c | 7 +++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/misc.c b/src/misc.c index 326ed89ed..2c49b5518 100644 --- a/src/misc.c +++ b/src/misc.c @@ -431,8 +431,8 @@ static const struct { RIG_MODE_AMS, "AMS" }, { RIG_MODE_PKTLSB, "PKTLSB" }, { RIG_MODE_PKTUSB, "PKTUSB" }, - { RIG_MODE_PKTUSB, "USB-D" }, { RIG_MODE_PKTLSB, "LSB-D" }, + { RIG_MODE_PKTUSB, "USB-D" }, { RIG_MODE_PKTFM, "PKTFM" }, { RIG_MODE_PKTFMN, "PKTFMN" }, { RIG_MODE_ECSSUSB, "ECSSUSB" }, @@ -481,6 +481,7 @@ rmode_t HAMLIB_API rig_parse_mode(const char *s) } } + rig_debug(RIG_DEBUG_WARN, "%s: mode '%s' not found\n", __func__, s); return RIG_MODE_NONE; } diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c index 4fe15a5d4..40810083f 100644 --- a/tests/rigctl_parse.c +++ b/tests/rigctl_parse.c @@ -2797,11 +2797,10 @@ declare_proto_rig(set_split_mode) RETURNFUNC(RIG_OK); } + // mode could be RIG_MODE_NONE here + // we treat it as non-fatal + // rig_parse_mode will spit out error msg mode = rig_parse_mode(arg1); - if (mode == RIG_MODE_NONE) - { - rig_debug(RIG_DEBUG_WARN, "%s: unknown mode=%s\n", __func__, arg1); - } CHKSCN1ARG(sscanf(arg2, "%d", &width)); RETURNFUNC(rig_set_split_mode(rig, txvfo, mode, (pbwidth_t) width)); }