[Hamlib-commits] Hamlib -- Ham radio control libraries branch master updated. 9a6d4d761249c553ef710
Library to control radio transceivers and receivers
Brought to you by:
n0nb
From: Nate B. <n0...@us...> - 2022-11-11 03:17:53
|
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, master has been updated via 9a6d4d761249c553ef71093754213ca72e94eeb9 (commit) via 853806b9785975309c407c1e7d7f2158b50a95b3 (commit) via fc0fc1c67a5332a8ad2b55caddf288f2797a4b4e (commit) via eeac97c72594b364fc65d760d4ca9d332796d380 (commit) via 539457f6ce4c178b2141821b89521dfd69ba1875 (commit) via 27f424dfe2d9922c81c2d371dcee56074715c619 (commit) via 09d7ed2f196707e68cd24fffad03bebb525184f7 (commit) via 36717917ce9347f21708ad391befede96f486d51 (commit) via 77ae5ef5c99401d242832fa91f61d1a8483bb1e5 (commit) via 2993ca9e62d5eaf2e82ae8f60b85198aa7e1cd3c (commit) via 1ef362a954647b9ec92da0808963b1de0b0fa7b1 (commit) via fde9ad706c5aa3b95cb4a2e3fbcc7201f331cc78 (commit) via 24eb991f559398ebb6c66e9bbc716f872c6a2b3e (commit) via 0963d8c5bfd8ff7aa8176de35d18f9030e3c1acd (commit) via 454f640237c29a680f36b1b8d7358f542e53443f (commit) from 1074410bd527271f2f1f13b930911dd38a59e179 (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 9a6d4d761249c553ef71093754213ca72e94eeb9 Merge: 853806b9 fc0fc1c6 Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Nov 10 17:53:50 2022 -0600 Merge branch 'master' of https://github.com/Hamlib/Hamlib commit 853806b9785975309c407c1e7d7f2158b50a95b3 Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Nov 10 17:51:44 2022 -0600 Fix rotctld dumpcaps to expose client rot_type instead of Other https://github.com/Hamlib/Hamlib/issues/1035 diff --git a/rigs/dummy/netrotctl.c b/rigs/dummy/netrotctl.c index 16b6c22e..aaf657ef 100644 --- a/rigs/dummy/netrotctl.c +++ b/rigs/dummy/netrotctl.c @@ -144,7 +144,7 @@ static int netrotctl_open(ROT *rot) } rs->max_el = rot->caps->max_el = atof(buf); - + ret = read_string(&rot->state.rotport, (unsigned char *) buf, BUF_MAX, "\n", sizeof("\n"), 0, 1); @@ -155,6 +155,23 @@ static int netrotctl_open(ROT *rot) rs->south_zero = atoi(buf); + // Prot 1 is tag=value format + if (prot_ver >= 1) + { + ret = read_string(&rot->state.rotport, (unsigned char *) buf, BUF_MAX, "\n", + sizeof("\n"), 0, 1); + + if (ret <= 0) + { + return (ret < 0) ? ret : -RIG_EPROTO; + } + + if (strstr(buf, "AzEl")) { rot->caps->rot_type = ROT_TYPE_AZEL; } + else if (strstr(buf, "Az")) { rot->caps->rot_type = ROT_TYPE_AZIMUTH; } + else if (strstr(buf, "El")) { rot->caps->rot_type = ROT_TYPE_ELEVATION; } + } + + return RIG_OK; } diff --git a/tests/rotctl.c b/tests/rotctl.c index f7c74c45..f8dd99aa 100644 --- a/tests/rotctl.c +++ b/tests/rotctl.c @@ -369,6 +369,14 @@ int main(int argc, char *argv[]) rot_token_foreach(my_rot, print_conf_list, (rig_ptr_t)my_rot); } + retcode = rot_open(my_rot); + + if (retcode != RIG_OK) + { + fprintf(stderr, "rot_open: error = %s \n", rigerror(retcode)); + exit(2); + } + /* * Print out capabilities, and exits immediately as we may be interested * only in caps, and rig_open may fail. @@ -380,14 +388,6 @@ int main(int argc, char *argv[]) exit(0); } - retcode = rot_open(my_rot); - - if (retcode != RIG_OK) - { - fprintf(stderr, "rot_open: error = %s \n", rigerror(retcode)); - exit(2); - } - my_rot->state.az_offset = az_offset; my_rot->state.el_offset = el_offset; diff --git a/tests/rotctl_parse.c b/tests/rotctl_parse.c index 1a7c03d6..daeff767 100644 --- a/tests/rotctl_parse.c +++ b/tests/rotctl_parse.c @@ -2363,7 +2363,7 @@ declare_proto_rot(dump_state) /* * - Protocol version */ -#define ROTCTLD_PROT_VER 0 +#define ROTCTLD_PROT_VER 1 if ((interactive && prompt) || (interactive && !prompt && ext_resp)) { @@ -2414,6 +2414,21 @@ declare_proto_rot(dump_state) fprintf(fout, "%d%c", rs->south_zero, resp_sep); + char *rtype = "Unknown"; + + switch (rot->caps->rot_type) + { + case ROT_TYPE_OTHER: rtype = "Other"; break; + + case ROT_TYPE_AZIMUTH : rtype = "Az"; break; + + case ROT_TYPE_ELEVATION : rtype = "El"; break; + + case ROT_TYPE_AZEL : rtype = "AzEl"; break; + } + + fprintf(fout, "rot_type=%s%c", rtype, resp_sep); + return RIG_OK; } commit fc0fc1c67a5332a8ad2b55caddf288f2797a4b4e Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Nov 10 17:51:44 2022 -0600 Fix rotctld dumpcaps to expose client rot_type instead of Other diff --git a/rigs/dummy/netrotctl.c b/rigs/dummy/netrotctl.c index 16b6c22e..aaf657ef 100644 --- a/rigs/dummy/netrotctl.c +++ b/rigs/dummy/netrotctl.c @@ -144,7 +144,7 @@ static int netrotctl_open(ROT *rot) } rs->max_el = rot->caps->max_el = atof(buf); - + ret = read_string(&rot->state.rotport, (unsigned char *) buf, BUF_MAX, "\n", sizeof("\n"), 0, 1); @@ -155,6 +155,23 @@ static int netrotctl_open(ROT *rot) rs->south_zero = atoi(buf); + // Prot 1 is tag=value format + if (prot_ver >= 1) + { + ret = read_string(&rot->state.rotport, (unsigned char *) buf, BUF_MAX, "\n", + sizeof("\n"), 0, 1); + + if (ret <= 0) + { + return (ret < 0) ? ret : -RIG_EPROTO; + } + + if (strstr(buf, "AzEl")) { rot->caps->rot_type = ROT_TYPE_AZEL; } + else if (strstr(buf, "Az")) { rot->caps->rot_type = ROT_TYPE_AZIMUTH; } + else if (strstr(buf, "El")) { rot->caps->rot_type = ROT_TYPE_ELEVATION; } + } + + return RIG_OK; } diff --git a/tests/rotctl.c b/tests/rotctl.c index f7c74c45..f8dd99aa 100644 --- a/tests/rotctl.c +++ b/tests/rotctl.c @@ -369,6 +369,14 @@ int main(int argc, char *argv[]) rot_token_foreach(my_rot, print_conf_list, (rig_ptr_t)my_rot); } + retcode = rot_open(my_rot); + + if (retcode != RIG_OK) + { + fprintf(stderr, "rot_open: error = %s \n", rigerror(retcode)); + exit(2); + } + /* * Print out capabilities, and exits immediately as we may be interested * only in caps, and rig_open may fail. @@ -380,14 +388,6 @@ int main(int argc, char *argv[]) exit(0); } - retcode = rot_open(my_rot); - - if (retcode != RIG_OK) - { - fprintf(stderr, "rot_open: error = %s \n", rigerror(retcode)); - exit(2); - } - my_rot->state.az_offset = az_offset; my_rot->state.el_offset = el_offset; diff --git a/tests/rotctl_parse.c b/tests/rotctl_parse.c index 1a7c03d6..daeff767 100644 --- a/tests/rotctl_parse.c +++ b/tests/rotctl_parse.c @@ -2363,7 +2363,7 @@ declare_proto_rot(dump_state) /* * - Protocol version */ -#define ROTCTLD_PROT_VER 0 +#define ROTCTLD_PROT_VER 1 if ((interactive && prompt) || (interactive && !prompt && ext_resp)) { @@ -2414,6 +2414,21 @@ declare_proto_rot(dump_state) fprintf(fout, "%d%c", rs->south_zero, resp_sep); + char *rtype = "Unknown"; + + switch (rot->caps->rot_type) + { + case ROT_TYPE_OTHER: rtype = "Other"; break; + + case ROT_TYPE_AZIMUTH : rtype = "Az"; break; + + case ROT_TYPE_ELEVATION : rtype = "El"; break; + + case ROT_TYPE_AZEL : rtype = "AzEl"; break; + } + + fprintf(fout, "rot_type=%s%c", rtype, resp_sep); + return RIG_OK; } commit eeac97c72594b364fc65d760d4ca9d332796d380 Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Nov 10 16:00:00 2022 -0600 Fix FT-991 level_gran https://github.com/Hamlib/Hamlib/issues/1144 diff --git a/NEWS b/NEWS index 251f49cf..64e100de 100644 --- a/NEWS +++ b/NEWS @@ -17,6 +17,9 @@ Version 4.6 Version 4.5.1 * 2022-XX-XX + * Add RIG_FUNC_TUNER to flrig.c + * Fix FT-991 level_gran (needs to be done for lots of rigs) + * Fix man page rigctl to show units for LEVEL items * Fix Flex6xxx if_len * Fix FLRig set_ptt * Add KEYSPD to TS890 diff --git a/doc/man1/rigctl.1 b/doc/man1/rigctl.1 index b29f030a..438de67d 100644 --- a/doc/man1/rigctl.1 +++ b/doc/man1/rigctl.1 @@ -863,6 +863,53 @@ The Level Value can be a float or an integer value. For the AGC token the value is one of \(oq0\(cq = OFF, \(oq1\(cq = SUPERFAST, \(oq2\(cq = FAST, \(oq3\(cq = SLOW, \(oq4\(cq = USER, \(oq5\(cq = MEDIUM, \(oq6\(cq = AUTO. Note that not all values work on all rigs. To list usable values do "rigctl -m [modelnum] -u | grep AGC levels" or for Windows "rigctl -m [modelnum] -u | find "AGC levels"". +.IP +Level units +.in +4n +.EX +0.0-1.0 where 0=0% and 1.0=100% (except for BAL where 50% is center) + AF, ALC, ANTIVOX, BAL, COMP, MICGAIN, MONITOR_GAIN, NOTCHF_RAW, NR, RF, RFPOWER, RFPOWER_METER, USB_AF, VOXGAIN + +Amps + ID_METER(A) + +dB + NL, COMP_METER, PREAMP, ATT, SLOPE_LOW, SLOPE_HIGH, SPECTRUM_REF, SPECTRUM_ATT, STRENGTH + +Degrees(temperature) + TEMP_METER(C) + +Hz + CWPITCH, IF, NOTCHF, PBT_IN, PBT_OUT, SPECTRUM_EDGE_LOW, SPECTRUM_EDGE_HIGH, SPECTRUM_SPAN + +Seconds + VOXDELAY(ds), BKINDL(ms), BKIN_DLYMS(ms) + +Raw info from rig + RAWSTR, BAND_SELECT (subject to change -- index right now but may convert to band name) + +SWR + SWR + +Volts + VD_METER + +Lookup - if level shows 0/0/0 then it's probably a lookup value + METER RIG_METER_XXXX 1=SWR, 2=COMP, 4=ALC, 8=IC, 16=DB, 32=PO, 64=VDD, 128=Temp + AGC 0=None, 1=SuperFast, 2=Fast, 3=Slow, 4=User, 5=Medium, 6=Auto + Note: Not all AGC values may be available -- see AGC Level in dumpcaps (e.g. rigctl -m 1035 -u | grep AGC) + SPECTRUM_MODE 0=None, 1=Center, 2=Fixed, 3=Center Scroll, 4=Fixed Scroll + SPECTRUM_AVG rig specific + +Watts + RFPOWER_METER_WATTS + +WPM + KEYSPD +.in +.EE +.IP + .IP .BR Note : Passing a \(oq?\(cq (query) as the first argument instead of a Level token diff --git a/rigs/yaesu/ft991.c b/rigs/yaesu/ft991.c index d2af1e20..4b4fc427 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 ".13", + .version = NEWCAT_VER ".14", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -166,10 +166,43 @@ const struct rig_caps ft991_caps = .has_set_parm = RIG_PARM_NONE, .level_gran = { // cppcheck-suppress * - [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, - [LVL_CWPITCH] = { .min = { .i = 300 }, .max = { .i = 1050 }, .step = { .i = 50 } }, - [LVL_KEYSPD] = { .min = { .i = 4 }, .max = { .i = 60 }, .step = { .i = 1 } }, - [LVL_NOTCHF] = { .min = { .i = 1 }, .max = { .i = 3200 }, .step = { .i = 10 } }, + /* raw data */ + [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, + /* levels with dB units */ + [LVL_PREAMP] = { .min = { .i = 10 }, .max = { .i = 20 }, .step = { .i = 10 } }, + [LVL_ATT] = { .min = { .i = 12 }, .max = { .i = 12 }, .step = { .i = 0 } }, + [LVL_STRENGTH] = { .min = { .i = 0 }, .max = { .i = 60 }, .step = { .i = 0 } }, + [LVL_NB] = { .min = { .f = 0 }, .max = { .f = 10 }, .step = { .f = 1 } }, + /* levels with WPM units */ + [LVL_KEYSPD] = { .min = { .i = 4 }, .max = { .i = 60 }, .step = { .i = 1 } }, + /* levels with Hz units */ + [LVL_CWPITCH] = { .min = { .i = 300 }, .max = { .i = 1050 }, .step = { .i = 50 } }, + [LVL_IF] = { .min = { .i = -1200 }, .max = { .i = 1200 }, .step = { .i = 20 } }, + [LVL_NOTCHF] = { .min = { .i = 1 }, .max = { .i = 3200 }, .step = { .i = 10 } }, + /* levels with time units */ + [LVL_VOXDELAY] = { .min = { .i = 3 }, .max = { .i = 300 }, .step = { .i = 1 } }, + [LVL_BKINDL] = { .min = { .i = 30 }, .max = { .i = 3000 }, .step = { .i = 1 } }, + [LVL_BKIN_DLYMS] = { .min = { .i = 30 }, .max = { .i = 3000 }, .step = { .i = 1 } }, + /* level with misc units */ + [LVL_SWR] = { .min = { .f = 0 }, .max = { .f = 5.0 }, .step = { .f = 1.0f/255.0f } }, + [LVL_BAND_SELECT] = { .min = { .i = 0 }, .max = { .i = 16 }, .step = { .i = 1 } }, + /* levels with 0-1 values -- increment based on rig's range */ + [LVL_NR] = { .min = { .f = 0 }, .max = { .f = 1 }, .step = { .f = 1.0f/10.0f } }, + [LVL_AF] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/255.0f } }, + [LVL_RF] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/255.0f } }, + [LVL_RFPOWER] = { .min = { .f = .05 }, .max = { .f = 1 }, .step = { .f = 1.0f/100.0f } }, + [LVL_RFPOWER_METER] = { .min = { .f = .0 }, .max = { .f = 1 }, .step = { .f = 1.0f/255.0f } }, + [LVL_RFPOWER_METER_WATTS] = { .min = { .f = .0 }, .max = { .f = 100 }, .step = { .f = 1.0f/255.0f } }, + [LVL_COMP_METER] = { .min = { .f = .0 }, .max = { .f = 1 }, .step = { .f = 1.0f/255.0f } }, + [LVL_ID_METER] = { .min = { .f = .0 }, .max = { .f = 1 }, .step = { .f = 1.0f/255.0f } }, + [LVL_VD_METER] = { .min = { .f = .0 }, .max = { .f = 1 }, .step = { .f = 1.0f/255.0f } }, + [LVL_SQL] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/100.0f } }, + [LVL_MICGAIN] = { .min = { .f = .0 }, .max = { .f = 1 }, .step = { .f = 1.0f/100.0f } }, + [LVL_MONITOR_GAIN] = { .min = { .f = .0 }, .max = { .f = 1 }, .step = { .f = 1.0f/100.0f } }, + [LVL_COMP] = { .min = { .f = .0 }, .max = { .f = 1 }, .step = { .f = 1.0f/100.0f } }, + [LVL_VOXGAIN] = { .min = { .f = .0 }, .max = { .f = 1 }, .step = { .f = 1.0f/100.0f } }, + [LVL_ANTIVOX] = { .min = { .f = .0 }, .max = { .f = 1 }, .step = { .f = 1.0f/100.0f } }, + [LVL_ALC] = { .min = { .f = .0 }, .max = { .f = 1 }, .step = { .f = 1.0f/100.0f } }, }, .ctcss_list = common_ctcss_list, .dcs_list = common_dcs_list, diff --git a/rigs/yaesu/ft991.h b/rigs/yaesu/ft991.h index 92e5c988..7371bd59 100644 --- a/rigs/yaesu/ft991.h +++ b/rigs/yaesu/ft991.h @@ -54,7 +54,7 @@ RIG_LEVEL_RFPOWER|RIG_LEVEL_RF|RIG_LEVEL_SQL|\ RIG_LEVEL_MICGAIN|RIG_LEVEL_IF|RIG_LEVEL_CWPITCH|\ RIG_LEVEL_KEYSPD|RIG_LEVEL_AF|RIG_LEVEL_AGC|\ - RIG_LEVEL_METER|RIG_LEVEL_BKINDL|RIG_LEVEL_SQL|\ + RIG_LEVEL_METER|RIG_LEVEL_BKINDL|RIG_LEVEL_BKIN_DLYMS|RIG_LEVEL_SQL|\ RIG_LEVEL_VOXGAIN|RIG_LEVEL_VOXDELAY|RIG_LEVEL_COMP|\ RIG_LEVEL_ANTIVOX|RIG_LEVEL_NR|RIG_LEVEL_NB|RIG_LEVEL_NOTCHF|\ RIG_LEVEL_MONITOR_GAIN|RIG_LEVEL_RFPOWER_METER|RIG_LEVEL_RFPOWER_METER_WATTS|\ diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 560cb290..c2ed5915 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -4187,16 +4187,20 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) } else { - fpf = newcat_scale_float(15, val.f); - - if (fpf < 1) + if (is_ft991) { - fpf = 1; + fpf = newcat_scale_float(10, val.f); + if (fpf > 10) fpf=10; + } + else + { + fpf = newcat_scale_float(15, val.f); + if (fpf > 15) fpf=10; } - if (fpf > 15) + if (fpf < 0) { - fpf = 15; + fpf = 0; } SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "RL0%02d%c", fpf, cat_term); @@ -4443,7 +4447,7 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) else if (is_ft991) { fpf = newcat_scale_float(100, val.f); - SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "EX147%03d%c", fpf, cat_term); + SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "EX145%03d%c", fpf, cat_term); } else if (is_ft891) { diff --git a/src/idx_builtin.h b/src/idx_builtin.h index 004bdbbf..4c468034 100644 --- a/src/idx_builtin.h +++ b/src/idx_builtin.h @@ -165,7 +165,7 @@ #define LVL_USB_AF setting2idx_builtin(RIG_LEVEL_USB_AF) #define LVL_AGC_TIME setting2idx_builtin(RIG_LEVEL_AGC_TIME) -#define LVL_50 setting2idx_builtin(RIG_LEVEL_50) +#define LVL_BAND_SELECT setting2idx_builtin(RIG_LEVEL_BAND_SELECT) #define LVL_51 setting2idx_builtin(RIG_LEVEL_51) #define LVL_52 setting2idx_builtin(RIG_LEVEL_52) #define LVL_53 setting2idx_builtin(RIG_LEVEL_53) commit 539457f6ce4c178b2141821b89521dfd69ba1875 Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Nov 10 12:18:18 2022 -0600 Update ftdx10.h power levels diff --git a/rigs/yaesu/ftdx10.h b/rigs/yaesu/ftdx10.h index 3b59e5c1..67b690dc 100644 --- a/rigs/yaesu/ftdx10.h +++ b/rigs/yaesu/ftdx10.h @@ -78,7 +78,7 @@ { \ 5, \ { \ - {35, 5.0f}, \ + {27, 5.0f}, \ {94, 25.0f}, \ {147, 50.0f}, \ {176, 75.0f}, \ commit 27f424dfe2d9922c81c2d371dcee56074715c619 Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Nov 10 12:17:17 2022 -0600 Add RIG_FUNC_TUNER to flrig.c diff --git a/rigs/dummy/flrig.c b/rigs/dummy/flrig.c index 507d6cc0..1e0b997a 100644 --- a/rigs/dummy/flrig.c +++ b/rigs/dummy/flrig.c @@ -76,6 +76,7 @@ static int flrig_get_vfo(RIG *rig, vfo_t *vfo); static int flrig_set_vfo(RIG *rig, vfo_t vfo); static int flrig_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt); static int flrig_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt); +static int flrig_set_func(RIG *rig, vfo_t vfo, setting_t setting, int status); static int flrig_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq); static int flrig_get_split_freq(RIG *rig, vfo_t vfo, freq_t *tx_freq); static int flrig_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, @@ -141,7 +142,7 @@ const struct rig_caps flrig_caps = RIG_MODEL(RIG_MODEL_FLRIG), .model_name = "FLRig", .mfg_name = "FLRig", - .version = "20221104.0", + .version = "20221109.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -154,7 +155,8 @@ const struct rig_caps flrig_caps = .retry = 2, .has_get_func = RIG_FUNC_NONE, - .has_set_func = RIG_FUNC_NONE, + .has_set_func = RIG_FUNC_TUNER, + .set_func = flrig_set_func, .has_get_level = FLRIG_LEVELS, .has_set_level = RIG_LEVEL_SET(FLRIG_LEVELS), .has_get_parm = FLRIG_PARM, @@ -2359,6 +2361,23 @@ HAMLIB_EXPORT(int) flrig_cat_string(RIG *rig, const char *arg) return retval; } +HAMLIB_EXPORT(int) flrig_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) +{ + int retval; + char cmd_arg[MAXARGLEN]; + rig_debug(RIG_DEBUG_VERBOSE, "%s called: level=%s, status=%d\n", __func__, rig_strfunc(func), status); + switch(func) + { + case RIG_FUNC_TUNER: + SNPRINTF(cmd_arg, sizeof(cmd_arg), + "<params><param><value>%d</value></param></params>", status); + retval = flrig_transaction(rig, "rig.tune", cmd_arg, NULL, 0); + default: + retval = -RIG_ENIMPL; + } + return retval; +} + #if 0 static int flrig_set_ext_parm(RIG *rig, setting_t parm, value_t val) { commit 09d7ed2f196707e68cd24fffad03bebb525184f7 Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Nov 10 08:03:43 2022 -0600 Improve README.md by adding github and sourceforge info diff --git a/README.md b/README.md index 754d423f..3b109369 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,15 @@ Hamlib - (C) Frank Singleton 2000 (vk...@ix...) (C) Stephane Fillod 2000-2011 - (C) The Hamlib Group 2000-2012 + (C) The Hamlib Group 2000-2022 + The purpose of this project is to provide stable, flexible, shared libraries that enable quicker development of Amateur Radio Equipment Control Applications. +The master repository is https://github.com/Hamlib/Hamlib +Daily snapshots are available at https://n0nb.users.sourceforge.net/ +Development happens on the github master (often by +merging feature branches) and each release has a release branch. Many Amateur Radio Transceivers come with serial interfaces that allows software to control the radio. This project will endeavour to provide shared commit 36717917ce9347f21708ad391befede96f486d51 Author: Mike Black W9MDB <mdb...@ya...> Date: Wed Nov 9 15:27:20 2022 -0600 Fix 5W level of ftdx10.c based on user testing diff --git a/rigs/yaesu/ftdx10.c b/rigs/yaesu/ftdx10.c index 58d1be65..3e1cf8e0 100644 --- a/rigs/yaesu/ftdx10.c +++ b/rigs/yaesu/ftdx10.c @@ -137,7 +137,7 @@ const struct rig_caps ftdx10_caps = RIG_MODEL(RIG_MODEL_FTDX10), .model_name = "FTDX-10", .mfg_name = "Yaesu", - .version = NEWCAT_VER ".3", + .version = NEWCAT_VER ".4", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, commit 77ae5ef5c99401d242832fa91f61d1a8483bb1e5 Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Nov 8 15:33:13 2022 -0600 Update simicom9700.c diff --git a/simulators/simicom9700.c b/simulators/simicom9700.c index 6eaf47ae..f61959a2 100644 --- a/simulators/simicom9700.c +++ b/simulators/simicom9700.c @@ -39,7 +39,7 @@ int ptt = 0; int satmode = 0; int agc_time = 1; int ovf_status = 0; -int powerstat = 1; +int powerstat = 0; void dumphex(unsigned char *buf, int n) { @@ -55,6 +55,7 @@ frameGet(int fd, unsigned char *buf) memset(buf, 0, BUFSIZE); unsigned char c; +again: while (read(fd, &c, 1) > 0) { buf[i++] = c; @@ -65,6 +66,19 @@ frameGet(int fd, unsigned char *buf) dumphex(buf, i); return i; } + + if (i > 2 && c==0xfe) + { + printf("Turning power on due to 0xfe string\n"); + powerstat = 1; + int j; + for(j=i;j<175;++j) + { + if (read(fd, &c, 1) < 0) break; + } + i=0; + goto again; + } } printf("Error???\n"); @@ -88,12 +102,6 @@ void frameParse(int fd, unsigned char *frame, int len) switch (frame[4]) { - case 0xfe: - usleep(500 * 1000); - tcflush(fd, TCIFLUSH); - powerstat = 1; - break; - case 0x03: //from_bcd(frameackbuf[2], (civ_731_mode ? 4 : 5) * 2); commit 2993ca9e62d5eaf2e82ae8f60b85198aa7e1cd3c Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Nov 8 15:09:09 2022 -0600 Fix segfault in icom_get_powerstat diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 82a785f5..3bb8bf44 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -8073,9 +8073,9 @@ int icom_get_powerstat(RIG *rig, powerstat_t *status) { freq_t freq; int retrysave = rig->caps->retry; - rig->caps->retry = 0; + rig->state.rigport.retry = 0; int retval = rig_get_freq(rig, RIG_VFO_A, &freq); - rig->caps->retry = retrysave; + rig->state.rigport.retry = retrysave; *status = retval==RIG_OK ? RIG_POWER_ON : RIG_POWER_OFF; return retval; } diff --git a/simulators/simicom9700.c b/simulators/simicom9700.c index 8a080eb0..6eaf47ae 100644 --- a/simulators/simicom9700.c +++ b/simulators/simicom9700.c @@ -13,6 +13,9 @@ #include <sys/time.h> #include <hamlib/rig.h> #include "../src/misc.h" +#include <termios.h> +#include <unistd.h> + #define BUFSIZE 256 #define X25 @@ -36,7 +39,7 @@ int ptt = 0; int satmode = 0; int agc_time = 1; int ovf_status = 0; -int powerstat = 0; +int powerstat = 1; void dumphex(unsigned char *buf, int n) { @@ -85,6 +88,12 @@ void frameParse(int fd, unsigned char *frame, int len) switch (frame[4]) { + case 0xfe: + usleep(500 * 1000); + tcflush(fd, TCIFLUSH); + powerstat = 1; + break; + case 0x03: //from_bcd(frameackbuf[2], (civ_731_mode ? 4 : 5) * 2); @@ -100,8 +109,12 @@ void frameParse(int fd, unsigned char *frame, int len) } frame[10] = 0xfd; + if (powerstat) + { n = write(fd, frame, 11); + } + break; case 0x04: @@ -233,7 +246,7 @@ void frameParse(int fd, unsigned char *frame, int len) frame[6] = ovf_status; frame[7] = 0xfd; n = write(fd, frame, 8); - ovf_status = ovf_status==0?1:0; + ovf_status = ovf_status == 0 ? 1 : 0; break; case 0x11: @@ -527,11 +540,14 @@ int main(int argc, char **argv) } if (powerstat) - frameParse(fd, buf, len); + { + frameParse(fd, buf, len); + } else { - usleep(1000*1000); + usleep(1000 * 1000); } + rigStatus(); } commit 1ef362a954647b9ec92da0808963b1de0b0fa7b1 Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Nov 8 14:59:14 2022 -0600 Fix NEWS diff --git a/NEWS b/NEWS index f510f08e..251f49cf 100644 --- a/NEWS +++ b/NEWS @@ -19,7 +19,7 @@ Version 4.5.1 * 2022-XX-XX * Fix Flex6xxx if_len * Fix FLRig set_ptt - * Add KEYSPD to TS870 + * Add KEYSPD to TS890 * rigctl 'W' command can now use a singled char terminator like ; that allows for variable length responses with no timeout -- e.g. W FA; ; * New RIG_LEVEL_USB_AF to control audio gain from rig to computer -- to allow AGC function in software using RF and USB_AF * Add RIG_LEVEL_AGC_TIME to allow AGC/OFF to be set for IC-7300, IC-9700, IC-705 commit fde9ad706c5aa3b95cb4a2e3fbcc7201f331cc78 Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Nov 8 10:47:57 2022 -0600 Fix IC-7300 rig power on hopefully https://github.com/Hamlib/Hamlib/issues/1142 diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 2dd50a07..82a785f5 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -8047,6 +8047,8 @@ int icom_get_powerstat(RIG *rig, powerstat_t *status) ENTERFUNC; + *status = RIG_POWER_OFF; // default return until proven otherwise + /* r75 has no way to get power status, so fake it */ if (rig->caps->rig_model == RIG_MODEL_ICR75) { @@ -8070,7 +8072,11 @@ int icom_get_powerstat(RIG *rig, powerstat_t *status) if (rig->caps->rig_model == RIG_MODEL_IC7300) { freq_t freq; + int retrysave = rig->caps->retry; + rig->caps->retry = 0; int retval = rig_get_freq(rig, RIG_VFO_A, &freq); + rig->caps->retry = retrysave; + *status = retval==RIG_OK ? RIG_POWER_ON : RIG_POWER_OFF; return retval; } else diff --git a/simulators/simicom9700.c b/simulators/simicom9700.c index f19be87c..8a080eb0 100644 --- a/simulators/simicom9700.c +++ b/simulators/simicom9700.c @@ -36,6 +36,7 @@ int ptt = 0; int satmode = 0; int agc_time = 1; int ovf_status = 0; +int powerstat = 0; void dumphex(unsigned char *buf, int n) { @@ -99,7 +100,8 @@ void frameParse(int fd, unsigned char *frame, int len) } frame[10] = 0xfd; - n = write(fd, frame, 11); + if (powerstat) + n = write(fd, frame, 11); break; case 0x04: @@ -524,7 +526,12 @@ int main(int argc, char **argv) fd = openPort(argv[1]); } + if (powerstat) frameParse(fd, buf, len); + else + { + usleep(1000*1000); + } rigStatus(); } diff --git a/src/rig.c b/src/rig.c index 7e07af18..ee997c1f 100644 --- a/src/rig.c +++ b/src/rig.c @@ -5860,9 +5860,11 @@ int HAMLIB_API rig_get_powerstat(RIG *rig, powerstat_t *status) if (rig->caps->get_powerstat == NULL) { + *status = RIG_POWER_ON; // default to power if not available RETURNFUNC(-RIG_ENAVAIL); } + *status = RIG_POWER_OFF; // default now to power off until proven otherwise in get_powerstat HAMLIB_TRACE; retcode = rig->caps->get_powerstat(rig, status); RETURNFUNC(retcode); commit 24eb991f559398ebb6c66e9bbc716f872c6a2b3e Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Nov 8 10:16:19 2022 -0600 Update NEWS diff --git a/NEWS b/NEWS index 36abaaee..f510f08e 100644 --- a/NEWS +++ b/NEWS @@ -13,7 +13,13 @@ Version 5.x -- future * Change FT1000MP Mark V model names to align with FT1000MP Version 4.6 - * 2023-XX-XX + * 2023-11-XX -- Planned for Nov 2023 + +Version 4.5.1 + * 2022-XX-XX + * Fix Flex6xxx if_len + * Fix FLRig set_ptt + * Add KEYSPD to TS870 * rigctl 'W' command can now use a singled char terminator like ; that allows for variable length responses with no timeout -- e.g. W FA; ; * New RIG_LEVEL_USB_AF to control audio gain from rig to computer -- to allow AGC function in software using RF and USB_AF * Add RIG_LEVEL_AGC_TIME to allow AGC/OFF to be set for IC-7300, IC-9700, IC-705 commit 0963d8c5bfd8ff7aa8176de35d18f9030e3c1acd Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Nov 7 12:24:55 2022 -0600 Fix if_len in flex6xxx.c https://github.com/Hamlib/Hamlib/issues/1141 diff --git a/rigs/kenwood/flex6xxx.c b/rigs/kenwood/flex6xxx.c index f07afe43..8d72a12e 100644 --- a/rigs/kenwood/flex6xxx.c +++ b/rigs/kenwood/flex6xxx.c @@ -88,14 +88,14 @@ static struct kenwood_priv_caps f6k_priv_caps = { .cmdtrm = EOM_KEN, .mode_table = flex_mode_table, - .if_len = 38 + .if_len = 37 }; static struct kenwood_priv_caps powersdr_priv_caps = { .cmdtrm = EOM_KEN, .mode_table = powersdr_mode_table, - .if_len = 38 + .if_len = 37 }; #define DSP_BW_NUM 8 commit 454f640237c29a680f36b1b8d7358f542e53443f Author: Mike Black W9MDB <mdb...@ya...> Date: Sun Nov 6 15:58:30 2022 -0600 Fix dummy_set_split_freq diff --git a/rigs/dummy/dummy.c b/rigs/dummy/dummy.c index 1f6fca1b..b1eb070b 100644 --- a/rigs/dummy/dummy.c +++ b/rigs/dummy/dummy.c @@ -424,6 +424,7 @@ static int dummy_set_freq(RIG *rig, vfo_t vfo, freq_t freq) } if (vfo == RIG_VFO_CURR) { vfo = priv->curr_vfo; } + if (vfo == RIG_VFO_CURR || RIG_VFO_TX) { vfo = vfo_fixup(rig,vfo,rig->state.cache.split); } // if needed for testing enable this to emulate a rig with 100hz resolution #if 0 @@ -930,13 +931,16 @@ static int dummy_get_dcs_sql(RIG *rig, vfo_t vfo, unsigned int *code) static int dummy_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq) { struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv; + int retval; ENTERFUNC; + + retval = dummy_set_freq(rig, vfo, tx_freq); priv->curr->tx_freq = tx_freq; rig_debug(RIG_DEBUG_VERBOSE, "%s: priv->curr->tx_freq = %.0f\n", __func__, priv->curr->tx_freq); - RETURNFUNC(RIG_OK); + RETURNFUNC(retval); } @@ -2266,7 +2270,7 @@ struct rig_caps dummy_caps = RIG_MODEL(RIG_MODEL_DUMMY), .model_name = "Dummy", .mfg_name = "Hamlib", - .version = "20220727.0", + .version = "20221106.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_OTHER, ----------------------------------------------------------------------- Summary of changes: NEWS | 11 ++++++++++- README.md | 7 ++++++- doc/man1/rigctl.1 | 47 +++++++++++++++++++++++++++++++++++++++++++++++ rigs/dummy/dummy.c | 8 ++++++-- rigs/dummy/flrig.c | 23 +++++++++++++++++++++-- rigs/dummy/netrotctl.c | 19 ++++++++++++++++++- rigs/icom/icom.c | 6 ++++++ rigs/kenwood/flex6xxx.c | 4 ++-- rigs/yaesu/ft991.c | 43 ++++++++++++++++++++++++++++++++++++++----- rigs/yaesu/ft991.h | 2 +- rigs/yaesu/ftdx10.c | 2 +- rigs/yaesu/ftdx10.h | 2 +- rigs/yaesu/newcat.c | 18 +++++++++++------- simulators/simicom9700.c | 37 ++++++++++++++++++++++++++++++++++--- src/idx_builtin.h | 2 +- src/rig.c | 2 ++ tests/rotctl.c | 16 ++++++++-------- tests/rotctl_parse.c | 17 ++++++++++++++++- 18 files changed, 229 insertions(+), 37 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |