From d7d450df493dd47c913bfc3c5272be4ba32eaf4b Mon Sep 17 00:00:00 2001 From: Mike Black W9MDB Date: Fri, 11 Aug 2023 10:40:42 -0500 Subject: [PATCH] Add parm BANDSELECT for Yaesu rigs 'p BANDSELECT' returns current band of VFOA 'P BANDSELECT BAND160M' example selects the 160M band 'P BANDSELECT ?' shows bands available for the rig Kenwood rigs will be next Icom rigs TBD when Icom explains the return from 0x1a 0x01 -- no bandselect possible so manual setting of rig values https://github.com/Hamlib/Hamlib/issues/1353 --- NEWS | 4 + doc/man1/rigctl.1 | 3 +- doc/man1/rigctld.1 | 2 +- include/hamlib/rig.h | 47 +++++++++- rigs/dummy/dummy.c | 4 + rigs/icom/frame.c | 5 ++ rigs/icom/ic7100.c | 8 +- rigs/icom/ic7300.c | 27 ++++-- rigs/icom/icom.c | 18 +++- rigs/yaesu/ft1200.c | 10 ++- rigs/yaesu/ft2000.c | 10 ++- rigs/yaesu/ft3000.c | 10 ++- rigs/yaesu/ft450.c | 10 ++- rigs/yaesu/ft5000.c | 10 ++- rigs/yaesu/ft710.c | 10 ++- rigs/yaesu/ft891.c | 10 ++- rigs/yaesu/ft9000.c | 4 +- rigs/yaesu/ft950.c | 10 ++- rigs/yaesu/ft991.c | 12 ++- rigs/yaesu/ftdx10.c | 10 ++- rigs/yaesu/ftdx101.c | 10 ++- rigs/yaesu/ftdx101mp.c | 10 ++- rigs/yaesu/newcat.c | 49 ++++++++++- rigs/yaesu/newcat.h | 2 + scripts/build-w32.sh | 4 +- simulators/Makefile.am | 2 +- simulators/simft991.c | 16 ++++ src/idx_builtin.h | 1 + src/misc.c | 193 +++++++++++++++++++++++++++++++++++++++++ src/misc.h | 5 ++ src/serial.c | 2 + src/sprintflst.c | 9 ++ tests/rigctl_parse.c | 25 ++++++ 33 files changed, 496 insertions(+), 56 deletions(-) diff --git a/NEWS b/NEWS index 189e9aff0..2a6d62139 100644 --- a/NEWS +++ b/NEWS @@ -13,6 +13,10 @@ Version 5.x -- future * Change FT1000MP Mark V model names to align with FT1000MP Version 4.6 + * Added parm BANDSELECT for Yaesu rigs + 'p BANDSELECT' returns current band of VFOA + 'P BANDSELECT BAND160M' example selects the 160M band + 'P BANDSELECT ?' shows bands available for the rig * Added rig_cm108_get/set_bit to API and get/set_gpio to rigctl(d) for GPIO1,2,3,4 access on CM108 * Added BG2FX FX4/C/CR/L * Fixed IC7610 to use new 0x25 0x26 command added in latest firmware diff --git a/doc/man1/rigctl.1 b/doc/man1/rigctl.1 index 1f6302912..e8d0efafc 100644 --- a/doc/man1/rigctl.1 +++ b/doc/man1/rigctl.1 @@ -1022,7 +1022,7 @@ and .RI \(aq "Parm Value" \(aq. .IP Parm is a token: \(oqANN\(cq, \(oqAPO\(cq, \(oqBACKLIGHT\(cq, \(oqBEEP\(cq, -\(oqTIME\(cq, \(oqBAT\(cq, \(oqKEYLIGHT\(cq. +\(oqTIME\(cq, \(oqBAT\(cq, \(oqKEYLIGHT\(cq, \(oqSCREENSAVER\(cq, \(oqAFIF\(cq, \(oqBANDSELECT\(cq. .IP .BR Note : Passing a \(oq?\(cq (query) as the first argument instead of a Parm token will @@ -1038,6 +1038,7 @@ Use this to determine the supported parameters of a given radio backend. KEYLIGHT -- Button backlight, on/off SCREENSAVER -- rig specific timeouts AFIF -- 0=AF audio, 1=IF audio -- see IC-7300/9700/705 + BANDSELECT -- band name, e.g. BAND160M, BAND80M.... a ? instead of band will show band possibilities . .TP diff --git a/doc/man1/rigctld.1 b/doc/man1/rigctld.1 index 315ef4511..9913ea1f4 100644 --- a/doc/man1/rigctld.1 +++ b/doc/man1/rigctld.1 @@ -922,7 +922,7 @@ and .RI \(aq "Parm Value" \(aq. .IP Parm is a token: \(oqANN\(cq, \(oqAPO\(cq, \(oqBACKLIGHT\(cq, \(oqBEEP\(cq, -\(oqTIME\(cq, \(oqBAT\(cq, \(oqKEYLIGHT\(cq. +\(oqTIME\(cq, \(oqBAT\(cq, \(oqKEYLIGHT\(cq, \(oqBANDSELECT\(cq. .IP .BR Note : Passing a \(oq?\(cq (query) as the first argument instead of a Parm token will diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h index 88240f535..09a563638 100644 --- a/include/hamlib/rig.h +++ b/include/hamlib/rig.h @@ -767,6 +767,46 @@ typedef enum { // numbers here reflect the Yaesu values RIG_BAND_430MHZ = 16, /*!< \c 430MHz */ } hamlib_band_t; +typedef enum { // numbers here reflect the Yaesu values + RIG_BANDSELECT_UNUSED = CONSTANT_64BIT_FLAG(0), /*!< \c Unused */ + RIG_BANDSELECT_2200M = CONSTANT_64BIT_FLAG(1), /*!< \c 160M */ + RIG_BANDSELECT_600M = CONSTANT_64BIT_FLAG(2), /*!< \c 160M */ + RIG_BANDSELECT_160M = CONSTANT_64BIT_FLAG(3), /*!< \c 160M */ + RIG_BANDSELECT_80M = CONSTANT_64BIT_FLAG(4), /*!< \c 80M */ + RIG_BANDSELECT_60M = CONSTANT_64BIT_FLAG(5), /*!< \c 60M */ + RIG_BANDSELECT_40M = CONSTANT_64BIT_FLAG(6), /*!< \c 40M */ + RIG_BANDSELECT_30M = CONSTANT_64BIT_FLAG(7), /*!< \c 30M */ + RIG_BANDSELECT_20M = CONSTANT_64BIT_FLAG(8), /*!< \c 20M */ + RIG_BANDSELECT_17M = CONSTANT_64BIT_FLAG(9), /*!< \c 17M */ + RIG_BANDSELECT_15M = CONSTANT_64BIT_FLAG(10), /*!< \c 15M */ + RIG_BANDSELECT_12M = CONSTANT_64BIT_FLAG(11), /*!< \c 12M */ + RIG_BANDSELECT_10M = CONSTANT_64BIT_FLAG(12), /*!< \c 10M */ + RIG_BANDSELECT_6M = CONSTANT_64BIT_FLAG(13), /*!< \c 6M */ + RIG_BANDSELECT_WFM = CONSTANT_64BIT_FLAG(14), /*!< \c IC705 74.8-108 */ + RIG_BANDSELECT_GEN = CONSTANT_64BIT_FLAG(15), /*!< \c 60M */ + RIG_BANDSELECT_MW = CONSTANT_64BIT_FLAG(16), /*!< \c Medium Wave */ + RIG_BANDSELECT_AIR = CONSTANT_64BIT_FLAG(17), /*!< \c Air band */ + RIG_BANDSELECT_4M = CONSTANT_64BIT_FLAG(18), /*!< \c 70MHz */ + RIG_BANDSELECT_2M = CONSTANT_64BIT_FLAG(19), /*!< \c 144MHz */ + RIG_BANDSELECT_1_25M = CONSTANT_64BIT_FLAG(20), /*!< \c 222MHz */ + RIG_BANDSELECT_70CM = CONSTANT_64BIT_FLAG(21), /*!< \c 420MHz */ + RIG_BANDSELECT_33CM = CONSTANT_64BIT_FLAG(22), /*!< \c 902MHz */ + RIG_BANDSELECT_23CM = CONSTANT_64BIT_FLAG(23), /*!< \c 1240MHz */ + RIG_BANDSELECT_13CM = CONSTANT_64BIT_FLAG(24), /*!< \c 2300MHz */ + RIG_BANDSELECT_9CM = CONSTANT_64BIT_FLAG(25), /*!< \c 3300MHz */ + RIG_BANDSELECT_5CM = CONSTANT_64BIT_FLAG(26), /*!< \c 5650MHz */ + RIG_BANDSELECT_3CM = CONSTANT_64BIT_FLAG(27), /*!< \c 10000MHz */ +} hamlib_bandselect_t; + + +#define RIG_BANDSELECT_ALL +#define RIG_BANDSELECT_LF (RIG_BANDSELECT_2200M | RIG_BANDSELECT_600M) +#define RIG_BANDSELECT_HF (RIG_BANDSELECT_160M | RIG_BANDSELECT_80M | RIG_BANDSELECT_60M | RIG_BANDSELECT_40M\ +| RIG_BANDSELECT_30M | RIG_BANDSELECT_20M | RIG_BANDSELECT_17M | RIG_BANDSELECT_15M | RIG_BANDSELECT_12M\ +RIG_BANDSELECT_10M | RIG_BANDSELECT_6M) +#define RIG_BANDSELECT_UHF (RIG_BANDSELECT_AIR | RIG_BANDSELECT_2M| RIG_BANDSELECT_1_25M( +#define RIG_BANDSELECT_VHF (RIG_BANDSELECT_70CM) + /** * \brief Rig Scan operation @@ -1077,7 +1117,8 @@ enum rig_parm_e { RIG_PARM_BAT = (1 << 6), /*!< \c BAT -- battery level, float [0.0 ... 1.0] */ RIG_PARM_KEYLIGHT = (1 << 7), /*!< \c KEYLIGHT -- Button backlight, on/off */ RIG_PARM_SCREENSAVER = (1 << 8), /*!< \c SCREENSAVER -- rig specific timeouts */ - RIG_PARM_AFIF = (1 << 9) /*!< \c AFIF -- 0=AF audio, 1=IF audio -- see IC-7300/9700/705 */ + RIG_PARM_AFIF = (1 << 9), /*!< \c AFIF -- 0=AF audio, 1=IF audio -- see IC-7300/9700/705 */ + RIG_PARM_BANDSELECT = (1 << 10) /*!< \c BANDSELECT -- e.g. BAND160M, BAND80M, BAND70CM, BAND2CM */ }; /** @@ -1106,9 +1147,11 @@ enum multicast_item_e { //! @cond Doxygen_Suppress #define RIG_PARM_FLOAT_LIST (RIG_PARM_BACKLIGHT|RIG_PARM_BAT|RIG_PARM_KEYLIGHT) +#define RIG_PARM_STRING_LIST (RIG_PARM_BANDSELECT) #define RIG_PARM_READONLY_LIST (RIG_PARM_BAT) #define RIG_PARM_IS_FLOAT(l) ((l)&RIG_PARM_FLOAT_LIST) +#define RIG_PARM_IS_STRING(l) ((l)&RIG_PARM_STRING_LIST) #define RIG_PARM_SET(l) ((l)&~RIG_PARM_READONLY_LIST) //! @endcond @@ -2102,6 +2145,8 @@ struct rig_caps { int (*set_lock_mode)(RIG *rig, int mode); int (*get_lock_mode)(RIG *rig, int *mode); short timeout_retry; /*!< number of retries to make in case of read timeout errors, some serial interfaces may require this, 0 to use default value, -1 to disable */ +// int (*bandwidth2rig)(RIG *rig, enum bandwidth_t bandwidth); +// enum bandwidth_t (*rig2bandwidth)(RIG *rig, int rigbandwidth); }; //! @endcond diff --git a/rigs/dummy/dummy.c b/rigs/dummy/dummy.c index 3378838e5..2ca7fd4ad 100644 --- a/rigs/dummy/dummy.c +++ b/rigs/dummy/dummy.c @@ -1534,6 +1534,10 @@ static int dummy_set_parm(RIG *rig, setting_t parm, value_t val) { SNPRINTF(pstr, sizeof(pstr), "%f", val.f); } + if (RIG_PARM_IS_STRING(parm)) + { + strcpy(pstr,val.cs); + } else { SNPRINTF(pstr, sizeof(pstr), "%d", val.i); diff --git a/rigs/icom/frame.c b/rigs/icom/frame.c index a18216452..5abc600b7 100644 --- a/rigs/icom/frame.c +++ b/rigs/icom/frame.c @@ -182,6 +182,7 @@ collision_retry: * up to rs->retry times. */ +rig_debug(RIG_DEBUG_ERR, "%s: p->timeout=%d\n", __func__, rs->rigport.timeout); retval = read_icom_frame(&rs->rigport, buf, sizeof(buf)); if (retval == -RIG_ETIMEOUT || retval == 0) @@ -288,8 +289,12 @@ read_another_frame: * FIXME: handle padding/collisions * ACKFRMLEN is the smallest frame we can expect from the rig */ +rig_debug(RIG_DEBUG_ERR, "%s(%d): p->timeout=%d\n", __func__, __LINE__, rs->rigport.timeout); buf[0] = 0; frm_len = read_icom_frame(&rs->rigport, buf, sizeof(buf)); +rig_debug(RIG_DEBUG_ERR, "%s(%d): p->timeout=%d\n", __func__, __LINE__ ,rs->rigport.timeout); + if (frm_len > 4 && memcmp(buf, sendbuf, frm_len) == 0) + priv->serial_USB_echo_off = 0; #if 0 diff --git a/rigs/icom/ic7100.c b/rigs/icom/ic7100.c index f80ab1ad5..b33d44038 100644 --- a/rigs/icom/ic7100.c +++ b/rigs/icom/ic7100.c @@ -98,7 +98,7 @@ RIG_LEVEL_NB | \ RIG_LEVEL_AGC_TIME) -#define IC7100_PARM_ALL (RIG_PARM_ANN|RIG_PARM_BACKLIGHT|RIG_PARM_KEYLIGHT|RIG_PARM_BEEP|RIG_PARM_TIME) +#define IC7100_PARM_ALL (RIG_PARM_ANN|RIG_PARM_BACKLIGHT|RIG_PARM_KEYLIGHT|RIG_PARM_BEEP|RIG_PARM_TIME|RIG_PARM_BANDSELECT) int ic7100_tokens[] = { TOK_DSTAR_CODE, TOK_DSTAR_DSQL, TOK_DSTAR_CALL_SIGN, TOK_DSTAR_MESSAGE, TOK_DSTAR_STATUS, TOK_DSTAR_MY_CS, TOK_DSTAR_TX_CS, TOK_DSTAR_TX_MESS, @@ -310,7 +310,7 @@ const struct rig_caps ic7100_caps = RIG_MODEL(RIG_MODEL_IC7100), .model_name = "IC-7100", .mfg_name = "Icom", - .version = BACKEND_VER ".4", + .version = BACKEND_VER ".5", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -346,7 +346,9 @@ const struct rig_caps ic7100_caps = .extlevels = icom_ext_levels, .extfuncs = icom_ext_funcs, .extparms = icom_ext_parms, - .parm_gran = {}, + .parm_gran = { + [PARM_BANDSELECT] = {.min = {.f = 0.0f}, .max = {.f = 1.0f}, .step = {.s = "BAND160M,BAND80M,BAND40M,BAND30M,BAND20M,BAND17M,BAND15M,BAND12M,BAND10M,BAND6M,BAND2M,BAND70CM,BANDGEN"}} + }, .ctcss_list = common_ctcss_list, .dcs_list = common_dcs_list, .preamp = { 1, 2, RIG_DBLST_END, }, diff --git a/rigs/icom/ic7300.c b/rigs/icom/ic7300.c index a1caaad28..b70d10719 100644 --- a/rigs/icom/ic7300.c +++ b/rigs/icom/ic7300.c @@ -57,6 +57,8 @@ int ic9700_set_vfo(RIG *rig, vfo_t vfo); #define IC7300_LEVELS (RIG_LEVEL_PREAMP|RIG_LEVEL_ATT|RIG_LEVEL_AGC|RIG_LEVEL_COMP|RIG_LEVEL_BKINDL|RIG_LEVEL_NR|RIG_LEVEL_PBT_IN|RIG_LEVEL_PBT_OUT|RIG_LEVEL_CWPITCH|RIG_LEVEL_RFPOWER|RIG_LEVEL_MICGAIN|RIG_LEVEL_KEYSPD|RIG_LEVEL_NOTCHF_RAW|RIG_LEVEL_SQL|RIG_LEVEL_RAWSTR|RIG_LEVEL_STRENGTH|RIG_LEVEL_AF|RIG_LEVEL_RF|RIG_LEVEL_VOXGAIN|RIG_LEVEL_ANTIVOX|RIG_LEVEL_VOXDELAY|RIG_LEVEL_SWR|RIG_LEVEL_ALC|RIG_LEVEL_RFPOWER_METER|RIG_LEVEL_RFPOWER_METER_WATTS|RIG_LEVEL_COMP_METER|RIG_LEVEL_VD_METER|RIG_LEVEL_ID_METER|RIG_LEVEL_MONITOR_GAIN|RIG_LEVEL_NB|RIG_LEVEL_SPECTRUM_MODE|RIG_LEVEL_SPECTRUM_SPAN|RIG_LEVEL_SPECTRUM_SPEED|RIG_LEVEL_SPECTRUM_REF|RIG_LEVEL_SPECTRUM_AVG|RIG_LEVEL_SPECTRUM_EDGE_LOW|RIG_LEVEL_SPECTRUM_EDGE_HIGH|RIG_LEVEL_USB_AF|RIG_LEVEL_AGC_TIME) #define IC7300_VFOS (RIG_VFO_A|RIG_VFO_B|RIG_VFO_MEM) +// RIG_PARM_BANDSELECT disabled until Icom can describe the return from 0x1a 0x01 +//#define IC7300_PARMS (RIG_PARM_ANN|RIG_PARM_BACKLIGHT|RIG_PARM_TIME|RIG_PARM_BEEP|RIG_PARM_BANDSELECT) #define IC7300_PARMS (RIG_PARM_ANN|RIG_PARM_BACKLIGHT|RIG_PARM_TIME|RIG_PARM_BEEP) #define IC7300_VFO_OPS (RIG_OP_CPY|RIG_OP_XCHG|RIG_OP_FROM_VFO|RIG_OP_TO_VFO|RIG_OP_MCL|RIG_OP_TUNE) @@ -145,6 +147,8 @@ int ic9700_set_vfo(RIG *rig, vfo_t vfo); * IC9700 items that differ from IC7300 */ #define IC9700_VFOS (RIG_VFO_A|RIG_VFO_B|RIG_VFO_MAIN|RIG_VFO_SUB|RIG_VFO_MEM|RIG_VFO_MAIN_A|RIG_VFO_MAIN_B|RIG_VFO_SUB_A|RIG_VFO_SUB_B) +// RIG_PARM_BANDSELECT disabled until Icom can describe the return from 0x1a 0x01 +//#define IC9700_PARMS (RIG_PARM_ANN|RIG_PARM_BACKLIGHT|RIG_PARM_TIME|RIG_PARM_BEEP|RIG_PARM_SCREENSAVER|RIG_PARM_BANDSELECT) #define IC9700_PARMS (RIG_PARM_ANN|RIG_PARM_BACKLIGHT|RIG_PARM_TIME|RIG_PARM_BEEP|RIG_PARM_SCREENSAVER) #define IC9700_FUNCS (RIG_FUNC_NB|RIG_FUNC_COMP|RIG_FUNC_VOX|RIG_FUNC_TONE|RIG_FUNC_TSQL|RIG_FUNC_SBKIN|RIG_FUNC_FBKIN|RIG_FUNC_NR|RIG_FUNC_MON|RIG_FUNC_MN|RIG_FUNC_ANF|RIG_FUNC_LOCK|RIG_FUNC_RIT|RIG_FUNC_SCOPE|RIG_FUNC_SATMODE|RIG_FUNC_DUAL_WATCH|RIG_FUNC_AFC|RIG_FUNC_TRANSCEIVE|RIG_FUNC_SPECTRUM|RIG_FUNC_SPECTRUM_HOLD|RIG_FUNC_SEND_MORSE|RIG_FUNC_SEND_VOICE_MEM|RIG_FUNC_OVF_STATUS) #define IC9700_LEVELS (RIG_LEVEL_PREAMP|RIG_LEVEL_ATT|RIG_LEVEL_AGC|RIG_LEVEL_COMP|RIG_LEVEL_BKINDL|RIG_LEVEL_NR|RIG_LEVEL_PBT_IN|RIG_LEVEL_PBT_OUT|RIG_LEVEL_CWPITCH|RIG_LEVEL_RFPOWER|RIG_LEVEL_MICGAIN|RIG_LEVEL_KEYSPD|RIG_LEVEL_NOTCHF_RAW|RIG_LEVEL_SQL|RIG_LEVEL_RAWSTR|RIG_LEVEL_STRENGTH|RIG_LEVEL_AF|RIG_LEVEL_RF|RIG_LEVEL_VOXGAIN|RIG_LEVEL_ANTIVOX|RIG_LEVEL_VOXDELAY|RIG_LEVEL_SWR|RIG_LEVEL_ALC|RIG_LEVEL_RFPOWER_METER|RIG_LEVEL_RFPOWER_METER_WATTS|RIG_LEVEL_COMP_METER|RIG_LEVEL_VD_METER|RIG_LEVEL_ID_METER|RIG_LEVEL_MONITOR_GAIN|RIG_LEVEL_NB|RIG_LEVEL_SPECTRUM_MODE|RIG_LEVEL_SPECTRUM_SPAN|RIG_LEVEL_SPECTRUM_SPEED|RIG_LEVEL_SPECTRUM_REF|RIG_LEVEL_SPECTRUM_AVG|RIG_LEVEL_SPECTRUM_EDGE_LOW|RIG_LEVEL_SPECTRUM_EDGE_HIGH|RIG_LEVEL_USB_AF|RIG_LEVEL_AGC_TIME) @@ -227,6 +231,7 @@ struct cmdparams ic7300_extcmds[] = { {.s = RIG_FUNC_TRANSCEIVE}, CMD_PARAM_TYPE_FUNC, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x71}, CMD_DAT_BOL, 1 }, { {.s = RIG_LEVEL_SPECTRUM_AVG}, CMD_PARAM_TYPE_LEVEL, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x02}, CMD_DAT_INT, 1 }, { {.s = RIG_LEVEL_USB_AF}, CMD_PARAM_TYPE_LEVEL, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x60}, CMD_DAT_LVL, 2 }, + { {.s = RIG_PARM_BANDSELECT}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_BAND_REG, SC_MOD_RW, 0, {0x00}, CMD_DAT_INT, 1 }, { {.s = RIG_PARM_NONE} } }; @@ -673,7 +678,7 @@ const struct rig_caps ic7300_caps = RIG_MODEL(RIG_MODEL_IC7300), .model_name = "IC-7300", .mfg_name = "Icom", - .version = BACKEND_VER ".10", + .version = BACKEND_VER ".11", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -708,7 +713,9 @@ const struct rig_caps ic7300_caps = [LVL_SPECTRUM_AVG] = {.min = {.i = 0}, .max = {.i = 3}, .step = {.i = 1}}, [LVL_USB_AF] = {.min = {.f = 0.0f}, .max = {.f = 1.0f}, .step = {.f = 1.0f / 255.0f }}, }, - .parm_gran = {}, + .parm_gran = { + [PARM_BANDSELECT] = {.step = {.s = "BANDUNUSED,BAND160M,BAND80M,BAND40M,BAND30M,BAND20M,BAND17M,BAND15M,BAND12M,BAND10M,BAND6M,BANDGEN"}} + }, .ext_tokens = ic7300_ext_tokens, .extlevels = icom_ext_levels, .ctcss_list = full_ctcss_list, @@ -910,7 +917,7 @@ struct rig_caps ic9700_caps = RIG_MODEL(RIG_MODEL_IC9700), .model_name = "IC-9700", .mfg_name = "Icom", - .version = BACKEND_VER ".15", + .version = BACKEND_VER ".17", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -944,7 +951,9 @@ struct rig_caps ic9700_caps = [LVL_SPECTRUM_AVG] = {.min = {.i = 0}, .max = {.i = 3}, .step = {.i = 1}}, [LVL_USB_AF] = {.min = {.f = 0.0f}, .max = {.f = 1.0f}, .step = {.f = 1.0f / 255.0f }}, }, - .parm_gran = {}, + .parm_gran = { + [PARM_BANDSELECT] = {.step = {.s = "BANDUNUSED,BAND70CM,BAND33CM,BAND23CM"}} + }, .ext_tokens = ic9700_ext_tokens, .extlevels = icom_ext_levels, .ctcss_list = full_ctcss_list, @@ -1223,7 +1232,7 @@ const struct rig_caps ic705_caps = RIG_MODEL(RIG_MODEL_IC705), .model_name = "IC-705", .mfg_name = "Icom", - .version = BACKEND_VER ".8", + .version = BACKEND_VER ".9", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -1257,7 +1266,9 @@ const struct rig_caps ic705_caps = [LVL_SPECTRUM_AVG] = {.min = {.i = 0}, .max = {.i = 3}, .step = {.i = 1}}, [LVL_USB_AF] = {.min = {.f = 0.0f}, .max = {.f = 1.0f}, .step = {.f = 1.0f / 255.0f }}, }, - .parm_gran = {}, + .parm_gran = { + [PARM_BANDSELECT] = {.step = {.s = "BANDUNUSED,BAND160M,BAND80M,BAND40M,BAND30M,BAND20M,BAND17M,BAND15M,BAND12M,BAND10M,BAND6M,BANDWFM,BANDAIR,BAND70CM,BAND33CM,BANDGEN"}} + }, .ext_tokens = ic705_ext_tokens, .extlevels = icom_ext_levels, .ctcss_list = full_ctcss_list, @@ -1524,7 +1535,9 @@ const struct rig_caps ic905_caps = [LVL_SPECTRUM_AVG] = {.min = {.i = 0}, .max = {.i = 3}, .step = {.i = 1}}, [LVL_USB_AF] = {.min = {.f = 0.0f}, .max = {.f = 1.0f}, .step = {.f = 1.0f / 255.0f }}, }, - .parm_gran = {}, + .parm_gran = { + [PARM_BANDSELECT] = {.step = {.s = "BANDUNUSED,BAND70CM,BAND33CM,BAND23CM,BAND23CM,BAND13CM,BAND3CM"}} + }, .ext_tokens = ic705_ext_tokens, .extlevels = icom_ext_levels, .ctcss_list = full_ctcss_list, diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index b3684555f..a2c87fa79 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -7607,6 +7607,17 @@ int icom_set_parm(RIG *rig, setting_t parm, value_t val) RETURNFUNC(-RIG_EINVAL); } +const char * icom_get_band(RIG *rig, int band) +{ + rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + + const char *s = rig_get_band_str(rig, band, 1); + + rig_debug(RIG_DEBUG_VERBOSE, "%s: %d=%s\n", __func__, band, s); + + return s; +} + /* * icom_get_parm * Assumes rig!=NULL @@ -7629,7 +7640,12 @@ int icom_get_parm(RIG *rig, setting_t parm, value_t *val) { if (cmd[i].cmdparamtype == CMD_PARAM_TYPE_PARM && cmd[i].id.s == parm) { - RETURNFUNC(icom_get_cmd(rig, RIG_VFO_NONE, (struct cmdparams *)&cmd[i], val)); + int retval = icom_get_cmd(rig, RIG_VFO_NONE, (struct cmdparams *)&cmd[i], val); + if (parm == RIG_PARM_BANDSELECT) + { + val->s = (char*)icom_get_band(rig, val->i); + } + RETURNFUNC(retval); } } diff --git a/rigs/yaesu/ft1200.c b/rigs/yaesu/ft1200.c index 85d890fa5..87e1f8c75 100644 --- a/rigs/yaesu/ft1200.c +++ b/rigs/yaesu/ft1200.c @@ -147,7 +147,7 @@ const struct rig_caps ftdx1200_caps = RIG_MODEL(RIG_MODEL_FTDX1200), .model_name = "FTDX-1200", .mfg_name = "Yaesu", - .version = NEWCAT_VER ".5", + .version = NEWCAT_VER ".6", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -168,8 +168,8 @@ const struct rig_caps ftdx1200_caps = .has_set_func = FTDX1200_FUNCS, .has_get_level = FTDX1200_LEVELS, .has_set_level = RIG_LEVEL_SET(FTDX1200_LEVELS), - .has_get_parm = RIG_PARM_NONE, - .has_set_parm = RIG_PARM_NONE, + .has_get_parm = RIG_PARM_BANDSELECT, + .has_set_parm = RIG_PARM_BANDSELECT, .level_gran = { #include "level_gran_yaesu.h" @@ -179,6 +179,10 @@ const struct rig_caps ftdx1200_caps = [LVL_MONITOR_GAIN] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/100.0f } }, [LVL_RFPOWER] = { .min = { .f = .05 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/100.0f } }, }, + .parm_gran = { + [PARM_BANDSELECT] = {.min = {.f = 0.0f}, .max = {.f = 1.0f}, .step = {.s = "BAND160M,BAND80M,BANDUNUSED,BAND40M,BAND30M,BAND20M,BAND17M,BAND15M,BAND12M,BAND10M,BAND6M,BANDGEN"}} + }, + .ctcss_list = common_ctcss_list, .dcs_list = NULL, .preamp = { 10, 20, RIG_DBLST_END, }, diff --git a/rigs/yaesu/ft2000.c b/rigs/yaesu/ft2000.c index 531d3454b..0ebb5f94b 100644 --- a/rigs/yaesu/ft2000.c +++ b/rigs/yaesu/ft2000.c @@ -132,7 +132,7 @@ const struct rig_caps ft2000_caps = RIG_MODEL(RIG_MODEL_FT2000), .model_name = "FT-2000", .mfg_name = "Yaesu", - .version = NEWCAT_VER ".3", + .version = NEWCAT_VER ".4", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -153,8 +153,8 @@ const struct rig_caps ft2000_caps = .has_set_func = FT2000_FUNCS, .has_get_level = FT2000_LEVELS, .has_set_level = RIG_LEVEL_SET(FT2000_LEVELS), - .has_get_parm = RIG_PARM_NONE, - .has_set_parm = RIG_PARM_NONE, + .has_get_parm = RIG_PARM_BANDSELECT, + .has_set_parm = RIG_PARM_BANDSELECT, .level_gran = { #include "level_gran_yaesu.h" // cppcheck-suppress * @@ -163,6 +163,10 @@ const struct rig_caps ft2000_caps = [LVL_COMP] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/255.0f } }, [LVL_VOXGAIN] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/255.0f } }, }, + .parm_gran = { + [PARM_BANDSELECT] = {.min = {.f = 0.0f}, .max = {.f = 1.0f}, .step = {.s = "BAND160M,BAND80M,BAND60M,BAND40M,BAND30M,BAND20M,BAND17M,BAND15M,BAND12M,BAND10M,BAND6M,BANDRGEN"}} + }, + .ctcss_list = common_ctcss_list, .dcs_list = NULL, .preamp = { 10, 17, RIG_DBLST_END, }, diff --git a/rigs/yaesu/ft3000.c b/rigs/yaesu/ft3000.c index 9696677a8..20d3b7eaf 100644 --- a/rigs/yaesu/ft3000.c +++ b/rigs/yaesu/ft3000.c @@ -242,7 +242,7 @@ const struct rig_caps ftdx3000_caps = RIG_MODEL(RIG_MODEL_FTDX3000), .model_name = "FTDX-3000", .mfg_name = "Yaesu", - .version = NEWCAT_VER ".10", + .version = NEWCAT_VER ".11", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -265,8 +265,8 @@ const struct rig_caps ftdx3000_caps = .has_set_func = FTDX5000_FUNCS, .has_get_level = FTDX5000_LEVELS, .has_set_level = RIG_LEVEL_SET(FTDX5000_LEVELS), - .has_get_parm = RIG_PARM_NONE, - .has_set_parm = RIG_PARM_NONE, + .has_get_parm = RIG_PARM_BANDSELECT, + .has_set_parm = RIG_PARM_BANDSELECT, .level_gran = { #include "level_gran_yaesu.h" [LVL_NOTCHF] = { .min = { .i = 1 }, .max = { .i = 4000 }, .step = { .i = 10 } }, @@ -274,6 +274,10 @@ const struct rig_caps ftdx3000_caps = [LVL_MONITOR_GAIN] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/100.0f } }, [LVL_RFPOWER] = { .min = { .f = .05 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/100.0f } }, }, + .parm_gran = { + [PARM_BANDSELECT] = {.min = {.f = 0.0f}, .max = {.f = 1.0f}, .step = {.s = "BAND160M,BAND80M,BANDUNUSED,BAND40M,BAND30M,BAND20M,BAND17M,BAND15M,BAND12M,BAND10M,BAND6M,BANDGEN"}} + }, + .ctcss_list = common_ctcss_list, .dcs_list = NULL, .preamp = { 10, 17, RIG_DBLST_END, }, diff --git a/rigs/yaesu/ft450.c b/rigs/yaesu/ft450.c index 4ad944fb5..e1e5d13a9 100644 --- a/rigs/yaesu/ft450.c +++ b/rigs/yaesu/ft450.c @@ -39,7 +39,7 @@ const struct rig_caps ft450_caps = RIG_MODEL(RIG_MODEL_FT450), .model_name = "FT-450", .mfg_name = "Yaesu", - .version = NEWCAT_VER ".3", + .version = NEWCAT_VER ".4", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -60,8 +60,8 @@ const struct rig_caps ft450_caps = .has_set_func = FT450_FUNCS, .has_get_level = FT450_LEVELS, .has_set_level = RIG_LEVEL_SET(FT450_LEVELS), - .has_get_parm = RIG_PARM_NONE, - .has_set_parm = RIG_PARM_NONE, + .has_get_parm = RIG_PARM_BANDSELECT, + .has_set_parm = RIG_PARM_BANDSELECT, .level_gran = { #include "level_gran_yaesu.h" @@ -70,6 +70,10 @@ const struct rig_caps ft450_caps = [LVL_NOTCHF] = { .min = { .i = 1 }, .max = { .i = 4000 }, .step = { .i = 10 } }, [LVL_VOXGAIN] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/255.0f } }, }, + .parm_gran = { + [PARM_BANDSELECT] = {.min = {.f = 0.0f}, .max = {.f = 1.0f}, .step = {.s = "BAND160M,BAND80M,BANDUNUSED,BAND40M,BAND30M,BAND20M,BAND17M,BAND15M,BAND12M,BAND10M,BAND6M,BANDGEN"}} + }, + .ctcss_list = common_ctcss_list, .dcs_list = NULL, .preamp = { 10, RIG_DBLST_END, }, /* TBC: Not specified in manual */ diff --git a/rigs/yaesu/ft5000.c b/rigs/yaesu/ft5000.c index 44bcee3d9..a15e8ab50 100644 --- a/rigs/yaesu/ft5000.c +++ b/rigs/yaesu/ft5000.c @@ -138,7 +138,7 @@ const struct rig_caps ftdx5000_caps = RIG_MODEL(RIG_MODEL_FTDX5000), .model_name = "FTDX-5000", .mfg_name = "Yaesu", - .version = NEWCAT_VER ".9", + .version = NEWCAT_VER ".10", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -159,8 +159,8 @@ const struct rig_caps ftdx5000_caps = .has_set_func = FTDX5000_FUNCS, .has_get_level = FTDX5000_LEVELS, .has_set_level = RIG_LEVEL_SET(FTDX5000_LEVELS), - .has_get_parm = RIG_PARM_NONE, - .has_set_parm = RIG_PARM_NONE, + .has_get_parm = RIG_PARM_BANDSELECT, + .has_set_parm = RIG_PARM_BANDSELECT, .level_gran = { #include "level_gran_yaesu.h" @@ -169,6 +169,10 @@ const struct rig_caps ftdx5000_caps = [LVL_COMP] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/255.0f } }, [LVL_VOXGAIN] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/255.0f } }, }, + .parm_gran = { + [PARM_BANDSELECT] = {.min = {.f = 0.0f}, .max = {.f = 1.0f}, .step = {.s = "BAND160M,BAND80M,BANDUNUSED,BAND40M,BAND30M,BAND20M,BAND17M,BAND15M,BAND12M,BAND10M,BAND6M,BANDGEN"}} + }, + .ctcss_list = common_ctcss_list, .dcs_list = NULL, .preamp = { 10, 20, RIG_DBLST_END, }, /* TBC: Not specified in manual */ diff --git a/rigs/yaesu/ft710.c b/rigs/yaesu/ft710.c index b3a8e4f6b..ac0b425ec 100644 --- a/rigs/yaesu/ft710.c +++ b/rigs/yaesu/ft710.c @@ -119,7 +119,7 @@ const struct rig_caps ft710_caps = RIG_MODEL(RIG_MODEL_FT710), .model_name = "FT-710", .mfg_name = "Yaesu", - .version = NEWCAT_VER ".5", + .version = NEWCAT_VER ".6", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -140,8 +140,8 @@ const struct rig_caps ft710_caps = .has_set_func = FT710_FUNCS, .has_get_level = FT710_LEVELS, .has_set_level = RIG_LEVEL_SET(FT710_LEVELS), - .has_get_parm = RIG_PARM_NONE, - .has_set_parm = RIG_PARM_NONE, + .has_get_parm = RIG_PARM_BANDSELECT, + .has_set_parm = RIG_PARM_BANDSELECT, .level_gran = { #include "level_gran_yaesu.h" @@ -150,6 +150,10 @@ const struct rig_caps ft710_caps = [LVL_MONITOR_GAIN] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/100.0f } }, [LVL_RFPOWER] = { .min = { .f = .05 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/100.0f } }, }, + .parm_gran = { + [PARM_BANDSELECT] = {.min = {.f = 0.0f}, .max = {.f = 1.0f}, .step = {.s = "BAND160M,BAND80M,BAND60M,BAND40M,BAND30M,BAND20M,BAND17M,BAND15M,BAND12M,BAND10M,BAND6M,BAND4M"}} + }, + .ctcss_list = common_ctcss_list, .dcs_list = NULL, .preamp = { 10, 20, RIG_DBLST_END, }, diff --git a/rigs/yaesu/ft891.c b/rigs/yaesu/ft891.c index 09c1c6adc..817b0a8cc 100644 --- a/rigs/yaesu/ft891.c +++ b/rigs/yaesu/ft891.c @@ -130,7 +130,7 @@ const struct rig_caps ft891_caps = RIG_MODEL(RIG_MODEL_FT891), .model_name = "FT-891", .mfg_name = "Yaesu", - .version = NEWCAT_VER ".7", + .version = NEWCAT_VER ".8", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -151,8 +151,8 @@ const struct rig_caps ft891_caps = .has_set_func = FT891_FUNCS, .has_get_level = FT891_LEVELS, .has_set_level = RIG_LEVEL_SET(FT891_LEVELS), - .has_get_parm = RIG_PARM_NONE, - .has_set_parm = RIG_PARM_NONE, + .has_get_parm = RIG_PARM_BANDSELECT, + .has_set_parm = RIG_PARM_BANDSELECT, .level_gran = { #include "level_gran_yaesu.h" @@ -163,6 +163,10 @@ const struct rig_caps ft891_caps = [LVL_MONITOR_GAIN] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/100.0f } }, [LVL_RFPOWER] = { .min = { .f = .05 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/100.0f } }, }, + .parm_gran = { + [PARM_BANDSELECT] = {.min = {.f = 0.0f}, .max = {.f = 1.0f}, .step = {.s = "BAND160M,BAND80M,BANDUNUSED,BAND40M,BAND30M,BAND20M,BAND17M,BAND15M,BAND12M,BAND10M,BAND6M,BANDRGEN,BANDMW"}} + }, + .ctcss_list = common_ctcss_list, .dcs_list = NULL, .preamp = { 10, RIG_DBLST_END, }, /* TBC */ diff --git a/rigs/yaesu/ft9000.c b/rigs/yaesu/ft9000.c index 2fccd8eeb..795fa1b24 100644 --- a/rigs/yaesu/ft9000.c +++ b/rigs/yaesu/ft9000.c @@ -46,7 +46,7 @@ const struct rig_caps ft9000_caps = RIG_MODEL(RIG_MODEL_FT9000), .model_name = "FTDX-9000", .mfg_name = "Yaesu", - .version = NEWCAT_VER ".3", + .version = NEWCAT_VER ".4", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -222,7 +222,7 @@ const struct rig_caps ft9000Old_caps = RIG_MODEL(RIG_MODEL_FT9000OLD), .model_name = "FTDX-9000 Old", .mfg_name = "Yaesu", - .version = NEWCAT_VER ".3", + .version = NEWCAT_VER ".4", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, diff --git a/rigs/yaesu/ft950.c b/rigs/yaesu/ft950.c index 27d67023a..d640bfe76 100644 --- a/rigs/yaesu/ft950.c +++ b/rigs/yaesu/ft950.c @@ -82,7 +82,7 @@ const struct rig_caps ft950_caps = RIG_MODEL(RIG_MODEL_FT950), .model_name = "FT-950", .mfg_name = "Yaesu", - .version = NEWCAT_VER ".4", + .version = NEWCAT_VER ".5", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -103,8 +103,8 @@ const struct rig_caps ft950_caps = .has_set_func = FT950_FUNCS, .has_get_level = FT950_LEVELS, .has_set_level = RIG_LEVEL_SET(FT950_LEVELS), - .has_get_parm = RIG_PARM_NONE, - .has_set_parm = RIG_PARM_NONE, + .has_get_parm = RIG_PARM_BANDSELECT, + .has_set_parm = RIG_PARM_BANDSELECT, .level_gran = { #include "level_gran_yaesu.h" @@ -115,6 +115,10 @@ const struct rig_caps ft950_caps = [LVL_NOTCHF] = { .min = { .i = 1 }, .max = { .i = 3000 }, .step = { .i = 10 } }, [LVL_RFPOWER] = { .min = { .f = .05 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/100.0f } }, }, + .parm_gran = { + [PARM_BANDSELECT] = {.min = {.f = 0.0f}, .max = {.f = 1.0f}, .step = {.s = "BAND160M,BAND80M,BANDUNUSED,BAND40M,BAND30M,BAND20M,BAND17M,BAND15M,BAND12M,BAND10M,BAND6M,BANDGEN"}} + }, + .ctcss_list = common_ctcss_list, .dcs_list = NULL, .preamp = { 10, 17, RIG_DBLST_END, }, diff --git a/rigs/yaesu/ft991.c b/rigs/yaesu/ft991.c index d13f67b86..309e1858d 100644 --- a/rigs/yaesu/ft991.c +++ b/rigs/yaesu/ft991.c @@ -138,7 +138,7 @@ const struct rig_caps ft991_caps = RIG_MODEL(RIG_MODEL_FT991), .model_name = "FT-991", .mfg_name = "Yaesu", - .version = NEWCAT_VER ".16", + .version = NEWCAT_VER ".17", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -159,8 +159,8 @@ const struct rig_caps ft991_caps = .has_set_func = FT991_FUNCS, .has_get_level = FT991_LEVELS, .has_set_level = RIG_LEVEL_SET(FT991_LEVELS), - .has_get_parm = RIG_PARM_NONE, - .has_set_parm = RIG_PARM_NONE, + .has_get_parm = RIG_PARM_BANDSELECT, + .has_set_parm = RIG_PARM_BANDSELECT, .level_gran = { #include "level_gran_yaesu.h" [LVL_MICGAIN] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/100.0f } }, @@ -168,6 +168,10 @@ const struct rig_caps ft991_caps = [LVL_MONITOR_GAIN] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/100.0f } }, [LVL_RFPOWER] = { .min = { .f = .05 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/100.0f } }, }, + .parm_gran = { + [PARM_BANDSELECT] = {.min = {.f = 0.0f}, .max = {.f = 1.0f}, .step = {.s = "BAND160M,BAND80M,BANDUNUSED,BAND40M,BAND30M,BAND20M,BAND17M,BAND15M,BAND12M,BAND10M,BAND6M,BANDGEN,BANDMW,BANDUNUSED,BANDAIR,BAND70CM,BAND33CM"}} + }, + .ctcss_list = common_ctcss_list, .dcs_list = common_dcs_list, .preamp = { 10, 20, RIG_DBLST_END, }, @@ -320,6 +324,8 @@ const struct rig_caps ft991_caps = .get_xit = newcat_get_xit, .get_func = newcat_get_func, .set_func = newcat_set_func, + .get_parm = newcat_get_parm, + .set_parm = newcat_set_parm, .get_level = newcat_get_level, .set_level = newcat_set_level, .get_mem = newcat_get_mem, diff --git a/rigs/yaesu/ftdx10.c b/rigs/yaesu/ftdx10.c index d411b26a4..64865b04c 100644 --- a/rigs/yaesu/ftdx10.c +++ b/rigs/yaesu/ftdx10.c @@ -135,7 +135,7 @@ const struct rig_caps ftdx10_caps = RIG_MODEL(RIG_MODEL_FTDX10), .model_name = "FTDX-10", .mfg_name = "Yaesu", - .version = NEWCAT_VER ".7", + .version = NEWCAT_VER ".8", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -156,8 +156,8 @@ const struct rig_caps ftdx10_caps = .has_set_func = FTDX10_FUNCS, .has_get_level = FTDX10_LEVELS, .has_set_level = RIG_LEVEL_SET(FTDX10_LEVELS), - .has_get_parm = RIG_PARM_NONE, - .has_set_parm = RIG_PARM_NONE, + .has_get_parm = RIG_PARM_BANDSELECT, + .has_set_parm = RIG_PARM_BANDSELECT, .level_gran = { #include "level_gran_yaesu.h" @@ -166,6 +166,10 @@ const struct rig_caps ftdx10_caps = [LVL_MONITOR_GAIN] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/100.0f } }, [LVL_RFPOWER] = { .min = { .f = .05 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/100.0f } }, }, + .parm_gran = { + [PARM_BANDSELECT] = {.min = {.f = 0.0f}, .max = {.f = 1.0f}, .step = {.s = "BAND160M,BAND80M,BANDUNUSED,BAND40M,BAND30M,BAND20M,BAND17M,BAND15M,BAND12M,BAND10M,BAND6M,BANDGEN,BANDMW"}} + }, + .ctcss_list = common_ctcss_list, .dcs_list = NULL, .preamp = { 10, 20, RIG_DBLST_END, }, diff --git a/rigs/yaesu/ftdx101.c b/rigs/yaesu/ftdx101.c index 6922a17ff..cd20541f9 100644 --- a/rigs/yaesu/ftdx101.c +++ b/rigs/yaesu/ftdx101.c @@ -135,7 +135,7 @@ const struct rig_caps ftdx101d_caps = RIG_MODEL(RIG_MODEL_FTDX101D), .model_name = "FTDX-101D", .mfg_name = "Yaesu", - .version = NEWCAT_VER ".17", + .version = NEWCAT_VER ".18", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -156,8 +156,8 @@ const struct rig_caps ftdx101d_caps = .has_set_func = FTDX101_FUNCS, .has_get_level = FTDX101_LEVELS, .has_set_level = RIG_LEVEL_SET(FTDX101_LEVELS), - .has_get_parm = RIG_PARM_NONE, - .has_set_parm = RIG_PARM_NONE, + .has_get_parm = RIG_PARM_BANDSELECT, + .has_set_parm = RIG_PARM_BANDSELECT, .level_gran = { #include "level_gran_yaesu.h" @@ -166,6 +166,10 @@ const struct rig_caps ftdx101d_caps = [LVL_MONITOR_GAIN] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/100.0f } }, [LVL_RFPOWER] = { .min = { .f = .05 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/100.0f } }, }, + .parm_gran = { + [PARM_BANDSELECT] = {.min = {.f = 0.0f}, .max = {.f = 1.0f}, .step = {.s = "BAND160M,BAND80M,BAND60M,BAND40M,BAND30M,BAND20M,BAND17M,BAND15M,BAND12M,BAND10M,BAND6M,BANDGEN,BANDMW,BANDUNUSED,BANDUNUSED,BANDUNUSED,BANDUNUSED,BAND4M"}} + }, + .ctcss_list = common_ctcss_list, .dcs_list = NULL, .preamp = { 10, 20, RIG_DBLST_END, }, diff --git a/rigs/yaesu/ftdx101mp.c b/rigs/yaesu/ftdx101mp.c index 78673c8ce..5e40aacbd 100644 --- a/rigs/yaesu/ftdx101mp.c +++ b/rigs/yaesu/ftdx101mp.c @@ -73,7 +73,7 @@ const struct rig_caps ftdx101mp_caps = RIG_MODEL(RIG_MODEL_FTDX101MP), .model_name = "FTDX-101MP", .mfg_name = "Yaesu", - .version = NEWCAT_VER ".8", + .version = NEWCAT_VER ".9", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -94,8 +94,8 @@ const struct rig_caps ftdx101mp_caps = .has_set_func = FTDX101_FUNCS, .has_get_level = FTDX101_LEVELS, .has_set_level = RIG_LEVEL_SET(FTDX101_LEVELS), - .has_get_parm = RIG_PARM_NONE, - .has_set_parm = RIG_PARM_NONE, + .has_get_parm = RIG_PARM_BANDSELECT, + .has_set_parm = RIG_PARM_BANDSELECT, .level_gran = { #include "level_gran_yaesu.h" [LVL_MICGAIN] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/100.0f } }, @@ -103,6 +103,10 @@ const struct rig_caps ftdx101mp_caps = [LVL_MONITOR_GAIN] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/100.0f } }, [LVL_RFPOWER] = { .min = { .f = .05 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/100.0f } }, }, + .parm_gran = { + [PARM_BANDSELECT] = {.min = {.f = 0.0f}, .max = {.f = 1.0f}, .step = {.s = "BAND160M,BAND80M,BANDUNUSED,BAND40M,BAND30M,BAND20M,BAND17M,BAND15M,BAND12M,BAND10M,BAND6M,BANDGEN,BANDMW,BANDUNUSED,BANDUNUSED,BANDUNUSED,BANDUNUSED,BAND4M"}} + }, + .ctcss_list = common_ctcss_list, .dcs_list = NULL, .preamp = { 10, 20, RIG_DBLST_END, }, diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index ec607fc3c..f1484a26e 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -6666,16 +6666,63 @@ int newcat_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status) int newcat_set_parm(RIG *rig, setting_t parm, value_t val) { + struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; + int retval; + int band = 0; ENTERFUNC; - RETURNFUNC(-RIG_ENAVAIL); + switch(parm) + { + case RIG_PARM_BANDSELECT: + if (!newcat_valid_command(rig, "BS")) + { + RETURNFUNC(-RIG_ENAVAIL); + } + // we should have a string for the desired band + band = rig_get_band_rig(rig, 0.0, val.s); + + SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "BS%02d%c", band, cat_term); + + retval = newcat_set_cmd(rig); + + if (retval != RIG_OK) + { + RETURNFUNC(retval); + } + RETURNFUNC(RIG_OK); + } + + RETURNFUNC(-RIG_ENIMPL); } int newcat_get_parm(RIG *rig, setting_t parm, value_t *val) { + int retval; ENTERFUNC; + switch(parm) + { + case RIG_PARM_BANDSELECT: + if (!newcat_valid_command(rig, "BS")) + { + RETURNFUNC(-RIG_ENAVAIL); + } + + freq_t freq; + retval = rig_get_freq(rig, RIG_VFO_A, &freq); + if (retval != RIG_OK) + { + RETURNFUNC(retval); + } + hamlib_band_t band = rig_get_band(rig, freq, 0); + val->cs = rig_get_band_str(rig, band, 0); + + RETURNFUNC(RIG_OK); + default: + RETURNFUNC(-RIG_EINVAL); + } + RETURNFUNC(-RIG_ENAVAIL); } diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h index 267b36f0b..391e64bce 100644 --- a/rigs/yaesu/newcat.h +++ b/rigs/yaesu/newcat.h @@ -195,6 +195,8 @@ int newcat_set_level(RIG * rig, vfo_t vfo, setting_t level, value_t val); int newcat_get_level(RIG * rig, vfo_t vfo, setting_t level, value_t * val); int newcat_set_func(RIG * rig, vfo_t vfo, setting_t func, int status); int newcat_get_func(RIG * rig, vfo_t vfo, setting_t func, int *status); +int newcat_set_parm(RIG * rig, setting_t parm, value_t val); +int newcat_get_parm(RIG * rig, setting_t parm, value_t *val); int newcat_set_mem(RIG * rig, vfo_t vfo, int ch); int newcat_get_mem(RIG * rig, vfo_t vfo, int *ch); int newcat_vfo_op(RIG * rig, vfo_t vfo, vfo_op_t op); diff --git a/scripts/build-w32.sh b/scripts/build-w32.sh index 37a40961a..de7f17607 100755 --- a/scripts/build-w32.sh +++ b/scripts/build-w32.sh @@ -232,9 +232,9 @@ make -j 4 install mkdir -p ${ZIP_DIR}/bin ${ZIP_DIR}/lib/msvc ${ZIP_DIR}/lib/gcc ${ZIP_DIR}/include ${ZIP_DIR}/doc cp -a src/libhamlib.def ${ZIP_DIR}/lib/msvc/libhamlib-4.def -todos ${ZIP_DIR}/lib/msvc/libhamlib-4.def +#todos ${ZIP_DIR}/lib/msvc/libhamlib-4.def cp -a ${INST_DIR}/include/hamlib ${ZIP_DIR}/include/. -todos ${ZIP_DIR}/include/hamlib/*.h +#todos ${ZIP_DIR}/include/hamlib/*.h # C++ binding is useless on w32 because of ABI for f in *class.h diff --git a/simulators/Makefile.am b/simulators/Makefile.am index 895b8d416..3583ba822 100644 --- a/simulators/Makefile.am +++ b/simulators/Makefile.am @@ -8,7 +8,7 @@ DISTCLEANFILES = bin_PROGRAMS = -check_PROGRAMS = simelecraft simicgeneric simkenwood simyaesu simic9100 simic9700 simft991 simftdx1200 simftdx3000 simjupiter simpowersdr simid5100 simft736 simftdx5000 simtmd700 simrotorez simspid simft817 simts590 simft847 simic7300 simic7000 simic7100 simic7200 simatd578 simic905 simts450 simic7600 simic7610 simic705 simts950 simts990 simic7851 +check_PROGRAMS = simelecraft simicgeneric simkenwood simyaesu simic9100 simic9700 simft991 simftdx1200 simftdx3000 simjupiter simpowersdr simid5100 simft736 simftdx5000 simtmd700 simrotorez simspid simft817 simts590 simft847 simic7300 simic7000 simic7100 simic7200 simatd578 simic905 simts450 simic7600 simic7610 simic705 simts950 simts990 simic7851 simftdx101 simelecraft_SOURCES = simelecraft.c simkenwood_SOURCES = simkenwood.c diff --git a/simulators/simft991.c b/simulators/simft991.c index fd8b7d873..d79da809d 100644 --- a/simulators/simft991.c +++ b/simulators/simft991.c @@ -22,6 +22,8 @@ char tx_vfo = '0'; char rx_vfo = '0'; char modeA = '0'; char modeB = '0'; +int keyspd = 20; +int bandselect = 5; // ID 0310 == 310, Must drop leading zero typedef enum nc_rigid_e @@ -283,6 +285,20 @@ int main(int argc, char *argv[]) if (n < 0) { perror("EX032"); } } + else if (strncmp(buf, "KS;", 3) == 0) + { + sprintf(buf,"KS%d;", keyspd); + n = write(fd, buf, strlen(buf)); + } + else if (strncmp(buf,"KS",2) == 0) + { + sscanf(buf,"KS%03d", &keyspd); + } + else if (strncmp(buf, "BS;", 3) == 0) // cannot query BS + { + sprintf(buf,"BS%02d;", bandselect); + n = write(fd, buf, strlen(buf)); + } else if (strlen(buf) > 0) { diff --git a/src/idx_builtin.h b/src/idx_builtin.h index 4c4680344..8b3446d1b 100644 --- a/src/idx_builtin.h +++ b/src/idx_builtin.h @@ -187,6 +187,7 @@ #define PARM_TIME setting2idx_builtin(RIG_PARM_TIME) #define PARM_BAT setting2idx_builtin(RIG_PARM_BAT) #define PARM_KEYLIGHT setting2idx_builtin(RIG_PARM_KEYLIGHT) +#define PARM_BANDSELECT setting2idx_builtin(RIG_PARM_BANDSELECT) /* Rotator levels */ diff --git a/src/misc.c b/src/misc.c index cfd887992..3142cd588 100644 --- a/src/misc.c +++ b/src/misc.c @@ -52,6 +52,7 @@ #include "misc.h" #include "serial.h" #include "network.h" +#include "sprintflst.h" #if defined(_WIN32) # include @@ -740,6 +741,42 @@ static const struct { RIG_FUNC_NONE, "" }, }; +static const struct +{ + setting_t bandselect; + const char *str; + double start,stop; +} rig_bandselect_str[] = +{ + { RIG_BANDSELECT_2200M, "BAND2200M", 0, 0 }, + { RIG_BANDSELECT_600M, "BAND600M" , 1800000, 1900000}, + { RIG_BANDSELECT_160M, "BAND160M" , 1800000, 1900000}, + { RIG_BANDSELECT_80M, "BAND80M" , 3400000, 4099999}, + { RIG_BANDSELECT_60M, "BAND60M" , 0, 0}, + { RIG_BANDSELECT_40M, "BAND40M" , 6900000, 7499999}, + { RIG_BANDSELECT_30M, "BAND30M" , 9900000, 10499999}, + { RIG_BANDSELECT_20M, "BAND20M" , 13900000, 14499999}, + { RIG_BANDSELECT_17M, "BAND17M" , 17900000, 18499999}, + { RIG_BANDSELECT_15M, "BAND15M" , 20900000, 21499999}, + { RIG_BANDSELECT_12M, "BAND10M" , 24400000, 25099999}, + { RIG_BANDSELECT_10M, "BAND10M" , 28000000, 29999999}, + { RIG_BANDSELECT_6M, "BAND6M" , 50000000, 54000000}, + { RIG_BANDSELECT_WFM, "BANDWFM" , 0, 0}, + { RIG_BANDSELECT_GEN, "BANDGEN" , 0, 0}, + { RIG_BANDSELECT_MW, "BANDMW" , 0, 0}, + { RIG_BANDSELECT_AIR, "BANDAIR" , 0, 0}, + { RIG_BANDSELECT_2M, "BAND2M" , 0, 0}, + { RIG_BANDSELECT_1_25M, "BAND1_25M" , 0, 0}, + { RIG_BANDSELECT_70CM, "BAND70CM" , 0, 0}, + { RIG_BANDSELECT_33CM, "BAND33CM" , 0, 0}, + { RIG_BANDSELECT_23CM, "BAND23CM" , 0, 0}, + { RIG_BANDSELECT_13CM, "BAND13CM" , 0, 0}, + { RIG_BANDSELECT_9CM, "BAND9CM" , 0, 0}, + { RIG_BANDSELECT_5CM, "BAND5CM" , 0, 0}, + { RIG_BANDSELECT_3CM, "BAND3CM", 0, 0 }, + { 0, NULL, 0, 0 } +}; + static const struct { @@ -784,6 +821,31 @@ setting_t HAMLIB_API rig_parse_func(const char *s) return RIG_FUNC_NONE; } +/** + * \brief Convert alpha string to enum band_select_t... + * \param s input alpha string + * \return RIG_FUNC_... + * + * \sa rig_func_e() + */ +setting_t HAMLIB_API rig_parse_band(const char *s) +{ + int i; + + rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + + for (i = 0 ; rig_bandselect_str[i].str[0] != '\0'; i++) + { + if (!strcmp(s, rig_bandselect_str[i].str)) + { + return rig_bandselect_str[i].bandselect; + } + } + + return RIG_FUNC_NONE; +} + + /** * \brief Convert alpha string to enum ROT_FUNC_... @@ -1206,6 +1268,7 @@ static const struct { RIG_PARM_BAT, "BAT" }, { RIG_PARM_KEYLIGHT, "KEYLIGHT"}, { RIG_PARM_SCREENSAVER, "SCREENSAVER"}, + { RIG_PARM_BANDSELECT, "BANDSELECT"}, { RIG_PARM_NONE, "" }, }; @@ -2735,7 +2798,137 @@ const char *spaces() return s; } +// if which==0 rig_band_select str will be returned +// if which!=0 the rig_parm_gran band str will be returne +const char* rig_get_band_str(RIG *rig, hamlib_band_t band, int which) +{ + int i; + if (which == 0) + { + for (i = 0; rig_bandselect_str[i].str[0] != '\0'; i++) + { + if (rig_bandselect_str[i].bandselect == band) + { + return rig_bandselect_str[i].str; + } + } + } + else + { + char bandlist[512]; + + rig_sprintf_parm_gran(bandlist, sizeof(bandlist)-1, RIG_PARM_BANDSELECT, rig->caps->parm_gran); + rig_debug(RIG_DEBUG_VERBOSE, "%s: bandlist=%s\n", __func__, bandlist); + int n = 0; + char *p = strchr(bandlist,'(')+1; + char *token; + if (p == NULL) + { + rig_debug(RIG_DEBUG_ERR, "%s: unable to find open paren in '%s'\n", __func__, bandlist); + return 0; + } + while((token = strtok_r(p, ",", &p))) + { + if (n == band) + { + for (i = 0; rig_bandselect_str[i].str[0] != '\0'; i++) + { + if (strcmp(rig_bandselect_str[i].str,token)==0) + { + return rig_bandselect_str[i].str; + } + } + } + n++; + } + + } + return "BANDGEN"; +} +// If freq==0 looks up using the band index (which is the rig's band reference index) +// So you call for the rigs' band select value, pass it in and get back the hamlib_band_t +// Then use rig_get_band_str to get the abstract band name +// returns the rig's backend hamlib_band_t that can used to lookup the band str +hamlib_band_t rig_get_band(RIG *rig, freq_t freq, int band) +{ + int i; + + rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + + if (freq == 0) + { + char bandlist[512]; + + rig_sprintf_parm_gran(bandlist, sizeof(bandlist)-1, RIG_PARM_BANDSELECT, rig->caps->parm_gran); + rig_debug(RIG_DEBUG_VERBOSE, "%s: bandlist=%s\n", __func__, bandlist); + // e.g. BANDSELECT(BAND160M,BAND80M,BANDUNUSED,BAND40M) + char *p = strchr(bandlist,'(')+1; + char *token; + if (p == NULL) + { + rig_debug(RIG_DEBUG_ERR, "%s: unable to find open paren in '%s'\n", __func__, bandlist); + return 0; + } + int n = 0; + while((token = strtok_r(p, ",", &p))) + { + if (n == band) return rig_bandselect_str[n].bandselect; + n++; + } + + return RIG_BANDSELECT_UNUSED; + } + for (i = 0 ; rig_bandselect_str[i].str[0] != '\0'; i++) + { + if (freq >= rig_bandselect_str[i].start && freq <= rig_bandselect_str[i].stop) + { + return rig_bandselect_str[i].bandselect; + } + } + + return RIG_BANDSELECT_GEN; +} + +// Gets the rig's band index from the hamlib_band_t +int rig_get_band_rig(RIG *rig, freq_t freq, const char *band) +{ + char bandlist[512]; + int i; + + if (freq == 0) + { + rig_sprintf_parm_gran(bandlist, sizeof(bandlist)-1, RIG_PARM_BANDSELECT, rig->caps->parm_gran); + rig_debug(RIG_DEBUG_VERBOSE, "%s: bandlist=%s\n", __func__, bandlist); + // e.g. BANDSELECT(BAND160M,BAND80M,BANDUNUSED,BAND40M) + char *p = strchr(bandlist,'(')+1; + char *token; + if (p == NULL) + { + rig_debug(RIG_DEBUG_ERR, "%s: unable to find open paren in '%s'\n", __func__, bandlist); + return 0; + } + int n = 0; + while((token = strtok_r(p, ",", &p))) + { + if (strcmp(token,band)==0) return n; + n++; + } + rig_debug(RIG_DEBUG_ERR, "%s: unknown band %s\n", __func__, band); + return 0; + } + for (i = 0 ; rig_bandselect_str[i].str[0] != '\0'; i++) + { + if (freq >= rig_bandselect_str[i].start && freq <= rig_bandselect_str[i].stop) + { + // now we know the hamlib_band_t so we can look it up now + // this is 1-time recursive + return rig_get_band_rig(rig, 0.0, rig_bandselect_str[i].str); + } + } + rig_debug(RIG_DEBUG_ERR, "%s: unable to find band=%s, freq=%f\n", __func__, band, freq); + return 0; // just give a value for now of the 1st band -- this should be an error +} //! @endcond diff --git a/src/misc.h b/src/misc.h index fac999786..19debbfe7 100644 --- a/src/misc.h +++ b/src/misc.h @@ -212,6 +212,11 @@ extern HAMLIB_EXPORT(int) rig_settings_load_all(char *settings_file); extern int check_level_param(RIG *rig, setting_t level, value_t val, gran_t **gran); +// Takes rig-specific band result and maps it the bandlist int the rig's backend +extern HAMLIB_EXPORT(hamlib_band_t) rig_get_band(RIG *rig, freq_t freq, int band); +extern HAMLIB_EXPORT(const char*) rig_get_band_str(RIG *rig, hamlib_band_t band, int which); +extern HAMLIB_EXPORT(int) rig_get_band_rig(RIG *rig, freq_t freq, const char *band); + __END_DECLS #endif /* _MISC_H */ diff --git a/src/serial.c b/src/serial.c index 9d580a95f..23ccd1af8 100644 --- a/src/serial.c +++ b/src/serial.c @@ -772,9 +772,11 @@ int HAMLIB_API serial_flush(hamlib_port_t *p) } timeout_save = p->timeout; + rig_debug(RIG_DEBUG_ERR, "%s: p->timeout=%d\n", __func__, p->timeout); timeout_retry_save = p->timeout_retry; p->timeout = 0; p->timeout_retry = 0; + do { diff --git a/src/sprintflst.c b/src/sprintflst.c index afb344b45..9f6089ffe 100644 --- a/src/sprintflst.c +++ b/src/sprintflst.c @@ -22,6 +22,7 @@ #include +#include #include /* Standard input/output definitions */ #include /* String function definitions */ @@ -570,6 +571,14 @@ int rig_sprintf_parm_gran(char *str, int nlen, setting_t parm, gran[i].max.f, gran[i].step.f); } + else if (RIG_PARM_IS_STRING(rig_idx2setting(i))) + { + rig_debug(RIG_DEBUG_ERR, "%s: BAND_SELECT?\n", __func__); + len += sprintf(str + len, + "%s(%s)", + ms, + gran[i].step.s); + } else { len += sprintf(str + len, diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c index 90cfa9b19..0211223da 100644 --- a/tests/rigctl_parse.c +++ b/tests/rigctl_parse.c @@ -3545,6 +3545,23 @@ declare_proto_rig(set_parm) fprintf(fout, "%s\n", s); RETURNFUNC2(RIG_OK); } + if (strcmp(arg1,"BANDSELECT")==0 && !strcmp(arg2,"?")) + { + char s[SPRINTF_MAX_SIZE]; + rig_sprintf_parm_gran(s, sizeof(s)-1, RIG_PARM_BANDSELECT, rig->caps->parm_gran); + char *p = strchr(s,')'); + if (p) *p = 0; + p = strchr(s,'('); + + if (p) + { + char *comma; + while((comma=strchr(p,','))) *comma=' '; + fprintf(fout, "%s\n", p+1); + RETURNFUNC2(RIG_OK); + } + else RETURNFUNC2(-RIG_EINTERNAL); + } parm = rig_parse_parm(arg1); @@ -3594,6 +3611,10 @@ declare_proto_rig(set_parm) { CHKSCN1ARG(sscanf(arg2, "%f", &val.f)); } + else if (RIG_PARM_IS_STRING(parm)) + { + val.cs = arg2; + } else { CHKSCN1ARG(sscanf(arg2, "%d", &val.i)); @@ -3710,6 +3731,10 @@ declare_proto_rig(get_parm) { fprintf(fout, "%f\n", val.f); } + if (RIG_PARM_IS_STRING(parm)) + { + fprintf(fout, "%s\n", val.s); + } else { fprintf(fout, "%d\n", val.i);