From bbeb87eb0572067c2a9bf14848070d82a60fc4a0 Mon Sep 17 00:00:00 2001 From: Mike Black W9MDB Date: Fri, 21 Oct 2022 22:27:58 -0500 Subject: [PATCH] Add newcat_scan for Yaesu rigs --- rigs/yaesu/ft1200.c | 2 ++ rigs/yaesu/ft2000.c | 2 ++ rigs/yaesu/ft3000.c | 2 ++ rigs/yaesu/ft450.c | 2 ++ rigs/yaesu/ft5000.c | 2 ++ rigs/yaesu/ft710.c | 2 ++ rigs/yaesu/ft891.c | 2 ++ rigs/yaesu/ft9000.c | 2 ++ rigs/yaesu/ft950.c | 2 ++ rigs/yaesu/ft991.c | 5 ++++- rigs/yaesu/ftdx10.c | 2 ++ rigs/yaesu/ftdx101.c | 2 ++ rigs/yaesu/ftdx101mp.c | 2 ++ rigs/yaesu/newcat.c | 16 +++++++++++++--- rigs/yaesu/newcat.h | 4 ++-- 15 files changed, 43 insertions(+), 6 deletions(-) diff --git a/rigs/yaesu/ft1200.c b/rigs/yaesu/ft1200.c index 9ba50b220..888823972 100644 --- a/rigs/yaesu/ft1200.c +++ b/rigs/yaesu/ft1200.c @@ -190,6 +190,7 @@ const struct rig_caps ftdx1200_caps = .agc_level_count = 5, .agc_levels = { RIG_AGC_OFF, RIG_AGC_FAST, RIG_AGC_MEDIUM, RIG_AGC_SLOW, RIG_AGC_AUTO }, .vfo_ops = FTDX1200_VFO_OPS, + .scan_ops = RIG_SCAN_VFO, .targetable_vfo = RIG_TARGETABLE_FREQ, .transceive = RIG_TRN_OFF, /* May enable later as the 1200 has an Auto Info command */ .bank_qty = 0, @@ -323,5 +324,6 @@ const struct rig_caps ftdx1200_caps = .wait_morse = rig_wait_morse, .set_clock = newcat_set_clock, .get_clock = newcat_get_clock, + .scan = newcat_scan, .hamlib_check_rig_caps = HAMLIB_CHECK_RIG_CAPS }; diff --git a/rigs/yaesu/ft2000.c b/rigs/yaesu/ft2000.c index 268586b51..c73a254ec 100644 --- a/rigs/yaesu/ft2000.c +++ b/rigs/yaesu/ft2000.c @@ -172,6 +172,7 @@ const struct rig_caps ft2000_caps = .max_xit = Hz(9999), .max_ifshift = Hz(1000), .vfo_ops = FT2000_VFO_OPS, + .scan_ops = RIG_SCAN_VFO, .targetable_vfo = RIG_TARGETABLE_FREQ | RIG_TARGETABLE_MODE, .transceive = RIG_TRN_OFF, /* May enable later as the 2000 has an Auto Info command */ .bank_qty = 0, @@ -308,5 +309,6 @@ const struct rig_caps ft2000_caps = .get_ext_level = newcat_get_ext_level, .send_morse = newcat_send_morse, .wait_morse = rig_wait_morse, + .scan = newcat_scan, .hamlib_check_rig_caps = HAMLIB_CHECK_RIG_CAPS }; diff --git a/rigs/yaesu/ft3000.c b/rigs/yaesu/ft3000.c index 887001674..34ce12560 100644 --- a/rigs/yaesu/ft3000.c +++ b/rigs/yaesu/ft3000.c @@ -285,6 +285,7 @@ const struct rig_caps ftdx3000_caps = .agc_level_count = 5, .agc_levels = { RIG_AGC_OFF, RIG_AGC_FAST, RIG_AGC_MEDIUM, RIG_AGC_SLOW, RIG_AGC_AUTO }, .vfo_ops = FTDX5000_VFO_OPS, + .scan_ops = RIG_SCAN_VFO, .targetable_vfo = RIG_TARGETABLE_FREQ, /* one of the few diffs from the 5000 */ .transceive = RIG_TRN_OFF, /* May enable later as the 5000 has an Auto Info command */ .bank_qty = 0, @@ -414,6 +415,7 @@ const struct rig_caps ftdx3000_caps = .get_ext_level = newcat_get_ext_level, .send_morse = newcat_send_morse, .wait_morse = rig_wait_morse, + .scan = newcat_scan, .hamlib_check_rig_caps = HAMLIB_CHECK_RIG_CAPS }; diff --git a/rigs/yaesu/ft450.c b/rigs/yaesu/ft450.c index f157b24ff..021d123d4 100644 --- a/rigs/yaesu/ft450.c +++ b/rigs/yaesu/ft450.c @@ -82,6 +82,7 @@ const struct rig_caps ft450_caps = .agc_level_count = 4, .agc_levels = { RIG_AGC_OFF, RIG_AGC_FAST, RIG_AGC_SLOW, RIG_AGC_AUTO }, .vfo_ops = FT450_VFO_OPS, + .scan_ops = RIG_SCAN_VFO, .targetable_vfo = RIG_TARGETABLE_FREQ, .transceive = RIG_TRN_OFF, /* May enable later as the 450 has an Auto Info command */ .bank_qty = 0, @@ -203,6 +204,7 @@ const struct rig_caps ft450_caps = .get_channel = newcat_get_channel, .send_morse = newcat_send_morse, .wait_morse = rig_wait_morse, + .scan = newcat_scan, .hamlib_check_rig_caps = HAMLIB_CHECK_RIG_CAPS }; diff --git a/rigs/yaesu/ft5000.c b/rigs/yaesu/ft5000.c index aaa42e35a..150f32adf 100644 --- a/rigs/yaesu/ft5000.c +++ b/rigs/yaesu/ft5000.c @@ -180,6 +180,7 @@ const struct rig_caps ftdx5000_caps = .agc_level_count = 5, .agc_levels = { RIG_AGC_OFF, RIG_AGC_FAST, RIG_AGC_MEDIUM, RIG_AGC_SLOW, RIG_AGC_AUTO }, .vfo_ops = FTDX5000_VFO_OPS, + .scan_ops = RIG_SCAN_VFO, .targetable_vfo = RIG_TARGETABLE_FREQ | RIG_TARGETABLE_MODE | RIG_TARGETABLE_FUNC | RIG_TARGETABLE_LEVEL | RIG_TARGETABLE_ANT | RIG_TARGETABLE_ROOFING, .transceive = RIG_TRN_OFF, /* May enable later as the 5000 has an Auto Info command */ .bank_qty = 0, @@ -310,5 +311,6 @@ const struct rig_caps ftdx5000_caps = .get_ext_level = newcat_get_ext_level, .send_morse = newcat_send_morse, .wait_morse = rig_wait_morse, + .scan = newcat_scan, .hamlib_check_rig_caps = HAMLIB_CHECK_RIG_CAPS }; diff --git a/rigs/yaesu/ft710.c b/rigs/yaesu/ft710.c index 54ddfb1ee..a643cccd8 100644 --- a/rigs/yaesu/ft710.c +++ b/rigs/yaesu/ft710.c @@ -176,6 +176,7 @@ const struct rig_caps ft710_caps = .agc_level_count = 5, .agc_levels = { RIG_AGC_OFF, RIG_AGC_FAST, RIG_AGC_MEDIUM, RIG_AGC_SLOW, RIG_AGC_AUTO }, .vfo_ops = FTDX10_VFO_OPS, + .scan_ops = RIG_SCAN_VFO, .targetable_vfo = RIG_TARGETABLE_FREQ | RIG_TARGETABLE_FUNC | RIG_TARGETABLE_LEVEL | RIG_TARGETABLE_COMMON, .transceive = RIG_TRN_OFF, /* May enable later as the FTDX10 has an Auto Info command */ .bank_qty = 0, @@ -311,5 +312,6 @@ const struct rig_caps ft710_caps = .wait_morse = rig_wait_morse, .set_clock = newcat_set_clock, .get_clock = newcat_get_clock, + .scan = newcat_scan, .hamlib_check_rig_caps = HAMLIB_CHECK_RIG_CAPS }; diff --git a/rigs/yaesu/ft891.c b/rigs/yaesu/ft891.c index b82470801..2c244c653 100644 --- a/rigs/yaesu/ft891.c +++ b/rigs/yaesu/ft891.c @@ -173,6 +173,7 @@ const struct rig_caps ft891_caps = .agc_level_count = 5, .agc_levels = { RIG_AGC_OFF, RIG_AGC_FAST, RIG_AGC_MEDIUM, RIG_AGC_SLOW, RIG_AGC_AUTO }, .vfo_ops = FT891_VFO_OPS, + .scan_ops = RIG_SCAN_VFO, .targetable_vfo = RIG_TARGETABLE_FREQ, .transceive = RIG_TRN_OFF, /* May enable later as the 950 has an Auto Info command */ .bank_qty = 0, @@ -323,6 +324,7 @@ const struct rig_caps ft891_caps = .wait_morse = rig_wait_morse, .set_clock = newcat_set_clock, .get_clock = newcat_get_clock, + .scan = newcat_scan, .hamlib_check_rig_caps = HAMLIB_CHECK_RIG_CAPS }; diff --git a/rigs/yaesu/ft9000.c b/rigs/yaesu/ft9000.c index 43fe7f4d7..39305e226 100644 --- a/rigs/yaesu/ft9000.c +++ b/rigs/yaesu/ft9000.c @@ -89,6 +89,7 @@ const struct rig_caps ft9000_caps = .agc_level_count = 5, .agc_levels = { RIG_AGC_OFF, RIG_AGC_FAST, RIG_AGC_MEDIUM, RIG_AGC_SLOW, RIG_AGC_AUTO }, .vfo_ops = FT9000_VFO_OPS, + .scan_ops = RIG_SCAN_VFO, .targetable_vfo = RIG_TARGETABLE_FREQ | RIG_TARGETABLE_MODE | RIG_TARGETABLE_ANT, .transceive = RIG_TRN_OFF, /* May enable later as the 9000 has an Auto Info command */ .bank_qty = 0, @@ -213,5 +214,6 @@ const struct rig_caps ft9000_caps = .get_channel = newcat_get_channel, .send_morse = newcat_send_morse, .wait_morse = rig_wait_morse, + .scan = newcat_scan, .hamlib_check_rig_caps = HAMLIB_CHECK_RIG_CAPS }; diff --git a/rigs/yaesu/ft950.c b/rigs/yaesu/ft950.c index b9b46ea05..c3e682a96 100644 --- a/rigs/yaesu/ft950.c +++ b/rigs/yaesu/ft950.c @@ -127,6 +127,7 @@ const struct rig_caps ft950_caps = .agc_level_count = 5, .agc_levels = { RIG_AGC_OFF, RIG_AGC_FAST, RIG_AGC_MEDIUM, RIG_AGC_SLOW, RIG_AGC_AUTO }, .vfo_ops = FT950_VFO_OPS, + .scan_ops = RIG_SCAN_VFO, .targetable_vfo = RIG_TARGETABLE_FREQ, .transceive = RIG_TRN_OFF, /* May enable later as the 950 has an Auto Info command */ .bank_qty = 0, @@ -285,5 +286,6 @@ const struct rig_caps ft950_caps = .get_ext_level = newcat_get_ext_level, .send_morse = newcat_send_morse, .wait_morse = rig_wait_morse, + .scan = newcat_scan, .hamlib_check_rig_caps = HAMLIB_CHECK_RIG_CAPS }; diff --git a/rigs/yaesu/ft991.c b/rigs/yaesu/ft991.c index 52765118e..d2af1e20f 100644 --- a/rigs/yaesu/ft991.c +++ b/rigs/yaesu/ft991.c @@ -141,7 +141,7 @@ const struct rig_caps ft991_caps = RIG_MODEL(RIG_MODEL_FT991), .model_name = "FT-991", .mfg_name = "Yaesu", - .version = NEWCAT_VER ".12", + .version = NEWCAT_VER ".13", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -181,6 +181,7 @@ const struct rig_caps ft991_caps = .agc_level_count = 5, .agc_levels = { RIG_AGC_OFF, RIG_AGC_FAST, RIG_AGC_MEDIUM, RIG_AGC_SLOW, RIG_AGC_AUTO }, .vfo_ops = FT991_VFO_OPS, + .scan_ops = RIG_SCAN_VFO, .targetable_vfo = RIG_TARGETABLE_FREQ, .transceive = RIG_TRN_OFF, /* May enable later as the 950 has an Auto Info command */ .bank_qty = 0, @@ -354,9 +355,11 @@ const struct rig_caps ft991_caps = .get_ext_level = newcat_get_ext_level, .send_morse = newcat_send_morse, .wait_morse = rig_wait_morse, + .scan = newcat_scan, .send_voice_mem = newcat_send_voice_mem, .set_clock = newcat_set_clock, .get_clock = newcat_get_clock, + .scan = newcat_scan, .hamlib_check_rig_caps = HAMLIB_CHECK_RIG_CAPS }; diff --git a/rigs/yaesu/ftdx10.c b/rigs/yaesu/ftdx10.c index 3ef3876d3..58d1be65e 100644 --- a/rigs/yaesu/ftdx10.c +++ b/rigs/yaesu/ftdx10.c @@ -176,6 +176,7 @@ const struct rig_caps ftdx10_caps = .agc_level_count = 5, .agc_levels = { RIG_AGC_OFF, RIG_AGC_FAST, RIG_AGC_MEDIUM, RIG_AGC_SLOW, RIG_AGC_AUTO }, .vfo_ops = FTDX10_VFO_OPS, + .scan_ops = RIG_SCAN_VFO, .targetable_vfo = RIG_TARGETABLE_FREQ | RIG_TARGETABLE_MODE | RIG_TARGETABLE_FUNC | RIG_TARGETABLE_LEVEL | RIG_TARGETABLE_COMMON, .transceive = RIG_TRN_OFF, /* May enable later as the FTDX10 has an Auto Info command */ .bank_qty = 0, @@ -311,5 +312,6 @@ const struct rig_caps ftdx10_caps = .wait_morse = rig_wait_morse, .set_clock = newcat_set_clock, .get_clock = newcat_get_clock, + .scan = newcat_scan, .hamlib_check_rig_caps = HAMLIB_CHECK_RIG_CAPS }; diff --git a/rigs/yaesu/ftdx101.c b/rigs/yaesu/ftdx101.c index 76b97e7ca..d7aeec2fd 100644 --- a/rigs/yaesu/ftdx101.c +++ b/rigs/yaesu/ftdx101.c @@ -176,6 +176,7 @@ const struct rig_caps ftdx101d_caps = .agc_level_count = 5, .agc_levels = { RIG_AGC_OFF, RIG_AGC_FAST, RIG_AGC_MEDIUM, RIG_AGC_SLOW, RIG_AGC_AUTO }, .vfo_ops = FTDX101_VFO_OPS, + .scan_ops = RIG_SCAN_VFO, .targetable_vfo = RIG_TARGETABLE_FREQ | RIG_TARGETABLE_MODE | RIG_TARGETABLE_FUNC | RIG_TARGETABLE_LEVEL | RIG_TARGETABLE_COMMON | RIG_TARGETABLE_ANT | RIG_TARGETABLE_ROOFING, .transceive = RIG_TRN_OFF, /* May enable later as the FTDX101 has an Auto Info command */ .bank_qty = 0, @@ -312,6 +313,7 @@ const struct rig_caps ftdx101d_caps = .wait_morse = rig_wait_morse, .set_clock = newcat_set_clock, .get_clock = newcat_get_clock, + .scan = newcat_scan, .hamlib_check_rig_caps = HAMLIB_CHECK_RIG_CAPS }; diff --git a/rigs/yaesu/ftdx101mp.c b/rigs/yaesu/ftdx101mp.c index 349bda879..1f6351813 100644 --- a/rigs/yaesu/ftdx101mp.c +++ b/rigs/yaesu/ftdx101mp.c @@ -112,6 +112,7 @@ const struct rig_caps ftdx101mp_caps = .max_xit = Hz(9999), .max_ifshift = Hz(1200), .vfo_ops = FTDX101_VFO_OPS, + .scan_ops = RIG_SCAN_VFO, .targetable_vfo = RIG_TARGETABLE_FREQ | RIG_TARGETABLE_MODE | RIG_TARGETABLE_FUNC | RIG_TARGETABLE_LEVEL | RIG_TARGETABLE_COMMON | RIG_TARGETABLE_ANT, .transceive = RIG_TRN_OFF, /* May enable later as the FTDX101 has an Auto Info command */ .bank_qty = 0, @@ -249,5 +250,6 @@ const struct rig_caps ftdx101mp_caps = .wait_morse = rig_wait_morse, .set_clock = newcat_set_clock, .get_clock = newcat_get_clock, + .scan = newcat_scan, .hamlib_check_rig_caps = HAMLIB_CHECK_RIG_CAPS }; diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 627c2a0ce..f7652eb9d 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -6891,9 +6891,20 @@ int newcat_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op) int newcat_scan(RIG *rig, vfo_t vfo, scan_t scan, int ch) { - ENTERFUNC; + struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; + int retval; - RETURNFUNC(-RIG_ENAVAIL); + ENTERFUNC; + SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "SC%d%c", scan, cat_term); + + if (RIG_OK != (retval = newcat_set_cmd(rig))) + { + rig_debug(RIG_DEBUG_VERBOSE, "%s:%d command err = %d\n", __func__, __LINE__, + retval); + RETURNFUNC2(retval); + } + + RETURNFUNC2(retval); } @@ -11629,4 +11640,3 @@ int newcat_get_clock(RIG *rig, int *year, int *month, int *day, int *hour, RETURNFUNC2(retval); } - diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h index 87b3878b2..8b52fa793 100644 --- a/rigs/yaesu/newcat.h +++ b/rigs/yaesu/newcat.h @@ -50,7 +50,7 @@ typedef char ncboolean; /* shared function version */ -#define NEWCAT_VER "20221013" +#define NEWCAT_VER "20221021" /* Hopefully large enough for future use, 128 chars plus '\0' */ #define NEWCAT_DATA_LEN 129 @@ -236,7 +236,7 @@ int newcat_set_clock(RIG *rig, int year, int month, int day, int hour, int min, int sec, double msec, int utc_offset); int newcat_get_clock(RIG *rig, int *year, int *month, int *day, int *hour, int *min, int *sec, double *msec, int *utc_offset); - +int newcat_scan(RIG *rig, vfo_t vfo, scan_t scan, int ch); #define TOKEN_BACKEND(t) (t)