From 5964e1de18f7ac77560e4f391f30cb14b98cfbb7 Mon Sep 17 00:00:00 2001 From: Michael Black W9MDB Date: Wed, 17 Feb 2021 08:43:12 -0600 Subject: [PATCH] Improve FTDX3000 antenna handling https://github.com/Hamlib/Hamlib/issues/510 --- doc/man1/rigctl.1 | 10 +++++----- rigs/yaesu/ft3000.c | 10 +++++----- rigs/yaesu/newcat.c | 4 ++++ rigs/yaesu/newcat.h | 2 +- 4 files changed, 15 insertions(+), 11 deletions(-) diff --git a/doc/man1/rigctl.1 b/doc/man1/rigctl.1 index aff36b532..b8751ffdc 100644 --- a/doc/man1/rigctl.1 +++ b/doc/man1/rigctl.1 @@ -675,11 +675,11 @@ For the IC-7851, FTDX3000 (and perhaps others) it means this: .IP .in +4n .EX -1 = TX/RX = ANT1 -2 = TX/RX = ANT2 -3 = TX/RX = ANT3 -4 = TX/RX = ANT1/ANT4 or ANT1/ANT3 -5 = TX/RX = ANT2/ANT4 or ANT2/ANT3 +1 = TX/RX = ANT1 FTDX3000=ANT1/ANT3 +2 = TX/RX = ANT2 FTDX3000=ANT2/ANT3 +3 = TX/RX = ANT3 FTDX3000=ANT3 +4 = TX/RX = ANT1/ANT4 +5 = TX/RX = ANT2/ANT4 6 = TX/RX = ANT3/ANT4 .EE .in diff --git a/rigs/yaesu/ft3000.c b/rigs/yaesu/ft3000.c index a3d90b72c..761645c0f 100644 --- a/rigs/yaesu/ft3000.c +++ b/rigs/yaesu/ft3000.c @@ -94,15 +94,15 @@ int ft3000_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option) ENTERFUNC; switch (ant) { - case 3: - cmd = "EX0320"; // TRX ANT3 - break; - case 4: + case 1: cmd = "EX0321"; // R3/1 ANT1/ANT3 break; - case 5: + case 2: cmd = "EX0322"; // RE/2 ANT2/ANT3 break; + case 3: + cmd = "EX0320"; // TRX ANT3 + break; default: rig_debug(RIG_DEBUG_ERR, "%s: expected 3,4,5 got %d\n", __func__, ant); RETURNFUNC(-RIG_EINVAL); diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index fd013bd49..dacfa13f3 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -3343,6 +3343,8 @@ int newcat_get_ant(RIG *rig, vfo_t vfo, ant_t dummy, value_t *option, ENTERFUNC; + option->i = 0; // default to no options + if (!newcat_valid_command(rig, command)) { RETURNFUNC(-RIG_ENAVAIL); @@ -3399,6 +3401,8 @@ int newcat_get_ant(RIG *rig, vfo_t vfo, ant_t dummy, value_t *option, RETURNFUNC(-RIG_EPROTO); } + *ant_tx = * ant_rx = *ant_curr; + RETURNFUNC(RIG_OK); } diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h index b74821ea4..0403c1506 100644 --- a/rigs/yaesu/newcat.h +++ b/rigs/yaesu/newcat.h @@ -50,7 +50,7 @@ typedef char ncboolean; /* shared function version */ -#define NEWCAT_VER "20210208" +#define NEWCAT_VER "20210213" /* Hopefully large enough for future use, 128 chars plus '\0' */ #define NEWCAT_DATA_LEN 129