[Hamlib-commits] Hamlib -- Ham radio control libraries branch Hamlib-4.0 updated. c76bf379e79df2f79
Library to control radio transceivers and receivers
Brought to you by:
n0nb
From: Nate B. <n0...@us...> - 2020-11-14 13:58:44
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Hamlib -- Ham radio control libraries". The branch, Hamlib-4.0 has been updated via c76bf379e79df2f79880e3fefd8e7a05b251217f (commit) via 319d227b3cba8088ecf753000253674bd60418da (commit) via 8765f75b0207bb83e4c1620be21716bb4b19e16e (commit) via 96613e149dd9bf0175342d93b21eee6a3b9ed6fd (commit) via e014dbf71527b1219d07d3afc87e65e2ea57315c (commit) via 5f0bbad9c7f3703b897767ec79f6913f2d2eb7d6 (commit) via ff42aca3978f39017cc0e3244a7c3da63c3d639a (commit) via 051c6449e44079edcddcd8c7617d6f5a9181d755 (commit) via 9aabaa94e05568fa19d1b2f2fb8d7a4d0dd782de (commit) via 7ba0ddbdcc2ffc64ad7a2089ea1f4dd91306430a (commit) via 8fda0436a1a19863060bd1117bbffa61ed815443 (commit) via d9bd8dd38c2a5d2acc2e5969adaba0b80e5c6083 (commit) via 68151ba30b24e12b3a2c672daf364068ff9264f2 (commit) via f1361a8937038b9e8fb6cd079e3a1facf41073ea (commit) via 10d142883238ebb6a1b5d011d5f873ca5a44e9cc (commit) via d9c7a3cb1cd045d7bc6fb72952fc4fd2aff127cc (commit) via 21546623f343b46c9452207073c3dd34f9429cb6 (commit) via 3a32c66fcd8797fd1d4d08c0470f25fe92387600 (commit) via 048d8f28fcc8cb1f4240f1ece7eea9ff372e7a81 (commit) via 43fe9005a576e801dd1d267d636c9901c32a84ee (commit) via 6259de5cc76176ad52322983f3b97be9f3fb961d (commit) via 776877f4b3c254174895cc14e7de1337dbeca8b7 (commit) via 9b5b7db92b50f586ad8d29fa60ab4baf7568774a (commit) via c076cc97339b3223f394902643d1d215c1ac0e74 (commit) from c7de6e8b1979c7c36ed5fb56bba6ff6d49445a68 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit c76bf379e79df2f79880e3fefd8e7a05b251217f Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Nov 11 16:40:06 2020 -0600 Change newcat.c RIG_FUNC_TUNER to send AC001 instead of AC002 to turn off TUNE G TUNE 1 is used to start tuning (cherry picked from commit cf3b528ea7f9c4274524f7793b9d9bc0df7d1234) diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 2822278b..372dbc2e 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -4884,9 +4884,6 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) return -RIG_ENAVAIL; } - // some rigs use AC02 to actually start tuning - if (status == 1 && (is_ftdx101 || is_ftdx5000)) { status = 2; } - snprintf(priv->cmd_str, sizeof(priv->cmd_str), "AC00%d%c", status == 0 ? 0 : status, cat_term); commit 319d227b3cba8088ecf753000253674bd60418da Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Nov 11 08:21:38 2020 -0600 Add RIG_METER_TEMP for FTDX101D and other newcat.c rigs Update documentation on TONE and TSQL to make it clear (cherry picked from commit 6ecaed955f268fca4c3c59653cd18153dc0789a7) diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h index 9d6aada6..ba916435 100644 --- a/include/hamlib/rig.h +++ b/include/hamlib/rig.h @@ -812,7 +812,8 @@ enum meter_level_e { RIG_METER_IC = (1 << 3), /*< IC */ RIG_METER_DB = (1 << 4), /*< DB */ RIG_METER_PO = (1 << 5), /*< Power Out */ - RIG_METER_VDD = (1 << 6) /*< Final Amp Voltage */ + RIG_METER_VDD = (1 << 6), /*< Final Amp Voltage */ + RIG_METER_TEMP = (1 << 7) /*< Final Amp Voltage */ }; @@ -1006,8 +1007,8 @@ typedef uint64_t setting_t; #define RIG_FUNC_NB CONSTANT_64BIT_FLAG (1) /*!< \c NB -- Noise Blanker */ #define RIG_FUNC_COMP CONSTANT_64BIT_FLAG (2) /*!< \c COMP -- Speech Compression */ #define RIG_FUNC_VOX CONSTANT_64BIT_FLAG (3) /*!< \c VOX -- Voice Operated Relay */ -#define RIG_FUNC_TONE CONSTANT_64BIT_FLAG (4) /*!< \c TONE -- CTCSS Tone */ -#define RIG_FUNC_TSQL CONSTANT_64BIT_FLAG (5) /*!< \c TSQL -- CTCSS Activate/De-activate and Encode-only value=2 if available */ +#define RIG_FUNC_TONE CONSTANT_64BIT_FLAG (4) /*!< \c TONE -- CTCSS Tone TX */ +#define RIG_FUNC_TSQL CONSTANT_64BIT_FLAG (5) /*!< \c TSQL -- CTCSS Activate/De-activate RX */ #define RIG_FUNC_SBKIN CONSTANT_64BIT_FLAG (6) /*!< \c SBKIN -- Semi Break-in (CW mode) */ #define RIG_FUNC_FBKIN CONSTANT_64BIT_FLAG (7) /*!< \c FBKIN -- Full Break-in (CW mode) */ #define RIG_FUNC_ANF CONSTANT_64BIT_FLAG (8) /*!< \c ANF -- Automatic Notch Filter (DSP) */ commit 8765f75b0207bb83e4c1620be21716bb4b19e16e Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Nov 11 07:26:51 2020 -0600 Undo last commit...FUNC_TONE and FUNC_TSQL handle this correctly (cherry picked from commit 1d07b1d6b6fda08f5b94ec9480c86a038272a44f) diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index fb81777f..2822278b 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -4777,8 +4777,7 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) return -RIG_ENAVAIL; } - // FTDX101D has 3 states 0,1,2 - snprintf(priv->cmd_str, sizeof(priv->cmd_str), "CT0%d%c", status , cat_term); + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "CT0%d%c", status ? 1 : 0 , cat_term); if (rig->caps->targetable_vfo & RIG_TARGETABLE_TONE) { commit 96613e149dd9bf0175342d93b21eee6a3b9ed6fd Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Nov 11 07:06:51 2020 -0600 Chance TSQL in newcat.c to allow more than 2 states FTDX101D has state=2 for encode-only (cherry picked from commit 056e0b2359ec67a373b649d50027b703483bfb8a) diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h index 040b953d..9d6aada6 100644 --- a/include/hamlib/rig.h +++ b/include/hamlib/rig.h @@ -1007,7 +1007,7 @@ typedef uint64_t setting_t; #define RIG_FUNC_COMP CONSTANT_64BIT_FLAG (2) /*!< \c COMP -- Speech Compression */ #define RIG_FUNC_VOX CONSTANT_64BIT_FLAG (3) /*!< \c VOX -- Voice Operated Relay */ #define RIG_FUNC_TONE CONSTANT_64BIT_FLAG (4) /*!< \c TONE -- CTCSS Tone */ -#define RIG_FUNC_TSQL CONSTANT_64BIT_FLAG (5) /*!< \c TSQL -- CTCSS Activate/De-activate */ +#define RIG_FUNC_TSQL CONSTANT_64BIT_FLAG (5) /*!< \c TSQL -- CTCSS Activate/De-activate and Encode-only value=2 if available */ #define RIG_FUNC_SBKIN CONSTANT_64BIT_FLAG (6) /*!< \c SBKIN -- Semi Break-in (CW mode) */ #define RIG_FUNC_FBKIN CONSTANT_64BIT_FLAG (7) /*!< \c FBKIN -- Full Break-in (CW mode) */ #define RIG_FUNC_ANF CONSTANT_64BIT_FLAG (8) /*!< \c ANF -- Automatic Notch Filter (DSP) */ diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 354e6e88..fb81777f 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -4777,8 +4777,8 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) return -RIG_ENAVAIL; } - snprintf(priv->cmd_str, sizeof(priv->cmd_str), "CT0%d%c", status ? 1 : 0, - cat_term); + // FTDX101D has 3 states 0,1,2 + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "CT0%d%c", status , cat_term); if (rig->caps->targetable_vfo & RIG_TARGETABLE_TONE) { diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h index a1e416f0..0ddbf4de 100644 --- a/rigs/yaesu/newcat.h +++ b/rigs/yaesu/newcat.h @@ -50,7 +50,7 @@ typedef char ncboolean; /* shared function version */ -#define NEWCAT_VER "20201103" +#define NEWCAT_VER "20201111" /* Hopefully large enough for future use, 128 chars plus '\0' */ #define NEWCAT_DATA_LEN 129 commit e014dbf71527b1219d07d3afc87e65e2ea57315c Author: Mikael Nousiainen <mik...@ik...> Date: Tue Nov 10 22:17:15 2020 +0200 Remove RIG_PASSBAND_ROOF as it was not necessary to use it (cherry picked from commit 81d02e22f160e81032e7e5c2dfac5161cbe517f5) diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h index f0dbd038..040b953d 100644 --- a/include/hamlib/rig.h +++ b/include/hamlib/rig.h @@ -495,16 +495,13 @@ typedef unsigned int vfo_t; * \brief Macro for bandpass to be set to normal * \def RIG_PASSBAND_NORMAL */ -#define RIG_PASSBAND_NORMAL s_Hz(0) // was 0 but collided with Yaesu SH00; capability +#define RIG_PASSBAND_NORMAL s_Hz(0) /** * \brief Macro for bandpass to be left alone */ #define RIG_PASSBAND_NOCHANGE s_Hz(-1) -/** - * \brief Macro for selecting roofing filter on set_mode/width -- FTDX101D - */ -#define RIG_PASSBAND_ROOF s_Hz(-3) + /** * * \sa rig_passband_normal(), rig_passband_narrow(), rig_passband_wide() diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index cabb74e9..354e6e88 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -6503,6 +6503,8 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) main_sub_vfo = (RIG_VFO_SUB == vfo) ? '1' : '0'; } + // NOTE: RIG_PASSBAND_NORMAL (0) should select the default filter width (SH00) + if (is_ft950) { switch (mode) @@ -7045,7 +7047,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) case RIG_MODE_RTTYR: case RIG_MODE_CW: case RIG_MODE_CWR: - if (width == RIG_PASSBAND_ROOF) { w = 0; } + if (width == RIG_PASSBAND_NORMAL) { w = 0; } else if (width <= 50) { w = 1; } else if (width <= 100) { w = 2; } else if (width <= 150) { w = 3; } @@ -7068,7 +7070,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) case RIG_MODE_LSB: case RIG_MODE_USB: - if (width == RIG_PASSBAND_ROOF) { w = 0; } + if (width == RIG_PASSBAND_NORMAL) { w = 0; } else if (width <= 300) { w = 1; } else if (width <= 400) { w = 2; } else if (width <= 600) { w = 3; } commit 5f0bbad9c7f3703b897767ec79f6913f2d2eb7d6 Author: Mikael Nousiainen <mik...@ik...> Date: Tue Nov 10 10:20:51 2020 +0200 Yaesu newcat repeater offset step size confirmed on an FTDX 5000 (cherry picked from commit 4102e8c1e5157e71a1ac908ffcd4c24e6589f5bf) diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 4d8069c9..cabb74e9 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -1641,7 +1641,7 @@ int newcat_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t offs) return -RIG_EINVAL; } - // TODO: Confirm: Step size is 1 kHz or 10 kHz -- CAT documentation is difficult to interpret + // Step size is 1 kHz offs /= 1000; snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%04li%c", command, offs, cat_term); @@ -1662,7 +1662,7 @@ int newcat_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t offs) return -RIG_EINVAL; } - // TODO: Confirm: Step size is 1 kHz or 10 kHz -- CAT documentation is difficult to interpret + // Step size is 1 kHz offs /= 1000; snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%04li%c", command, offs, cat_term); @@ -1846,7 +1846,7 @@ int newcat_get_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t *offs) return RIG_OK; } - // TODO: Confirm: Step size is 1 kHz or 10 kHz -- CAT documentation is difficult to interpret + // Step size is 1 kHz step = 1000; } else if (is_ftdx5000) @@ -1866,7 +1866,7 @@ int newcat_get_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t *offs) return RIG_OK; } - // TODO: Confirm: Step size is 1 kHz or 10 kHz -- CAT documentation is difficult to interpret + // Step size is 1 kHz step = 1000; } else if (is_ftdx101) commit ff42aca3978f39017cc0e3244a7c3da63c3d639a Author: Mikael Nousiainen <mik...@ik...> Date: Mon Nov 9 22:18:57 2020 +0200 Add repeater offset support for many Yaesu newcat rigs and fix FT-991 repeater offset step (cherry picked from commit e122955213fc9f1e277add81bf07c71ef9c2d48d) diff --git a/rigs/yaesu/ft1200.c b/rigs/yaesu/ft1200.c index 14dacd3f..f6af9d52 100644 --- a/rigs/yaesu/ft1200.c +++ b/rigs/yaesu/ft1200.c @@ -235,6 +235,8 @@ const struct rig_caps ftdx1200_caps = .mW2power = newcat_mW2power, .set_rptr_shift = newcat_set_rptr_shift, .get_rptr_shift = newcat_get_rptr_shift, + .set_rptr_offs = newcat_set_rptr_offs, + .get_rptr_offs = newcat_get_rptr_offs, .set_ctcss_tone = newcat_set_ctcss_tone, .get_ctcss_tone = newcat_get_ctcss_tone, .set_ctcss_sql = newcat_set_ctcss_sql, diff --git a/rigs/yaesu/ft2000.c b/rigs/yaesu/ft2000.c index af7a73d6..c33bcdfd 100644 --- a/rigs/yaesu/ft2000.c +++ b/rigs/yaesu/ft2000.c @@ -236,6 +236,8 @@ const struct rig_caps ft2000_caps = .mW2power = newcat_mW2power, .set_rptr_shift = newcat_set_rptr_shift, .get_rptr_shift = newcat_get_rptr_shift, + .set_rptr_offs = newcat_set_rptr_offs, + .get_rptr_offs = newcat_get_rptr_offs, .set_ctcss_tone = newcat_set_ctcss_tone, .get_ctcss_tone = newcat_get_ctcss_tone, .set_ctcss_sql = newcat_set_ctcss_sql, diff --git a/rigs/yaesu/ft3000.c b/rigs/yaesu/ft3000.c index 32f24550..dc416780 100644 --- a/rigs/yaesu/ft3000.c +++ b/rigs/yaesu/ft3000.c @@ -238,6 +238,8 @@ const struct rig_caps ftdx3000_caps = .mW2power = newcat_mW2power, .set_rptr_shift = newcat_set_rptr_shift, .get_rptr_shift = newcat_get_rptr_shift, + .set_rptr_offs = newcat_set_rptr_offs, + .get_rptr_offs = newcat_get_rptr_offs, .set_ctcss_tone = newcat_set_ctcss_tone, .get_ctcss_tone = newcat_get_ctcss_tone, .set_ctcss_sql = newcat_set_ctcss_sql, diff --git a/rigs/yaesu/ft450.c b/rigs/yaesu/ft450.c index 98857ed4..d0be5671 100644 --- a/rigs/yaesu/ft450.c +++ b/rigs/yaesu/ft450.c @@ -32,19 +32,13 @@ #include "hamlib/rig.h" #include "bandplan.h" -#include "serial.h" -#include "misc.h" -#include "yaesu.h" #include "newcat.h" #include "ft450.h" #include "idx_builtin.h" /* - * ft450 rigs capabilities. - * Also this struct is READONLY! - * + * FT-450 rig capabilities */ - const struct rig_caps ft450_caps = { RIG_MODEL(RIG_MODEL_FT450), @@ -192,6 +186,8 @@ const struct rig_caps ft450_caps = .mW2power = newcat_mW2power, .set_rptr_shift = newcat_set_rptr_shift, .get_rptr_shift = newcat_get_rptr_shift, + .set_rptr_offs = newcat_set_rptr_offs, + .get_rptr_offs = newcat_get_rptr_offs, .set_ctcss_tone = newcat_set_ctcss_tone, .get_ctcss_tone = newcat_get_ctcss_tone, .set_ctcss_sql = newcat_set_ctcss_sql, diff --git a/rigs/yaesu/ft5000.c b/rigs/yaesu/ft5000.c index cfb13e23..7928da03 100644 --- a/rigs/yaesu/ft5000.c +++ b/rigs/yaesu/ft5000.c @@ -233,6 +233,8 @@ const struct rig_caps ftdx5000_caps = .mW2power = newcat_mW2power, .set_rptr_shift = newcat_set_rptr_shift, .get_rptr_shift = newcat_get_rptr_shift, + .set_rptr_offs = newcat_set_rptr_offs, + .get_rptr_offs = newcat_get_rptr_offs, .set_ctcss_tone = newcat_set_ctcss_tone, .get_ctcss_tone = newcat_get_ctcss_tone, .set_ctcss_sql = newcat_set_ctcss_sql, diff --git a/rigs/yaesu/ft891.c b/rigs/yaesu/ft891.c index 3a73d4fb..f33e2652 100644 --- a/rigs/yaesu/ft891.c +++ b/rigs/yaesu/ft891.c @@ -215,6 +215,8 @@ const struct rig_caps ft891_caps = .mW2power = newcat_mW2power, .set_rptr_shift = newcat_set_rptr_shift, .get_rptr_shift = newcat_get_rptr_shift, + .set_rptr_offs = newcat_set_rptr_offs, + .get_rptr_offs = newcat_get_rptr_offs, .set_ctcss_tone = newcat_set_ctcss_tone, .get_ctcss_tone = newcat_get_ctcss_tone, .set_ctcss_sql = newcat_set_ctcss_sql, diff --git a/rigs/yaesu/ft950.c b/rigs/yaesu/ft950.c index 27bba7c0..bf30d435 100644 --- a/rigs/yaesu/ft950.c +++ b/rigs/yaesu/ft950.c @@ -262,6 +262,8 @@ const struct rig_caps ft950_caps = .mW2power = newcat_mW2power, .set_rptr_shift = newcat_set_rptr_shift, .get_rptr_shift = newcat_get_rptr_shift, + .set_rptr_offs = newcat_set_rptr_offs, + .get_rptr_offs = newcat_get_rptr_offs, .set_ctcss_tone = newcat_set_ctcss_tone, .get_ctcss_tone = newcat_get_ctcss_tone, .set_ctcss_sql = newcat_set_ctcss_sql, diff --git a/rigs/yaesu/ft991.c b/rigs/yaesu/ft991.c index e643c025..60568197 100644 --- a/rigs/yaesu/ft991.c +++ b/rigs/yaesu/ft991.c @@ -207,8 +207,8 @@ const struct rig_caps ft991_caps = .mW2power = newcat_mW2power, .set_rptr_shift = newcat_set_rptr_shift, .get_rptr_shift = newcat_get_rptr_shift, - .set_rptr_offs = newcat_set_rptr_offs, /*ve9gj */ - .get_rptr_offs = newcat_get_rptr_offs, /*ve9gj */ + .set_rptr_offs = newcat_set_rptr_offs, + .get_rptr_offs = newcat_get_rptr_offs, .set_ctcss_tone = ft991_set_ctcss_tone, .get_ctcss_tone = ft991_get_ctcss_tone, .set_dcs_code = ft991_set_dcs_code, diff --git a/rigs/yaesu/ftdx101.c b/rigs/yaesu/ftdx101.c index 75b3668a..c7f517fb 100644 --- a/rigs/yaesu/ftdx101.c +++ b/rigs/yaesu/ftdx101.c @@ -229,6 +229,8 @@ const struct rig_caps ftdx101d_caps = .mW2power = newcat_mW2power, .set_rptr_shift = newcat_set_rptr_shift, .get_rptr_shift = newcat_get_rptr_shift, + .set_rptr_offs = newcat_set_rptr_offs, + .get_rptr_offs = newcat_get_rptr_offs, .set_ctcss_tone = newcat_set_ctcss_tone, .get_ctcss_tone = newcat_get_ctcss_tone, .set_ctcss_sql = newcat_set_ctcss_sql, diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 24e76019..4d8069c9 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -1492,21 +1492,91 @@ int newcat_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t offs) { struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; int err; - char command[16] ; - freq_t freq; + char command[32]; + freq_t freq = 0; rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); - if (newcat_is_rig(rig, RIG_MODEL_FT991)) + err = newcat_get_freq(rig, vfo, &freq); // Need to get freq to determine band + if (err < 0) + { + return err; + } + + if (is_ft450) { - freq = 0; - err = newcat_get_freq(rig, vfo, &freq); // Need to get freq to determine band + strcpy(command, "EX050"); + + // Step size is 100 kHz + offs /= 100000; - if (err < 0) + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%03li%c", command, offs, cat_term); + } + else if (is_ft2000) + { + if (freq >= 28000000 && freq <= 29700000) { - return err; + strcpy(command, "EX076"); + } + else if (freq >= 50000000 && freq <= 54000000) + { + strcpy(command, "EX077"); + } + else + { + // only valid on 10m and 6m bands + return -RIG_EINVAL; } + // Step size is 1 kHz + offs /= 1000; + + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%04li%c", command, offs, cat_term); + } + else if (is_ft950) + { + if (freq >= 28000000 && freq <= 29700000) + { + strcpy(command, "EX057"); + } + else if (freq >= 50000000 && freq <= 54000000) + { + strcpy(command, "EX058"); + } + else + { + // only valid on 10m and 6m bands + return -RIG_EINVAL; + } + + // Step size is 1 kHz + offs /= 1000; + + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%04li%c", command, offs, cat_term); + } + else if (is_ft891) + { + if (freq >= 28000000 && freq <= 29700000) + { + strcpy(command, "EX0904"); + } + else if (freq >= 50000000 && freq <= 54000000) + { + strcpy(command, "EX0905"); + } + else + { + // only valid on 10m and 6m bands + return -RIG_EINVAL; + } + + // Step size is 1 kHz + offs /= 1000; + + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%04li%c", command, offs, cat_term); + } + else if (is_ft991) + { if (freq >= 28000000 && freq <= 29700000) { strcpy(command, "EX080"); @@ -1526,15 +1596,104 @@ int newcat_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t offs) else { // only valid on 10m to 70cm bands - return RIG_OK; + return -RIG_EINVAL; } - snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%04li%c", command, offs, - cat_term); - return newcat_set_cmd(rig); + // Step size is 1 kHz + offs /= 1000; + + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%04li%c", command, offs, cat_term); } + else if (is_ftdx1200) + { + if (freq >= 28000000 && freq <= 29700000) + { + strcpy(command, "EX087"); + } + else if (freq >= 50000000 && freq <= 54000000) + { + strcpy(command, "EX088"); + } + else + { + // only valid on 10m and 6m bands + return -RIG_EINVAL; + } - return -RIG_ENAVAIL; + // Step size is 1 kHz + offs /= 1000; + + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%04li%c", command, offs, cat_term); + } + else if (is_ftdx3000) + { + if (freq >= 28000000 && freq <= 29700000) + { + strcpy(command, "EX086"); + } + else if (freq >= 50000000 && freq <= 54000000) + { + strcpy(command, "EX087"); + } + else + { + // only valid on 10m and 6m bands + return -RIG_EINVAL; + } + + // TODO: Confirm: Step size is 1 kHz or 10 kHz -- CAT documentation is difficult to interpret + offs /= 1000; + + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%04li%c", command, offs, cat_term); + } + else if (is_ftdx5000) + { + if (freq >= 28000000 && freq <= 29700000) + { + strcpy(command, "EX081"); + } + else if (freq >= 50000000 && freq <= 54000000) + { + strcpy(command, "EX082"); + } + else + { + // only valid on 10m and 6m bands + return -RIG_EINVAL; + } + + // TODO: Confirm: Step size is 1 kHz or 10 kHz -- CAT documentation is difficult to interpret + offs /= 1000; + + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%04li%c", command, offs, cat_term); + } + else if (is_ftdx101) + { + if (freq >= 28000000 && freq <= 29700000) + { + strcpy(command, "EX010315"); + } + else if (freq >= 50000000 && freq <= 54000000) + { + strcpy(command, "EX010316"); + } + else + { + // only valid on 10m and 6m bands + return -RIG_EINVAL; + } + + // Step size is 1 kHz + offs /= 1000; + + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%04li%c", command, offs, cat_term); + } + else + { + return -RIG_ENAVAIL; + } + + return newcat_set_cmd(rig); } @@ -1544,20 +1703,86 @@ int newcat_get_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t *offs) int err; int ret_data_len; char *retoffs; - freq_t freq; + freq_t freq = 0; + int step; rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); - if (newcat_is_rig(rig, RIG_MODEL_FT991)) + err = newcat_get_freq(rig, vfo, &freq); // Need to get freq to determine band + if (err < 0) + { + return err; + } + + if (is_ft450) { - freq = 0; - err = newcat_get_freq(rig, vfo, &freq); // Need to get freq to determine band + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "EX050%c", cat_term); - if (err < 0) + // Step size is 100 kHz + step = 100000; + } + else if (is_ft2000) + { + if (freq >= 28000000 && freq <= 29700000) { - return err; + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "EX076%c", cat_term); + } + else if (freq >= 50000000 && freq <= 54000000) + { + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "EX077%c", cat_term); + } + else + { + // only valid on 10m and 6m bands + *offs = 0; + return RIG_OK; } + // Step size is 1 kHz + step = 1000; + } + else if (is_ft950) + { + if (freq >= 28000000 && freq <= 29700000) + { + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "EX057%c", cat_term); + } + else if (freq >= 50000000 && freq <= 54000000) + { + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "EX058%c", cat_term); + } + else + { + // only valid on 10m and 6m bands + *offs = 0; + return RIG_OK; + } + + // Step size is 1 kHz + step = 1000; + } + else if (is_ft891) + { + if (freq >= 28000000 && freq <= 29700000) + { + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "EX0904%c", cat_term); + } + else if (freq >= 50000000 && freq <= 54000000) + { + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "EX0905%c", cat_term); + } + else + { + // only valid on 10m and 6m bands + *offs = 0; + return RIG_OK; + } + + // Step size is 1 kHz + step = 1000; + } + else if (is_ft991) + { if (freq >= 28000000 && freq <= 29700000) { snprintf(priv->cmd_str, sizeof(priv->cmd_str), "EX080%c", cat_term); @@ -1576,28 +1801,114 @@ int newcat_get_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t *offs) } else { - *offs = 0; // only valid on 10m to 70cm bands + // only valid on 10m to 70cm bands + *offs = 0; return RIG_OK; } - if (RIG_OK != (err = newcat_get_cmd(rig))) + // Step size is 1 kHz + step = 1000; + } + else if (is_ftdx1200) + { + if (freq >= 28000000 && freq <= 29700000) { - return err; + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "EX087%c", cat_term); + } + else if (freq >= 50000000 && freq <= 54000000) + { + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "EX088%c", cat_term); + } + else + { + // only valid on 10m and 6m bands + *offs = 0; + return RIG_OK; + } + + // Step size is 1 kHz + step = 1000; + } + else if (is_ftdx3000) + { + if (freq >= 28000000 && freq <= 29700000) + { + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "EX086%c", cat_term); + } + else if (freq >= 50000000 && freq <= 54000000) + { + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "EX087%c", cat_term); + } + else + { + // only valid on 10m and 6m bands + *offs = 0; + return RIG_OK; + } + + // TODO: Confirm: Step size is 1 kHz or 10 kHz -- CAT documentation is difficult to interpret + step = 1000; + } + else if (is_ftdx5000) + { + if (freq >= 28000000 && freq <= 29700000) + { + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "EX081%c", cat_term); + } + else if (freq >= 50000000 && freq <= 54000000) + { + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "EX082%c", cat_term); + } + else + { + // only valid on 10m and 6m bands + *offs = 0; + return RIG_OK; } - ret_data_len = strlen(priv->ret_data); + // TODO: Confirm: Step size is 1 kHz or 10 kHz -- CAT documentation is difficult to interpret + step = 1000; + } + else if (is_ftdx101) + { + if (freq >= 28000000 && freq <= 29700000) + { + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "EX010315%c", cat_term); + } + else if (freq >= 50000000 && freq <= 54000000) + { + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "EX010316%c", cat_term); + } + else + { + // only valid on 10m and 6m bands + *offs = 0; + return RIG_OK; + } - /* skip command */ - retoffs = priv->ret_data + strlen(priv->cmd_str) - 1; - /* chop term */ - priv->ret_data[ret_data_len - 1] = '\0'; - *offs = atoi(retoffs); + // Step size is 1 kHz + step = 1000; } else { return -RIG_ENAVAIL; } + err = newcat_get_cmd(rig); + if (err != RIG_OK) + { + return err; + } + + ret_data_len = strlen(priv->ret_data); + + /* skip command */ + retoffs = priv->ret_data + strlen(priv->cmd_str) - 1; + /* chop term */ + priv->ret_data[ret_data_len - 1] = '\0'; + + *offs = atoi(retoffs) * step; + return RIG_OK; } commit 051c6449e44079edcddcd8c7617d6f5a9181d755 Author: Michael Black W9MDB <mdb...@ya...> Date: Mon Nov 9 23:06:44 2020 -0600 Add FUNC_TUNE to Flex/PowerSDR (cherry picked from commit f3cb1a09aead849dcfc25ad53c0f94e1cf5267cd) diff --git a/rigs/kenwood/flex6xxx.c b/rigs/kenwood/flex6xxx.c index 73267724..65411fbf 100644 --- a/rigs/kenwood/flex6xxx.c +++ b/rigs/kenwood/flex6xxx.c @@ -39,7 +39,7 @@ #define F6K_MODES (RIG_MODE_CW|RIG_MODE_SSB|RIG_MODE_AM|RIG_MODE_FM|RIG_MODE_PKTLSB|RIG_MODE_PKTUSB) -#define F6K_FUNC_ALL (RIG_FUNC_VOX) +#define F6K_FUNC_ALL (RIG_FUNC_VOX|RIG_FUNC_TUNER) #define F6K_LEVEL_ALL (RIG_LEVEL_SLOPE_HIGH|RIG_LEVEL_SLOPE_LOW|RIG_LEVEL_KEYSPD) @@ -49,7 +49,7 @@ #define F6K_ANTS (RIG_ANT_1|RIG_ANT_2|RIG_ANT_3) /* PowerSDR differences */ -#define POWERSDR_FUNC_ALL (RIG_FUNC_VOX|RIG_FUNC_SQL|RIG_FUNC_NB|RIG_FUNC_ANF|RIG_FUNC_MUTE|RIG_FUNC_RIT|RIG_FUNC_XIT) +#define POWERSDR_FUNC_ALL (RIG_FUNC_VOX|RIG_FUNC_SQL|RIG_FUNC_NB|RIG_FUNC_ANF|RIG_FUNC_MUTE|RIG_FUNC_RIT|RIG_FUNC_XIT|RIG_FUNC_TUNER) #define POWERSDR_LEVEL_ALL (RIG_LEVEL_SLOPE_HIGH|RIG_LEVEL_SLOPE_LOW|RIG_LEVEL_KEYSPD|RIG_LEVEL_RFPOWER_METER|RIG_LEVEL_MICGAIN|RIG_LEVEL_VOXGAIN|RIG_LEVEL_SQL|RIG_LEVEL_AF|RIG_LEVEL_AGC|RIG_LEVEL_RF|RIG_LEVEL_IF) @@ -941,6 +941,10 @@ int powersdr_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) snprintf(cmd, sizeof(cmd) - 1, "ZZSO%01d", status); break; + case RIG_FUNC_TUNER: + snprintf(cmd, sizeof(cmd) - 1, "ZZTU%01d", status); + break; + default: return kenwood_set_func(rig, vfo, func, status); } @@ -1140,7 +1144,7 @@ const struct rig_caps powersdr_caps = RIG_MODEL(RIG_MODEL_POWERSDR), .model_name = "PowerSDR/Thetis", .mfg_name = "FlexRadio/ANAN", - .version = "20201016.0", + .version = "20201108.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, commit 9aabaa94e05568fa19d1b2f2fb8d7a4d0dd782de Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Nov 7 06:45:47 2020 -0600 Fix max macro in kenwood.c -- wasn't being used anyways (cherry picked from commit 9a60e32defa48603d42f79ca7c835ac2ae3ed64e) diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index 0565508d..473ff0b2 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -42,7 +42,7 @@ #include "ts990s.h" #ifndef max -#define max(a,b) (((a) (b)) ? (a) : (b)) +#define max(a,b) (((a) > (b)) ? (a) : (b)) #define min(a,b) (((a) < (b)) ? (a) : (b)) #endif commit 7ba0ddbdcc2ffc64ad7a2089ea1f4dd91306430a Author: Mikael Nousiainen <mik...@ik...> Date: Sun Nov 8 13:03:48 2020 +0200 Improve handling of the ? response for Yaesu rigs (cherry picked from commit 7b8b96555aa934c586c7e93ff6a4b9d4e03085a9) diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index e58f055a..24e76019 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -2920,7 +2920,7 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) priv->cmd_str[2] = main_sub_vfo; } - // Some Yaesu rigs reject IF shift command in AM/FM modes + // Some Yaesu rigs reject this command in AM/FM modes priv->question_mark_response_means_rejected = 1; break; @@ -2983,6 +2983,9 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) } snprintf(priv->cmd_str, sizeof(priv->cmd_str), "MG%03d%c", fpf, cat_term); + + // Some Yaesu rigs reject this command in RTTY modes + priv->question_mark_response_means_rejected = 1; break; case RIG_LEVEL_METER: @@ -3189,6 +3192,8 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) } } + // Some Yaesu rigs reject this command in AM/FM modes + priv->question_mark_response_means_rejected = 1; break; case RIG_LEVEL_COMP: @@ -3623,9 +3628,6 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) { priv->cmd_str[2] = main_sub_vfo; } - - // Some Yaesu rigs reject IF shift command in AM/FM modes - priv->question_mark_response_means_rejected = 1; break; case RIG_LEVEL_CWPITCH: @@ -3901,9 +3903,6 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) err = newcat_get_cmd(rig); - // Clear flag after executing command - priv->question_mark_response_means_rejected = 0; - if (err != RIG_OK) { return err; @@ -4413,6 +4412,8 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) priv->cmd_str[2] = main_sub_vfo; } + // Some Yaesu rigs reject this command in AM/FM modes + priv->question_mark_response_means_rejected = 1; break; case RIG_FUNC_MN: @@ -4429,6 +4430,8 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) priv->cmd_str[2] = main_sub_vfo; } + // Some Yaesu rigs reject this command in AM/FM modes + priv->question_mark_response_means_rejected = 1; break; case RIG_FUNC_FBKIN: @@ -4533,6 +4536,8 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) priv->cmd_str[2] = main_sub_vfo; } + // Some Yaesu rigs reject this command in AM/FM modes + priv->question_mark_response_means_rejected = 1; break; case RIG_FUNC_COMP: @@ -4601,7 +4606,12 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) return -RIG_EINVAL; } - return newcat_set_cmd(rig); + err = newcat_set_cmd(rig); + + // Clear flag after executing command + priv->question_mark_response_means_rejected = 0; + + return err; } @@ -8363,18 +8373,25 @@ int newcat_get_cmd(RIG *rig) break; /* retry */ case '?': - if (priv->question_mark_response_means_rejected) - { - /* Some commands, like MR and MC return "?;" when choosing a channel that doesn't exist */ - rig_debug(RIG_DEBUG_ERR, "%s: Command rejected: '%s'\n", __func__, - priv->cmd_str); - return -RIG_ERJCTED; - } - - /* Rig busy wait please */ - rig_debug(RIG_DEBUG_ERR, "%s: Rig busy\n", __func__); - rc = -RIG_BUSBUSY; - break; /* retry read only */ + /* The ? response is ambiguous and undocumented by Yaesu, but for get commands it seems to + * indicate that the rig rejected the command because the state of the rig is not valid for the command + * or that the command parameter is invalid. Retrying the command does not fix the issue, + * as the error is caused by the an invalid combination of rig state. + * + * For example, the following cases have been observed: + * - MR and MC commands are rejected when referring to an _empty_ memory channel even + * if the channel number is in a valid range + * - BC (ANF) and RL (NR) commands fail in AM/FM modes, because they are + * supported only in SSB/CW/RTTY modes + * - MG (MICGAIN) command fails in RTTY mode, as it's a digital mode + * + * There are many more cases like these and they vary by rig model. + * + * So far, "rig busy" type situations with the ? response have not been observed for get commands. + */ + rig_debug(RIG_DEBUG_ERR, "%s: Command rejected by the rig: '%s'\n", __func__, + priv->cmd_str); + return -RIG_ERJCTED; } continue; @@ -8494,10 +8511,25 @@ int newcat_set_cmd(RIG *rig) break; /* retry */ case '?': + /* The ? response is ambiguous and undocumented by Yaesu. For set commands it seems to indicate: + * 1) either that the rig is busy and the command needs to be retried + * 2) or that the rig rejected the command because the state of the rig is not valid for the command + * or that the command parameter is invalid. Retrying the command does not fix the issue + * in this case, as the error is caused by the an invalid combination of rig state. + * The latter case is consistent with behaviour of get commands. + * + * For example, the following cases have been observed: + * - MR and MC commands are rejected when referring to an _empty_ memory channel even + * if the channel number is in a valid range + * - BC (ANF) and RL (NR) commands fail in AM/FM modes, because they are + * supported only in SSB/CW/RTTY modes + * - MG (MICGAIN) command fails in RTTY mode, as it's a digital mode + * + * There are many more cases like these and they vary by rig model. + */ if (priv->question_mark_response_means_rejected) { - /* Some commands, like MR and MC return "?;" when choosing a channel that doesn't exist */ - rig_debug(RIG_DEBUG_ERR, "%s: Command rejected: '%s'\n", __func__, + rig_debug(RIG_DEBUG_ERR, "%s: Command rejected by the rig: '%s'\n", __func__, priv->cmd_str); return -RIG_ERJCTED; } commit 8fda0436a1a19863060bd1117bbffa61ed815443 Author: Mikael Nousiainen <mik...@ik...> Date: Sun Nov 8 00:15:48 2020 +0200 Allow AMN mode on FTDX 5000 and FTDX 3000 -- the rig seems to return it regardless of documentation (cherry picked from commit 8f3d5b5a850488b8aeed8deac9fe3dcc955bd022) diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index c630173f..e58f055a 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -6573,6 +6573,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) break; case RIG_MODE_AM: + case RIG_MODE_AMN: case RIG_MODE_FM: case RIG_MODE_PKTFM: case RIG_MODE_FMN: @@ -6591,8 +6592,10 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) switch (mode) { case RIG_MODE_AM: + case RIG_MODE_AMN: case RIG_MODE_FM: case RIG_MODE_PKTFM: + case RIG_MODE_FMN: if (width < rig_passband_normal(rig, mode)) { err = newcat_set_narrow(rig, vfo, TRUE); @@ -6602,9 +6605,6 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) err = newcat_set_narrow(rig, vfo, FALSE); } return err; - - case RIG_MODE_FMN: - return RIG_OK; } } // end is_ftdx1200 and is_ftdx3000 else if (is_ftdx5000) @@ -6680,6 +6680,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) break; case RIG_MODE_AM: + case RIG_MODE_AMN: case RIG_MODE_FM: case RIG_MODE_PKTFM: case RIG_MODE_FMN: @@ -6698,8 +6699,10 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) switch (mode) { case RIG_MODE_AM: + case RIG_MODE_AMN: case RIG_MODE_FM: case RIG_MODE_PKTFM: + case RIG_MODE_FMN: if (width < rig_passband_normal(rig, mode)) { err = newcat_set_narrow(rig, vfo, TRUE); @@ -6709,9 +6712,6 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) err = newcat_set_narrow(rig, vfo, FALSE); } return err; - - case RIG_MODE_FMN: - return RIG_OK; } } // end is_ftdx5000 else if (is_ftdx101) @@ -7661,6 +7661,10 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) *width = 9000; break; + case RIG_MODE_AMN: + *width = 6000; + break; + default: return -RIG_EINVAL; } /* end switch(mode) */ @@ -7801,6 +7805,10 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) *width = 9000; break; + case RIG_MODE_AMN: + *width = 6000; + break; + default: return -RIG_EINVAL; } /* end switch(mode) */ commit d9bd8dd38c2a5d2acc2e5969adaba0b80e5c6083 Author: Mikael Nousiainen <mik...@ik...> Date: Sun Nov 8 00:09:41 2020 +0200 Combine filters on AM/AMN and FM/FMN modes as the narrow setting changes the mode too (cherry picked from commit c10606ed4f79322fb1253ff2d6685ec96269864d) diff --git a/rigs/yaesu/ft3000.c b/rigs/yaesu/ft3000.c index 6172bd2b..32f24550 100644 --- a/rigs/yaesu/ft3000.c +++ b/rigs/yaesu/ft3000.c @@ -185,14 +185,13 @@ const struct rig_caps ftdx3000_caps = {FTDX5000_CW_RTTY_PKT_RX_MODES, Hz(1800)}, /* Normal CW, RTTY, PKT/USER */ {FTDX5000_CW_RTTY_PKT_RX_MODES, Hz(500)}, /* Narrow CW, RTTY, PKT/USER */ {FTDX5000_CW_RTTY_PKT_RX_MODES, Hz(2400)}, /* Wide CW, RTTY, PKT/USER */ - {RIG_MODE_SSB, Hz(2400)}, /* Normal SSB */ - {RIG_MODE_SSB, Hz(1800)}, /* Narrow SSB */ - {RIG_MODE_SSB, Hz(4000)}, /* Wide SSB */ - {RIG_MODE_AM, Hz(9000)}, /* Normal AM */ - {RIG_MODE_AM, Hz(6000)}, /* Narrow AM */ - {FTDX5000_FM_WIDE_RX_MODES, Hz(16000)}, /* Normal FM */ - {FTDX5000_FM_WIDE_RX_MODES, Hz(9000)}, /* Narrow FM */ - {RIG_MODE_FMN, Hz(9000)}, /* Narrow FM */ + {RIG_MODE_SSB, Hz(2400)}, /* Normal SSB */ + {RIG_MODE_SSB, Hz(1800)}, /* Narrow SSB */ + {RIG_MODE_SSB, Hz(4000)}, /* Wide SSB */ + {FTDX5000_AM_RX_MODES, Hz(9000)}, /* Normal AM */ + {FTDX5000_AM_RX_MODES, Hz(6000)}, /* Narrow AM */ + {FTDX5000_FM_RX_MODES, Hz(16000)}, /* Normal FM */ + {FTDX5000_FM_RX_MODES, Hz(9000)}, /* Narrow FM */ {FTDX5000_CW_RTTY_PKT_RX_MODES | RIG_MODE_SSB, RIG_FLT_ANY}, RIG_FLT_END, diff --git a/rigs/yaesu/ft5000.c b/rigs/yaesu/ft5000.c index ca94e384..cfb13e23 100644 --- a/rigs/yaesu/ft5000.c +++ b/rigs/yaesu/ft5000.c @@ -183,11 +183,10 @@ const struct rig_caps ftdx5000_caps = {RIG_MODE_SSB, Hz(2400)}, /* Normal SSB */ {RIG_MODE_SSB, Hz(1800)}, /* Narrow SSB */ {RIG_MODE_SSB, Hz(4000)}, /* Wide SSB */ - {RIG_MODE_AM, Hz(9000)}, /* Normal AM */ - {RIG_MODE_AM, Hz(6000)}, /* Narrow AM */ - {FTDX5000_FM_WIDE_RX_MODES, Hz(16000)}, /* Normal FM */ - {FTDX5000_FM_WIDE_RX_MODES, Hz(9000)}, /* Narrow FM */ - {RIG_MODE_FMN, Hz(9000)}, /* Narrow FM */ + {FTDX5000_AM_RX_MODES, Hz(9000)}, /* Normal AM */ + {FTDX5000_AM_RX_MODES, Hz(6000)}, /* Narrow AM */ + {FTDX5000_FM_RX_MODES, Hz(16000)}, /* Normal FM */ + {FTDX5000_FM_RX_MODES, Hz(9000)}, /* Narrow FM */ {FTDX5000_CW_RTTY_PKT_RX_MODES | RIG_MODE_SSB, RIG_FLT_ANY}, RIG_FLT_END, diff --git a/rigs/yaesu/ft5000.h b/rigs/yaesu/ft5000.h index 5dc021b1..7b045376 100644 --- a/rigs/yaesu/ft5000.h +++ b/rigs/yaesu/ft5000.h @@ -32,15 +32,14 @@ /* Receiver caps */ -#define FTDX5000_ALL_RX_MODES (RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|\ +#define FTDX5000_ALL_RX_MODES (RIG_MODE_AM|RIG_MODE_AMN|RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|\ RIG_MODE_RTTY|RIG_MODE_RTTYR|RIG_MODE_PKTLSB|RIG_MODE_PKTUSB|RIG_MODE_PKTFM|\ RIG_MODE_FM|RIG_MODE_FMN) #define FTDX5000_SSB_CW_RX_MODES (RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|\ RIG_MODE_RTTY|RIG_MODE_RTTYR|RIG_MODE_PKTLSB|RIG_MODE_PKTUSB) -#define FTDX5000_AM_RX_MODES (RIG_MODE_AM) -#define FTDX5000_FM_WIDE_RX_MODES (RIG_MODE_FM|RIG_MODE_PKTFM) -#define FTDX5000_FM_RX_MODES (FTDX5000_FM_WIDE_RX_MODES|RIG_MODE_FMN) +#define FTDX5000_AM_RX_MODES (RIG_MODE_AM|RIG_MODE_AMN) +#define FTDX5000_FM_RX_MODES (RIG_MODE_FM|RIG_MODE_PKTFM|RIG_MODE_FMN) #define FTDX5000_CW_RTTY_PKT_RX_MODES (RIG_MODE_RTTY|RIG_MODE_RTTYR|\ RIG_MODE_PKTUSB|RIG_MODE_PKTLSB|RIG_MODE_CW|RIG_MODE_CWR) @@ -48,7 +47,7 @@ #define FTDX5000_OTHER_TX_MODES (RIG_MODE_CW|RIG_MODE_SSB|RIG_MODE_RTTY| \ RIG_MODE_PKTLSB|RIG_MODE_PKTUSB|RIG_MODE_FM|RIG_MODE_PKTFM|RIG_MODE_FMN) /* 100 W class */ -#define FTDX5000_AM_TX_MODES (RIG_MODE_AM) /* set 25W max */ +#define FTDX5000_AM_TX_MODES (RIG_MODE_AM|RIG_MODE_AMN) /* set 25W max */ /* TBC */ #define FTDX5000_LEVELS (RIG_LEVEL_ATT|RIG_LEVEL_PREAMP|\ commit 68151ba30b24e12b3a2c672daf364068ff9264f2 Author: Mikael Nousiainen <mik...@ik...> Date: Sat Nov 7 23:46:09 2020 +0200 Fix roofing filter selection bug. Get mode for RX bandwidth from function argument. (cherry picked from commit fdbc66b434a38a542cf8220c43dd1b3d1dddb846) diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 4e0c2eb5..c630173f 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -6941,7 +6941,7 @@ static int set_roofing_filter(RIG *rig, vfo_t vfo, int index) static int set_roofing_filter_for_width(RIG *rig, vfo_t vfo, int width) { struct newcat_priv_caps *priv_caps = (struct newcat_priv_caps *)rig->caps->priv; - int index = -1; + int index = 0; int i; rig_debug(RIG_DEBUG_TRACE, "%s: called\n", __func__); @@ -6971,11 +6971,6 @@ static int set_roofing_filter_for_width(RIG *rig, vfo_t vfo, int width) index = current_filter->index; } - if (index < 0) - { - return -RIG_EINVAL; - } - return set_roofing_filter(rig, vfo, index); } @@ -7069,7 +7064,7 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) if (is_ft950 || is_ftdx5000) { // Some Yaesu rigs cannot query SH in modes such as AM/FM - switch (rig->state.current_mode) + switch (mode) { case RIG_MODE_FM: case RIG_MODE_FMN: commit f1361a8937038b9e8fb6cd079e3a1facf41073ea Author: Mikael Nousiainen <mik...@ik...> Date: Sat Nov 7 23:30:34 2020 +0200 Do not query filter width using SH command with FTDX 5000 in AM/FM modes (cherry picked from commit d114a5e2d669dd8a6f4c2aebc961b585c45a5a3a) diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 7755bcf5..4e0c2eb5 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -7047,6 +7047,7 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; int err; int w; + int sh_command_valid = 1; char narrow = '!'; char cmd[] = "SH"; char main_sub_vfo = '0'; @@ -7065,19 +7066,20 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) return err; } - if (is_ft950) + if (is_ft950 || is_ftdx5000) { - // can't query SH in some modes + // Some Yaesu rigs cannot query SH in modes such as AM/FM switch (rig->state.current_mode) { - case RIG_MODE_FM: *width = 16000; break; - - case RIG_MODE_AM: *width = 9000; break; - - case RIG_MODE_AMN: *width = 6000; break; + case RIG_MODE_FM: + case RIG_MODE_FMN: + case RIG_MODE_PKTFM: + case RIG_MODE_AM: + case RIG_MODE_AMN: + case RIG_MODE_PKTAM: + sh_command_valid = 0; + break; } - - return RIG_OK; } if (rig->caps->targetable_vfo & RIG_TARGETABLE_MODE) @@ -7085,45 +7087,53 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) main_sub_vfo = (RIG_VFO_B == vfo || RIG_VFO_SUB == vfo) ? '1' : '0'; } - snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%c%c", cmd, main_sub_vfo, - cat_term); - - /* Get RX BANDWIDTH */ - if (RIG_OK != (err = newcat_get_cmd(rig))) + if (sh_command_valid) { - return err; - } + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%c%c", cmd, main_sub_vfo, + cat_term); - if (strlen(priv->ret_data) == 7) - { - if (sscanf(priv->ret_data, "SH%*1d0%3d", &w) != 1) + err = newcat_get_cmd(rig); + if (err != RIG_OK) { - err = -RIG_EPROTO; + return err; } - } - else if (strlen(priv->ret_data) == 6) - { - if (sscanf(priv->ret_data, "SH%*1d%3d", &w) != 1) + + if (strlen(priv->ret_data) == 7) + { + if (sscanf(priv->ret_data, "SH%*1d0%3d", &w) != 1) + { + err = -RIG_EPROTO; + } + } + else if (strlen(priv->ret_data) == 6) { - err = -RIG_EPROTO; + if (sscanf(priv->ret_data, "SH%*1d%3d", &w) != 1) + { + err = -RIG_EPROTO; + } } + else + { + rig_debug(RIG_DEBUG_ERR, "%s: unknown SH response='%s'\n", __func__, + priv->ret_data); + return -RIG_EPROTO; + } + + if (err != RIG_OK) + { + rig_debug(RIG_DEBUG_ERR, "%s: unable to parse width from '%s'\n", __func__, + priv->ret_data); + return -RIG_EPROTO; + } + + rig_debug(RIG_DEBUG_TRACE, "%s: w=%d\n", __func__, w); } else { - rig_debug(RIG_DEBUG_ERR, "%s: unknown SH response='%s'\n", __func__, - priv->ret_data); - return -RIG_EPROTO; - } - - if (err != RIG_OK) - { - rig_debug(RIG_DEBUG_ERR, "%s: unable to parse width from '%s'\n", __func__, - priv->ret_data); - return -RIG_EPROTO; + // Some Yaesu rigs cannot query filter width using SH command in modes such as AM/FM + w = 0; } - rig_debug(RIG_DEBUG_TRACE, "%s: w=%d\n", __func__, w); - if (is_ft950) { if ((narrow = get_narrow(rig, RIG_VFO_MAIN)) < 0) commit 10d142883238ebb6a1b5d011d5f873ca5a44e9cc Author: Mikael Nousiainen <mik...@ik...> Date: Sat Nov 7 22:58:09 2020 +0200 Add RIG_FLT_ANY for FT-991 and FT-891 (cherry picked from commit b9815a41656d95649cda4d7df773f8a2d9983692) diff --git a/rigs/yaesu/ft891.c b/rigs/yaesu/ft891.c index 5c5eaaaa..3a73d4fb 100644 --- a/rigs/yaesu/ft891.c +++ b/rigs/yaesu/ft891.c @@ -172,6 +172,7 @@ const struct rig_caps ft891_caps = {RIG_MODE_SSB, Hz(600)}, /* SSB */ {RIG_MODE_SSB, Hz(400)}, /* SSB */ {RIG_MODE_SSB, Hz(200)}, /* SSB */ + {FT891_CW_RTTY_PKT_RX_MODES | RIG_MODE_SSB, RIG_FLT_ANY }, {RIG_MODE_AM, Hz(9000)}, /* Normal AM */ {RIG_MODE_AM, Hz(6000)}, /* Narrow AM */ {FT891_FM_RX_MODES, Hz(16000)}, /* Normal FM */ diff --git a/rigs/yaesu/ft991.c b/rigs/yaesu/ft991.c index 7f2a1858..e643c025 100644 --- a/rigs/yaesu/ft991.c +++ b/rigs/yaesu/ft991.c @@ -163,6 +163,7 @@ const struct rig_caps ft991_caps = {RIG_MODE_SSB, Hz(600)}, /* SSB */ {RIG_MODE_SSB, Hz(400)}, /* SSB */ {RIG_MODE_SSB, Hz(200)}, /* SSB */ + {FT991_CW_RTTY_PKT_RX_MODES | RIG_MODE_SSB, RIG_FLT_ANY }, {RIG_MODE_AM, Hz(9000)}, /* Normal AM */ {RIG_MODE_AMN, Hz(6000)}, /* Narrow AM */ {FT991_FM_WIDE_RX_MODES, Hz(16000)}, /* Normal FM */ commit d9c7a3cb1cd045d7bc6fb72952fc4fd2aff127cc Author: Mikael Nousiainen <mik...@ik...> Date: Sat Nov 7 19:47:08 2020 +0200 Handle Yaesu rigs rejecting IF shift command without retries (cherry picked from commit 88cec8450cff870e981f53f632f3acf6839f2f1a) diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 2bfc827c..7755bcf5 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -2920,6 +2920,8 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) priv->cmd_str[2] = main_sub_vfo; } + // Some Yaesu rigs reject IF shift command in AM/FM modes + priv->question_mark_response_means_rejected = 1; break; case RIG_LEVEL_CWPITCH: { @@ -3526,7 +3528,12 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) return -RIG_EINVAL; } - return newcat_set_cmd(rig); + err = newcat_set_cmd(rig); + + // Clear flag after executing command + priv->question_mark_response_means_rejected = 0; + + return err; } @@ -3616,6 +3623,9 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) { priv->cmd_str[2] = main_sub_vfo; } + + // Some Yaesu rigs reject IF shift command in AM/FM modes + priv->question_mark_response_means_rejected = 1; break; case RIG_LEVEL_CWPITCH: @@ -3889,7 +3899,12 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) return -RIG_EINVAL; } - if (RIG_OK != (err = newcat_get_cmd(rig))) + err = newcat_get_cmd(rig); + + // Clear flag after executing command + priv->question_mark_response_means_rejected = 0; + + if (err != RIG_OK) { return err; } commit 21546623f343b46c9452207073c3dd34f9429cb6 Author: Mikael Nousiainen <mik...@ik...> Date: Sat Nov 7 15:03:54 2020 +0200 Add routines to convert between morse code dot duration and milliseconds. Implement Yaesu break-in delay level correctly using these conversion routines. (cherry picked from commit 7cbe39d5ab130eb38542332515a4573677e5ed10) diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 1e1ee9b9..2bfc827c 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -3208,96 +3208,94 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) snprintf(priv->cmd_str, sizeof(priv->cmd_str), "PL%03d%c", fpf, cat_term); break; - case RIG_LEVEL_BKINDL: + case RIG_LEVEL_BKINDL: { + int millis; + value_t keyspd; - /* Standard: word "PARIS" == 50 Unit Intervals, UIs */ - /* 1 dot == 2 UIs */ - /* tenth_dots-per-second -to- milliseconds */ if (!newcat_valid_command(rig, "SD")) { return -RIG_ENAVAIL; } - // we don't get full resolution as long as val->i is in integer tenths - // consider changing this to float or to milliseconds - val.i *= 100; // tenths to ms conversion - - if (is_ftdx101) + // Convert 10/ths of dots to milliseconds using the current key speed + err = newcat_get_level(rig, vfo, RIG_LEVEL_KEYSPD, &keyspd); + if (err != RIG_OK) { - if (val.i <= 30) { snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SD00;"); } - - else if (val.i <= 50) { snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SD01;"); } - - else if (val.i <= 100) { snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SD02;"); } - - else if (val.i <= 150) { snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SD03;"); } - - else if (val.i <= 200) { snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SD04;"); } + return err; + } - else if (val.i <= 250) { snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SD05;"); } + millis = dot10ths_to_millis(val.i, keyspd.i); - else if (val.i > 2900) { snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SD33;"); } - // this covers 300-2900 06-32 - else { snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SD%02d;", 6 + ((val.i - 300) / 100)); } + if (is_ftdx101) + { + if (millis <= 30) { snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SD00;"); } + else if (millis <= 50) { snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SD01;"); } + else if (millis <= 100) { snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SD02;"); } + else if (millis <= 150) { snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SD03;"); } + else if (millis <= 200) { snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SD04;"); } + else if (millis <= 250) { snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SD05;"); } + else if (millis > 2900) { snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SD33;"); } + else + { + // This covers 300-2900 06-32 + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SD%02d;", 6 + ((millis - 300) / 100)); + } } else if (is_ftdx5000) { - if (val.i < 20) + if (millis < 20) { - val.i = 20; + millis = 20; } - - if (val.i > 5000) + if (millis > 5000) { - val.i = 5000; + millis = 5000; } - snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SD%04d%c", val.i, cat_term); + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SD%04d%c", millis, cat_term); } else if (is_ft950 || is_ft450 || is_ft891 || is_ft991 || is_ftdx1200 || is_ftdx3000) { - if (val.i < 30) + if (millis < 30) { - val.i = 30; + millis = 30; } - - if (val.i > 3000) + if (millis > 3000) { - val.i = 3000; + millis = 3000; } - snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SD%04d%c", val.... [truncated message content] |