hamlib-cvs-digest Mailing List for Ham Radio Control Libraries (Page 8)
Library to control radio transceivers and receivers
Brought to you by:
n0nb
You can subscribe to this list here.
2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(57) |
Nov
(27) |
Dec
(25) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(41) |
Feb
(101) |
Mar
(60) |
Apr
(32) |
May
(32) |
Jun
(198) |
Jul
(95) |
Aug
(60) |
Sep
(48) |
Oct
(96) |
Nov
(27) |
Dec
(222) |
2002 |
Jan
(180) |
Feb
(46) |
Mar
(68) |
Apr
(11) |
May
(36) |
Jun
(34) |
Jul
(113) |
Aug
(42) |
Sep
(71) |
Oct
(65) |
Nov
(116) |
Dec
(40) |
2003 |
Jan
(32) |
Feb
(92) |
Mar
(29) |
Apr
(102) |
May
(21) |
Jun
(34) |
Jul
(3) |
Aug
(60) |
Sep
(30) |
Oct
(62) |
Nov
(57) |
Dec
(33) |
2004 |
Jan
(28) |
Feb
(46) |
Mar
(16) |
Apr
(14) |
May
(31) |
Jun
(21) |
Jul
(10) |
Aug
(80) |
Sep
(42) |
Oct
(11) |
Nov
(28) |
Dec
(13) |
2005 |
Jan
(35) |
Feb
(26) |
Mar
(20) |
Apr
(118) |
May
(2) |
Jun
(5) |
Jul
|
Aug
|
Sep
(5) |
Oct
(1) |
Nov
(13) |
Dec
(1) |
2006 |
Jan
(9) |
Feb
(25) |
Mar
(22) |
Apr
(6) |
May
|
Jun
|
Jul
(2) |
Aug
(1) |
Sep
(3) |
Oct
(46) |
Nov
(13) |
Dec
(7) |
2007 |
Jan
(9) |
Feb
(14) |
Mar
(3) |
Apr
|
May
(6) |
Jun
(1) |
Jul
|
Aug
(11) |
Sep
(7) |
Oct
(8) |
Nov
(41) |
Dec
(3) |
2008 |
Jan
(27) |
Feb
(16) |
Mar
(13) |
Apr
(23) |
May
(39) |
Jun
(4) |
Jul
(7) |
Aug
(1) |
Sep
(13) |
Oct
(52) |
Nov
(44) |
Dec
(55) |
2009 |
Jan
(72) |
Feb
(69) |
Mar
|
Apr
|
May
|
Jun
(13) |
Jul
(1) |
Aug
(6) |
Sep
(15) |
Oct
(11) |
Nov
(31) |
Dec
(20) |
2010 |
Jan
(24) |
Feb
(21) |
Mar
(22) |
Apr
(40) |
May
(38) |
Jun
(4) |
Jul
(2) |
Aug
(22) |
Sep
(19) |
Oct
(14) |
Nov
(5) |
Dec
(8) |
2011 |
Jan
(14) |
Feb
(36) |
Mar
(6) |
Apr
|
May
|
Jun
(23) |
Jul
(13) |
Aug
(8) |
Sep
(7) |
Oct
|
Nov
(3) |
Dec
(9) |
2012 |
Jan
(17) |
Feb
(13) |
Mar
(10) |
Apr
|
May
(1) |
Jun
(14) |
Jul
(4) |
Aug
(12) |
Sep
(2) |
Oct
(24) |
Nov
(14) |
Dec
(2) |
2013 |
Jan
(4) |
Feb
(3) |
Mar
(3) |
Apr
(3) |
May
(10) |
Jun
(4) |
Jul
(7) |
Aug
|
Sep
(15) |
Oct
(5) |
Nov
(1) |
Dec
(2) |
2014 |
Jan
|
Feb
(8) |
Mar
(1) |
Apr
(3) |
May
(1) |
Jun
|
Jul
|
Aug
(1) |
Sep
(3) |
Oct
(7) |
Nov
(6) |
Dec
(3) |
2015 |
Jan
(4) |
Feb
(5) |
Mar
(8) |
Apr
(8) |
May
(2) |
Jun
|
Jul
(4) |
Aug
(7) |
Sep
(8) |
Oct
|
Nov
(6) |
Dec
(4) |
2016 |
Jan
(6) |
Feb
(26) |
Mar
(3) |
Apr
(10) |
May
(6) |
Jun
(5) |
Jul
(1) |
Aug
(4) |
Sep
(3) |
Oct
(4) |
Nov
(3) |
Dec
(10) |
2017 |
Jan
(11) |
Feb
(11) |
Mar
(2) |
Apr
(1) |
May
(7) |
Jun
(2) |
Jul
(11) |
Aug
(9) |
Sep
(5) |
Oct
(5) |
Nov
(1) |
Dec
(2) |
2018 |
Jan
(5) |
Feb
(2) |
Mar
(19) |
Apr
(7) |
May
(11) |
Jun
(3) |
Jul
(4) |
Aug
(10) |
Sep
(2) |
Oct
(8) |
Nov
(6) |
Dec
(9) |
2019 |
Jan
(9) |
Feb
(6) |
Mar
(2) |
Apr
(4) |
May
(6) |
Jun
(9) |
Jul
(6) |
Aug
(3) |
Sep
(5) |
Oct
(2) |
Nov
(8) |
Dec
(9) |
2020 |
Jan
(15) |
Feb
(1) |
Mar
(18) |
Apr
(33) |
May
(43) |
Jun
(87) |
Jul
(45) |
Aug
(8) |
Sep
(43) |
Oct
(3) |
Nov
(5) |
Dec
(42) |
2021 |
Jan
(116) |
Feb
(40) |
Mar
(58) |
Apr
(48) |
May
(29) |
Jun
(2) |
Jul
|
Aug
(22) |
Sep
(18) |
Oct
(1) |
Nov
|
Dec
(3) |
2022 |
Jan
(1) |
Feb
(1) |
Mar
|
Apr
(1) |
May
(2) |
Jun
(1) |
Jul
|
Aug
(1) |
Sep
|
Oct
(6) |
Nov
(2) |
Dec
(9) |
2023 |
Jan
(10) |
Feb
|
Mar
|
Apr
(10) |
May
(3) |
Jun
(1) |
Jul
(2) |
Aug
(4) |
Sep
(1) |
Oct
|
Nov
(2) |
Dec
(3) |
2024 |
Jan
(4) |
Feb
(1) |
Mar
(2) |
Apr
(2) |
May
(5) |
Jun
(3) |
Jul
(1) |
Aug
(2) |
Sep
|
Oct
(2) |
Nov
(3) |
Dec
(9) |
2025 |
Jan
(5) |
Feb
(5) |
Mar
|
Apr
(10) |
May
(20) |
Jun
(43) |
Jul
(24) |
Aug
(12) |
Sep
|
Oct
|
Nov
|
Dec
|
From: n0nb <n0...@us...> - 2023-04-05 11:48:07
|
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 annotated tag, 4.5.5 has been created at abb1914db02e2702da020c0ea0b4bb1163b87193 (tag) tagging 6eecd3d0160278373875e16b77299881ff656068 (commit) replaces 4.5.4 tagged by Nate Bargmann on Wed Apr 5 06:45:48 2023 -0500 - Log ----------------------------------------------------------------- 4.5.5 Hamlib 4.5.5 release -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQSC1k9rDmfNQfaJu6b7LFEw1VqIGQUCZC1fxgAKCRD7LFEw1VqI GVWWAJ9n9zKFPUYB/CJXIEZTcwPh59weYQCgpywExdwdzylFukHEDwW7NLrtbuI= =nABw -----END PGP SIGNATURE----- Michael Black (2): Merge pull request #1245 from mikaelnousiainen/icom-async-fixes Merge pull request #1244 from mikaelnousiainen/ts2000-fixes Mikael Nousiainen (1): Disable rig port flushing when async I/O is enabled. Improve validation of Icom frames. Mike Black W9MDB (62): Fix BSD build include path https://github.com/Hamlib/Hamlib/issues/1208 Fix get_powerstat call when get_powerstat is not defined https://github.com/Hamlib/Hamlib/issues/1217 Add FT991 to 60M exception Update NEWS Add TS-2000 to has_ps exceptions https://github.com/Hamlib/Hamlib/issues/1213 Change FTDX10 handshake to None instead of Hardware Update NEWS Fix AGC level display in rigctld https://github.com/Hamlib/Hamlib/issues/1155 Show AGC Level None when there are no AGC settings for rig https://github.com/Hamlib/Hamlib/issues/1155 Improve powerstat on/off behavior for Icom rigs https://github.com/Hamlib/Hamlib/issues/1212 Make auto_power_on a bit more robust for RigPI which seems slow to get going https://github.com/Hamlib/Hamlib/issues/1212 Remove one sleep from set_powerstat loop https://github.com/Hamlib/Hamlib/issues/1212 Allow get_powerstat when rig is powered off https://github.com/Hamlib/Hamlib/issues/1220 Fix icom.h Fix K3/K3S VFOB mode/bandwidth setting https://github.com/Hamlib/Hamlib/issues/1224 Update NEWS ERemove EX103 get/set for FTDX5000 Update NEWS Change QRP QRDX PTT to use TQ instead TX...more incompability with TS-480 standard Update NEWS Some updates to fix rc2800 operations https://github.com/Hamlib/Hamlib/commit/be72027f9a3c54b2ac086d3aca456edd503d7ecf Update NEWS Ensure K4 is in K40 mode when requesting ID Update NEWS Change TM-D700 and TM-D710 to hardware flow control https://github.com/Hamlib/Hamlib/issues/1228 Fix VFO A/B swapping for gpredict -- hopefully better behavior for VFO swapping rigs Should avoid setting RX freq while TX and avoid TX freq while RX https://github.com/Hamlib/Hamlib/issues/1230 Fix FT-450D detection Fix AF level control for FTDX10 and FT710 https://github.com/Hamlib/Hamlib/issues/1231 Allo FT-857 to return cached vfo when set_vfo is called and EEPROM read error occurs https://github.com/Hamlib/Hamlib/issues/1232 Improve FT-857 get_vfo response when error occurs This could be FT-857 EEPROM burnout https://github.com/Hamlib/Hamlib/issues/1232 Add fix for TMD700 https://github.com/Hamlib/Hamlib/issues/1230 Some fixes for th.c operation https://github.com/Hamlib/Hamlib/issues/1230 Add attenuator level control for TS890 Update SMeter/SWR tables for TS890 Thanks to N3GB George Baltz Increase post_write to 20ms for FT710 https://github.com/Hamlib/Hamlib/issues/1235 Separate the validation cmd in newcat.c to allow rig post_write_delay to be in effect https://github.com/Hamlib/Hamlib/issues/1219 Update NEWS Win4Yaesu is not recognizing EX commands so we ignore errors on the EX command for some Yaeus rigs Update NEWS Move semicolon removal after complete string is read. xg3 was expecting single ; response and old way was causing timeouts Add tcflush back into flush routine https://github.com/Hamlib/Hamlib/issues/1241 Fix xg3 set_freq Align xg3 with kenwood_priv and remove set/get mem for xg3 for now Re-enable set/get mem for xg3 Fix set_freq in jst145.c Fix set_vfo in jst145.c Update NEWS Update NEWS Fix spelling error in rotctl.c help and add offset settings to rotctl.1 Fix Gemini DX1200 gemini_set_level function Update NEWS For K3 prevent ID; command from K22; command Remote ops was having a problem with K22; https://github.com/Hamlib/Hamlib/issues/1254 Update NEWS Fix IC-7160 get_powerstat to disable it...cannot read power status from 7610 Update NEWS Enable async by default -- this prevents WSJT-X from crashing when transceive mode is on for the IC9700 https://github.com/Hamlib/Hamlib/issues/1264 Fix rigctld get_powerstat https://github.com/Hamlib/Hamlib/issues/1220 Fix PS0; command in newcat.c https://github.com/Hamlib/Hamlib/issues/1220 Fix auto_power_on from rigctl invocation with --set-conf=auto_power_on=1 https://github.com/Hamlib/Hamlib/issues/1220 Update NEWS Add error message when rig is not turned on that mentions auto_power_on Add simid5100.c Fix bootstrap problems Nate Bargmann (1): Update NEWS for 4.5.5 release ----------------------------------------------------------------------- hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: n0nb <n0...@us...> - 2023-04-05 11:44:34
|
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.5.5 has been updated via 6eecd3d0160278373875e16b77299881ff656068 (commit) via e5210bec1545472ef924c8fb8f21a550c6b6be3d (commit) via ad140cbac217ea346ebbe8042ecf67b1bbca08d7 (commit) from 9bf8066b836399507e0ae5cbed3f6c07a16de938 (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 6eecd3d0160278373875e16b77299881ff656068 Author: Nate Bargmann <n0...@n0...> Date: Wed Apr 5 06:43:08 2023 -0500 Update NEWS for 4.5.5 release diff --git a/NEWS b/NEWS index 73af32a6..8b13ec30 100644 --- a/NEWS +++ b/NEWS @@ -1,36 +1,14 @@ Hamlib -- History of visible changes. Copyright (C) 2000-2003 Frank Singleton -Copyright (C) 2000-2021 Stephane Fillod, and others -Copyright (C) 2000-2021 Michael Black W9MDB, and others +Copyright (C) 2000-2023 Stephane Fillod, and others +Copyright (C) 2000-2023 Michael Black W9MDB, and others Please send Hamlib bug reports to ham...@li... -Version 5.x -- future - * rig_get_conf deprecated and replaced by rig_get_conf2 - * rot_get_conf deprecated and replaced by rot_get_conf2 - * Change FT1000MP Mark V model names to align with FT1000MP - -Version 4.6 - * Add saebrtrack rotor https://sites.google.com/site/marklhammond/saebrtrack - * Add offset_vfoa and offset_vfob applying to rig_set_freq - * Fix K4 to put it in K40 mode when requesting ID - * 2023-11-XX -- Planned for Nov 2023 - * Fixes for M2 Rotors - * Add rigctlsync utility to synchronize frequency from a rig to SDR# (or others) - * Add SDR# rig for use with SDR#'s gpredict plugin -- can only get/set freq - * Add Apex Shared Loop rotator -- unidirectional only so far - * Add client_version to rigctld so client can report it's version for future use/compatility/alternatives - * Add --set-conf=tuner_control_pathname=hamlib_tuner_control (default) - If file exists then it will be called with 0/1 (Off/On) argument - with 'U TUNER 0' or 'U TUNER 1" - Default path is for current directory - * Add MDS 4710/9710 rigs - * Add FLIR PTU-D48, E46, D100, D300 rotors - * Fix FTDX3000 rig split - Version 4.5.5 + * 2023-04-05 * Add park to rotorez.c * Fix rig power on/off from rigctl cmd line and rigctld * Enable async mode by default to prevent WSJT-X crash on IC9700 with transceive on @@ -66,7 +44,7 @@ Version 4.5.5 * Fix power on/off/on for Icom rigs with rigctld power_on=0 Version 4.5.4 - * 2023-XX-XX + * 2023-01-10 * Fix CM108 ptt setting for non-default usage * Fix power on/off for Icom rigs with rigctld power_on=0 * Fix get_powerstat status return for non-PS kenwood rigs commit e5210bec1545472ef924c8fb8f21a550c6b6be3d Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Apr 4 22:13:16 2023 -0500 Fix bootstrap problems diff --git a/simulators/Makefile.am b/simulators/Makefile.am index eebddedd..3e2d7c04 100644 --- a/simulators/Makefile.am +++ b/simulators/Makefile.am @@ -8,7 +8,7 @@ DISTCLEANFILES = bin_PROGRAMS = -check_PROGRAMS = simelecraft simicom simkenwood simyaesu simicom9700 simft991 simftdx1200 simftdx3000 simjupiter simpowersdr +check_PROGRAMS = simelecraft simicom simkenwood simyaesu simicom9700 simft991 simftdx1200 simftdx3000 simjupiter simpowersdr simid5100 simelecraft_SOURCES = simelecraft.c simicom_SOURCES = simicom.c diff --git a/tests/Makefile.am b/tests/Makefile.am index 828f5efc..69cd60be 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -26,7 +26,6 @@ AMPCOMMONSRC = ampctl_parse.c ampctl_parse.h dumpcaps_amp.c uthash.h rigctl_SOURCES = rigctl.c $(RIGCOMMONSRC) rigctld_SOURCES = rigctld.c $(RIGCOMMONSRC) rigctlcom_SOURCES = rigctlcom.c $(RIGCOMMONSRC) -rigctltcp_SOURCES = rigctltcp.c $(RIGCOMMONSRC) rotctl_SOURCES = rotctl.c $(ROTCOMMONSRC) rotctld_SOURCES = rotctld.c $(ROTCOMMONSRC) ampctl_SOURCES = ampctl.c $(AMPCOMMONSRC) @@ -51,7 +50,6 @@ rotctld_CFLAGS = $(AM_CFLAGS) $(PTHREAD_CFLAGS) -I$(top_builddir)/src ampctl_CFLAGS = $(AM_CFLAGS) $(PTHREAD_CFLAGS) -I$(top_builddir)/src ampctld_CFLAGS = $(AM_CFLAGS) $(PTHREAD_CFLAGS) -I$(top_builddir)/src rigctlcom_CFLAGS = $(AM_CFLAGS) $(PTHREAD_CFLAGS) -I$(top_builddir)/security -rigctltcp_CFLAGS = $(AM_CFLAGS) $(PTHREAD_CFLAGS) -I$(top_builddir)/security if HAVE_LIBUSB rigtestlibusb_CFLAGS = $(AM_CFLAGS) $(PTHREAD_CFLAGS) $(LIBUSB_CFLAGS) endif @@ -65,7 +63,6 @@ ampctl_LDADD = $(PTHREAD_LIBS) $(LDADD) $(READLINE_LIBS) ampctld_LDADD = $(NET_LIBS) $(PTHREAD_LIBS) $(LDADD) $(READLINE_LIBS) rigmem_LDADD = $(LIBXML2_LIBS) $(LDADD) rigctlcom_LDADD = $(NET_LIBS) $(PTHREAD_LIBS) $(LDADD) $(READLINE_LIBS) -rigctltcp_LDADD = $(NET_LIBS) $(PTHREAD_LIBS) $(LDADD) $(READLINE_LIBS) if HAVE_LIBUSB rigtestlibusb_LDADD = $(LIBUSB_LIBS) endif @@ -81,7 +78,6 @@ rigctld_LDFLAGS = $(WINEXELDFLAGS) rotctld_LDFLAGS = $(WINEXELDFLAGS) ampctld_LDFLAGS = $(WINEXELDFLAGS) rigctlcom_LDFLAGS = $(WINEXELDFLAGS) -rigctltcp_LDFLAGS = $(WINEXELDFLAGS) if HAVE_LIBUSB rigtestlibusb_LDFLAGS = $(WINEXELDFLAGS) endif commit ad140cbac217ea346ebbe8042ecf67b1bbca08d7 Author: Mike Black W9MDB <mdb...@ya...> Date: Wed Jan 4 17:33:55 2023 -0600 Add simid5100.c diff --git a/simulators/simid5100.c b/simulators/simid5100.c new file mode 100644 index 00000000..3db0a01f --- /dev/null +++ b/simulators/simid5100.c @@ -0,0 +1,476 @@ +// simicom will show the pts port to use for rigctl on Unix +// using virtual serial ports on Windows is to be developed yet +// Needs a lot of improvement to work on all Icoms +// gcc -g -Wall -o simicom simicom.c -lhamlib +// On mingw in the hamlib src directory +// gcc -static -I../include -g -Wall -o simicom simicom.c -L../../build/src/.libs -lhamlib -lwsock32 -lws2_32 +#define _XOPEN_SOURCE 600 +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> +#include <fcntl.h> +#include <sys/time.h> +#include <hamlib/rig.h> +#include "../src/misc.h" +#include <termios.h> +#include <unistd.h> + + +#define BUFSIZE 256 + +int civ_731_mode = 0; +vfo_t current_vfo = RIG_VFO_A; +int split = 0; + +// we make B different from A to ensure we see a difference at startup +float freqA = 145000000; +float freqB = 14074500; +mode_t modeA = RIG_MODE_PKTUSB; +mode_t modeB = RIG_MODE_PKTUSB; +int datamodeA = 0; +int datamodeB = 0; +int filterA = 0; +ant_t ant_curr = 0; +int ant_option = 0; +int ptt = 0; +int satmode = 0; +int agc_time = 1; +int ovf_status = 0; +int powerstat = 1; + +void dumphex(unsigned char *buf, int n) +{ + for (int i = 0; i < n; ++i) { printf("%02x ", buf[i]); } + + printf("\n"); +} + +int +frameGet(int fd, unsigned char *buf) +{ + int i = 0; + memset(buf, 0, BUFSIZE); + unsigned char c; + +again: + + while (read(fd, &c, 1) > 0) + { + buf[i++] = c; + //printf("i=%d, c=0x%02x\n",i,c); + + if (c == 0xfd) + { + 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"); + + return 0; +} + +void frameParse(int fd, unsigned char *frame, int len) +{ + double freq; + int n = 0; + + dumphex(frame, len); + + if (frame[0] != 0xfe && frame[1] != 0xfe) + { + printf("expected fe fe, got "); + dumphex(frame, len); + return; + } + + switch (frame[4]) + { + case 0x00: + freq = from_bcd(&frame[5], 5 * 2); + freqA = freq; + printf("freq=%lf\n", freqA); + break; + case 0x03: + + //from_bcd(frameackbuf[2], (civ_731_mode ? 4 : 5) * 2); + if (current_vfo == RIG_VFO_A || current_vfo == RIG_VFO_MAIN) + { + printf("get_freqA\n"); + to_bcd(&frame[5], (long long)freqA/10000, 3 * 2); + dump_hex(frame,11); + } + else + { + printf("get_freqB\n"); + to_bcd(&frame[5], (long long)freqB/10000, 3 * 2); + } + + frame[8] = 0xfd; + dump_hex(frame,9); + + n = write(fd, frame, 9); + + break; + + case 0x04: + if (current_vfo == RIG_VFO_A || current_vfo == RIG_VFO_MAIN) + { + printf("get_modeA\n"); + frame[5] = modeA; + frame[6] = filterA; + } + else + { + printf("get_modeB\n"); + frame[5] = modeB; + frame[6] = filterA; + } + + frame[7] = 0xfd; + n = write(fd, frame, 8); + break; + + case 0x05: + freq = from_bcd(&frame[5], (civ_731_mode ? 4 : 5) * 2); + printf("set_freq to %.0f\n", freq); + + if (current_vfo == RIG_VFO_A || current_vfo == RIG_VFO_MAIN) { freqA = freq; } + else { freqB = freq; } + + frame[4] = 0xfb; + frame[5] = 0xfd; + n = write(fd, frame, 6); + break; + + case 0x06: + if (current_vfo == RIG_VFO_A || current_vfo == RIG_VFO_MAIN) { modeA = frame[6]; } + else { modeB = frame[6]; } + + frame[4] = 0xfb; + frame[5] = 0xfd; + n = write(fd, frame, 6); + break; + + case 0x07: + + switch (frame[5]) + { + case 0x00: current_vfo = RIG_VFO_A; break; + + case 0x01: current_vfo = RIG_VFO_B; break; + + case 0xd0: current_vfo = RIG_VFO_MAIN; break; + + case 0xd1: current_vfo = RIG_VFO_SUB; break; + } + + printf("set_vfo to %s\n", rig_strvfo(current_vfo)); + + frame[4] = 0xfb; + frame[5] = 0xfd; + n = write(fd, frame, 6); + break; + + case 0x0f: + if (frame[5] == 0) { split = 0; } + else if (frame[5] == 1) { split = 1; } + else { frame[6] = split; } + + if (frame[5] == 0xfd) + { + printf("get split %d\n", 1); + frame[7] = 0xfd; + n = write(fd, frame, 8); + } + else + { + printf("set split %d\n", 1); + frame[4] = 0xfb; + frame[5] = 0xfd; + n = write(fd, frame, 6); + } + + break; + + case 0x12: // we're simulating the 3-byte version -- not the 2-byte + if (frame[5] != 0xfd) + { + printf("Set ant %d\n", -1); + ant_curr = frame[5]; + ant_option = frame[6]; + dump_hex(frame, 8); + } + else + { + printf("Get ant\n"); + } + + frame[5] = ant_curr; + frame[6] = ant_option; + frame[7] = 0xfd; + printf("write 8 bytes\n"); + dump_hex(frame, 8); + n = write(fd, frame, 8); + break; + + case 0x14: + switch (frame[5]) + { + static int power_level = 0; + + case 0x0a: + printf("Using power level %d\n", power_level); + power_level += 10; + + if (power_level > 250) { power_level = 0; } + + to_bcd(&frame[6], (long long)power_level, 2); + frame[8] = 0xfd; + n = write(fd, frame, 9); + break; + } + + break; + + case 0x15: + switch (frame[5]) + { + static int meter_level = 0; + + case 0x07: + frame[6] = ovf_status; + frame[7] = 0xfd; + n = write(fd, frame, 8); + ovf_status = ovf_status == 0 ? 1 : 0; + break; + + case 0x11: + printf("Using meter level %d\n", meter_level); + meter_level += 10; + + if (meter_level > 250) { meter_level = 0; } + + to_bcd(&frame[6], (long long)meter_level, 2); + frame[8] = 0xfd; + n = write(fd, frame, 9); + break; + } + + case 0x16: + switch (frame[5]) + { + case 0x5a: + if (frame[6] == 0xfe) + { + satmode = frame[6]; + } + else + { + frame[6] = satmode; + frame[7] = 0xfd; + n = write(fd, frame, 8); + } + + break; + } + + break; + + case 0x18: // miscellaneous things + frame[5] = 1; + frame[6] = 0xfd; + n = write(fd, frame, 7); + break; + + case 0x1a: // miscellaneous things + switch (frame[5]) + { + case 0x03: // width + if (current_vfo == RIG_VFO_A || current_vfo == RIG_VFO_MAIN) { frame[6] = filterA; } + + frame[7] = 0xfd; + n = write(fd, frame, 8); + break; + + case 0x04: // AGC TIME + printf("frame[6]==x%02x, frame[7]=0%02x\n", frame[6], frame[7]); + + if (frame[6] == 0xfd) // the we are reading + { + frame[6] = agc_time; + frame[7] = 0xfd; + n = write(fd, frame, 8); + } + else + { + printf("AGC_TIME RESPONSE******************************"); + agc_time = frame[6]; + frame[4] = 0xfb; + frame[5] = 0xfd; + n = write(fd, frame, 6); + } + + break; + + case 0x07: // satmode + frame[4] = 0; + frame[7] = 0xfd; + n = write(fd, frame, 8); + break; + + } + + break; + + case 0x1c: + switch (frame[5]) + { + case 0: + if (frame[6] == 0xfd) + { + frame[6] = ptt; + frame[7] = 0xfd; + n = write(fd, frame, 8); + } + else + { + ptt = frame[6]; + frame[7] = 0xfb; + frame[8] = 0xfd; + n = write(fd, frame, 9); + } + + break; + + } + + break; + + case 0x25: + frame[4] = 0xfa; + frame[5] = 0xfd; + break; + + case 0x26: + frame[4] = 0xfa; + frame[5] = 0xfd; + break; + + default: printf("cmd 0x%02x unknown\n", frame[4]); + } + + if (n == 0) { printf("Write failed?\n"); } + +// don't care about the rig type yet + +} + +#if defined(WIN32) || defined(_WIN32) +int openPort(char *comport) // doesn't matter for using pts devices +{ + int fd; + fd = open(comport, O_RDWR); + + if (fd < 0) + { + perror(comport); + } + + return fd; +} + +#else +int openPort(char *comport) // doesn't matter for using pts devices +{ + int fd = posix_openpt(O_RDWR); + char *name = ptsname(fd); + + if (name == NULL) + { + perror("pstname"); + return -1; + } + + printf("name=%s\n", name); + + if (fd == -1 || grantpt(fd) == -1 || unlockpt(fd) == -1) + { + perror("posix_openpt"); + return -1; + } + + return fd; +} +#endif + +void rigStatus() +{ + char vfoa = current_vfo == RIG_VFO_A ? '*' : ' '; + char vfob = current_vfo == RIG_VFO_B ? '*' : ' '; + printf("%cVFOA: mode=%d filter=%d freq=%.0f\n", vfoa, modeA, + filterA, + freqA); + printf("%cVFOB: mode=%d filter=%d freq=%.0f\n", vfob, modeB, + filterA, + freqB); +} + +int main(int argc, char **argv) +{ + unsigned char buf[256]; + int fd = openPort(argv[1]); + + printf("%s: %s\n", argv[0], rig_version()); +#if defined(WIN32) || defined(_WIN32) + + if (argc != 2) + { + printf("Missing comport argument\n"); + printf("%s [comport]\n", argv[0]); + exit(1); + } + +#endif + + while (1) + { + int len = frameGet(fd, buf); + + if (len <= 0) + { + close(fd); + fd = openPort(argv[1]); + } + + if (powerstat) + { + frameParse(fd, buf, len); + } + else + { + usleep(1000 * 1000); + } + + rigStatus(); + } + + return 0; +} ----------------------------------------------------------------------- Summary of changes: NEWS | 30 +------ simulators/Makefile.am | 2 +- simulators/{simicom9700.c => simid5100.c} | 144 +++++------------------------- tests/Makefile.am | 4 - 4 files changed, 25 insertions(+), 155 deletions(-) copy simulators/{simicom9700.c => simid5100.c} (73%) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: n0nb <n0...@us...> - 2023-04-05 01:57:34
|
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.5.5 has been updated via 9bf8066b836399507e0ae5cbed3f6c07a16de938 (commit) via 4ab3aaf3588d92c9d1d116cfa48f747737c834f4 (commit) via ddf11623148650e91c88eee0f29dad116c53d50d (commit) via ceb51534c59a1da24c8720ebd3b4e14b5fc20f73 (commit) via bab6dbe548ac9f6f91c4367a260749ef9cb49873 (commit) via df70d0f9dac6f9e58c5e4fbfcf25d0268962e2d1 (commit) via 6595a2587c4403cfe736d11c0521bd019cafefd5 (commit) via c240bd1cd095a0fc5f2eed66481404cf30435b16 (commit) via ee987bc88e9712ade2bf4353e9bd50bccba50d54 (commit) via 7fa8b6889b1612e992f8d42a3293e63dd2e83f90 (commit) via e0af8c0a7a4c3a4d1d266705af46ced5f910ae2b (commit) via 3fa423c63dd19a47bd48cc60eac9b08f4a48caca (commit) via 9fc5ec5035921c174061bafcfb610cbf1f73ea46 (commit) via fe2ebcb06f83991f6c5f3057fb49adef59bf4ad3 (commit) via 4a08058186220b74f72d8e4beca3848dfe414ba5 (commit) via a73f8ae4825236b1e7160b7c2f1e7c39808a892a (commit) via a1abda197ed2a691d9834fb88331b30af72edd15 (commit) via 471a247a99bc2982211b935758ef54651fe14277 (commit) via fd05de48aac1bcd58bcc4a38b10cf50cf0dfd2c9 (commit) via c67f53ee7987cef3d0d1d0f3475849a62ece3e22 (commit) via d03cdcef83ce9ced5752e109513b59453fa4a53c (commit) via 38502218e1ca66b44dcfb235dba167378adbfdcb (commit) via e05f154a8db6c000674afd2dc03c1e0a47ccccff (commit) via d946b80a4dcb7bc99fda25eee1716a9ae15772a5 (commit) via 165b5514cd0ae2f0bf0511e56f909c57c0959117 (commit) via d47a0279c9204ecd73edb63485f192f4fc3ba498 (commit) via a3a1b4c6be38cffaa502c558fafdfb62678ee1b4 (commit) via 41c90b759e00b80431d45d0786d4421036be164e (commit) via c11955154573160e90d466a87425891650763332 (commit) via 252a0c2bd73daf1a1b75f2f1d205b237f1b10f3e (commit) via afb909271524c638b60c66b8906aeb8f198617cc (commit) via 1b7649d49e6bf33bc5a177711cdd1fea3cbbe0b8 (commit) via ccb879df9492d382a0bb87aebd6102f528c42eae (commit) via 9b3ee663fba2c25442811897a3fb73ec25416776 (commit) via 9ee5afbcf6a1326610114341f90c2c566950d203 (commit) via 1f25aab7858b4e7d8a681781accc93906e197448 (commit) via 5c21f0e790a1948e9a9a7c6cb465af1bac543272 (commit) via 73bbb072c14f62c629096e15a474d21393ad016e (commit) via de0c60563c7feafbd9d6a493bef770dadf5374ec (commit) via 8217088293483bb1f9966b35a91c1dc67bfa8187 (commit) via d82d2d35257d0bbdecd599dbb80d27bde8a0ac4a (commit) via 5b8621606f1af28f18180e03a962ed97742ef1e1 (commit) via 2a0145d77b87813274ec5609404a69b4914c891f (commit) from 88f6eb29a8d29900f8486f550566f6628a64c12b (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 9bf8066b836399507e0ae5cbed3f6c07a16de938 Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Mar 30 22:28:09 2023 -0500 Add error message when rig is not turned on that mentions auto_power_on diff --git a/src/rig.c b/src/rig.c index efe2811c..c5352418 100644 --- a/src/rig.c +++ b/src/rig.c @@ -1266,7 +1266,12 @@ int HAMLIB_API rig_open(RIG *rig) powerstat_t powerflag; status = rig_get_powerstat(rig, &powerflag); - if (status == RIG_OK && powerflag == RIG_POWER_OFF && rig->state.auto_power_on == 0) { return (-RIG_EPOWER); } + if (status == RIG_OK && powerflag == RIG_POWER_OFF && rig->state.auto_power_on == 0) + { + rig_debug(RIG_DEBUG_ERR, "%s: rig power is off, use --set-conf=auto_power_on if power on is wanted\n", __func__); + + return (-RIG_EPOWER); + } // don't need auto_power_on if power is already on if (status == RIG_OK && powerflag == RIG_POWER_ON) { rig->state.auto_power_on = 0; } commit 4ab3aaf3588d92c9d1d116cfa48f747737c834f4 Author: Mike Black W9MDB <mdb...@ya...> Date: Wed Mar 29 08:46:05 2023 -0500 Update NEWS diff --git a/NEWS b/NEWS index 562c1a21..73af32a6 100644 --- a/NEWS +++ b/NEWS @@ -31,6 +31,8 @@ Version 4.6 * Fix FTDX3000 rig split Version 4.5.5 + * Add park to rotorez.c + * Fix rig power on/off from rigctl cmd line and rigctld * Enable async mode by default to prevent WSJT-X crash on IC9700 with transceive on * Fix IC7610 get_powerstat to disable it -- cannot read power status * Fix K3 K22 command error for remote operations @@ -47,7 +49,7 @@ Version 4.5.5 * Add fix for TMD700 * Improve FT-857 get_vfo response when error occurs * Allow FT-857 to use cached vfo on get_vfo when error occurs reading EEPROM - * Fix FTDX10 FT710 set_level AFy + * Fix FTDX10 FT710 set_level AF * Fix FT-450D detection * Fix VFO A/B swapping for gpredict -- hopefully better behavior for VFO swapping rigs Should avoid setting RX freq while TX and avoid TX freq while RX commit ddf11623148650e91c88eee0f29dad116c53d50d Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Mar 28 10:43:07 2023 -0500 Fix auto_power_on from rigctl invocation with --set-conf=auto_power_on=1 https://github.com/Hamlib/Hamlib/issues/1220 diff --git a/src/rig.c b/src/rig.c index e4886f17..efe2811c 100644 --- a/src/rig.c +++ b/src/rig.c @@ -1266,7 +1266,7 @@ int HAMLIB_API rig_open(RIG *rig) powerstat_t powerflag; status = rig_get_powerstat(rig, &powerflag); - if (status == RIG_OK && powerflag == RIG_POWER_OFF) { return (-RIG_EPOWER); } + if (status == RIG_OK && powerflag == RIG_POWER_OFF && rig->state.auto_power_on == 0) { return (-RIG_EPOWER); } // don't need auto_power_on if power is already on if (status == RIG_OK && powerflag == RIG_POWER_ON) { rig->state.auto_power_on = 0; } commit ceb51534c59a1da24c8720ebd3b4e14b5fc20f73 Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Mar 28 10:24:31 2023 -0500 Fix PS0; command in newcat.c https://github.com/Hamlib/Hamlib/issues/1220 diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 4250bff4..b1090abb 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -3560,9 +3560,8 @@ int newcat_set_powerstat(RIG *rig, powerstat_t status) case RIG_POWER_OFF: case RIG_POWER_STANDBY: - ps = '0'; - write_block(&state->rigport, (unsigned char *) "PS0;", 4); - break; + retval = write_block(&state->rigport, (unsigned char *) "PS0;", 4); + RETURNFUNC(retval); default: RETURNFUNC(-RIG_ENAVAIL); diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h index 1844e9c9..441914ca 100644 --- a/rigs/yaesu/newcat.h +++ b/rigs/yaesu/newcat.h @@ -50,7 +50,7 @@ typedef char ncboolean; /* shared function version */ -#define NEWCAT_VER "20230228" +#define NEWCAT_VER "20230328" /* Hopefully large enough for future use, 128 chars plus '\0' */ #define NEWCAT_DATA_LEN 129 commit bab6dbe548ac9f6f91c4367a260749ef9cb49873 Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Mar 28 09:43:26 2023 -0500 Fix rigctld get_powerstat https://github.com/Hamlib/Hamlib/issues/1220 diff --git a/rigs/dummy/netrigctl.c b/rigs/dummy/netrigctl.c index ad90419e..1f9ec6fd 100644 --- a/rigs/dummy/netrigctl.c +++ b/rigs/dummy/netrigctl.c @@ -2054,7 +2054,7 @@ static int netrigctl_get_powerstat(RIG *rig, powerstat_t *status) ret = netrigctl_transaction(rig, cmd, strlen(cmd), buf); - if (ret == 0) + if (ret > 0) { *status = atoi(buf); } @@ -2736,7 +2736,7 @@ struct rig_caps netrigctl_caps = RIG_MODEL(RIG_MODEL_NETRIGCTL), .model_name = "NET rigctl", .mfg_name = "Hamlib", - .version = "20230117.0", + .version = "20230328.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_OTHER, commit df70d0f9dac6f9e58c5e4fbfcf25d0268962e2d1 Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Mar 27 10:04:59 2023 -0500 Enable async by default -- this prevents WSJT-X from crashing when transceive mode is on for the IC9700 https://github.com/Hamlib/Hamlib/issues/1264 diff --git a/NEWS b/NEWS index 40fb1a52..562c1a21 100644 --- a/NEWS +++ b/NEWS @@ -31,6 +31,7 @@ Version 4.6 * Fix FTDX3000 rig split Version 4.5.5 + * Enable async mode by default to prevent WSJT-X crash on IC9700 with transceive on * Fix IC7610 get_powerstat to disable it -- cannot read power status * Fix K3 K22 command error for remote operations * Fix Gemini DX1200 gemini_set_level diff --git a/src/rig.c b/src/rig.c index da0198e2..e4886f17 100644 --- a/src/rig.c +++ b/src/rig.c @@ -552,7 +552,7 @@ RIG *HAMLIB_API rig_init(rig_model_t rig_model) #endif rs->priv = NULL; - rs->async_data_enabled = 0; + rs->async_data_enabled = 1; rs->rigport.fd = -1; rs->pttport.fd = -1; rs->comm_state = 0; commit 6595a2587c4403cfe736d11c0521bd019cafefd5 Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Mar 25 12:38:24 2023 -0500 Update NEWS diff --git a/NEWS b/NEWS index 97d1c51b..40fb1a52 100644 --- a/NEWS +++ b/NEWS @@ -31,6 +31,7 @@ Version 4.6 * Fix FTDX3000 rig split Version 4.5.5 + * Fix IC7610 get_powerstat to disable it -- cannot read power status * Fix K3 K22 command error for remote operations * Fix Gemini DX1200 gemini_set_level * Fix async I/O to not call flush commit c240bd1cd095a0fc5f2eed66481404cf30435b16 Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Mar 25 11:20:52 2023 -0500 Fix IC-7160 get_powerstat to disable it...cannot read power status from 7610 diff --git a/rigs/icom/ic7610.c b/rigs/icom/ic7610.c index c0322780..742e945b 100644 --- a/rigs/icom/ic7610.c +++ b/rigs/icom/ic7610.c @@ -350,7 +350,7 @@ const struct rig_caps ic7610_caps = RIG_MODEL(RIG_MODEL_IC7610), .model_name = "IC-7610", .mfg_name = "Icom", - .version = BACKEND_VER ".9", + .version = BACKEND_VER ".11", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -582,7 +582,8 @@ const struct rig_caps ic7610_caps = .set_split_vfo = icom_set_split_vfo, .get_split_vfo = icom_get_split_vfo, .set_powerstat = icom_set_powerstat, - .get_powerstat = icom_get_powerstat, + // 7610 cannot read power status apparently +// .get_powerstat = icom_get_powerstat, .send_morse = icom_send_morse, .stop_morse = icom_stop_morse, .wait_morse = rig_wait_morse, commit ee987bc88e9712ade2bf4353e9bd50bccba50d54 Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Mar 18 23:43:36 2023 -0500 Update NEWS diff --git a/NEWS b/NEWS index dd593da1..97d1c51b 100644 --- a/NEWS +++ b/NEWS @@ -31,6 +31,7 @@ Version 4.6 * Fix FTDX3000 rig split Version 4.5.5 + * Fix K3 K22 command error for remote operations * Fix Gemini DX1200 gemini_set_level * Fix async I/O to not call flush * Change EX startup commands for Yaesu rigs to allow errors...Win4Yaesu not recognizing EX commands commit 7fa8b6889b1612e992f8d42a3293e63dd2e83f90 Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Mar 18 23:40:45 2023 -0500 For K3 prevent ID; command from K22; command Remote ops was having a problem with K22; https://github.com/Hamlib/Hamlib/issues/1254 diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index 8188c1ac..b3f9398b 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -342,9 +342,13 @@ transaction_write: skip |= strncmp(cmdstr, "RU", 2) == 0; skip |= strncmp(cmdstr, "RD", 2) == 0; skip |= strncmp(cmdstr, "KYW", 3) == 0; + skip |= strncmp(cmdstr, "PS1", 3) == 0; + skip |= strncmp(cmdstr, "PS0", 3) == 0; + skip |= strncmp(cmdstr, "K22", 3) == 0; if (skip) { + hl_usleep(200*1000); // give little settle time for these commands goto transaction_quit; } } diff --git a/rigs/kenwood/kenwood.h b/rigs/kenwood/kenwood.h index 66e64f12..1c97ddc5 100644 --- a/rigs/kenwood/kenwood.h +++ b/rigs/kenwood/kenwood.h @@ -29,7 +29,7 @@ #include "misc.h" #include "idx_builtin.h" -#define BACKEND_VER "20230208" +#define BACKEND_VER "20230318" #define EOM_KEN ';' #define EOM_TH '\r' commit e0af8c0a7a4c3a4d1d266705af46ced5f910ae2b Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Mar 18 22:21:07 2023 -0500 Update NEWS diff --git a/NEWS b/NEWS index ac260aa3..dd593da1 100644 --- a/NEWS +++ b/NEWS @@ -13,6 +13,7 @@ Version 5.x -- future * Change FT1000MP Mark V model names to align with FT1000MP Version 4.6 + * Add saebrtrack rotor https://sites.google.com/site/marklhammond/saebrtrack * Add offset_vfoa and offset_vfob applying to rig_set_freq * Fix K4 to put it in K40 mode when requesting ID * 2023-11-XX -- Planned for Nov 2023 @@ -30,6 +31,8 @@ Version 4.6 * Fix FTDX3000 rig split Version 4.5.5 + * Fix Gemini DX1200 gemini_set_level + * Fix async I/O to not call flush * Change EX startup commands for Yaesu rigs to allow errors...Win4Yaesu not recognizing EX commands * Fix jst145 set_freq and get_freq * Restore tcflush as some odd behavior was seen that tclush fixes commit 3fa423c63dd19a47bd48cc60eac9b08f4a48caca Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Mar 18 22:18:50 2023 -0500 Fix Gemini DX1200 gemini_set_level function diff --git a/amplifiers/gemini/dx1200.c b/amplifiers/gemini/dx1200.c index ed9786e7..e0a23cc0 100644 --- a/amplifiers/gemini/dx1200.c +++ b/amplifiers/gemini/dx1200.c @@ -61,9 +61,9 @@ const struct amp_caps gemini_amp_caps = AMP_MODEL(AMP_MODEL_GEMINI_DX1200), .model_name = "DX1200/HF-1K", .mfg_name = "Gemini", - .version = "20220710.0", + .version = "20230318.0", .copyright = "LGPL", - .status = RIG_STATUS_ALPHA, + .status = RIG_STATUS_BETA, .amp_type = AMP_TYPE_OTHER, .port_type = RIG_PORT_NETWORK, .write_delay = 0, diff --git a/amplifiers/gemini/gemini.c b/amplifiers/gemini/gemini.c index b105cdcd..7d3f1e4a 100644 --- a/amplifiers/gemini/gemini.c +++ b/amplifiers/gemini/gemini.c @@ -282,13 +282,12 @@ int gemini_set_level(AMP *amp, setting_t level, value_t val) if (val.f < .67) { cmd = "PM\n"; } - return RIG_OK; break; } retval = gemini_transaction(amp, cmd, NULL, 0); - if (retval != RIG_OK) { return retval; } + if (retval == RIG_OK) { return retval; } rig_debug(RIG_DEBUG_ERR, "%s: Unknown level=%s\n", __func__, rig_strlevel(level)); commit 9fc5ec5035921c174061bafcfb610cbf1f73ea46 Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Mar 16 16:41:35 2023 -0500 Fix spelling error in rotctl.c help and add offset settings to rotctl.1 diff --git a/doc/man1/rotctl.1 b/doc/man1/rotctl.1 index a85d8e1a..f947223a 100644 --- a/doc/man1/rotctl.1 +++ b/doc/man1/rotctl.1 @@ -23,6 +23,8 @@ rotctl \- control antenna rotators .OP \-s baud .OP \-t char .OP \-C parm=val +.OP \-o azoffset +.OP \-O eloffset .RB [ \-v [ \-Z ]] .RB [ command | \- ] .YS @@ -131,6 +133,15 @@ The semicolon (\(oq;\(cq) is a common terminator for rotators that accept ASCII character strings. . .TP +.BR \-o ", " \-\-set\-azoffset +Azimuth correction floating point -- during set value is added, during get value is subtracted. +. +.TP +.BR \-O ", " \-\-set\-eloffset +Elevation correction floating point -- during set value is added, during get value is subtracted. +. +. +.TP .BR \-L ", " \-\-show\-conf List all configuration parameters for the rotator defined with .B \-m diff --git a/tests/rotctl.c b/tests/rotctl.c index f8dd99aa..50a1c621 100644 --- a/tests/rotctl.c +++ b/tests/rotctl.c @@ -509,8 +509,8 @@ void usage() " -s, --serial-speed=BAUD set serial speed of the serial port\n" " -t, --send-cmd-term=CHAR set send_cmd command termination char\n" " -C, --set-conf=PARM=VAL set config parameters\n" - " -o, --set-azoffset==VAL set offset for azimuth\n" - " -O, --set-eloffset==VAL set offset for elevation\n" + " -o, --set-azoffset=VAL set offset for azimuth\n" + " -O, --set-eloffset=VAL set offset for elevation\n" " -L, --show-conf list all config parameters\n" " -l, --list list all model numbers and exit\n" " -u, --dump-caps dump capabilities and exit\n" commit fe2ebcb06f83991f6c5f3057fb49adef59bf4ad3 Author: Michael Black <mdb...@ya...> Date: Wed Mar 8 15:31:58 2023 -0600 Merge pull request #1244 from mikaelnousiainen/ts2000-fixes Improve Kenwood TS-2000 backend diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index c2b71dc6..8188c1ac 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -3133,7 +3133,15 @@ int kenwood_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) case RIG_LEVEL_AF: { - int vfo_set = vfo == RIG_VFO_A || vfo == RIG_VFO_MAIN ? 0 : 1; + int vfo_num; + if (RIG_IS_TS2000) + { + vfo_num = (vfo == RIG_VFO_C) ? 1 : 0; + } + else + { + vfo_num = (vfo == RIG_VFO_A || vfo == RIG_VFO_MAIN) ? 0 : 1; + } // some rigs only recognize 0 for vfo_set // https://github.com/Hamlib/Hamlib/issues/304 @@ -3151,7 +3159,7 @@ int kenwood_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) break; case 3: - SNPRINTF(levelbuf, sizeof(levelbuf), "AG%d%03d", vfo_set, kenwood_val); + SNPRINTF(levelbuf, sizeof(levelbuf), "AG%d%03d", vfo_num, kenwood_val); break; default: @@ -3192,10 +3200,21 @@ int kenwood_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) SNPRINTF(levelbuf, sizeof(levelbuf), "RG%03d", kenwood_val); break; - case RIG_LEVEL_SQL: - /* Default to RX#0 */ - SNPRINTF(levelbuf, sizeof(levelbuf), "SQ0%03d", kenwood_val); + case RIG_LEVEL_SQL: { + int vfo_num; + if (RIG_IS_TS2000) + { + vfo_num = (vfo == RIG_VFO_C) ? 1 : 0; + } + else + { + /* Default to RX#0 */ + vfo_num = 0; + } + + SNPRINTF(levelbuf, sizeof(levelbuf), "SQ%d%03d", vfo_num, kenwood_val); break; + } case RIG_LEVEL_AGC: SNPRINTF(levelbuf, sizeof(levelbuf), "GT%03d", 84 * kenwood_val); @@ -3397,6 +3416,7 @@ int get_kenwood_level(RIG *rig, const char *cmd, float *fval, int *ival) */ int kenwood_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) { + char cmdbuf[8]; char lvlbuf[KENWOOD_MAX_BUF_LEN]; char *cmd; int retval; @@ -3423,6 +3443,18 @@ int kenwood_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) cmd = "SM0"; len = 3; } + else if (RIG_IS_TS2000) + { + len = 3; + if (vfo == RIG_VFO_C) + { + cmd = "SM1"; + } + else + { + cmd = "SM0"; + } + } else { cmd = "SM"; @@ -3436,16 +3468,31 @@ int kenwood_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) RETURNFUNC(retval); } - /* XXX atoi ? */ - sscanf(lvlbuf + len, "%d", &val->i); /* rawstr */ + sscanf(lvlbuf + len, "%d", &val->i); break; - case RIG_LEVEL_STRENGTH: + case RIG_LEVEL_STRENGTH: { + int multiplier = 1; + if (RIG_IS_TS590S || RIG_IS_TS590SG || RIG_IS_TS480) { cmd = "SM0"; len = 3; } + else if (RIG_IS_TS2000) + { + len = 3; + if (vfo == RIG_VFO_C) + { + cmd = "SM1"; + // TS-2000 sub-transceiver S-meter range is half of the main one + multiplier = 2; + } + else + { + cmd = "SM0"; + } + } else { cmd = "SM"; @@ -3459,7 +3506,8 @@ int kenwood_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) RETURNFUNC(retval); } - sscanf(lvlbuf + len, "%d", &val->i); /* rawstr */ + sscanf(lvlbuf + len, "%d", &val->i); + val->i *= multiplier; if (rig->caps->str_cal.size) { @@ -3469,8 +3517,47 @@ int kenwood_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) { val->i = (val->i * 4) - 54; } - break; + } + + case RIG_LEVEL_SQL: { + int ack_len; + int vfo_num; + + if (RIG_IS_TS2000) + { + vfo_num = (vfo == RIG_VFO_C) ? 1 : 0; + } + else + { + /* Default to RX#0 */ + vfo_num = 0; + } + + SNPRINTF(cmdbuf, sizeof(cmdbuf), "SQ%c", vfo_num); + retval = kenwood_transaction(rig, cmdbuf, lvlbuf, sizeof(lvlbuf)); + len = 6; + + if (retval != RIG_OK) + { + return retval; + } + + ack_len = strlen(lvlbuf); + + if (ack_len != len) + { + return -RIG_EPROTO; + } + + if (sscanf(&lvlbuf[len - 3], "%d", &lvl) != 1) + { + return -RIG_EPROTO; + } + + val->f = (float) lvl / 255.f; + return RIG_OK; + } case RIG_LEVEL_ATT: len = RIG_IS_TS890S ? 3 : 6; @@ -3564,8 +3651,8 @@ int kenwood_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) val->f = (power_now - power_min) / (float)(power_max - power_min); RETURNFUNC(RIG_OK); - case RIG_LEVEL_AF: - + case RIG_LEVEL_AF: { + int vfo_num; // first time through we'll determine the AG format // Can be "AG" "AG0" or "AG0/1" // This could be done by rig but easy enough to make it automagic @@ -3622,6 +3709,15 @@ int kenwood_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) RETURNFUNC(RIG_OK); // this is non-fatal for no))w } + if (RIG_IS_TS2000) + { + vfo_num = (vfo == RIG_VFO_C) ? 1 : 0; + } + else + { + vfo_num = (vfo == RIG_VFO_A || vfo == RIG_VFO_MAIN) ? 0 : 1; + } + switch (priv->ag_format) { case 0: @@ -3630,16 +3726,16 @@ int kenwood_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) break; case 1: - RETURNFUNC(get_kenwood_level(rig, "AG", &val->f, NULL)); + retval = get_kenwood_level(rig, "AG", &val->f, NULL); break; case 2: - RETURNFUNC(get_kenwood_level(rig, "AG0", &val->f, NULL)); + retval = get_kenwood_level(rig, "AG0", &val->f, NULL); break; case 3: - RETURNFUNC(get_kenwood_level(rig, vfo == RIG_VFO_MAIN ? "AG0" : "AG1", &val->f, - NULL)); + SNPRINTF(cmdbuf, sizeof(cmdbuf), "AG%d", vfo_num); + retval = get_kenwood_level(rig, cmdbuf, &val->f,NULL); break; default: @@ -3648,11 +3744,12 @@ int kenwood_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) RETURNFUNC(-RIG_EPROTO); } + RETURNFUNC(retval); + } + case RIG_LEVEL_RF: RETURNFUNC(get_kenwood_level(rig, "RG", &val->f, NULL)); - - case RIG_LEVEL_MICGAIN: { int micgain_now; @@ -4452,7 +4549,7 @@ int kenwood_get_ctcss_sql(RIG *rig, vfo_t vfo, tone_t *tone) } else { - SNPRINTF(cmd, sizeof(cmd), "CT"); + SNPRINTF(cmd, sizeof(cmd), "CN"); offs = 2; } @@ -4588,6 +4685,7 @@ int kenwood_get_ant(RIG *rig, vfo_t vfo, ant_t dummy, value_t *option, char ackbuf[8]; int offs; int retval; + char antenna; ENTERFUNC; @@ -4612,12 +4710,22 @@ int kenwood_get_ant(RIG *rig, vfo_t vfo, ant_t dummy, value_t *option, RETURNFUNC(retval); } - if (ackbuf[offs] < '1' || ackbuf[offs] > '9') + antenna = ackbuf[offs]; + + if (antenna < '0' || antenna > '9') { RETURNFUNC(-RIG_EPROTO); } - *ant_curr = RIG_ANT_N(ackbuf[offs] - '1'); + if (antenna == '0') + { + // At least TS-2000 return AN0 on VHF/UHF bands + *ant_curr = RIG_ANT_1; + } + else + { + *ant_curr = RIG_ANT_N(ackbuf[offs] - '1'); + } /* XXX check that the returned antenna is valid for the current rig */ @@ -4658,17 +4766,41 @@ int kenwood_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) ENTERFUNC; rig_debug(RIG_DEBUG_VERBOSE, "%s: ptt=%d\n", __func__, ptt); - switch (ptt) + if (RIG_IS_TS2000) { - case RIG_PTT_ON: ptt_cmd = "TX"; break; - - case RIG_PTT_ON_MIC: ptt_cmd = "TX0"; break; - - case RIG_PTT_ON_DATA: ptt_cmd = "TX1"; break; - - case RIG_PTT_OFF: ptt_cmd = "RX"; break; - - default: RETURNFUNC(-RIG_EINVAL); + switch (ptt) + { + case RIG_PTT_ON: + case RIG_PTT_ON_MIC: + case RIG_PTT_ON_DATA: + ptt_cmd = (vfo == RIG_VFO_C) ? "TX1" : "TX0"; + break; + case RIG_PTT_OFF: + ptt_cmd = "RX"; + break; + default: + RETURNFUNC(-RIG_EINVAL); + } + } + else + { + switch (ptt) + { + case RIG_PTT_ON: + ptt_cmd = "TX"; + break; + case RIG_PTT_ON_MIC: + ptt_cmd = "TX0"; + break; + case RIG_PTT_ON_DATA: + ptt_cmd = "TX1"; + break; + case RIG_PTT_OFF: + ptt_cmd = "RX"; + break; + default: + RETURNFUNC(-RIG_EINVAL); + } } int retval = kenwood_transaction(rig, ptt_cmd, NULL, 0); @@ -4736,8 +4868,8 @@ int kenwood_get_dcd(RIG *rig, vfo_t vfo, dcd_t *dcd) RETURNFUNC(retval); } - if ((RIG_IS_TS990S && RIG_VFO_SUB == vfo) || (RIG_IS_TS2000 - && RIG_VFO_SUB == vfo)) + if ((RIG_IS_TS990S && RIG_VFO_SUB == vfo) || + (RIG_IS_TS2000 && RIG_VFO_C == vfo)) { offs = 3; } diff --git a/rigs/kenwood/ts2000.c b/rigs/kenwood/ts2000.c index 6e70c567..6b0410b4 100644 --- a/rigs/kenwood/ts2000.c +++ b/rigs/kenwood/ts2000.c @@ -1,7 +1,7 @@ /* * Hamlib Kenwood backend - TS2000 description * Copyright (c) 2000-2011 by Stephane Fillod - * + * Copyright (c) 2023 by Mikael Nousiainen * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -26,19 +26,31 @@ #include <hamlib/rig.h> #include "kenwood.h" +#include "token.h" +#include "misc.h" +#include "iofunc.h" +#include "cal.h" -#define TS2000_ALL_MODES (RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_SSB|RIG_MODE_FM|RIG_MODE_RTTY) +#define TS2000_ALL_MODES (RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|RIG_MODE_FM|RIG_MODE_RTTY|RIG_MODE_RTTYR) #define TS2000_OTHER_TX_MODES (RIG_MODE_CW|RIG_MODE_SSB|RIG_MODE_FM|RIG_MODE_RTTY) #define TS2000_AM_TX_MODES RIG_MODE_AM -#define TS2000_FUNC_ALL (RIG_FUNC_TONE|RIG_FUNC_TSQL|RIG_FUNC_BC|RIG_FUNC_NB|RIG_FUNC_NR|RIG_FUNC_ANF|RIG_FUNC_COMP|RIG_FUNC_RIT|RIG_FUNC_XIT) +#define TS2000_LEVEL_GET (RIG_LEVEL_RFPOWER|RIG_LEVEL_AF|RIG_LEVEL_RF|RIG_LEVEL_SQL|RIG_LEVEL_AGC|RIG_LEVEL_MICGAIN|RIG_LEVEL_STRENGTH|RIG_LEVEL_KEYSPD|RIG_LEVEL_CWPITCH| \ + RIG_LEVEL_MONITOR_GAIN|RIG_LEVEL_NB|RIG_LEVEL_NR|RIG_LEVEL_PREAMP|RIG_LEVEL_COMP|RIG_LEVEL_ATT|RIG_LEVEL_VOXDELAY|RIG_LEVEL_VOXGAIN|RIG_LEVEL_BKIN_DLYMS| \ + RIG_LEVEL_METER|RIG_LEVEL_SWR|RIG_LEVEL_COMP_METER|RIG_LEVEL_ALC|RIG_LEVEL_RFPOWER_METER|RIG_LEVEL_SLOPE_HIGH|RIG_LEVEL_SLOPE_LOW) + +#define TS2000_LEVEL_SET (RIG_LEVEL_RFPOWER|RIG_LEVEL_AF|RIG_LEVEL_RF|RIG_LEVEL_SQL|RIG_LEVEL_AGC|RIG_LEVEL_MICGAIN|RIG_LEVEL_KEYSPD|RIG_LEVEL_CWPITCH| \ + RIG_LEVEL_MONITOR_GAIN|RIG_LEVEL_NB|RIG_LEVEL_NR|RIG_LEVEL_PREAMP|RIG_LEVEL_COMP|RIG_LEVEL_ATT|RIG_LEVEL_VOXDELAY|RIG_LEVEL_VOXGAIN|RIG_LEVEL_BKIN_DLYMS| \ + RIG_LEVEL_METER|RIG_LEVEL_SLOPE_HIGH|RIG_LEVEL_SLOPE_LOW) -#define TS2000_LEVEL_ALL (RIG_LEVEL_PREAMP|RIG_LEVEL_ATT|RIG_LEVEL_VOXDELAY|RIG_LEVEL_AF|RIG_LEVEL_RF|RIG_LEVEL_SQL|RIG_LEVEL_CWPITCH|RIG_LEVEL_RFPOWER|RIG_LEVEL_MICGAIN|RIG_LEVEL_KEYSPD|RIG_LEVEL_COMP|RIG_LEVEL_AGC|RIG_LEVEL_BKINDL|RIG_LEVEL_METER|RIG_LEVEL_VOXGAIN|RIG_LEVEL_ANTIVOX|RIG_LEVEL_RAWSTR|RIG_LEVEL_STRENGTH) +#define TS2000_FUNC_ALL (RIG_FUNC_NB|RIG_FUNC_COMP|RIG_FUNC_VOX|RIG_FUNC_NR|RIG_FUNC_NR|RIG_FUNC_BC|RIG_FUNC_BC2|RIG_FUNC_RIT|RIG_FUNC_XIT| \ + RIG_FUNC_TUNER|RIG_FUNC_MON|RIG_FUNC_FBKIN|RIG_FUNC_LOCK|RIG_FUNC_TONE|RIG_FUNC_TSQL|RIG_FUNC_ANF) #define TS2000_MAINVFO (RIG_VFO_A|RIG_VFO_B) #define TS2000_SUBVFO (RIG_VFO_C) -#define TS2000_VFO_OP (RIG_OP_UP|RIG_OP_DOWN|RIG_OP_BAND_UP|RIG_OP_BAND_DOWN) +#define TS2000_VFO_OPS (RIG_OP_UP|RIG_OP_DOWN|RIG_OP_BAND_UP|RIG_OP_BAND_DOWN|RIG_OP_CPY|RIG_OP_TUNE) + #define TS2000_SCAN_OP (RIG_SCAN_VFO) #define TS2000_ANTS (RIG_ANT_1|RIG_ANT_2) @@ -54,11 +66,21 @@ {0x1E, 60}}\ } -/* prototypes */ -static int ts2000_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val); -static int ts2000_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, - int read_only); -static int ts2000_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan); +#define TS2000_SWR_CAL { 5, \ + { \ + { 0, 1.0f }, \ + { 4, 1.5f }, \ + { 8, 2.0f }, \ + { 12, 3.0f }, \ + { 20, 10.0f } \ + } } + +#define TOK_FUNC_NOISE_REDUCTION_2 TOKEN_BACKEND(102) +#define TOK_LEVEL_DSP_RX_EQUALIZER TOKEN_BACKEND(104) +#define TOK_LEVEL_DSP_TX_EQUALIZER TOKEN_BACKEND(105) +#define TOK_LEVEL_DSP_TX_BANDWIDTH TOKEN_BACKEND(106) +#define TOK_LEVEL_BEEP_VOLUME TOKEN_BACKEND(107) +#define TOK_LEVEL_TX_SIDETONE_VOLUME TOKEN_BACKEND(108) /* * 38 CTCSS sub-audible tones + 1750 tone @@ -72,8 +94,6 @@ tone_t ts2000_ctcss_list[] = 0, }; - - /* * 103 available DCS codes */ @@ -91,9 +111,128 @@ tone_t ts2000_dcs_list[] = 0, }; +int ts2000_ext_tokens[] = +{ + TOK_FUNC_NOISE_REDUCTION_2, TOK_FUNC_FILTER_WIDTH_DATA, + TOK_LEVEL_DSP_RX_EQUALIZER, TOK_LEVEL_DSP_TX_EQUALIZER, TOK_LEVEL_DSP_TX_BANDWIDTH, + TOK_LEVEL_BEEP_VOLUME, TOK_LEVEL_TX_SIDETONE_VOLUME, + TOK_BACKEND_NONE, +}; + +const struct confparams ts2000_ext_funcs[] = +{ + { + TOK_FUNC_NOISE_REDUCTION_2, "NR2", "Noise reduction 2", "Noise reduction 2", + NULL, RIG_CONF_CHECKBUTTON, + }, + { RIG_CONF_END, NULL, } +}; + +const struct confparams ts2000_ext_levels[] = +{ + { + TOK_LEVEL_DSP_RX_EQUALIZER, "DSP_RX_EQUALIZER", "DSP RX equalizer", "DSP RX equalizer type", + NULL, RIG_CONF_COMBO, { .c = { .combostr = { "OFF", "H BOOST", "F PASS", "B BOOST", "CONV-EN", "USER", NULL } } } + }, + { + TOK_LEVEL_DSP_TX_EQUALIZER, "DSP_TX_EQUALIZER", "DSP TX equalizer", "DSP TX equalizer type", + NULL, RIG_CONF_COMBO, { .c = { .combostr = { "OFF", "H BOOST", "F PASS", "B BOOST", "CONV-EN", "USER", NULL } } } + }, + { + TOK_LEVEL_DSP_TX_BANDWIDTH, "DSP_TX_BANDWIDTH", "DSP TX bandwidth", "DSP TX bandwidth for SSB and AM", + NULL, RIG_CONF_COMBO, { .c = { .combostr = { "2.0 kHz", "2.2 kHz", "2.4 kHz", "2.6 kHz", "2.8 kHz", "3.0 kHz", NULL } } } + }, + { + TOK_LEVEL_BEEP_VOLUME, "BEEP_VOLUME", "Beep volume", "Beep volume", + NULL, RIG_CONF_NUMERIC, { .n = { .min = 0, .max = 9, .step = 1 } } + }, + { + TOK_LEVEL_TX_SIDETONE_VOLUME, "TX_SIDETONE_VOLUME", "TX sidetone volume", "TX sidetone volume", + NULL, RIG_CONF_NUMERIC, { .n = { .min = 0, .max = 9, .step = 1 } } + }, + { RIG_CONF_END, NULL, } +}; + +static struct kenwood_filter_width ts2000_filter_width[] = +{ + { RIG_MODE_CW | RIG_MODE_CWR, 50, 50 }, + { RIG_MODE_CW | RIG_MODE_CWR, 80, 80 }, + { RIG_MODE_CW | RIG_MODE_CWR, 100, 100 }, + { RIG_MODE_CW | RIG_MODE_CWR, 150, 150 }, + { RIG_MODE_CW | RIG_MODE_CWR, 200, 200 }, + { RIG_MODE_CW | RIG_MODE_CWR, 300, 300 }, + { RIG_MODE_CW | RIG_MODE_CWR, 400, 400 }, + { RIG_MODE_CW | RIG_MODE_CWR, 500, 500 }, + { RIG_MODE_CW | RIG_MODE_CWR, 600, 600 }, + { RIG_MODE_CW | RIG_MODE_CWR, 1000, 1000 }, + { RIG_MODE_CW | RIG_MODE_CWR, 2000, 2000 }, + { RIG_MODE_RTTY | RIG_MODE_RTTYR, 250, 250 }, + { RIG_MODE_RTTY | RIG_MODE_RTTYR, 500, 500 }, + { RIG_MODE_RTTY | RIG_MODE_RTTYR, 1000, 1000 }, + { RIG_MODE_RTTY | RIG_MODE_RTTYR, 1500, 1500 }, + { RIG_MODE_SSB, 0, 2400 }, + { RIG_MODE_SSB, 1, 500 }, // NAR1 optional filter + { RIG_MODE_SSB, 2, 270 }, // NAR2 optional filter + { RIG_MODE_FM, 0, 6000 }, + { RIG_MODE_FM, 1, 12000 }, + { RIG_MODE_AM, 0, 2400 }, + { RIG_MODE_AM, 1, 6000 }, // NAR1 optional filter (?) + { RIG_MODE_NONE, -1, -1 }, +}; + +static struct kenwood_slope_filter ts2000_slope_filter_high[] = +{ + { RIG_MODE_SSB | RIG_MODE_FM | RIG_MODE_RTTY | RIG_MODE_RTTYR, 0, 0, 1400 }, + { RIG_MODE_SSB | RIG_MODE_FM | RIG_MODE_RTTY | RIG_MODE_RTTYR, 0, 1, 1600 }, + { RIG_MODE_SSB | RIG_MODE_FM | RIG_MODE_RTTY | RIG_MODE_RTTYR, 0, 2, 1800 }, + { RIG_MODE_SSB | RIG_MODE_FM | RIG_MODE_RTTY | RIG_MODE_RTTYR, 0, 3, 2000 }, + { RIG_MODE_SSB | RIG_MODE_FM | RIG_MODE_RTTY | RIG_MODE_RTTYR, 0, 4, 2200 }, + { RIG_MODE_SSB | RIG_MODE_FM | RIG_MODE_RTTY | RIG_MODE_RTTYR, 0, 5, 2400 }, + { RIG_MODE_SSB | RIG_MODE_FM | RIG_MODE_RTTY | RIG_MODE_RTTYR, 0, 6, 2600 }, + { RIG_MODE_SSB | RIG_MODE_FM | RIG_MODE_RTTY | RIG_MODE_RTTYR, 0, 7, 2800 }, + { RIG_MODE_SSB | RIG_MODE_FM | RIG_MODE_RTTY | RIG_MODE_RTTYR, 0, 8, 3000 }, + { RIG_MODE_SSB | RIG_MODE_FM | RIG_MODE_RTTY | RIG_MODE_RTTYR, 0, 9, 3400 }, + { RIG_MODE_SSB | RIG_MODE_FM | RIG_MODE_RTTY | RIG_MODE_RTTYR, 0, 10, 4000 }, + { RIG_MODE_SSB | RIG_MODE_FM | RIG_MODE_RTTY | RIG_MODE_RTTYR, 0, 11, 5000 }, + { RIG_MODE_AM, 0, 0, 2500 }, + { RIG_MODE_AM, 0, 1, 3000 }, + { RIG_MODE_AM, 0, 2, 4000 }, + { RIG_MODE_AM, 0, 3, 5000 }, + { RIG_MODE_SSB | RIG_MODE_RTTY | RIG_MODE_RTTYR | RIG_MODE_FM | RIG_MODE_AM, 1, 0, 170 }, + { RIG_MODE_SSB | RIG_MODE_RTTY | RIG_MODE_RTTYR | RIG_MODE_FM | RIG_MODE_AM, 1, 1, 1930 }, + { RIG_MODE_SSB | RIG_MODE_RTTY | RIG_MODE_RTTYR | RIG_MODE_FM | RIG_MODE_AM, 1, 2, 2160 }, + { RIG_MODE_NONE, 0, -1, -1 }, +}; + +static struct kenwood_slope_filter ts2000_slope_filter_low[] = +{ + { RIG_MODE_SSB | RIG_MODE_FM | RIG_MODE_RTTY | RIG_MODE_RTTYR, 0, 0, 0 }, + { RIG_MODE_SSB | RIG_MODE_FM | RIG_MODE_RTTY | RIG_MODE_RTTYR, 0, 1, 50 }, + { RIG_MODE_SSB | RIG_MODE_FM | RIG_MODE_RTTY | RIG_MODE_RTTYR, 0, 2, 100 }, + { RIG_MODE_SSB | RIG_MODE_FM | RIG_MODE_RTTY | RIG_MODE_RTTYR, 0, 3, 200 }, + { RIG_MODE_SSB | RIG_MODE_FM | RIG_MODE_RTTY | RIG_MODE_RTTYR, 0, 4, 300 }, + { RIG_MODE_SSB | RIG_MODE_FM | RIG_MODE_RTTY | RIG_MODE_RTTYR, 0, 5, 400 }, + { RIG_MODE_SSB | RIG_MODE_FM | RIG_MODE_RTTY | RIG_MODE_RTTYR, 0, 6, 500 }, + { RIG_MODE_SSB | RIG_MODE_FM | RIG_MODE_RTTY | RIG_MODE_RTTYR, 0, 7, 600 }, + { RIG_MODE_SSB | RIG_MODE_FM | RIG_MODE_RTTY | RIG_MODE_RTTYR, 0, 8, 700 }, + { RIG_MODE_SSB | RIG_MODE_FM | RIG_MODE_RTTY | RIG_MODE_RTTYR, 0, 9, 800 }, + { RIG_MODE_SSB | RIG_MODE_FM | RIG_MODE_RTTY | RIG_MODE_RTTYR, 0, 10, 900 }, + { RIG_MODE_SSB | RIG_MODE_FM | RIG_MODE_RTTY | RIG_MODE_RTTYR, 10, 1, 1000 }, + { RIG_MODE_AM, 0, 0, 0 }, + { RIG_MODE_AM, 0, 1, 100 }, + { RIG_MODE_AM, 0, 2, 200 }, + { RIG_MODE_AM, 0, 3, 500 }, + { RIG_MODE_SSB | RIG_MODE_RTTY | RIG_MODE_RTTYR | RIG_MODE_FM | RIG_MODE_AM, 1, 0, 2500 }, + { RIG_MODE_SSB | RIG_MODE_RTTY | RIG_MODE_RTTYR | RIG_MODE_FM | RIG_MODE_AM, 1, 1, 1000 }, + { RIG_MODE_NONE, 0, -1, -1 }, +}; + static struct kenwood_priv_caps ts2000_priv_caps = { .cmdtrm = EOM_KEN, + .filter_width = ts2000_filter_width, + .slope_filter_high = ts2000_slope_filter_high, + .slope_filter_low = ts2000_slope_filter_low, }; /* memory capabilities */ @@ -118,1059 +257,1650 @@ static struct kenwood_priv_caps ts2000_priv_caps = /* - * ts2000 rig capabilities. - * - * part of infos comes from http://www.kenwood.net/ + * Function definitions below */ -const struct rig_caps ts2000_caps = + +int ts2000_init(RIG *rig) { - RIG_MODEL(RIG_MODEL_TS2000), - .model_name = "TS-2000", - .mfg_name = "Kenwood", - .version = BACKEND_VER ".0", - .copyright = "LGPL", - .status = RIG_STATUS_STABLE, - .rig_type = RIG_TYPE_TRANSCEIVER, - .ptt_type = RIG_PTT_RIG, - .dcd_type = RIG_DCD_RIG, - .port_type = RIG_PORT_SERIAL, - .serial_rate_min = 1200, - .serial_rate_max = 57600, - .serial_data_bits = 8, - .serial_stop_bits = 1, - .serial_parity = RIG_PARITY_NONE, - .serial_handshake = RIG_HANDSHAKE_NONE, - .write_delay = 0, - .post_write_delay = 0, /* ms */ - .timeout = 200, - .retry = 10, + struct kenwood_priv_data *priv; + int retval; - .has_get_func = TS2000_FUNC_ALL, - .has_set_func = TS2000_FUNC_ALL, - .has_get_level = TS2000_LEVEL_ALL, - .has_set_level = RIG_LEVEL_SET(TS2000_LEVEL_ALL), - .has_get_parm = RIG_PARM_NONE, - .has_set_parm = RIG_PARM_NONE, /* FIXME: parms */ - .level_gran = + ENTERFUNC; + + retval = kenwood_init(rig); + + if (retval != RIG_OK) { -#include "level_gran_kenwood.h" - }, - .parm_gran = {}, - .vfo_ops = TS2000_VFO_OP, - .scan_ops = TS2000_SCAN_OP, - .ctcss_list = ts2000_ctcss_list, - .dcs_list = ts2000_dcs_list, - .preamp = { 20, RIG_DBLST_END, }, /* FIXME: real preamp? */ - .attenuator = { 20, RIG_DBLST_END, }, - .max_rit = kHz(20), - .max_xit = kHz(20), - .max_ifshift = kHz(1), - .targetable_vfo = RIG_TARGETABLE_FREQ, - .transceive = RIG_TRN_RIG, - .agc_level_count = 5, - .agc_levels = { RIG_AGC_OFF, RIG_AGC_SLOW, RIG_AGC_MEDIUM, RIG_AGC_FAST, RIG_AGC_ON }, - .bank_qty = 0, - .chan_desc_sz = 7, + return retval; + } - .chan_list = { - { 0, 299, RIG_MTYPE_MEM, TS2000_MEM_CAP }, - RIG_CHAN_END, - }, + priv = (struct kenwood_priv_data *) rig->state.priv; - .rx_range_list1 = { - {kHz(300), MHz(60), TS2000_ALL_MODES, -1, -1, TS2000_MAINVFO, TS2000_ANTS}, - {MHz(144), MHz(146), TS2000_ALL_MODES, -1, -1, TS2000_MAINVFO}, - {MHz(430), MHz(440), TS2000_ALL_MODES, -1, -1, TS2000_MAINVFO}, - {MHz(144), MHz(146), TS2000_ALL_MODES, -1, -1, TS2000_SUBVFO}, - {MHz(430), MHz(440), TS2000_ALL_MODES, -1, -1, TS2000_SUBVFO}, - RIG_FRNG_END, - }, /* rx range */ - .tx_range_list1 = { - {kHz(1830), kHz(1850), TS2000_OTHER_TX_MODES, W(5), W(100), TS2000_MAINVFO, TS2000_ANTS}, - {kHz(1830), kHz(1850), TS2000_AM_TX_MODES, 2000, 25000, TS2000_MAINVFO, TS2000_ANTS}, - {kHz(3500), kHz(3800), TS2000_OTHER_TX_MODES, W(5), W(100), TS2000_MAINVFO, TS2000_ANTS}, - {kHz(3500), kHz(3800), TS2000_AM_TX_MODES, W(5), W(25), TS2000_MAINVFO, TS2000_ANTS}, - {MHz(7), kHz(7100), TS2000_OTHER_TX_MODES, W(5), W(100), TS2000_MAINVFO, TS2000_ANTS}, - {MHz(7), kHz(7100), TS2000_AM_TX_MODES, W(5), W(25), TS2000_MAINVFO, TS2000_ANTS}, - {MHz(10.1), MHz(10.15), TS2000_OTHER_TX_MODES, W(5), W(100), TS2000_MAINVFO, TS2000_ANTS}, - {MHz(10.1), MHz(10.15), TS2000_AM_TX_MODES, W(5), W(25), TS2000_MAINVFO, TS2000_ANTS}, - {MHz(14), kHz(14350), TS2000_OTHER_TX_MODES, W(5), W(100), TS2000_MAINVFO, TS2000_ANTS}, - {MHz(14), kHz(14350), TS2000_AM_TX_MODES, W(5), W(25), TS2000_MAINVFO, TS2000_ANTS}, - {kHz(18068), kHz(18168), TS2000_OTHER_TX_MODES, W(5), W(100), TS2000_MAINVFO, TS2000_ANTS}, - {kHz(18068), kHz(18168), TS2000_AM_TX_MODES, W(5), W(25), TS2000_MAINVFO, TS2000_ANTS}, - {MHz(21), kHz(21450), TS2000_OTHER_TX_MODES, W(5), W(100), TS2000_MAINVFO, TS2000_ANTS}, - {MHz(21), kHz(21450), TS2000_AM_TX_MODES, W(5), W(25), TS2000_MAINVFO, TS2000_ANTS}, - {kHz(24890), kHz(24990), TS2000_OTHER_TX_MODES, W(5), W(100), TS2000_MAINVFO, TS2000_ANTS}, - {kHz(24890), kHz(24990), TS2000_AM_TX_MODES, W(5), W(25), TS2000_MAINVFO, TS2000_ANTS}, - {MHz(28), kHz(29700), TS2000_OTHER_TX_MODES, W(5), W(100), TS2000_MAINVFO, TS2000_ANTS}, - {MHz(28), kHz(29700), TS2000_AM_TX_MODES, W(5), W(25), TS2000_MAINVFO, TS2000_ANTS}, - {MHz(50), MHz(50.2), TS2000_OTHER_TX_MODES, W(5), W(100), TS2000_MAINVFO, TS2000_ANTS}, - {MHz(50), MHz(50.2), TS2000_AM_TX_MODES, W(5), W(25), TS2000_MAINVFO, TS2000_ANTS}, - {MHz(144), MHz(146), TS2000_OTHER_TX_MODES, W(5), W(100), TS2000_MAINVFO}, - {MHz(144), MHz(146), TS2000_AM_TX_MODES, W(5), W(25), TS2000_MAINVFO}, - {MHz(430), MHz(440), TS2000_OTHER_TX_MODES, W(5), W(50), TS2000_MAINVFO}, - {MHz(430), MHz(440), TS2000_AM_TX_MODES, W(5), W(12.5), TS2000_MAINVFO}, - RIG_FRNG_END, - }, /* tx range */ + priv->ag_format = 3; + priv->micgain_min = 0; + priv->micgain_max = 100; - .rx_range_list2 = { - {kHz(300), MHz(60), TS2000_ALL_MODES, -1, -1, TS2000_MAINVFO, TS2000_ANTS}, - {MHz(142), MHz(152), TS2000_ALL_MODES, -1, -1, TS2000_MAINVFO}, - {MHz(420), MHz(450), TS2000_ALL_MODES, -1, -1, TS2000_MAINVFO}, - {MHz(118), MHz(174), TS2000_ALL_MODES, -1, -1, TS2000_SUBVFO}, - {MHz(220), MHz(512), TS2000_ALL_MODES, -1, -1, TS2000_SUBVFO}, - RIG_FRNG_END, - }, /* rx range */ - .tx_range_list2 = { - {kHz(1800), MHz(2), TS2000_OTHER_TX_MODES, W(5), W(100), TS2000_MAINVFO, TS2000_ANTS}, - {kHz(1800), MHz(2), TS2000_AM_TX_MODES, 2000, 25000, TS2000_MAINVFO, TS2000_ANTS}, - {kHz(3500), MHz(4), TS2000_OTHER_TX_MODES, W(5), W(100), TS2000_MAINVFO, TS2000_ANTS}, - {kHz(3500), MHz(4), TS2000_AM_TX_MODES, W(5), W(25), TS2000_MAINVFO, TS2000_ANTS}, - {MHz(7), kHz(7300), TS2000_OTHER_TX_MODES, W(5), W(100), TS2000_MAINVFO, TS2000_ANTS}, - {MHz(7), kHz(7300), TS2000_AM_TX_MODES, W(5), W(25), TS2000_MAINVFO, TS2000_ANTS}, - {MHz(10.1), MHz(10.15), TS2000_OTHER_TX_MODES, W(5), W(100), TS2000_MAINVFO, TS2000_ANTS}, - {MHz(10.1), MHz(10.15), TS2000_AM_TX_MODES, W(5), W(25), TS2000_MAINVFO, TS2000_ANTS}, - {MHz(14), kHz(14350), TS2000_OTHER_TX_MODES, W(5), W(100), TS2000_MAINVFO, TS2000_ANTS}, - {MHz(14), kHz(14350), TS2000_AM_TX_MODES, W(5), W(25), TS2000_MAINVFO, TS2000_ANTS}, - {kHz(18068), kHz(18168), TS2000_OTHER_TX_MODES, W(5), W(100), TS2000_MAINVFO, TS2000_ANTS}, - {kHz(18068), kHz(18168), TS2000_AM_TX_MODES, W(5), W(25), TS2000_MAINVFO, TS2000_ANTS}, - {MHz(21), kHz(21450), TS2000_OTHER_TX_MODES, W(5), W(100), TS2000_MAINVFO, TS2000_ANTS}, - {MHz(21), kHz(21450), TS2000_AM_TX_MODES, W(5), W(25), TS2000_MAINVFO, TS2000_ANTS}, - {kHz(24890), kHz(24990), TS2000_OTHER_TX_MODES, W(5), W(100), TS2000_MAINVFO, TS2000_ANTS}, - {kHz(24890), kHz(24990), TS2000_AM_TX_MODES, W(5), W(25), TS2000_MAINVFO, TS2000_ANTS}, - {MHz(28), kHz(29700), TS2000_OTHER_TX_MODES, W(5), W(100), TS2000_MAINVFO, TS2000_ANTS}, - {MHz(28), kHz(29700), TS2000_AM_TX_MODES, W(5), W(25), TS2000_MAINVFO, TS2000_ANTS}, - {MHz(50), MHz(54), TS2000_OTHER_TX_MODES, W(5), W(100), TS2000_MAINVFO, TS2000_ANTS}, - {MHz(50), MHz(54), TS2000_AM_TX_MODES, W(5), W(25), TS2000_MAINVFO, TS2000_ANTS}, - {MHz(144), MHz(148), TS2000_OTHER_TX_MODES, W(5), W(100), TS2000_MAINVFO}, - {MHz(144), MHz(148), TS2000_AM_TX_MODES, W(5), W(25), TS2000_MAINVFO}, - {MHz(430), MHz(450), TS2000_OTHER_TX_MODES, W(5), W(50), TS2000_MAINVFO}, - {MHz(430), MHz(450), TS2000_AM_TX_MODES, W(5), W(12.5), TS2000_MAINVFO}, - RIG_FRNG_END, - }, /* tx range */ - .tuning_steps = { - {RIG_MODE_SSB | RIG_MODE_CW | RIG_MODE_RTTY, 1}, - {TS2000_ALL_MODES, 10}, - {TS2000_ALL_MODES, 100}, - {TS2000_ALL_MODES, kHz(1)}, - {TS2000_ALL_MODES, kHz(2.5)}, - {TS2000_ALL_MODES, kHz(5)}, - {RIG_MODE_AM | RIG_MODE_FM, kHz(6.25)}, - {TS2000_ALL_MODES, kHz(10)}, - {RIG_MODE_AM | RIG_MODE_FM, kHz(12.5)}, - {RIG_MODE_AM | RIG_MODE_FM, kHz(12.5)}, - {RIG_MODE_AM | RIG_MODE_FM, kHz(15)}, - {RIG_MODE_AM | RIG_MODE_FM, kHz(20)}, - {RIG_MODE_AM | RIG_MODE_FM, kHz(25)}, - {RIG_MODE_AM | RIG_MODE_FM, kHz(30)}, - {RIG_MODE_AM | RIG_MODE_FM, kHz(50)}, - {RIG_MODE_AM | RIG_MODE_FM, kHz(100)}, - {TS2000_ALL_MODES, MHz(1)}, - {TS2000_ALL_MODES, 0}, /* any tuning step */ - RIG_TS_END, - }, + RETURNFUNC(RIG_OK); +} - /* mode/filter list, remember: order matters! */ - .filters = { - {RIG_MODE_SSB, kHz(2.2)}, - {RIG_MODE_CW, Hz(600)}, - {RIG_MODE_RTTY, Hz(1500)}, - {RIG_MODE_AM, kHz(6)}, - {RIG_MODE_FM | RIG_MODE_AM, kHz(12)}, - RIG_FLT_END, - }, +static int ts2000_set_ex_menu(RIG *rig, int number, int value_len, int value) +{ + char buf[20]; - .str_cal = TS2000_STR_CAL, + ENTERFUNC; - .priv = (void *)& ts2000_priv_caps, + SNPRINTF(buf, sizeof(buf), "EX%03d0000%0*d", number, value_len, value); - .rig_init = kenwood_init, - .rig_open = kenwood_open, - .rig_close = kenwood_close, - .rig_cleanup = kenwood_cleanup, - .set_freq = kenwood_set_freq, - .get_freq = kenwood_get_freq, - .set_rit = kenwood_set_rit, - .get_rit = kenwood_get_rit, - .set_xit = kenwood_set_xit, - .get_xit = kenwood_get_xit, - .set_mode = kenwood_set_mode, - .get_mode = kenwood_get_mode, - .set_vfo = kenwood_set_vfo, - .get_vfo = kenwood_get_vfo_if, - .set_split_vfo = kenwood_set_split_vfo, - .get_split_vfo = kenwood_get_split_vfo_if, - .set_ctcss_tone = kenwood_set_ctcss_tone_tn, - .get_ctcss_tone = kenwood_get_ctcss_tone, - .set_ctcss_sql = kenwood_set_ctcss_sql, - .get_ctcss_sql = kenwood_get_ctcss_sql, - .get_ptt = kenwood_get_ptt, - .set_ptt = kenwood_set_ptt, - .get_dcd = kenwood_get_dcd, - .set_func = kenwood_set_func, - .get_func = kenwood_get_func, - .set_level = kenwood_set_level, - .get_level = ts2000_get_level, - .set_ant = kenwood_set_ant, - .get_ant = kenwood_get_ant, - .send_morse = kenwood_send_morse, - .wait_morse = rig_wait_morse, - .vfo_op = kenwood_vfo_op, - .scan = kenwood_scan, - .set_mem = kenwood_set_mem, - .get_mem = kenwood_get_mem, - .get_channel = ts2000_get_channel, - .set_channel = ts2000_set_channel, - .set_trn = kenwood_set_trn, - .get_trn = kenwood_get_trn, - .set_powerstat = kenwood_set_powerstat, - .get_powerstat = kenwood_get_powerstat, - .get_info = kenwood_get_info, - .reset = kenwood_reset, + RETURNFUNC(kenwood_transaction(rig, buf, NULL, 0)); +} - .hamlib_check_rig_caps = HAMLIB_CHECK_RIG_CAPS -}; +static int ts2000_get_ex_menu(RIG *rig, int number, int value_len, int *value) +{ + int retval; + char buf[20]; + char ackbuf[20]; -/* - * Function definitions below - */ + rig_debug(RIG_DEBUG_TRACE, "%s called\n", __func__); -/* - * ts2000_get_channel - * Read command format: - M|R|P1|P2|P3|P3|;| - * P1: 0 - RX frequency, 1 - TX frequency - Memory channel 290 ~ 299: P1=0 (start frequency), P1=1 (end frequency) - P2 - bank number - allowed values: <space>, 0, 1 or 2 - P3 - channel number 00-99 + SNPRINTF(buf, sizeof(buf), "EX%03d0000", number); - Returned value: - M | R |P1 |P2 |P3 |P3 |P4 |P4 |P4 |P4 | - P4 |P4 |P4 |P4 |P4 |P4 |P4 |P5 |P6 |P7 | - P8 |P8 |P9 |P9 |P10|P10|P10|P11|P12|P13| - P13|P13|P13|P13|P13|P13|P13|P13|P14|P14| - P15|P16|P16|P16|P16|P16|P16|P16|P16| ; | - P1 - P3 described above - P4: Frequency in Hz (11-digit). - P5: Mode. 1: LSB, 2: USB, 3: CW, 4: FM, 5: AM, 6: FSK, 7: CR-R, 8: Reserved, 9: FSK-R - P6: Lockout status. 0: Lockout OFF, 1: Lockout ON. - P7: 0: OFF, 1: TONE, 2: CTCSS, 3: DCS. - P8: Tone Number. Allowed values 01 (67Hz) - 38 (250.3Hz) - P9: CTCSS tone number. Allowed values 01 (67Hz) - 38 (250.3Hz) - P10: DCS code. Allowed values 000 (023 DCS code) to 103 (754 DCS code). - P11: REVERSE status. - P12: SHIFT status. 0: Simplex, 1: +, 2: –, 3: = (All E-types) - P13: Offset frequency in Hz (9-digit). - Allowed values 000000000 - 059950000 in steps of 50000. Unused digits must be 0. - P14: Step size. Allowed values: - for SSB, CW, FSK mode: 00 - 03 - 00: 1 kHz, 01: 2.5 kHz, 02: 5 kHz, 03: 10 kHz - for AM, FM mode: 00 - 09 - 00: 5 kHz, 01: 6.25 kHz, 02: 10 kHz, 03: 12.5 kHz, 04: 15 kHz, - 05: 20 kHz, 06: 25 kHz, 07: 30 kHz, 08: 50 kHz, 09: 100 kHz - P15: Memory Group number (0 ~ 9). - P16: Memory name. A maximum of 8 characters. - - */ - -int ts2000_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only) -{ - int err; - int tmp; - size_t length; - char buf[52]; - char cmd[8]; - struct kenwood_priv_caps *caps = kenwood_caps(rig); - - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + retval = kenwood_safe_transaction(rig, buf, ackbuf, sizeof(ackbuf), + 9 + value_len); - if (!chan || chan->vfo != RIG_VFO_MEM) + if (retval != RIG_OK) { - return -RIG_EINVAL; + RETURNFUNC2(retval); } - /* put channel num in the command string */ - SNPRINTF(cmd, sizeof(cmd), "MR0%03d;", chan->channel_num); + sscanf(ackbuf + 9, "%d", value); - err = kenwood_transaction(rig, cmd, buf, sizeof(buf)); + RETURNFUNC2(RIG_OK); +} - if (err != RIG_OK) - { - return err; - } +static int ts2000_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) +{ + char buf[20]; - length = strlen(buf); - memset(chan, 0x00, sizeof(channel_t)); + rig_debug(RIG_DEBUG_TRACE, "%s called\n", __func__); - chan->vfo = RIG_VFO_MEM; + switch (func) + { + case RIG_FUNC_MON: + SNPRINTF(buf, sizeof(buf), "ML00%c", (status == 0) ? '0' : '1'); + RETURNFUNC(kenwood_transaction(rig, buf, NULL, 0)); - /* parse from right to left */ + case RIG_FUNC_LOCK: + SNPRINTF(buf, sizeof(buf), "LK%c%c", (status == 0) ? '0' : '1', + (status == 0) ? '0' : '1'); + RETURNFUNC(kenwood_transaction(rig, buf, NULL, 0)); - /* XXX based on the available documentation, there is no command - * to read out the filters of a given memory channel. The rig, however, - * stores this information. - */ - /* First check if a name is assigned. - Name is returned at positions 41-48 (counting from 0) */ - if (length > 41) - { -// rig_debug(RIG_DEBUG_VERBOSE, "Copying channel description: %s\n", &buf[ 41 ] ); - strcpy(chan->channel_desc, &buf[ 41 ]); + default: + return kenwood_set_func(rig, vfo, func, status); } +} - /* Memory group no */ - chan->scan_group = buf[ 40 ] - '0'; - /* Fields 38-39 contain tuning step as a number 00 - 09. - Tuning step depends on this number and the mode, - just save it for now */ - buf[ 40 ] = '\0'; - tmp = atoi(&buf[ 38]); - /* Offset frequency */ - buf[ 38 ] = '\0'; - chan->rptr_offs = atoi(&buf[ 29 ]); +static int ts2000_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status) +{ + char buf[20]; + int retval; - /* Shift type - WARNING: '=' shift type not programmed */ - if (buf[ 28 ] == '1') + ENTERFUNC; + + switch (func) { - chan->rptr_shift = RIG_RPT_SHIFT_PLUS; - } - else + case RIG_FUNC_MON: { - if (buf[ 28 ] == '2') - { - chan->rptr_shift = RIG_RPT_SHIFT_MINUS; - } - else + int raw_value; + retval = kenwood_safe_transaction(rig, "ML", buf, sizeof(buf), 5); + + if (retval != RIG_OK) { - chan->rptr_shift = RIG_RPT_SHIFT_NONE; + RETURNFUNC(retval); } - } - /* Reverse status */ - if (buf[27] == '1') - { - chan->funcs |= RIG_FUNC_REV; - } + sscanf(buf, "ML%d", &raw_value); - /* Check for tone, CTCSS and DCS */ - /* DCS code first */ - if (buf[ 19 ] == '3') - { - if (rig->caps->dcs_list) - { - buf[ 27 ] = '\0'; - chan->dcs_code = rig->caps->dcs_list[ atoi(&buf[ 24 ]) ]; - chan->dcs_sql = chan->dcs_code; - chan->ctcss_tone = 0; - chan->ctcss_sql = 0; - } + *status = (raw_value > 0); + break; } - else - { - chan->dcs_code = 0; - chan->dcs_sql = 0; - /* CTCSS code - Caution, CTCSS codes, unlike DCS codes, are numbered from 1! */ - buf[ 24 ] = '\0'; - if (buf[ 19 ] == '2') - { - chan->funcs |= RIG_FUNC_TSQL; + case RIG_FUNC_LOCK: + retval = kenwood_safe_transaction(rig, "LK", buf, sizeof(buf), 4); - if (rig->caps->ctcss_list) - { - chan->ctcss_sql = rig->caps->ctcss_list[ atoi(&buf[22]) - 1 ]; - chan->ctcss_tone = 0; - } - } - else + if (retval != RIG_OK) { - chan->ctcss_sql = 0; + RETURNFUNC(retval); + } - /* CTCSS tone */ - if (buf[ 19 ] == '1') - { - chan->funcs |= RIG_FUNC_TONE; - buf[ 22 ] = '\0'; + *status = buf[2] != '0' || buf[3] != '0'; + break; - if (rig->caps->ctcss_list) - { - chan->ctcss_tone = rig->caps->ctcss_list[ atoi(&buf[20]) - 1 ]; - } - } - else - { - chan->ctcss_tone = 0; - } - } + default: + return kenwood_get_func(rig, vfo, func, status); } + RETURNFUNC(RIG_OK); +} + +/* + * WARNING: The commands differ slightly from the general versions in kenwood.c + * e.g.: "SQ"=>"SQ0" , "AG"=>"AG0" + */ +static int ts2000_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) +{ + char levelbuf[16]; + int kenwood_val; + char vfo_num = (vfo == RIG_VFO_C) ? '1' : '0'; + + rig_debug(RIG_DEBUG_TRACE, "%s called\n", __func__); - /* memory lockout */ - if (buf[18] == '1') + switch (level) { - chan->flags |= RIG_CHFLAG_SKIP; - } + case RIG_LEVEL_RF: + kenwood_val = val.f * 255; + SNPRINTF(levelbuf, sizeof(levelbuf), "RG%03d", kenwood_val); + break; - /* mode */ - chan->mode = kenwood2rmode(buf[17] - '0', caps->mode_table); + case RIG_LEVEL_AF: + return kenwood_set_level(rig, vfo, level, val); - /* Now we have the mode, let's finish the tuning step */ - if ((chan->mode == RIG_MODE_AM) || (chan->mode == RIG_MODE_FM)) - { - switch (tmp) + case RIG_LEVEL_SQL: + kenwood_val = val.f * 255; + SNPRINTF(levelbuf, sizeof(levelbuf), "SQ%c%03d", vfo_num, kenwood_val); + break; + + case RIG_LEVEL_AGC: + /* Possible values for TS-2000 are 0(=off)-020(=slow) */ + + switch (val.i) { - case 0: chan->tuning_step = kHz(5); break; + case RIG_AGC_OFF: + kenwood_val = 0; + break; - case 1: chan->tuning_step = kHz(6.25); break; + case RIG_AGC_SUPERFAST: + kenwood_val = 1; + break; - case 2: chan->tuning_step = kHz(10); break; + case RIG_AGC_FAST: + kenwood_val = 5; + break; - case 3: chan->tuning_step = kHz(12.5); break; + case RIG_AGC_MEDIUM: + kenwood_val = 10; + break; - case 4: chan->tuning_step = kHz(15); break; + case RIG_AGC_SLOW: + kenwood_val = 20; + break; - case 5: chan->tuning_step = kHz(20); break; + default: + rig_debug(RIG_DEBUG_ERR, "%s: unsupported agc value", __func__); + return -RIG_EINVAL; + } - case 6: chan->tuning_step = kHz(25); break; + SNPRINTF(levelbuf, sizeof(levelbuf), "GT%03d", kenwood_val); + break; - case 7: chan->tuning_step = kHz(30); break; + case RIG_LEVEL_MONITOR_GAIN: + kenwood_val = val.f * 9.0; + SNPRINTF(levelbuf, sizeof(levelbuf), "ML%03d", kenwood_val); + break; - case 8: chan->tuning_step = kHz(50); break; + case RIG_LEVEL_NB: + kenwood_val = val.f * 10.0; + SNPRINTF(levelbuf, sizeof(levelbuf), "NL%03d", kenwood_val); + break; - case 9: chan->tuning_step = kHz(100); break; + case RIG_LEVEL_NR: + kenwood_val = val.f * 9.0; + SNPRINTF(levelbuf, sizeof(levelbuf), "RL%02d", kenwood_val); + break; - default: chan->tuning_step = 0; + case RIG_LEVEL_PREAMP: + if (val.i != 12 && val.i != 0) + { + RETURNFUNC(-RIG_EINVAL); } - } - else - { - switch (tmp) + + SNPRINTF(levelbuf, sizeof(levelbuf), "PA%c", (val.i == 12) ? '1' : '0'); + break; + + case RIG_LEVEL_ATT: + if (val.i != 12 && val.i != 0) { - case 0: chan->tuning_step = kHz(1); break; + RETURNFUNC(-RIG_EINVAL); + } - case 1: chan->tuning_step = kHz(2.5); break; + SNPRINTF(levelbuf, sizeof(levelbuf), "RA%02d", (val.i == 12) ? 1 : 0); + break; - case 2: chan->tuning_step = kHz(5); break; + case RIG_LEVEL_METER: + switch (val.i) + { + case RIG_METER_SWR: + kenwood_val = 1; + break; - case 3: chan->tuning_step = kHz(10); break; + case RIG_METER_COMP: + kenwood_val = 2; + break; - default: chan->tuning_step = 0; + case RIG_METER_ALC: + kenwood_val = 3; + break; + + default: + RETURNFUNC(-RIG_EINVAL); } - } - /* Frequency */ - buf[17] = '\0'; - chan->freq = atoi(&buf[6]); + SNPRINTF(levelbuf, sizeof(levelbuf), "RM%d", kenwood_val); + break; - if (chan->freq == RIG_FREQ_NONE) - { - return -RIG_ENAVAIL; + case RIG_LEVEL_CWPITCH: + if (val.i > 1000 || val.i < 400) + { + RETURNFUNC(-RIG_EINVAL); + } + + RETURNFUNC(ts2000_set_ex_menu(rig, 31, 2, (val.i - 400) / 50)); + + default: + return kenwood_set_level(rig, vfo, level, val); } - buf[6] = '\0'; - chan->channel_num = atoi(&buf[3]); + return kenwood_transaction(rig, levelbuf, NULL, 0); +} +// TS-2000 can only read one meter at a time and the user must select +// the meter using RIG_LEVEL_METER. This function returns the meter value if +// the selected meter matches the expected meter. +static int ts2000_read_meter(RIG *rig, int expected_meter, int *value) +{ + int retval; + char cmdbuf[8]; + struct rig_state *rs = &rig->state; + char ackbuf[32]; + int expected_len = 8; + int read_meter; + int read_value; - /* Check split freq */ - cmd[2] = '1'; - err = kenwood_transaction(rig, cmd, buf, sizeof(buf)); + ENTERFUNC; - if (err != RIG_OK) + SNPRINTF(cmdbuf, sizeof(cmdbuf), "RM;"); + + retval = write_block(&rs->rigport, (unsigned char *) cmdbuf, strlen(cmdbuf)); + + rig_debug(RIG_DEBUG_TRACE, "%s: write_block retval=%d\n", __func__, retval); + + if (retval != RIG_OK) { - return err; + RETURNFUNC(retval); } - chan->tx_mode = kenwood2rmode(buf[17] - '0', caps->mode_table); + // TS-2000 returns values for a single meter at the same ti... [truncated message content] |
From: n0nb <n0...@us...> - 2023-04-05 01:53:27
|
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 99170c10259dbe0b4903ce6ce3d47bac623769de (commit) via 3053263c5203d4c1a6c9e3fef59dcc80423a4647 (commit) via 38d685869827a0cdad53a726bc2a51a2015356a7 (commit) via 1ec7dc07ec96aee27ed8c24ea5f72b75cec59646 (commit) via 7236942d89d6f6dca2b163f9073c48c09fd3a7c2 (commit) via c331899d94424bffd4ad4d5b214ad7249f55b08a (commit) via 9d7ac000e5e315b25d484d5bdd109cc026af801d (commit) via 8d407320648445a50b98119aae53ed5081a617b5 (commit) via f11db5c94955b87e7f2f0ce4b935d3d2f851ebed (commit) via bbda209fc0ab7bf1e139b253d165900729e7f4d6 (commit) via 7395ef0e3f1e34ae43f01a4938f021cd3f2c0fde (commit) via 403ec07b6b5c7d68d1382bbf99ed960524e136c3 (commit) via 79db09c201ea25abb07f0c363819f7c4eaab4161 (commit) via 224820fb44c262c9c966becc9afa795c165808cc (commit) via 5aab96beff06f89feacef864eb1d0d107d0a06eb (commit) via d34983f495520e2136f150dd93000f729f3d9d57 (commit) via d522967b320a93bc01529bd0ebb0b3a97f6acc6f (commit) via 692deca638a548d464ba102cc50910531f19bb23 (commit) via 30b2087f5d3b80ce8badf7d860d98908df5a5d59 (commit) via 2db37fe7dbca630a95c2437cd4de8500cd80b838 (commit) via dd75f55b1fcb3ef1e3e9049dfe8af5a4f1e3af67 (commit) via ac197389a2fdd958c6566a3a235fa2aaf4172594 (commit) via 8cce59b048158e92a32a455d1f30b82a968e57fb (commit) via 8cdb21b6f385e36cd3c5381817108cc0435f0b32 (commit) via 7914842c2dfeef3b9cd4e752c404b71b5ce53935 (commit) via 9f960fa5317aa98942d89243e6ecc2c69b92b4ac (commit) via 2712c57058b05723cb5b3ee523755052391c9eab (commit) via d893de407ebac2529709d244b2a1c129790e6691 (commit) via 56907442abd2e86940a0659a2d22e1cd9f01baa0 (commit) via cf956daf17ee0099b9151002ece37ce1d268f911 (commit) via 3254ac70a1583f04b6b165a8d526e930a97c4d93 (commit) via 0f0bbeb612b322f8929385e821c8f6d5689627e7 (commit) via 558747fab36994493aaa12c0fcfa1011aa0cdcb4 (commit) via 4004046d49a6880a0a11a8bcc5e25142c17d25ae (commit) via 26d3e79cf5dc3fbca64a6fd6c68ed58fdcfbaa3c (commit) via 8e24746a3e14d0e3ed78e42d37a5132b99573b1e (commit) via 3c94527fb6a33db6a1f70955bc56e86da6be95d2 (commit) via 38cc75c5681b932809634724ef1adfefb467461d (commit) via 6de5aa78386a493a64eec12bfcc8814c8e9f8dc7 (commit) via 389ee47f76eb83b0b722f4d1a68caa786870b977 (commit) via 113cad3ee179f1260e234c8f3d5d5711295542cc (commit) via 2adf0490842e14c2f10921235e2288ceb75f29e0 (commit) via 0f7908be22cd238921be2a66fc6389b880514e00 (commit) via 5e00bed9cbbaee517260389bb75be114403973a7 (commit) via fd473062d1813a6fc8660a4cd5e305621a7e52c2 (commit) via 18c4eb46315ef44bdf22f5ac7774ba017e186564 (commit) via e022ff2314016d1ec62b00068f28dea22800a25a (commit) via 01a2dd23ed256eeeb190bbf813232a658b28ffc7 (commit) via 51c88e0a6d0d6e3a3d3b73f4217f7adcee6939c6 (commit) via c3e7021c61fbdad5b83360c0bcdfc26945c825fc (commit) via e9979846623935c217c023b26f2057838b3a153d (commit) via b02ff9daa13a578879d5c41ff0e78e88795a7a02 (commit) via c9e2c5f6972cfbd058ba7d03a405c867c72bdf13 (commit) via c3265dc905058ac7133897121d77f634b6d05853 (commit) via 52d41236a72512fc25a2aad289b87691bafb9788 (commit) via 57b7cd1860ce5bb8c46ab686260a5176a5bced7f (commit) via 24a4a094843c5c149be76277a9ab3704b8b097b7 (commit) via e05eb7743b40acaf3bd942ceb1feb86fc2cc985b (commit) via dff890a143c78e2c7e166cad9b826434a07fee36 (commit) via 9823a41f48ba6ff2d622e88afaa160c7ea9a550a (commit) via 8e08385d2dd31912d1face09eb69772d7b7daaa5 (commit) via a64bb4fc7dc4f6f7c0d65e64cab0ec9cbbd3affb (commit) via 631a7a5faa3327cc14df79934788709f8f41a2fc (commit) via 16f03dcdfb80583fcdac0167f4d03cadae71cdcb (commit) via f5c26bf235c24aa7c1f1f02bf11f06a4c96e2dd3 (commit) via 19b2c33e62a5ee71568ad911dd2b33cd97859153 (commit) via 09a6bbf7c7e97d156cef60db9ecf8c3f51426739 (commit) via 77dd85289c6c9e83546d16ad585167b09b031474 (commit) via 94b8e53be97ddbd05ee2df2186846817f494058f (commit) via f17f6f0f42ce99c130618fa02b4e3955a461b622 (commit) via 0e6fd996bc37a3ec1b14f4896569a88ba7601833 (commit) via 6cf65cc0993054d13d41ac750b7102ae23f20a2a (commit) via 2f68033840def43482389a043fc42ead934cd1d8 (commit) via 95196ca96ca9db98f0cf42f2eba9a8a5d819194e (commit) via ec0645780cfc20a252b31ad84429e77e2e1ebe8f (commit) via 0591aee8e6062bf42e088495abcbdd2b58f5c2fb (commit) via edc18103f005f05c0ad5458970b9da7b96c516a1 (commit) via a8aba7c13b523915cfa554f63de0d8140e3a9cdb (commit) via 2622113d2f7069c93546fd81359a29c9bc7d0604 (commit) via 3d4fe8fead62d864f98ba893108cceb0bafee62a (commit) via d06244c47f4dffdf9f47172385c8dfac738c24e2 (commit) via eb5767c0ca2590d51beb92dd73ecaed35c32df51 (commit) via e428d824cdf238dc028ad13f773f22dbd8a96385 (commit) via 126e7dfefd66e06a7b89fbe6c0944d780d9242af (commit) via 9ad9f23fe170b0277a5045fc7510dd645063bea6 (commit) via decc056662ea892cba32cc35a4a3476b7d383124 (commit) via fe1eabf531f23f9057270a68cc18905567c91c05 (commit) via ee7ecc71a1d2a0945e3629e74b40f1fe60da7ddf (commit) via 07fc69f3e8aa34f463f22dd27e8e25aa5573ec3c (commit) via a9b9154a2d721948f124553b1d952a703f1c268a (commit) via 14aa095362c082ab56d4823fc350a37f2f70dc04 (commit) via 00e2797c6fe44ca1941f374d85aae0095da972e4 (commit) via bc476a1c948a85f8b29554c24e1e9fd349afeb79 (commit) via f161ae7b3507e4417ca05f809ae26d7d4199730f (commit) via f5a1dabd06fd43ddcc3cbf1a3965e36e5d9b5b28 (commit) via a9cb12158471a6235f34658ae6fb7ae754e78809 (commit) via 717dae50272e06b66a447ca80c83df93f4f5c349 (commit) via fb12668f066f837f6ded07398e5c49437d8afd4e (commit) via 514d87dcc9b7bf99225336f0885d68b19667657e (commit) via c0030fa01de4aa20e47425b972bf7bff1206a24b (commit) via 10ac497c0b45757ac7da7bbc84381d551380325c (commit) via fef9737a47d0164399987960432803bfad757f1c (commit) via dbd9ff45fa74df614d5402ab2c1d6a315c7af192 (commit) via 3d38f8b214c9f4398f9623a38eb60ee679244baa (commit) via 1edb21a38dd587f665131367e1df7b9daefd910b (commit) via 51712b9a663b45e7d4c19c41a70bf7a977399b03 (commit) via 51d95bb8f794468e2dc5aa1dff4df11a72968729 (commit) via 3f900869917d618c9433f3cf2030c4db737a1f55 (commit) via cdb3a60f023f4164ff070fc7db877869cf3c3724 (commit) via 52be0797d82da0e2c957b100f9fa8f1e31718bab (commit) via 7673abc59b2b3632d58252818a0486bb62d22f98 (commit) via 420125b8bc5bec3e1d6d3cb1dbdab4fe3c156793 (commit) via 72117308663f97bc7ae396a108f6c5ffd51b2258 (commit) via 72e94b6069a2b1d4ca1e16e37c1e869e137761b8 (commit) via 561f65a56dc7f12d879265dc24298389c39fabb7 (commit) via 1213d874480707d6bb78ad2ff3d1ab6fc74c8592 (commit) via d09c048161d42e237e46f2af23d43a48de044dd7 (commit) via b6fe95ae801084f77d53800ba266b04c06ad203b (commit) via b6ec70fcb2c27f747257dc5626463f8963f2e708 (commit) via a04abe6e04d91dc9c3b1c2ffcee76d5c7b1d617c (commit) via 5c170542957f7584ae2be6c5885f21d87e818a2d (commit) via 2e894dd9cc5a3ee91dbeb27607a624ad189b3561 (commit) via 9dbe4ef79a46a9dedc62e5362ce4acf33608d2df (commit) via 58700c6e9f2526ef6f1f0365f76904887542e2be (commit) via 4078fa9248a1080862c7750bee1e9cfe92576fd2 (commit) via 111627533f3c811d4aa8e282271c8019f635f747 (commit) via f9adf5de0a8ab7908bf295f05a3a1ac1ae6a481d (commit) via cbd5f9ad3ea68952fec121705ce43a79723fa63a (commit) via 1e1abaccbc32e1b2c9e7132b17b168cdea13b4d2 (commit) via 907a178aa670d862bc7d158f2b72527e57f8876c (commit) via 73fc563ceb69b842d7e2ceefb856c7a96a8fac45 (commit) via e9724a905823e09627acd2054836ecd2206ce67f (commit) via 321c3660455e718d8b2abe64b5bfb64879e1d4d9 (commit) via cc7c335dc5b3939b6c28c19f3fa8fdf946d47be7 (commit) via c903c09cd1d4942ba413e787fd141af22c36b196 (commit) via b037c72c50422c3b644efdb46569065375814e94 (commit) via 44e8389e0030606d9b786c110e7dffa60f2af9bc (commit) via 0e9bdc5d043906cb07480191209aef5d5c11f166 (commit) via 1efff461e384ff366df35b438e5295531eae0536 (commit) via c055817c27f58fd98d0bdc6b918c9574ad565290 (commit) via 8c0bb2034d34a2cac7187422688d0b349ebfb1f1 (commit) via fa503c5b3bc7f021e938312e9f0893a3d951bf8d (commit) via 61e4e8d6764e04fb0277fda33f414722530f2b16 (commit) via d645bae2074eca68900c1e7917a8322b8fccf5f6 (commit) from fa4a96e6a6c8e2ad4fcb016d6034ebfc91375a1c (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 99170c10259dbe0b4903ce6ce3d47bac623769de Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Mar 30 22:28:09 2023 -0500 Add error message when rig is not turned on that mentions auto_power_on diff --git a/src/rig.c b/src/rig.c index bb0d1ee2..d08616e4 100644 --- a/src/rig.c +++ b/src/rig.c @@ -1280,7 +1280,12 @@ int HAMLIB_API rig_open(RIG *rig) powerstat_t powerflag; status = rig_get_powerstat(rig, &powerflag); - if (status == RIG_OK && powerflag == RIG_POWER_OFF && rig->state.auto_power_on == 0) { return (-RIG_EPOWER); } + if (status == RIG_OK && powerflag == RIG_POWER_OFF && rig->state.auto_power_on == 0) + { + rig_debug(RIG_DEBUG_ERR, "%s: rig power is off, use --set-conf=auto_power_on if power on is wanted\n", __func__); + + return (-RIG_EPOWER); + } // don't need auto_power_on if power is already on if (status == RIG_OK && powerflag == RIG_POWER_ON) { rig->state.auto_power_on = 0; } commit 3053263c5203d4c1a6c9e3fef59dcc80423a4647 Author: Mike Black W9MDB <mdb...@ya...> Date: Wed Mar 29 08:46:05 2023 -0500 Update NEWS diff --git a/NEWS b/NEWS index 25e5eeb6..d407df76 100644 --- a/NEWS +++ b/NEWS @@ -31,6 +31,8 @@ Version 4.6 * Fix FTDX3000 rig split Version 4.5.5 + * Add park to rotorez.c + * Fix rig power on/off from rigctl cmd line and rigctld * Enable async mode by default to prevent WSJT-X crash on IC9700 with transceive on * Fix IC7610 get_powerstat to disable it -- cannot read power status * Fix K3 K22 command error for remote operations @@ -47,7 +49,7 @@ Version 4.5.5 * Add fix for TMD700 * Improve FT-857 get_vfo response when error occurs * Allow FT-857 to use cached vfo on get_vfo when error occurs reading EEPROM - * Fix FTDX10 FT710 set_level AFy + * Fix FTDX10 FT710 set_level AF * Fix FT-450D detection * Fix VFO A/B swapping for gpredict -- hopefully better behavior for VFO swapping rigs Should avoid setting RX freq while TX and avoid TX freq while RX commit 38d685869827a0cdad53a726bc2a51a2015356a7 Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Mar 28 17:23:54 2023 -0500 Progress on Expert ampctl diff --git a/amplifiers/expert/expert.c b/amplifiers/expert/expert.c index 913ac6db..2be064a9 100644 --- a/amplifiers/expert/expert.c +++ b/amplifiers/expert/expert.c @@ -111,7 +111,7 @@ int expert_transaction(AMP *amp, const unsigned char *cmd, int cmd_len, unsigned int loop; char cmdbuf[64]; int checksum=0; - int bytes; + int bytes = 0; rig_debug(RIG_DEBUG_VERBOSE, "%s called, cmd=%s\n", __func__, cmd); @@ -626,9 +626,6 @@ struct expert_priv_data *expert_priv; * Private helper function prototypes */ -//static int kpa1500_send_priv_cmd(AMP *amp, const char *cmd); -//static int kpa1500_flush_buffer(AMP *amp); - /* ************************************* * * Separate model capabilities @@ -643,7 +640,7 @@ struct expert_priv_data *expert_priv; const struct amp_caps expert_amp_caps = { - AMP_MODEL(AMP_MODEL_ELECRAFT_KPA1500), + AMP_MODEL(AMP_MODEL_EXPERT_FA), .model_name = "1.3K-FA/1.5K-FA/2K-FA", .mfg_name = "Expert", .version = "20230320.0", @@ -693,7 +690,7 @@ const struct amp_caps expert_amp_caps = * Send command string to amplifier */ -static int kpa1500_send_priv_cmd(AMP *amp, const char *cmdstr) +static int expert_send_priv_cmd(AMP *amp, const char *cmdstr) { struct amp_state *rs; int err; diff --git a/src/amp_reg.c b/src/amp_reg.c index 98892790..95187c4a 100644 --- a/src/amp_reg.c +++ b/src/amp_reg.c @@ -89,6 +89,7 @@ static struct { AMP_DUMMY, AMP_BACKEND_DUMMY, AMP_FUNCNAMA(dummy) }, { AMP_ELECRAFT, AMP_BACKEND_ELECRAFT, AMP_FUNCNAMA(kpa1500) }, { AMP_GEMINI, AMP_BACKEND_GEMINI, AMP_FUNCNAMA(gemini) }, + { AMP_EXPERT, AMP_BACKEND_EXPERT, AMP_FUNCNAMA(expert) }, { 0, NULL }, /* end */ }; commit 1ec7dc07ec96aee27ed8c24ea5f72b75cec59646 Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Mar 28 17:14:59 2023 -0500 Fix expert_amp_caps diff --git a/amplifiers/expert/expert.c b/amplifiers/expert/expert.c index 212f447a..913ac6db 100644 --- a/amplifiers/expert/expert.c +++ b/amplifiers/expert/expert.c @@ -641,7 +641,7 @@ struct expert_priv_data *expert_priv; * Expert 1.3K-FA, 1.5K-FA, and 2K-FA */ -const struct amp_caps kpa1500_amp_caps = +const struct amp_caps expert_amp_caps = { AMP_MODEL(AMP_MODEL_ELECRAFT_KPA1500), .model_name = "1.3K-FA/1.5K-FA/2K-FA", commit 7236942d89d6f6dca2b163f9073c48c09fd3a7c2 Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Mar 28 17:08:40 2023 -0500 Adding Expert Linear amplifier diff --git a/amplifiers/expert/expert.c b/amplifiers/expert/expert.c index f66256d4..212f447a 100644 --- a/amplifiers/expert/expert.c +++ b/amplifiers/expert/expert.c @@ -23,6 +23,7 @@ #include <string.h> #include "expert.h" #include "register.h" +#include "misc.h" struct fault_list { @@ -102,12 +103,15 @@ int expert_flushbuffer(AMP *amp) return rig_flush(&rs->ampport); } -int expert_transaction(AMP *amp, const char *cmd, char *response, int response_len) +int expert_transaction(AMP *amp, const unsigned char *cmd, int cmd_len, unsigned char *response, int response_len) { struct amp_state *rs; int err; int len = 0; int loop; + char cmdbuf[64]; + int checksum=0; + int bytes; rig_debug(RIG_DEBUG_VERBOSE, "%s called, cmd=%s\n", __func__, cmd); @@ -117,43 +121,35 @@ int expert_transaction(AMP *amp, const char *cmd, char *response, int response_l rs = &->state; - loop = 3; - - do // wake up the amp by sending ; until we receive ; - { - char c = ';'; - rig_debug(RIG_DEBUG_VERBOSE, "%s waiting for ;\n", __func__); - err = write_block(&rs->ampport, (unsigned char *) &c, 1); - - if (err != RIG_OK) { return err; } - - len = read_string(&rs->ampport, (unsigned char *) response, response_len, ";", - 1, 0, 1); - - if (len < 0) { return len; } - } - while (--loop > 0 && (len != 1 || response[0] != ';')); + cmdbuf[0] = cmdbuf[1] = cmdbuf[2] = 0x55; + memcpy(&cmdbuf,cmd,cmd_len); + for(int i=0;i<cmd_len;++i) checksum += cmd[i]; + checksum = checksum % 256; + cmdbuf[3] = cmd_len; + cmdbuf[3+cmd_len+1] = checksum; // Now send our command - err = write_block(&rs->ampport, (unsigned char *) cmd, strlen(cmd)); + err = write_block(&rs->ampport, (unsigned char *) cmdbuf, 3+cmd_len+2); if (err != RIG_OK) { return err; } if (response) // if response expected get it { response[0] = 0; - len = read_string(&rs->ampport, (unsigned char *) response, response_len, ";", - 1, 0, 1); + // read the 4-byte header x55x55x55xXX where XX is the hex # of bytes + len = read_block_direct(&rs->ampport, (unsigned char *) response, 4); + rig_debug(RIG_DEBUG_ERR, "%s: len=%d, bytes=%02x\n", __func__, len, response[3]); if (len < 0) { - rig_debug(RIG_DEBUG_VERBOSE, "%s called, error=%s\n", __func__, + rig_debug(RIG_DEBUG_VERBOSE, "%s: error=%s\n", __func__, rigerror(len)); return len; } - - rig_debug(RIG_DEBUG_VERBOSE, "%s called, response='%s'\n", __func__, - response); + if (len == 4) bytes = response[3]; + rig_debug(RIG_DEBUG_ERR, "%s: bytes=%d\n", __func__, bytes); + len = read_block_direct(&rs->ampport, (unsigned char *) response, bytes-3 ); + dump_hex(response,len); } else // if no response expected try to get one { @@ -208,7 +204,7 @@ int expert_get_freq(AMP *amp, freq_t *freq) if (!amp) { return -RIG_EINVAL; } - retval = expert_transaction(amp, "^FR;", responsebuf, sizeof(responsebuf)); + retval = expert_transaction(amp, NULL,0, NULL, sizeof(responsebuf)); if (retval != RIG_OK) { return retval; } @@ -231,14 +227,14 @@ int expert_set_freq(AMP *amp, freq_t freq) int retval; unsigned long tfreq; int nargs; - char cmd[KPABUFSZ]; + unsigned char cmd[KPABUFSZ]; rig_debug(RIG_DEBUG_VERBOSE, "%s called, freq=%"PRIfreq"\n", __func__, freq); if (!amp) { return -RIG_EINVAL; } - SNPRINTF(cmd, sizeof(cmd), "^FR%05ld;", (long)freq / 1000); - retval = expert_transaction(amp, cmd, NULL, 0); +// SNPRINTF(cmd, sizeof(cmd), "^FR%05ld;", (long)freq / 1000); + retval = expert_transaction(amp, cmd, 0, NULL, 0); if (retval != RIG_OK) { return retval; } @@ -265,7 +261,7 @@ int expert_set_freq(AMP *amp, freq_t freq) int expert_get_level(AMP *amp, setting_t level, value_t *val) { char responsebuf[KPABUFSZ]; - char *cmd; + unsigned char cmd[8]; int retval; int fault; int i; @@ -284,8 +280,8 @@ int expert_get_level(AMP *amp, setting_t level, value_t *val) rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); // get the current antenna selected - cmd = "^AE;"; - retval = expert_transaction(amp, cmd, responsebuf, sizeof(responsebuf)); + cmd[0] = 0x00; + retval = expert_transaction(amp, cmd, 0, NULL, sizeof(responsebuf)); if (retval != RIG_OK) { return retval; } @@ -305,46 +301,46 @@ int expert_get_level(AMP *amp, setting_t level, value_t *val) switch (level) { case AMP_LEVEL_SWR: - cmd = "^SW;"; + cmd[0] = 0x00; break; case AMP_LEVEL_NH: - cmd = "^DF;"; + cmd[0] = 0x00; break; case AMP_LEVEL_PF: - cmd = "^DF;"; + cmd[0] = 0x00; break; case AMP_LEVEL_PWR_INPUT: - cmd = "^PWI;"; + cmd[0] = 0x00; break; case AMP_LEVEL_PWR_FWD: - cmd = "^PWF;"; + cmd[0] = 0x00; break; case AMP_LEVEL_PWR_REFLECTED: - cmd = "^PWR;"; + cmd[0] = 0x00; break; case AMP_LEVEL_PWR_PEAK: - cmd = "^PWK;"; + cmd[0] = 0x00; break; case AMP_LEVEL_FAULT: - cmd = "^SF;"; + cmd[0] = 0x00; break; } - retval = expert_transaction(amp, cmd, responsebuf, sizeof(responsebuf)); + retval = expert_transaction(amp, cmd, 0, NULL, sizeof(responsebuf)); if (retval != RIG_OK) { return retval; } switch (level) { case AMP_LEVEL_SWR: - nargs = sscanf(responsebuf, "^SW%f", &float_value); + //nargs = sscanf(responsebuf, "^SW%f", &float_value); if (nargs != 1) { @@ -358,7 +354,7 @@ int expert_get_level(AMP *amp, setting_t level, value_t *val) case AMP_LEVEL_NH: case AMP_LEVEL_PF: - nargs = sscanf(responsebuf, "^DF%d,%d", &int_value, &int_value2); + //nargs = sscanf(responsebuf, "^DF%d,%d", &int_value, &int_value2); if (nargs != 2) { @@ -407,7 +403,7 @@ int expert_get_level(AMP *amp, setting_t level, value_t *val) case AMP_LEVEL_PWR_INPUT: - cmd = "^PWI;"; + cmd[0] = 0x00; nargs = sscanf(responsebuf, "^SW%d", &pwrinput); if (nargs != 1) @@ -423,7 +419,7 @@ int expert_get_level(AMP *amp, setting_t level, value_t *val) break; case AMP_LEVEL_PWR_FWD: - cmd = "^PWF;"; + cmd[0] = 0x00; nargs = sscanf(responsebuf, "^SW%d", &pwrfwd); if (nargs != 1) @@ -439,7 +435,7 @@ int expert_get_level(AMP *amp, setting_t level, value_t *val) break; case AMP_LEVEL_PWR_REFLECTED: - cmd = "^PWR;"; + cmd[0] = 0x00; nargs = sscanf(responsebuf, "^SW%d", &pwrref); if (nargs != 1) @@ -455,7 +451,7 @@ int expert_get_level(AMP *amp, setting_t level, value_t *val) break; case AMP_LEVEL_PWR_PEAK: - cmd = "^PWK;"; + cmd[0] = 0x00; nargs = sscanf(responsebuf, "^SW%d", &pwrpeak); if (nargs != 1) @@ -471,7 +467,7 @@ int expert_get_level(AMP *amp, setting_t level, value_t *val) break; case AMP_LEVEL_FAULT: - cmd = "^SF;"; + cmd[0] = 0x00; nargs = sscanf(responsebuf, "^SW%d", &fault); if (nargs != 1) @@ -509,11 +505,11 @@ int expert_get_level(AMP *amp, setting_t level, value_t *val) int expert_get_powerstat(AMP *amp, powerstat_t *status) { - char responsebuf[KPABUFSZ]; + unsigned char responsebuf[KPABUFSZ]; int retval; - int operate; - int ampon; - int nargs; + int operate = 0; + int ampon = 0; + int nargs = 0; rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); @@ -522,11 +518,11 @@ int expert_get_powerstat(AMP *amp, powerstat_t *status) if (!amp) { return -RIG_EINVAL; } - retval = expert_transaction(amp, "^ON;", responsebuf, sizeof(responsebuf)); + retval = expert_transaction(amp, NULL, 0, responsebuf, sizeof(responsebuf)); if (retval != RIG_OK) { return retval; } - nargs = sscanf(responsebuf, "^ON%d", &on); + //nargs = sscanf(responsebuf, "^ON%d", &on); if (nargs != 1) { @@ -547,11 +543,11 @@ int expert_get_powerstat(AMP *amp, powerstat_t *status) return -RIG_EPROTO; } - retval = expert_transaction(amp, "^OP;", responsebuf, sizeof(responsebuf)); + retval = expert_transaction(amp, NULL, 0, responsebuf, sizeof(responsebuf)); if (retval != RIG_OK) { return retval; } - nargs = sscanf(responsebuf, "^ON%d", &operate); + //nargs = sscanf(responsebuf, "^ON%d", &operate); if (nargs != 1) { @@ -568,7 +564,8 @@ int expert_get_powerstat(AMP *amp, powerstat_t *status) int expert_set_powerstat(AMP *amp, powerstat_t status) { int retval; - char *cmd = NULL; + unsigned char cmd[8]; + int cmd_len = 1; rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); @@ -578,13 +575,13 @@ int expert_set_powerstat(AMP *amp, powerstat_t status) { case RIG_POWER_UNKNOWN: break; - case RIG_POWER_OFF: cmd = "^ON0;"; break; + case RIG_POWER_OFF: cmd[0] = 0x0a; break; - case RIG_POWER_ON: cmd = "^ON1;"; break; + case RIG_POWER_ON: cmd[0] = 0x0b; break; - case RIG_POWER_OPERATE: cmd = "^OS1;"; break; + case RIG_POWER_OPERATE: cmd[0] = 0x0d; break; - case RIG_POWER_STANDBY: cmd = "^OS0;"; break; + case RIG_POWER_STANDBY: cmd[0] = 0x0a; break; default: @@ -592,7 +589,7 @@ int expert_set_powerstat(AMP *amp, powerstat_t status) } - retval = expert_transaction(amp, cmd, NULL, 0); + retval = expert_transaction(amp, cmd, cmd_len, NULL, 0); if (retval != RIG_OK) { return retval; } diff --git a/amplifiers/expert/expert.h b/amplifiers/expert/expert.h index f8ef1de8..d2fdb4f3 100644 --- a/amplifiers/expert/expert.h +++ b/amplifiers/expert/expert.h @@ -48,7 +48,7 @@ int expert_init(AMP *amp); int expert_close(AMP *amp); int expert_reset(AMP *amp, amp_reset_t reset); int expert_flush_buffer(AMP *amp); -int expert_transaction(AMP *amp, const char *cmd, char *response, +int expert_transaction(AMP *amp, const unsigned char *cmd, int cmd_len, unsigned char *response, int response_len); const char *expert_get_info(AMP *amp); int expert_get_freq(AMP *amp, freq_t *freq); diff --git a/configure.ac b/configure.ac index 92ce17f8..e07bc085 100644 --- a/configure.ac +++ b/configure.ac @@ -52,7 +52,7 @@ dnl here but will be added later, e.g. "winradio". RIG_BACKEND_LIST="rigs/adat rigs/alinco rigs/aor rigs/barrett rigs/codan rigs/dorji rigs/drake rigs/dummy rigs/elad rigs/flexradio rigs/icom rigs/icmarine rigs/jrc rigs/kachina rigs/kenwood rigs/kit rigs/lowe rigs/pcr rigs/prm80 rigs/racal rigs/rft rigs/rs rigs/skanti rigs/tapr rigs/tentec rigs/tuner rigs/uniden rigs/winradio rigs/wj rigs/yaesu rigs/gomspace rigs/mds" ROT_BACKEND_LIST="rotators/amsat rotators/apex rotators/ars rotators/celestron rotators/cnctrk rotators/grbltrk rotators/easycomm rotators/ether6 rotators/flir rotators/fodtrack rotators/gs232a rotators/heathkit rotators/m2 rotators/meade rotators/rotorez rotators/sartek rotators/saebrtrack rotators/spid rotators/ts7400 rotators/prosistel rotators/ioptron rotators/satel rotators/radant" # Amplifiers are all in the amplifiers directory -AMP_BACKEND_LIST="amplifiers/elecraft amplifiers/gemini" +AMP_BACKEND_LIST="amplifiers/elecraft amplifiers/gemini amplifiers/expert" dnl See README.release on setting these values # Values given to -version-info when linking. See libtool documentation. @@ -907,6 +907,7 @@ scripts/Makefile android/Makefile amplifiers/elecraft/Makefile amplifiers/gemini/Makefile +amplifiers/expert/Makefile simulators/Makefile hamlib.pc ]) diff --git a/include/hamlib/amplist.h b/include/hamlib/amplist.h index 3e954c86..4122062c 100644 --- a/include/hamlib/amplist.h +++ b/include/hamlib/amplist.h @@ -106,10 +106,15 @@ //! @endcond #define AMP_MODEL_ELECRAFT_KPA1500 AMP_MAKE_MODEL(AMP_ELECRAFT, 1) //#define AMP_MODEL_ELECRAFT_KPA500 AMP_MAKE_MODEL(AMP_ELECRAFT, 2) + #define AMP_GEMINI 3 #define AMP_BACKEND_GEMINI "gemini" #define AMP_MODEL_GEMINI_DX1200 AMP_MAKE_MODEL(AMP_GEMINI, 1) +#define AMP_EXPERT 4 +#define AMP_BACKEND_EXPERT "expert" +#define AMP_MODEL_EXPERT_FA AMP_MAKE_MODEL(AMP_EXPERT, 1) + /** * \brief Convenience type definition for an amplifier model. diff --git a/src/amp_reg.c b/src/amp_reg.c index 998a58ff..98892790 100644 --- a/src/amp_reg.c +++ b/src/amp_reg.c @@ -65,6 +65,7 @@ DEFINE_INITAMP_BACKEND(dummy); DEFINE_INITAMP_BACKEND(kpa1500); DEFINE_INITAMP_BACKEND(gemini); +DEFINE_INITAMP_BACKEND(expert); //! @endcond /** commit c331899d94424bffd4ad4d5b214ad7249f55b08a Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Mar 28 15:57:24 2023 -0500 Fix expert in rotators/Android.mk diff --git a/amplifiers/expert/Android.mk b/amplifiers/expert/Android.mk index 57d2dd17..502f300f 100644 --- a/amplifiers/expert/Android.mk +++ b/amplifiers/expert/Android.mk @@ -3,7 +3,7 @@ LOCAL_PATH:= $(call my-dir) include $(CLEAR_VARS) LOCAL_SRC_FILES := expert.c -LOCAL_MODULE := expoert +LOCAL_MODULE := expert LOCAL_CFLAGS := LOCAL_C_INCLUDES := android include src commit 9d7ac000e5e315b25d484d5bdd109cc026af801d Merge: f11db5c9 8d407320 Author: Michael Black <mdb...@ya...> Date: Tue Mar 28 14:25:11 2023 -0500 Merge pull request #1265 from dforsi/fix/duplicated-initializers Fix initializer-overrides warnings by clang commit 8d407320648445a50b98119aae53ed5081a617b5 Author: Daniele Forsi IU5HKX <iu...@gm...> Date: Tue Mar 28 19:49:01 2023 +0200 Fix initializer-overrides warnings by clang Fixes: dx77.c:225:5: warning: initializer overrides prior initialization of this subobject [-Winitializer-overrides] { ^ dx77.c:217:23: note: previous initialization is here .tx_range_list2 = {RIG_FRNG_END,}, ^~~~~~~~~~~~~~~ ft991.c:356:27: warning: initializer overrides prior initialization of this subobject [-Winitializer-overrides] .scan = newcat_scan, ^~~~~~~~~~~ ft991.c:352:27: note: previous initialization is here .scan = newcat_scan, ^~~~~~~~~~~ diff --git a/rigs/alinco/dx77.c b/rigs/alinco/dx77.c index baa5a448..870bc83b 100644 --- a/rigs/alinco/dx77.c +++ b/rigs/alinco/dx77.c @@ -214,7 +214,6 @@ const struct rig_caps dx77_caps = RIG_FRNG_END, }, .tx_range_list1 = {RIG_FRNG_END,}, - .tx_range_list2 = {RIG_FRNG_END,}, .rx_range_list2 = { diff --git a/rigs/yaesu/ft991.c b/rigs/yaesu/ft991.c index 2191d59b..69206e60 100644 --- a/rigs/yaesu/ft991.c +++ b/rigs/yaesu/ft991.c @@ -353,7 +353,6 @@ const struct rig_caps ft991_caps = .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 }; commit f11db5c94955b87e7f2f0ce4b935d3d2f851ebed Merge: bbda209f 7395ef0e Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Mar 28 11:53:30 2023 -0500 Merge branch 'master' of https://github.com/Hamlib/Hamlib commit bbda209fc0ab7bf1e139b253d165900729e7f4d6 Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Mar 28 11:52:26 2023 -0500 Add park to rotorez https://github.com/Hamlib/Hamlib/issues/1257 diff --git a/amplifiers/expert/Android.mk b/amplifiers/expert/Android.mk new file mode 100644 index 00000000..57d2dd17 --- /dev/null +++ b/amplifiers/expert/Android.mk @@ -0,0 +1,12 @@ +LOCAL_PATH:= $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := expert.c +LOCAL_MODULE := expoert + +LOCAL_CFLAGS := +LOCAL_C_INCLUDES := android include src +LOCAL_LDLIBS := -lhamlib + +include $(BUILD_STATIC_LIBRARY) diff --git a/amplifiers/expert/Makefile.am b/amplifiers/expert/Makefile.am new file mode 100644 index 00000000..2733ef26 --- /dev/null +++ b/amplifiers/expert/Makefile.am @@ -0,0 +1,8 @@ +SRC = expert.c + +EXPERTSRC = expert.h + +noinst_LTLIBRARIES = libhamlib-expert.la +libhamlib_expert_la_SOURCES = $(SRC) $(EXPERTSRC) + +EXTRA_DIST = README.expert Android.mk diff --git a/amplifiers/expert/README.expert b/amplifiers/expert/README.expert new file mode 100644 index 00000000..331bc178 --- /dev/null +++ b/amplifiers/expert/README.expert @@ -0,0 +1,7 @@ +hamlib - Copyright (C) 2023 The Hamlib Group + +File: README.expert + +Notes on Expert backends + +2023-03-20 Initial prototype for Expert amplifiers diff --git a/amplifiers/expert/expert.c b/amplifiers/expert/expert.c new file mode 100644 index 00000000..f66256d4 --- /dev/null +++ b/amplifiers/expert/expert.c @@ -0,0 +1,734 @@ +/* + * Hamlib Expert amplifier backend - low level communication routines + * Copyright (c) 2023 by Michael Black W9MDB + * + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#include <stdlib.h> +#include <string.h> +#include "expert.h" +#include "register.h" + +struct fault_list +{ + int code; + char *errmsg; +}; +const struct fault_list expert_fault_list [] = +{ + {0, "No fault condition"}, + {0x10, "Watchdog Timer was reset"}, + {0x20, "PA Current is too high"}, + {0x40, "Temperature is too high"}, + {0x60, "Input power is too high"}, + {0x61, "Gain is too low"}, + {0x70, "Invalid frequency"}, + {0x80, "50V supply voltage too low or too high"}, + {0x81, "5V supply voltage too low or too high"}, + {0x82, "10V supply voltage too low or too high"}, + {0x83, "12V supply voltage too low or too high"}, + {0x84, "-12V supply voltage too low or too high"}, + {0x85, "5V or 400V LPF board supply voltages not detected"}, + {0x90, "Reflected power is too high"}, + {0x91, "SWR very high"}, + {0x92, "ATU no match"}, + {0xB0, "Dissipated power too high"}, + {0xC0, "Forward power too high"}, + {0xE0, "Forward power too high for current setting"}, + {0xF0, "Gain is too high"}, + {0, NULL} +}; + +/* + * Initialize data structures + */ + +int expert_init(AMP *amp) +{ + rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + + if (!amp) + { + return -RIG_EINVAL; + } + + amp->state.priv = (struct expert_priv_data *) + calloc(1, sizeof(struct expert_priv_data)); + + if (!amp->state.priv) + { + return -RIG_ENOMEM; + } + + amp->state.ampport.type.rig = RIG_PORT_SERIAL; + + return RIG_OK; +} + +int expert_close(AMP *amp) +{ + rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + + if (amp->state.priv) { free(amp->state.priv); } + + amp->state.priv = NULL; + + return RIG_OK; +} + +int expert_flushbuffer(AMP *amp) +{ + struct amp_state *rs; + + rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + + rs = &->state; + + return rig_flush(&rs->ampport); +} + +int expert_transaction(AMP *amp, const char *cmd, char *response, int response_len) +{ + struct amp_state *rs; + int err; + int len = 0; + int loop; + + rig_debug(RIG_DEBUG_VERBOSE, "%s called, cmd=%s\n", __func__, cmd); + + if (!amp) { return -RIG_EINVAL; } + + expert_flushbuffer(amp); + + rs = &->state; + + loop = 3; + + do // wake up the amp by sending ; until we receive ; + { + char c = ';'; + rig_debug(RIG_DEBUG_VERBOSE, "%s waiting for ;\n", __func__); + err = write_block(&rs->ampport, (unsigned char *) &c, 1); + + if (err != RIG_OK) { return err; } + + len = read_string(&rs->ampport, (unsigned char *) response, response_len, ";", + 1, 0, 1); + + if (len < 0) { return len; } + } + while (--loop > 0 && (len != 1 || response[0] != ';')); + + // Now send our command + err = write_block(&rs->ampport, (unsigned char *) cmd, strlen(cmd)); + + if (err != RIG_OK) { return err; } + + if (response) // if response expected get it + { + response[0] = 0; + len = read_string(&rs->ampport, (unsigned char *) response, response_len, ";", + 1, 0, 1); + + if (len < 0) + { + rig_debug(RIG_DEBUG_VERBOSE, "%s called, error=%s\n", __func__, + rigerror(len)); + return len; + } + + rig_debug(RIG_DEBUG_VERBOSE, "%s called, response='%s'\n", __func__, + response); + } + else // if no response expected try to get one + { + char responsebuf[KPABUFSZ]; + responsebuf[0] = 0; + loop = 3; + + do + { + char c = ';'; + rig_debug(RIG_DEBUG_VERBOSE, "%s waiting for ;\n", __func__); + err = write_block(&rs->ampport, (unsigned char *) &c, 1); + + if (err != RIG_OK) { return err; } + + len = read_string(&rs->ampport, (unsigned char *) responsebuf, KPABUFSZ, ";", 1, + 0, 1); + + if (len < 0) { return len; } + } + while (--loop > 0 && (len != 1 || responsebuf[0] != ';')); + } + + return RIG_OK; +} + +/* + * Get Info + * returns the model name string + */ +const char *expert_get_info(AMP *amp) +{ + const struct amp_caps *rc; + + rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + + if (!amp) { return (const char *) - RIG_EINVAL; } + + rc = amp->caps; + + return rc->model_name; +} + +int expert_get_freq(AMP *amp, freq_t *freq) +{ + char responsebuf[KPABUFSZ]; + int retval; + unsigned long tfreq; + int nargs; + + rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + + if (!amp) { return -RIG_EINVAL; } + + retval = expert_transaction(amp, "^FR;", responsebuf, sizeof(responsebuf)); + + if (retval != RIG_OK) { return retval; } + + nargs = sscanf(responsebuf, "^FR%lu", &tfreq); + + if (nargs != 1) + { + rig_debug(RIG_DEBUG_VERBOSE, "%s Error: ^FR response='%s'\n", __func__, + responsebuf); + return -RIG_EPROTO; + } + + *freq = tfreq * 1000; + return RIG_OK; +} + +int expert_set_freq(AMP *amp, freq_t freq) +{ + char responsebuf[KPABUFSZ]; + int retval; + unsigned long tfreq; + int nargs; + char cmd[KPABUFSZ]; + + rig_debug(RIG_DEBUG_VERBOSE, "%s called, freq=%"PRIfreq"\n", __func__, freq); + + if (!amp) { return -RIG_EINVAL; } + + SNPRINTF(cmd, sizeof(cmd), "^FR%05ld;", (long)freq / 1000); + retval = expert_transaction(amp, cmd, NULL, 0); + + if (retval != RIG_OK) { return retval; } + + nargs = sscanf(responsebuf, "^FR%lu", &tfreq); + + if (nargs != 1) + { + rig_debug(RIG_DEBUG_ERR, "%s Error: ^FR response='%s'\n", __func__, + responsebuf); + return -RIG_EPROTO; + } + + if (tfreq * 1000 != freq) + { + rig_debug(RIG_DEBUG_ERR, + "%s Error setting freq: ^FR freq!=freq2, %f=%lu '%s'\n", __func__, + freq, tfreq * 1000, responsebuf); + return -RIG_EPROTO; + } + + return RIG_OK; +} + +int expert_get_level(AMP *amp, setting_t level, value_t *val) +{ + char responsebuf[KPABUFSZ]; + char *cmd; + int retval; + int fault; + int i; + int nargs; + int antenna; + int pwrpeak; + int pwrref; + int pwrfwd; + int pwrinput; + float float_value = 0; + int int_value = 0, int_value2 = 0; + struct amp_state *rs = &->state; + struct expert_priv_data *priv = amp->state.priv; + + + rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + + // get the current antenna selected + cmd = "^AE;"; + retval = expert_transaction(amp, cmd, responsebuf, sizeof(responsebuf)); + + if (retval != RIG_OK) { return retval; } + + antenna = 0; + nargs = sscanf(responsebuf, "^AE%d", &antenna); + + if (nargs != 1) + { + rig_debug(RIG_DEBUG_ERR, "%s: invalid value %s='%s'\n", __func__, cmd, + responsebuf); + return -RIG_EPROTO; + } + + rig_debug(RIG_DEBUG_VERBOSE, "%s: cmd=%s, antenna=%d\n", __func__, cmd, + antenna); + + switch (level) + { + case AMP_LEVEL_SWR: + cmd = "^SW;"; + break; + + case AMP_LEVEL_NH: + cmd = "^DF;"; + break; + + case AMP_LEVEL_PF: + cmd = "^DF;"; + break; + + case AMP_LEVEL_PWR_INPUT: + cmd = "^PWI;"; + break; + + case AMP_LEVEL_PWR_FWD: + cmd = "^PWF;"; + break; + + case AMP_LEVEL_PWR_REFLECTED: + cmd = "^PWR;"; + break; + + case AMP_LEVEL_PWR_PEAK: + cmd = "^PWK;"; + break; + + case AMP_LEVEL_FAULT: + cmd = "^SF;"; + break; + } + + retval = expert_transaction(amp, cmd, responsebuf, sizeof(responsebuf)); + + if (retval != RIG_OK) { return retval; } + + switch (level) + { + case AMP_LEVEL_SWR: + nargs = sscanf(responsebuf, "^SW%f", &float_value); + + if (nargs != 1) + { + rig_debug(RIG_DEBUG_ERR, "%s invalid value %s='%s'\n", __func__, cmd, + responsebuf); + return -RIG_EPROTO; + } + + val->f = float_value / 10.0f; + return RIG_OK; + + case AMP_LEVEL_NH: + case AMP_LEVEL_PF: + nargs = sscanf(responsebuf, "^DF%d,%d", &int_value, &int_value2); + + if (nargs != 2) + { + rig_debug(RIG_DEBUG_ERR, "%s invalid value %s='%s'\n", __func__, cmd, + responsebuf); + return -RIG_EPROTO; + } + + rig_debug(RIG_DEBUG_VERBOSE, "%s freq range=%dKHz,%dKHz\n", __func__, + int_value, int_value2); + + // + do + { + retval = read_string(&rs->ampport, (unsigned char *) responsebuf, + sizeof(responsebuf), ";", 1, 0, + 1); + + if (retval != RIG_OK) { return retval; } + + if (strstr(responsebuf, "BYPASS") != 0) + { + int antenna2 = 0; + nargs = sscanf(responsebuf, "AN%d Side TX %d %*s %*s %d", &antenna2, &int_value, + &int_value2); + rig_debug(RIG_DEBUG_VERBOSE, "%s response='%s'\n", __func__, responsebuf); + + if (nargs != 3) + { + rig_debug(RIG_DEBUG_ERR, "%s invalid value %s='%s'\n", __func__, cmd, + responsebuf); + return -RIG_EPROTO; + } + + rig_debug(RIG_DEBUG_VERBOSE, "%s antenna=%d,nH=%d\n", __func__, antenna2, + int_value); + + val->i = level == AMP_LEVEL_NH ? int_value : int_value2; + return RIG_OK; + } + } + while (strstr(responsebuf, "BYPASS")); + + + break; + + + case AMP_LEVEL_PWR_INPUT: + cmd = "^PWI;"; + nargs = sscanf(responsebuf, "^SW%d", &pwrinput); + + if (nargs != 1) + { + rig_debug(RIG_DEBUG_ERR, "%s invalid value %s='%s'\n", __func__, cmd, + responsebuf); + return -RIG_EPROTO; + } + + val->i = pwrinput; + return RIG_OK; + + break; + + case AMP_LEVEL_PWR_FWD: + cmd = "^PWF;"; + nargs = sscanf(responsebuf, "^SW%d", &pwrfwd); + + if (nargs != 1) + { + rig_debug(RIG_DEBUG_ERR, "%s invalid value %s='%s'\n", __func__, cmd, + responsebuf); + return -RIG_EPROTO; + } + + val->i = pwrfwd; + return RIG_OK; + + break; + + case AMP_LEVEL_PWR_REFLECTED: + cmd = "^PWR;"; + nargs = sscanf(responsebuf, "^SW%d", &pwrref); + + if (nargs != 1) + { + rig_debug(RIG_DEBUG_ERR, "%s invalid value %s='%s'\n", __func__, cmd, + responsebuf); + return -RIG_EPROTO; + } + + val->i = pwrref; + return RIG_OK; + + break; + + case AMP_LEVEL_PWR_PEAK: + cmd = "^PWK;"; + nargs = sscanf(responsebuf, "^SW%d", &pwrpeak); + + if (nargs != 1) + { + rig_debug(RIG_DEBUG_ERR, "%s invalid value %s='%s'\n", __func__, cmd, + responsebuf); + return -RIG_EPROTO; + } + + val->i = pwrpeak; + return RIG_OK; + + break; + + case AMP_LEVEL_FAULT: + cmd = "^SF;"; + nargs = sscanf(responsebuf, "^SW%d", &fault); + + if (nargs != 1) + { + rig_debug(RIG_DEBUG_ERR, "%s invalid value %s='%s'\n", __func__, cmd, + responsebuf); + return -RIG_EPROTO; + } + + for (i = 0; expert_fault_list[i].errmsg != NULL; ++i) + { + if (expert_fault_list[i].code == fault) + { + val->s = expert_fault_list[i].errmsg; + return RIG_OK; + } + } + + rig_debug(RIG_DEBUG_ERR, "%s unknown fault from %s\n", __func__, responsebuf); + SNPRINTF(priv->tmpbuf, sizeof(priv->tmpbuf), "Unknown fault code=0x%02x", + fault); + val->s = priv->tmpbuf; + return RIG_OK; + + break; + + default: + rig_debug(RIG_DEBUG_ERR, "%s unknown level=%s\n", __func__, + rig_strlevel(level)); + + } + + return -RIG_EINVAL; +} + +int expert_get_powerstat(AMP *amp, powerstat_t *status) +{ + char responsebuf[KPABUFSZ]; + int retval; + int operate; + int ampon; + int nargs; + + + rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + + *status = RIG_POWER_UNKNOWN; + + if (!amp) { return -RIG_EINVAL; } + + retval = expert_transaction(amp, "^ON;", responsebuf, sizeof(responsebuf)); + + if (retval != RIG_OK) { return retval; } + + nargs = sscanf(responsebuf, "^ON%d", &on); + + if (nargs != 1) + { + rig_debug(RIG_DEBUG_VERBOSE, "%s Error: ^ON response='%s'\n", __func__, + responsebuf); + return -RIG_EPROTO; + } + + switch (ampon) + { + case 0: *status = RIG_POWER_OFF; return RIG_OK; + + case 1: *status = RIG_POWER_ON; break; + + default: + rig_debug(RIG_DEBUG_VERBOSE, "%s Error: ^ON unknown response='%s'\n", __func__, + responsebuf); + return -RIG_EPROTO; + } + + retval = expert_transaction(amp, "^OP;", responsebuf, sizeof(responsebuf)); + + if (retval != RIG_OK) { return retval; } + + nargs = sscanf(responsebuf, "^ON%d", &operate); + + if (nargs != 1) + { + rig_debug(RIG_DEBUG_VERBOSE, "%s Error: ^ON response='%s'\n", __func__, + responsebuf); + return -RIG_EPROTO; + } + + *status = operate == 1 ? RIG_POWER_OPERATE : RIG_POWER_STANDBY; + + return RIG_OK; +} + +int expert_set_powerstat(AMP *amp, powerstat_t status) +{ + int retval; + char *cmd = NULL; + + rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + + if (!amp) { return -RIG_EINVAL; } + + switch (status) + { + case RIG_POWER_UNKNOWN: break; + + case RIG_POWER_OFF: cmd = "^ON0;"; break; + + case RIG_POWER_ON: cmd = "^ON1;"; break; + + case RIG_POWER_OPERATE: cmd = "^OS1;"; break; + + case RIG_POWER_STANDBY: cmd = "^OS0;"; break; + + + default: + rig_debug(RIG_DEBUG_ERR, "%s invalid status=%d\n", __func__, status); + + } + + retval = expert_transaction(amp, cmd, NULL, 0); + + if (retval != RIG_OK) { return retval; } + + return RIG_OK; +} + +int expert_reset(AMP *amp, amp_reset_t reset) +{ + int retval; + + rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + + // toggling from standby to operate supposed to reset + retval = expert_set_powerstat(amp, RIG_POWER_STANDBY); + + if (retval != RIG_OK) + { + rig_debug(RIG_DEBUG_ERR, "%s: error setting RIG_POWER_STANDBY '%s'\n", __func__, + strerror(retval)); + + } + + return expert_set_powerstat(amp, RIG_POWER_OPERATE); +} + + +struct expert_priv_data *expert_priv; +/* + * API local implementation + * + */ + +/* + * Private helper function prototypes + */ + +//static int kpa1500_send_priv_cmd(AMP *amp, const char *cmd); +//static int kpa1500_flush_buffer(AMP *amp); + +/* ************************************* + * + * Separate model capabilities + * + * ************************************* + */ + + +/* + * Expert 1.3K-FA, 1.5K-FA, and 2K-FA + */ + +const struct amp_caps kpa1500_amp_caps = +{ + AMP_MODEL(AMP_MODEL_ELECRAFT_KPA1500), + .model_name = "1.3K-FA/1.5K-FA/2K-FA", + .mfg_name = "Expert", + .version = "20230320.0", + .copyright = "LGPL", + .status = RIG_STATUS_ALPHA, + .amp_type = AMP_TYPE_OTHER, + .port_type = RIG_PORT_SERIAL, + .serial_rate_min = 9600, + .serial_rate_max = 115200, + .serial_data_bits = 8, + .serial_stop_bits = 1, + .serial_parity = RIG_PARITY_NONE, + .serial_handshake = RIG_HANDSHAKE_NONE, + .write_delay = 0, + .post_write_delay = 0, + .timeout = 2000, + .retry = 2, + .has_get_level = AMP_LEVEL_SWR | AMP_LEVEL_NH | AMP_LEVEL_PF | AMP_LEVEL_PWR_INPUT | AMP_LEVEL_PWR_FWD | AMP_LEVEL_PWR_REFLECTED | AMP_LEVEL_FAULT, + .has_set_level = 0, + + .amp_open = NULL, + .amp_init = expert_init, + .amp_close = expert_close, + .reset = expert_reset, + .get_info = expert_get_info, + .get_powerstat = expert_get_powerstat, + .set_powerstat = expert_set_powerstat, + .set_freq = expert_set_freq, + .get_freq = expert_get_freq, + .get_level = expert_get_level, +}; + + +/* ************************************ + * + * API functions + * + * ************************************ + */ + +/* + * + */ + +#if 0 // not implemented yet +/* + * Send command string to amplifier + */ + +static int kpa1500_send_priv_cmd(AMP *amp, const char *cmdstr) +{ + struct amp_state *rs; + int err; + + rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + + if (!amp) + { + return -RIG_EINVAL; + } + + rs = &->state; + err = write_block(&rs->ampport, cmdstr, strlen(cmdstr)); + + if (err != RIG_OK) + { + return err; + } + + return RIG_OK; +} +#endif + +/* + * Initialize backend + */ + +DECLARE_INITAMP_BACKEND(expert) +{ + rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + + amp_register(&expert_amp_caps); + + return RIG_OK; +} diff --git a/amplifiers/expert/expert.h b/amplifiers/expert/expert.h new file mode 100644 index 00000000..f8ef1de8 --- /dev/null +++ b/amplifiers/expert/expert.h @@ -0,0 +1,62 @@ +/* + * Hamlib backend library for the Expert amplifier set. + * + * expert.h - (C) Michael Black W9MDB 2023 + * + * This shared library provides an API for communicating + * via serial interface to Expert amplifiers. + * + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#ifndef _AMP_EXPERT_H +#define _AMP_EXPERT_H 1 + +#include <hamlib/amplifier.h> +#include <iofunc.h> +#include <serial.h> + +// Is this big enough? +#define KPABUFSZ 100 + +extern const struct amp_caps expert_amp_caps; + +/* + * Private data structure + */ +struct expert_priv_data +{ + char tmpbuf[256]; // for unknown error msg +}; + + +int expert_init(AMP *amp); +int expert_close(AMP *amp); +int expert_reset(AMP *amp, amp_reset_t reset); +int expert_flush_buffer(AMP *amp); +int expert_transaction(AMP *amp, const char *cmd, char *response, + int response_len); +const char *expert_get_info(AMP *amp); +int expert_get_freq(AMP *amp, freq_t *freq); +int expert_set_freq(AMP *amp, freq_t freq); + +int expert_get_level(AMP *amp, setting_t level, value_t *val); +int expert_get_powerstat(AMP *amp, powerstat_t *status); +int expert_set_powerstat(AMP *amp, powerstat_t status); + +#endif /* _AMP_EXPERT_H */ + diff --git a/rotators/rotorez/rotorez.c b/rotators/rotorez/rotorez.c index 6867acea..6411a3ad 100644 --- a/rotators/rotorez/rotorez.c +++ b/rotators/rotorez/rotorez.c @@ -55,6 +55,7 @@ static int rotorez_rot_set_position(ROT *rot, azimuth_t azimuth, elevation_t elevation); static int rotorez_rot_get_position(ROT *rot, azimuth_t *azimuth, elevation_t *elevation); +static int rotorez_park(ROT *rot); static int erc_rot_get_position(ROT *rot, azimuth_t *azimuth, elevation_t *elevation); static int rt21_rot_get_position(ROT *rot, azimuth_t *azimuth, @@ -129,7 +130,7 @@ const struct rot_caps rotorez_rot_caps = ROT_MODEL(ROT_MODEL_ROTOREZ), .model_name = "Rotor-EZ", .mfg_name = "Idiom Press", - .version = "20220109.0", + .version = "20230328.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rot_type = ROT_TYPE_OTHER, @@ -157,6 +158,7 @@ const struct rot_caps rotorez_rot_caps = .rot_cleanup = rotorez_rot_cleanup, .set_position = rotorez_rot_set_position, .get_position = rotorez_rot_get_position, + .park = rotorez_park, .stop = rotorez_rot_stop, .set_conf = rotorez_rot_set_conf, .get_info = rotorez_rot_get_info, @@ -174,7 +176,7 @@ const struct rot_caps rotorcard_rot_caps = ROT_MODEL(ROT_MODEL_ROTORCARD), .model_name = "RotorCard", .mfg_name = "Idiom Press", - .version = "20100214.0", + .version = "20230328.0", .copyright = "LGPL", .status = RIG_STATUS_BETA, .rot_type = ROT_TYPE_OTHER, @@ -202,6 +204,7 @@ const struct rot_caps rotorcard_rot_caps = .rot_cleanup = rotorez_rot_cleanup, .set_position = rotorez_rot_set_position, .get_position = rotorez_rot_get_position, + .park = rotorez_park, .stop = rotorez_rot_stop, .set_conf = rotorez_rot_set_conf, .get_info = rotorez_rot_get_info, @@ -218,7 +221,7 @@ const struct rot_caps dcu_rot_caps = ROT_MODEL(ROT_MODEL_DCU), .model_name = "DCU-1/DCU-1X", .mfg_name = "Hy-Gain", - .version = "20100823.0", + .version = "20230328.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rot_type = ROT_TYPE_OTHER, @@ -262,7 +265,7 @@ const struct rot_caps erc_rot_caps = ROT_MODEL(ROT_MODEL_ERC), .model_name = "ERC", .mfg_name = "DF9GR", - .version = "20100823.2", /* second revision on 23 Aug 2010 */ + .version = "20230328.2", /* second revision on 23 Aug 2010 */ .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rot_type = ROT_TYPE_OTHER, @@ -290,6 +293,7 @@ const struct rot_caps erc_rot_caps = .rot_cleanup = rotorez_rot_cleanup, .set_position = rotorez_rot_set_position, .get_position = erc_rot_get_position, + .park = rotorez_park, .stop = dcu1_rot_stop, .reset = rotorez_rot_reset, // .stop = rotorez_rot_stop, @@ -309,7 +313,7 @@ const struct rot_caps yrc1_rot_caps = ROT_MODEL(ROT_MODEL_YRC1), .model_name = "DCU2/DCU3/YRC-1", .mfg_name = "Hy-Gain", - .version = "20100823.2", + .version = "20230328.2", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rot_type = ROT_TYPE_OTHER, @@ -337,6 +341,7 @@ const struct rot_caps yrc1_rot_caps = .rot_cleanup = rotorez_rot_cleanup, .set_position = rotorez_rot_set_position, .get_position = erc_rot_get_position, + .park = rotorez_park, .stop = dcu1_rot_stop, .reset = rotorez_rot_reset, // .stop = rotorez_rot_stop, @@ -351,7 +356,7 @@ const struct rot_caps rt21_rot_caps = ROT_MODEL(ROT_MODEL_RT21), .model_name = "RT-21", .mfg_name = "Green Heron", - .version = "20220104.0", + .version = "20230328.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rot_type = ROT_TYPE_OTHER, @@ -379,6 +384,7 @@ const struct rot_caps rt21_rot_caps = .rot_cleanup = rotorez_rot_cleanup, .set_position = rt21_rot_set_position, .get_position = rt21_rot_get_position, + .park = rotorez_park, .stop = rotorez_rot_stop, // .set_conf = rotorez_rot_set_conf, // .get_info = rotorez_rot_get_info, @@ -1128,6 +1134,20 @@ static int rotorez_flush_buffer(ROT *rot) return RIG_OK; } +/* + * Moves to Home Position + */ +static int rotorez_park(ROT *rot) +{ + rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + + /* Assume home is 0,0 */ + rotorez_rot_set_position(rot, 0, 0); + + return RIG_OK; +} + + /* * Initialize backend commit 7395ef0e3f1e34ae43f01a4938f021cd3f2c0fde Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Mar 28 11:52:26 2023 -0500 Add park to rotorez diff --git a/rotators/rotorez/rotorez.c b/rotators/rotorez/rotorez.c index 6867acea..6411a3ad 100644 --- a/rotators/rotorez/rotorez.c +++ b/rotators/rotorez/rotorez.c @@ -55,6 +55,7 @@ static int rotorez_rot_set_position(ROT *rot, azimuth_t azimuth, elevation_t elevation); static int rotorez_rot_get_position(ROT *rot, azimuth_t *azimuth, elevation_t *elevation); +static int rotorez_park(ROT *rot); static int erc_rot_get_position(ROT *rot, azimuth_t *azimuth, elevation_t *elevation); static int rt21_rot_get_position(ROT *rot, azimuth_t *azimuth, @@ -129,7 +130,7 @@ const struct rot_caps rotorez_rot_caps = ROT_MODEL(ROT_MODEL_ROTOREZ), .model_name = "Rotor-EZ", .mfg_name = "Idiom Press", - .version = "20220109.0", + .version = "20230328.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rot_type = ROT_TYPE_OTHER, @@ -157,6 +158,7 @@ const struct rot_caps rotorez_rot_caps = .rot_cleanup = rotorez_rot_cleanup, .set_position = rotorez_rot_set_position, .get_position = rotorez_rot_get_position, + .park = rotorez_park, .stop = rotorez_rot_stop, .set_conf = rotorez_rot_set_conf, .get_info = rotorez_rot_get_info, @@ -174,7 +176,7 @@ const struct rot_caps rotorcard_rot_caps = ROT_MODEL(ROT_MODEL_ROTORCARD), .model_name = "RotorCard", .mfg_name = "Idiom Press", - .version = "20100214.0", + .version = "20230328.0", .copyright = "LGPL", .status = RIG_STATUS_BETA, .rot_type = ROT_TYPE_OTHER, @@ -202,6 +204,7 @@ const struct rot_caps rotorcard_rot_caps = .rot_cleanup = rotorez_rot_cleanup, .set_position = rotorez_rot_set_position, .get_position = rotorez_rot_get_position, + .park = rotorez_park, .stop = rotorez_rot_stop, .set_conf = rotorez_rot_set_conf, .get_info = rotorez_rot_get_info, @@ -218,7 +221,7 @@ const struct rot_caps dcu_rot_caps = ROT_MODEL(ROT_MODEL_DCU), .model_name = "DCU-1/DCU-1X", .mfg_name = "Hy-Gain", - .version = "20100823.0", + .version = "20230328.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rot_type = ROT_TYPE_OTHER, @@ -262,7 +265,7 @@ const struct rot_caps erc_rot_caps = ROT_MODEL(ROT_MODEL_ERC), .model_name = "ERC", .mfg_name = "DF9GR", - .version = "20100823.2", /* second revision on 23 Aug 2010 */ + .version = "20230328.2", /* second revision on 23 Aug 2010 */ .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rot_type = ROT_TYPE_OTHER, @@ -290,6 +293,7 @@ const struct rot_caps erc_rot_caps = .rot_cleanup = rotorez_rot_cleanup, .set_position = rotorez_rot_set_position, .get_position = erc_rot_get_position, + .park = rotorez_park, .stop = dcu1_rot_stop, .reset = rotorez_rot_reset, // .stop = rotorez_rot_stop, @@ -309,7 +313,7 @@ const struct rot_caps yrc1_rot_caps = ROT_MODEL(ROT_MODEL_YRC1), .model_n... [truncated message content] |
From: n0nb <n0...@us...> - 2023-01-31 13:31:49
|
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 fa4a96e6a6c8e2ad4fcb016d6034ebfc91375a1c (commit) via 6fbb0986121b8865eaf2c1bcd36082dfeb4290f3 (commit) via 29ad027b6359fda2322215bcea24150b2954b1da (commit) via 33b8c1c88db6bb87968777f6cb5bbc3f6ae5a719 (commit) via 14016be81769a4d0c8bca813f493ff5845a97cd6 (commit) via 2cec9e6d5725e73637d658648180413e9fc15137 (commit) via 9bc5c4a883ce00c419e629700c4cb247dee74398 (commit) via 8a25a3be90108e351191fcbca1d4adce91859dd0 (commit) via ff64d86fd9b7b35c37fb89dbd7ecd5bb6ed6b033 (commit) via 5c36bef6c2e94a516202555507c85246b1667c1c (commit) via 41a8a50e65a6cc85ea01b2f5e64e729f1f3cba44 (commit) via 0177d85a5d9984932c261730e3865810c511283c (commit) via 1e353191bcb9f5eb7c8b33aa2c168ffb17f8aa41 (commit) via eb049ab92dad8f79516939672bb9e78d0056da5d (commit) from 8d1eacc9cb1aa6c18f44533c292022280f02b897 (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 fa4a96e6a6c8e2ad4fcb016d6034ebfc91375a1c Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Jan 30 07:54:43 2023 -0600 Add rigctlsync to doc/Makefile.am diff --git a/doc/Makefile.am b/doc/Makefile.am index 7cdda5c9..85a956fa 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -2,7 +2,7 @@ EXTRA_DIST = hamlib.cfg index.doxygen hamlib.css footer.html hamlib.png dist_man_MANS = man1/ampctl.1 man1/ampctld.1 \ man1/rigctl.1 man1/rigctld.1 man1/rigmem.1 man1/rigsmtr.1 \ - man1/rigswr.1 man1/rotctl.1 man1/rotctld.1 man1/rigctlcom.1 \ + man1/rigswr.1 man1/rotctl.1 man1/rotctld.1 man1/rigctlcom.1 man1/rigctlsync.1 \ man7/hamlib.7 man7/hamlib-primer.7 man7/hamlib-utilities.7 SRCDOCLST = \ commit 6fbb0986121b8865eaf2c1bcd36082dfeb4290f3 Author: Mike Black W9MDB <mdb...@ya...> Date: Sun Jan 29 15:50:27 2023 -0600 Fix segfault using python Hamlib.rig_parse_mode(None) Argument really needed to be 'None' but now prints out better error message https://github.com/Hamlib/Hamlib/issues/1227 diff --git a/Segfault-award b/Segfault-award index e09c6749..4bf3b4be 100644 --- a/Segfault-award +++ b/Segfault-award @@ -7,6 +7,8 @@ A developer cannot apply for HSHR for segfaults on his/her own code. Here is the list of the brave fellows: +* Christoph Berg DF7CB python with Hamlib.rig_parse(None) + * Saku Nyland OH1KH v4.5.1, 10/2022, rigctld.c using ptt_type=RTS * David Kjellquist WB5NHL, v1.1.3, 09/2002, kenwood/ts570.c diff --git a/src/misc.c b/src/misc.c index a82a2360..439f8382 100644 --- a/src/misc.c +++ b/src/misc.c @@ -496,7 +496,8 @@ static const struct { RIG_MODE_IQ, "IQ"}, { RIG_MODE_ISBUSB, "ISBUSB"}, { RIG_MODE_ISBLSB, "ISBLSB"}, - { RIG_MODE_NONE, "" }, + { RIG_MODE_NONE, "None" }, // so we can reutnr None when NONE is requested + { -1, "" }, // need to end list }; @@ -513,7 +514,7 @@ rmode_t HAMLIB_API rig_parse_mode(const char *s) rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); - for (i = 0 ; mode_str[i].str[0] != '\0'; i++) + for (i = 0 ; (s != NULL) && (mode_str[i].str[0] != '\0'); i++) { if (!strcmp(s, mode_str[i].str)) { @@ -521,7 +522,7 @@ rmode_t HAMLIB_API rig_parse_mode(const char *s) } } - rig_debug(RIG_DEBUG_WARN, "%s: mode '%s' not found\n", __func__, s); + rig_debug(RIG_DEBUG_WARN, "%s: mode '%s' not found...returning RIG_MODE_NONE\n", __func__, s); return RIG_MODE_NONE; } @@ -1915,7 +1916,9 @@ vfo_t HAMLIB_API vfo_fixup(RIG *rig, vfo_t vfo, split_t split) if (VFO_HAS_MAIN_SUB_ONLY) { vfo = RIG_VFO_MAIN; } - if (VFO_HAS_MAIN_SUB_A_B_ONLY) { vfo = RIG_VFO_MAIN; } + //in this case we don't change it as either VFOA/B or Main/Sub makes a difference + //ID5100 for example has to turn on dual watch mode for Main/Sub + //if (VFO_HAS_MAIN_SUB_A_B_ONLY) { vfo = RIG_VFO_MAIN; } } else if (vfo == RIG_VFO_TX) { @@ -1963,7 +1966,7 @@ vfo_t HAMLIB_API vfo_fixup(RIG *rig, vfo_t vfo, split_t split) if (VFO_HAS_MAIN_SUB_ONLY) { vfo = RIG_VFO_SUB; } - if (VFO_HAS_MAIN_SUB_A_B_ONLY) { vfo = RIG_VFO_SUB; } + //if (VFO_HAS_MAIN_SUB_A_B_ONLY) { vfo = RIG_VFO_SUB; } rig_debug(RIG_DEBUG_TRACE, "%s: final vfo=%s\n", __func__, rig_strvfo(vfo)); } commit 29ad027b6359fda2322215bcea24150b2954b1da Author: Mike Black W9MDB <mdb...@ya...> Date: Sun Jan 29 12:46:48 2023 -0600 Update simicom9700.c diff --git a/simulators/simicom9700.c b/simulators/simicom9700.c index 25f8996b..5da7d709 100644 --- a/simulators/simicom9700.c +++ b/simulators/simicom9700.c @@ -10,6 +10,7 @@ #include <string.h> #include <unistd.h> #include <fcntl.h> +#include <errno.h> #include <sys/time.h> #include <hamlib/rig.h> #include "../src/misc.h" @@ -84,7 +85,7 @@ again: } } - printf("Error???\n"); + printf("Error??? c=x%02x\n", c); return 0; } @@ -234,6 +235,26 @@ void frameParse(int fd, unsigned char *frame, int len) { static int power_level = 0; + case 0x07: + case 0x08: + if (frame[6] != 0xfd) + { + frame[6] = 0xfb; + dumphex(frame,7); + n = write(fd, frame, 7); + printf("ACK x14 x08\n"); + } + else + { + to_bcd(&frame[6], (long long)128, 2); + frame[8] = 0xfb; + dumphex(frame,9); + n = write(fd, frame, 9); + printf("SEND x14 x08\n"); + } + + break; + case 0x0a: printf("Using power level %d\n", power_level); power_level += 10; @@ -298,6 +319,12 @@ void frameParse(int fd, unsigned char *frame, int len) n = write(fd, frame, 7); break; + case 0x19: // miscellaneous things + frame[5] = 0x94; + frame[6] = 0xfd; + n = write(fd, frame, 7); + break; + case 0x1a: // miscellaneous things switch (frame[5]) { @@ -474,7 +501,7 @@ void frameParse(int fd, unsigned char *frame, int len) default: printf("cmd 0x%02x unknown\n", frame[4]); } - if (n == 0) { printf("Write failed?\n"); } + if (n == 0) { printf("Write failed=%s\n", strerror(errno)); } // don't care about the rig type yet commit 33b8c1c88db6bb87968777f6cb5bbc3f6ae5a719 Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Jan 28 12:48:04 2023 -0600 Update NEWS diff --git a/NEWS b/NEWS index 4bc8c95c..767da306 100644 --- a/NEWS +++ b/NEWS @@ -14,6 +14,7 @@ Version 5.x -- future Version 4.6 * 2023-11-XX -- Planned for Nov 2023 + * Fixes for M2 Rotors * Add rigctlsync utility to synchronize frequency from a rig to SDR# (or others) * Add SDR# rig for use with SDR#'s gpredict plugin -- can only get/set freq * Add Apex Shared Loop rotator -- unidirectional only so far commit 14016be81769a4d0c8bca813f493ff5845a97cd6 Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Jan 28 12:42:14 2023 -0600 Some updates to fix rc2800 operations https://github.com/Hamlib/Hamlib/commit/be72027f9a3c54b2ac086d3aca456edd503d7ecf diff --git a/rotators/m2/rc2800.c b/rotators/m2/rc2800.c index ccea70ad..f615d679 100644 --- a/rotators/m2/rc2800.c +++ b/rotators/m2/rc2800.c @@ -199,15 +199,24 @@ transaction_write: /* then comes the answer */ memset(data, 0, data_len); - retval = read_string(&rs->rotport, (unsigned char *) data, data_len, CR, - strlen(CR), 0, 1); + retval = read_string(&rs->rotport, (unsigned char *) data, data_len, CR LF, + strlen(CR LF), 0, 1); // some models seem to echo -- so we'll check and read again if echoed - if (cmdstr && strcmp(data, cmdstr) == 0) + // skip last char in case the reply is terminated with LF instead of CR + if (cmdstr && strncmp(data, cmdstr, strlen(data) - 1) == 0) { memset(data, 0, data_len); - retval = read_string(&rs->rotport, (unsigned char *) data, data_len, CR, - strlen(CR), 0, 1); + retval = read_string(&rs->rotport, (unsigned char *) data, data_len, CR LF, + strlen(CR LF), 0, 1); + } + + // some models uses both CR + LF -- so we'll check and discard the additional one + if (strlen(data) == 1) + { + memset(data, 0, data_len); + retval = read_string(&rs->rotport, (unsigned char *) data, data_len, CR LF, + strlen(CR LF), 0, 1); } if (retval < 0) @@ -234,19 +243,18 @@ rc2800_rot_set_position(ROT *rot, azimuth_t az, elevation_t el) rig_debug(RIG_DEBUG_TRACE, "%s called: %f %f\n", __func__, az, el); - if (rot->caps->rot_model == ROT_MODEL_RC2800_EARLY_AZ) + if (rot->caps->rot_model == ROT_MODEL_RC2800) // new protocol + { + // does the new protocol use decimal points? + // we'll assume no for now + num_sprintf(cmdstr, "A%.0f"CR, az); + } + else // old protocol (both AZ and AZEL) { - // we only do azimuth and this is the old protocol // we have to switch modes and then send azimuth // an extra CR gives us a response to expect num_sprintf(cmdstr, "A\r%.0f\r\r", az); } - else - { - // does the new protocol use decimal points? - // we'll assume no for now - num_sprintf(cmdstr, "A%0f"CR, az); - } retval1 = rc2800_transaction(rot, cmdstr, NULL, 0); @@ -258,17 +266,16 @@ rc2800_rot_set_position(ROT *rot, azimuth_t az, elevation_t el) /* do not overwhelm the MCU? */ hl_usleep(200 * 1000); - if (rot->caps->rot_model == ROT_MODEL_RC2800_EARLY_AZEL) + if (rot->caps->rot_model == ROT_MODEL_RC2800) // new protocol + { + num_sprintf(cmdstr, "E%.0f"CR, el); + } + else // old protocol (both AZ and AZEL) { - // this is the old protocol // we have to switch modes and then send azimuth // an extra CR gives us a response to expect num_sprintf(cmdstr, "E\r%.0f\r\r", el); } - else - { - num_sprintf(cmdstr, "E%.0f"CR, el); - } retval2 = rc2800_transaction(rot, cmdstr, NULL, 0); @@ -311,36 +318,37 @@ rc2800_rot_get_position(ROT *rot, azimuth_t *az, elevation_t *el) } } - if (rot->caps->rot_model == ROT_MODEL_RC2800) + if (rot->caps->rot_type == ROT_TYPE_AZIMUTH) + { + rig_debug(RIG_DEBUG_TRACE, "%s: (az) = (%.1f)\n", + __func__, *az); + return RIG_OK; + } + + /* do not overwhelm the MCU? */ + hl_usleep(200 * 1000); + + retval = rc2800_transaction(rot, "E" CR, posbuf, sizeof(posbuf)); + + if (retval != RIG_OK || strlen(posbuf) < 5) { - retval = rc2800_transaction(rot, "E" CR, posbuf, sizeof(posbuf)); + return retval < 0 ? retval : -RIG_EPROTO; + } - if (retval != RIG_OK || strlen(posbuf) < 5) + if (rc2800_parse(posbuf, &device, &value) == RIG_OK) + { + if (device == 'E') { - return retval < 0 ? retval : -RIG_EPROTO; + *el = (elevation_t) value; } - - if (rc2800_parse(posbuf, &device, &value) == RIG_OK) + else { - if (device == 'E') - { - *el = (elevation_t) value; - } - else - { - return -RIG_EPROTO; - } + return -RIG_EPROTO; } - - rig_debug(RIG_DEBUG_TRACE, "%s: (az, el) = (%.1f, %.1f)\n", - __func__, *az, *el); - } - else - { - rig_debug(RIG_DEBUG_TRACE, "%s: (az) = (%.1f)\n", - __func__, *az); } + rig_debug(RIG_DEBUG_TRACE, "%s: (az, el) = (%.1f, %.1f)\n", + __func__, *az, *el); return RIG_OK; } @@ -400,7 +408,7 @@ const struct rot_caps rc2800_rot_caps = ROT_MODEL(ROT_MODEL_RC2800), .model_name = "RC2800", .mfg_name = "M2", - .version = "20210129", + .version = "20230123", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rot_type = ROT_TYPE_AZEL, @@ -432,7 +440,7 @@ const struct rot_caps rc2800az_rot_caps = ROT_MODEL(ROT_MODEL_RC2800_EARLY_AZ), .model_name = "RC2800_EARLY_AZ", .mfg_name = "M2", - .version = "20201130", + .version = "20230123", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rot_type = ROT_TYPE_AZIMUTH, @@ -463,7 +471,7 @@ const struct rot_caps rc2800azel_rot_caps = ROT_MODEL(ROT_MODEL_RC2800_EARLY_AZEL), .model_name = "RC2800_EARLY_AZEL", .mfg_name = "M2", - .version = "20201130", + .version = "20230123", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rot_type = ROT_TYPE_AZEL, commit 2cec9e6d5725e73637d658648180413e9fc15137 Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Jan 27 23:49:47 2023 -0600 Update rigctlsync diff --git a/doc/man1/rigctlsync.1 b/doc/man1/rigctlsync.1 index 9a9f619e..369950ad 100644 --- a/doc/man1/rigctlsync.1 +++ b/doc/man1/rigctlsync.1 @@ -264,7 +264,7 @@ with FLRig as the Hamlib model .PP .in +4n .EX -.RB $ " rigctlsync -m 4 -M 9" +.RB $ " rigctlsync -m 4 -M 9 -R 192.168.1.1:4532" .EE .in . diff --git a/tests/rigctlsync.c b/tests/rigctlsync.c index 63aa7c3c..0499d2fb 100644 --- a/tests/rigctlsync.c +++ b/tests/rigctlsync.c @@ -211,7 +211,7 @@ int main(int argc, char *argv[]) int show_conf = 0; int dump_caps_opt = 0; - const char *rig_file = NULL, *rig_file2 = NULL; + const char *rig_file = NULL, *rig_file2 = "127.0.0.1:4532"; //const char **ptt_file = NULL, *dcd_file = NULL; //ptt_type_t ptt_type = RIG_PTT_NONE; //dcd_type_t dcd_type = RIG_DCD_NONE; @@ -220,7 +220,7 @@ int main(int argc, char *argv[]) char *civaddr = NULL; /* NULL means no need to set conf */ char conf_parms[MAXCONFLEN] = ""; - printf("rigctlcom Version 1.4\n"); + printf("rigctlsync Version 1.0\n"); if (argc < 3) { @@ -494,7 +494,7 @@ int main(int argc, char *argv[]) rig_set_debug(verbose); - rig_debug(RIG_DEBUG_VERBOSE, "%s, %s\n", "rigctlcom", hamlib_version2); + rig_debug(RIG_DEBUG_VERBOSE, "%s, %s\n", "rigctlsync", hamlib_version2); rig_debug(RIG_DEBUG_VERBOSE, "%s", "Report bugs to <ham...@li...>\n\n"); @@ -550,12 +550,7 @@ int main(int argc, char *argv[]) strncpy(my_rig->state.rigport.pathname, rig_file, HAMLIB_FILPATHLEN - 1); } - if (!rig_file2) - { - fprintf(stderr, "-R com port not provided\n"); - exit(2); - } - + fprintf(stderr, "rig to send frequency to: %s\n", rig_file2); strncpy(my_rig_sync->state.rigport.pathname, rig_file2, HAMLIB_FILPATHLEN - 1); #if 0 @@ -691,7 +686,7 @@ void usage() name); printf("Example: Sync freq from rigctld to SDR#\n"); - printf("\t%s -m 2 -M 9 127.0.0.1:4532\n\n", name); + printf("\t%s -m 2 -M 9 -R 127.0.0.1:4532\n\n", name); printf("See the %s.1 manual page for complete details.\n\n", name); printf( commit 9bc5c4a883ce00c419e629700c4cb247dee74398 Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Jan 27 23:35:31 2023 -0600 Add rigctlsync utility to allow synchornizing a rig to SDR# diff --git a/NEWS b/NEWS index 429aca2a..4bc8c95c 100644 --- a/NEWS +++ b/NEWS @@ -14,6 +14,7 @@ Version 5.x -- future Version 4.6 * 2023-11-XX -- Planned for Nov 2023 + * Add rigctlsync utility to synchronize frequency from a rig to SDR# (or others) * Add SDR# rig for use with SDR#'s gpredict plugin -- can only get/set freq * Add Apex Shared Loop rotator -- unidirectional only so far * Add client_version to rigctld so client can report it's version for future use/compatility/alternatives diff --git a/doc/man1/rigctlsync.1 b/doc/man1/rigctlsync.1 new file mode 100644 index 00000000..9a9f619e --- /dev/null +++ b/doc/man1/rigctlsync.1 @@ -0,0 +1,329 @@ +.\" Hey, EMACS: -*- nroff -*- +.\" +.\" For layout and available macros, see man(7), man-pages(7), groff_man(7) +.\" Please adjust the date whenever revising the manpage. +.\" +.\" Note: Please keep this page in sync with the source, rigctlsync.c +.\" +.TH RIGCTLSYNC "1" "2023-01-27" "Hamlib" "Hamlib Utilities" +. +. +.SH NAME +. +rigctlsync \- synchronize a rig to SDR# (or other rig) +. +.SH SYNOPSIS +. +. +.SY rigctlsync +.OP \-hlLuV +.OP \-m id +.OP \-r device +.OP \-R device +.OP \-s baud +.OP \-S baud +.OP \-c id +.OP \-C parm=val +.OP \-B +.RB [ \-v [ \-Z ]] +.YS +. +.SH DESCRIPTION +Allows you to synchornize frequence from a rig to SDR#. +Best when used with rigctld, FlRig, or a multiport radio. +. +.PP +Please report bugs and provide feedback at the e-mail address given in the +.B BUGS +section below. Patches and code enhancements sent to the same address are +welcome. +. +. +.SH OPTIONS +. +This program follows the usual GNU command line syntax. Short options that +take an argument may have the value follow immediately or be separated by a +space. Long options starting with two dashes (\(oq\-\(cq) require an +\(oq=\(cq between the option and any argument. +. +.PP +Here is a summary of the supported options: +. +.TP +.BR \-m ", " \-\-model = \fIid\fP +Select radio model number. +.IP +See model list (use \(lqrigctlsync -l\(rq). +.IP +.BR Note : +.B rigctlsync +(or third party software using the C API) will use radio model 2 for +.B NET rigctl +(communicating with +.BR rigctld ). +. +.TP +.BR \-r ", " \-\-rig\-file = \fIdevice\fP +Use +.I device +as the file name of the port connected to the radio. +.IP +Often a serial port, but could be a USB to serial adapter. Typically +.IR /dev/ttyS0 ", " /dev/ttyS1 ", " /dev/ttyUSB0 , +etc. on Linux, +.IR COM1 ", " COM2 , +etc. on MS Windows. The BSD flavors and Mac OS/X have their own designations. +See your system's documentation. +.IP +The special string \(lquh\-rig\(rq may be given to enable micro-ham device +support. +. +.TP +.BR \-R ", " \-\-rig\-file2 = \fIdevice\fP +Use +.I device +as the file name of one of the virtual com ports -- your program will connect +to the other com port of the virtual pair. +. +.TP +.BR \-s ", " \-\-serial\-speed = \fIbaud\fP +Set serial speed to +.I baud +rate. +.IP +Uses maximum serial speed from radio backend capabilities (set by +.B -m +above) as the default. +. +.TP +.BR \-S ", " \-\-serial\-speed2 = \fIbaud\fP +Set serial speed to +.I baud +rate for virtual com port (see +.BR -R ). +. +.IP +Uses maximum serial speed from radio backend capabilities (set by +.B -m +above) as the default. +. +.TP +.BR \-c ", " \-\-civaddr = \fIid\fP +Use +.I id +as the CI-V address to communicate with the rig. +.IP +Only useful for Icom and some Ten-Tec rigs. +.IP +.BR Note : +The +.I id +is in decimal notation, unless prefixed by +.IR 0x , +in which case it is hexadecimal. +. +.TP +.BR \-L ", " \-\-show\-conf +List all config parameters for the radio defined with +.B \-m +above. +. +.TP +.BR \-C ", " \-\-set\-conf = \fIparm=val\fP [ \fI,parm=val\fP ] +Set radio configuration parameter(s), e.g. +.IR stop_bits=2 . +.IP +Use the +.B -L +option above for a list of configuration parameters for a given model number. +. +.TP +.BR \-u ", " \-\-dump\-caps +Dump capabilities for the radio defined with +.B -m +above and exit. +. +.TP +.BR \-l ", " \-\-list +List all model numbers defined in +.B Hamlib +and exit. +.IP +The list is sorted by model number. +.IP +.BR Note : +In Linux the list can be scrolled back using +.BR Shift-PageUp / Shift-PageDown , +or using the scrollbars of a virtual terminal in X or the cmd window in +Windows. The output can be piped to +.BR more (1) +or +.BR less (1), +e.g. \(lqrigctl -l | more\(rq. +. +.TP +.BR \-n ", " \-\-no\-restore\-ai +.B rigctl +restores the state of auto information (AI) on the controlled rig. +.IP +If this is not desired, for example if you are using +.B rigctl +to turn AI mode on or off, pass this option. +. +.TP +.BR \-B ", " \-\-mapa2b +Maps set_freq on VFOA to VFOB instead. +This allows using CW skimmer with the rig in split mode and clicking on a frequency in CW skimmer +will set VFOB to the transmit frequency. +. +.TP +.BR \-v ", " \-\-verbose +Set verbose mode, cumulative (see +.B DIAGNOSTICS +below). +. +.TP +.BR \-Z ", " \-\-debug\-time\-stamps +Enable time stamps for the debug messages. +.IP +Use only in combination with the +.B -v +option as it generates no output on its own. +. +.TP +.BR \-h ", " \-\-help +Show a summary of these options and exit. +. +.TP +.BR \-V ", " \-\-version +Show version of +.B rigctl +and exit. +. +.PP +.BR Note : +Some options may not be implemented by a given backend and will return an +error. This is most likely to occur with the +.B \-\-set\-conf +and +.B \-\-show\-conf +options. +. +. +.SH DIAGNOSTICS +. +The +.BR \-v , +.B \-\-verbose +option allows different levels of diagnostics +to be output to +.B stderr +and correspond to \-v for +.BR BUG , +\-vv for +.BR ERR , +\-vvv for +.BR WARN , +\-vvvv for +.BR VERBOSE , +or \-vvvvv for +.BR TRACE . +. +.PP +A given verbose level is useful for providing needed debugging information to +the email address below. For example, TRACE output shows all of the values +sent to and received from the radio which is very useful for radio backend +library development and may be requested by the developers. +. +. +.SH EXIT STATUS +.B rigctlsync +exits with: +. +.TP +.B 0 +if all operations completed normally; +. +.TP +.B 1 +if there was an invalid command line option or argument; +. +.TP +.B 2 +if an error was returned by +.BR Hamlib . +. +. +.SH EXAMPLE +. +Start +.B rigctlsync +with FLRig as the Hamlib model +.UE +. +.PP +.in +4n +.EX +.RB $ " rigctlsync -m 4 -M 9" +.EE +.in +. +.PP +The following diagram shows the communications flow that allows N1MM Logger+ +to communicate with a radio connected to Flrig: +. +.PP +.in +4n +.EE +.in +. +. +.SH BUGS +. +.PP +Report bugs to: +.IP +.nf +.MT hamlib\-de...@li... +Hamlib Developer mailing list +.ME +.fi +. +. +.SH COPYING +. +This file is part of Hamlib, a project to develop a library that simplifies +radio, rotator, and amplifier control functions for developers of software +primarily of interest to radio amateurs and those interested in radio +communications. +. +.PP +Copyright \(co 2000-2011 Stephane Fillod +.br +Copyright \(co 2000-2018 the Hamlib Group (various contributors) +.br +Copyright \(co 2010-2020 Nate Bargmann +.br +Copyright \(co 2019 Michael Black W9MDB +. +.PP +This is free software; see the file COPYING for copying conditions. There is +NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +. +. +.SH SEE ALSO +. +.BR rigctld (1), +.BR rigctl (1), +.BR socat (1), +.BR hamlib (7) +. +. +.SH COLOPHON +. +Links to the Hamlib Wiki, Git repository, release archives, and daily snapshot +archives are available via +. +.UR http://www.hamlib.org +hamlib.org +.UE . diff --git a/tests/Makefile.am b/tests/Makefile.am index a9c5d7b1..f80b7111 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -14,7 +14,7 @@ endif DISTCLEANFILES = rigctl.log rigctl.sum testbcd.log testbcd.sum -bin_PROGRAMS = rigctl rigctld rigmem rigsmtr rigswr rotctl rotctld rigctlcom rigctltcp ampctl ampctld $(TESTLIBUSB) +bin_PROGRAMS = rigctl rigctld rigmem rigsmtr rigswr rotctl rotctld rigctlcom rigctltcp rigctlsync ampctl ampctld $(TESTLIBUSB) #check_PROGRAMS = dumpmem testrig testrigopen testrigcaps testtrn testbcd testfreq listrigs testloc rig_bench testcache cachetest cachetest2 testcookie testgrid testsecurity check_PROGRAMS = dumpmem testrig testrigopen testrigcaps testtrn testbcd testfreq listrigs testloc rig_bench testcache cachetest cachetest2 testcookie testgrid hamlibmodels @@ -27,6 +27,7 @@ rigctl_SOURCES = rigctl.c $(RIGCOMMONSRC) rigctld_SOURCES = rigctld.c $(RIGCOMMONSRC) rigctlcom_SOURCES = rigctlcom.c $(RIGCOMMONSRC) rigctltcp_SOURCES = rigctltcp.c $(RIGCOMMONSRC) +rigctlsync_SOURCES = rigctlsync.c $(RIGCOMMONSRC) rotctl_SOURCES = rotctl.c $(ROTCOMMONSRC) rotctld_SOURCES = rotctld.c $(ROTCOMMONSRC) ampctl_SOURCES = ampctl.c $(AMPCOMMONSRC) @@ -52,6 +53,7 @@ ampctl_CFLAGS = $(AM_CFLAGS) $(PTHREAD_CFLAGS) -I$(top_builddir)/src ampctld_CFLAGS = $(AM_CFLAGS) $(PTHREAD_CFLAGS) -I$(top_builddir)/src rigctlcom_CFLAGS = $(AM_CFLAGS) $(PTHREAD_CFLAGS) -I$(top_builddir)/security rigctltcp_CFLAGS = $(AM_CFLAGS) $(PTHREAD_CFLAGS) -I$(top_builddir)/security +rigctlsync_CFLAGS = $(AM_CFLAGS) $(PTHREAD_CFLAGS) -I$(top_builddir)/security if HAVE_LIBUSB rigtestlibusb_CFLAGS = $(AM_CFLAGS) $(PTHREAD_CFLAGS) $(LIBUSB_CFLAGS) endif @@ -66,6 +68,7 @@ ampctld_LDADD = $(NET_LIBS) $(PTHREAD_LIBS) $(LDADD) $(READLINE_LIBS) rigmem_LDADD = $(LIBXML2_LIBS) $(LDADD) rigctlcom_LDADD = $(NET_LIBS) $(PTHREAD_LIBS) $(LDADD) $(READLINE_LIBS) rigctltcp_LDADD = $(NET_LIBS) $(PTHREAD_LIBS) $(LDADD) $(READLINE_LIBS) +rigctlsync_LDADD = $(NET_LIBS) $(PTHREAD_LIBS) $(LDADD) $(READLINE_LIBS) if HAVE_LIBUSB rigtestlibusb_LDADD = $(LIBUSB_LIBS) endif @@ -82,6 +85,7 @@ rotctld_LDFLAGS = $(WINEXELDFLAGS) ampctld_LDFLAGS = $(WINEXELDFLAGS) rigctlcom_LDFLAGS = $(WINEXELDFLAGS) rigctltcp_LDFLAGS = $(WINEXELDFLAGS) +rigctlsync_LDFLAGS = $(WINEXELDFLAGS) if HAVE_LIBUSB rigtestlibusb_LDFLAGS = $(WINEXELDFLAGS) endif diff --git a/tests/rigctlsync.c b/tests/rigctlsync.c new file mode 100644 index 00000000..63aa7c3c --- /dev/null +++ b/tests/rigctlsync.c @@ -0,0 +1,716 @@ +/* + * rigctlsync.c - (C) Stephane Fillod 2000-2011 + * (C) The Hamlib Group 2012 + * (C) Nate Bargmann 2008,2010,2011,2012,2013 + * (C) Michael Black W9MDB 2023 - derived from rigctlcom.c + * + * This program will synchronize frequency from one rig to another + * Implemented for AirSpy SDR# to keep freq synced with a real rig + * It simply polls the real rig and when freq changes sends it to SDR# (or whatever rig is hooked up) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + */ + +#include <hamlib/config.h> + +#ifdef WIN32 +#define WIN32_LEAN_AND_MEAN +// cppcheck-suppress * +#include <windows.h> +#endif + +// cppcheck-suppress * +#include <stdio.h> +// cppcheck-suppress * +#include <stdlib.h> +// cppcheck-suppress * +#include <string.h> +// cppcheck-suppress * +// cppcheck-suppress * +#include <ctype.h> +// cppcheck-suppress * +#include <errno.h> +// cppcheck-suppress * +#include <signal.h> + +// cppcheck-suppress * +#include <getopt.h> + +// cppcheck-suppress * +#include <sys/types.h> + +#ifdef HAVE_NETINET_IN_H +// cppcheck-suppress * +# include <netinet/in.h> +#endif + +#ifdef HAVE_ARPA_INET_H +// cppcheck-suppress * +# include <arpa/inet.h> +#endif + +#ifdef HAVE_SYS_SOCKET_H +// cppcheck-suppress * +# include <sys/socket.h> +#elif HAVE_WS2TCPIP_H +# include <ws2tcpip.h> +# include <fcntl.h> +# if defined(HAVE_WSPIAPI_H) +# include <wspiapi.h> +# endif +#endif + +#include <hamlib/rig.h> +#include "misc.h" +#include "iofunc.h" +#include "serial.h" +#include "sprintflst.h" +#include "rigctl_parse.h" +#include "sleep.h" + +/* + * Reminder: when adding long options, + * keep up to date SHORT_OPTIONS, usage()'s output and man page. thanks. + * NB: do NOT use -W since it's reserved by POSIX. + * TODO: add an option to read from a file + */ +#define SHORT_OPTIONS "B:m:M:r:R:p:d:P:D:s:S:c:C:lLuvhVZ" +static struct option long_options[] = +{ + {"mapa2b", 0, 0, 'B'}, + {"model", 1, 0, 'm'}, + {"rig-file", 1, 0, 'r'}, + {"rig-file2", 1, 0, 'R'}, + {"ptt-file", 1, 0, 'p'}, + {"dcd-file", 1, 0, 'd'}, + {"ptt-type", 1, 0, 'P'}, + {"dcd-type", 1, 0, 'D'}, + {"serial-speed", 1, 0, 's'}, + {"serial-speed2", 1, 0, 'S'}, + {"civaddr", 1, 0, 'c'}, + {"set-conf", 1, 0, 'C'}, + {"list", 0, 0, 'l'}, + {"show-conf", 0, 0, 'L'}, + {"dump-caps", 0, 0, 'u'}, + {"verbose", 0, 0, 'v'}, + {"help", 0, 0, 'h'}, + {"version", 0, 0, 'V'}, + {"debug-time-stamps", 0, 0, 'Z'}, + {0, 0, 0, 0} +}; + +void usage(); +static RIG *my_rig; /* handle to rig */ +static RIG +*my_rig_sync; /* rig the gets synchronized -- freq only for now */ +static int verbose; +/* CW Skimmer can only set VFOA */ +/* IC7300 for example can run VFOA on FM and VFOB on CW */ +/* So -A/--mapa2b changes set_freq on VFOA to VFOB */ +/* This allows working CW Skimmer in split mode and transmit on VFOB */ +static int mapa2b; /* maps set_freq on VFOA to VFOB instead */ + +#ifdef HAVE_SIG_ATOMIC_T +static sig_atomic_t volatile ctrl_c; +#else +static int volatile ctrl_c; +#endif + +#define MAXCONFLEN 1024 + +#if 0 +# ifdef WIN32 +static BOOL WINAPI CtrlHandler(DWORD fdwCtrlType) +{ + rig_debug(RIG_DEBUG_VERBOSE, "CtrlHandler called\n"); + + switch (fdwCtrlType) + { + case CTRL_C_EVENT: + case CTRL_CLOSE_EVENT: + ctrl_c = 1; + return TRUE; + + default: + return FALSE; + } +} +# else +static void signal_handler(int sig) +{ + switch (sig) + { + case SIGINT: + ctrl_c = 1; + break; + + default: + /* do nothing */ + break; + } +} +# endif /* ifdef WIN32 */ +#endif /* if 0 */ + +#if 0 +static void handle_error(enum rig_debug_level_e lvl, const char *msg) +{ + int e; +# ifdef __MINGW32__ + LPVOID lpMsgBuf; + + lpMsgBuf = (LPVOID)"Unknown error"; + e = WSAGetLastError(); + + if (FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER + | FORMAT_MESSAGE_FROM_SYSTEM + | FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, + e, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), + // Default language + (LPTSTR)&lpMsgBuf, + 0, + NULL)) + { + + rig_debug(lvl, "%s: Network error %d: %s\n", msg, e, lpMsgBuf); + LocalFree(lpMsgBuf); + } + else + { + rig_debug(lvl, "%s: Network error %d\n", msg, e); + } + +# else + e = errno; + rig_debug(lvl, "%s: Network error %d: %s\n", msg, e, strerror(e)); +# endif /* ifdef __MINGW32__ */ +} +#endif /* if 0 */ + + +int main(int argc, char *argv[]) +{ + rig_model_t my_model[] = { RIG_MODEL_DUMMY, RIG_MODEL_SDRSHARP }; + + int retcode; /* generic return code from functions */ + + int show_conf = 0; + int dump_caps_opt = 0; + const char *rig_file = NULL, *rig_file2 = NULL; + //const char **ptt_file = NULL, *dcd_file = NULL; + //ptt_type_t ptt_type = RIG_PTT_NONE; + //dcd_type_t dcd_type = RIG_DCD_NONE; + int serial_rate = 0; + int serial_rate2 = 0; /* virtual com port default speed */ + char *civaddr = NULL; /* NULL means no need to set conf */ + char conf_parms[MAXCONFLEN] = ""; + + printf("rigctlcom Version 1.4\n"); + + if (argc < 3) + { + usage(); + return 1; + } + + while (1) + { + int c; + int option_index = 0; + char dummy[2]; + + c = getopt_long(argc, + argv, + SHORT_OPTIONS, + long_options, + &option_index); + + if (c == -1) + { + break; + } + + switch (c) + { + case 'h': + usage(); + exit(0); + + case 'V': + version(); + exit(0); + + case 'B': + mapa2b = 1; + break; + + case 'm': + case 'M': + if (!optarg) + { + usage(); /* wrong arg count */ + exit(1); + } + + if (c == 'm') + { + my_model[0] = atoi(optarg); + } + else + { + my_model[1] = atoi(optarg); + } + + break; + + case 'r': + if (!optarg) + { + usage(); /* wrong arg count */ + exit(1); + } + + rig_file = optarg; + break; + + case 'R': + if (!optarg) + { + usage(); /* wrong arg count */ + exit(1); + } + + rig_file2 = optarg; + break; + + +#if 0 + + case 'p': + if (!optarg) + { + usage(); /* wrong arg count */ + exit(1); + } + + ptt_file = optarg; + break; +#endif + +#if 0 + + case 'd': + if (!optarg) + { + usage(); /* wrong arg count */ + exit(1); + } + + dcd_file = optarg; + break; +#endif + +#if 0 + + case 'P': + if (!optarg) + { + usage(); /* wrong arg count */ + exit(1); + } + + if (!strcmp(optarg, "RIG")) + { + ptt_type = RIG_PTT_RIG; + } + else if (!strcmp(optarg, "DTR")) + { + ptt_type = RIG_PTT_SERIAL_DTR; + } + else if (!strcmp(optarg, "RTS")) + { + ptt_type = RIG_PTT_SERIAL_RTS; + } + else if (!strcmp(optarg, "PARALLEL")) + { + ptt_type = RIG_PTT_PARALLEL; + } + else if (!strcmp(optarg, "CM108")) + { + ptt_type = RIG_PTT_CM108; + } + else if (!strcmp(optarg, "NONE")) + { + ptt_type = RIG_PTT_NONE; + } + else + { + ptt_type = atoi(optarg); + } + + break; +#endif + +#if 0 + + case 'D': + if (!optarg) + { + usage(); /* wrong arg count */ + exit(1); + } + + if (!strcmp(optarg, "RIG")) + { + dcd_type = RIG_DCD_RIG; + } + else if (!strcmp(optarg, "DSR")) + { + dcd_type = RIG_DCD_SERIAL_DSR; + } + else if (!strcmp(optarg, "CTS")) + { + dcd_type = RIG_DCD_SERIAL_CTS; + } + else if (!strcmp(optarg, "CD")) + { + dcd_type = RIG_DCD_SERIAL_CAR; + } + else if (!strcmp(optarg, "PARALLEL")) + { + dcd_type = RIG_DCD_PARALLEL; + } + else if (!strcmp(optarg, "NONE")) + { + dcd_type = RIG_DCD_NONE; + } + else + { + dcd_type = atoi(optarg); + } + + break; +#endif + + case 'c': + if (!optarg) + { + usage(); /* wrong arg count */ + exit(1); + } + + civaddr = optarg; + break; + + case 's': + if (!optarg) + { + usage(); /* wrong arg count */ + exit(1); + } + + if (sscanf(optarg, "%d%1s", &serial_rate, dummy) != 1) + { + fprintf(stderr, "Invalid baud rate of %s\n", optarg); + exit(1); + } + + break; + + case 'S': + if (!optarg) + { + usage(); /* wrong arg count */ + exit(1); + } + + serial_rate2 = atoi(optarg); + break; + + + case 'C': + if (!optarg) + { + usage(); /* wrong arg count */ + exit(1); + } + + if (*conf_parms != '\0') + { + strcat(conf_parms, ","); + } + + if (strlen(conf_parms) + strlen(optarg) > MAXCONFLEN - 24) + { + printf("Length of conf_parms exceeds internal maximum of %d\n", + MAXCONFLEN - 24); + return 1; + } + + strncat(conf_parms, optarg, MAXCONFLEN - strlen(conf_parms)); + break; + + case 'v': + verbose++; + break; + + case 'L': + show_conf++; + break; + + case 'l': + rig_set_debug(verbose); + list_models(); + exit(0); + + case 'u': + dump_caps_opt++; + break; + + case 'Z': + rig_set_debug_time_stamp(1); + break; + + default: + usage(); /* unknown option? */ + exit(1); + } + } + + rig_set_debug(verbose); + + rig_debug(RIG_DEBUG_VERBOSE, "%s, %s\n", "rigctlcom", hamlib_version2); + rig_debug(RIG_DEBUG_VERBOSE, "%s", + "Report bugs to <ham...@li...>\n\n"); + + if (argc == 1) + { + usage(); + exit(2); + } + + my_rig = rig_init(my_model[0]); + + if (!my_rig) + { + fprintf(stderr, + "Unknown rig num %d, or initialization error.\n", + my_model[0]); + + fprintf(stderr, "Please check with --list option.\n"); + exit(2); + } + + my_rig_sync = rig_init(my_model[1]); + + if (!my_rig_sync) + { + fprintf(stderr, + "Unknown rig num %d, or initialization error.\n", + my_model[1]); + + fprintf(stderr, "Please check with --list option.\n"); + exit(2); + } + +#if 0 + retcode = set_conf(my_rig, conf_parms); + + if (retcode != RIG_OK) + { + fprintf(stderr, "Config parameter error: %s\n", rigerror(retcode)); + exit(2); + } + +#endif + + if (my_model[0] > 5 && !rig_file) + { + fprintf(stderr, "-r rig com port not provided\n"); + exit(2); + } + + if (rig_file) + { + strncpy(my_rig->state.rigport.pathname, rig_file, HAMLIB_FILPATHLEN - 1); + } + + if (!rig_file2) + { + fprintf(stderr, "-R com port not provided\n"); + exit(2); + } + + strncpy(my_rig_sync->state.rigport.pathname, rig_file2, HAMLIB_FILPATHLEN - 1); + +#if 0 + + /* + * ex: RIG_PTT_PARALLEL and /dev/parport0 + */ + if (ptt_type != RIG_PTT_NONE) + { + my_rig->state.pttport.type.ptt = ptt_type; + } + + if (dcd_type != RIG_DCD_NONE) + { + my_rig->state.dcdport.type.dcd = dcd_type; + } + + if (ptt_file) + { + strncpy(my_rig->state.pttport.pathname, ptt_file, HAMLIB_FILPATHLEN - 1); + } + + if (dcd_file) + { + strncpy(my_rig->state.dcdport.pathname, dcd_file, HAMLIB_FILPATHLEN - 1); + } + +#endif + + /* FIXME: bound checking and port type == serial */ + if (serial_rate != 0) + { + my_rig->state.rigport.parm.serial.rate = serial_rate; + } + + if (serial_rate2 != 0) + { + my_rig_sync->state.rigport.parm.serial.rate = serial_rate2; + } + + + if (civaddr) + { + rig_set_conf(my_rig, rig_token_lookup(my_rig, "civaddr"), civaddr); + } + + /* + * print out conf parameters + */ + if (show_conf) + { + rig_token_foreach(my_rig, print_conf_list, (rig_ptr_t)my_rig); + } + + /* + * print out conf parameters, and exits immediately + * We may be interested only in only caps, and rig_open may fail. + */ + if (dump_caps_opt) + { + dumpcaps(my_rig, stdout); + rig_cleanup(my_rig); /* if you care about memory */ + exit(0); + } + + /* open and close rig connection to check early for issues */ + retcode = rig_open(my_rig); + + if (retcode != RIG_OK) + { + fprintf(stderr, "rig_open: error = %s \n", rigerror(retcode)); + exit(2); + } + + + retcode = rig_open(my_rig_sync); + + if (retcode != RIG_OK) + { + fprintf(stderr, "rig_open sync: error = %s \n", rigerror(retcode)); + exit(2); + } + + + if (verbose > 0) + { + printf("Opened rig model %d, '%s'\n", + my_rig->caps->rig_model, + my_rig->caps->model_name); + } + + rig_debug(RIG_DEBUG_VERBOSE, "Backend version: %s, Status: %s\n", + my_rig->caps->version, rig_strstatus(my_rig->caps->status)); + + /* + * main loop + */ + do + { + freq_t freq; + int retval = rig_get_freq(my_rig, RIG_VFO_CURR, &freq); + + if (retval != RIG_OK) + { + rig_debug(RIG_DEBUG_ERR, "%s: Error in rig_get_freq: %s\n", __func__, + rigerror(retval)); + } + + if (retval != RIG_OK) + { + rig_debug(RIG_DEBUG_ERR, "%s: Error in rig_set_freq: %s\n", __func__, + rigerror(retval)); + } + + retval = rig_set_freq(my_rig_sync, RIG_VFO_CURR, freq); + + hl_usleep(400 * 1000); // fairly fast to keep up + } + while (retcode == 0 && !ctrl_c); + + rig_close(my_rig); /* close port */ + rig_cleanup(my_rig); /* if you care about memory */ + + return 0; +} + +void usage() +{ + char *name = "rigctlsync"; + printf("Usage: %s -m rignumber -r comport -s baud -M rignumber -R comport [OPTIONS]...\n\n" + "Will copy frequency from -m rig to -M rig\n" + "e.g. will keep SDR# synchronized to a rig.\n\n", + name); + + printf("Example: Sync freq from rigctld to SDR#\n"); + printf("\t%s -m 2 -M 9 127.0.0.1:4532\n\n", name); + printf("See the %s.1 manual page for complete details.\n\n", name); + + printf( + " -m, --model=ID select radio model number. See model list (-l)\n" + " -r, --rig-file=DEVICE set device of the radio to operate on\n" + " -R, --rig-file2=DEVICE set device of the virtual com port to operate on\n" + " -s, --serial-speed=BAUD set serial speed of the serial port\n" + " -S, --serial-speed2=BAUD set serial speed of the virtual com port [default=115200]\n" + " -c, --civaddr=ID set CI-V address, decimal (for Icom rigs only)\n" + " -C, --set-conf=PARM=VAL set config parameters\n" + " -L, --show-conf list all config parameters\n" + " -l, --list list all model numbers and exit\n" + " -u, --dump-caps dump capabilities and exit\n" + " -v, --verbose set verbose mode, cumulative (-v to -vvvvv)\n" + " -Z, --debug-time-stamps enable time stamps for debug messages\n" + " -h, --help display this help and exit\n" + " -V, --version output version information and exit\n\n" + ); + + printf("\nReport bugs to <ham...@li...>.\n"); + +} commit 8a25a3be90108e351191fcbca1d4adce91859dd0 Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Jan 27 17:46:46 2023 -0600 Fix sdrsharp model name to show gpredict diff --git a/rigs/dummy/sdrsharp.c b/rigs/dummy/sdrsharp.c index 7b61b0e7..2eb45cdf 100644 --- a/rigs/dummy/sdrsharp.c +++ b/rigs/dummy/sdrsharp.c @@ -525,7 +525,7 @@ static int sdrsharp_get_vfo(RIG *rig, vfo_t *vfo) const struct rig_caps sdrsharp_caps = { RIG_MODEL(RIG_MODEL_SDRSHARP), - .model_name = "SDR#", + .model_name = "SDR#/gpredict", .mfg_name = "Airspy", .version = "20230127.0", .copyright = "LGPL", commit ff64d86fd9b7b35c37fb89dbd7ecd5bb6ed6b033 Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Jan 27 17:44:08 2023 -0600 Fix sdrsharp manufacturer name diff --git a/rigs/dummy/sdrsharp.c b/rigs/dummy/sdrsharp.c index e8b5dace..7b61b0e7 100644 --- a/rigs/dummy/sdrsharp.c +++ b/rigs/dummy/sdrsharp.c @@ -526,7 +526,7 @@ const struct rig_caps sdrsharp_caps = { RIG_MODEL(RIG_MODEL_SDRSHARP), .model_name = "SDR#", - .mfg_name = "Hamlib", + .mfg_name = "Airspy", .version = "20230127.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, commit 5c36bef6c2e94a516202555507c85246b1667c1c Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Jan 27 17:39:14 2023 -0600 Fix compile warning in sdrsharp.c diff --git a/rigs/dummy/sdrsharp.c b/rigs/dummy/sdrsharp.c index 0f95cdce..e8b5dace 100644 --- a/rigs/dummy/sdrsharp.c +++ b/rigs/dummy/sdrsharp.c @@ -39,8 +39,8 @@ #define FALSE 0 -#define MAXCMDLEN 8192 -#define MAXXMLLEN 8192 +#define MAXCMDLEN 128 +#define MAXXMLLEN 128 #define MAXARGLEN 128 #define MAXBANDWIDTHLEN 4096 commit 41a8a50e65a6cc85ea01b2f5e64e729f1f3cba44 Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Jan 27 17:31:24 2023 -0600 Add SDR# rig for use with SDR#'s gpredict pluigin -- can only get/set freq diff --git a/NEWS b/NEWS index 8662ce99..429aca2a 100644 --- a/NEWS +++ b/NEWS @@ -14,6 +14,7 @@ Version 5.x -- future Version 4.6 * 2023-11-XX -- Planned for Nov 2023 + * Add SDR# rig for use with SDR#'s gpredict plugin -- can only get/set freq * Add Apex Shared Loop rotator -- unidirectional only so far * Add client_version to rigctld so client can report it's version for future use/compatility/alternatives * Add --set-conf=tuner_control_pathname=hamlib_tuner_control (default) diff --git a/include/hamlib/riglist.h b/include/hamlib/riglist.h index 6d730595..3c641856 100644 --- a/include/hamlib/riglist.h +++ b/include/hamlib/riglist.h @@ -72,6 +72,7 @@ #define RIG_MODEL_DUMMY_NOVFO RIG_MAKE_MODEL(RIG_DUMMY, 6) #define RIG_MODEL_TCI1X RIG_MAKE_MODEL(RIG_DUMMY, 7) #define RIG_MODEL_ACLOG RIG_MAKE_MODEL(RIG_DUMMY, 8) +#define RIG_MODEL_SDRSHARP RIG_MAKE_MODEL(RIG_DUMMY, 9) /* * Yaesu diff --git a/rigs/dummy/Android.mk b/rigs/dummy/Android.mk index 84054465..4108a9db 100644 --- a/rigs/dummy/Android.mk +++ b/rigs/dummy/Android.mk @@ -2,7 +2,7 @@ LOCAL_PATH:= $(call my-dir) include $(CLEAR_VARS) -LOCAL_SRC_FILES := dummy.c rot_dummy.c netrigctl.c netrotctl.c flrig.c trxmanager.c dummy_common.c +LOCAL_SRC_FILES := dummy.c rot_dummy.c netrigctl.c netrotctl.c flrig.c trxmanager.c dummy_common.c sdrsharp.c LOCAL_MODULE := dummy LOCAL_CFLAGS := diff --git a/rigs/dummy/Makefile.am b/rigs/dummy/Makefile.am index 5a419d3f..f763ee87 100644 --- a/rigs/dummy/Makefile.am +++ b/rigs/dummy/Makefile.am @@ -1,4 +1,4 @@ -DUMMYSRC = dummy_common.c dummy_common.h dummy.c dummy.h rot_dummy.c rot_dummy.h netrigctl.c netrotctl.c flrig.c flrig.h trxmanager.c trxmanager.h amp_dummy.c amp_dummy.h netampctl.c tci1x.c aclog.c +DUMMYSRC = dummy_common.c dummy_common.h dummy.c dummy.h rot_dummy.c rot_dummy.h netrigctl.c netrotctl.c flrig.c flrig.h trxmanager.c trxmanager.h amp_dummy.c amp_dummy.h netampctl.c tci1x.c aclog.c sdrsharp.c noinst_LTLIBRARIES = libhamlib-dummy.la libhamlib_dummy_la_SOURCES = $(DUMMYSRC) diff --git a/rigs/dummy/dummy.c b/rigs/dummy/dummy.c index c9539053..d3f7f63b 100644 --- a/rigs/dummy/dummy.c +++ b/rigs/dummy/dummy.c @@ -2676,6 +2676,7 @@ DECLARE_INITRIG_BACKEND(dummy) rig_register(&trxmanager_caps); rig_register(&dummy_no_vfo_caps); rig_register(&aclog_caps); + rig_register(&sdrsharp_caps); // rig_register(&tci1x_caps); return RIG_OK; } diff --git a/rigs/dummy/dummy.h b/rigs/dummy/dummy.h index dc844a20..b800cfd5 100644 --- a/rigs/dummy/dummy.h +++ b/rigs/dummy/dummy.h @@ -46,6 +46,7 @@ extern const struct rig_caps flrig_caps; extern const struct rig_caps trxmanager_caps; extern const struct rig_caps tci1x_caps; extern const struct rig_caps aclog_caps; +extern const struct rig_caps sdrsharp_caps; int netrigctl_get_vfo_mode(RIG *); diff --git a/rigs/dummy/sdrsharp.c b/rigs/dummy/sdrsharp.c new file mode 100644 index 00000000..0f95cdce --- /dev/null +++ b/rigs/dummy/sdrsharp.c @@ -0,0 +1,573 @@ +/* +* Hamlib rigctld backend - works with SDR#'s gpredict plugin for example +* Copyright (c) 2023 by Michael Black W9MDB +* +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; either +* version 2.1 of the License, or (at your option) any later version. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +* +*/ +#include <hamlib/config.h> + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#include <hamlib/rig.h> +#include <serial.h> +#include <misc.h> +#include <token.h> +#include <register.h> +#include <network.h> + +#include "dummy_common.h" + +#define DEBUG 1 +#define DEBUG_TRACE DEBUG_VERBOSE +#define TRUE 1 +#define FALSE 0 + + +#define MAXCMDLEN 8192 +#define MAXXMLLEN 8192 +#define MAXARGLEN 128 +#define MAXBANDWIDTHLEN 4096 + +#define DEFAULTPATH "127.0.0.1:4532" + +#define SDRSHARP_VFOS (RIG_VFO_A) + +#define SDRSHARP_MODES (RIG_MODE_NONE) + +struct sdrsharp_priv_data +{ + vfo_t curr_vfo; + char bandwidths[MAXBANDWIDTHLEN]; /* pipe delimited set */ + int nbandwidths; + char info[8192]; + ptt_t ptt; + split_t split; + rmode_t curr_modeA; + rmode_t curr_modeB; + freq_t curr_freqA; + freq_t curr_freqB; + pbwidth_t curr_widthA; + pbwidth_t curr_widthB; + int has_get_modeA; /* True if this function is available */ + int has_get_bwA; /* True if this function is available */ + int has_set_bwA; /* True if this function is available */ + float powermeter_scale; /* So we can scale power meter to 0-1 */ + value_t parms[RIG_SETTING_MAX]; + struct ext_list *ext_parms; +}; + +/* +* check_vfo +* No assumptions +*/ +static int check_vfo(vfo_t vfo) +{ + switch (vfo) + { + case RIG_VFO_A: + break; + + case RIG_VFO_TX: + case RIG_VFO_B: + break; + + case RIG_VFO_CURR: + break; // will default to A in which_vfo + + default: + return (FALSE); + } + + return (TRUE); +} + +/* +* read_transaction +* Assumes rig!=NULL, xml!=NULL, xml_len>=MAXXMLLEN +*/ +static int read_transaction(RIG *rig, char *xml, int xml_len) +{ + int retval; + int retry; + char *delims; + char *terminator = "\n"; + struct rig_state *rs = &rig->state; + + ENTERFUNC; + + retry = 2; + delims = "\n"; + xml[0] = 0; + + do + { + char tmp_buf[MAXXMLLEN]; // plenty big for expected sdrsharp responses hopefully + + if (retry < 2) + { + rig_debug(RIG_DEBUG_WARN, "%s: retry needed? retry=%d\n", __func__, retry); + } + + int len = read_string(&rs->rigport, (unsigned char *) tmp_buf, sizeof(tmp_buf), + delims, + strlen(delims), 0, 1); + + if (len > 0) { retry = 3; } + + if (len <= 0) + { + rig_debug(RIG_DEBUG_ERR, "%s: read_string error=%d\n", __func__, len); + continue; + } + + if (strlen(xml) + strlen(tmp_buf) < xml_len - 1) + { + strncat(xml, tmp_buf, xml_len - 1); + } + else + { + rig_debug(RIG_DEBUG_ERR, + "%s: xml buffer overflow!!\nTrying to add len=%d\nTo len=%d\n", __func__, + (int)strlen(tmp_buf), (int)strlen(xml)); + RETURNFUNC(-RIG_EPROTO); + } + } + while (retry-- > 0 && strstr(xml, terminator) == NULL); + + if (retry == 0) + { + rig_debug(RIG_DEBUG_WARN, "%s: retry timeout\n", __func__); + RETURNFUNC(-RIG_ETIMEOUT); + } + + if (strstr(xml, terminator)) + { +// rig_debug(RIG_DEBUG_TRACE, "%s: got %s\n", __func__, terminator); + retval = RIG_OK; + } + else + { + rig_debug(RIG_DEBUG_VERBOSE, "%s: did not get %s\n", __func__, terminator); + retval = -(101 + RIG_EPROTO); + } + + RETURNFUNC(retval); +} + +/* +* write_transaction +* Assumes rig!=NULL, xml!=NULL, xml_len=total size of xml for response +*/ +static int write_transaction(RIG *rig, char *xml, int xml_len) +{ + + int try = rig->caps->retry; + + int retval = -RIG_EPROTO; + + struct rig_state *rs = &rig->state; + + ENTERFUNC; + + // This shouldn't ever happen...but just in case + // We need to avoid an empty write as rigctld replies with blank line + if (xml_len == 0) + { + rig_debug(RIG_DEBUG_ERR, "%s: len==0??\n", __func__); + RETURNFUNC(retval); + } + + // appears we can lose sync if we don't clear things out + // shouldn't be anything for us now anyways + rig_flush(&rig->state.rigport); + + while (try-- >= 0 && retval != RIG_OK) + { + retval = write_block(&rs->rigport, (unsigned char *) xml, strlen(xml)); + + if (retval < 0) + { + RETURNFUNC(-RIG_EIO); + } + } + + RETURNFUNC(retval); +} + +static int sdrsharp_transaction(RIG *rig, char *cmd, char *value, + int value_len) +{ + char xml[MAXXMLLEN]; + int retry = 3; + + ENTERFUNC; + ELAPSED1; + + set_transaction_active(rig); + + if (value) + { + value[0] = 0; + } + + do + { + int retval; + + if (retry != 3) + { + rig_debug(RIG_DEBUG_VERBOSE, "%s: cmd=%s, retry=%d\n", __func__, cmd, retry); + } + + retval = write_transaction(rig, cmd, strlen(cmd)); + + if (retval != RIG_OK) + { + rig_debug(RIG_DEBUG_ERR, "%s: write_transaction error=%d\n", __func__, retval); + + // if we get RIG_EIO the socket has probably disappeared + // so bubble up the error so port can re re-opened + if (retval == -RIG_EIO) { set_transaction_inactive(rig); RETURNFUNC(retval); } + + hl_usleep(50 * 1000); // 50ms sleep if error + } + + if (value) + { + read_transaction(rig, xml, sizeof(xml)); // this might time out -- that's OK + } + + if (value) { strncpy(value, xml, value_len); } + + } + while (((value && strlen(value) == 0)) + && retry--); // we'll do retries if needed + + if (value && strlen(value) == 0) + { + rig_debug(RIG_DEBUG_ERR, "%s: no value returned\n", __func__); + set_transaction_inactive(rig); RETURNFUNC(RIG_EPROTO); + } + + ELAPSED2; + set_transaction_inactive(rig); + RETURNFUNC(RIG_OK); +} + +/* +* sdrsharp_init +* Assumes rig!=NULL +*/ +static int sdrsharp_init(RIG *rig) +{ + struct sdrsharp_priv_data *priv; + + ENTERFUNC; + rig_debug(RIG_DEBUG_TRACE, "%s version %s\n", __func__, rig->caps->version); + + rig->state.priv = (struct sdrsharp_priv_data *)calloc(1, sizeof( + struct sdrsharp_priv_data)); + + if (!rig->state.priv) + { + RETURNFUNC(-RIG_ENOMEM); + } + + priv = rig->state.priv; + + memset(priv, 0, sizeof(struct sdrsharp_priv_data)); + memset(priv->parms, 0, RIG_SETTING_MAX * sizeof(value_t)); + + /* + * set arbitrary initial status + */ + rig->state.current_vfo = RIG_VFO_A; + priv->split = 0; + priv->ptt = 0; + priv->curr_modeA = -1; + priv->curr_modeB = -1; + priv->curr_widthA = -1; + priv->curr_widthB = -1; + + if (!rig->caps) + { + RETURNFUNC(-RIG_EINVAL); + } + + strncpy(rig->state.rigport.pathname, DEFAULTPATH, + sizeof(rig->state.rigport.pathname)); + + RETURNFUNC(RIG_OK); +} + +/* +* sdrsharp_get_freq +* Assumes rig!=NULL, rig->state.priv!=NULL, freq!=NULL +*/ +static int sdrsharp_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) +{ + char value[MAXARGLEN]; + struct sdrsharp_priv_data *priv = (struct sdrsharp_priv_data *) rig->state.priv; + + ENTERFUNC; + rig_debug(RIG_DEBUG_TRACE, "%s: vfo=%s\n", __func__, + rig_strvfo(vfo)); + + + if (check_vfo(vfo) == FALSE) + { + rig_debug(RIG_DEBUG_ERR, "%s: unsupported VFO %s\n", + __func__, rig_strvfo(vfo)); + RETURNFUNC(-RIG_EINVAL); + } + + if (vfo == RIG_VFO_CURR) + { + vfo = rig->state.current_vfo; + rig_debug(RIG_DEBUG_TRACE, "%s: get_freq2 vfo=%s\n", + __func__, rig_strvfo(vfo)); + } + + char *cmd = "f\n"; + int retval; + + retval = sdrsharp_transaction(rig, cmd, value, sizeof(value)); + + if (retval != RIG_OK) + { + rig_debug(RIG_DEBUG_ERR, "%s: READBMF failed retval=%s\n", __func__, + rigerror(retval)); + RETURNFUNC(retval); + } + + *freq = 0; + + sscanf(value, "%lf", freq); + + if (*freq == 0) + { + rig_debug(RIG_DEBUG_ERR, "%s: freq==0??\nvalue=%s\n", __func__, + value); + RETURNFUNC(-RIG_EPROTO); + } + else + { + rig_debug(RIG_DEBUG_TRACE, "%s: freq=%.0f\n", __func__, *freq); + } + + if (vfo == RIG_VFO_A) + { + priv->curr_freqA = *freq; + } + else // future support in SDRSHARP maybe? + { + priv->curr_freqB = *freq; + } + + RETURNFUNC(RIG_OK); +} + +/* +* sdrsharp_open +* Assumes rig!=NULL, rig->state.priv!=NULL +*/ +static int sdrsharp_open(RIG *rig) +{ + int retval; + char value[MAXARGLEN]; + + ENTERFUNC; + + freq_t freq; + retval = sdrsharp_get_freq(rig, RIG_VFO_CURR, &freq); + + if (retval != RIG_OK) + { + rig_debug(RIG_DEBUG_ERR, "%s: sdrsharp_get_freq not working!!\n", __func__); + RETURNFUNC(RIG_EPROTO); + } + + rig->state.current_vfo = RIG_VFO_A; + rig_debug(RIG_DEBUG_TRACE, "%s: currvfo=%s value=%s\n", __func__, + rig_strvfo(rig->state.current_vfo), value); + + RETURNFUNC(retval); +} + +/* +* sdrsharp_close +* Assumes rig!=NULL +*/ +static int sdrsharp_close(RIG *rig) +{ + ENTERFUNC; + + RETURNFUNC(RIG_OK); +} + +/* +* sdrsharp_cleanup +* Assumes rig!=NULL, rig->state.priv!=NULL +*/ +static int sdrsharp_cleanup(RIG *rig) +{ + struct sdrsharp_priv_data *priv; + + rig_debug(RIG_DEBUG_TRACE, "%s\n", __func__); + + if (!rig) + { + RETURNFUNC2(-RIG_EINVAL); + } + + priv = (struct sdrsharp_priv_data *)rig->state.priv; + + free(priv->ext_parms); + free(rig->state.priv); + + rig->state.priv = NULL; + + // we really don't need to free this up as it's only done once + // was causing problem when cleanup was followed by rig_open + // model_sdrsharp was not getting refilled + // if we can figure out that one we can re-enable this +#if 0 + int i; + + for (i = 0; modeMap[i].mode_hamlib != 0; ++i) + { + if (modeMap[i].mode_sdrsharp) + { + ... [truncated message content] |
From: n0nb <n0...@us...> - 2023-01-25 13:39:49
|
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.5.5 has been updated via 88f6eb29a8d29900f8486f550566f6628a64c12b (commit) via 858737fa024ae1a73d09e735aa98239e67674808 (commit) via b06f8fcb31f2a8062f2b03ebb1439adb283cb80c (commit) via 9b3365941486109f761e8074f3ad703e32268ee2 (commit) via f89b49800f85af23368203422afef182c4da2dc5 (commit) via e089e9849006390d39ebd71cd90fd84f178c962c (commit) via 383794637a8a7992ea015e5a84bf11a2079e6d0d (commit) via 680c56c6ce1772bc97be413ea041b0ebf2650eb1 (commit) via f5b9f6743c9601f06f04d6db4bc3b832072ff6a8 (commit) via f0e7ec385a954113e9c027047a7f8d8f15f120c6 (commit) via 84d86aaa73c337667d43c50afe2bfbb53f9feff9 (commit) via 177d58b7576a3e203d6157a6c2fbfd4fa47ff885 (commit) from dc1d9cf43ef330e8ea518e5bea99c1f83a63147c (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 88f6eb29a8d29900f8486f550566f6628a64c12b Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Jan 24 11:28:33 2023 -0600 Update NEWS diff --git a/NEWS b/NEWS index 378ee292..8662ce99 100644 --- a/NEWS +++ b/NEWS @@ -25,6 +25,7 @@ Version 4.6 * Fix FTDX3000 rig split Version 4.5.5 + * Fix QRP QDX PTT to new TQ command due to firmware changes * Remove EX103 check for FTDX5000 * Fix K3/K3S VFOB setting of mode/width * Fix AGC level display in rigctld commit 858737fa024ae1a73d09e735aa98239e67674808 Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Jan 24 11:22:19 2023 -0600 Change QRP QRDX PTT to use TQ instead TX...more incompability with TS-480 standard diff --git a/rigs/kenwood/ts480.c b/rigs/kenwood/ts480.c index 1d4fb807..59eb9d7a 100644 --- a/rigs/kenwood/ts480.c +++ b/rigs/kenwood/ts480.c @@ -1251,6 +1251,30 @@ int ts480_init(RIG *rig) RETURNFUNC(RIG_OK); } +int qdx_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) +{ + const char *ptt_cmd; + + ENTERFUNC; + rig_debug(RIG_DEBUG_VERBOSE, "%s: ptt=%d\n", __func__, ptt); + + switch (ptt) + { + case RIG_PTT_ON: ptt_cmd = "TQ1"; break; + + case RIG_PTT_OFF: ptt_cmd = "TQ0"; break; + + default: RETURNFUNC(-RIG_EINVAL); + } + + int retval = kenwood_transaction(rig, ptt_cmd, NULL, 0); + + //if (ptt == RIG_PTT_OFF) { hl_usleep(100 * 1000); } // a little time for PTT to turn off + + RETURNFUNC(retval); +} + + /* * TS-480 rig capabilities * Notice that some rigs share the same functions. @@ -1457,7 +1481,7 @@ const struct rig_caps qrplabs_caps = RIG_MODEL(RIG_MODEL_QRPLABS), .model_name = "QCX/QDX", .mfg_name = "QRPLabs", - .version = BACKEND_VER ".0", + .version = BACKEND_VER ".1", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -1780,7 +1804,7 @@ const struct rig_caps pt8000a_caps = .set_split_vfo = kenwood_set_split_vfo, .get_split_vfo = kenwood_get_split_vfo_if, .get_ptt = kenwood_get_ptt, - .set_ptt = kenwood_set_ptt, + .set_ptt = qdx_set_ptt, .get_dcd = kenwood_get_dcd, .set_powerstat = kenwood_set_powerstat, .get_powerstat = kenwood_get_powerstat, commit b06f8fcb31f2a8062f2b03ebb1439adb283cb80c Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Jan 23 14:50:59 2023 -0600 Update NEWS diff --git a/NEWS b/NEWS index ff9b3656..378ee292 100644 --- a/NEWS +++ b/NEWS @@ -25,6 +25,7 @@ Version 4.6 * Fix FTDX3000 rig split Version 4.5.5 + * Remove EX103 check for FTDX5000 * Fix K3/K3S VFOB setting of mode/width * Fix AGC level display in rigctld * Change FTDX10 to no serial handshake commit 9b3365941486109f761e8074f3ad703e32268ee2 Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Jan 23 14:49:06 2023 -0600 ERemove EX103 get/set for FTDX5000 diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 65f8b9f4..ac04d2a8 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -641,6 +641,7 @@ int newcat_open(RIG *rig) rig_debug(RIG_DEBUG_VERBOSE, "%s: disabling FTDX3000 band select\n", __func__); } +#if 0 // this apparently does not work if (is_ftdx5000) { // Remember EX103 status @@ -663,6 +664,7 @@ int newcat_open(RIG *rig) if (priv->ret_data[6] == ';') { priv->front_rear_status = priv->ret_data[5]; } } +#endif RETURNFUNC(RIG_OK); } @@ -695,6 +697,7 @@ int newcat_close(RIG *rig) priv->poweron = 0; } +#if 0 // this apparently does not work -- we can't query EX103 if (is_ftdx5000) { // Restore EX103 status @@ -703,6 +706,7 @@ int newcat_close(RIG *rig) rig_debug(RIG_DEBUG_TRACE, "%s: cmd_str = %s\n", __func__, priv->cmd_str); newcat_set_cmd(rig); // don't care about the return } +#endif RETURNFUNC(RIG_OK); } diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h index db1d64c4..60b2c9ad 100644 --- a/rigs/yaesu/newcat.h +++ b/rigs/yaesu/newcat.h @@ -50,7 +50,7 @@ typedef char ncboolean; /* shared function version */ -#define NEWCAT_VER "20230115" +#define NEWCAT_VER "20230123" /* Hopefully large enough for future use, 128 chars plus '\0' */ #define NEWCAT_DATA_LEN 129 commit f89b49800f85af23368203422afef182c4da2dc5 Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Jan 23 09:10:58 2023 -0600 Update NEWS diff --git a/NEWS b/NEWS index a1b4ac1c..ff9b3656 100644 --- a/NEWS +++ b/NEWS @@ -25,6 +25,7 @@ Version 4.6 * Fix FTDX3000 rig split Version 4.5.5 + * Fix K3/K3S VFOB setting of mode/width * Fix AGC level display in rigctld * Change FTDX10 to no serial handshake * Add TS2000 to has_ps exception commit e089e9849006390d39ebd71cd90fd84f178c962c Author: Mike Black W9MDB <mdb...@ya...> Date: Sun Jan 22 16:45:22 2023 -0600 Fix K3/K3S VFOB mode/bandwidth setting https://github.com/Hamlib/Hamlib/issues/1224 diff --git a/rigs/kenwood/k3.c b/rigs/kenwood/k3.c index a9b0a1f6..cfa530f7 100644 --- a/rigs/kenwood/k3.c +++ b/rigs/kenwood/k3.c @@ -190,7 +190,7 @@ const struct rig_caps k3_caps = RIG_MODEL(RIG_MODEL_K3), .model_name = "K3", .mfg_name = "Elecraft", - .version = BACKEND_VER ".25", + .version = BACKEND_VER ".26", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -343,7 +343,7 @@ const struct rig_caps k3s_caps = RIG_MODEL(RIG_MODEL_K3S), .model_name = "K3S", .mfg_name = "Elecraft", - .version = BACKEND_VER ".19", + .version = BACKEND_VER ".21", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -960,15 +960,21 @@ int k3_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) int err; rmode_t temp_m; pbwidth_t temp_w; - char *cmd_mode = "DT"; + char *cmd_data = "DT"; char *cmd_bw = "BW"; int cmd_bw_len = 6; + struct kenwood_priv_data *priv = rig->state.priv; rig_debug(RIG_DEBUG_VERBOSE, "%s called vfo=%s\n", __func__, rig_strvfo(vfo)); - if (vfo == RIG_VFO_B && rig->caps->rig_model == RIG_MODEL_K4) + if ((priv->is_k3 || priv->is_k3s || priv->is_k4 || priv->is_k4d + || priv->is_k4hd) && vfo == RIG_VFO_B) { - cmd_mode = "DT$"; + if (!(priv->is_k3 || priv->is_k3s)) + { + cmd_data = "DT$"; + } + cmd_bw = "BW$"; cmd_bw_len = 7; @@ -993,8 +999,8 @@ int k3_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) if (temp_m == RIG_MODE_RTTY) { - err = kenwood_safe_transaction(rig, cmd_mode, buf, KENWOOD_MAX_BUF_LEN, - strlen(cmd_mode) + 1); + err = kenwood_safe_transaction(rig, cmd_data, buf, KENWOOD_MAX_BUF_LEN, + strlen(cmd_data) + 1); if (err != RIG_OK) { @@ -1021,8 +1027,8 @@ int k3_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) } else if (temp_m == RIG_MODE_RTTYR) { - err = kenwood_safe_transaction(rig, cmd_mode, buf, KENWOOD_MAX_BUF_LEN, - strlen(cmd_mode) + 1); + err = kenwood_safe_transaction(rig, cmd_data, buf, KENWOOD_MAX_BUF_LEN, + strlen(cmd_data) + 1); if (err != RIG_OK) { diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index 1abad7a1..a82fc261 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -2640,8 +2640,8 @@ int kenwood_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) } else { - if (vfo == RIG_VFO_B - && rig->caps->rig_model == RIG_MODEL_K4) // K4 new MD$ command for VFOB + if ((priv->is_k3 || priv->is_k3s || priv->is_k4 || priv->is_k4d + || priv->is_k4hd) && vfo == RIG_VFO_B) { SNPRINTF(cmd, sizeof(cmd), "MD$"); offs = 3; diff --git a/rigs/kenwood/kenwood.h b/rigs/kenwood/kenwood.h index d0c077a0..45494637 100644 --- a/rigs/kenwood/kenwood.h +++ b/rigs/kenwood/kenwood.h @@ -29,7 +29,7 @@ #include "misc.h" #include "idx_builtin.h" -#define BACKEND_VER "20230115" +#define BACKEND_VER "20230222" #define EOM_KEN ';' #define EOM_TH '\r' commit 383794637a8a7992ea015e5a84bf11a2079e6d0d Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Jan 23 09:09:09 2023 -0600 Fix icom.h diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h index 27bdebb0..efc28fa4 100644 --- a/rigs/icom/icom.h +++ b/rigs/icom/icom.h @@ -239,10 +239,7 @@ struct icom_priv_caps struct icom_spectrum_scope_caps spectrum_scope_caps; /*!< Icom spectrum scope capabilities, if supported by the rig. Main/Sub scopes in Icom rigs have the same caps. */ struct icom_spectrum_edge_frequency_range spectrum_edge_frequency_ranges[ICOM_MAX_SPECTRUM_FREQ_RANGES]; /*!< Icom spectrum scope edge frequencies, if supported by the rig. Last entry should have zeros in all fields. */ struct cmdparams *extcmds; /*!< Pointer to extended operations array */ -<<<<<<< HEAD -======= int dualwatch_split; /*!< Rig supports dual watch for split ops -- e.g. ID-5100 */ ->>>>>>> 9d096c4a (Improve powerstat on/off behavior for Icom rigs) }; struct icom_priv_data commit 680c56c6ce1772bc97be413ea041b0ebf2650eb1 Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Jan 19 17:15:59 2023 -0600 Allow get_powerstat when rig is powered off https://github.com/Hamlib/Hamlib/issues/1220 diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c index c9c87c56..91f407fd 100644 --- a/tests/rigctl_parse.c +++ b/tests/rigctl_parse.c @@ -1753,7 +1753,10 @@ readline_repeat: && cmd_entry->cmd != 0x8f // dump_state && cmd_entry->cmd != 0xf0 // chk_vfo && cmd_entry->cmd != 0x87 // set_powerstat - && my_rig->caps->rig_model != RIG_MODEL_POWERSDR) // some rigs can do stuff when powered off + && cmd_entry->cmd != 0x88 // get_powerstat + && cmd_entry->cmd != 0xa5 // client_version + && my_rig->caps->rig_model != + RIG_MODEL_POWERSDR) // some rigs can do stuff when powered off { rig_debug(RIG_DEBUG_WARN, "%s: command %s not allowed when rig is powered off\n", __func__, commit f5b9f6743c9601f06f04d6db4bc3b832072ff6a8 Author: Mike Black W9MDB <mdb...@ya...> Date: Wed Jan 18 23:32:18 2023 -0600 Remove one sleep from set_powerstat loop https://github.com/Hamlib/Hamlib/issues/1212 diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 8b91dacb..de5e1871 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -8008,7 +8008,6 @@ int icom_set_powerstat(RIG *rig, powerstat_t status) for (i = 0; i < 5 && retval != RIG_OK; ++i) { - sleep(1); // give it a while to power up retval = icom_get_usb_echo_off(rig); if (retval != RIG_OK) { sleep(1); } commit f0e7ec385a954113e9c027047a7f8d8f15f120c6 Author: Mike Black W9MDB <mdb...@ya...> Date: Wed Jan 18 23:27:27 2023 -0600 Make auto_power_on a bit more robust for RigPI which seems slow to get going https://github.com/Hamlib/Hamlib/issues/1212 diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index bb90f1bb..8b91dacb 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -1140,7 +1140,8 @@ icom_rig_close(RIG *rig) ENTERFUNC; - if (priv->poweron == 0) RETURNFUNC(RIG_OK); // nothing to do + if (priv->poweron == 0) { RETURNFUNC(RIG_OK); } // nothing to do + if (priv->poweron == 1 && rs->auto_power_off) { // maybe we need power off? @@ -7990,11 +7991,8 @@ int icom_set_powerstat(RIG *rig, powerstat_t status) memset(fe_buf, 0xfe, fe_max); // sending more than enough 0xfe's to wake up the rs232 write_block(&rs->rigport, fe_buf, fe_max); - // close and re-open the rig - // on linux the USB gets reset during power on - rig_close(rig); - sleep(1); // let serial bus idle for a while - rig_open(rig); + hl_usleep(200 * + 1000); // need to wait a bit for RigPI and others to queue the echo // we'll try 0x18 0x01 now -- should work on STBY rigs too pwr_sc = S_PWR_ON; @@ -8006,8 +8004,16 @@ int icom_set_powerstat(RIG *rig, powerstat_t status) // poweron == 0 means never powered -- == 2 means CAT turned off if (priv->poweron == 0 || priv->poweron == 2) { - sleep(1); // give it a while to power up - icom_get_usb_echo_off(rig); + retval = -1; + + for (i = 0; i < 5 && retval != RIG_OK; ++i) + { + sleep(1); // give it a while to power up + retval = icom_get_usb_echo_off(rig); + + if (retval != RIG_OK) { sleep(1); } + } + return RIG_OK; } commit 84d86aaa73c337667d43c50afe2bfbb53f9feff9 Author: Mike Black W9MDB <mdb...@ya...> Date: Wed Jan 18 15:00:18 2023 -0600 Improve powerstat on/off behavior for Icom rigs https://github.com/Hamlib/Hamlib/issues/1212 diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index d912ad97..bb90f1bb 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -713,6 +713,7 @@ int icom_init(RIG *rig) || rig->caps->rig_model == RIG_MODEL_IC821H || rig->caps->rig_model == RIG_MODEL_IC910 || rig->caps->rig_model == RIG_MODEL_IC2730 + || rig->caps->rig_model == RIG_MODEL_ID5100 ) { priv->x25cmdfails = 1; @@ -991,6 +992,18 @@ icom_rig_open(RIG *rig) rig_debug(RIG_DEBUG_VERBOSE, "%s: %s v%s\n", __func__, rig->caps->model_name, rig->caps->version); + + if (rs->auto_power_on && priv->poweron == 0) + { + rig_debug(RIG_DEBUG_VERBOSE, + "%s asking for power on *****************************************\n", __func__); + rig_set_powerstat(rig, 1); + rig_debug(RIG_DEBUG_VERBOSE, + "%s asking for power on #2 =======================================\n", + __func__); + priv->poweron = 1; + } + retry_open: retval_echo = icom_get_usb_echo_off(rig); @@ -1127,7 +1140,8 @@ icom_rig_close(RIG *rig) ENTERFUNC; - if (priv->poweron != 0 && rs->auto_power_off) + if (priv->poweron == 0) RETURNFUNC(RIG_OK); // nothing to do + if (priv->poweron == 1 && rs->auto_power_off) { // maybe we need power off? rig_debug(RIG_DEBUG_VERBOSE, "%s trying power off\n", __func__); @@ -7971,7 +7985,6 @@ int icom_set_powerstat(RIG *rig, powerstat_t status) { case RIG_POWER_ON: - sleep(1); // let serial bus idle for a while // ic7300 manual says ~150 for 115,200 // we'll just send a few more to be sure for all speeds memset(fe_buf, 0xfe, fe_max); @@ -7990,6 +8003,14 @@ int icom_set_powerstat(RIG *rig, powerstat_t status) retval = icom_transaction(rig, C_SET_PWR, pwr_sc, NULL, 0, ackbuf, &ack_len); + // poweron == 0 means never powered -- == 2 means CAT turned off + if (priv->poweron == 0 || priv->poweron == 2) + { + sleep(1); // give it a while to power up + icom_get_usb_echo_off(rig); + return RIG_OK; + } + break; default: @@ -7997,6 +8018,7 @@ int icom_set_powerstat(RIG *rig, powerstat_t status) fe_buf[0] = 0; retval = icom_transaction(rig, C_SET_PWR, pwr_sc, NULL, 0, ackbuf, &ack_len); + priv->poweron = 2; } i = 0; diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h index 3f4c3c18..27bdebb0 100644 --- a/rigs/icom/icom.h +++ b/rigs/icom/icom.h @@ -239,6 +239,10 @@ struct icom_priv_caps struct icom_spectrum_scope_caps spectrum_scope_caps; /*!< Icom spectrum scope capabilities, if supported by the rig. Main/Sub scopes in Icom rigs have the same caps. */ struct icom_spectrum_edge_frequency_range spectrum_edge_frequency_ranges[ICOM_MAX_SPECTRUM_FREQ_RANGES]; /*!< Icom spectrum scope edge frequencies, if supported by the rig. Last entry should have zeros in all fields. */ struct cmdparams *extcmds; /*!< Pointer to extended operations array */ +<<<<<<< HEAD +======= + int dualwatch_split; /*!< Rig supports dual watch for split ops -- e.g. ID-5100 */ +>>>>>>> 9d096c4a (Improve powerstat on/off behavior for Icom rigs) }; struct icom_priv_data commit 177d58b7576a3e203d6157a6c2fbfd4fa47ff885 Author: Mike Black W9MDB <mdb...@ya...> Date: Wed Jan 18 07:09:28 2023 -0600 Show AGC Level None when there are no AGC settings for rig https://github.com/Hamlib/Hamlib/issues/1155 diff --git a/tests/dumpcaps.c b/tests/dumpcaps.c index 0100c113..ed5f86db 100644 --- a/tests/dumpcaps.c +++ b/tests/dumpcaps.c @@ -318,6 +318,11 @@ int dumpcaps(RIG *rig, FILE *fout) fprintf(fout, " %d=%s", caps->agc_levels[i], rig_stragclevel(caps->agc_levels[i])); } + + if (i == 0) + { + fprintf(fout, " %d=%s", RIG_AGC_NONE, rig_stragclevel(RIG_AGC_NONE)); + } } fprintf(fout, "\n"); ----------------------------------------------------------------------- Summary of changes: NEWS | 3 +++ rigs/icom/icom.c | 41 ++++++++++++++++++++++++++++++++++------- rigs/icom/icom.h | 1 + rigs/kenwood/k3.c | 24 +++++++++++++++--------- rigs/kenwood/kenwood.c | 4 ++-- rigs/kenwood/kenwood.h | 2 +- rigs/kenwood/ts480.c | 28 ++++++++++++++++++++++++++-- rigs/yaesu/newcat.c | 4 ++++ rigs/yaesu/newcat.h | 2 +- tests/dumpcaps.c | 5 +++++ tests/rigctl_parse.c | 5 ++++- 11 files changed, 96 insertions(+), 23 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: n0nb <n0...@us...> - 2023-01-25 02:39:39
|
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 8d1eacc9cb1aa6c18f44533c292022280f02b897 (commit) via 267184ad44eb703eaea274e612408739aae5faa5 (commit) via a47eba7ce4102f332842e79cfeb64b08c69335d4 (commit) via 76a3ab19eb78ef2df4ae4e65dff2e33274ac6a70 (commit) via 3fd698d063906b1fbda4db75d38692202dbd322c (commit) via b977858da94b3e1e88706f2be9d6ebc5ce8fc4b6 (commit) via d68c218a3d249d14313086cb9c1c2312cdbba0d0 (commit) via 79129087e0ed550dc19b7c435dc46ad948c61751 (commit) via af941307495d3616ff78cc1fb37b96b87109a765 (commit) via 907560270eca870606ed6002efaa69577f50c7ab (commit) via 52bed765eff14c752aafd4814f5cf3b7e6ac3d41 (commit) via 9626894029686803544cae7860f34b362dd7a19b (commit) via 9b89a99f9985b90acfcb462647e0b9348cc9930f (commit) via d16b52e414c7e2862dab145dee30eda3487ba04f (commit) via 407b0fcc5414989d6032d845d139fb7b701ddfdc (commit) via 344779eaf199fdfeea750db88820aab537835270 (commit) via 18a2d91f59e0a04042bcaf68e47417f5d9695dbe (commit) via 0c2426c800b754de0aa14a89421354e39473546f (commit) via cdbd517228cf11d5a9e90d82fa534abc53d95eb4 (commit) via cfde2c8a92105da471056fa70194ee10658c201f (commit) via eb1d46723616ec3d94b453f0c1fed94bc977cfe5 (commit) via 50a14bb08fdcccc59fc1f7cf803cd6866ee369f3 (commit) via 13d27a3567c7c632eabded6e1c23f0a96c5053bc (commit) via c78371353c704eb3c16da02b511e6f647ade4190 (commit) via 268f44eb7d64a1ee0ca3489b8edd0188ce1fc69e (commit) via 3daed948a8cfa9f02bb1e8035f6e3355eb31a22e (commit) via 9d096c4ac95fae1c8fd235648874bc27d979d2bc (commit) via ac220815c4ec81f20dc22ca051dc19e3c98cfa9d (commit) via 57b063a44ce257e139633cd82f0e8245f15e4721 (commit) via 9861d1f87ba92667f52558b76349b331620fd13f (commit) via 6f6379e547772755368c35fc117b0ce57bd911ab (commit) via b38739bcabf2a24bbde4315a70d6cbe551879b6c (commit) from f392cc4c1804f06fe16f7e326c879e2ba0f20e1d (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 8d1eacc9cb1aa6c18f44533c292022280f02b897 Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Jan 24 11:28:33 2023 -0600 Update NEWS diff --git a/NEWS b/NEWS index 7f618af6..8662ce99 100644 --- a/NEWS +++ b/NEWS @@ -25,7 +25,7 @@ Version 4.6 * Fix FTDX3000 rig split Version 4.5.5 - * Fix QRP QDX PTT to new TQ command + * Fix QRP QDX PTT to new TQ command due to firmware changes * Remove EX103 check for FTDX5000 * Fix K3/K3S VFOB setting of mode/width * Fix AGC level display in rigctld commit 267184ad44eb703eaea274e612408739aae5faa5 Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Jan 24 11:26:22 2023 -0600 Change QRP QDX PTT command to TQ instead of TX -- more incompability with TS-480 commands diff --git a/NEWS b/NEWS index 378ee292..7f618af6 100644 --- a/NEWS +++ b/NEWS @@ -25,6 +25,7 @@ Version 4.6 * Fix FTDX3000 rig split Version 4.5.5 + * Fix QRP QDX PTT to new TQ command * Remove EX103 check for FTDX5000 * Fix K3/K3S VFOB setting of mode/width * Fix AGC level display in rigctld commit a47eba7ce4102f332842e79cfeb64b08c69335d4 Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Jan 24 11:25:49 2023 -0600 Revert "Update NEWS" This reverts commit 76a3ab19eb78ef2df4ae4e65dff2e33274ac6a70. diff --git a/NEWS b/NEWS index 7f618af6..378ee292 100644 --- a/NEWS +++ b/NEWS @@ -25,7 +25,6 @@ Version 4.6 * Fix FTDX3000 rig split Version 4.5.5 - * Fix QRP QDX PTT to new TQ command * Remove EX103 check for FTDX5000 * Fix K3/K3S VFOB setting of mode/width * Fix AGC level display in rigctld diff --git a/rigs/dummy/netrigctl.c b/rigs/dummy/netrigctl.c index c4e90efb..b69e04b6 100644 --- a/rigs/dummy/netrigctl.c +++ b/rigs/dummy/netrigctl.c @@ -2065,9 +2065,6 @@ static int netrigctl_get_powerstat(RIG *rig, powerstat_t *status) // also a problem with Flex 6xxx and Log4OM not working due to lack of PS command rig_debug(RIG_DEBUG_VERBOSE, "%s: PS command failed (ret=%d) so returning RIG_POWER_ON\n", __func__, ret); - if (ret == -RIG_EPOWER) - *status = RIG_POWER_OFF; - else *status = RIG_POWER_ON; } diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index b491a1c9..10ea9b1f 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -3622,7 +3622,7 @@ int newcat_get_powerstat(RIG *rig, powerstat_t *status) // when not powered on need a dummy byte to wake it up // then sleep from 1 to 2 seconds so we'll do 1.5 secs - write_block(&state->rigport, (unsigned char *) ";;;", 3); + write_block(&state->rigport, (unsigned char *) "PS;", 3); hl_usleep(1200000); SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "%s%c", command, cat_term); diff --git a/simulators/simft991.c b/simulators/simft991.c index 49f61d17..965deb4f 100644 --- a/simulators/simft991.c +++ b/simulators/simft991.c @@ -104,11 +104,11 @@ int main(int argc, char *argv[]) while (1) { - start: if (getmyline(fd, buf)) { printf("Cmd:%s\n", buf); } + else { continue; } if (strcmp(buf, "RM5;") == 0) { @@ -172,10 +172,8 @@ int main(int argc, char *argv[]) } else if (strcmp(buf, "PS;") == 0) { -#if 0 - SNPRINTF(buf, sizeof(buf), "PS0;"); + SNPRINTF(buf, sizeof(buf), "PS1;"); n = write(fd, buf, strlen(buf)); -#endif } else if (strcmp(buf, "AI;") == 0) { diff --git a/src/rig.c b/src/rig.c index 68104894..65927287 100644 --- a/src/rig.c +++ b/src/rig.c @@ -6079,7 +6079,6 @@ int HAMLIB_API rig_get_powerstat(RIG *rig, powerstat_t *status) if (rig->caps->get_powerstat == NULL) { - rig_debug(RIG_DEBUG_VERBOSE, "%s: Rig does not have get_powerstat to assume RIG_POWER_ON\n", __func__); *status = RIG_POWER_ON; // default to power if not available RETURNFUNC(RIG_OK); } @@ -6087,7 +6086,6 @@ int HAMLIB_API rig_get_powerstat(RIG *rig, powerstat_t *status) *status = RIG_POWER_OFF; // default now to power off until proven otherwise in get_powerstat HAMLIB_TRACE; retcode = rig->caps->get_powerstat(rig, status); - if (retcode == -RIG_ETIMEOUT) status = RIG_POWER_OFF; RETURNFUNC(retcode); } diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c index 9cefcb0a..02c80195 100644 --- a/tests/rigctl_parse.c +++ b/tests/rigctl_parse.c @@ -4741,7 +4741,7 @@ declare_proto_rig(get_powerstat) if (status != RIG_OK) { - stat = status; + RETURNFUNC(status); } if ((interactive && prompt) || (interactive && !prompt && ext_resp)) commit 76a3ab19eb78ef2df4ae4e65dff2e33274ac6a70 Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Jan 24 11:23:47 2023 -0600 Update NEWS diff --git a/NEWS b/NEWS index 378ee292..7f618af6 100644 --- a/NEWS +++ b/NEWS @@ -25,6 +25,7 @@ Version 4.6 * Fix FTDX3000 rig split Version 4.5.5 + * Fix QRP QDX PTT to new TQ command * Remove EX103 check for FTDX5000 * Fix K3/K3S VFOB setting of mode/width * Fix AGC level display in rigctld diff --git a/rigs/dummy/netrigctl.c b/rigs/dummy/netrigctl.c index b69e04b6..c4e90efb 100644 --- a/rigs/dummy/netrigctl.c +++ b/rigs/dummy/netrigctl.c @@ -2065,6 +2065,9 @@ static int netrigctl_get_powerstat(RIG *rig, powerstat_t *status) // also a problem with Flex 6xxx and Log4OM not working due to lack of PS command rig_debug(RIG_DEBUG_VERBOSE, "%s: PS command failed (ret=%d) so returning RIG_POWER_ON\n", __func__, ret); + if (ret == -RIG_EPOWER) + *status = RIG_POWER_OFF; + else *status = RIG_POWER_ON; } diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 10ea9b1f..b491a1c9 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -3622,7 +3622,7 @@ int newcat_get_powerstat(RIG *rig, powerstat_t *status) // when not powered on need a dummy byte to wake it up // then sleep from 1 to 2 seconds so we'll do 1.5 secs - write_block(&state->rigport, (unsigned char *) "PS;", 3); + write_block(&state->rigport, (unsigned char *) ";;;", 3); hl_usleep(1200000); SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "%s%c", command, cat_term); diff --git a/simulators/simft991.c b/simulators/simft991.c index 965deb4f..49f61d17 100644 --- a/simulators/simft991.c +++ b/simulators/simft991.c @@ -104,11 +104,11 @@ int main(int argc, char *argv[]) while (1) { + start: if (getmyline(fd, buf)) { printf("Cmd:%s\n", buf); } - else { continue; } if (strcmp(buf, "RM5;") == 0) { @@ -172,8 +172,10 @@ int main(int argc, char *argv[]) } else if (strcmp(buf, "PS;") == 0) { - SNPRINTF(buf, sizeof(buf), "PS1;"); +#if 0 + SNPRINTF(buf, sizeof(buf), "PS0;"); n = write(fd, buf, strlen(buf)); +#endif } else if (strcmp(buf, "AI;") == 0) { diff --git a/src/rig.c b/src/rig.c index 65927287..68104894 100644 --- a/src/rig.c +++ b/src/rig.c @@ -6079,6 +6079,7 @@ int HAMLIB_API rig_get_powerstat(RIG *rig, powerstat_t *status) if (rig->caps->get_powerstat == NULL) { + rig_debug(RIG_DEBUG_VERBOSE, "%s: Rig does not have get_powerstat to assume RIG_POWER_ON\n", __func__); *status = RIG_POWER_ON; // default to power if not available RETURNFUNC(RIG_OK); } @@ -6086,6 +6087,7 @@ int HAMLIB_API rig_get_powerstat(RIG *rig, powerstat_t *status) *status = RIG_POWER_OFF; // default now to power off until proven otherwise in get_powerstat HAMLIB_TRACE; retcode = rig->caps->get_powerstat(rig, status); + if (retcode == -RIG_ETIMEOUT) status = RIG_POWER_OFF; RETURNFUNC(retcode); } diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c index 02c80195..9cefcb0a 100644 --- a/tests/rigctl_parse.c +++ b/tests/rigctl_parse.c @@ -4741,7 +4741,7 @@ declare_proto_rig(get_powerstat) if (status != RIG_OK) { - RETURNFUNC(status); + stat = status; } if ((interactive && prompt) || (interactive && !prompt && ext_resp)) commit 3fd698d063906b1fbda4db75d38692202dbd322c Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Jan 24 11:22:19 2023 -0600 Change QRP QRDX PTT to use TQ instead TX...more incompability with TS-480 standard diff --git a/rigs/kenwood/ts480.c b/rigs/kenwood/ts480.c index 1d4fb807..59eb9d7a 100644 --- a/rigs/kenwood/ts480.c +++ b/rigs/kenwood/ts480.c @@ -1251,6 +1251,30 @@ int ts480_init(RIG *rig) RETURNFUNC(RIG_OK); } +int qdx_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) +{ + const char *ptt_cmd; + + ENTERFUNC; + rig_debug(RIG_DEBUG_VERBOSE, "%s: ptt=%d\n", __func__, ptt); + + switch (ptt) + { + case RIG_PTT_ON: ptt_cmd = "TQ1"; break; + + case RIG_PTT_OFF: ptt_cmd = "TQ0"; break; + + default: RETURNFUNC(-RIG_EINVAL); + } + + int retval = kenwood_transaction(rig, ptt_cmd, NULL, 0); + + //if (ptt == RIG_PTT_OFF) { hl_usleep(100 * 1000); } // a little time for PTT to turn off + + RETURNFUNC(retval); +} + + /* * TS-480 rig capabilities * Notice that some rigs share the same functions. @@ -1457,7 +1481,7 @@ const struct rig_caps qrplabs_caps = RIG_MODEL(RIG_MODEL_QRPLABS), .model_name = "QCX/QDX", .mfg_name = "QRPLabs", - .version = BACKEND_VER ".0", + .version = BACKEND_VER ".1", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -1780,7 +1804,7 @@ const struct rig_caps pt8000a_caps = .set_split_vfo = kenwood_set_split_vfo, .get_split_vfo = kenwood_get_split_vfo_if, .get_ptt = kenwood_get_ptt, - .set_ptt = kenwood_set_ptt, + .set_ptt = qdx_set_ptt, .get_dcd = kenwood_get_dcd, .set_powerstat = kenwood_set_powerstat, .get_powerstat = kenwood_get_powerstat, commit b977858da94b3e1e88706f2be9d6ebc5ce8fc4b6 Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Jan 23 14:50:59 2023 -0600 Update NEWS diff --git a/NEWS b/NEWS index ff9b3656..378ee292 100644 --- a/NEWS +++ b/NEWS @@ -25,6 +25,7 @@ Version 4.6 * Fix FTDX3000 rig split Version 4.5.5 + * Remove EX103 check for FTDX5000 * Fix K3/K3S VFOB setting of mode/width * Fix AGC level display in rigctld * Change FTDX10 to no serial handshake commit d68c218a3d249d14313086cb9c1c2312cdbba0d0 Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Jan 23 14:49:06 2023 -0600 ERemove EX103 get/set for FTDX5000 diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 39d94072..10ea9b1f 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -641,6 +641,7 @@ int newcat_open(RIG *rig) rig_debug(RIG_DEBUG_VERBOSE, "%s: disabling FTDX3000 band select\n", __func__); } +#if 0 // this apparently does not work if (is_ftdx5000) { // Remember EX103 status @@ -663,6 +664,7 @@ int newcat_open(RIG *rig) if (priv->ret_data[6] == ';') { priv->front_rear_status = priv->ret_data[5]; } } +#endif RETURNFUNC(RIG_OK); } @@ -695,6 +697,7 @@ int newcat_close(RIG *rig) priv->poweron = 0; } +#if 0 // this apparently does not work -- we can't query EX103 if (is_ftdx5000) { // Restore EX103 status @@ -703,6 +706,7 @@ int newcat_close(RIG *rig) rig_debug(RIG_DEBUG_TRACE, "%s: cmd_str = %s\n", __func__, priv->cmd_str); newcat_set_cmd(rig); // don't care about the return } +#endif RETURNFUNC(RIG_OK); } diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h index db1d64c4..60b2c9ad 100644 --- a/rigs/yaesu/newcat.h +++ b/rigs/yaesu/newcat.h @@ -50,7 +50,7 @@ typedef char ncboolean; /* shared function version */ -#define NEWCAT_VER "20230115" +#define NEWCAT_VER "20230123" /* Hopefully large enough for future use, 128 chars plus '\0' */ #define NEWCAT_DATA_LEN 129 commit 79129087e0ed550dc19b7c435dc46ad948c61751 Merge: af941307 90756027 Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Jan 23 09:12:48 2023 -0600 Merge branch 'master' of https://github.com/Hamlib/Hamlib commit af941307495d3616ff78cc1fb37b96b87109a765 Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Jan 23 09:10:58 2023 -0600 Update NEWS diff --git a/NEWS b/NEWS index a1b4ac1c..ff9b3656 100644 --- a/NEWS +++ b/NEWS @@ -25,6 +25,7 @@ Version 4.6 * Fix FTDX3000 rig split Version 4.5.5 + * Fix K3/K3S VFOB setting of mode/width * Fix AGC level display in rigctld * Change FTDX10 to no serial handshake * Add TS2000 to has_ps exception commit 907560270eca870606ed6002efaa69577f50c7ab Author: Michael Black <mdb...@ya...> Date: Mon Jan 23 08:34:58 2023 -0600 Update test.json Add WidthUpper/Lower to json draft diff --git a/bindings/csharp/multicast/test.json b/bindings/csharp/multicast/test.json index d417acce..488fbaa5 100644 --- a/bindings/csharp/multicast/test.json +++ b/bindings/csharp/multicast/test.json @@ -7,6 +7,8 @@ "Freq": 14074000, "Mode": "USB", "Width": 5000, + "WidthLower": 200, + "WidthUpper": 3000, "RX": true, "TX": false }, @@ -15,8 +17,10 @@ "Freq": 14076000, "Mode": "USB", "Width": 5000, + "WidthLower": 200, + "WidthUpper": 3000, "RX": false, - "TX": false + "TX": true }], "__comment_spectrum__": "Rigs that have spectrum output may include this data", commit 52bed765eff14c752aafd4814f5cf3b7e6ac3d41 Author: Mike Black W9MDB <mdb...@ya...> Date: Sun Jan 22 23:41:21 2023 -0600 Clean up rig power on/off sequencing for Kenwood/Elecraft rigs Note that the K3/K3S cannot power on via CAT control https://github.com/Hamlib/Hamlib/issues/1225 diff --git a/rigs/kenwood/elecraft.c b/rigs/kenwood/elecraft.c index 077a4aa4..4d93369c 100644 --- a/rigs/kenwood/elecraft.c +++ b/rigs/kenwood/elecraft.c @@ -97,11 +97,19 @@ int elecraft_open(RIG *rig) char buf[KENWOOD_MAX_BUF_LEN]; struct kenwood_priv_data *priv = rig->state.priv; char *model = "Unknown"; + struct rig_state *rs = &rig->state; rig_debug(RIG_DEBUG_VERBOSE, "%s called, rig version=%s\n", __func__, rig->caps->version); + if (rs->auto_power_on && priv->poweron == 0) + { + rig_set_powerstat(rig, 1); + priv->poweron = 1; + } + + /* Actual read extension levels from radio. * * The value stored in the k?_ext_lvl variables map to diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index a82fc261..e3da638d 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -342,6 +342,8 @@ transaction_write: skip |= strncmp(cmdstr, "RU", 2) == 0; skip |= strncmp(cmdstr, "RD", 2) == 0; skip |= strncmp(cmdstr, "KYW", 3) == 0; + skip |= strncmp(cmdstr, "PS1", 3) == 0; + skip |= strncmp(cmdstr, "PS0", 3) == 0; if (skip) { @@ -825,6 +827,14 @@ int kenwood_open(RIG *rig) id[0] = 0; rig->state.rigport.retry = 0; + + if (rig->state.auto_power_on) + { + // Ensure rig is on + rig_set_powerstat(rig, 1); + sleep(1); + } + err = kenwood_get_id(rig, id); if (err != RIG_OK) @@ -857,14 +867,6 @@ int kenwood_open(RIG *rig) err = RIG_OK; // reset our err back to OK for later checks } - if (err == -RIG_ETIMEOUT && rig->state.auto_power_on) - { - // Ensure rig is on - rig_set_powerstat(rig, 1); - /* Try get id again */ - err = kenwood_get_id(rig, id); - } - if (RIG_OK != err) { rig_debug(RIG_DEBUG_ERR, @@ -1069,6 +1071,8 @@ int kenwood_close(RIG *rig) ENTERFUNC; + if (priv->poweron == 0) { RETURNFUNC(RIG_OK); } // nothing to do + if (!no_restore_ai && priv->trn_state >= 0) { /* restore AI state */ @@ -4825,9 +4829,16 @@ int kenwood_get_trn(RIG *rig, int *trn) */ int kenwood_set_powerstat(RIG *rig, powerstat_t status) { - int retval = kenwood_transaction(rig, - (status == RIG_POWER_ON) ? ";;;;PS1;" : "PS0", - NULL, 0); + int retval; + struct kenwood_priv_data *priv = rig->state.priv; + + if ((priv->is_k3 || priv->is_k3s) && status == RIG_POWER_ON) + { + rig_debug(RIG_DEBUG_ERR, + "%s: K3/K3S must use aux I/O jack pulled low to power on\n", __func__); + return -RIG_EPOWER; + } + int i = 0; int retry_save = rig->state.rigport.retry; @@ -4835,6 +4846,10 @@ int kenwood_set_powerstat(RIG *rig, powerstat_t status) rig->state.rigport.retry = 0; + retval = kenwood_transaction(rig, + (status == RIG_POWER_ON) ? ";;;;PS1;" : "PS0", + NULL, 0); + if (status == RIG_POWER_ON) // wait for wakeup only { for (i = 0; i < 8; ++i) // up to ~10 seconds including the timeouts diff --git a/src/rig.c b/src/rig.c index 2aa101ab..65927287 100644 --- a/src/rig.c +++ b/src/rig.c @@ -1267,6 +1267,19 @@ int HAMLIB_API rig_open(RIG *rig) if (caps->rig_open != NULL) { + if (caps->get_powerstat != NULL) + { + powerstat_t powerflag; + status = rig_get_powerstat(rig, &powerflag); + if (status == RIG_OK && powerflag == RIG_POWER_OFF) return (-RIG_EPOWER); + // don't need auto_power_on if power is already on + if (status == RIG_OK && powerflag == RIG_POWER_ON) rig->state.auto_power_on = 0; + if (status == -RIG_ETIMEOUT) { + rig_debug(RIG_DEBUG_ERR, "%s: Some rigs cannot get_powerstat while off\n", __func__); + rig_debug(RIG_DEBUG_ERR, "%s: Known rigs: K3, K3S\n", __func__); + return (-RIG_EPOWER); + } + } status = caps->rig_open(rig); if (status != RIG_OK) diff --git a/tests/rigctl.c b/tests/rigctl.c index f29defe9..081f25d7 100644 --- a/tests/rigctl.c +++ b/tests/rigctl.c @@ -565,8 +565,8 @@ int main(int argc, char *argv[]) if (retcode != RIG_OK) { - fprintf(stderr, "rig_open: error = %s %s \n", rig_file, - strerror(errno)); +// fprintf(stderr, "rig_open: error = %s %s \n", rig_file, +// rigerror(retcode)); if (!ignore_rig_open_error) { exit(2); } } commit 9626894029686803544cae7860f34b362dd7a19b Author: Mike Black W9MDB <mdb...@ya...> Date: Sun Jan 22 16:45:22 2023 -0600 Fix K3/K3S VFOB mode/bandwidth setting https://github.com/Hamlib/Hamlib/issues/1224 diff --git a/rigs/kenwood/k3.c b/rigs/kenwood/k3.c index 336b30bc..0956e575 100644 --- a/rigs/kenwood/k3.c +++ b/rigs/kenwood/k3.c @@ -190,7 +190,7 @@ const struct rig_caps k3_caps = RIG_MODEL(RIG_MODEL_K3), .model_name = "K3", .mfg_name = "Elecraft", - .version = BACKEND_VER ".25", + .version = BACKEND_VER ".26", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -343,7 +343,7 @@ const struct rig_caps k3s_caps = RIG_MODEL(RIG_MODEL_K3S), .model_name = "K3S", .mfg_name = "Elecraft", - .version = BACKEND_VER ".20", + .version = BACKEND_VER ".21", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -960,15 +960,21 @@ int k3_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) int err; rmode_t temp_m; pbwidth_t temp_w; - char *cmd_mode = "DT"; + char *cmd_data = "DT"; char *cmd_bw = "BW"; int cmd_bw_len = 6; + struct kenwood_priv_data *priv = rig->state.priv; rig_debug(RIG_DEBUG_VERBOSE, "%s called vfo=%s\n", __func__, rig_strvfo(vfo)); - if (vfo == RIG_VFO_B && rig->caps->rig_model == RIG_MODEL_K4) + if ((priv->is_k3 || priv->is_k3s || priv->is_k4 || priv->is_k4d + || priv->is_k4hd) && vfo == RIG_VFO_B) { - cmd_mode = "DT$"; + if (!(priv->is_k3 || priv->is_k3s)) + { + cmd_data = "DT$"; + } + cmd_bw = "BW$"; cmd_bw_len = 7; @@ -993,8 +999,8 @@ int k3_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) if (temp_m == RIG_MODE_RTTY) { - err = kenwood_safe_transaction(rig, cmd_mode, buf, KENWOOD_MAX_BUF_LEN, - strlen(cmd_mode) + 1); + err = kenwood_safe_transaction(rig, cmd_data, buf, KENWOOD_MAX_BUF_LEN, + strlen(cmd_data) + 1); if (err != RIG_OK) { @@ -1021,8 +1027,8 @@ int k3_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) } else if (temp_m == RIG_MODE_RTTYR) { - err = kenwood_safe_transaction(rig, cmd_mode, buf, KENWOOD_MAX_BUF_LEN, - strlen(cmd_mode) + 1); + err = kenwood_safe_transaction(rig, cmd_data, buf, KENWOOD_MAX_BUF_LEN, + strlen(cmd_data) + 1); if (err != RIG_OK) { diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index 1abad7a1..a82fc261 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -2640,8 +2640,8 @@ int kenwood_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) } else { - if (vfo == RIG_VFO_B - && rig->caps->rig_model == RIG_MODEL_K4) // K4 new MD$ command for VFOB + if ((priv->is_k3 || priv->is_k3s || priv->is_k4 || priv->is_k4d + || priv->is_k4hd) && vfo == RIG_VFO_B) { SNPRINTF(cmd, sizeof(cmd), "MD$"); offs = 3; diff --git a/rigs/kenwood/kenwood.h b/rigs/kenwood/kenwood.h index d0c077a0..45494637 100644 --- a/rigs/kenwood/kenwood.h +++ b/rigs/kenwood/kenwood.h @@ -29,7 +29,7 @@ #include "misc.h" #include "idx_builtin.h" -#define BACKEND_VER "20230115" +#define BACKEND_VER "20230222" #define EOM_KEN ';' #define EOM_TH '\r' commit 9b89a99f9985b90acfcb462647e0b9348cc9930f Merge: d16b52e4 407b0fcc Author: Mike Black W9MDB <mdb...@ya...> Date: Sun Jan 22 10:49:45 2023 -0600 Merge branch 'master' of https://github.com/Hamlib/Hamlib commit d16b52e414c7e2862dab145dee30eda3487ba04f Author: Mike Black W9MDB <mdb...@ya...> Date: Sun Jan 22 10:43:58 2023 -0600 Fix IC7300 5 second sleep during poweron Reverse ID-5100 logic for dual watch mode https://github.com/Hamlib/Hamlib/issues/1220 diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 3a700127..76929d4c 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -6620,7 +6620,7 @@ int icom_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo) if (priv_caps->dualwatch_split) { - int wvfo = tx_vfo & (RIG_VFO_A | RIG_VFO_MAIN) ? S_MAIN : S_SUB; + int wvfo = tx_vfo & (RIG_VFO_A | RIG_VFO_MAIN) ? S_SUB : S_MAIN; if (RIG_OK != (retval = icom_set_func(rig, RIG_VFO_CURR, RIG_FUNC_DUAL_WATCH, split_sc))) @@ -8020,6 +8020,11 @@ int icom_set_powerstat(RIG *rig, powerstat_t status) priv->serial_USB_echo_off = 1; retval = icom_transaction(rig, C_SET_PWR, pwr_sc, NULL, 0, ackbuf, &ack_len); + if (rig->caps->rig_model == RIG_MODEL_IC7300) + { + rig_debug(RIG_DEBUG_VERBOSE, "%s: waiting 5 seconds for rig to wake up\n", __func__); + sleep(5); // IC7300 is slow to start up -- may need to add more rigs + } // poweron == 0 means never powered -- == 2 means CAT turned off if (priv->poweron == 0 || priv->poweron == 2) @@ -8051,11 +8056,6 @@ int icom_set_powerstat(RIG *rig, powerstat_t status) if (status == RIG_POWER_ON) // wait for wakeup only { - if (rig->caps->rig_model == RIG_MODEL_IC7300) - { - rig_debug(RIG_DEBUG_VERBOSE, "%s: waiting 5 seconds for rig to wake up\n", __func__); - sleep(5); // IC7300 is slow to start up -- may need to add more rigs - } for (i = 0; i < retry; ++i) // up to 10 attempts { freq_t freq; diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h index a72ba5ed..6157453c 100644 --- a/rigs/icom/icom.h +++ b/rigs/icom/icom.h @@ -31,7 +31,7 @@ #include <sys/time.h> #endif -#define BACKEND_VER "20230121" +#define BACKEND_VER "20230122" #define ICOM_IS_ID31 rig_is_model(rig, RIG_MODEL_ID31) #define ICOM_IS_ID51 rig_is_model(rig, RIG_MODEL_ID51) commit 407b0fcc5414989d6032d845d139fb7b701ddfdc Author: Mike Black W9MDB <mdb...@ya...> Date: Sun Jan 22 10:43:58 2023 -0600 Fix IC7300 5 second sleep during poweron https://github.com/Hamlib/Hamlib/issues/1220 diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 3a700127..76929d4c 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -6620,7 +6620,7 @@ int icom_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo) if (priv_caps->dualwatch_split) { - int wvfo = tx_vfo & (RIG_VFO_A | RIG_VFO_MAIN) ? S_MAIN : S_SUB; + int wvfo = tx_vfo & (RIG_VFO_A | RIG_VFO_MAIN) ? S_SUB : S_MAIN; if (RIG_OK != (retval = icom_set_func(rig, RIG_VFO_CURR, RIG_FUNC_DUAL_WATCH, split_sc))) @@ -8020,6 +8020,11 @@ int icom_set_powerstat(RIG *rig, powerstat_t status) priv->serial_USB_echo_off = 1; retval = icom_transaction(rig, C_SET_PWR, pwr_sc, NULL, 0, ackbuf, &ack_len); + if (rig->caps->rig_model == RIG_MODEL_IC7300) + { + rig_debug(RIG_DEBUG_VERBOSE, "%s: waiting 5 seconds for rig to wake up\n", __func__); + sleep(5); // IC7300 is slow to start up -- may need to add more rigs + } // poweron == 0 means never powered -- == 2 means CAT turned off if (priv->poweron == 0 || priv->poweron == 2) @@ -8051,11 +8056,6 @@ int icom_set_powerstat(RIG *rig, powerstat_t status) if (status == RIG_POWER_ON) // wait for wakeup only { - if (rig->caps->rig_model == RIG_MODEL_IC7300) - { - rig_debug(RIG_DEBUG_VERBOSE, "%s: waiting 5 seconds for rig to wake up\n", __func__); - sleep(5); // IC7300 is slow to start up -- may need to add more rigs - } for (i = 0; i < retry; ++i) // up to 10 attempts { freq_t freq; diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h index a72ba5ed..6157453c 100644 --- a/rigs/icom/icom.h +++ b/rigs/icom/icom.h @@ -31,7 +31,7 @@ #include <sys/time.h> #endif -#define BACKEND_VER "20230121" +#define BACKEND_VER "20230122" #define ICOM_IS_ID31 rig_is_model(rig, RIG_MODEL_ID31) #define ICOM_IS_ID51 rig_is_model(rig, RIG_MODEL_ID51) commit 344779eaf199fdfeea750db88820aab537835270 Author: Mike Black W9MDB <mdb...@ya...> Date: Sun Jan 22 10:02:46 2023 -0600 Add draft HamlibGUI controller using dotnet and GTK. Should compile on Windows, Linux, and MacOS with appropriate dotnet package installed See README.TXT in directory https://github.com/Hamlib/Hamlib/issues/1223 diff --git a/bindings/csharp/hamlibgui/MainWindow.cs b/bindings/csharp/hamlibgui/MainWindow.cs new file mode 100644 index 00000000..82701193 --- /dev/null +++ b/bindings/csharp/hamlibgui/MainWindow.cs @@ -0,0 +1,48 @@ +using System; +using Gtk; +using UI = Gtk.Builder.ObjectAttribute; + +namespace hamlibgui +{ +class MainWindow : Window +{ + [UI] private Label _label1 = null; + [UI] private Button _button1 = null; + + private bool connectFlag; + + public MainWindow() : this(new Builder("MainWindow.glade")) { } + + private MainWindow(Builder builder) : base( + builder.GetRawOwnedObject("MainWindow")) + { + builder.Autoconnect(this); + + DeleteEvent += Window_DeleteEvent; + _button1.Clicked += Button1_Clicked; + } + + private void Window_DeleteEvent(object sender, DeleteEventArgs a) + { + Application.Quit(); + } + + private void Button1_Clicked(object sender, EventArgs a) + { + connectFlag = !connectFlag; + + if (connectFlag) + { + String mytext = "Rig Connected (not really)"; + _label1.Text = mytext; + _button1.Label = "Disconnect Rig"; + } + else + { + String mytext = "Rig not Connected "; + _label1.Text = mytext; + _button1.Label = "Connect to Rig"; + } + } +} +} diff --git a/bindings/csharp/hamlibgui/MainWindow.glade b/bindings/csharp/hamlibgui/MainWindow.glade new file mode 100755 index 00000000..abc5b731 --- /dev/null +++ b/bindings/csharp/hamlibgui/MainWindow.glade @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Generated with glade 3.38.2 --> +<interface> + <requires lib="gtk+" version="3.18"/> + <object class="GtkWindow" id="MainWindow"> + <property name="can-focus">False</property> + <property name="title" translatable="yes">Hamlib Control</property> + <property name="default-width">480</property> + <property name="default-height">240</property> + <child> + <object class="GtkBox"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="margin-left">4</property> + <property name="margin-right">4</property> + <property name="margin-top">4</property> + <property name="margin-bottom">4</property> + <property name="orientation">vertical</property> + <child> + <object class="GtkLabel" id="_label1"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="label" translatable="yes">Hamlib controller to go here</property> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkButton" id="_button1"> + <property name="label" translatable="yes">Connect to Rig</property> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="receives-default">True</property> + <property name="tooltip-markup" translatable="yes">Click to connect/disconnect rig</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> + </child> + </object> +</interface> diff --git a/bindings/csharp/hamlibgui/Program.cs b/bindings/csharp/hamlibgui/Program.cs new file mode 100755 index 00000000..1bad8e7a --- /dev/null +++ b/bindings/csharp/hamlibgui/Program.cs @@ -0,0 +1,23 @@ +using System; +using Gtk; + +namespace hamlibgui +{ + class Program + { + [STAThread] + public static void Main(string[] args) + { + Application.Init(); + + var app = new Application("org.hamlibgui.hamlibgui", GLib.ApplicationFlags.None); + app.Register(GLib.Cancellable.Current); + + var win = new MainWindow(); + app.AddWindow(win); + + win.Show(); + Application.Run(); + } + } +} diff --git a/bindings/csharp/hamlibgui/README.txt b/bindings/csharp/hamlibgui/README.txt new file mode 100644 index 00000000..4020be1e --- /dev/null +++ b/bindings/csharp/hamlibgui/README.txt @@ -0,0 +1,18 @@ +This is a test of creating a portable Hamlib GUI controller using dotnet and GTK +Should be able to compile on Windows, Linux, and MacOS +No guarante this will go anywhere depending on ability to talk to Hamlib via C# + +On Windows +dotnet new install GtkSharp.Template.CSharp +dotnet build + + + + +On Ubuntu I don't see the GtkSharp package -- but you can build the code generated on the Windows side. +apt install dotnet-sdk-6.0 +dotnet build + + +Note: On Windows you can create a skeleton GTK app +dotnet new gtkapp diff --git a/bindings/csharp/hamlibgui/hamlibgui.csproj b/bindings/csharp/hamlibgui/hamlibgui.csproj new file mode 100755 index 00000000..459dedc8 --- /dev/null +++ b/bindings/csharp/hamlibgui/hamlibgui.csproj @@ -0,0 +1,19 @@ +<Project Sdk="Microsoft.NET.Sdk"> + + <PropertyGroup> + <OutputType>WinExe</OutputType> + <TargetFramework>net6.0</TargetFramework> + </PropertyGroup> + + <ItemGroup> + <None Remove="**\*.glade" /> + <EmbeddedResource Include="**\*.glade"> + <LogicalName>%(Filename)%(Extension)</LogicalName> + </EmbeddedResource> + </ItemGroup> + + <ItemGroup> + <PackageReference Include="GtkSharp" Version="3.24.24.*" /> + </ItemGroup> + +</Project> commit 18a2d91f59e0a04042bcaf68e47417f5d9695dbe Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Jan 21 22:49:51 2023 -0600 Add HAMLIB_VERSION_MAJOR, HAMLIB_VERSION_MINOR, and HAMLIB_VERSION_PATCH #defines https://github.com/Hamlib/Hamlib/issues/1209 diff --git a/configure.ac b/configure.ac index 0af90a70..ff777d51 100644 --- a/configure.ac +++ b/configure.ac @@ -59,11 +59,15 @@ dnl See README.release on setting these values # Set them here to keep c++/Makefile and src/Makefile in sync. ABI_VERSION=4 ABI_REVISION=6 +ABI_PATCH=0 ABI_AGE=0 AC_DEFINE_UNQUOTED([ABI_VERSION], [$ABI_VERSION], [Frontend ABI version]) AC_DEFINE_UNQUOTED([ABI_REVISION], [$ABI_REVISION], [Frontend ABI revision]) AC_DEFINE_UNQUOTED([ABI_AGE], [$ABI_AGE], [Frontend ABI age]) +AC_DEFINE_UNQUOTED([ABI_VERSION_MAJOR], [$ABI_VERSION], [Frontend Major version]) +AC_DEFINE_UNQUOTED([ABI_VERSION_MINOR], [$ABI_REVISION], [Frontend Minor version]) +AC_DEFINE_UNQUOTED([ABI_VERSION_PATCH], [$ABI_PATCH], [Frontend Patch version]) AC_SUBST([ABI_VERSION]) AC_SUBST([ABI_REVISION]) commit 0c2426c800b754de0aa14a89421354e39473546f Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Jan 21 17:21:04 2023 -0600 Add 5 second sleep during power on for IC7300 https://github.com/Hamlib/Hamlib/issues/1220 diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 7cc67e52..3a700127 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -8051,6 +8051,11 @@ int icom_set_powerstat(RIG *rig, powerstat_t status) if (status == RIG_POWER_ON) // wait for wakeup only { + if (rig->caps->rig_model == RIG_MODEL_IC7300) + { + rig_debug(RIG_DEBUG_VERBOSE, "%s: waiting 5 seconds for rig to wake up\n", __func__); + sleep(5); // IC7300 is slow to start up -- may need to add more rigs + } for (i = 0; i < retry; ++i) // up to 10 attempts { freq_t freq; diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h index 6629fcad..a72ba5ed 100644 --- a/rigs/icom/icom.h +++ b/rigs/icom/icom.h @@ -31,7 +31,7 @@ #include <sys/time.h> #endif -#define BACKEND_VER "20230118" +#define BACKEND_VER "20230121" #define ICOM_IS_ID31 rig_is_model(rig, RIG_MODEL_ID31) #define ICOM_IS_ID51 rig_is_model(rig, RIG_MODEL_ID51) commit cdbd517228cf11d5a9e90d82fa534abc53d95eb4 Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Jan 21 12:55:44 2023 -0600 Remove double execution of get_powerstat -- was causing rigctld to give an error https://github.com/Hamlib/Hamlib/issues/1220 diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c index 2c417b47..02c80195 100644 --- a/tests/rigctl_parse.c +++ b/tests/rigctl_parse.c @@ -1731,23 +1731,6 @@ readline_repeat: else { - if (my_rig->caps->get_powerstat && (rig_powerstat == RIG_POWER_OFF - || rig_powerstat == RIG_POWER_STANDBY)) - { - // Update power status - powerstat_t stat = RIG_POWER_ON; - retcode = rig_get_powerstat(my_rig, &stat); - - if (retcode == RIG_OK) { rig_powerstat = stat; } - - if (rig_powerstat != RIG_POWER_ON) - { - rig_debug(RIG_DEBUG_ERR, - "%s: rig_powerstat is not on = %d\n", __func__, - rig_powerstat); - } - } - // Allow only certain commands when the rig is powered off if (retcode == RIG_OK && (rig_powerstat == RIG_POWER_OFF || rig_powerstat == RIG_POWER_STANDBY) commit cfde2c8a92105da471056fa70194ee10658c201f Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Jan 20 16:53:42 2023 -0600 Add ability for set_vfo_opt 0/1 so rigctl can control VFO option diff --git a/src/rig.c b/src/rig.c index 5eb5767f..2aa101ab 100644 --- a/src/rig.c +++ b/src/rig.c @@ -6917,10 +6917,14 @@ int HAMLIB_API rig_set_vfo_opt(RIG *rig, int status) RETURNFUNC(-RIG_EINVAL); } + // Only netrigctl has this function + // We allow the status to be set for rigctl use if (rig->caps->set_vfo_opt == NULL) { ELAPSED2; - RETURNFUNC(-RIG_ENAVAIL); + rig->state.vfo_opt = status; + //RETURNFUNC(-RIG_ENAVAIL); + RETURNFUNC(RIG_OK); } retcode = rig->caps->set_vfo_opt(rig, status); commit eb1d46723616ec3d94b453f0c1fed94bc977cfe5 Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Jan 20 15:39:23 2023 -0600 Fix segfault in aclog.c diff --git a/rigs/dummy/aclog.c b/rigs/dummy/aclog.c index d5a5a828..b3a95524 100644 --- a/rigs/dummy/aclog.c +++ b/rigs/dummy/aclog.c @@ -301,7 +301,7 @@ static int aclog_transaction(RIG *rig, char *cmd, char *value, // we get an unknown response if function does not exist if (strstr(xml, "UNKNOWN")) { set_transaction_inactive(rig); RETURNFUNC(RIG_ENAVAIL); } - strncpy(value, xml, value_len); + if (value) strncpy(value, xml, value_len); } while (((value && strlen(value) == 0)) commit 50a14bb08fdcccc59fc1f7cf803cd6866ee369f3 Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Jan 20 12:47:52 2023 -0600 Add ACLog rig -- should work with WSJT_X and Fake It mode -- mode setting is a bit odd though might need None for mode in WSJT-X and manually set rig diff --git a/include/hamlib/riglist.h b/include/hamlib/riglist.h index 9acb9a22..6d730595 100644 --- a/include/hamlib/riglist.h +++ b/include/hamlib/riglist.h @@ -71,7 +71,7 @@ #define RIG_MODEL_TRXMANAGER_RIG RIG_MAKE_MODEL(RIG_DUMMY, 5) #define RIG_MODEL_DUMMY_NOVFO RIG_MAKE_MODEL(RIG_DUMMY, 6) #define RIG_MODEL_TCI1X RIG_MAKE_MODEL(RIG_DUMMY, 7) - +#define RIG_MODEL_ACLOG RIG_MAKE_MODEL(RIG_DUMMY, 8) /* * Yaesu @@ -128,7 +128,6 @@ #define RIG_MODEL_FT990UNI RIG_MAKE_MODEL(RIG_YAESU, 48) #define RIG_MODEL_FT710 RIG_MAKE_MODEL(RIG_YAESU, 49) - /* * Kenwood */ @@ -274,7 +273,6 @@ #define RIG_MODEL_G90 RIG_MAKE_MODEL(RIG_ICOM, 88) /* Xiegu G90 */ #define RIG_MODEL_X5105 RIG_MAKE_MODEL(RIG_ICOM, 89) /* Xiegu X5105 -- G90 compatible */ - /* * Optoelectronics (CI-V) */ @@ -283,7 +281,6 @@ #define RIG_MODEL_OS535 RIG_MAKE_MODEL(RIG_ICOM, 52) #define RIG_MODEL_OS456 RIG_MAKE_MODEL(RIG_ICOM, 53) - /* * TenTec (CI-V) */ @@ -292,7 +289,6 @@ #define RIG_MODEL_PARAGON2 RIG_MAKE_MODEL(RIG_ICOM, 59) #define RIG_MODEL_DELTAII RIG_MAKE_MODEL(RIG_ICOM, 64) - /* * Icom PCR */ @@ -303,7 +299,6 @@ #define RIG_MODEL_PCR1500 RIG_MAKE_MODEL(RIG_PCR, 3) #define RIG_MODEL_PCR2500 RIG_MAKE_MODEL(RIG_PCR, 4) - /* * AOR */ @@ -326,7 +321,6 @@ #define RIG_MODEL_AR7030P RIG_MAKE_MODEL(RIG_AOR, 15) #define RIG_MODEL_SR2200 RIG_MAKE_MODEL(RIG_AOR, 16) - /* * JRC */ @@ -340,7 +334,6 @@ #define RIG_MODEL_NRD535 RIG_MAKE_MODEL(RIG_JRC, 6) #define RIG_MODEL_NRD545 RIG_MAKE_MODEL(RIG_JRC, 7) - /* * Radio Shack * Actually, they might be either Icom or Uniden. TBC --SF @@ -354,7 +347,6 @@ #define RIG_MODEL_RS2042 RIG_MAKE_MODEL(RIG_RADIOSHACK, 5) /* w/ OptoElectronics OS435 Board */ #define RIG_MODEL_RS2041 RIG_MAKE_MODEL(RIG_RADIOSHACK, 6) /* PRO-2041 */ - /* * Uniden */ @@ -373,7 +365,6 @@ #define RIG_MODEL_BCD996T RIG_MAKE_MODEL(RIG_UNIDEN, 11) #define RIG_MODEL_BC898 RIG_MAKE_MODEL(RIG_UNIDEN, 12) - /* * Drake */ @@ -383,7 +374,6 @@ #define RIG_MODEL_DKR8A RIG_MAKE_MODEL(RIG_DRAKE, 2) #define RIG_MODEL_DKR8B RIG_MAKE_MODEL(RIG_DRAKE, 3) - /* * Lowe */ @@ -394,7 +384,6 @@ #define RIG_MODEL_HF250 RIG_MAKE_MODEL(RIG_LOWE, 3) #define RIG_MODEL_HF235 RIG_MAKE_MODEL(RIG_LOWE, 4) - /* * Racal */ @@ -406,7 +395,6 @@ #define RIG_MODEL_RA3710 RIG_MAKE_MODEL(RIG_RACAL, 4) #define RIG_MODEL_RA3702 RIG_MAKE_MODEL(RIG_RACAL, 5) - /* * Watkins-Johnson */ @@ -417,7 +405,6 @@ #define RIG_MODEL_WJ8711 RIG_MAKE_MODEL(RIG_WJ, 3) #define RIG_MODEL_WJ8888 RIG_MAKE_MODEL(RIG_WJ, 4) - /* * Rohde & Schwarz--ek */ @@ -429,7 +416,6 @@ #define RIG_MODEL_EK895 RIG_MAKE_MODEL(RIG_EK, 4) #define RIG_MODEL_EK070 RIG_MAKE_MODEL(RIG_EK, 5) - /* * Skanti */ @@ -440,7 +426,6 @@ #define RIG_MODEL_TRP9000 RIG_MAKE_MODEL(RIG_SKANTI, 3) #define RIG_MODEL_TRP8255 RIG_MAKE_MODEL(RIG_SKANTI, 4) - /* * WiNRADiO/LinRADiO */ @@ -458,7 +443,6 @@ #define RIG_MODEL_G305 RIG_MAKE_MODEL(RIG_WINRADIO, 10) #define RIG_MODEL_G315 RIG_MAKE_MODEL(RIG_WINRADIO, 11) - /* * Ten Tec */ @@ -477,7 +461,6 @@ #define RIG_MODEL_RX331 RIG_MAKE_MODEL(RIG_TENTEC, 12) #define RIG_MODEL_TT599 RIG_MAKE_MODEL(RIG_TENTEC, 13) /* Eagle */ - /* * Alinco */ @@ -486,7 +469,6 @@ #define RIG_MODEL_DX77 RIG_MAKE_MODEL(RIG_ALINCO, 1) #define RIG_MODEL_DXSR8 RIG_MAKE_MODEL(RIG_ALINCO, 2) - /* * Kachina */ @@ -494,7 +476,6 @@ #define RIG_BACKEND_KACHINA "kachina" #define RIG_MODEL_505DSP RIG_MAKE_MODEL(RIG_KACHINA, 1) - /* * Gnuradio backend */ @@ -506,7 +487,6 @@ #define RIG_MODEL_GRAUDIOIQ RIG_MAKE_MODEL(RIG_GNURADIO, 4) /* I&Q stereo sound card source */ #define RIG_MODEL_USRP_G RIG_MAKE_MODEL(RIG_GNURADIO, 5) /* Universal Software Radio Peripheral */ - /* * Microtune tuners */ @@ -516,7 +496,6 @@ #define RIG_MODEL_MICROTUNE_4702 RIG_MAKE_MODEL(RIG_MICROTUNE, 2) /* Alan's */ #define RIG_MODEL_MICROTUNE_4707 RIG_MAKE_MODEL(RIG_MICROTUNE, 3) - /* * TAPR */ @@ -524,7 +503,6 @@ #define RIG_BACKEND_TAPR "tapr" #define RIG_MODEL_DSP10 RIG_MAKE_MODEL(RIG_TAPR, 1) - /* * Flex-radio */ @@ -535,7 +513,6 @@ #define RIG_MODEL_DTTSP RIG_MAKE_MODEL(RIG_FLEXRADIO, 3) #define RIG_MODEL_DTTSP_UDP RIG_MAKE_MODEL(RIG_FLEXRADIO, 4) - /* * VEB Funkwerk Köpenick RFT */ @@ -543,7 +520,6 @@ #define RIG_BACKEND_RFT "rft" #define RIG_MODEL_EKD500 RIG_MAKE_MODEL(RIG_RFT, 1) - /* * Various kits */ @@ -569,7 +545,6 @@ #define RIG_MODEL_FUNCUBEDONGLEPLUS RIG_MAKE_MODEL(RIG_KIT, 18) /* FunCUBE Dongle Pro+ */ #define RIG_MODEL_RSHFIQ RIG_MAKE_MODEL(RIG_KIT, 19) /* RS-HFIQ */ - /* * SW/FM/TV tuner cards supported by Video4Linux,*BSD, .. */ @@ -578,7 +553,6 @@ #define RIG_MODEL_V4L RIG_MAKE_MODEL(RIG_TUNER, 1) #define RIG_MODEL_V4L2 RIG_MAKE_MODEL(RIG_TUNER, 2) - /* * Rohde & Schwarz--rs */ @@ -589,7 +563,6 @@ #define RIG_MODEL_XK2100 RIG_MAKE_MODEL(RIG_RS, 3) #define RIG_MODEL_EK89X RIG_MAKE_MODEL(RIG_RS, 4) - /* * Phillips/Simoco PRM80 */ @@ -598,7 +571,6 @@ #define RIG_MODEL_PRM8060 RIG_MAKE_MODEL(RIG_PRM80, 1) #define RIG_MODEL_PRM8070 RIG_MAKE_MODEL(RIG_PRM80, 2) - /* * ADAT by HB9CBU * @@ -608,7 +580,6 @@ #define RIG_BACKEND_ADAT "adat" #define RIG_MODEL_ADT_200A RIG_MAKE_MODEL(RIG_ADAT, 1) - /* * ICOM Marine */ @@ -619,7 +590,6 @@ #define RIG_MODEL_IC_M710 RIG_MAKE_MODEL(RIG_ICMARINE, 3) #define RIG_MODEL_IC_M803 RIG_MAKE_MODEL(RIG_ICMARINE, 4) - /* * Dorji transceiver modules */ diff --git a/rigs/dummy/Makefile.am b/rigs/dummy/Makefile.am index 7a60bdce..5a419d3f 100644 --- a/rigs/dummy/Makefile.am +++ b/rigs/dummy/Makefile.am @@ -1,4 +1,4 @@ -DUMMYSRC = dummy_common.c dummy_common.h dummy.c dummy.h rot_dummy.c rot_dummy.h netrigctl.c netrotctl.c flrig.c flrig.h trxmanager.c trxmanager.h amp_dummy.c amp_dummy.h netampctl.c tci1x.c +DUMMYSRC = dummy_common.c dummy_common.h dummy.c dummy.h rot_dummy.c rot_dummy.h netrigctl.c netrotctl.c flrig.c flrig.h trxmanager.c trxmanager.h amp_dummy.c amp_dummy.h netampctl.c tci1x.c aclog.c noinst_LTLIBRARIES = libhamlib-dummy.la libhamlib_dummy_la_SOURCES = $(DUMMYSRC) diff --git a/rigs/dummy/aclog.c b/rigs/dummy/aclog.c new file mode 100644 index 00000000..d5a5a828 --- /dev/null +++ b/rigs/dummy/aclog.c @@ -0,0 +1,994 @@ +/* +* Hamlib ACLog backend - main file +* Copyright (c) 2023 by Michael Black W9MDB +* +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; either +* version 2.1 of the License, or (at your option) any later version. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +* +*/ +#include <hamlib/config.h> + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#include <hamlib/rig.h> +#include <serial.h> +#include <misc.h> +#include <token.h> +#include <register.h> +#include <network.h> + +#include "dummy_common.h" + +#define DEBUG 1 +#define DEBUG_TRACE DEBUG_VERBOSE +#define TRUE 1 +#define FALSE 0 + + +#define MAXCMDLEN 8192 +#define MAXXMLLEN 8192 +#define MAXARGLEN 128 +#define MAXBANDWIDTHLEN 4096 + +#define DEFAULTPATH "127.0.0.1:1100" + +#define ACLOG_VFOS (RIG_VFO_A) + +#define ACLOG_MODES (RIG_MODE_AM | RIG_MODE_PKTAM | RIG_MODE_CW | RIG_MODE_CWR |\ + RIG_MODE_RTTY | RIG_MODE_RTTYR |\ + RIG_MODE_PKTLSB | RIG_MODE_PKTUSB |\ + RIG_MODE_SSB | RIG_MODE_LSB | RIG_MODE_USB |\ + RIG_MODE_FM | RIG_MODE_WFM | RIG_MODE_FMN | RIG_MODE_PKTFM |\ + RIG_MODE_C4FM) + +#define streq(s1,s2) (strcmp(s1,s2)==0) + +struct aclog_priv_data +{ + vfo_t curr_vfo; + char bandwidths[MAXBANDWIDTHLEN]; /* pipe delimited set returned from aclog */ + int nbandwidths; + char info[8192]; + ptt_t ptt; + split_t split; + rmode_t curr_modeA; + rmode_t curr_modeB; + freq_t curr_freqA; + freq_t curr_freqB; + pbwidth_t curr_widthA; + pbwidth_t curr_widthB; + int has_get_modeA; /* True if this function is available */ + int has_get_bwA; /* True if this function is available */ + int has_set_bwA; /* True if this function is available */ + float powermeter_scale; /* So we can scale power meter to 0-1 */ + value_t parms[RIG_SETTING_MAX]; + struct ext_list *ext_parms; +}; + +//Structure for mapping aclog dynmamic modes to hamlib modes +//aclog displays modes as the rig displays them +struct s_modeMap +{ + rmode_t mode_hamlib; + char *mode_aclog; +}; + +//ACLog will provide us the modes for the selected rig +//We will then put them in this struct +static struct s_modeMap modeMap[] = +{ + {RIG_MODE_USB, "|USB|"}, + {RIG_MODE_USB, "|SSB|"}, + {RIG_MODE_LSB, "|LSB|"}, + {RIG_MODE_PKTUSB, NULL}, + {RIG_MODE_PKTLSB, NULL}, + {RIG_MODE_AM, "|AM|"}, + {RIG_MODE_FM, "|FM|"}, + {RIG_MODE_FMN, NULL}, + {RIG_MODE_WFM, NULL}, + {RIG_MODE_CW, "|CW|"}, + {RIG_MODE_CWR, "|CWR|"}, + {RIG_MODE_RTTY, "|RTTY|"}, + {RIG_MODE_RTTYR, "|RTTYR|"}, + {RIG_MODE_C4FM, "|C4FM|"}, + {0, NULL} +}; + +/* +* check_vfo +* No assumptions +*/ +static int check_vfo(vfo_t vfo) +{ + switch (vfo) + { + case RIG_VFO_A: + break; + + case RIG_VFO_TX: + case RIG_VFO_B: + break; + + case RIG_VFO_CURR: + break; // will default to A in which_vfo + + default: + return (FALSE); + } + + return (TRUE); +} + +/* +* read_transaction +* Assumes rig!=NULL, xml!=NULL, xml_len>=MAXXMLLEN +*/ +static int read_transaction(RIG *rig, char *xml, int xml_len) +{ + int retval; + int retry; + char *delims; + char *terminator = "</CMD>\r\n"; + struct rig_state *rs = &rig->state; + + ENTERFUNC; + + retry = 2; + delims = "\n"; + xml[0] = 0; + + do + { + char tmp_buf[MAXXMLLEN]; // plenty big for expected aclog responses hopefully + + if (retry < 2) + { + rig_debug(RIG_DEBUG_WARN, "%s: retry needed? retry=%d\n", __func__, retry); + } + + int len = read_string(&rs->rigport, (unsigned char *) tmp_buf, sizeof(tmp_buf), + delims, + strlen(delims), 0, 1); + rig_debug(RIG_DEBUG_TRACE, "%s: string='%s'\n", __func__, tmp_buf); + + // if our first response we should see the HTTP header + if (strlen(xml) == 0 && strstr(tmp_buf, "<CMD>") == NULL) + { + rig_debug(RIG_DEBUG_ERR, "%s: Expected '</CMD>', got '%s'\n", __func__, + tmp_buf); + continue; // we'll try again + } + + if (len > 0) { retry = 3; } + + if (len <= 0) + { + rig_debug(RIG_DEBUG_ERR, "%s: read_string error=%d\n", __func__, len); + continue; + } + + if (strlen(xml) + strlen(tmp_buf) < xml_len - 1) + { + strncat(xml, tmp_buf, xml_len - 1); + } + else + { + rig_debug(RIG_DEBUG_ERR, + "%s: xml buffer overflow!!\nTrying to add len=%d\nTo len=%d\n", __func__, + (int)strlen(tmp_buf), (int)strlen(xml)); + RETURNFUNC(-RIG_EPROTO); + } + } + while (retry-- > 0 && strstr(xml, terminator) == NULL); + + if (retry == 0) + { + rig_debug(RIG_DEBUG_WARN, "%s: retry timeout\n", __func__); + RETURNFUNC(-RIG_ETIMEOUT); + } + + if (strstr(xml, terminator)) + { + rig_debug(RIG_DEBUG_TRACE, "%s: got %s\n", __func__, terminator); + retval = RIG_OK; + } + else + { + rig_debug(RIG_DEBUG_VERBOSE, "%s: did not get %s\n", __func__, terminator); + retval = -(101 + RIG_EPROTO); + } + + RETURNFUNC(retval); +} + +/* +* write_transaction +* Assumes rig!=NULL, xml!=NULL, xml_len=total size of xml for response +*/ +static int write_transaction(RIG *rig, char *xml, int xml_len) +{ + + int try = rig->caps->retry; + + int retval = -RIG_EPROTO; + + struct rig_state *rs = &rig->state; + + ENTERFUNC; + + // This shouldn't ever happen...but just in case + // We need to avoid an empty write as rigctld replies with blank line + if (xml_len == 0) + { + rig_debug(RIG_DEBUG_ERR, "%s: len==0??\n", __func__); + RETURNFUNC(retval); + } + + // appears we can lose sync if we don't clear things out + // shouldn't be anything for us now anyways + rig_flush(&rig->state.rigport); + + while (try-- >= 0 && retval != RIG_OK) + { + retval = write_block(&rs->rigport, (unsigned char *) xml, strlen(xml)); + + if (retval < 0) + { + RETURNFUNC(-RIG_EIO); + } + } + + RETURNFUNC(retval); +} + +static int aclog_transaction(RIG *rig, char *cmd, char *value, + int value_len) +{ + char xml[MAXXMLLEN]; + int retry = 3; + + ENTERFUNC; + ELAPSED1; + + set_transaction_active(rig); + + if (value) + { + value[0] = 0; + } + + do + { + int retval; + + if (retry != 3) + { + rig_debug(RIG_DEBUG_VERBOSE, "%s: cmd=%s, retry=%d\n", __func__, cmd, retry); + } + + retval = write_transaction(rig, cmd, strlen(cmd)); + + if (retval != RIG_OK) + { + rig_debug(RIG_DEBUG_ERR, "%s: write_transaction error=%d\n", __func__, retval); + + // if we get RIG_EIO the socket has probably disappeared + // so bubble up the error so port can re re-opened + if (retval == -RIG_EIO) { set_transaction_inactive(rig); RETURNFUNC(retval); } + + hl_usleep(50 * 1000); // 50ms sleep if error + } + + if (value) + { + read_transaction(rig, xml, sizeof(xml)); // this might time out -- that's OK + } + + // we get an unknown response if function does not exist + if (strstr(xml, "UNKNOWN")) { set_transaction_inactive(rig); RETURNFUNC(RIG_ENAVAIL); } + + strncpy(value, xml, value_len); + + } + while (((value && strlen(value) == 0)) + && retry--); // we'll do retries if needed + + if (value && strlen(value) == 0) + { + rig_debug(RIG_DEBUG_ERR, "%s: no value returned\n", __func__); + set_transaction_inactive(rig); RETURNFUNC(RIG_EPROTO); + } + + ELAPSED2; + set_transaction_inactive(rig); + RETURNFUNC(RIG_OK); +} + +/* +* aclog_init +* Assumes rig!=NULL +*/ +static int aclog_init(RIG *rig) +{ + struct aclog_priv_data *priv; + + ENTERFUNC; + rig_debug(RIG_DEBUG_TRACE, "%s version %s\n", __func__, rig->caps->version); + + rig->state.priv = (struct aclog_priv_data *)calloc(1, sizeof( + struct aclog_priv_data)); + + if (!rig->state.priv) + { + RETURNFUNC(-RIG_ENOMEM); + } + + priv = rig->state.priv; + + memset(priv, 0, sizeof(struct aclog_priv_data)); + memset(priv->parms, 0, RIG_SETTING_MAX * sizeof(value_t)); + + /* + * set arbitrary initial status + */ + rig->state.current_vfo = RIG_VFO_A; + priv->split = 0; + priv->ptt = 0; + priv->curr_modeA = -1; + priv->curr_modeB = -1; + priv->curr_widthA = -1; + priv->curr_widthB = -1; + + if (!rig->caps) + { + RETURNFUNC(-RIG_EINVAL); + } + + strncpy(rig->state.rigport.pathname, DEFAULTPATH, + sizeof(rig->state.rigport.pathname)); + + RETURNFUNC(RIG_OK); +} + +/* +* modeMapGet +* Assumes mode!=NULL +* Return the string for ACLog for the given hamlib mode +*/ +static const char *modeMapGet(rmode_t modeHamlib) +{ + int i; + + rig_debug(RIG_DEBUG_TRACE, "%s: called\n", __func__); + + for (i = 0; modeMap[i].mode_hamlib != 0; ++i) + { + if (modeMap[i].mode_aclog == NULL) { continue; } + + rig_debug(RIG_DEBUG_TRACE, + "%s: checking modeMap[%d]=%.0f to modeHamlib=%.0f, mode_aclog='%s'\n", __func__, + i, (double)modeMap[i].mode_hamlib, (double)modeHamlib, modeMap[i].mode_aclog); + + if (modeMap[i].mode_hamlib == modeHamlib && strlen(modeMap[i].mode_aclog) > 0) + { + rig_debug(RIG_DEBUG_TRACE, "%s matched mode=%.0f, returning '%s'\n", __func__, + (double)modeHamlib, modeMap[i].mode_aclog); + return (modeMap[i].mode_aclog); + } + } + + rig_debug(RIG_DEBUG_ERR, "%s: ACLog does not have mode: %s\n", __func__, + rig_strrmode(modeHamlib)); + return ("ERROR"); +} + +/* +* modeMapGetHamlib +* Assumes mode!=NULL +* Return the hamlib mode from the given ACLog string +*/ +static rmode_t modeMapGetHamlib(const char *modeACLog) +{ + int i; + char modeCheck[64]; + + SNPRINTF(modeCheck, sizeof(modeCheck), "|%s|", modeACLog); + + for (i = 0; modeMap[i].mode_hamlib != 0; ++i) + { + rig_debug(RIG_DEBUG_TRACE, "%s: find '%s' in '%s'\n", __func__, + modeCheck, modeMap[i].mode_aclog); + + if (modeMap[i].mode_aclog + && strcmp(modeMap[i].mode_aclog, modeCheck) == 0) + { + return (modeMap[i].mode_hamlib); + } + } + + rig_debug(RIG_DEBUG_TRACE, "%s: mode requested: %s, not in modeMap\n", __func__, + modeACLog); + return (RIG_MODE_NONE); +} + +/* +* aclog_get_freq +* Assumes rig!=NULL, rig->state.priv!=NULL, freq!=NULL +*/ +static int aclog_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) +{ + char value[MAXARGLEN]; + struct aclog_priv_data *priv = (struct aclog_priv_data *) rig->state.priv; + + ENTERFUNC; + rig_debug(RIG_DEBUG_TRACE, "%s: vfo=%s\n", __func__, + rig_strvfo(vfo)); + + + if (check_vfo(vfo) == FALSE) + { + rig_debug(RIG_DEBUG_ERR, "%s: unsupported VFO %s\n", + __func__, rig_strvfo(vfo)); + RETURNFUNC(-RIG_EINVAL); + } + + if (vfo == RIG_VFO_CURR) + { + vfo = rig->state.current_vfo; + rig_debug(RIG_DEBUG_TRACE, "%s: get_freq2 vfo=%s\n", + __func__, rig_strvfo(vfo)); + } + + char *cmd = "<CMD><READBMF></CMD>\r\n"; + int retval; + + retval = aclog_transaction(rig, cmd, value, sizeof(value)); + + if (retval != RIG_OK) + { + rig_debug(RIG_DEBUG_ERR, "%s: READBMF failed retval=%s\n", __func__, + rigerror(retval)); + RETURNFUNC(retval); + } + + char *p = strstr(value, "<FREQ>"); + *freq = 0; + + if (p) { sscanf(p, "<FREQ>%lf", freq); } + + *freq *= 1e6; // convert from MHz to Hz + + if (*freq == 0) + { + rig_debug(RIG_DEBUG_ERR, "%s: freq==0??\nvalue=%s\n", __func__, + value); + RETURNFUNC(-RIG_EPROTO); + } + else + { + rig_debug(RIG_DEBUG_TRACE, "%s: freq=%.0f\n", __func__, *freq); + } + + if (vfo == RIG_VFO_A) + { + priv->curr_freqA = *freq; + } + else // future support in ACL... [truncated message content] |
From: n0nb <n0...@us...> - 2023-01-18 12:58:18
|
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.5.5 has been created at dc1d9cf43ef330e8ea518e5bea99c1f83a63147c (commit) - Log ----------------------------------------------------------------- commit dc1d9cf43ef330e8ea518e5bea99c1f83a63147c Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Jan 17 23:54:05 2023 -0600 Fix AGC level display in rigctld https://github.com/Hamlib/Hamlib/issues/1155 diff --git a/NEWS b/NEWS index 23de5250..a1b4ac1c 100644 --- a/NEWS +++ b/NEWS @@ -25,6 +25,7 @@ Version 4.6 * Fix FTDX3000 rig split Version 4.5.5 + * Fix AGC level display in rigctld * Change FTDX10 to no serial handshake * Add TS2000 to has_ps exception * Add FT991 to 60M exception diff --git a/rigs/dummy/netrigctl.c b/rigs/dummy/netrigctl.c index c0ce157a..ad90419e 100644 --- a/rigs/dummy/netrigctl.c +++ b/rigs/dummy/netrigctl.c @@ -815,7 +815,7 @@ static int netrigctl_open(RIG *rig) int i = 0; char *p = strtok(value, " "); rig->caps->agc_levels[0] = RIG_AGC_NONE; // default value gets overwritten - rig->caps->agc_level_count = 1; + rig->caps->agc_level_count = 0; while (p) { @@ -2736,7 +2736,7 @@ struct rig_caps netrigctl_caps = RIG_MODEL(RIG_MODEL_NETRIGCTL), .model_name = "NET rigctl", .mfg_name = "Hamlib", - .version = "20230106.0", + .version = "20230117.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_OTHER, diff --git a/src/sprintflst.c b/src/sprintflst.c index 07e3c347..6a6c870f 100644 --- a/src/sprintflst.c +++ b/src/sprintflst.c @@ -939,7 +939,7 @@ int rig_sprintf_agc_levels(RIG *rig, char *str, int lenstr) { if (strlen(str) > 0) { strcat(str, " "); } - sprintf(tmpbuf, "%d=%s", i, + sprintf(tmpbuf, "%d=%s", rig->caps->agc_levels[i], rig_stragclevel(rig->caps->agc_levels[i])); if (strlen(str) + strlen(tmpbuf) < lenstr - 1) commit 8d20fa079f77329105a8d97d96d9cf5cd0cb59fb Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Jan 17 22:31:17 2023 -0600 Update NEWS diff --git a/NEWS b/NEWS index 536a8033..23de5250 100644 --- a/NEWS +++ b/NEWS @@ -25,6 +25,7 @@ Version 4.6 * Fix FTDX3000 rig split Version 4.5.5 + * Change FTDX10 to no serial handshake * Add TS2000 to has_ps exception * Add FT991 to 60M exception * Fix get_powerstat bad call in rigctl_parse.c commit f5dc6edc160d925c2fc5d06f4f7f78d64b32a236 Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Jan 17 22:30:02 2023 -0600 Change FTDX10 handshake to None instead of Hardware diff --git a/rigs/yaesu/ftdx10.c b/rigs/yaesu/ftdx10.c index 9daf5241..77101d8a 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 ".5", + .version = NEWCAT_VER ".6", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -149,7 +149,7 @@ const struct rig_caps ftdx10_caps = .serial_data_bits = 8, .serial_stop_bits = 2, .serial_parity = RIG_PARITY_NONE, - .serial_handshake = RIG_HANDSHAKE_HARDWARE, + .serial_handshake = RIG_HANDSHAKE_NONE, .write_delay = FTDX10_WRITE_DELAY, .post_write_delay = FTDX10_POST_WRITE_DELAY, .timeout = 2000, commit a03d5892255a3c2987e144b474d3edadba4209fa Author: Mike Black W9MDB <mdb...@ya...> Date: Sun Jan 15 12:41:01 2023 -0600 Add TS-2000 to has_ps exceptions https://github.com/Hamlib/Hamlib/issues/1213 diff --git a/NEWS b/NEWS index 9a533279..536a8033 100644 --- a/NEWS +++ b/NEWS @@ -25,6 +25,7 @@ Version 4.6 * Fix FTDX3000 rig split Version 4.5.5 + * Add TS2000 to has_ps exception * Add FT991 to 60M exception * Fix get_powerstat bad call in rigctl_parse.c * Really fix CM108 ptt_bitnum usage diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index fe41cdbf..1abad7a1 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -771,6 +771,7 @@ int kenwood_init(RIG *rig) if (rig->caps->rig_model == RIG_MODEL_TS450S || rig->caps->rig_model == RIG_MODEL_TS50 || rig->caps->rig_model == RIG_MODEL_TS140S + || rig->caps->rig_model == RIG_MODEL_TS2000 || rig->caps->rig_model == RIG_MODEL_TS440) { priv->has_ps = 0; diff --git a/rigs/kenwood/kenwood.h b/rigs/kenwood/kenwood.h index 69106804..d0c077a0 100644 --- a/rigs/kenwood/kenwood.h +++ b/rigs/kenwood/kenwood.h @@ -29,7 +29,7 @@ #include "misc.h" #include "idx_builtin.h" -#define BACKEND_VER "20230109" +#define BACKEND_VER "20230115" #define EOM_KEN ';' #define EOM_TH '\r' commit d80e23c15091874efc32592f26a7c91990fcb1f2 Author: Mike Black W9MDB <mdb...@ya...> Date: Sun Jan 15 10:18:44 2023 -0600 Update NEWS diff --git a/NEWS b/NEWS index e05a2746..9a533279 100644 --- a/NEWS +++ b/NEWS @@ -25,6 +25,7 @@ Version 4.6 * Fix FTDX3000 rig split Version 4.5.5 + * Add FT991 to 60M exception * Fix get_powerstat bad call in rigctl_parse.c * Really fix CM108 ptt_bitnum usage * Fix Elecraft power2mW precision/accuracy commit 0b886dfd0b8eef5e6309053effd9088d418b8ebe Author: Mike Black W9MDB <mdb...@ya...> Date: Sun Jan 15 10:17:54 2023 -0600 Add FT991 to 60M exception diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 703b7fb6..65f8b9f4 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -824,6 +824,9 @@ int newcat_60m_exception(RIG *rig, freq_t freq, mode_t mode) return -RIG_EINVAL; } + // some rigs need to skip freq/mode settings as 60M only operates in memory mode + if (is_ft991) { return 1; } + if (!is_ftdx10 && !is_ft710 && !is_ftdx101d && !is_ftdx101mp) { return 0; } rig_debug(RIG_DEBUG_VERBOSE, "%s: 60M exception ignoring freq/mode commands\n", diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h index 5202dcfd..db1d64c4 100644 --- a/rigs/yaesu/newcat.h +++ b/rigs/yaesu/newcat.h @@ -50,7 +50,7 @@ typedef char ncboolean; /* shared function version */ -#define NEWCAT_VER "20230109" +#define NEWCAT_VER "20230115" /* Hopefully large enough for future use, 128 chars plus '\0' */ #define NEWCAT_DATA_LEN 129 commit ae0add1e980bbe2a4ce5552a58824947157f2d56 Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Jan 13 17:30:55 2023 -0600 Fix get_powerstat call when get_powerstat is not defined https://github.com/Hamlib/Hamlib/issues/1217 diff --git a/NEWS b/NEWS index 3c18ed21..e05a2746 100644 --- a/NEWS +++ b/NEWS @@ -24,8 +24,14 @@ Version 4.6 * Add FLIR PTU-D48, E46, D100, D300 rotors * Fix FTDX3000 rig split +Version 4.5.5 + * Fix get_powerstat bad call in rigctl_parse.c + * Really fix CM108 ptt_bitnum usage + * Fix Elecraft power2mW precision/accuracy + * Fix power on/off/on for Icom rigs with rigctld power_on=0 + Version 4.5.4 - * 2023-01-10 + * 2023-XX-XX * Fix CM108 ptt setting for non-default usage * Fix power on/off for Icom rigs with rigctld power_on=0 * Fix get_powerstat status return for non-PS kenwood rigs diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c index 1b356aac..c9c87c56 100644 --- a/tests/rigctl_parse.c +++ b/tests/rigctl_parse.c @@ -1728,7 +1728,7 @@ readline_repeat: else { - if (my_rig->caps->set_powerstat && (rig_powerstat == RIG_POWER_OFF + if (my_rig->caps->get_powerstat && (rig_powerstat == RIG_POWER_OFF || rig_powerstat == RIG_POWER_STANDBY)) { // Update power status commit c915e49e1bf49eca5afd9409344cf599410a77cd Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Jan 10 23:08:53 2023 -0600 Fix BSD build include path https://github.com/Hamlib/Hamlib/issues/1208 diff --git a/configure.ac b/configure.ac index ff6db5d6..e5bdfc41 100644 --- a/configure.ac +++ b/configure.ac @@ -14,7 +14,7 @@ dnl Please do not use '-' in the version number, as package managers will fail, dnl however, the use of '~' should be fine as apt (others?) will treat dnl it as an earlier version than the actual release. TNX KA6MAL dnl PACKAGE_NAME + " " + PACKAGE_VERSION must not exceed 20 chars! -AC_INIT([Hamlib],[4.5.4],[ham...@li...],[hamlib],[http://www.hamlib.org]) +AC_INIT([Hamlib],[4.5.5],[ham...@li...],[hamlib],[http://www.hamlib.org]) AC_CONFIG_SRCDIR([include/hamlib/rig.h]) AC_CONFIG_MACRO_DIR([macros]) @@ -269,7 +269,7 @@ LT_INIT([win32-dll]) dnl The host_os variable is set by the AC_CANONICAL_HOST macro above. AS_CASE(["$host_os"], [freebsd*], [ - AM_CPPFLAGS="-I/usr/local/include ${AM_CPPFLAGS}" + AM_CPPFLAGS="${AM_CPPFLAGS} -I/usr/local/include" AM_LDFLAGS="${AM_LDFLAGS} -L/usr/local/lib" AC_SUBST([AM_LDFLAGS])], ----------------------------------------------------------------------- hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: n0nb <n0...@us...> - 2023-01-18 12:50:31
|
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 f392cc4c1804f06fe16f7e326c879e2ba0f20e1d (commit) via 16af6ae3aa39835711c11ec5a4376ba173dc0fc6 (commit) via aeb2692b4203f5b354cd667455f862af31821a66 (commit) via c0866e0bad111a21021b9f3d30d91a1884c2df59 (commit) via 739fe24e6287dfbdf1fafebd8c04b8cd3154e9eb (commit) via d180883f3efc24c813d6c020f6c1ef3811d94002 (commit) via c02370d27981c66c89be187965922f4bfae59d71 (commit) via 3f8da23bb62f851377d474b1ab874833207aa73c (commit) via cb1c98fa857f735f7f18f964948e320eefb63b20 (commit) via 0ad5a4b7425f5a1c73ef89300920b3f4231a54a9 (commit) via c3ff7e134fd18a6fbf0005002fd81317e584758b (commit) via e681185b61f466350e194376a8fa5e19797c7233 (commit) via 77ce6b6dc39ba90cc12d1253af0de4f5ec7abb81 (commit) via 29a80fb496696fb40a93e022987371da5c1d68db (commit) via 9c48ec785c69442892a8acb3257c308fb9611310 (commit) via e4471b9ece77601d3a5af8740dbc85caa847c323 (commit) via 37b29012934ba57d527535d84b86ea1460ff409e (commit) via 51f9cbe4575ecb82e5ff34447d44ea9e6624ac6d (commit) via dc131cba7fc76ee0e9bea1dd123b2e6ac6a681d3 (commit) via 00dce998aebfd9f4b9addd3830eb4b9026e1d1ce (commit) via 5ebde1ca34e2b44b5b1c0d5e4a38ce091639b19e (commit) from aa1cf567f67febd90e6d6a804ba2950fd9f2b6cf (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 f392cc4c1804f06fe16f7e326c879e2ba0f20e1d Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Jan 17 23:54:05 2023 -0600 Fix AGC level display in rigctld https://github.com/Hamlib/Hamlib/issues/1155 diff --git a/NEWS b/NEWS index 23de5250..a1b4ac1c 100644 --- a/NEWS +++ b/NEWS @@ -25,6 +25,7 @@ Version 4.6 * Fix FTDX3000 rig split Version 4.5.5 + * Fix AGC level display in rigctld * Change FTDX10 to no serial handshake * Add TS2000 to has_ps exception * Add FT991 to 60M exception diff --git a/rigs/dummy/netrigctl.c b/rigs/dummy/netrigctl.c index 03976838..b69e04b6 100644 --- a/rigs/dummy/netrigctl.c +++ b/rigs/dummy/netrigctl.c @@ -814,7 +814,7 @@ static int netrigctl_open(RIG *rig) int i = 0; char *p = strtok(value, " "); rig->caps->agc_levels[0] = RIG_AGC_NONE; // default value gets overwritten - rig->caps->agc_level_count = 1; + rig->caps->agc_level_count = 0; while (p) { @@ -2735,7 +2735,7 @@ struct rig_caps netrigctl_caps = RIG_MODEL(RIG_MODEL_NETRIGCTL), .model_name = "NET rigctl", .mfg_name = "Hamlib", - .version = "20230106.0", + .version = "20230117.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_OTHER, diff --git a/src/sprintflst.c b/src/sprintflst.c index 07e3c347..6a6c870f 100644 --- a/src/sprintflst.c +++ b/src/sprintflst.c @@ -939,7 +939,7 @@ int rig_sprintf_agc_levels(RIG *rig, char *str, int lenstr) { if (strlen(str) > 0) { strcat(str, " "); } - sprintf(tmpbuf, "%d=%s", i, + sprintf(tmpbuf, "%d=%s", rig->caps->agc_levels[i], rig_stragclevel(rig->caps->agc_levels[i])); if (strlen(str) + strlen(tmpbuf) < lenstr - 1) commit 16af6ae3aa39835711c11ec5a4376ba173dc0fc6 Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Jan 17 22:31:17 2023 -0600 Update NEWS diff --git a/NEWS b/NEWS index 536a8033..23de5250 100644 --- a/NEWS +++ b/NEWS @@ -25,6 +25,7 @@ Version 4.6 * Fix FTDX3000 rig split Version 4.5.5 + * Change FTDX10 to no serial handshake * Add TS2000 to has_ps exception * Add FT991 to 60M exception * Fix get_powerstat bad call in rigctl_parse.c commit aeb2692b4203f5b354cd667455f862af31821a66 Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Jan 17 22:30:02 2023 -0600 Change FTDX10 handshake to None instead of Hardware diff --git a/rigs/yaesu/ftdx10.c b/rigs/yaesu/ftdx10.c index 9daf5241..77101d8a 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 ".5", + .version = NEWCAT_VER ".6", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -149,7 +149,7 @@ const struct rig_caps ftdx10_caps = .serial_data_bits = 8, .serial_stop_bits = 2, .serial_parity = RIG_PARITY_NONE, - .serial_handshake = RIG_HANDSHAKE_HARDWARE, + .serial_handshake = RIG_HANDSHAKE_NONE, .write_delay = FTDX10_WRITE_DELAY, .post_write_delay = FTDX10_POST_WRITE_DELAY, .timeout = 2000, commit c0866e0bad111a21021b9f3d30d91a1884c2df59 Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Jan 17 16:23:45 2023 -0600 Add hamlibmodels.c example diff --git a/tests/hamlibmodels.c b/tests/hamlibmodels.c new file mode 100644 index 00000000..a7cfac7f --- /dev/null +++ b/tests/hamlibmodels.c @@ -0,0 +1,38 @@ +/* Example showing host to list all models */ +#include <stdio.h> +#include <stdlib.h> +#include <hamlib/rig.h> + +char *list[1000]; // as of 2023-01-17 we have 275 rigs so this should cover us for long time + +int nmodels = 0; + +static int hash_model_list(const struct rig_caps *caps, void *data) +{ + char s[256]; + sprintf(s, "%s %s", caps->mfg_name, caps->model_name); + list[nmodels] = strdup(s); + ++nmodels; + return 1; /* !=0, we want them all ! */ +} + +int mycmp(const void *p1, const void *p2) +{ + const char **s1 = (const char **)p1; + const char **s2 = (const char **)p2; + return strcasecmp(*s1, *s2); +} + +int main() +{ + rig_set_debug_level(RIG_DEBUG_NONE); + rig_load_all_backends(); + rig_list_foreach(hash_model_list, NULL); + qsort(list, nmodels, sizeof(list) / 1000, mycmp); + + for (int i = 0; i < nmodels; ++i) { printf("%s\n", list[i]); } + + printf("%d models\n", nmodels); + + return 0; +} commit 739fe24e6287dfbdf1fafebd8c04b8cd3154e9eb Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Jan 17 15:45:29 2023 -0600 Add new simulator to Makefile.am diff --git a/simulators/Makefile.am b/simulators/Makefile.am index 3e2d7c04..115b0b20 100644 --- a/simulators/Makefile.am +++ b/simulators/Makefile.am @@ -8,7 +8,7 @@ DISTCLEANFILES = bin_PROGRAMS = -check_PROGRAMS = simelecraft simicom simkenwood simyaesu simicom9700 simft991 simftdx1200 simftdx3000 simjupiter simpowersdr simid5100 +check_PROGRAMS = simelecraft simicom simkenwood simyaesu simicom9700 simft991 simftdx1200 simftdx3000 simjupiter simpowersdr simid5100 simft736 simftdx5000 simelecraft_SOURCES = simelecraft.c simicom_SOURCES = simicom.c commit d180883f3efc24c813d6c020f6c1ef3811d94002 Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Jan 17 09:22:55 2023 -0600 Allow rigctl/rigctld to continue when a bad set_conf is called -- just shows a warning now diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c index c1c0dc8a..0d397724 100644 --- a/tests/rigctl_parse.c +++ b/tests/rigctl_parse.c @@ -2040,6 +2040,7 @@ void list_models() int set_conf(RIG *my_rig, char *conf_parms) { char *p, *n; + int token; p = conf_parms; @@ -2063,12 +2064,20 @@ int set_conf(RIG *my_rig, char *conf_parms) *n++ = '\0'; } + token = rig_token_lookup(my_rig, p); + if (token != 0) + { ret = rig_set_conf(my_rig, rig_token_lookup(my_rig, p), q); if (ret != RIG_OK) { return (ret); } + } + else + { + rig_debug(RIG_DEBUG_WARN, "%s: invalid token %s for this rig\n", __func__, p); + } p = n; } commit c02370d27981c66c89be187965922f4bfae59d71 Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Jan 17 09:19:39 2023 -0600 Allow rigctld to continue when an invalid set_conf parameter is used diff --git a/src/conf.c b/src/conf.c index a2e5898d..0b9e4f47 100644 --- a/src/conf.c +++ b/src/conf.c @@ -842,6 +842,8 @@ static int frontend_get_conf2(RIG *rig, token_t token, char *val, int val_len) case TOK_HANDSHAKE: if (rs->rigport.type.rig != RIG_PORT_SERIAL) { + rig_debug(RIG_DEBUG_ERR, "%s: getting handshake is invalid for non-serial port rig type\n", + __func__); return -RIG_EINVAL; } @@ -1251,6 +1253,7 @@ token_t HAMLIB_API rig_token_lookup(RIG *rig, const char *name) */ int HAMLIB_API rig_set_conf(RIG *rig, token_t token, const char *val) { + struct rig_state *rs = &rig->state; rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); if (!rig || !rig->caps) @@ -1258,6 +1261,13 @@ int HAMLIB_API rig_set_conf(RIG *rig, token_t token, const char *val) return -RIG_EINVAL; } + // Some parameters can be ignored + if (token == TOK_HANDSHAKE && (rs->rigport.type.rig != RIG_PORT_SERIAL)) + { + rig_debug(RIG_DEBUG_WARN, "%s: handshake is not valid for non-serial port rig\n", __func__); + return RIG_OK; // this allows rigctld to continue and just print a warning instead of error + } + if (rig_need_debug(RIG_DEBUG_VERBOSE)) { const struct confparams *cfp; commit 3f8da23bb62f851377d474b1ab874833207aa73c Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Jan 17 08:50:47 2023 -0600 Improved set_conf error when serial_handshake is invalid diff --git a/src/conf.c b/src/conf.c index f0612783..a2e5898d 100644 --- a/src/conf.c +++ b/src/conf.c @@ -369,6 +369,8 @@ static int frontend_set_conf(RIG *rig, token_t token, const char *val) case TOK_HANDSHAKE: if (rs->rigport.type.rig != RIG_PORT_SERIAL) { + rig_debug(RIG_DEBUG_ERR, "%s: setting handshake is invalid for non-serial port rig type\n", + __func__); return -RIG_EINVAL; } commit cb1c98fa857f735f7f18f964948e320eefb63b20 Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Jan 16 09:24:00 2023 -0600 Fix xdgpath in settings.c diff --git a/src/settings.c b/src/settings.c index 33c24b76..f11cc940 100644 --- a/src/settings.c +++ b/src/settings.c @@ -1029,7 +1029,7 @@ HAMLIB_EXPORT(int) rig_settings_get_path(char *path, int pathlen) if (xdgpath) { - snprintf(path, pathlen - 1, "%s/%s/%s", xdgpath, cwd, HAMLIB_SETTINGS_FILE); + snprintf(path, pathlen - 1, "%s/%s", xdgpath, HAMLIB_SETTINGS_FILE); } else if (home && access(path, F_OK) != -1) { commit 0ad5a4b7425f5a1c73ef89300920b3f4231a54a9 Author: Mike Black W9MDB <mdb...@ya...> Date: Sun Jan 15 22:22:14 2023 -0600 Attempt to allow PS; query for Yaeus rigs when powered off https://github.com/Hamlib/Hamlib/issues/1220 diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 65f8b9f4..39d94072 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -3602,6 +3602,7 @@ int newcat_set_powerstat(RIG *rig, powerstat_t status) int newcat_get_powerstat(RIG *rig, powerstat_t *status) { struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; + struct rig_state *state = &rig->state; int err; char ps; char command[] = "PS"; @@ -3615,6 +3616,11 @@ int newcat_get_powerstat(RIG *rig, powerstat_t *status) RETURNFUNC(-RIG_ENAVAIL); } + // when not powered on need a dummy byte to wake it up + // then sleep from 1 to 2 seconds so we'll do 1.5 secs + write_block(&state->rigport, (unsigned char *) "PS;", 3); + hl_usleep(1200000); + SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "%s%c", command, cat_term); /* Get Power status */ commit c3ff7e134fd18a6fbf0005002fd81317e584758b Author: Mike Black W9MDB <mdb...@ya...> Date: Sun Jan 15 12:41:01 2023 -0600 Add TS-2000 to has_ps exceptions https://github.com/Hamlib/Hamlib/issues/1213 diff --git a/NEWS b/NEWS index 9a533279..536a8033 100644 --- a/NEWS +++ b/NEWS @@ -25,6 +25,7 @@ Version 4.6 * Fix FTDX3000 rig split Version 4.5.5 + * Add TS2000 to has_ps exception * Add FT991 to 60M exception * Fix get_powerstat bad call in rigctl_parse.c * Really fix CM108 ptt_bitnum usage diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index fe41cdbf..1abad7a1 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -771,6 +771,7 @@ int kenwood_init(RIG *rig) if (rig->caps->rig_model == RIG_MODEL_TS450S || rig->caps->rig_model == RIG_MODEL_TS50 || rig->caps->rig_model == RIG_MODEL_TS140S + || rig->caps->rig_model == RIG_MODEL_TS2000 || rig->caps->rig_model == RIG_MODEL_TS440) { priv->has_ps = 0; diff --git a/rigs/kenwood/kenwood.h b/rigs/kenwood/kenwood.h index 69106804..d0c077a0 100644 --- a/rigs/kenwood/kenwood.h +++ b/rigs/kenwood/kenwood.h @@ -29,7 +29,7 @@ #include "misc.h" #include "idx_builtin.h" -#define BACKEND_VER "20230109" +#define BACKEND_VER "20230115" #define EOM_KEN ';' #define EOM_TH '\r' commit e681185b61f466350e194376a8fa5e19797c7233 Author: Mike Black W9MDB <mdb...@ya...> Date: Sun Jan 15 10:18:44 2023 -0600 Update NEWS diff --git a/NEWS b/NEWS index e05a2746..9a533279 100644 --- a/NEWS +++ b/NEWS @@ -25,6 +25,7 @@ Version 4.6 * Fix FTDX3000 rig split Version 4.5.5 + * Add FT991 to 60M exception * Fix get_powerstat bad call in rigctl_parse.c * Really fix CM108 ptt_bitnum usage * Fix Elecraft power2mW precision/accuracy commit 77ce6b6dc39ba90cc12d1253af0de4f5ec7abb81 Author: Mike Black W9MDB <mdb...@ya...> Date: Sun Jan 15 10:17:54 2023 -0600 Add FT991 to 60M exception diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 703b7fb6..65f8b9f4 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -824,6 +824,9 @@ int newcat_60m_exception(RIG *rig, freq_t freq, mode_t mode) return -RIG_EINVAL; } + // some rigs need to skip freq/mode settings as 60M only operates in memory mode + if (is_ft991) { return 1; } + if (!is_ftdx10 && !is_ft710 && !is_ftdx101d && !is_ftdx101mp) { return 0; } rig_debug(RIG_DEBUG_VERBOSE, "%s: 60M exception ignoring freq/mode commands\n", diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h index 5202dcfd..db1d64c4 100644 --- a/rigs/yaesu/newcat.h +++ b/rigs/yaesu/newcat.h @@ -50,7 +50,7 @@ typedef char ncboolean; /* shared function version */ -#define NEWCAT_VER "20230109" +#define NEWCAT_VER "20230115" /* Hopefully large enough for future use, 128 chars plus '\0' */ #define NEWCAT_DATA_LEN 129 commit 29a80fb496696fb40a93e022987371da5c1d68db Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Jan 13 17:30:55 2023 -0600 Fix get_powerstat call when get_powerstat is not defined https://github.com/Hamlib/Hamlib/issues/1217 diff --git a/NEWS b/NEWS index 996d795c..e05a2746 100644 --- a/NEWS +++ b/NEWS @@ -25,6 +25,7 @@ Version 4.6 * Fix FTDX3000 rig split Version 4.5.5 + * Fix get_powerstat bad call in rigctl_parse.c * Really fix CM108 ptt_bitnum usage * Fix Elecraft power2mW precision/accuracy * Fix power on/off/on for Icom rigs with rigctld power_on=0 diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c index c1aeb838..c1c0dc8a 100644 --- a/tests/rigctl_parse.c +++ b/tests/rigctl_parse.c @@ -1731,7 +1731,7 @@ readline_repeat: else { - if (my_rig->caps->set_powerstat && (rig_powerstat == RIG_POWER_OFF + if (my_rig->caps->get_powerstat && (rig_powerstat == RIG_POWER_OFF || rig_powerstat == RIG_POWER_STANDBY)) { // Update power status commit 9c48ec785c69442892a8acb3257c308fb9611310 Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Jan 12 11:23:11 2023 -0600 Improve serial port timeout when permission proble or does not exist https://github.com/Hamlib/Hamlib/issues/1216 diff --git a/src/serial.c b/src/serial.c index e22df68b..05d72c22 100644 --- a/src/serial.c +++ b/src/serial.c @@ -231,7 +231,7 @@ int HAMLIB_API serial_open(hamlib_port_t *rp) fd = OPEN(rp->pathname, O_RDWR | O_NOCTTY | O_NDELAY); } } - while (++i <= 4 && fd == -1); + while (++i <= 4 && fd == -1 && errno != ENOENT && errno != EPERM); if (fd == -1) { commit e4471b9ece77601d3a5af8740dbc85caa847c323 Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Jan 10 23:07:53 2023 -0600 Fix BSD build include path order https://github.com/Hamlib/Hamlib/issues/1208 diff --git a/configure.ac b/configure.ac index fcaffc79..0af90a70 100644 --- a/configure.ac +++ b/configure.ac @@ -273,7 +273,7 @@ dnl The host_os variable is set by the AC_CANONICAL_HOST macro above. AM_CONDITIONAL([VERSIONDLL], false) AS_CASE(["$host_os"], [freebsd*], [ - AM_CPPFLAGS="-I/usr/local/include ${AM_CPPFLAGS}" + AM_CPPFLAGS="${AM_CPPFLAGS} -I/usr/local/include" AM_LDFLAGS="${AM_LDFLAGS} -L/usr/local/lib" AC_SUBST([AM_LDFLAGS])], commit 37b29012934ba57d527535d84b86ea1460ff409e Merge: dc131cba 51f9cbe4 Author: Michael Black <mdb...@ya...> Date: Tue Jan 10 15:21:03 2023 -0600 Merge pull request #1215 from fillods/F8CFE/celestron_status Update status of celestron to Stable commit 51f9cbe4575ecb82e5ff34447d44ea9e6624ac6d Author: Stephane Fillod <fi...@us...> Date: Tue Jan 10 20:41:07 2023 +0100 Update status of celestron to Stable Tested-by: Eric K0JEG Tested-by: Daniel DL7NDR <04...@ma...> Tested-by: Андрей Родионов <der...@gm...> diff --git a/rotators/celestron/celestron.c b/rotators/celestron/celestron.c index 87d98685..39baebe5 100644 --- a/rotators/celestron/celestron.c +++ b/rotators/celestron/celestron.c @@ -228,7 +228,7 @@ const struct rot_caps nexstar_rot_caps = .mfg_name = "Celestron", .version = "20220109.0", .copyright = "LGPL", - .status = RIG_STATUS_BETA, + .status = RIG_STATUS_STABLE, .rot_type = ROT_TYPE_AZEL, .port_type = RIG_PORT_SERIAL, .serial_rate_min = 9600, commit dc131cba7fc76ee0e9bea1dd123b2e6ac6a681d3 Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Jan 10 08:46:10 2023 -0600 Fix set_powerstat on/off/on for Icom rigs using rigctld power_on=0 https://github.com/Hamlib/Hamlib/issues/1212 diff --git a/NEWS b/NEWS index 9c1c8353..996d795c 100644 --- a/NEWS +++ b/NEWS @@ -27,6 +27,7 @@ Version 4.6 Version 4.5.5 * Really fix CM108 ptt_bitnum usage * Fix Elecraft power2mW precision/accuracy + * Fix power on/off/on for Icom rigs with rigctld power_on=0 Version 4.5.4 * 2023-XX-XX diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index d912ad97..feaf733f 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -7977,11 +7977,6 @@ int icom_set_powerstat(RIG *rig, powerstat_t status) memset(fe_buf, 0xfe, fe_max); // sending more than enough 0xfe's to wake up the rs232 write_block(&rs->rigport, fe_buf, fe_max); - // close and re-open the rig - // on linux the USB gets reset during power on - rig_close(rig); - sleep(1); // let serial bus idle for a while - rig_open(rig); // we'll try 0x18 0x01 now -- should work on STBY rigs too pwr_sc = S_PWR_ON; @@ -8043,6 +8038,12 @@ int icom_set_powerstat(RIG *rig, powerstat_t status) { rig_debug(RIG_DEBUG_TRACE, "%s: Wait failed for get_powerstat\n", __func__); + // close and re-open the rig + // on linux the USB gets reset during power on + rig_close(rig); + sleep(1); + rig_open(rig); + retval = -RIG_ETIMEOUT; } diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h index 3f4c3c18..a9ba4fe9 100644 --- a/rigs/icom/icom.h +++ b/rigs/icom/icom.h @@ -31,7 +31,7 @@ #include <sys/time.h> #endif -#define BACKEND_VER "20230109" +#define BACKEND_VER "20230110" #define ICOM_IS_ID31 rig_is_model(rig, RIG_MODEL_ID31) #define ICOM_IS_ID51 rig_is_model(rig, RIG_MODEL_ID51) commit 00dce998aebfd9f4b9addd3830eb4b9026e1d1ce Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Jan 9 23:26:15 2023 -0600 Fix Elecraft power2mW precision/accuracy Should fix any others too https://github.com/Hamlib/Hamlib/issues/1205 diff --git a/NEWS b/NEWS index a8dd99d0..9c1c8353 100644 --- a/NEWS +++ b/NEWS @@ -26,6 +26,7 @@ Version 4.6 Version 4.5.5 * Really fix CM108 ptt_bitnum usage + * Fix Elecraft power2mW precision/accuracy Version 4.5.4 * 2023-XX-XX diff --git a/rigs/kenwood/k3.c b/rigs/kenwood/k3.c index a9b0a1f6..336b30bc 100644 --- a/rigs/kenwood/k3.c +++ b/rigs/kenwood/k3.c @@ -343,7 +343,7 @@ const struct rig_caps k3s_caps = RIG_MODEL(RIG_MODEL_K3S), .model_name = "K3S", .mfg_name = "Elecraft", - .version = BACKEND_VER ".19", + .version = BACKEND_VER ".20", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -495,7 +495,7 @@ const struct rig_caps k4_caps = RIG_MODEL(RIG_MODEL_K4), .model_name = "K4", .mfg_name = "Elecraft", - .version = BACKEND_VER ".25", + .version = BACKEND_VER ".26", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -646,7 +646,7 @@ const struct rig_caps kx3_caps = RIG_MODEL(RIG_MODEL_KX3), .model_name = "KX3", .mfg_name = "Elecraft", - .version = BACKEND_VER ".18", + .version = BACKEND_VER ".19", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -797,7 +797,7 @@ const struct rig_caps kx2_caps = RIG_MODEL(RIG_MODEL_KX2), .model_name = "KX2", .mfg_name = "Elecraft", - .version = BACKEND_VER ".17", + .version = BACKEND_VER ".18", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -1839,7 +1839,9 @@ int k3_power2mW(RIG *rig, freq_t freq, rmode_t mode) { - *mwpower = power * k3_get_maxpower(rig) * 1000; + char buf[32]; + snprintf(buf, sizeof(buf), "%.0f", power * k3_get_maxpower(rig) * 1000); + *mwpower = atoi(buf); return RIG_OK; } diff --git a/simulators/simelecraft.c b/simulators/simelecraft.c index ea82a0a3..8dc58b6e 100644 --- a/simulators/simelecraft.c +++ b/simulators/simelecraft.c @@ -281,7 +281,7 @@ int main(int argc, char *argv[]) } else if (strncmp(buf, "PC;", 3) == 0) { - SNPRINTF(buf, sizeof(buf), "PC0150;"); + SNPRINTF(buf, sizeof(buf), "PC0980;"); n = write(fd, buf, strlen(buf)); } else if (strlen(buf) > 0) diff --git a/src/rig.c b/src/rig.c index 01e36480..8c14aa3e 100644 --- a/src/rig.c +++ b/src/rig.c @@ -5845,6 +5845,7 @@ int HAMLIB_API rig_power2mW(RIG *rig, rmode_t mode) { const freq_range_t *txrange; + char buf[32]; ENTERFUNC; @@ -5880,7 +5881,10 @@ int HAMLIB_API rig_power2mW(RIG *rig, RETURNFUNC(-RIG_EINVAL); } - *mwpower = (unsigned int)(power * txrange->high_power); + + snprintf(buf, sizeof(buf), "%.0f", power * txrange->high_power); + *mwpower = atoi(buf); + //*mwpower = (unsigned int)(power * txrange->high_power); RETURNFUNC(RIG_OK); } commit 5ebde1ca34e2b44b5b1c0d5e4a38ce091639b19e Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Jan 9 22:53:01 2023 -0600 Really fix CM108 ptt_bitnum usage https://github.com/Hamlib/Hamlib/issues/1203 diff --git a/NEWS b/NEWS index b2909aaa..a8dd99d0 100644 --- a/NEWS +++ b/NEWS @@ -24,6 +24,9 @@ Version 4.6 * Add FLIR PTU-D48, E46, D100, D300 rotors * Fix FTDX3000 rig split +Version 4.5.5 + * Really fix CM108 ptt_bitnum usage + Version 4.5.4 * 2023-XX-XX * Fix CM108 ptt setting for non-default usage diff --git a/src/rig.c b/src/rig.c index d4cff0ae..01e36480 100644 --- a/src/rig.c +++ b/src/rig.c @@ -1114,8 +1114,12 @@ int HAMLIB_API rig_open(RIG *rig) rs->pttport.fd = cm108_open(&rs->pttport); strncpy(rs->rigport.pathname, DEFAULT_CM108_PORT, HAMLIB_FILPATHLEN); - rs->rigport.parm.cm108.ptt_bitnum = DEFAULT_CM108_PTT_BITNUM; - rs->pttport.parm.cm108.ptt_bitnum = DEFAULT_CM108_PTT_BITNUM; + + if (rs->rigport.parm.cm108.ptt_bitnum == 0) + { + rs->rigport.parm.cm108.ptt_bitnum = DEFAULT_CM108_PTT_BITNUM; + rs->pttport.parm.cm108.ptt_bitnum = DEFAULT_CM108_PTT_BITNUM; + } if (rs->pttport.fd < 0) { @@ -6019,6 +6023,7 @@ int HAMLIB_API rig_set_powerstat(RIG *rig, powerstat_t status) HAMLIB_TRACE; retcode = rig->caps->set_powerstat(rig, status); rig_flush(&rig->state.rigport); // if anything is queued up flush it + rig->state.auto_power_on = 1; // ensure we auto power on in the future RETURNFUNC(retcode); } ----------------------------------------------------------------------- Summary of changes: NEWS | 10 ++++++++++ configure.ac | 2 +- rigs/dummy/netrigctl.c | 4 ++-- rigs/icom/icom.c | 11 ++++++----- rigs/icom/icom.h | 2 +- rigs/kenwood/k3.c | 12 +++++++----- rigs/kenwood/kenwood.c | 1 + rigs/kenwood/kenwood.h | 2 +- rigs/yaesu/ftdx10.c | 4 ++-- rigs/yaesu/newcat.c | 9 +++++++++ rigs/yaesu/newcat.h | 2 +- rotators/celestron/celestron.c | 2 +- simulators/Makefile.am | 2 +- simulators/simelecraft.c | 2 +- src/conf.c | 12 ++++++++++++ src/rig.c | 15 ++++++++++++--- src/serial.c | 2 +- src/settings.c | 2 +- src/sprintflst.c | 2 +- tests/hamlibmodels.c | 38 ++++++++++++++++++++++++++++++++++++++ tests/rigctl_parse.c | 11 ++++++++++- 21 files changed, 119 insertions(+), 28 deletions(-) create mode 100644 tests/hamlibmodels.c hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: n0nb <n0...@us...> - 2023-01-10 02:23:13
|
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 annotated tag, 4.5.4 has been created at c8cd1be4c5e8be392aad23c6464ca31f8476d718 (tag) tagging 921cc52eb95cb67cada35a8d68d7f228a50a4479 (commit) replaces 4.5.2 tagged by Nate Bargmann on Mon Jan 9 20:22:26 2023 -0600 - Log ----------------------------------------------------------------- Hamlib 4.5.4 release -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQSC1k9rDmfNQfaJu6b7LFEw1VqIGQUCY7zL+QAKCRD7LFEw1VqI Ge0eAKCfbaRoFnuNQkzENkyXU/ixrPRpCACgl4Y2BwsxF06oiet7vhW6rRZBWjU= =GkCj -----END PGP SIGNATURE----- Mike Black W9MDB (55): Fix grep error on mingw build Update NEWS Change FTDX5000 write_delay to zero -- was causing microham to return ?; to every command https://github.com/Hamlib/Hamlib/issues/1080 Update NEWS FT5000 cannot use RIG_PTT_ON_DATA/MIC menu 103 control and is now set for rear automatically too https://github.com/Hamlib/Hamlib/issues/1193 Make sure FT5000 is in data mode for PTT request -- returns to MIC mode on shutdown https://github.com/Hamlib/Hamlib/issues/1193 Make FT5000 EX1031;TX1; command two commands https://github.com/Hamlib/Hamlib/issues/1193 FTDX5000 will now remember startup front/rear setting and restore it Will also allow front/rear selection in WSJT-X/JTDX https://github.com/Hamlib/Hamlib/issues/1195 astyle newcat.c Allow for 36 and 37 byte IF lengths for ic10.c This should fix QRP QRDX buggy IF message -- hopefully the fix theirs to send 33 bytes. https://github.com/Hamlib/Hamlib/issues/1196#issuecomment-1367473810 Update NEWS Add QRPLabs QCX/QDX for better behavior/capability from ts480 entry Update NEWS Remove set_rts and set_dtr low from serial.c This was causing hardward flow control to fail on Linux and MacOS https://github.com/Hamlib/Hamlib/issues/1198 https://github.com/Hamlib/Hamlib/issues/1199 Update NEWS Remove get_powerstat from Icom ID-5100 -- does not have the ability to get power status https://github.com/Hamlib/Hamlib/issues/1201 Update NEWS Fix ID5100 ID4100 ID31 ID51 get/set freq Remove get_powerstat from ID4100 ID31 ID51 as it they are not capable Add new rig_is_model function to help with Icom rig identification checks https://github.com/Hamlib/Hamlib/issues/1202 https://github.com/Hamlib/Hamlib/issues/1200 Update NEWS Remove rigctltcp from tests/Makefile.am Convert Icom 3-byte frequency to Hz from KHz https://github.com/Hamlib/Hamlib/issues/1200 Another attempt to fix get/set freq for ID5100 ID4100 ID31 ID51 https://github.com/Hamlib/Hamlib/issues/1202 https://github.com/Hamlib/Hamlib/issues/1200 Fix units for get freq for ID5100 ID4100 ID31 ID51 https://github.com/Hamlib/Hamlib/issues/1200 Fix ID5100 get/set_mode Remove ID rigs freq_len check as civ_731 setting should cover it https://github.com/Hamlib/Hamlib/issues/1204 Add PKTUSB to ft1000mp rigs Remove XONXOFF flow control from ID5100 and ID4100 -- Firmware E8 is not working correclty that flow control https://github.com/Hamlib/Hamlib/issues/1202 Make 3-byte Icom ID rigs show error message Get dummy rig to work with grig by disallowing empty "u" calls Update ID5100 and ID4100 Promote ID5100 to stable https://github.com/Hamlib/Hamlib/issues/1204 https://github.com/Hamlib/Hamlib/issues/1202 https://github.com/Hamlib/Hamlib/issues/1202 Allow rigctld to start with autopower_on=0 and avoid timeouts at startup Update NEWS Fix rig_getpower2mW so it checks all range lists https://github.com/Hamlib/Hamlib/issues/1205 Update NEWS Fix rigctld agc level readings -- allow for rig backedn to specify "RIG_AGC_NONE" now for clarity if desired https://github.com/Hamlib/Hamlib/issues/1155 Update man pages to clarify upper/lower case for set/get commands Remove unnecessary check from netrigctl.c https://github.com/Hamlib/Hamlib/issues/1155 Remove EX039 check from FTDX3000/3000DM https://github.com/Hamlib/Hamlib/issues/1206 Fix elecraft power2mW by scaling power to either 15W or 100W based on KPA availability We are ignoring the tx_range values for the Kn series https://github.com/Hamlib/Hamlib/issues/1205 Force K22 mode on Elecraft rigs to get PC power level in .1W intervals for low power operations https://github.com/Hamlib/Hamlib/issues/1205 Fix FTDX3000 EX039 error https://github.com/Hamlib/Hamlib/issues/1206 Update NEWS Update NEWS Update timing in nrd535.c based on testing thanks to markjfine Add FT-710 to 60M exception in newcat.c to allow some ability to work with WSJT-X https://github.com/Hamlib/Hamlib/issues/1211 Ensure 60M exception for FT710 is only for US language setting https://github.com/Hamlib/Hamlib/issues/1211 Close rig on set_powerstat 0 -- Linux was unable to reconnect to IC-7300 https://github.com/Hamlib/Hamlib/issues/1212 For Icom rigs close and reopen rig after set_powerstat=1 -- Linux resets the usb device https://github.com/Hamlib/Hamlib/issues/1212 Fix get_powerstat status return to always show POWER_ON for kenwood non-PS rigs https://github.com/Hamlib/Hamlib/issues/1213 Fix FT-710, FTDX10, FTDX101D/MP 60M operations https://github.com/Hamlib/Hamlib/issues/1211 Update NEWS Fix CM108 ptt setting https://github.com/Hamlib/Hamlib/issues/1203 Update NEWS https://github.com/Hamlib/Hamlib/issues/1203 Add simjupiter Revert "Close rig on set_powerstat 0 -- Linux was unable to reconnect to IC-7300" Fix Icom poweron behavior https://github.com/Hamlib/Hamlib/issues/1212 Nate Bargmann (2): Bump to version 4.5.4 Set release date in NEWS ----------------------------------------------------------------------- hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: n0nb <n0...@us...> - 2023-01-10 01:32:40
|
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.5.4 has been created at 921cc52eb95cb67cada35a8d68d7f228a50a4479 (commit) - Log ----------------------------------------------------------------- commit 921cc52eb95cb67cada35a8d68d7f228a50a4479 Author: Nate Bargmann <n0...@n0...> Date: Mon Jan 9 19:31:41 2023 -0600 Set release date in NEWS diff --git a/NEWS b/NEWS index b2909aaa..3c18ed21 100644 --- a/NEWS +++ b/NEWS @@ -25,7 +25,7 @@ Version 4.6 * Fix FTDX3000 rig split Version 4.5.4 - * 2023-XX-XX + * 2023-01-10 * Fix CM108 ptt setting for non-default usage * Fix power on/off for Icom rigs with rigctld power_on=0 * Fix get_powerstat status return for non-PS kenwood rigs commit 1f56a1104e494557be3592f574e93d5892c2645a Author: Nate Bargmann <n0...@n0...> Date: Mon Jan 9 19:10:32 2023 -0600 Bump to version 4.5.4 diff --git a/configure.ac b/configure.ac index 7f2a7007..ff6db5d6 100644 --- a/configure.ac +++ b/configure.ac @@ -14,7 +14,7 @@ dnl Please do not use '-' in the version number, as package managers will fail, dnl however, the use of '~' should be fine as apt (others?) will treat dnl it as an earlier version than the actual release. TNX KA6MAL dnl PACKAGE_NAME + " " + PACKAGE_VERSION must not exceed 20 chars! -AC_INIT([Hamlib],[4.5.2],[ham...@li...],[hamlib],[http://www.hamlib.org]) +AC_INIT([Hamlib],[4.5.4],[ham...@li...],[hamlib],[http://www.hamlib.org]) AC_CONFIG_SRCDIR([include/hamlib/rig.h]) AC_CONFIG_MACRO_DIR([macros]) commit 59131c4496a0b07ff78a35ede5c8ec554fe1ad7b Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Jan 9 12:34:22 2023 -0600 Fix Icom poweron behavior https://github.com/Hamlib/Hamlib/issues/1212 diff --git a/NEWS b/NEWS index 369326eb..b2909aaa 100644 --- a/NEWS +++ b/NEWS @@ -27,6 +27,7 @@ Version 4.6 Version 4.5.4 * 2023-XX-XX * Fix CM108 ptt setting for non-default usage + * Fix power on/off for Icom rigs with rigctld power_on=0 * Fix get_powerstat status return for non-PS kenwood rigs * Fix FT-710, FTDX10, FTDX101D/MP usage on 60M * Fix timing on NRD-535D diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 2b101cc1..d912ad97 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -7979,8 +7979,8 @@ int icom_set_powerstat(RIG *rig, powerstat_t status) write_block(&rs->rigport, fe_buf, fe_max); // close and re-open the rig // on linux the USB gets reset during power on - sleep(1); // let serial bus idle for a while rig_close(rig); + sleep(1); // let serial bus idle for a while rig_open(rig); // we'll try 0x18 0x01 now -- should work on STBY rigs too commit 427237389098a9e608532ae95c686324ad9deb78 Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Jan 9 12:21:33 2023 -0600 Revert "Close rig on set_powerstat 0 -- Linux was unable to reconnect to IC-7300" This reverts commit 93e3aec58863b87b41dd68fcef4f11f4838f418a. diff --git a/NEWS b/NEWS index a430b0f4..369326eb 100644 --- a/NEWS +++ b/NEWS @@ -28,7 +28,6 @@ Version 4.5.4 * 2023-XX-XX * Fix CM108 ptt setting for non-default usage * Fix get_powerstat status return for non-PS kenwood rigs - * Fix set_powerstat 0 to reopen with IC-7300 (and others?) on Linux * Fix FT-710, FTDX10, FTDX101D/MP usage on 60M * Fix timing on NRD-535D * Fix AGC levels with rigctld diff --git a/src/rig.c b/src/rig.c index fec3d8bc..d7462153 100644 --- a/src/rig.c +++ b/src/rig.c @@ -6015,9 +6015,6 @@ int HAMLIB_API rig_set_powerstat(RIG *rig, powerstat_t status) HAMLIB_TRACE; retcode = rig->caps->set_powerstat(rig, status); rig_flush(&rig->state.rigport); // if anything is queued up flush it - - if (status == RIG_POWER_OFF) { rig_close(rig); } - RETURNFUNC(retcode); } commit 6db1e36b4650e3d3aee7a1c14b594e16430cc5d0 Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Jan 9 11:46:49 2023 -0600 Add simjupiter diff --git a/simulators/simjupiter.c b/simulators/simjupiter.c new file mode 100644 index 00000000..6d4849d4 --- /dev/null +++ b/simulators/simjupiter.c @@ -0,0 +1,117 @@ +// can run this using rigctl/rigctld and socat pty devices +// gcc -o simft897 simft897.c +#define _XOPEN_SOURCE 600 +#include <stdio.h> +#include <stdlib.h> +#include <fcntl.h> +#include <string.h> +#include <unistd.h> +#include "../include/hamlib/rig.h" + +#define BUFSIZE 256 + +float freqA = 14074000; +float freqB = 14074500; +char tx_vfo = '0'; +char rx_vfo = '0'; +char modeA = '1'; +char modeB = '1'; +int width_main = 500; +int width_sub = 700; + + +int +getmyline(int fd, unsigned char *buf) +{ + unsigned char c; + int i = 0; + int n = 0; + memset(buf, 0, BUFSIZE); + + while (i < 5 && read(fd, &c, 1) > 0) + { + buf[i++] = c; + n++; + } + + printf("n=%d %02x %02x %02x %02x %02x\n", n, buf[0], buf[1], buf[2], buf[3], + buf[4]); + return n; +} + +#if defined(WIN32) || defined(_WIN32) +int openPort(char *comport) // doesn't matter for using pts devices +{ + int fd; + fd = open(comport, O_RDWR); + + if (fd < 0) + { + perror(comport); + } + + return fd; +} + +#else +int openPort(char *comport) // doesn't matter for using pts devices +{ + int fd = posix_openpt(O_RDWR); + char *name = ptsname(fd); + + if (name == NULL) + { + perror("pstname"); + return -1; + } + + printf("name=%s\n", name); + + if (fd == -1 || grantpt(fd) == -1 || unlockpt(fd) == -1) + { + perror("posix_openpt"); + return -1; + } + + return fd; +} +#endif + + + +int main(int argc, char *argv[]) +{ + unsigned char buf[256]; + unsigned char *pbuf; + int n; + + +again: + int fd = openPort(argv[1]); + + while (1) + { + int bytes = getmyline(fd, buf); + + if (bytes == 0) + { + close(fd); + goto again; + } + + if (bytes != 5) + { + printf("Not 5 bytes? bytes=%d\n", bytes); + } + + switch (buf[0]) + { + case '?': printf("Query %c\n", buf[1]);break; + case '*': printf("Set %c\n", buf[1]);break; + + default: printf("Unknown cmd=%02x\n", buf[4]); + } + } + + return 0; +} commit 63f9ac46895f6c33968df5cfff4caf8c9edee690 Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Jan 9 11:24:34 2023 -0600 Update NEWS https://github.com/Hamlib/Hamlib/issues/1203 diff --git a/NEWS b/NEWS index 632ff66b..a430b0f4 100644 --- a/NEWS +++ b/NEWS @@ -26,6 +26,7 @@ Version 4.6 Version 4.5.4 * 2023-XX-XX + * Fix CM108 ptt setting for non-default usage * Fix get_powerstat status return for non-PS kenwood rigs * Fix set_powerstat 0 to reopen with IC-7300 (and others?) on Linux * Fix FT-710, FTDX10, FTDX101D/MP usage on 60M commit bfc6d19a4b29bedc6567c7ddcc506c099a2bf8ac Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Jan 9 11:03:50 2023 -0600 Fix CM108 ptt setting https://github.com/Hamlib/Hamlib/issues/1203 diff --git a/src/conf.c b/src/conf.c index e2149692..9667351e 100644 --- a/src/conf.c +++ b/src/conf.c @@ -554,6 +554,7 @@ static int frontend_set_conf(RIG *rig, token_t token, const char *val) } rs->pttport.parm.cm108.ptt_bitnum = val_i; + rs->rigport.parm.cm108.ptt_bitnum = val_i; rs->pttport_deprecated.parm.cm108.ptt_bitnum = val_i; break; diff --git a/src/rig.c b/src/rig.c index 5b872eaa..fec3d8bc 100644 --- a/src/rig.c +++ b/src/rig.c @@ -586,8 +586,13 @@ RIG *HAMLIB_API rig_init(rig_model_t rig_model) */ case RIG_PORT_CM108: strncpy(rs->rigport.pathname, DEFAULT_CM108_PORT, HAMLIB_FILPATHLEN); - rs->rigport.parm.cm108.ptt_bitnum = DEFAULT_CM108_PTT_BITNUM; - rs->pttport.parm.cm108.ptt_bitnum = DEFAULT_CM108_PTT_BITNUM; + + if (rs->rigport.parm.cm108.ptt_bitnum == 0) + { + rs->rigport.parm.cm108.ptt_bitnum = DEFAULT_CM108_PTT_BITNUM; + rs->pttport.parm.cm108.ptt_bitnum = DEFAULT_CM108_PTT_BITNUM; + } + break; case RIG_PORT_GPIO: commit ccca746fa7f7ac3183a8290ec41371ffbe8d021f Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Jan 9 10:44:27 2023 -0600 Update NEWS diff --git a/NEWS b/NEWS index ca819542..632ff66b 100644 --- a/NEWS +++ b/NEWS @@ -28,7 +28,7 @@ Version 4.5.4 * 2023-XX-XX * Fix get_powerstat status return for non-PS kenwood rigs * Fix set_powerstat 0 to reopen with IC-7300 (and others?) on Linux - * Fix FT-710 usage on 60M + * Fix FT-710, FTDX10, FTDX101D/MP usage on 60M * Fix timing on NRD-535D * Fix AGC levels with rigctld * Fix FTDX3000 EX039 error commit 2570c273abf8605b84a860cb1a6e187db294772e Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Jan 9 10:42:57 2023 -0600 Fix FT-710, FTDX10, FTDX101D/MP 60M operations https://github.com/Hamlib/Hamlib/issues/1211 diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index a3d5045d..703b7fb6 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -799,43 +799,88 @@ int newcat_get_conf2(RIG *rig, token_t token, char *val, int val_len) RETURNFUNC(ret); } +static int freq_60m[] = { 5332000, 5348000, 5358500, 5373000, 5405000 }; + /* returns 0 if no exeption or 1 if rig needs special handling */ -int newcat_60m_exception(RIG *rig, freq_t freq) +int newcat_60m_exception(RIG *rig, freq_t freq, mode_t mode) { struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; int err; - int is_exception = 0; + int channel = -1; + int i; + rmode_t tmode; + pbwidth_t twidth; if (!(freq > 5.2 && freq < 5.5)) // we're not on 60M { return 0; } - if (is_ftdx10) { is_exception = 1; } - else if (is_ft710) + if (mode != RIG_MODE_CW && mode != RIG_MODE_USB && mode != RIG_MODE_PKTUSB + && mode != RIG_MODE_RTTYR) + { + rig_debug(RIG_DEBUG_ERR, + "%s: only USB, PKTUSB, RTTYR, and CW allowed for 60M operations\n", __func__); + return -RIG_EINVAL; + } + + if (!is_ftdx10 && !is_ft710 && !is_ftdx101d && !is_ftdx101mp) { return 0; } + + rig_debug(RIG_DEBUG_VERBOSE, "%s: 60M exception ignoring freq/mode commands\n", + __func__); + // If US mode we need to use memory channels + SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "EX0301%c", cat_term); + + if ((err = newcat_get_cmd(rig)) != RIG_OK) { - // If US mode we need to use memory channels - SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "EX0301%c", cat_term); + RETURNFUNC2(err); + } + + // 01 is the only exception so far -- others may be like UK and have full control too + if (strncmp(&priv->ret_data[6], "01", 2) != 0) { return 0; } // no exception - if ((err = newcat_get_cmd(rig)) != RIG_OK) + // so now we should have a rig that has fixed memory channels 501-510 in USB/CW-U mode + + // toggle vfo mode if we need to + + rig_debug(RIG_DEBUG_VERBOSE, "%s: 60M exception ignoring freq/mode commands\n", + __func__); + + rig_get_mode(rig, RIG_VFO_A, &tmode, &twidth); + if (tmode != RIG_VFO_MEM) + { + err = newcat_vfomem_toggle(rig); + if (err != RIG_OK) { - RETURNFUNC2(err); + rig_debug(RIG_DEBUG_ERR, "%s: Error toggling VFO_MEM\n", __func__); + return -err; } + } + // find the nearest slot below what is requested + for (i = 0; i < 5; ++i) + { + if ((long)freq == freq_60m[i]) { channel = i; } + } - // 01 is the only exception so far -- others may be like UK and have full control too - if (strncmp(&priv->ret_data[6], "01", 2) != 0) { return 0; } // no exception - - is_exception = 1; + if (channel < 0) + { + rig_debug(RIG_DEBUG_ERR, + "%s: 60M allowed frequencies are 5.332, 5.348, 5.3585, 5.373,5.405, got %g\n", + __func__, freq / 1000); + return -RIG_EINVAL; } - if (is_exception) + if (mode == RIG_MODE_CW) { channel += 5; } + + SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "MC%3d%c", channel + 501, + cat_term); + + if ((err = newcat_set_cmd(rig)) != RIG_OK) { - rig_debug(RIG_DEBUG_VERBOSE, "%s: 60M exception ignoring freq/mode commands\n", - __func__); - return 1; + RETURNFUNC2(err); } - return 0; + return 1; } /* @@ -854,10 +899,12 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) const struct rig_caps *caps; struct newcat_priv_data *priv; int special_60m = 0; + rmode_t tmode; + pbwidth_t twidth; ENTERFUNC; - if (newcat_60m_exception(rig, freq)) + if (newcat_60m_exception(rig, freq, rig->state.cache.modeMainA)) { // we don't try to set freq on 60m for some rigs since we must be in memory mode // and we can't run split mode on 60M memory mode either @@ -882,6 +929,13 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) priv = (struct newcat_priv_data *)rig->state.priv; caps = rig->caps; + rig_get_mode(rig, RIG_VFO_A, &tmode, &twidth); + if (tmode == RIG_VFO_MEM) + { + // then we need to toggle back to VFO mode + newcat_vfomem_toggle(rig); + } + rig_debug(RIG_DEBUG_TRACE, "%s: passed vfo = %s\n", __func__, rig_strvfo(vfo)); // rig_debug(RIG_DEBUG_TRACE, "%s: translated vfo = %s\n", __func__, rig_strvfo(tvfo)); rig_debug(RIG_DEBUG_TRACE, "%s: passed freq = %"PRIfreq" Hz\n", __func__, freq); @@ -1386,7 +1440,7 @@ int newcat_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) ENTERFUNC; - if (newcat_60m_exception(rig, rig->state.cache.freqMainA)) { RETURNFUNC(RIG_OK); } // we don't set mode in this case + if (newcat_60m_exception(rig, rig->state.cache.freqMainA, mode)) { RETURNFUNC(RIG_OK); } // we don't set mode in this case if (!newcat_valid_command(rig, "MD")) { diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h index a0602bc0..5202dcfd 100644 --- a/rigs/yaesu/newcat.h +++ b/rigs/yaesu/newcat.h @@ -50,7 +50,7 @@ typedef char ncboolean; /* shared function version */ -#define NEWCAT_VER "20230108" +#define NEWCAT_VER "20230109" /* Hopefully large enough for future use, 128 chars plus '\0' */ #define NEWCAT_DATA_LEN 129 commit eea990150204ee6f0ad2099ad436f9d25651ddb9 Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Jan 9 10:28:43 2023 -0600 Fix get_powerstat status return to always show POWER_ON for kenwood non-PS rigs https://github.com/Hamlib/Hamlib/issues/1213 diff --git a/NEWS b/NEWS index dec67ca5..ca819542 100644 --- a/NEWS +++ b/NEWS @@ -26,6 +26,7 @@ Version 4.6 Version 4.5.4 * 2023-XX-XX + * Fix get_powerstat status return for non-PS kenwood rigs * Fix set_powerstat 0 to reopen with IC-7300 (and others?) on Linux * Fix FT-710 usage on 60M * Fix timing on NRD-535D diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index 223adfae..fe41cdbf 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -4878,6 +4878,7 @@ int kenwood_get_powerstat(RIG *rig, powerstat_t *status) if (!priv->has_ps) { + *status = RIG_POWER_ON; RETURNFUNC(RIG_OK); // fake the OK return for these rigs } diff --git a/rigs/kenwood/kenwood.h b/rigs/kenwood/kenwood.h index 4787ae93..69106804 100644 --- a/rigs/kenwood/kenwood.h +++ b/rigs/kenwood/kenwood.h @@ -29,7 +29,7 @@ #include "misc.h" #include "idx_builtin.h" -#define BACKEND_VER "20221230" +#define BACKEND_VER "20230109" #define EOM_KEN ';' #define EOM_TH '\r' commit 5f9fc933f5f05070ca6310b5c26cda8f5a916463 Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Jan 9 09:50:25 2023 -0600 For Icom rigs close and reopen rig after set_powerstat=1 -- Linux resets the usb device https://github.com/Hamlib/Hamlib/issues/1212 diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index e806c3cf..2b101cc1 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -7977,6 +7977,11 @@ int icom_set_powerstat(RIG *rig, powerstat_t status) memset(fe_buf, 0xfe, fe_max); // sending more than enough 0xfe's to wake up the rs232 write_block(&rs->rigport, fe_buf, fe_max); + // close and re-open the rig + // on linux the USB gets reset during power on + sleep(1); // let serial bus idle for a while + rig_close(rig); + rig_open(rig); // we'll try 0x18 0x01 now -- should work on STBY rigs too pwr_sc = S_PWR_ON; diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h index 254d89f9..3f4c3c18 100644 --- a/rigs/icom/icom.h +++ b/rigs/icom/icom.h @@ -31,7 +31,7 @@ #include <sys/time.h> #endif -#define BACKEND_VER "20230104" +#define BACKEND_VER "20230109" #define ICOM_IS_ID31 rig_is_model(rig, RIG_MODEL_ID31) #define ICOM_IS_ID51 rig_is_model(rig, RIG_MODEL_ID51) commit df2aa87a19b9d9dd9581a9f11f94f5ec444891d5 Author: Mike Black W9MDB <mdb...@ya...> Date: Sun Jan 8 16:48:35 2023 -0600 Close rig on set_powerstat 0 -- Linux was unable to reconnect to IC-7300 https://github.com/Hamlib/Hamlib/issues/1212 diff --git a/NEWS b/NEWS index 6c17f323..dec67ca5 100644 --- a/NEWS +++ b/NEWS @@ -26,6 +26,7 @@ Version 4.6 Version 4.5.4 * 2023-XX-XX + * Fix set_powerstat 0 to reopen with IC-7300 (and others?) on Linux * Fix FT-710 usage on 60M * Fix timing on NRD-535D * Fix AGC levels with rigctld diff --git a/src/rig.c b/src/rig.c index be9ca6d6..5b872eaa 100644 --- a/src/rig.c +++ b/src/rig.c @@ -6010,6 +6010,9 @@ int HAMLIB_API rig_set_powerstat(RIG *rig, powerstat_t status) HAMLIB_TRACE; retcode = rig->caps->set_powerstat(rig, status); rig_flush(&rig->state.rigport); // if anything is queued up flush it + + if (status == RIG_POWER_OFF) { rig_close(rig); } + RETURNFUNC(retcode); } commit 0fce421845b593ce59f9ca71fb069f7afae474fd Author: Mike Black W9MDB <mdb...@ya...> Date: Sun Jan 8 10:28:34 2023 -0600 Ensure 60M exception for FT710 is only for US language setting https://github.com/Hamlib/Hamlib/issues/1211 diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 3a5bf33c..a3d5045d 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -799,22 +799,36 @@ int newcat_get_conf2(RIG *rig, token_t token, char *val, int val_len) RETURNFUNC(ret); } +/* returns 0 if no exeption or 1 if rig needs special handling */ +int newcat_60m_exception(RIG *rig, freq_t freq) +{ + struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; + int err; + int is_exception = 0; + if (!(freq > 5.2 && freq < 5.5)) // we're not on 60M + { + return 0; + } + if (is_ftdx10) { is_exception = 1; } + else if (is_ft710) + { + // If US mode we need to use memory channels + SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "EX0301%c", cat_term); -/* - * newcat_set_freq - * - * Set frequency for a given VFO - * RIG_TARGETABLE_VFO - * Does not SET priv->current_vfo - * - */ + if ((err = newcat_get_cmd(rig)) != RIG_OK) + { + RETURNFUNC2(err); + } -int newcat_60m_exception(RIG *rig, freq_t freq) -{ - // can we improve this to set memory mode and pick the memory slot? - if ((is_ftdx10 || is_ft710) && freq > 5.2 && freq < 5.5) + // 01 is the only exception so far -- others may be like UK and have full control too + if (strncmp(&priv->ret_data[6], "01", 2) != 0) { return 0; } // no exception + + is_exception = 1; + } + + if (is_exception) { rig_debug(RIG_DEBUG_VERBOSE, "%s: 60M exception ignoring freq/mode commands\n", __func__); @@ -824,6 +838,14 @@ int newcat_60m_exception(RIG *rig, freq_t freq) return 0; } +/* + * newcat_set_freq + * + * Set frequency for a given VFO + * RIG_TARGETABLE_VFO + * Does not SET priv->current_vfo + * + */ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) { char c; commit e3926a2e139f301f508d7236ca72e4fc0a0fbcac Author: Mike Black W9MDB <mdb...@ya...> Date: Sun Jan 8 07:58:57 2023 -0600 Add FT-710 to 60M exception in newcat.c to allow some ability to work with WSJT-X https://github.com/Hamlib/Hamlib/issues/1211 diff --git a/NEWS b/NEWS index 187b734f..6c17f323 100644 --- a/NEWS +++ b/NEWS @@ -26,6 +26,7 @@ Version 4.6 Version 4.5.4 * 2023-XX-XX + * Fix FT-710 usage on 60M * Fix timing on NRD-535D * Fix AGC levels with rigctld * Fix FTDX3000 EX039 error diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 281a2d33..3a5bf33c 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -814,7 +814,7 @@ int newcat_get_conf2(RIG *rig, token_t token, char *val, int val_len) int newcat_60m_exception(RIG *rig, freq_t freq) { // can we improve this to set memory mode and pick the memory slot? - if (is_ftdx10 && freq > 5.2 && freq < 5.5) + if ((is_ftdx10 || is_ft710) && freq > 5.2 && freq < 5.5) { rig_debug(RIG_DEBUG_VERBOSE, "%s: 60M exception ignoring freq/mode commands\n", __func__); diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h index 78aa63aa..a0602bc0 100644 --- a/rigs/yaesu/newcat.h +++ b/rigs/yaesu/newcat.h @@ -50,7 +50,7 @@ typedef char ncboolean; /* shared function version */ -#define NEWCAT_VER "20230107" +#define NEWCAT_VER "20230108" /* Hopefully large enough for future use, 128 chars plus '\0' */ #define NEWCAT_DATA_LEN 129 commit c653d5effdfaa734b94b745ce6e3802dc9319866 Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Jan 7 22:17:24 2023 -0600 Update timing in nrd535.c based on testing thanks to markjfine diff --git a/rigs/jrc/nrd535.c b/rigs/jrc/nrd535.c index d4b0a707..a31e1700 100644 --- a/rigs/jrc/nrd535.c +++ b/rigs/jrc/nrd535.c @@ -96,7 +96,7 @@ const struct rig_caps nrd535_caps = RIG_MODEL(RIG_MODEL_NRD535), .model_name = "NRD-535D", .mfg_name = "JRC", - .version = BACKEND_VER ".0", + .version = BACKEND_VER ".1", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_RECEIVER, @@ -110,8 +110,8 @@ const struct rig_caps nrd535_caps = .serial_parity = RIG_PARITY_NONE, .serial_handshake = RIG_HANDSHAKE_NONE, .write_delay = 0, - .post_write_delay = 20, - .timeout = 200, + .post_write_delay = 21, + .timeout = 250, .retry = 3, .has_get_func = NRD535_FUNC, commit 771075445f91d20e84b932ec6bfbd52dc9a938f4 Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Jan 7 22:20:06 2023 -0600 Update NEWS diff --git a/NEWS b/NEWS index 2c6b975d..187b734f 100644 --- a/NEWS +++ b/NEWS @@ -26,6 +26,7 @@ Version 4.6 Version 4.5.4 * 2023-XX-XX + * Fix timing on NRD-535D * Fix AGC levels with rigctld * Fix FTDX3000 EX039 error * Fix Elecraft power2mW operation commit 8296a7f6cae251beac807ee3fca2a6e43a3ea171 Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Jan 7 17:30:09 2023 -0600 Update NEWS diff --git a/NEWS b/NEWS index ac1b0756..2c6b975d 100644 --- a/NEWS +++ b/NEWS @@ -27,6 +27,8 @@ Version 4.6 Version 4.5.4 * 2023-XX-XX * Fix AGC levels with rigctld + * Fix FTDX3000 EX039 error + * Fix Elecraft power2mW operation * Fix rig_power2mW so it checks all ranges * Allow rigctld to start with autopower_on=0 to avoid startup timeouts when rig is powered off * Fix dummy device to work with grig by disallowing empty "u" call commit 7b2abebeea8373475076860da0582edfd99f65fd Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Jan 7 16:03:34 2023 -0600 Fix FTDX3000 EX039 error https://github.com/Hamlib/Hamlib/issues/1206 diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 2d611638..281a2d33 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -546,6 +546,7 @@ int newcat_open(RIG *rig) struct rig_state *rig_s = &rig->state; const char *handshake[3] = {"None", "Xon/Xoff", "Hardware"}; int err; + int set_only = 0; ENTERFUNC; @@ -611,15 +612,24 @@ int newcat_open(RIG *rig) else if (priv->rig_id == NC_RIGID_FT991A || rig->caps->rig_model == RIG_MODEL_FT991) { cmd = "EX0321;EX032;"; } else if (priv->rig_id == NC_RIGID_FTDX3000 - || rig->caps->rig_model == RIG_MODEL_FTDX3000) { cmd = "EX0391;"; } + || rig->caps->rig_model == RIG_MODEL_FTDX3000) { cmd = "EX0391;"; set_only = 1; } else if (priv->rig_id == NC_RIGID_FTDX3000DM - || rig->caps->rig_model == RIG_MODEL_FTDX3000) { cmd = "EX0391;"; } + || rig->caps->rig_model == RIG_MODEL_FTDX3000) { cmd = "EX0391;"; set_only = 1; } else if (priv->rig_id == NC_RIGID_FTDX5000 || rig->caps->rig_model == RIG_MODEL_FTDX5000) { cmd = "EX0331;EX033"; } SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "%s", cmd); - if (RIG_OK != (err = newcat_get_cmd(rig))) + if (set_only) + { + err = newcat_set_cmd(rig); + } + else + { + err = newcat_get_cmd(rig); + } + + if (err != RIG_OK) { RETURNFUNC(err); } @@ -636,9 +646,17 @@ int newcat_open(RIG *rig) // Remember EX103 status SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "EX103;"); rig_debug(RIG_DEBUG_TRACE, "%s: cmd_str = %s\n", __func__, priv->cmd_str); - err = newcat_get_cmd(rig); - if (RIG_OK != (err = newcat_get_cmd(rig))) + if (set_only) + { + err = newcat_set_cmd(rig); + } + else + { + err = newcat_get_cmd(rig); + } + + if (err != RIG_OK) { RETURNFUNC(err); } diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h index 7e196a9d..78aa63aa 100644 --- a/rigs/yaesu/newcat.h +++ b/rigs/yaesu/newcat.h @@ -50,7 +50,7 @@ typedef char ncboolean; /* shared function version */ -#define NEWCAT_VER "20230106" +#define NEWCAT_VER "20230107" /* Hopefully large enough for future use, 128 chars plus '\0' */ #define NEWCAT_DATA_LEN 129 commit 09b71a11d0ef9e1b7c5ab330985d084a1da9e194 Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Jan 7 11:46:56 2023 -0600 Force K22 mode on Elecraft rigs to get PC power level in .1W intervals for low power operations https://github.com/Hamlib/Hamlib/issues/1205 diff --git a/rigs/kenwood/elecraft.c b/rigs/kenwood/elecraft.c index ad3d4171..077a4aa4 100644 --- a/rigs/kenwood/elecraft.c +++ b/rigs/kenwood/elecraft.c @@ -165,6 +165,18 @@ int elecraft_open(RIG *rig) } } + if (rig->caps->rig_model != RIG_MODEL_XG3) // XG3 doesn't have extended + { + // turn on k2 extended to get PC values in more resolution + err = kenwood_transaction(rig, "K22;", NULL, 0); + + if (err != RIG_OK) + { + rig_debug(RIG_DEBUG_ERR, "%s: error setting K22='%s'...continuing\n", __func__, + rigerror(err)); + } + } + switch (rig->caps->rig_model) { case RIG_MODEL_K2: @@ -310,8 +322,8 @@ int elecraft_open(RIG *rig) kenwood_get_trn(rig, &priv->trn_state); /* ignore errors */ /* Currently we cannot cope with AI mode so turn it off in case last client left it on */ - kenwood_set_trn(rig, RIG_TRN_OFF); /* ignore status in case - it's not supported */ + kenwood_set_trn(rig, + RIG_TRN_OFF); /* ignore status in case it's not supported */ } // For rigs like K3X vfo emulation need to set VFO_A to start diff --git a/rigs/kenwood/k3.c b/rigs/kenwood/k3.c index 3847cd81..a9b0a1f6 100644 --- a/rigs/kenwood/k3.c +++ b/rigs/kenwood/k3.c @@ -160,7 +160,8 @@ int kx3_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val); int kx3_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val); int k3_set_func(RIG *rig, vfo_t vfo, setting_t func, int status); int k3_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status); -int k3_power2mW(RIG *rig, unsigned int *mwpower, float power, freq_t freq, rmode_t mode); +int k3_power2mW(RIG *rig, unsigned int *mwpower, float power, freq_t freq, + rmode_t mode); /* Private helper functions */ int set_rit_xit(RIG *rig, shortfreq_t rit); @@ -1825,6 +1826,7 @@ static int k3_get_maxpower(RIG *rig) break; } } + #endif rig_debug(RIG_DEBUG_TRACE, "%s: maxpower=%d\n", __func__, maxpower); @@ -1944,8 +1946,9 @@ int k3_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) break; case RIG_LEVEL_RFPOWER: - SNPRINTF(levelbuf, sizeof(levelbuf), "PC%03d", - (int)(val.f * k3_get_maxpower(rig))); + kenwood_val = (int)(val.f * k3_get_maxpower(rig)); + SNPRINTF(levelbuf, sizeof(levelbuf), "PC%03d%s", kenwood_val, + kenwood_val > 15 ? "1" : "0"); break; default: @@ -2247,7 +2250,15 @@ int k3_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) return RIG_EPROTO; } - val->f = (float) lvl / k3_get_maxpower(rig); + // extended K22 format PCnnnx where 0=.1W units and 1=1W units + if (len == 6 && levelbuf[5] == '0') + { + val->f = (float) lvl / 10.0 / k3_get_maxpower(rig); + } + else + { + val->f = (float) lvl / k3_get_maxpower(rig); + } break; diff --git a/simulators/simelecraft.c b/simulators/simelecraft.c index 1c71ce6f..e5af7a66 100644 --- a/simulators/simelecraft.c +++ b/simulators/simelecraft.c @@ -132,7 +132,8 @@ int main(int argc, char *argv[]) { printf("%s\n", buf); usleep(50 * 1000); - pbuf = "IF059014200000+000000700000;"; + //pbuf = "IF059014200000+000000700000;"; + pbuf = "IF00007230000 -000000 0001000001 ;" ; n = write(fd, pbuf, strlen(pbuf)); printf("n=%d\n", n); @@ -264,7 +265,7 @@ int main(int argc, char *argv[]) } else if (strncmp(buf, "PC;", 3) == 0) { - SNPRINTF(buf, sizeof(buf), "PC005;"); + SNPRINTF(buf, sizeof(buf), "PC0150;"); n = write(fd, buf, strlen(buf)); } else if (strlen(buf) > 0) commit 3e5080ebff5a98a52527c1c2fa4fc3818dbf7558 Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Jan 6 23:31:18 2023 -0600 Fix elecraft power2mW by scaling power to either 15W or 100W based on KPA availability We are ignoring the tx_range values for the Kn series https://github.com/Hamlib/Hamlib/issues/1205 diff --git a/rigs/kenwood/k3.c b/rigs/kenwood/k3.c index fa85a7d6..3847cd81 100644 --- a/rigs/kenwood/k3.c +++ b/rigs/kenwood/k3.c @@ -160,6 +160,7 @@ int kx3_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val); int kx3_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val); int k3_set_func(RIG *rig, vfo_t vfo, setting_t func, int status); int k3_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status); +int k3_power2mW(RIG *rig, unsigned int *mwpower, float power, freq_t freq, rmode_t mode); /* Private helper functions */ int set_rit_xit(RIG *rig, shortfreq_t rit); @@ -188,7 +189,7 @@ const struct rig_caps k3_caps = RIG_MODEL(RIG_MODEL_K3), .model_name = "K3", .mfg_name = "Elecraft", - .version = BACKEND_VER ".24", + .version = BACKEND_VER ".25", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -331,6 +332,7 @@ const struct rig_caps k3_caps = .get_ant = kenwood_get_ant, .send_morse = kenwood_send_morse, .wait_morse = rig_wait_morse, + .power2mW = k3_power2mW, .hamlib_check_rig_caps = HAMLIB_CHECK_RIG_CAPS }; @@ -340,7 +342,7 @@ const struct rig_caps k3s_caps = RIG_MODEL(RIG_MODEL_K3S), .model_name = "K3S", .mfg_name = "Elecraft", - .version = BACKEND_VER ".18", + .version = BACKEND_VER ".19", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -482,6 +484,7 @@ const struct rig_caps k3s_caps = .get_ant = kenwood_get_ant, .send_morse = kenwood_send_morse, .wait_morse = rig_wait_morse, + .power2mW = k3_power2mW, .hamlib_check_rig_caps = HAMLIB_CHECK_RIG_CAPS }; @@ -491,7 +494,7 @@ const struct rig_caps k4_caps = RIG_MODEL(RIG_MODEL_K4), .model_name = "K4", .mfg_name = "Elecraft", - .version = BACKEND_VER ".24", + .version = BACKEND_VER ".25", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -633,6 +636,7 @@ const struct rig_caps k4_caps = .get_ant = kenwood_get_ant, .send_morse = kenwood_send_morse, .wait_morse = rig_wait_morse, + .power2mW = k3_power2mW, .hamlib_check_rig_caps = HAMLIB_CHECK_RIG_CAPS }; @@ -641,7 +645,7 @@ const struct rig_caps kx3_caps = RIG_MODEL(RIG_MODEL_KX3), .model_name = "KX3", .mfg_name = "Elecraft", - .version = BACKEND_VER ".17", + .version = BACKEND_VER ".18", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -783,6 +787,7 @@ const struct rig_caps kx3_caps = .get_ant = kenwood_get_ant, .send_morse = kenwood_send_morse, .wait_morse = rig_wait_morse, + .power2mW = k3_power2mW, .hamlib_check_rig_caps = HAMLIB_CHECK_RIG_CAPS }; @@ -791,7 +796,7 @@ const struct rig_caps kx2_caps = RIG_MODEL(RIG_MODEL_KX2), .model_name = "KX2", .mfg_name = "Elecraft", - .version = BACKEND_VER ".16", + .version = BACKEND_VER ".17", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -840,8 +845,8 @@ const struct rig_caps kx2_caps = RIG_FRNG_END, }, /* rx range */ .tx_range_list1 = { - FRQ_RNG_HF(1, K3_MODES, mW(10), W(10), K3_VFO, K3_ANTS), - FRQ_RNG_6m(1, K3_MODES, mW(10), W(10), K3_VFO, K3_ANTS), + FRQ_RNG_HF(1, K3_MODES, mW(10), W(12), K3_VFO, K3_ANTS), + FRQ_RNG_6m(1, K3_MODES, mW(10), W(12), K3_VFO, K3_ANTS), RIG_FRNG_END, }, /* tx range */ @@ -851,8 +856,8 @@ const struct rig_caps kx2_caps = RIG_FRNG_END, }, /* rx range */ .tx_range_list2 = { - FRQ_RNG_HF(2, K3_MODES, mW(10), W(10), K3_VFO, K3_ANTS), - FRQ_RNG_6m(2, K3_MODES, mW(10), W(10), K3_VFO, K3_ANTS), + FRQ_RNG_HF(2, K3_MODES, mW(10), W(12), K3_VFO, K3_ANTS), + FRQ_RNG_6m(2, K3_MODES, mW(10), W(12), K3_VFO, K3_ANTS), RIG_FRNG_END, }, /* tx range */ .tuning_steps = { @@ -933,6 +938,7 @@ const struct rig_caps kx2_caps = .get_ant = kenwood_get_ant, .send_morse = kenwood_send_morse, .wait_morse = rig_wait_morse, + .power2mW = k3_power2mW, .hamlib_check_rig_caps = HAMLIB_CHECK_RIG_CAPS }; @@ -1768,17 +1774,20 @@ int k3_get_split_mode(RIG *rig, vfo_t vfo, rmode_t *tx_mode, static int k3_get_maxpower(RIG *rig) { - int retval; - int maxpower = 12; // K3 default power level - char levelbuf[KENWOOD_MAX_BUF_LEN]; + //int retval; + int maxpower = 15; // K3 default power level + //char levelbuf[KENWOOD_MAX_BUF_LEN]; struct kenwood_priv_data *priv = rig->state.priv; - // default range is 0-12 if there is no KPA3 installed + // default range is 0-15 if there is no KPA3 installed if (priv->has_kpa3 || priv->has_kpa100) { maxpower = 110; } +// Elecraft makes max power pretty variable +// So we will stick with 15W or 110W and scale everything to that +#if 0 else if (RIG_IS_KX2 || RIG_IS_KX3) { @@ -1816,11 +1825,22 @@ static int k3_get_maxpower(RIG *rig) break; } } +#endif rig_debug(RIG_DEBUG_TRACE, "%s: maxpower=%d\n", __func__, maxpower); return maxpower; } +int k3_power2mW(RIG *rig, + unsigned int *mwpower, + float power, + freq_t freq, + rmode_t mode) +{ + *mwpower = power * k3_get_maxpower(rig) * 1000; + return RIG_OK; +} + int k3_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) { char levelbuf[16]; @@ -2220,13 +2240,7 @@ int k3_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) if (len == 5 || len == 6) { - sscanf(levelbuf + 2, "%d", &lvl); - - if (len == 6) - { - // K2 extended reply - lvl /= 10; - } + sscanf(levelbuf + 2, "%3d", &lvl); } else { diff --git a/simulators/simelecraft.c b/simulators/simelecraft.c index 0be6800e..1c71ce6f 100644 --- a/simulators/simelecraft.c +++ b/simulators/simelecraft.c @@ -262,6 +262,11 @@ int main(int argc, char *argv[]) SNPRINTF(buf, sizeof(buf), "TQ0;"); write(fd, buf, strlen(buf)); } + else if (strncmp(buf, "PC;", 3) == 0) + { + SNPRINTF(buf, sizeof(buf), "PC005;"); + n = write(fd, buf, strlen(buf)); + } else if (strlen(buf) > 0) { fprintf(stderr, "Unknown command: %s\n", buf); commit b9ee776e5b58d7225730687b65e548423c241cef Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Jan 6 22:22:25 2023 -0600 Remove EX039 check from FTDX3000/3000DM https://github.com/Hamlib/Hamlib/issues/1206 diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index bf219832..2d611638 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -611,9 +611,9 @@ int newcat_open(RIG *rig) else if (priv->rig_id == NC_RIGID_FT991A || rig->caps->rig_model == RIG_MODEL_FT991) { cmd = "EX0321;EX032;"; } else if (priv->rig_id == NC_RIGID_FTDX3000 - || rig->caps->rig_model == RIG_MODEL_FTDX3000) { cmd = "EX0391;EX039;"; } + || rig->caps->rig_model == RIG_MODEL_FTDX3000) { cmd = "EX0391;"; } else if (priv->rig_id == NC_RIGID_FTDX3000DM - || rig->caps->rig_model == RIG_MODEL_FTDX3000) { cmd = "EX0391;EX039;"; } + || rig->caps->rig_model == RIG_MODEL_FTDX3000) { cmd = "EX0391;"; } else if (priv->rig_id == NC_RIGID_FTDX5000 || rig->caps->rig_model == RIG_MODEL_FTDX5000) { cmd = "EX0331;EX033"; } diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h index 914c535f..7e196a9d 100644 --- a/rigs/yaesu/newcat.h +++ b/rigs/yaesu/newcat.h @@ -50,7 +50,7 @@ typedef char ncboolean; /* shared function version */ -#define NEWCAT_VER "20221228" +#define NEWCAT_VER "20230106" /* Hopefully large enough for future use, 128 chars plus '\0' */ #define NEWCAT_DATA_LEN 129 commit efc295159987f88d22d2f1c52081a77775bc2293 Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Jan 6 16:41:45 2023 -0600 Remove unnecessary check from netrigctl.c https://github.com/Hamlib/Hamlib/issues/1155 diff --git a/rigs/dummy/netrigctl.c b/rigs/dummy/netrigctl.c index 61c15d76..c0ce157a 100644 --- a/rigs/dummy/netrigctl.c +++ b/rigs/dummy/netrigctl.c @@ -825,7 +825,6 @@ static int netrigctl_open(RIG *rig) if (n == 2) { - if (agc_code == RIG_AGC_OFF) { p = strtok(NULL, " "); continue; } ; rig->caps->agc_levels[i++] = agc_code; rig->caps->agc_level_count++; rig_debug(RIG_DEBUG_VERBOSE, "%s: rig has agc code=%d, level=%s\n", __func__, commit df8c625cc9723a5200bf8e4cd27fc993687ab656 Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Jan 6 10:30:32 2023 -0600 Update man pages to clarify upper/lower case for set/get commands diff --git a/doc/man1/rigctl.1 b/doc/man1/rigctl.1 index 73bc1320..3eb537ef 100644 --- a/doc/man1/rigctl.1 +++ b/doc/man1/rigctl.1 @@ -351,12 +351,12 @@ Since most of the .B Hamlib operations have a .BR set " and a " get -method, an upper case letter will often be used for a +method, a single upper case letter will often be used for a .B set -method whereas the corresponding lower case letter refers to the +method whereas the corresponding single lower case letter refers to the .B get method. Each operation also has a long name; in interactive mode, prepend a -backslash, \(oq\\\(cq, to enter a long command name. +backslash, \(oq\\\(cq, to enter a long command name all lower case. . .PP Example: Use \(lq\\dump_caps\(rq to see what capabilities this radio and diff --git a/doc/man1/rigctld.1 b/doc/man1/rigctld.1 index 391920a7..fd9469fc 100644 --- a/doc/man1/rigctld.1 +++ b/doc/man1/rigctld.1 @@ -414,12 +414,12 @@ Since most of the .B Hamlib operations have a .BR set " and a " get -method, an upper case letter will be used for +method, a single pper case letter will be used for .B set -methods whereas the corresponding lower case letter refers to the +methods whereas the corresponding single lower case letter refers to the .B get method. Each operation also has a long name; prepend a backslash, \(oq\\\(cq, -to send a long command name. +to send a long command name all in lower case. . .PP Example (Perl): \(lqprint $socket "\\\\dump_caps\\n";\(rq to see what the commit 23e4eb2885809e087cb656a34ae6f9faee13aa7a Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Jan 6 16:21:58 2023 -0600 Fix rigctld agc level readings -- allow for rig backedn to specify "RIG_AGC_NONE" now for clarity if desired https://github.com/Hamlib/Hamlib/issues/1155 diff --git a/NEWS b/NEWS index 0924a332..ac1b0756 100644 --- a/NEWS +++ b/NEWS @@ -26,6 +26,7 @@ Version 4.6 Version 4.5.4 * 2023-XX-XX + * Fix AGC levels with rigctld * Fix rig_power2mW so it checks all ranges * Allow rigctld to start with autopower_on=0 to avoid startup timeouts when rig is powered off * Fix dummy device to work with grig by disallowing empty "u" call diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h index 4279bb15..37f85267 100644 --- a/include/hamlib/rig.h +++ b/include/hamlib/rig.h @@ -333,7 +333,7 @@ typedef enum { */ /* TODO: kill me, and replace by real AGC delay */ enum agc_level_e { - RIG_AGC_OFF = 0, + RIG_AGC_OFF = 0, RIG_AGC_SUPERFAST, RIG_AGC_FAST, RIG_AGC_SLOW, @@ -341,7 +341,8 @@ enum agc_level_e { RIG_AGC_MEDIUM, RIG_AGC_AUTO, RIG_AGC_LONG, - RIG_AGC_ON /*< Turns AGC ON -- Kenwood -- restores last level set */ + RIG_AGC_ON, /*< Turns AGC ON -- Kenwood -- restores last level set */ + RIG_AGC_NONE /*< Rig does not have CAT AGC control */ }; diff --git a/rigs/dummy/netrigctl.c b/rigs/dummy/netrigctl.c index 0477306d..61c15d76 100644 --- a/rigs/dummy/netrigctl.c +++ b/rigs/dummy/netrigctl.c @@ -812,9 +812,10 @@ static int netrigctl_open(RIG *rig) } else if (strcmp(setting, "agc_levels") == 0) { - int i = 1; + int i = 0; char *p = strtok(value, " "); - rig->caps->agc_levels[0] = RIG_AGC_OFF; + rig->caps->agc_levels[0] = RIG_AGC_NONE; // default value gets overwritten + rig->caps->agc_level_count = 1; while (p) { @@ -824,7 +825,9 @@ static int netrigctl_open(RIG *rig) if (n == 2) { + if (agc_code == RIG_AGC_OFF) { p = strtok(NULL, " "); continue; } ; rig->caps->agc_levels[i++] = agc_code; + rig->caps->agc_level_count++; rig_debug(RIG_DEBUG_VERBOSE, "%s: rig has agc code=%d, level=%s\n", __func__, agc_code, agc_string); } @@ -836,8 +839,6 @@ static int netrigctl_open(RIG *rig) rig_debug(RIG_DEBUG_VERBOSE, "%d=%s\n", agc_code, agc_string); p = strtok(NULL, " "); } - - rig->caps->agc_level_count = i; } else { @@ -2736,7 +2737,7 @@ struct rig_caps netrigctl_caps = RIG_MODEL(RIG_MODEL_NETRIGCTL), .model_name = "NET rigctl", .mfg_name = "Hamlib", - .version = "20230104.0", + .version = "20230106.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_OTHER, diff --git a/simulators/simft991.c b/simulators/simft991.c index 83ebc2e7..965deb4f 100644 --- a/simulators/simft991.c +++ b/simulators/simft991.c @@ -12,6 +12,10 @@ float freqA = 14074000; float freqB = 14074500; +char tx_vfo = '0'; +char rx_vfo = '0'; +char modeA = '0'; +char modeB = '0'; // ID 0310 == 310, Must drop leading zero typedef enum nc_rigid_e @@ -104,7 +108,7 @@ int main(int argc, char *argv[]) { printf("Cmd:%s\n", buf); } - else { return 0; } + else { continue; } if (strcmp(buf, "RM5;") == 0) { @@ -137,6 +141,24 @@ int main(int argc, char *argv[]) if (n <= 0) { perror("IF"); } } + else if (strcmp(buf, "FA;") == 0) + { + SNPRINTF(buf, sizeof(buf), "FA%08.0f;", freqA); + n = write(fd, buf, strlen(buf)); + } + else if (strncmp(buf, "FA", 2) == 0) + { + sscanf(buf, "FA%f", &freqA); + } + else if (strcmp(buf, "FB;") == 0) + { + SNPRINTF(buf, sizeof(buf), "FB%08.0f;", freqB); + n = write(fd, buf, strlen(buf)); + } + else if (strncmp(buf, "FB", 2) == 0) + { + sscanf(buf, "FB%f", &freqB); + } else if (strcmp(buf, "ID;") == 0) { printf("%s\n", buf); @@ -148,6 +170,11 @@ int main(int argc, char *argv[]) if (n <= 0) { perror("ID"); } } + else if (strcmp(buf, "PS;") == 0) + { + SNPRINTF(buf, sizeof(buf), "PS1;"); + n = write(fd, buf, strlen(buf)); + } else if (strcmp(buf, "AI;") == 0) { printf("%s\n", buf); @@ -158,6 +185,54 @@ int main(int argc, char *argv[]) if (n <= 0) { perror("ID"); } } + else if (strcmp(buf, "AI0;") == 0) + { + usleep(50 * 1000); + } + else if (strcmp(buf, "FT;") == 0) + { + usleep(50 * 1000); + SNPRINTF(buf, sizeof(buf), "FT%c;", tx_vfo); + printf(" FT response#1=%s, tx_vfo=%c\n", buf, tx_vfo); + n = write(fd, buf, strlen(buf)); + printf(" FT response#2=%s\n", buf); + + if (n < 0) { perror("FT"); } + } + else if (strncmp(buf, "FT", 2) == 0) + { + tx_vfo = buf[2]; + + if (tx_vfo == '3') { tx_vfo = '1'; } + else if (tx_vfo == '2') { tx_vfo = '0'; } + else { perror("Expected 2 or 3"); } + } + else if (strcmp(buf, "MD0;") == 0) + { + usleep(50 * 1000); + SNPRINTF(buf, sizeof(buf), "MD0%c;", modeA); + n = write(fd, buf, strlen(buf)); + + if (n < 0) { perror("MD0;"); } + } + else if (strncmp(buf, "MD0", 3) == 0) + { + modeA = buf[3]; + } + else if (strcmp(buf, "MD1;") == 0) + { + usleep(50 * 1000); + SNPRINTF(buf, sizeof(buf), "MD1%c;", modeB); + n = write(fd, buf, strlen(buf)); + + if (n < 0) { perror("MD0;"); } + } + else if (strncmp(buf, "MD1", 3) == 0) + { + modeB = buf[3]; + } + + #if 0 else if (strncmp(buf, "AI", 2) == 0) diff --git a/src/misc.c b/src/misc.c index 008b1754..e38d35a5 100644 --- a/src/misc.c +++ b/src/misc.c @@ -1284,6 +1284,7 @@ static const struct { RIG_AGC_AUTO, "AUTO" }, { RIG_AGC_LONG, "LONG" }, { RIG_AGC_ON, "ON" }, + { RIG_AGC_NONE, "NONE" }, { -1, "" }, }; diff --git a/tests/dumpcaps.c b/tests/dumpcaps.c index 19811bde..0100c113 100644 --- a/tests/dumpcaps.c +++ b/tests/dumpcaps.c @@ -296,7 +296,6 @@ int dumpcaps(RIG *rig, FILE *fout) fprintf(fout, "\n"); -#if 0 fprintf(fout, "AGC levels:"); const struct icom_priv_caps *priv_caps = (const struct icom_priv_caps *) rig->caps->priv; @@ -313,6 +312,7 @@ int dumpcaps(RIG *rig, FILE *fout) } else { + for (i = 0; i < HAMLIB_MAX_AGC_LEVELS && i < caps->agc_level_count; i++) { fprintf(fout, " %d=%s", caps->agc_levels[i], @@ -320,16 +320,13 @@ int dumpcaps(RIG *rig, FILE *fout) } } -#else - //fprintf(fout, "\n"); - fprintf(fout, "AGC levels: "); - char buf[1024]; - rig_sprintf_agc_levels(rig, buf, (int)sizeof(buf)); - fprintf(fout, "%s", buf); -#endif + fprintf(fout, "\n"); if (i == 0) { + rig_debug(RIG_DEBUG_WARN, + "%s: defaulting to all levels since rig does not have any\n", __func__); + // Fall back to printing out all levels for backwards-compatibility for (i = RIG_AGC_OFF; i <= RIG_AGC_LAST; i++) { commit 852440b0fa14cb52fef0d84c88522c6fe8dbcb99 Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Jan 5 23:32:41 2023 -0600 Update NEWS diff --git a/NEWS b/NEWS index ae716d06..0924a332 100644 --- a/NEWS +++ b/NEWS @@ -26,6 +26,7 @@ Version 4.6 Version 4.5.4 * 2023-XX-XX + * Fix rig_power2mW so it checks all ranges * Allow rigctld to start with autopower_on=0 to avoid startup timeouts when rig is powered off * Fix dummy device to work with grig by disallowing empty "u" call * Fix ID5100 and promote to stable and hopefully ID4100 too commit 990c1768f8d3a2117e94880c213ddfa7ef3c57c6 Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Jan 5 23:31:15 2023 -0600 Fix rig_getpower2mW so it checks all range lists https://github.com/Hamlib/Hamlib/issues/1205 diff --git a/src/rig.c b/src/rig.c index 736cf818..be9ca6d6 100644 --- a/src/rig.c +++ b/src/rig.c @@ -5847,11 +5847,23 @@ int HAMLIB_API rig_power2mW(RIG *rig, txrange = rig_get_range(rig->state.tx_range_list, freq, mode); - if (!txrange) + // check all the range lists + if (txrange == NULL) { rig_get_range(rig->caps->tx_range_list1, freq, mode); } + + if (txrange == NULL) { rig_get_range(rig->caps->tx_range_list2, freq, mode); } + + if (txrange == NULL) { rig_get_range(rig->caps->tx_range_list3, freq, mode); } + + if (txrange == NULL) { rig_get_range(rig->caps->tx_range_list4, freq, mode); } + + if (txrange == NULL) { rig_get_range(rig->caps->tx_range_list5, freq, mode); } + + if (txrange == NULL) { /* * freq is not on the tx range! */ + rig_debug(RIG_DEBUG_ERR, "%s: freq not in tx range\n", __func__); RETURNFUNC(-RIG_EINVAL); } @@ -6843,7 +6855,7 @@ const freq_range_t *HAMLIB_API rig_get_range(const freq_range_t *range_list, { int i; - if (!range_list) + if (range_list == NULL) { return (NULL); } commit 5c478c922232eb30fadc50854c1a6e65f75a63d3 Author: Mike Black W9MDB <mdb...@ya...> Date: Wed Jan 4 17:23:49 2023 -0600 Update NEWS diff --git a/NEWS b/NEWS index 0facc972..ae716d06 100644 --- a/NEWS +++ b/NEWS @@ -26,6 +26,9 @@ Version 4.6 Version 4.5.4 * 2023-XX-XX + * Allow rigctld to start with autopower_on=0 to avoid startup timeouts when rig is powered off + * Fix dummy device to work with grig by disallowing empty "u" call + * Fix ID5100 and promote to stable and hopefully ID4100 too * Remove get_powerstat from Icom ID-5100,ID-4100,ID-31,ID-51 and fix get/set freq in all Version 4.5.3 commit 9e74696a427d3b455c78cade2ea8b49d258c896e Author: Mike Black W9MDB <mdb...@ya...> Date: Wed Jan 4 17:22:56 2023 -0600 Allow rigctld to start with autopower_on=0 and avoid timeouts at startup diff --git a/tests/rigctld.c b/tests/rigctld.c index 9bc906b2..e52f57f1 100644 --- a/tests/rigctld.c +++ b/tests/rigctld.c @@ -156,6 +156,7 @@ extern int lock_mode; extern powerstat_t rig_powerstat; static int rigctld_idle = 0; // if true then rig will close when no clients are connected +static int skip_open = 0; #define MAXCONFLEN 1024 @@ -509,19 +510,29 @@ int main(int argc, char *argv[]) exit(1); } - if (*conf_parms != '\0') + if (strcmp(optarg, "autopower_on=0") == 0) { - strcat(conf_parms, ","); + rig_debug(RIG_DEBUG_ERR, "%s: skipping rig_open\n", __func__); + skip_open = 1; } - - if (strlen(conf_parms) + strlen(optarg) > MAXCONFLEN - 24) + else { - printf("Length of conf_parms exceeds internal maximum of %d\n", - MAXCONFLEN - 24); - return 1; + + if (*conf_parms != '\0') + { + strcat(conf_parms, ","); + } + + if (strlen(conf_parms) + strlen(optarg) > MAXCONFLEN - 24) + { + printf("Length of conf_parms exceeds internal maximum of %d\n", + MAXCONFLEN - 24); + return 1; + } + + strncat(conf_parms, optarg, MAXCONFLEN - strlen(conf_parms)); } - strncat(conf_parms, optarg, MAXCONFLEN - strlen(conf_parms)); break; case 't': @@ -758,8 +769,15 @@ int main(int argc, char *argv[]) } /* attempt to open rig to check early for issues */ - retcode = rig_open(my_rig); - rig_opened = retcode == RIG_OK ? 1 : 0; + if (skip_open) + { + rig_opened = 0; + } + else + { + retcode = rig_open(my_rig); + rig_opened = retcode == RIG_OK ? 1 : 0; + } if (retcode != RIG_OK) { commit 41ad82139f954913090aa83d2e322a6e58412542 Author: Mike Black W9MDB <mdb...@ya...> Date: Wed Jan 4 15:40:36 2023 -0600 Update ID5100 and ID4100 Promote ID5100 to stable https://github.com/Hamlib/Hamlib/issues/1204 https://github.com/Hamlib/Hamlib/issues/1202 https://github.com/Hamlib/Hamlib/issues/1202 diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index c5dd7dcf..e806c3cf 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -1363,16 +1363,22 @@ int icom_set_freq(RIG *rig, vfo_t vfo, freq_t freq) else { cmd = C_SET_FREQ; + subcmd = -1; if (ICOM_IS_ID5100 || ICOM_IS_ID4100 || ICOM_IS_ID31 || ICOM_IS_ID51) { // for these rigs 0x00 is setting the freq and 0x03 is just for reading cmd = 0x00; + // temporary fix for ID5100 not giving ACK/NAK on 0x00 freq on E8 firmware + retval = icom_transaction(rig, cmd, subcmd, freqbuf, freq_len, NULL, + NULL); + return RIG_OK; + } + else + { + retval = icom_transaction(rig, cmd, subcmd, freqbuf, freq_len, ackbuf, + &ack_len); } - - subcmd = -1; - retval = icom_transaction(rig, cmd, subcmd, freqbuf, freq_len, ackbuf, - &ack_len); } hl_usleep(50 * 1000); // pause for transceive message and we'll flush it @@ -1699,7 +1705,8 @@ int icom_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) if (freq_len == 3 && (ICOM_IS_ID5100 || ICOM_IS_ID4100 || ICOM_IS_ID31 || ICOM_IS_ID51)) { - rig_debug(RIG_DEBUG_ERR, "%s: 3-byte ID5100/4100 length - turn off XONXOFF flow control\n", __func__); + rig_debug(RIG_DEBUG_ERR, + "%s: 3-byte ID5100/4100 length - turn off XONXOFF flow control\n", __func__); } else if (freq_len != 4 && freq_len != 5) { diff --git a/rigs/icom/id4100.c b/rigs/icom/id4100.c index 52837820..6b4a46ac 100644 --- a/rigs/icom/id4100.c +++ b/rigs/icom/id4100.c @@ -98,7 +98,6 @@ const struct rig_caps id4100_caps = .serial_data_bits = 8, .serial_stop_bits = 1, .serial_parity = RIG_PARITY_NONE, - //.serial_handshake = RIG_HANDSHAKE_XONXOFF, .serial_handshake = RIG_HANDSHAKE_NONE, .write_delay = 0, .post_write_delay = 0, diff --git a/rigs/icom/id5100.c b/rigs/icom/id5100.c index 3c04551e..d0de207d 100644 --- a/rigs/icom/id5100.c +++ b/rigs/icom/id5100.c @@ -90,13 +90,16 @@ int id5100_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) case RIG_MODE_FMN: icmode = 5; modebuf = 2; break; - case RIG_MODE_DSTAR: icmode = 17; modebuf = 1; break; + case RIG_MODE_DSTAR: icmode = 0x17; modebuf = 1; break; default: rig_debug(RIG_DEBUG_ERR, "%s: Unknown mode=%s\n", __func__, rig_strrmode(mode)); return -RIG_EINVAL; } + rig_debug(RIG_DEBUG_VERBOSE, "%s: mode=%d, modebuf=%c\n", __func__, icmode, + modebuf); + retval = icom_transaction(rig, C_SET_MODE, icmode, &modebuf, 1, ackbuf, &ack_len); @@ -118,11 +121,17 @@ int id5100_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) switch (modebuf[1]) { - case 2: *mode = modebuf[3] == 1 ? RIG_MODE_AM : RIG_MODE_AMN; break; + case 2: + *mode = modebuf[2] == 1 ? RIG_MODE_AM : RIG_MODE_AMN; + *width = modebuf[2] == 1 ? 12000 : 6000; break; - case 5: *mode = modebuf[3] == 1 ? RIG_MODE_FM : RIG_MODE_FMN; break; + case 5: + *mode = modebuf[2] == 1 ? RIG_MODE_FM : RIG_MODE_FMN; + *width = modebuf[2] == 1 ? 10000 : 5000; break; - case 17: *mode = RIG_MODE_DSTAR; break; + case 0x17: + *mode = RIG_MODE_DSTAR; + *width = 6000; break; } return RIG_OK; @@ -144,7 +153,7 @@ const struct rig_caps id5100_caps = .mfg_name = "Icom", .version = BACKEND_VER ".2", .copyright = "LGPL", - .status = RIG_STATUS_BETA, + .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_MOBILE, .ptt_type = RIG_PTT_RIG, .dcd_type = RIG_DCD_RIG, @@ -154,8 +163,6 @@ const struct rig_caps id5100_caps = .serial_data_bits = 8, .serial_stop_bits = 1, .serial_parity = RIG_PARITY_NONE, - // XONXOFF is not working on Firmware E8 - //.serial_handshake = RIG_HANDSHAKE_XONXOFF, .serial_handshake = RIG_HANDSHAKE_NONE, .write_delay = 0, .post_write_delay = 0, diff --git a/simulators/Makefile.am b/simulators/Makefile.am index e0002914..eebddedd 100644 --- a/simulators/Makefile.am +++ b/simulators/Makefile.am @@ -8,12 +8,13 @@ DISTCLEANFILES = bin_PROGRAMS = -check_PROGRAMS = simelecraft simicom simkenwood simyaesu simicom9700 +check_PROGRAMS = simelecraft simicom simkenwood simyaesu simicom9700 simft991 simftdx1200 simftdx3000 simjupiter simpowersdr simelecraft_SOURCES = simelecraft.c simicom_SOURCES = simicom.c simkenwood_SOURCES = simkenwood.c simyaesu_SOURCES = simyaesu.c +simid5100_SOURCES = simid5100.c # include generated include files ahead of any in sources #rigctl_CPPFLAGS = -I$(top_builddir)/tests -I$(top_builddir)/src -I$(srcdir) $(AM_CPPFLAGS) @@ -25,17 +26,20 @@ simelecraft_CFL... [truncated message content] |
From: n0nb <n0...@us...> - 2023-01-10 00:57:01
|
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 aa1cf567f67febd90e6d6a804ba2950fd9f2b6cf (commit) via 7cc477869f195b1da5f536ad118bf45d8fe69e11 (commit) via 3eedc5a5af3ed6b374ccc13d8d43b6111aa0f34b (commit) via 56c87cfa9a4f88381cb01384215a0f1d4ae86ac3 (commit) via 7c5b095ff3618ba8b25370d15cea1fe8f11e2227 (commit) via 58621995f3c28529ba2f86b0b6fe071d288a212a (commit) via d2ef9d5edaa843d0a9cd653eb39245c243f300c4 (commit) via 89fadca3bdbcbc288e0b3db02d1a7143be8a95f1 (commit) via 93e3aec58863b87b41dd68fcef4f11f4838f418a (commit) via 57522f0b93958262225827088667035735503f25 (commit) via 8be3fcbef500df7c1ce6d14fdb1a06dbd5015c10 (commit) via 0a2dddfce05043eb1e0c1137e32b15e153a966e3 (commit) via e3ac42a6b65246114d5fdc6e98d708f45879d3fb (commit) via 02312ef322a7664e25c50eb993e04f0b2607500d (commit) via 6cb7a8c56080218c61de8f0322df04639d0f0147 (commit) via 7978d74750db62ce36190bd97f160395e41c6f3f (commit) via eb904148b5a35dc1b13d70076370125658671778 (commit) via 22df154486fa59489d9bc51ff220ab70e2961c66 (commit) via 79255fa27cba9ea1884e29df700466ef5f946566 (commit) via 4a487ffdcceb2789930fd1e941810a9f5cd4aaf8 (commit) via db218e9e73e6763dafb7a7137656c4faf11ef360 (commit) via 86771a95575116f31f498a8912d36e114f1109bc (commit) via e6c5c15452bad475ddf69c0ae74cd63e6bc347b3 (commit) via bbd0f856ca3f26b5d6367c4ca3d8519e58458e08 (commit) via 31d2939acc21fe58b5f203fa5a1c1e6bebb947c4 (commit) via 589736e8f7e8e8def8f136436a8b9af72c32d31b (commit) via 6dbd2cff5e1b5be4aefeb463f00391e5d05d89a5 (commit) via 902be172c1613d97bcba8f90e9199100c0578b0b (commit) via f1b6d322ba549a245ff9e488b3e02b755512e1aa (commit) via 87cc9a8c3d133ab18a6f4b9758e98836bd0fd101 (commit) via 383c95b9c4cfce2cc7b3ad243c997953b716994c (commit) via af9a7a6938f0f7a7ea7c329b110241480f474577 (commit) via cceffce4a50bf4413dfcca0e1ba3d2ada7aa48a6 (commit) via 0404b43bd8225608d443dab3a48f1161b12b2486 (commit) via 138795668f66c472bcaf16f3b1eb7076dfad88ba (commit) via 9c5809ffba8712c314a78dcadcfe8ae75a1beaa7 (commit) via 1b6b78f54a98f9450a621895fd759d89435fb060 (commit) via 4c09344f32cff0eb27333b904db017324aef4be7 (commit) from 9f0bd7b310e7d21c857052cb6249d6210caabd61 (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 aa1cf567f67febd90e6d6a804ba2950fd9f2b6cf Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Jan 9 12:34:22 2023 -0600 Fix Icom poweron behavior https://github.com/Hamlib/Hamlib/issues/1212 diff --git a/NEWS b/NEWS index 369326eb..b2909aaa 100644 --- a/NEWS +++ b/NEWS @@ -27,6 +27,7 @@ Version 4.6 Version 4.5.4 * 2023-XX-XX * Fix CM108 ptt setting for non-default usage + * Fix power on/off for Icom rigs with rigctld power_on=0 * Fix get_powerstat status return for non-PS kenwood rigs * Fix FT-710, FTDX10, FTDX101D/MP usage on 60M * Fix timing on NRD-535D diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 2b101cc1..d912ad97 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -7979,8 +7979,8 @@ int icom_set_powerstat(RIG *rig, powerstat_t status) write_block(&rs->rigport, fe_buf, fe_max); // close and re-open the rig // on linux the USB gets reset during power on - sleep(1); // let serial bus idle for a while rig_close(rig); + sleep(1); // let serial bus idle for a while rig_open(rig); // we'll try 0x18 0x01 now -- should work on STBY rigs too commit 7cc477869f195b1da5f536ad118bf45d8fe69e11 Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Jan 9 12:21:33 2023 -0600 Revert "Close rig on set_powerstat 0 -- Linux was unable to reconnect to IC-7300" This reverts commit 93e3aec58863b87b41dd68fcef4f11f4838f418a. diff --git a/NEWS b/NEWS index a430b0f4..369326eb 100644 --- a/NEWS +++ b/NEWS @@ -28,7 +28,6 @@ Version 4.5.4 * 2023-XX-XX * Fix CM108 ptt setting for non-default usage * Fix get_powerstat status return for non-PS kenwood rigs - * Fix set_powerstat 0 to reopen with IC-7300 (and others?) on Linux * Fix FT-710, FTDX10, FTDX101D/MP usage on 60M * Fix timing on NRD-535D * Fix AGC levels with rigctld diff --git a/src/rig.c b/src/rig.c index aa3be50d..d4cff0ae 100644 --- a/src/rig.c +++ b/src/rig.c @@ -6019,9 +6019,6 @@ int HAMLIB_API rig_set_powerstat(RIG *rig, powerstat_t status) HAMLIB_TRACE; retcode = rig->caps->set_powerstat(rig, status); rig_flush(&rig->state.rigport); // if anything is queued up flush it - - if (status == RIG_POWER_OFF) { rig_close(rig); } - RETURNFUNC(retcode); } commit 3eedc5a5af3ed6b374ccc13d8d43b6111aa0f34b Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Jan 9 11:24:34 2023 -0600 Update NEWS https://github.com/Hamlib/Hamlib/issues/1203 diff --git a/NEWS b/NEWS index 632ff66b..a430b0f4 100644 --- a/NEWS +++ b/NEWS @@ -26,6 +26,7 @@ Version 4.6 Version 4.5.4 * 2023-XX-XX + * Fix CM108 ptt setting for non-default usage * Fix get_powerstat status return for non-PS kenwood rigs * Fix set_powerstat 0 to reopen with IC-7300 (and others?) on Linux * Fix FT-710, FTDX10, FTDX101D/MP usage on 60M commit 56c87cfa9a4f88381cb01384215a0f1d4ae86ac3 Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Jan 9 11:03:50 2023 -0600 Fix CM108 ptt setting https://github.com/Hamlib/Hamlib/issues/1203 diff --git a/src/conf.c b/src/conf.c index 92f067a3..f0612783 100644 --- a/src/conf.c +++ b/src/conf.c @@ -559,6 +559,7 @@ static int frontend_set_conf(RIG *rig, token_t token, const char *val) } rs->pttport.parm.cm108.ptt_bitnum = val_i; + rs->rigport.parm.cm108.ptt_bitnum = val_i; rs->pttport_deprecated.parm.cm108.ptt_bitnum = val_i; break; diff --git a/src/rig.c b/src/rig.c index b65a5419..aa3be50d 100644 --- a/src/rig.c +++ b/src/rig.c @@ -588,8 +588,13 @@ RIG *HAMLIB_API rig_init(rig_model_t rig_model) */ case RIG_PORT_CM108: strncpy(rs->rigport.pathname, DEFAULT_CM108_PORT, HAMLIB_FILPATHLEN); - rs->rigport.parm.cm108.ptt_bitnum = DEFAULT_CM108_PTT_BITNUM; - rs->pttport.parm.cm108.ptt_bitnum = DEFAULT_CM108_PTT_BITNUM; + + if (rs->rigport.parm.cm108.ptt_bitnum == 0) + { + rs->rigport.parm.cm108.ptt_bitnum = DEFAULT_CM108_PTT_BITNUM; + rs->pttport.parm.cm108.ptt_bitnum = DEFAULT_CM108_PTT_BITNUM; + } + break; case RIG_PORT_GPIO: commit 7c5b095ff3618ba8b25370d15cea1fe8f11e2227 Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Jan 9 10:44:27 2023 -0600 Update NEWS diff --git a/NEWS b/NEWS index ca819542..632ff66b 100644 --- a/NEWS +++ b/NEWS @@ -28,7 +28,7 @@ Version 4.5.4 * 2023-XX-XX * Fix get_powerstat status return for non-PS kenwood rigs * Fix set_powerstat 0 to reopen with IC-7300 (and others?) on Linux - * Fix FT-710 usage on 60M + * Fix FT-710, FTDX10, FTDX101D/MP usage on 60M * Fix timing on NRD-535D * Fix AGC levels with rigctld * Fix FTDX3000 EX039 error commit 58621995f3c28529ba2f86b0b6fe071d288a212a Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Jan 9 10:42:57 2023 -0600 Fix FT-710, FTDX10, FTDX101D/MP 60M operations https://github.com/Hamlib/Hamlib/issues/1211 diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index a3d5045d..703b7fb6 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -799,43 +799,88 @@ int newcat_get_conf2(RIG *rig, token_t token, char *val, int val_len) RETURNFUNC(ret); } +static int freq_60m[] = { 5332000, 5348000, 5358500, 5373000, 5405000 }; + /* returns 0 if no exeption or 1 if rig needs special handling */ -int newcat_60m_exception(RIG *rig, freq_t freq) +int newcat_60m_exception(RIG *rig, freq_t freq, mode_t mode) { struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; int err; - int is_exception = 0; + int channel = -1; + int i; + rmode_t tmode; + pbwidth_t twidth; if (!(freq > 5.2 && freq < 5.5)) // we're not on 60M { return 0; } - if (is_ftdx10) { is_exception = 1; } - else if (is_ft710) + if (mode != RIG_MODE_CW && mode != RIG_MODE_USB && mode != RIG_MODE_PKTUSB + && mode != RIG_MODE_RTTYR) + { + rig_debug(RIG_DEBUG_ERR, + "%s: only USB, PKTUSB, RTTYR, and CW allowed for 60M operations\n", __func__); + return -RIG_EINVAL; + } + + if (!is_ftdx10 && !is_ft710 && !is_ftdx101d && !is_ftdx101mp) { return 0; } + + rig_debug(RIG_DEBUG_VERBOSE, "%s: 60M exception ignoring freq/mode commands\n", + __func__); + // If US mode we need to use memory channels + SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "EX0301%c", cat_term); + + if ((err = newcat_get_cmd(rig)) != RIG_OK) { - // If US mode we need to use memory channels - SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "EX0301%c", cat_term); + RETURNFUNC2(err); + } + + // 01 is the only exception so far -- others may be like UK and have full control too + if (strncmp(&priv->ret_data[6], "01", 2) != 0) { return 0; } // no exception - if ((err = newcat_get_cmd(rig)) != RIG_OK) + // so now we should have a rig that has fixed memory channels 501-510 in USB/CW-U mode + + // toggle vfo mode if we need to + + rig_debug(RIG_DEBUG_VERBOSE, "%s: 60M exception ignoring freq/mode commands\n", + __func__); + + rig_get_mode(rig, RIG_VFO_A, &tmode, &twidth); + if (tmode != RIG_VFO_MEM) + { + err = newcat_vfomem_toggle(rig); + if (err != RIG_OK) { - RETURNFUNC2(err); + rig_debug(RIG_DEBUG_ERR, "%s: Error toggling VFO_MEM\n", __func__); + return -err; } + } + // find the nearest slot below what is requested + for (i = 0; i < 5; ++i) + { + if ((long)freq == freq_60m[i]) { channel = i; } + } - // 01 is the only exception so far -- others may be like UK and have full control too - if (strncmp(&priv->ret_data[6], "01", 2) != 0) { return 0; } // no exception - - is_exception = 1; + if (channel < 0) + { + rig_debug(RIG_DEBUG_ERR, + "%s: 60M allowed frequencies are 5.332, 5.348, 5.3585, 5.373,5.405, got %g\n", + __func__, freq / 1000); + return -RIG_EINVAL; } - if (is_exception) + if (mode == RIG_MODE_CW) { channel += 5; } + + SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "MC%3d%c", channel + 501, + cat_term); + + if ((err = newcat_set_cmd(rig)) != RIG_OK) { - rig_debug(RIG_DEBUG_VERBOSE, "%s: 60M exception ignoring freq/mode commands\n", - __func__); - return 1; + RETURNFUNC2(err); } - return 0; + return 1; } /* @@ -854,10 +899,12 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) const struct rig_caps *caps; struct newcat_priv_data *priv; int special_60m = 0; + rmode_t tmode; + pbwidth_t twidth; ENTERFUNC; - if (newcat_60m_exception(rig, freq)) + if (newcat_60m_exception(rig, freq, rig->state.cache.modeMainA)) { // we don't try to set freq on 60m for some rigs since we must be in memory mode // and we can't run split mode on 60M memory mode either @@ -882,6 +929,13 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) priv = (struct newcat_priv_data *)rig->state.priv; caps = rig->caps; + rig_get_mode(rig, RIG_VFO_A, &tmode, &twidth); + if (tmode == RIG_VFO_MEM) + { + // then we need to toggle back to VFO mode + newcat_vfomem_toggle(rig); + } + rig_debug(RIG_DEBUG_TRACE, "%s: passed vfo = %s\n", __func__, rig_strvfo(vfo)); // rig_debug(RIG_DEBUG_TRACE, "%s: translated vfo = %s\n", __func__, rig_strvfo(tvfo)); rig_debug(RIG_DEBUG_TRACE, "%s: passed freq = %"PRIfreq" Hz\n", __func__, freq); @@ -1386,7 +1440,7 @@ int newcat_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) ENTERFUNC; - if (newcat_60m_exception(rig, rig->state.cache.freqMainA)) { RETURNFUNC(RIG_OK); } // we don't set mode in this case + if (newcat_60m_exception(rig, rig->state.cache.freqMainA, mode)) { RETURNFUNC(RIG_OK); } // we don't set mode in this case if (!newcat_valid_command(rig, "MD")) { diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h index a0602bc0..5202dcfd 100644 --- a/rigs/yaesu/newcat.h +++ b/rigs/yaesu/newcat.h @@ -50,7 +50,7 @@ typedef char ncboolean; /* shared function version */ -#define NEWCAT_VER "20230108" +#define NEWCAT_VER "20230109" /* Hopefully large enough for future use, 128 chars plus '\0' */ #define NEWCAT_DATA_LEN 129 commit d2ef9d5edaa843d0a9cd653eb39245c243f300c4 Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Jan 9 10:28:43 2023 -0600 Fix get_powerstat status return to always show POWER_ON for kenwood non-PS rigs https://github.com/Hamlib/Hamlib/issues/1213 diff --git a/NEWS b/NEWS index dec67ca5..ca819542 100644 --- a/NEWS +++ b/NEWS @@ -26,6 +26,7 @@ Version 4.6 Version 4.5.4 * 2023-XX-XX + * Fix get_powerstat status return for non-PS kenwood rigs * Fix set_powerstat 0 to reopen with IC-7300 (and others?) on Linux * Fix FT-710 usage on 60M * Fix timing on NRD-535D diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index 223adfae..fe41cdbf 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -4878,6 +4878,7 @@ int kenwood_get_powerstat(RIG *rig, powerstat_t *status) if (!priv->has_ps) { + *status = RIG_POWER_ON; RETURNFUNC(RIG_OK); // fake the OK return for these rigs } diff --git a/rigs/kenwood/kenwood.h b/rigs/kenwood/kenwood.h index 4787ae93..69106804 100644 --- a/rigs/kenwood/kenwood.h +++ b/rigs/kenwood/kenwood.h @@ -29,7 +29,7 @@ #include "misc.h" #include "idx_builtin.h" -#define BACKEND_VER "20221230" +#define BACKEND_VER "20230109" #define EOM_KEN ';' #define EOM_TH '\r' commit 89fadca3bdbcbc288e0b3db02d1a7143be8a95f1 Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Jan 9 09:50:25 2023 -0600 For Icom rigs close and reopen rig after set_powerstat=1 -- Linux resets the usb device https://github.com/Hamlib/Hamlib/issues/1212 diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index e806c3cf..2b101cc1 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -7977,6 +7977,11 @@ int icom_set_powerstat(RIG *rig, powerstat_t status) memset(fe_buf, 0xfe, fe_max); // sending more than enough 0xfe's to wake up the rs232 write_block(&rs->rigport, fe_buf, fe_max); + // close and re-open the rig + // on linux the USB gets reset during power on + sleep(1); // let serial bus idle for a while + rig_close(rig); + rig_open(rig); // we'll try 0x18 0x01 now -- should work on STBY rigs too pwr_sc = S_PWR_ON; diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h index 254d89f9..3f4c3c18 100644 --- a/rigs/icom/icom.h +++ b/rigs/icom/icom.h @@ -31,7 +31,7 @@ #include <sys/time.h> #endif -#define BACKEND_VER "20230104" +#define BACKEND_VER "20230109" #define ICOM_IS_ID31 rig_is_model(rig, RIG_MODEL_ID31) #define ICOM_IS_ID51 rig_is_model(rig, RIG_MODEL_ID51) commit 93e3aec58863b87b41dd68fcef4f11f4838f418a Author: Mike Black W9MDB <mdb...@ya...> Date: Sun Jan 8 16:48:35 2023 -0600 Close rig on set_powerstat 0 -- Linux was unable to reconnect to IC-7300 https://github.com/Hamlib/Hamlib/issues/1212 diff --git a/NEWS b/NEWS index 6c17f323..dec67ca5 100644 --- a/NEWS +++ b/NEWS @@ -26,6 +26,7 @@ Version 4.6 Version 4.5.4 * 2023-XX-XX + * Fix set_powerstat 0 to reopen with IC-7300 (and others?) on Linux * Fix FT-710 usage on 60M * Fix timing on NRD-535D * Fix AGC levels with rigctld diff --git a/src/rig.c b/src/rig.c index eaac46ec..b65a5419 100644 --- a/src/rig.c +++ b/src/rig.c @@ -6014,6 +6014,9 @@ int HAMLIB_API rig_set_powerstat(RIG *rig, powerstat_t status) HAMLIB_TRACE; retcode = rig->caps->set_powerstat(rig, status); rig_flush(&rig->state.rigport); // if anything is queued up flush it + + if (status == RIG_POWER_OFF) { rig_close(rig); } + RETURNFUNC(retcode); } commit 57522f0b93958262225827088667035735503f25 Author: Mike Black W9MDB <mdb...@ya...> Date: Sun Jan 8 10:28:34 2023 -0600 Ensure 60M exception for FT710 is only for US language setting https://github.com/Hamlib/Hamlib/issues/1211 diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 3a5bf33c..a3d5045d 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -799,22 +799,36 @@ int newcat_get_conf2(RIG *rig, token_t token, char *val, int val_len) RETURNFUNC(ret); } +/* returns 0 if no exeption or 1 if rig needs special handling */ +int newcat_60m_exception(RIG *rig, freq_t freq) +{ + struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; + int err; + int is_exception = 0; + if (!(freq > 5.2 && freq < 5.5)) // we're not on 60M + { + return 0; + } + if (is_ftdx10) { is_exception = 1; } + else if (is_ft710) + { + // If US mode we need to use memory channels + SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "EX0301%c", cat_term); -/* - * newcat_set_freq - * - * Set frequency for a given VFO - * RIG_TARGETABLE_VFO - * Does not SET priv->current_vfo - * - */ + if ((err = newcat_get_cmd(rig)) != RIG_OK) + { + RETURNFUNC2(err); + } -int newcat_60m_exception(RIG *rig, freq_t freq) -{ - // can we improve this to set memory mode and pick the memory slot? - if ((is_ftdx10 || is_ft710) && freq > 5.2 && freq < 5.5) + // 01 is the only exception so far -- others may be like UK and have full control too + if (strncmp(&priv->ret_data[6], "01", 2) != 0) { return 0; } // no exception + + is_exception = 1; + } + + if (is_exception) { rig_debug(RIG_DEBUG_VERBOSE, "%s: 60M exception ignoring freq/mode commands\n", __func__); @@ -824,6 +838,14 @@ int newcat_60m_exception(RIG *rig, freq_t freq) return 0; } +/* + * newcat_set_freq + * + * Set frequency for a given VFO + * RIG_TARGETABLE_VFO + * Does not SET priv->current_vfo + * + */ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) { char c; commit 8be3fcbef500df7c1ce6d14fdb1a06dbd5015c10 Author: Mike Black W9MDB <mdb...@ya...> Date: Sun Jan 8 07:58:57 2023 -0600 Add FT-710 to 60M exception in newcat.c to allow some ability to work with WSJT-X https://github.com/Hamlib/Hamlib/issues/1211 diff --git a/NEWS b/NEWS index 187b734f..6c17f323 100644 --- a/NEWS +++ b/NEWS @@ -26,6 +26,7 @@ Version 4.6 Version 4.5.4 * 2023-XX-XX + * Fix FT-710 usage on 60M * Fix timing on NRD-535D * Fix AGC levels with rigctld * Fix FTDX3000 EX039 error diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 281a2d33..3a5bf33c 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -814,7 +814,7 @@ int newcat_get_conf2(RIG *rig, token_t token, char *val, int val_len) int newcat_60m_exception(RIG *rig, freq_t freq) { // can we improve this to set memory mode and pick the memory slot? - if (is_ftdx10 && freq > 5.2 && freq < 5.5) + if ((is_ftdx10 || is_ft710) && freq > 5.2 && freq < 5.5) { rig_debug(RIG_DEBUG_VERBOSE, "%s: 60M exception ignoring freq/mode commands\n", __func__); diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h index 78aa63aa..a0602bc0 100644 --- a/rigs/yaesu/newcat.h +++ b/rigs/yaesu/newcat.h @@ -50,7 +50,7 @@ typedef char ncboolean; /* shared function version */ -#define NEWCAT_VER "20230107" +#define NEWCAT_VER "20230108" /* Hopefully large enough for future use, 128 chars plus '\0' */ #define NEWCAT_DATA_LEN 129 commit 0a2dddfce05043eb1e0c1137e32b15e153a966e3 Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Jan 7 22:20:06 2023 -0600 Update NEWS diff --git a/NEWS b/NEWS index 2c6b975d..187b734f 100644 --- a/NEWS +++ b/NEWS @@ -26,6 +26,7 @@ Version 4.6 Version 4.5.4 * 2023-XX-XX + * Fix timing on NRD-535D * Fix AGC levels with rigctld * Fix FTDX3000 EX039 error * Fix Elecraft power2mW operation commit e3ac42a6b65246114d5fdc6e98d708f45879d3fb Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Jan 7 22:17:24 2023 -0600 Update timing in nrd535.c based on testing thanks to markjfine diff --git a/rigs/jrc/nrd535.c b/rigs/jrc/nrd535.c index d4b0a707..a31e1700 100644 --- a/rigs/jrc/nrd535.c +++ b/rigs/jrc/nrd535.c @@ -96,7 +96,7 @@ const struct rig_caps nrd535_caps = RIG_MODEL(RIG_MODEL_NRD535), .model_name = "NRD-535D", .mfg_name = "JRC", - .version = BACKEND_VER ".0", + .version = BACKEND_VER ".1", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_RECEIVER, @@ -110,8 +110,8 @@ const struct rig_caps nrd535_caps = .serial_parity = RIG_PARITY_NONE, .serial_handshake = RIG_HANDSHAKE_NONE, .write_delay = 0, - .post_write_delay = 20, - .timeout = 200, + .post_write_delay = 21, + .timeout = 250, .retry = 3, .has_get_func = NRD535_FUNC, commit 02312ef322a7664e25c50eb993e04f0b2607500d Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Jan 7 17:30:09 2023 -0600 Update NEWS diff --git a/NEWS b/NEWS index ac1b0756..2c6b975d 100644 --- a/NEWS +++ b/NEWS @@ -27,6 +27,8 @@ Version 4.6 Version 4.5.4 * 2023-XX-XX * Fix AGC levels with rigctld + * Fix FTDX3000 EX039 error + * Fix Elecraft power2mW operation * Fix rig_power2mW so it checks all ranges * Allow rigctld to start with autopower_on=0 to avoid startup timeouts when rig is powered off * Fix dummy device to work with grig by disallowing empty "u" call commit 6cb7a8c56080218c61de8f0322df04639d0f0147 Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Jan 7 16:03:34 2023 -0600 Fix FTDX3000 EX039 error https://github.com/Hamlib/Hamlib/issues/1206 diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 2d611638..281a2d33 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -546,6 +546,7 @@ int newcat_open(RIG *rig) struct rig_state *rig_s = &rig->state; const char *handshake[3] = {"None", "Xon/Xoff", "Hardware"}; int err; + int set_only = 0; ENTERFUNC; @@ -611,15 +612,24 @@ int newcat_open(RIG *rig) else if (priv->rig_id == NC_RIGID_FT991A || rig->caps->rig_model == RIG_MODEL_FT991) { cmd = "EX0321;EX032;"; } else if (priv->rig_id == NC_RIGID_FTDX3000 - || rig->caps->rig_model == RIG_MODEL_FTDX3000) { cmd = "EX0391;"; } + || rig->caps->rig_model == RIG_MODEL_FTDX3000) { cmd = "EX0391;"; set_only = 1; } else if (priv->rig_id == NC_RIGID_FTDX3000DM - || rig->caps->rig_model == RIG_MODEL_FTDX3000) { cmd = "EX0391;"; } + || rig->caps->rig_model == RIG_MODEL_FTDX3000) { cmd = "EX0391;"; set_only = 1; } else if (priv->rig_id == NC_RIGID_FTDX5000 || rig->caps->rig_model == RIG_MODEL_FTDX5000) { cmd = "EX0331;EX033"; } SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "%s", cmd); - if (RIG_OK != (err = newcat_get_cmd(rig))) + if (set_only) + { + err = newcat_set_cmd(rig); + } + else + { + err = newcat_get_cmd(rig); + } + + if (err != RIG_OK) { RETURNFUNC(err); } @@ -636,9 +646,17 @@ int newcat_open(RIG *rig) // Remember EX103 status SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "EX103;"); rig_debug(RIG_DEBUG_TRACE, "%s: cmd_str = %s\n", __func__, priv->cmd_str); - err = newcat_get_cmd(rig); - if (RIG_OK != (err = newcat_get_cmd(rig))) + if (set_only) + { + err = newcat_set_cmd(rig); + } + else + { + err = newcat_get_cmd(rig); + } + + if (err != RIG_OK) { RETURNFUNC(err); } diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h index 7e196a9d..78aa63aa 100644 --- a/rigs/yaesu/newcat.h +++ b/rigs/yaesu/newcat.h @@ -50,7 +50,7 @@ typedef char ncboolean; /* shared function version */ -#define NEWCAT_VER "20230106" +#define NEWCAT_VER "20230107" /* Hopefully large enough for future use, 128 chars plus '\0' */ #define NEWCAT_DATA_LEN 129 commit 7978d74750db62ce36190bd97f160395e41c6f3f Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Jan 7 11:46:56 2023 -0600 Force K22 mode on Elecraft rigs to get PC power level in .1W intervals for low power operations https://github.com/Hamlib/Hamlib/issues/1205 diff --git a/rigs/kenwood/elecraft.c b/rigs/kenwood/elecraft.c index ad3d4171..077a4aa4 100644 --- a/rigs/kenwood/elecraft.c +++ b/rigs/kenwood/elecraft.c @@ -165,6 +165,18 @@ int elecraft_open(RIG *rig) } } + if (rig->caps->rig_model != RIG_MODEL_XG3) // XG3 doesn't have extended + { + // turn on k2 extended to get PC values in more resolution + err = kenwood_transaction(rig, "K22;", NULL, 0); + + if (err != RIG_OK) + { + rig_debug(RIG_DEBUG_ERR, "%s: error setting K22='%s'...continuing\n", __func__, + rigerror(err)); + } + } + switch (rig->caps->rig_model) { case RIG_MODEL_K2: @@ -310,8 +322,8 @@ int elecraft_open(RIG *rig) kenwood_get_trn(rig, &priv->trn_state); /* ignore errors */ /* Currently we cannot cope with AI mode so turn it off in case last client left it on */ - kenwood_set_trn(rig, RIG_TRN_OFF); /* ignore status in case - it's not supported */ + kenwood_set_trn(rig, + RIG_TRN_OFF); /* ignore status in case it's not supported */ } // For rigs like K3X vfo emulation need to set VFO_A to start diff --git a/rigs/kenwood/k3.c b/rigs/kenwood/k3.c index 3847cd81..a9b0a1f6 100644 --- a/rigs/kenwood/k3.c +++ b/rigs/kenwood/k3.c @@ -160,7 +160,8 @@ int kx3_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val); int kx3_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val); int k3_set_func(RIG *rig, vfo_t vfo, setting_t func, int status); int k3_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status); -int k3_power2mW(RIG *rig, unsigned int *mwpower, float power, freq_t freq, rmode_t mode); +int k3_power2mW(RIG *rig, unsigned int *mwpower, float power, freq_t freq, + rmode_t mode); /* Private helper functions */ int set_rit_xit(RIG *rig, shortfreq_t rit); @@ -1825,6 +1826,7 @@ static int k3_get_maxpower(RIG *rig) break; } } + #endif rig_debug(RIG_DEBUG_TRACE, "%s: maxpower=%d\n", __func__, maxpower); @@ -1944,8 +1946,9 @@ int k3_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) break; case RIG_LEVEL_RFPOWER: - SNPRINTF(levelbuf, sizeof(levelbuf), "PC%03d", - (int)(val.f * k3_get_maxpower(rig))); + kenwood_val = (int)(val.f * k3_get_maxpower(rig)); + SNPRINTF(levelbuf, sizeof(levelbuf), "PC%03d%s", kenwood_val, + kenwood_val > 15 ? "1" : "0"); break; default: @@ -2247,7 +2250,15 @@ int k3_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) return RIG_EPROTO; } - val->f = (float) lvl / k3_get_maxpower(rig); + // extended K22 format PCnnnx where 0=.1W units and 1=1W units + if (len == 6 && levelbuf[5] == '0') + { + val->f = (float) lvl / 10.0 / k3_get_maxpower(rig); + } + else + { + val->f = (float) lvl / k3_get_maxpower(rig); + } break; diff --git a/simulators/simelecraft.c b/simulators/simelecraft.c index 661095a9..ea82a0a3 100644 --- a/simulators/simelecraft.c +++ b/simulators/simelecraft.c @@ -132,7 +132,8 @@ int main(int argc, char *argv[]) { printf("%s\n", buf); usleep(50 * 1000); - pbuf = "IF059014200000+000000700000;"; + //pbuf = "IF059014200000+000000700000;"; + pbuf = "IF00007230000 -000000 0001000001 ;" ; n = write(fd, pbuf, strlen(pbuf)); printf("n=%d\n", n); @@ -280,7 +281,7 @@ int main(int argc, char *argv[]) } else if (strncmp(buf, "PC;", 3) == 0) { - SNPRINTF(buf, sizeof(buf), "PC005;"); + SNPRINTF(buf, sizeof(buf), "PC0150;"); n = write(fd, buf, strlen(buf)); } else if (strlen(buf) > 0) commit eb904148b5a35dc1b13d70076370125658671778 Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Jan 6 23:31:18 2023 -0600 Fix elecraft power2mW by scaling power to either 15W or 100W based on KPA availability We are ignoring the tx_range values for the Kn series https://github.com/Hamlib/Hamlib/issues/1205 diff --git a/rigs/kenwood/k3.c b/rigs/kenwood/k3.c index fa85a7d6..3847cd81 100644 --- a/rigs/kenwood/k3.c +++ b/rigs/kenwood/k3.c @@ -160,6 +160,7 @@ int kx3_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val); int kx3_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val); int k3_set_func(RIG *rig, vfo_t vfo, setting_t func, int status); int k3_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status); +int k3_power2mW(RIG *rig, unsigned int *mwpower, float power, freq_t freq, rmode_t mode); /* Private helper functions */ int set_rit_xit(RIG *rig, shortfreq_t rit); @@ -188,7 +189,7 @@ const struct rig_caps k3_caps = RIG_MODEL(RIG_MODEL_K3), .model_name = "K3", .mfg_name = "Elecraft", - .version = BACKEND_VER ".24", + .version = BACKEND_VER ".25", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -331,6 +332,7 @@ const struct rig_caps k3_caps = .get_ant = kenwood_get_ant, .send_morse = kenwood_send_morse, .wait_morse = rig_wait_morse, + .power2mW = k3_power2mW, .hamlib_check_rig_caps = HAMLIB_CHECK_RIG_CAPS }; @@ -340,7 +342,7 @@ const struct rig_caps k3s_caps = RIG_MODEL(RIG_MODEL_K3S), .model_name = "K3S", .mfg_name = "Elecraft", - .version = BACKEND_VER ".18", + .version = BACKEND_VER ".19", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -482,6 +484,7 @@ const struct rig_caps k3s_caps = .get_ant = kenwood_get_ant, .send_morse = kenwood_send_morse, .wait_morse = rig_wait_morse, + .power2mW = k3_power2mW, .hamlib_check_rig_caps = HAMLIB_CHECK_RIG_CAPS }; @@ -491,7 +494,7 @@ const struct rig_caps k4_caps = RIG_MODEL(RIG_MODEL_K4), .model_name = "K4", .mfg_name = "Elecraft", - .version = BACKEND_VER ".24", + .version = BACKEND_VER ".25", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -633,6 +636,7 @@ const struct rig_caps k4_caps = .get_ant = kenwood_get_ant, .send_morse = kenwood_send_morse, .wait_morse = rig_wait_morse, + .power2mW = k3_power2mW, .hamlib_check_rig_caps = HAMLIB_CHECK_RIG_CAPS }; @@ -641,7 +645,7 @@ const struct rig_caps kx3_caps = RIG_MODEL(RIG_MODEL_KX3), .model_name = "KX3", .mfg_name = "Elecraft", - .version = BACKEND_VER ".17", + .version = BACKEND_VER ".18", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -783,6 +787,7 @@ const struct rig_caps kx3_caps = .get_ant = kenwood_get_ant, .send_morse = kenwood_send_morse, .wait_morse = rig_wait_morse, + .power2mW = k3_power2mW, .hamlib_check_rig_caps = HAMLIB_CHECK_RIG_CAPS }; @@ -791,7 +796,7 @@ const struct rig_caps kx2_caps = RIG_MODEL(RIG_MODEL_KX2), .model_name = "KX2", .mfg_name = "Elecraft", - .version = BACKEND_VER ".16", + .version = BACKEND_VER ".17", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -840,8 +845,8 @@ const struct rig_caps kx2_caps = RIG_FRNG_END, }, /* rx range */ .tx_range_list1 = { - FRQ_RNG_HF(1, K3_MODES, mW(10), W(10), K3_VFO, K3_ANTS), - FRQ_RNG_6m(1, K3_MODES, mW(10), W(10), K3_VFO, K3_ANTS), + FRQ_RNG_HF(1, K3_MODES, mW(10), W(12), K3_VFO, K3_ANTS), + FRQ_RNG_6m(1, K3_MODES, mW(10), W(12), K3_VFO, K3_ANTS), RIG_FRNG_END, }, /* tx range */ @@ -851,8 +856,8 @@ const struct rig_caps kx2_caps = RIG_FRNG_END, }, /* rx range */ .tx_range_list2 = { - FRQ_RNG_HF(2, K3_MODES, mW(10), W(10), K3_VFO, K3_ANTS), - FRQ_RNG_6m(2, K3_MODES, mW(10), W(10), K3_VFO, K3_ANTS), + FRQ_RNG_HF(2, K3_MODES, mW(10), W(12), K3_VFO, K3_ANTS), + FRQ_RNG_6m(2, K3_MODES, mW(10), W(12), K3_VFO, K3_ANTS), RIG_FRNG_END, }, /* tx range */ .tuning_steps = { @@ -933,6 +938,7 @@ const struct rig_caps kx2_caps = .get_ant = kenwood_get_ant, .send_morse = kenwood_send_morse, .wait_morse = rig_wait_morse, + .power2mW = k3_power2mW, .hamlib_check_rig_caps = HAMLIB_CHECK_RIG_CAPS }; @@ -1768,17 +1774,20 @@ int k3_get_split_mode(RIG *rig, vfo_t vfo, rmode_t *tx_mode, static int k3_get_maxpower(RIG *rig) { - int retval; - int maxpower = 12; // K3 default power level - char levelbuf[KENWOOD_MAX_BUF_LEN]; + //int retval; + int maxpower = 15; // K3 default power level + //char levelbuf[KENWOOD_MAX_BUF_LEN]; struct kenwood_priv_data *priv = rig->state.priv; - // default range is 0-12 if there is no KPA3 installed + // default range is 0-15 if there is no KPA3 installed if (priv->has_kpa3 || priv->has_kpa100) { maxpower = 110; } +// Elecraft makes max power pretty variable +// So we will stick with 15W or 110W and scale everything to that +#if 0 else if (RIG_IS_KX2 || RIG_IS_KX3) { @@ -1816,11 +1825,22 @@ static int k3_get_maxpower(RIG *rig) break; } } +#endif rig_debug(RIG_DEBUG_TRACE, "%s: maxpower=%d\n", __func__, maxpower); return maxpower; } +int k3_power2mW(RIG *rig, + unsigned int *mwpower, + float power, + freq_t freq, + rmode_t mode) +{ + *mwpower = power * k3_get_maxpower(rig) * 1000; + return RIG_OK; +} + int k3_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) { char levelbuf[16]; @@ -2220,13 +2240,7 @@ int k3_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) if (len == 5 || len == 6) { - sscanf(levelbuf + 2, "%d", &lvl); - - if (len == 6) - { - // K2 extended reply - lvl /= 10; - } + sscanf(levelbuf + 2, "%3d", &lvl); } else { diff --git a/simulators/simelecraft.c b/simulators/simelecraft.c index 1d34c05b..661095a9 100644 --- a/simulators/simelecraft.c +++ b/simulators/simelecraft.c @@ -278,6 +278,11 @@ int main(int argc, char *argv[]) SNPRINTF(buf, sizeof(buf), "TQ0;"); n = write(fd, buf, strlen(buf)); } + else if (strncmp(buf, "PC;", 3) == 0) + { + SNPRINTF(buf, sizeof(buf), "PC005;"); + n = write(fd, buf, strlen(buf)); + } else if (strlen(buf) > 0) { fprintf(stderr, "Unknown command: %s\n", buf); commit 22df154486fa59489d9bc51ff220ab70e2961c66 Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Jan 6 22:22:25 2023 -0600 Remove EX039 check from FTDX3000/3000DM https://github.com/Hamlib/Hamlib/issues/1206 diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index bf219832..2d611638 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -611,9 +611,9 @@ int newcat_open(RIG *rig) else if (priv->rig_id == NC_RIGID_FT991A || rig->caps->rig_model == RIG_MODEL_FT991) { cmd = "EX0321;EX032;"; } else if (priv->rig_id == NC_RIGID_FTDX3000 - || rig->caps->rig_model == RIG_MODEL_FTDX3000) { cmd = "EX0391;EX039;"; } + || rig->caps->rig_model == RIG_MODEL_FTDX3000) { cmd = "EX0391;"; } else if (priv->rig_id == NC_RIGID_FTDX3000DM - || rig->caps->rig_model == RIG_MODEL_FTDX3000) { cmd = "EX0391;EX039;"; } + || rig->caps->rig_model == RIG_MODEL_FTDX3000) { cmd = "EX0391;"; } else if (priv->rig_id == NC_RIGID_FTDX5000 || rig->caps->rig_model == RIG_MODEL_FTDX5000) { cmd = "EX0331;EX033"; } diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h index 914c535f..7e196a9d 100644 --- a/rigs/yaesu/newcat.h +++ b/rigs/yaesu/newcat.h @@ -50,7 +50,7 @@ typedef char ncboolean; /* shared function version */ -#define NEWCAT_VER "20221228" +#define NEWCAT_VER "20230106" /* Hopefully large enough for future use, 128 chars plus '\0' */ #define NEWCAT_DATA_LEN 129 commit 79255fa27cba9ea1884e29df700466ef5f946566 Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Jan 6 16:41:45 2023 -0600 Remove unnecessary check from netrigctl.c https://github.com/Hamlib/Hamlib/issues/1155 diff --git a/rigs/dummy/netrigctl.c b/rigs/dummy/netrigctl.c index 6ad737fc..03976838 100644 --- a/rigs/dummy/netrigctl.c +++ b/rigs/dummy/netrigctl.c @@ -824,7 +824,6 @@ static int netrigctl_open(RIG *rig) if (n == 2) { - if (agc_code == RIG_AGC_OFF) { p = strtok(NULL, " "); continue; } ; rig->caps->agc_levels[i++] = agc_code; rig->caps->agc_level_count++; rig_debug(RIG_DEBUG_VERBOSE, "%s: rig has agc code=%d, level=%s\n", __func__, commit 4a487ffdcceb2789930fd1e941810a9f5cd4aaf8 Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Jan 6 16:21:58 2023 -0600 Fix rigctld agc level readings -- allow for rig backedn to specify "RIG_AGC_NONE" now for clarity if desired https://github.com/Hamlib/Hamlib/issues/1155 diff --git a/NEWS b/NEWS index 0924a332..ac1b0756 100644 --- a/NEWS +++ b/NEWS @@ -26,6 +26,7 @@ Version 4.6 Version 4.5.4 * 2023-XX-XX + * Fix AGC levels with rigctld * Fix rig_power2mW so it checks all ranges * Allow rigctld to start with autopower_on=0 to avoid startup timeouts when rig is powered off * Fix dummy device to work with grig by disallowing empty "u" call diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h index a55ef92f..438040ef 100644 --- a/include/hamlib/rig.h +++ b/include/hamlib/rig.h @@ -332,7 +332,7 @@ typedef enum { */ /* TODO: kill me, and replace by real AGC delay */ enum agc_level_e { - RIG_AGC_OFF = 0, + RIG_AGC_OFF = 0, RIG_AGC_SUPERFAST, RIG_AGC_FAST, RIG_AGC_SLOW, @@ -340,7 +340,8 @@ enum agc_level_e { RIG_AGC_MEDIUM, RIG_AGC_AUTO, RIG_AGC_LONG, - RIG_AGC_ON /*< Turns AGC ON -- Kenwood -- restores last level set */ + RIG_AGC_ON, /*< Turns AGC ON -- Kenwood -- restores last level set */ + RIG_AGC_NONE /*< Rig does not have CAT AGC control */ }; diff --git a/rigs/dummy/netrigctl.c b/rigs/dummy/netrigctl.c index 393b1ea9..6ad737fc 100644 --- a/rigs/dummy/netrigctl.c +++ b/rigs/dummy/netrigctl.c @@ -811,9 +811,10 @@ static int netrigctl_open(RIG *rig) } else if (strcmp(setting, "agc_levels") == 0) { - int i = 1; + int i = 0; char *p = strtok(value, " "); - rig->caps->agc_levels[0] = RIG_AGC_OFF; + rig->caps->agc_levels[0] = RIG_AGC_NONE; // default value gets overwritten + rig->caps->agc_level_count = 1; while (p) { @@ -823,7 +824,9 @@ static int netrigctl_open(RIG *rig) if (n == 2) { + if (agc_code == RIG_AGC_OFF) { p = strtok(NULL, " "); continue; } ; rig->caps->agc_levels[i++] = agc_code; + rig->caps->agc_level_count++; rig_debug(RIG_DEBUG_VERBOSE, "%s: rig has agc code=%d, level=%s\n", __func__, agc_code, agc_string); } @@ -835,8 +838,6 @@ static int netrigctl_open(RIG *rig) rig_debug(RIG_DEBUG_VERBOSE, "%d=%s\n", agc_code, agc_string); p = strtok(NULL, " "); } - - rig->caps->agc_level_count = i; } else { @@ -2735,7 +2736,7 @@ struct rig_caps netrigctl_caps = RIG_MODEL(RIG_MODEL_NETRIGCTL), .model_name = "NET rigctl", .mfg_name = "Hamlib", - .version = "20230104.0", + .version = "20230106.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_OTHER, diff --git a/simulators/simft991.c b/simulators/simft991.c index 83ebc2e7..965deb4f 100644 --- a/simulators/simft991.c +++ b/simulators/simft991.c @@ -12,6 +12,10 @@ float freqA = 14074000; float freqB = 14074500; +char tx_vfo = '0'; +char rx_vfo = '0'; +char modeA = '0'; +char modeB = '0'; // ID 0310 == 310, Must drop leading zero typedef enum nc_rigid_e @@ -104,7 +108,7 @@ int main(int argc, char *argv[]) { printf("Cmd:%s\n", buf); } - else { return 0; } + else { continue; } if (strcmp(buf, "RM5;") == 0) { @@ -137,6 +141,24 @@ int main(int argc, char *argv[]) if (n <= 0) { perror("IF"); } } + else if (strcmp(buf, "FA;") == 0) + { + SNPRINTF(buf, sizeof(buf), "FA%08.0f;", freqA); + n = write(fd, buf, strlen(buf)); + } + else if (strncmp(buf, "FA", 2) == 0) + { + sscanf(buf, "FA%f", &freqA); + } + else if (strcmp(buf, "FB;") == 0) + { + SNPRINTF(buf, sizeof(buf), "FB%08.0f;", freqB); + n = write(fd, buf, strlen(buf)); + } + else if (strncmp(buf, "FB", 2) == 0) + { + sscanf(buf, "FB%f", &freqB); + } else if (strcmp(buf, "ID;") == 0) { printf("%s\n", buf); @@ -148,6 +170,11 @@ int main(int argc, char *argv[]) if (n <= 0) { perror("ID"); } } + else if (strcmp(buf, "PS;") == 0) + { + SNPRINTF(buf, sizeof(buf), "PS1;"); + n = write(fd, buf, strlen(buf)); + } else if (strcmp(buf, "AI;") == 0) { printf("%s\n", buf); @@ -158,6 +185,54 @@ int main(int argc, char *argv[]) if (n <= 0) { perror("ID"); } } + else if (strcmp(buf, "AI0;") == 0) + { + usleep(50 * 1000); + } + else if (strcmp(buf, "FT;") == 0) + { + usleep(50 * 1000); + SNPRINTF(buf, sizeof(buf), "FT%c;", tx_vfo); + printf(" FT response#1=%s, tx_vfo=%c\n", buf, tx_vfo); + n = write(fd, buf, strlen(buf)); + printf(" FT response#2=%s\n", buf); + + if (n < 0) { perror("FT"); } + } + else if (strncmp(buf, "FT", 2) == 0) + { + tx_vfo = buf[2]; + + if (tx_vfo == '3') { tx_vfo = '1'; } + else if (tx_vfo == '2') { tx_vfo = '0'; } + else { perror("Expected 2 or 3"); } + } + else if (strcmp(buf, "MD0;") == 0) + { + usleep(50 * 1000); + SNPRINTF(buf, sizeof(buf), "MD0%c;", modeA); + n = write(fd, buf, strlen(buf)); + + if (n < 0) { perror("MD0;"); } + } + else if (strncmp(buf, "MD0", 3) == 0) + { + modeA = buf[3]; + } + else if (strcmp(buf, "MD1;") == 0) + { + usleep(50 * 1000); + SNPRINTF(buf, sizeof(buf), "MD1%c;", modeB); + n = write(fd, buf, strlen(buf)); + + if (n < 0) { perror("MD0;"); } + } + else if (strncmp(buf, "MD1", 3) == 0) + { + modeB = buf[3]; + } + + #if 0 else if (strncmp(buf, "AI", 2) == 0) diff --git a/src/misc.c b/src/misc.c index bab1b104..a82a2360 100644 --- a/src/misc.c +++ b/src/misc.c @@ -1282,6 +1282,7 @@ static const struct { RIG_AGC_AUTO, "AUTO" }, { RIG_AGC_LONG, "LONG" }, { RIG_AGC_ON, "ON" }, + { RIG_AGC_NONE, "NONE" }, { -1, "" }, }; diff --git a/tests/dumpcaps.c b/tests/dumpcaps.c index 19811bde..0100c113 100644 --- a/tests/dumpcaps.c +++ b/tests/dumpcaps.c @@ -296,7 +296,6 @@ int dumpcaps(RIG *rig, FILE *fout) fprintf(fout, "\n"); -#if 0 fprintf(fout, "AGC levels:"); const struct icom_priv_caps *priv_caps = (const struct icom_priv_caps *) rig->caps->priv; @@ -313,6 +312,7 @@ int dumpcaps(RIG *rig, FILE *fout) } else { + for (i = 0; i < HAMLIB_MAX_AGC_LEVELS && i < caps->agc_level_count; i++) { fprintf(fout, " %d=%s", caps->agc_levels[i], @@ -320,16 +320,13 @@ int dumpcaps(RIG *rig, FILE *fout) } } -#else - //fprintf(fout, "\n"); - fprintf(fout, "AGC levels: "); - char buf[1024]; - rig_sprintf_agc_levels(rig, buf, (int)sizeof(buf)); - fprintf(fout, "%s", buf); -#endif + fprintf(fout, "\n"); if (i == 0) { + rig_debug(RIG_DEBUG_WARN, + "%s: defaulting to all levels since rig does not have any\n", __func__); + // Fall back to printing out all levels for backwards-compatibility for (i = RIG_AGC_OFF; i <= RIG_AGC_LAST; i++) { commit db218e9e73e6763dafb7a7137656c4faf11ef360 Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Jan 6 10:30:32 2023 -0600 Update man pages to clarify upper/lower case for set/get commands diff --git a/doc/man1/rigctl.1 b/doc/man1/rigctl.1 index d68fae78..3d95cc5e 100644 --- a/doc/man1/rigctl.1 +++ b/doc/man1/rigctl.1 @@ -373,12 +373,12 @@ Since most of the .B Hamlib operations have a .BR set " and a " get -method, an upper case letter will often be used for a +method, a single upper case letter will often be used for a .B set -method whereas the corresponding lower case letter refers to the +method whereas the corresponding single lower case letter refers to the .B get method. Each operation also has a long name; in interactive mode, prepend a -backslash, \(oq\\\(cq, to enter a long command name. +backslash, \(oq\\\(cq, to enter a long command name all lower case. . .PP Example: Use \(lq\\dump_caps\(rq to see what capabilities this radio and diff --git a/doc/man1/rigctld.1 b/doc/man1/rigctld.1 index 0e82f40d..6b55bf59 100644 --- a/doc/man1/rigctld.1 +++ b/doc/man1/rigctld.1 @@ -436,12 +436,12 @@ Since most of the .B Hamlib operations have a .BR set " and a " get -method, an upper case letter will be used for +method, a single pper case letter will be used for .B set -methods whereas the corresponding lower case letter refers to the +methods whereas the corresponding single lower case letter refers to the .B get method. Each operation also has a long name; prepend a backslash, \(oq\\\(cq, -to send a long command name. +to send a long command name all in lower case. . .PP Example (Perl): \(lqprint $socket "\\\\dump_caps\\n";\(rq to see what the commit 86771a95575116f31f498a8912d36e114f1109bc Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Jan 6 07:56:11 2023 -0600 Update simelecraft.c diff --git a/simulators/simelecraft.c b/simulators/simelecraft.c index 0be6800e..1d34c05b 100644 --- a/simulators/simelecraft.c +++ b/simulators/simelecraft.c @@ -105,7 +105,7 @@ int main(int argc, char *argv[]) buf[0] = 0; if (getmyline(fd, buf) > 0) { printf("Cmd:%s\n", buf); } - else { return 0; } + else {continue; } if (strcmp(buf, "RM5;") == 0) { @@ -149,6 +149,22 @@ int main(int argc, char *argv[]) if (n <= 0) { perror("ID"); } } + else if (strcmp(buf, "PS;") == 0) + { + SNPRINTF(buf, sizeof(buf), "PS1;"); + n = write(fd, buf, strlen(buf)); + } + else if (strcmp(buf, "BW;") == 0) + { + SNPRINTF(buf, sizeof(buf), "BW0190;"); + n = write(fd, buf, strlen(buf)); + } + else if (strcmp(buf, "BN;") == 0) + { + SNPRINTF(buf, sizeof(buf), "BN03;"); + n = write(fd, buf, strlen(buf)); + } + #if 0 else if (strncmp(buf, "AI", 2) == 0) @@ -199,29 +215,29 @@ int main(int argc, char *argv[]) } else if (strcmp(buf, "K2;") == 0) { - write(fd, "K20;", 4); + n = write(fd, "K20;", 4); } else if (strcmp(buf, "K3;") == 0) { - write(fd, "K30;", 4); + n = write(fd, "K30;", 4); } else if (strcmp(buf, "RVM;") == 0) { - write(fd, "RV02.37;", 8); + n = write(fd, "RV02.37;", 8); } else if (strcmp(buf, "AI;") == 0) { - write(fd, "AI0;", 4); + n = write(fd, "AI0;", 4); } else if (strcmp(buf, "MD;") == 0) { SNPRINTF(buf, sizeof(buf), "MD%d;", modea); - write(fd, buf, strlen(buf)); + n = write(fd, buf, strlen(buf)); } else if (strcmp(buf, "MD$;") == 0) { SNPRINTF(buf, sizeof(buf), "MD$%d;", modeb); - write(fd, buf, strlen(buf)); + n = write(fd, buf, strlen(buf)); } else if (strncmp(buf, "MD", 2) == 0) { @@ -231,12 +247,12 @@ int main(int argc, char *argv[]) else if (strcmp(buf, "FA;") == 0) { SNPRINTF(buf, sizeof(buf), "FA%011d;", freqa); - write(fd, buf, strlen(buf)); + n = write(fd, buf, strlen(buf)); } else if (strcmp(buf, "FB;") == 0) { SNPRINTF(buf, sizeof(buf), "FB%011d;", freqb); - write(fd, buf, strlen(buf)); + n = write(fd, buf, strlen(buf)); } else if (strncmp(buf, "FA", 2) == 0) @@ -250,17 +266,17 @@ int main(int argc, char *argv[]) else if (strncmp(buf, "FR;", 3) == 0) { SNPRINTF(buf, sizeof(buf), "FR0;"); - write(fd, buf, strlen(buf)); + n = write(fd, buf, strlen(buf)); } else if (strncmp(buf, "FT;", 3) == 0) { SNPRINTF(buf, sizeof(buf), "FT0;"); - write(fd, buf, strlen(buf)); + n = write(fd, buf, strlen(buf)); } else if (strncmp(buf, "TQ;", 3) == 0) { SNPRINTF(buf, sizeof(buf), "TQ0;"); - write(fd, buf, strlen(buf)); + n = write(fd, buf, strlen(buf)); } else if (strlen(buf) > 0) { commit e6c5c15452bad475ddf69c0ae74cd63e6bc347b3 Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Jan 5 23:32:41 2023 -0600 Update NEWS diff --git a/NEWS b/NEWS index ae716d06..0924a332 100644 --- a/NEWS +++ b/NEWS @@ -26,6 +26,7 @@ Version 4.6 Version 4.5.4 * 2023-XX-XX + * Fix rig_power2mW so it checks all ranges * Allow rigctld to start with autopower_on=0 to avoid startup timeouts when rig is powered off * Fix dummy device to work with grig by disallowing empty "u" call * Fix ID5100 and promote to stable and hopefully ID4100 too commit bbd0f856ca3f26b5d6367c4ca3d8519e58458e08 Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Jan 5 23:31:15 2023 -0600 Fix rig_getpower2mW so it checks all range lists https://github.com/Hamlib/Hamlib/issues/1205 diff --git a/src/rig.c b/src/rig.c index 7422fd27..eaac46ec 100644 --- a/src/rig.c +++ b/src/rig.c @@ -5851,11 +5851,23 @@ int HAMLIB_API rig_power2mW(RIG *rig, txrange = rig_get_range(rig->state.tx_range_list, freq, mode); - if (!txrange) + // check all the range lists + if (txrange == NULL) { rig_get_range(rig->caps->tx_range_list1, freq, mode); } + + if (txrange == NULL) { rig_get_range(rig->caps->tx_range_list2, freq, mode); } + + if (txrange == NULL) { rig_get_range(rig->caps->tx_range_list3, freq, mode); } + + if (txrange == NULL) { rig_get_range(rig->caps->tx_range_list4, freq, mode); } + + if (txrange == NULL) { rig_get_range(rig->caps->tx_range_list5, freq, mode); } + + if (txrange == NULL) { /* * freq is not on the tx range! */ + rig_debug(RIG_DEBUG_ERR, "%s: freq not in tx range\n", __func__); RETURNFUNC(-RIG_EINVAL); } @@ -6847,7 +6859,7 @@ const freq_range_t *HAMLIB_API rig_get_range(const freq_range_t *range_list, { int i; - if (!range_list) + if (range_list == NULL) { return (NULL); } commit 31d2939acc21fe58b5f203fa5a1c1e6bebb947c4 Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Jan 5 10:02:46 2023 -0600 Fix auto_power_on check in rigctld.c diff --git a/tests/rigctld.c b/tests/rigctld.c index e52f57f1..f61c9ff0 100644 --- a/tests/rigctld.c +++ b/tests/rigctld.c @@ -510,7 +510,7 @@ int main(int argc, char *argv[]) exit(1); } - if (strcmp(optarg, "autopower_on=0") == 0) + if (strcmp(optarg, "auto_power_on=0") == 0) { rig_debug(RIG_DEBUG_ERR, "%s: skipping rig_open\n", __func__); skip_open = 1; commit 589736e8f7e8e8def8f136436a8b9af72c32d31b Author: Mike Black W9MDB <mdb...@ya...> Date: Wed Jan 4 17:33:55 2023 -0600 Add simid5100.c diff --git a/simulators/simid5100.c b/simulators/simid5100.c new file mode 100644 index 00000000..3db0a01f --- /dev/null +++ b/simulators/simid5100.c @@ -0,0 +1,476 @@ +// simicom will show the pts port to use for rigctl on Unix +// using virtual serial ports on Windows is to be developed yet +// Needs a lot of improvement to work on all Icoms +// gcc -g -Wall -o simicom simicom.c -lhamlib +// On mingw in the hamlib src directory +// gcc -static -I../include -g -Wall -o simicom simicom.c -L../../build/src/.libs -lhamlib -lwsock32 -lws2_32 +#define _XOPEN_SOURCE 600 +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> +#include <fcntl.h> +#include <sys/time.h> +#include <hamlib/rig.h> +#include "../src/misc.h" +#include <termios.h> +#include <unistd.h> + + +#define BUFSIZE 256 + +int civ_731_mode = 0; +vfo_t current_vfo = RIG_VFO_A; +int split = 0; + +// we make B different from A to ensure we see a difference at startup +float freqA = 145000000; +float freqB = 14074500; +mode_t modeA = RIG_MODE_PKTUSB; +mode_t modeB = RIG_MODE_PKTUSB; +int datamodeA = 0; +int datamodeB = 0; +int filterA = 0; +ant_t ant_curr = 0; +int ant_option = 0; +int ptt = 0; +int satmode = 0; +int agc_time = 1; +int ovf_status = 0; +int powerstat = 1; + +void dumphex(unsigned char *buf, int n) +{ + for (int i = 0; i < n; ++i) { printf("%02x ", buf[i]); } + + printf("\n"); +} + +int +frameGet(int fd, unsigned char *buf) +{ + int i = 0; + memset(buf, 0, BUFSIZE); + unsigned char c; + +again: + + while (read(fd, &c, 1) > 0) + { + buf[i++] = c; + //printf("i=%d, c=0x%02x\n",i,c); + + if (c == 0xfd) + { + 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"); + + return 0; +} + +void frameParse(int fd, unsigned char *frame, int len) +{ + double freq; + int n = 0; + + dumphex(frame, len); + + if (frame[0] != 0xfe && frame[1] != 0xfe) + { + printf("expected fe fe, got "); + dumphex(frame, len); + return; + } + + switch (frame[4]) + { + case 0x00: + freq = from_bcd(&frame[5], 5 * 2); + freqA = freq; + printf("freq=%lf\n", freqA); + break; + case 0x03: + + //from_bcd(frameackbuf[2], (civ_731_mode ? 4 : 5) * 2); + if (current_vfo == RIG_VFO_A || current_vfo == RIG_VFO_MAIN) + { + printf("get_freqA\n"); + to_bcd(&frame[5], (long long)freqA/10000, 3 * 2); + dump_hex(frame,11); + } + else + { + printf("get_freqB\n"); + to_bcd(&frame[5], (long long)freqB/10000, 3 * 2); + } + + frame[8] = 0xfd; + dump_hex(frame,9); + + n = write(fd, frame, 9); + + break; + + case 0x04: + if (current_vfo == RIG_VFO_A || current_vfo == RIG_VFO_MAIN) + { + printf("get_modeA\n"); + frame[5] = modeA; + frame[6] = filterA; + } + else + { + printf("get_modeB\n"); + frame[5] = modeB; + frame[6] = filterA; + } + + frame[7] = 0xfd; + n = write(fd, frame, 8); + break; + + case 0x05: + freq = from_bcd(&frame[5], (civ_731_mode ? 4 : 5) * 2); + printf("set_freq to %.0f\n", freq); + + if (current_vfo == RIG_VFO_A || current_vfo == RIG_VFO_MAIN) { freqA = freq; } + else { freqB = freq; } + + frame[4] = 0xfb; + frame[5] = 0xfd; + n = write(fd, frame, 6); + break; + + case 0x06: + if (current_vfo == RIG_VFO_A || current_vfo == RIG_VFO_MAIN) { modeA = frame[6]; } + else { modeB = frame[6]; } + + frame[4] = 0xfb; + frame[5] = 0xfd; + n = write(fd, frame, 6); + break; + + case 0x07: + + switch (frame[5]) + { + case 0x00: current_vfo = RIG_VFO_A; break; + + case 0x01: current_vfo = RIG_VFO_B; break; + + case 0xd0: current_vfo = RIG_VFO_MAIN; break; + + case 0xd1: current_vfo = RIG_VFO_SUB; break; + } + + printf("set_vfo to %s\n", rig_strvfo(current_vfo)); + + frame[4] = 0xfb; + frame[5] = 0xfd; + n = write(fd, frame, 6); + break; + + case 0x0f: + if (frame[5] == 0) { split = 0; } + else if (frame[5] == 1) { split = 1; } + else { frame[6] = split; } + + if (frame[5] == 0xfd) + { + printf("get split %d\n", 1); + frame[7] = 0xfd; + n = write(fd, frame, 8); + } + else + { + printf("set split %d\n", 1); + frame[4] = 0xfb; + frame[5] = 0xfd; + n = write(fd, frame, 6); + } + + break; + + case 0x12: // we're simulating the 3-byte version -- not the 2-... [truncated message content] |
From: n0nb <n0...@us...> - 2023-01-03 01:57:55
|
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 9f0bd7b310e7d21c857052cb6249d6210caabd61 (commit) via 0b2f0873b036b339f5f65412cc17a464cc2ef3ba (commit) via c7b33ef0b3296a88ca387db1ac3634e19075dab1 (commit) via f68d45d99b5b08ac64d19a20d8aedfc27270de3e (commit) via fa7289995c29719739edd13d3e945248adc0905a (commit) via 582686505cbbc43f2013b7b8355d1f877671ef7e (commit) via 712564a2ae97343c5ed7001f90e79716939ed1d0 (commit) via 2fc1d157baa1454307665d759ee41b9cc9e1b8da (commit) via b1fcdea72d35a3648bacf202f8614d8ac33bc197 (commit) via 1ee37d0a563de967ec0855bcd7f96bfb394e4866 (commit) via c1662ce8865c7ff585f5085a1f8ecd6c3ac8b042 (commit) via 1bb1f545ebe7cf4f1aec069598e1f2545484f0ca (commit) via 64c566cd14b743c91563c986cd70c0a3be431b9d (commit) via b6654c78cba91a2818c9380710f1af91bde8f5ab (commit) via f67a53c41c0067d495e4a30c131df94301e43d47 (commit) via 04ccccb02d2819899a2981dea219318908529d4d (commit) via 7e81e8552a6fdc121e3427e4afb97bfa31f8619a (commit) via 1fd44dcef2c17db8923f1b41c84619ddf882d8fb (commit) via 2306ee4f1dd73f942f07c34d870a891e43377d46 (commit) via 606aea1552e173a793b206cb9ec2733ff59dc322 (commit) via cfc2e28c1968638bf20802ffa188f02cb4faeb94 (commit) via a75b274f6f4dd4ef5690581d0ecce653fbd29b1a (commit) via ab511cbea65c6764410ed5a623106175675d14d3 (commit) via 0450b36c67e59403983d1170058b8fe67c949d8e (commit) via bc6c14e43048179a99805bc434e139b5e253327e (commit) via c59b5383e9371c8d638f9f8d727f1ca612ad229e (commit) via 97ef9e5beae4e30ecfa26a09f2d1bfcbb61e2184 (commit) via 5db44be3ba1bbca5da66ed23b4bd6fdad3d7d054 (commit) via e70465a9c04c16c34a4ddc0e2b811ec12f9ece4b (commit) from b61550bf6b53c0cef885ed1443967a6c9aa2fb78 (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 9f0bd7b310e7d21c857052cb6249d6210caabd61 Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Jan 2 11:38:27 2023 -0600 Add rigctltcp.c -- not working yet diff --git a/tests/rigctltcp.c b/tests/rigctltcp.c new file mode 100644 index 00000000..81080ef3 --- /dev/null +++ b/tests/rigctltcp.c @@ -0,0 +1,1563 @@ +/* + * rigctltcp.c - (C) Stephane Fillod 2000-2011 + * (C) Nate Bargmann 2008,2010,2011,2012,2013 + * (C) The Hamlib Group 2012-2022 + * + * This program test/control a radio using Hamlib. + * It takes commands from a tcp network connection. + * + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + */ + +#include <hamlib/config.h> + +#ifdef WIN32 +#define WIN32_LEAN_AND_MEAN +#include <windows.h> +#endif + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> +#include <ctype.h> +#include <errno.h> +#include <signal.h> + +#include <getopt.h> + +#include <sys/types.h> /* See NOTES */ + +#ifdef HAVE_NETINET_IN_H +# include <netinet/in.h> +#endif + +#ifdef HAVE_ARPA_INET_H +# include <arpa/inet.h> +#endif + +#ifdef HAVE_SYS_SOCKET_H +# include <sys/socket.h> +#elif HAVE_WS2TCPIP_H +# include <ws2tcpip.h> +# include <fcntl.h> +# if defined(HAVE_WSPIAPI_H) +# include <wspiapi.h> +# endif +#endif + +#ifdef HAVE_NETDB_H +# include <netdb.h> +#endif + +#ifdef HAVE_PTHREAD +# include <pthread.h> +#endif + +#include <hamlib/rig.h> +#include "misc.h" +#include "iofunc.h" +#include "serial.h" +#include "sprintflst.h" +#include "network.h" + +#include "rigctl_parse.h" + + +/* + * Reminder: when adding long options, + * keep up to date SHORT_OPTIONS, usage()'s output and man page. thanks. + * TODO: add an option to read from a file + */ +#define SHORT_OPTIONS "m:r:p:d:P:D:s:S:c:T:t:C:W:w:x:z:lLuovhVZMRA:n:" +static struct option long_options[] = +{ + {"model", 1, 0, 'm'}, + {"rig-file", 1, 0, 'r'}, + {"ptt-file", 1, 0, 'p'}, + {"dcd-file", 1, 0, 'd'}, + {"ptt-type", 1, 0, 'P'}, + {"dcd-type", 1, 0, 'D'}, + {"serial-speed", 1, 0, 's'}, + {"separator", 1, 0, 'S'}, + {"civaddr", 1, 0, 'c'}, + {"listen-addr", 1, 0, 'T'}, + {"port", 1, 0, 't'}, + {"set-conf", 1, 0, 'C'}, + {"list", 0, 0, 'l'}, + {"show-conf", 0, 0, 'L'}, + {"dump-caps", 0, 0, 'u'}, + {"vfo", 0, 0, 'o'}, + {"verbose", 0, 0, 'v'}, + {"help", 0, 0, 'h'}, + {"version", 0, 0, 'V'}, + {"twiddle_timeout", 1, 0, 'W'}, + {"twiddle_rit", 1, 0, 'w'}, + {"uplink", 1, 0, 'x'}, + {"debug-time-stamps", 0, 0, 'Z'}, + {"multicast-addr", 1, 0, 'M'}, + {"multicast-port", 1, 0, 'n'}, + {"password", 1, 0, 'A'}, + {"rigctld-idle", 0, 0, 'R'}, + {0, 0, 0, 0} +}; + + +struct handle_data +{ + RIG *rig; + int sock; + struct sockaddr_storage cli_addr; + socklen_t clilen; + int vfo_mode; + int use_password; +}; + + +void *handle_socket(void *arg); +void usage(void); + + +#ifdef HAVE_PTHREAD +static unsigned client_count; +#endif + +static RIG *my_rig; /* handle to rig (instance) */ +static volatile int rig_opened = 0; +static int verbose; + +#ifdef HAVE_SIG_ATOMIC_T +static sig_atomic_t volatile ctrl_c; +#else +static int volatile ctrl_c; +#endif + +const char *portno = "4532"; +const char *src_addr = NULL; /* INADDR_ANY */ +const char *multicast_addr = "0.0.0.0"; +int multicast_port = 4532; +extern char rigctld_password[65]; +char resp_sep = '\n'; +extern int lock_mode; +extern powerstat_t rig_powerstat; +static int rigctld_idle = + 0; // if true then rig will close when no clients are connected + +#define MAXCONFLEN 1024 + + +void mutex_rigctld(int lock) +{ +#ifdef HAVE_PTHREAD + static pthread_mutex_t client_lock = PTHREAD_MUTEX_INITIALIZER; + + if (lock) + { + pthread_mutex_lock(&client_lock); + rig_debug(RIG_DEBUG_VERBOSE, "%s: client lock engaged\n", __func__); + } + else + { + rig_debug(RIG_DEBUG_VERBOSE, "%s: client lock disengaged\n", __func__); + pthread_mutex_unlock(&client_lock); + } + +#endif +} + +#ifdef WIN32 +static BOOL WINAPI CtrlHandler(DWORD fdwCtrlType) +{ + rig_debug(RIG_DEBUG_VERBOSE, "%s: called\n", __func__); + + switch (fdwCtrlType) + { + case CTRL_C_EVENT: + case CTRL_CLOSE_EVENT: + ctrl_c = 1; + return TRUE; + + default: + return FALSE; + } +} +#else +static void signal_handler(int sig) +{ + switch (sig) + { + case SIGINT: + ctrl_c = 1; + break; + + default: + /* do nothing */ + break; + } +} +#endif + +static void handle_error(enum rig_debug_level_e lvl, const char *msg) +{ + int e; +#ifdef __MINGW32__ + LPVOID lpMsgBuf; + + lpMsgBuf = (LPVOID)"Unknown error"; + e = WSAGetLastError(); + + if (FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER + | FORMAT_MESSAGE_FROM_SYSTEM + | FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, e, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), + // Default language + (LPTSTR)&lpMsgBuf, 0, NULL)) + { + + rig_debug(lvl, "%s: Network error %d: %s\n", msg, e, (char *)lpMsgBuf); + LocalFree(lpMsgBuf); + } + else + { + rig_debug(lvl, "%s: Network error %d\n", msg, e); + } + +#else + e = errno; + rig_debug(lvl, "%s: Network error %d: %s\n", msg, e, strerror(e)); +#endif +} + +int main(int argc, char *argv[]) +{ + rig_model_t my_model = RIG_MODEL_DUMMY; + + int retcode; /* generic return code from functions */ + + int show_conf = 0; + int dump_caps_opt = 0; + const char *rig_file = NULL, *ptt_file = NULL, *dcd_file = NULL; + ptt_type_t ptt_type = RIG_PTT_NONE; + dcd_type_t dcd_type = RIG_DCD_NONE; + int serial_rate = 0; + char *civaddr = NULL; /* NULL means no need to set conf */ + char conf_parms[MAXCONFLEN] = ""; + + struct addrinfo hints, *result, *saved_result; + int sock_listen; + int reuseaddr = 1; + int twiddle_timeout = 0; + int twiddle_rit = 0; + int uplink = 0; + char host[NI_MAXHOST]; + char serv[NI_MAXSERV]; + char rigstartup[1024]; + char vbuf[1024]; +#if HAVE_SIGACTION + struct sigaction act; +#endif + +#ifdef HAVE_PTHREAD + pthread_t thread; + pthread_attr_t attr; +#endif + struct handle_data *arg; + int vfo_mode = 0; /* vfo_mode=0 means target VFO is current VFO */ + int i; + extern int is_rigctld; + + is_rigctld = 1; + + int err = setvbuf(stderr, vbuf, _IOFBF, sizeof(vbuf)); + + if (err) { rig_debug(RIG_DEBUG_ERR, "%s: setvbuf err=%s\n", __func__, strerror(err)); } + + + while (1) + { + int c; + int option_index = 0; + char dummy[2]; + + c = getopt_long(argc, + argv, + SHORT_OPTIONS, + long_options, + &option_index); + + if (c == -1) + { + break; + } + + switch (c) + { + case 'h': + usage(); + exit(0); + + case 'V': + printf("rigctl %s\n", hamlib_version2); + exit(0); + + case 'R': + rigctld_idle = 1; + break; + + case 'A': + strncpy(rigctld_password, optarg, sizeof(rigctld_password) - 1); + //char *md5 = rig_make_m d5(rigctld_password); + char md5[HAMLIB_SECRET_LENGTH + 1]; + rig_password_generate_secret(rigctld_password, md5); + printf("Secret key: %s\n", md5); + rig_settings_save("sharedkey", md5, e_CHAR); + break; + + case 'm': + if (!optarg) + { + usage(); /* wrong arg count */ + exit(1); + } + + my_model = atoi(optarg); + break; + + case 'r': + if (!optarg) + { + usage(); /* wrong arg count */ + exit(1); + } + + rig_file = optarg; + break; + + case 'p': + if (!optarg) + { + usage(); /* wrong arg count */ + exit(1); + } + + ptt_file = optarg; + break; + + case 'd': + if (!optarg) + { + usage(); /* wrong arg count */ + exit(1); + } + + dcd_file = optarg; + break; + + case 'P': + if (!optarg) + { + usage(); /* wrong arg count */ + exit(1); + } + + if (!strcmp(optarg, "RIG")) + { + ptt_type = RIG_PTT_RIG; + } + else if (!strcmp(optarg, "DTR")) + { + ptt_type = RIG_PTT_SERIAL_DTR; + } + else if (!strcmp(optarg, "RTS")) + { + ptt_type = RIG_PTT_SERIAL_RTS; + } + else if (!strcmp(optarg, "PARALLEL")) + { + ptt_type = RIG_PTT_PARALLEL; + } + else if (!strcmp(optarg, "CM108")) + { + ptt_type = RIG_PTT_CM108; + } + else if (!strcmp(optarg, "GPIO")) + { + ptt_type = RIG_PTT_GPIO; + } + else if (!strcmp(optarg, "GPION")) + { + ptt_type = RIG_PTT_GPION; + } + else if (!strcmp(optarg, "NONE")) + { + ptt_type = RIG_PTT_NONE; + } + else + { + puts("Unrecognised PTT type, using NONE"); + ptt_type = RIG_PTT_NONE; + } + + break; + + case 'D': + if (!optarg) + { + usage(); /* wrong arg count */ + exit(1); + } + + if (!strcmp(optarg, "RIG")) + { + dcd_type = RIG_DCD_RIG; + } + else if (!strcmp(optarg, "DSR")) + { + dcd_type = RIG_DCD_SERIAL_DSR; + } + else if (!strcmp(optarg, "CTS")) + { + dcd_type = RIG_DCD_SERIAL_CTS; + } + else if (!strcmp(optarg, "CD")) + { + dcd_type = RIG_DCD_SERIAL_CAR; + } + else if (!strcmp(optarg, "PARALLEL")) + { + dcd_type = RIG_DCD_PARALLEL; + } + else if (!strcmp(optarg, "CM108")) + { + dcd_type = RIG_DCD_CM108; + } + else if (!strcmp(optarg, "GPIO")) + { + dcd_type = RIG_DCD_GPIO; + } + else if (!strcmp(optarg, "GPION")) + { + dcd_type = RIG_DCD_GPION; + } + else if (!strcmp(optarg, "NONE")) + { + dcd_type = RIG_DCD_NONE; + } + else + { + puts("Unrecognised DCD type, using NONE"); + dcd_type = RIG_DCD_NONE; + } + + break; + + case 'c': + if (!optarg) + { + usage(); /* wrong arg count */ + exit(1); + } + + civaddr = optarg; + break; + + case 'S': + if (!optarg) + { + usage(); /* wrong arg count */ + exit(1); + } + + resp_sep = *optarg; + rig_debug(RIG_DEBUG_VERBOSE, "%s: resp_sep=%c\n", __func__, resp_sep); + break; + + case 's': + if (!optarg) + { + usage(); /* wrong arg count */ + exit(1); + } + + if (sscanf(optarg, "%d%1s", &serial_rate, dummy) != 1) + { + fprintf(stderr, "Invalid baud rate of %s\n", optarg); + exit(1); + } + + break; + + case 'C': + if (!optarg) + { + usage(); /* wrong arg count */ + exit(1); + } + + if (*conf_parms != '\0') + { + strcat(conf_parms, ","); + } + + if (strlen(conf_parms) + strlen(optarg) > MAXCONFLEN - 24) + { + printf("Length of conf_parms exceeds internal maximum of %d\n", + MAXCONFLEN - 24); + return 1; + } + + strncat(conf_parms, optarg, MAXCONFLEN - strlen(conf_parms)); + break; + + case 't': + if (!optarg) + { + usage(); /* wrong arg count */ + exit(1); + } + + portno = optarg; + break; + + case 'T': + if (!optarg) + { + usage(); /* wrong arg count */ + exit(1); + } + + src_addr = optarg; + break; + + case 'o': + vfo_mode++; + //rig_debug(RIG_DEBUG_ERR, "%s: #0 vfo_mode=%d\n", __func__, vfo_mode); + break; + + case 'v': + verbose++; + break; + + case 'L': + show_conf++; + break; + + case 'l': + list_models(); + exit(0); + + case 'u': + dump_caps_opt++; + break; + + case 'W': + if (!optarg) + { + usage(); /* wrong arg count */ + exit(1); + } + + twiddle_timeout = atoi(optarg); + fprintf(stderr, + "twiddle_timeout is deprecated...use e.g. --set-conf=twiddle_timeout=5\n"); + break; + + case 'w': + if (!optarg) + { + usage(); /* wrong arg count */ + exit(1); + } + + twiddle_rit = atoi(optarg); + fprintf(stderr, + "twiddle_timeout is deprecated...use e.g. --set-conf=twiddle_timeout=5\n"); + break; + + + case 'x': + if (!optarg) + { + usage(); /* wrong arg count */ + exit(1); + } + + uplink = atoi(optarg); + break; + + + case 'Z': + rig_set_debug_time_stamp(1); + break; + + case 'M': + if (!optarg) + { + usage(); /* wrong arg count */ + exit(1); + } + + multicast_addr = optarg; + break; + + case 'n': + if (!optarg) + { + usage(); /* wrong arg count */ + exit(1); + } + + multicast_port = atoi(optarg); + + if (multicast_port == 0) + { + fprintf(stderr, "Invalid multicast port: %s\n", optarg); + exit(1); + } + + break; + + default: + usage(); /* unknown option? */ + exit(1); + } + } + +#if 0 + + if (!vfo_mode) + { + printf("Recommend using --vfo switch for rigctld if client supports it\n"); + printf("rigctl and netrigctl will automatically detect vfo mode\n"); + } + +#endif + + rig_set_debug(verbose); + + SNPRINTF(rigstartup, sizeof(rigstartup), "%s(%d) Startup:", __FILE__, __LINE__); + + for (i = 0; i < argc; ++i) { strcat(rigstartup, " "); strcat(rigstartup, argv[i]); } + + rig_debug(RIG_DEBUG_VERBOSE, "%s\n", rigstartup); + + rig_debug(RIG_DEBUG_VERBOSE, "rigctld %s\n", hamlib_version2); + rig_debug(RIG_DEBUG_VERBOSE, "%s", + "Report bugs to <ham...@li...>\n\n"); + rig_debug(RIG_DEBUG_VERBOSE, "Max# of rigctld client services=%d\n", + NI_MAXSERV); + + my_rig = rig_init(my_model); + + if (!my_rig) + { + fprintf(stderr, + "Unknown rig num %u, or initialization error.\n", + my_model); + + fprintf(stderr, "Please check with --list option.\n"); + exit(2); + } + + retcode = set_conf(my_rig, conf_parms); + + if (retcode != RIG_OK) + { + fprintf(stderr, "Config parameter error: %s\n", rigerror(retcode)); + exit(2); + } + + if (rig_file) + { + strncpy(my_rig->state.rigport.pathname, rig_file, HAMLIB_FILPATHLEN - 1); + } + + my_rig->state.twiddle_timeout = twiddle_timeout; + my_rig->state.twiddle_rit = twiddle_rit; + my_rig->state.uplink = uplink; + rig_debug(RIG_DEBUG_TRACE, "%s: twiddle=%d, uplink=%d, twiddle_rit=%d\n", + __func__, + my_rig->state.twiddle_timeout, my_rig->state.uplink, my_rig->state.twiddle_rit); + + /* + * ex: RIG_PTT_PARALLEL and /dev/parport0 + */ + if (ptt_type != RIG_PTT_NONE) + { + my_rig->state.pttport.type.ptt = ptt_type; + my_rig->state.pttport_deprecated.type.ptt = ptt_type; + // This causes segfault since backend rig_caps are const + // rigctld will use the rig->state version of this for clients + //my_rig->caps->ptt_type = ptt_type; + } + + if (dcd_type != RIG_DCD_NONE) + { + my_rig->state.dcdport.type.dcd = dcd_type; + my_rig->state.dcdport_deprecated.type.dcd = dcd_type; + } + + if (ptt_file) + { + strncpy(my_rig->state.pttport.pathname, ptt_file, HAMLIB_FILPATHLEN - 1); + strncpy(my_rig->state.pttport_deprecated.pathname, ptt_file, + HAMLIB_FILPATHLEN - 1); + } + + if (dcd_file) + { + strncpy(my_rig->state.dcdport.pathname, dcd_file, HAMLIB_FILPATHLEN - 1); + strncpy(my_rig->state.dcdport_deprecated.pathname, dcd_file, + HAMLIB_FILPATHLEN - 1); + } + + /* FIXME: bound checking and port type == serial */ + if (serial_rate != 0) + { + my_rig->state.rigport.parm.serial.rate = serial_rate; + my_rig->state.rigport_deprecated.parm.serial.rate = serial_rate; + } + + if (civaddr) + { + rig_set_conf(my_rig, rig_token_lookup(my_rig, "civaddr"), civaddr); + } + + /* + * print out conf parameters + */ + if (show_conf) + { + rig_token_foreach(my_rig, print_conf_list, (rig_ptr_t)my_rig); + } + + /* + * print out conf parameters, and exits immediately + * We may be interested only in only caps, and rig_open may fail. + */ + if (dump_caps_opt) + { + dumpcaps(my_rig, stdout); + rig_cleanup(my_rig); /* if you care about memory */ + exit(0); + } + + /* attempt to open rig to check early for issues */ + retcode = rig_open(my_rig); + rig_opened = retcode == RIG_OK ? 1 : 0; + + if (retcode != RIG_OK) + { + fprintf(stderr, "rig_open: error = %s %s %s \n", rigerror(retcode), rig_file, + strerror(errno)); + // continue even if opening the rig fails, because it may be powered off + } + + if (verbose > RIG_DEBUG_ERR) + { + printf("Opened rig model %u, '%s'\n", + my_rig->caps->rig_model, + my_rig->caps->model_name); + } + + rig_debug(RIG_DEBUG_VERBOSE, "Backend version: %s, Status: %s\n", + my_rig->caps->version, rig_strstatus(my_rig->caps->status)); + + // Normally we keep the rig open to speed up the 1st client connect + // But some rigs like the FT-736 have to lock the rig for CAT control + // So they need to release the rig when no clients are connected + if (rigctld_idle) + { + rig_close(my_rig); /* we will reopen for clients */ + + if (verbose > RIG_DEBUG_ERR) + { + printf("Closed rig model %d, '%s - will reopen for clients'\n", + my_rig->caps->rig_model, + my_rig->caps->model_name); + } + } + +#ifdef __MINGW32__ +# ifndef SO_OPENTYPE +# define SO_OPENTYPE 0x7008 +# endif +# ifndef SO_SYNCHRONOUS_NONALERT +# define SO_SYNCHRONOUS_NONALERT 0x20 +# endif +# ifndef INVALID_SOCKET +# define INVALID_SOCKET -1 +# endif + + WSADATA wsadata; + + if (WSAStartup(MAKEWORD(1, 1), &wsadata) == SOCKET_ERROR) + { + fprintf(stderr, "WSAStartup socket error\n"); + exit(1); + } + + { + int sockopt = SO_SYNCHRONOUS_NONALERT; + setsockopt(INVALID_SOCKET, SOL_SOCKET, SO_OPENTYPE, (char *)&sockopt, + sizeof(sockopt)); + } + +#endif + + /* + * Prepare listening socket + */ + memset(&hints, 0, sizeof(struct addrinfo)); + hints.ai_family = AF_UNSPEC; /* Allow IPv4 or IPv6 */ + hints.ai_socktype = SOCK_STREAM;/* TCP socket */ + hints.ai_flags = AI_PASSIVE; /* For wildcard IP address */ + hints.ai_protocol = 0; /* Any protocol */ + + retcode = getaddrinfo(src_addr, portno, &hints, &result); + + if (retcode == 0 && result->ai_family == AF_INET6) + { + rig_debug(RIG_DEBUG_TRACE, "%s: Using IPV6\n", __func__); + } + else if (retcode == 0) + { + rig_debug(RIG_DEBUG_TRACE, "%s: Using IPV4\n", __func__); + } + else + { + fprintf(stderr, "getaddrinfo: %s\n", gai_strerror(retcode)); + exit(2); + } + + saved_result = result; + + enum multicast_item_e items = RIG_MULTICAST_POLL | RIG_MULTICAST_TRANSCEIVE | + RIG_MULTICAST_SPECTRUM; + retcode = network_multicast_publisher_start(my_rig, multicast_addr, + multicast_port, items); + + if (retcode != RIG_OK) + { + rig_debug(RIG_DEBUG_ERR, "%s: network_multicast_server failed: %s\n", __FILE__, + rigerror(retcode)); + // we will consider this non-fatal for now + } + + do + { + sock_listen = socket(result->ai_family, + result->ai_socktype, + result->ai_protocol); + + if (sock_listen < 0) + { + handle_error(RIG_DEBUG_ERR, "socket"); + freeaddrinfo(saved_result); /* No longer needed */ + exit(2); + } + + if (setsockopt(sock_listen, + SOL_SOCKET, + SO_REUSEADDR, + (char *)&reuseaddr, + sizeof(reuseaddr)) + < 0) + { + + handle_error(RIG_DEBUG_ERR, "setsockopt"); + freeaddrinfo(saved_result); /* No longer needed */ + exit(1); + } + +#ifdef IPV6_V6ONLY + + if (AF_INET6 == result->ai_family) + { + /* allow IPv4 mapped to IPv6 clients Windows and BSD default + this to 1 (i.e. disallowed) and we prefer it off */ + int sockopt = 0; + + if (setsockopt(sock_listen, + IPPROTO_IPV6, + IPV6_V6ONLY, + (char *)&sockopt, + sizeof(sockopt)) + < 0) + { + + handle_error(RIG_DEBUG_ERR, "setsockopt"); + freeaddrinfo(saved_result); /* No longer needed */ + exit(1); + } + } + +#endif + + if (0 == bind(sock_listen, result->ai_addr, result->ai_addrlen)) + { + break; + } + + handle_error(RIG_DEBUG_WARN, "binding failed (trying next interface)"); +#ifdef __MINGW32__ + closesocket(sock_listen); +#else + close(sock_listen); +#endif + } + while ((result = result->ai_next) != NULL); + + freeaddrinfo(saved_result); /* No longer needed */ + + if (NULL == result) + { + rig_debug(RIG_DEBUG_ERR, "%s: bind error - no available interface\n", __func__); + exit(1); + } + + if (listen(sock_listen, 4) < 0) + { + handle_error(RIG_DEBUG_ERR, "listening"); + exit(1); + } + +#if HAVE_SIGACTION + +#ifdef SIGPIPE + /* Ignore SIGPIPE as we will handle it at the write()/send() calls + that will consequently fail with EPIPE. All child threads will + inherit this disposition which is what we want. */ + memset(&act, 0, sizeof act); + act.sa_handler = SIG_IGN; + act.sa_flags = SA_RESTART; + + if (sigaction(SIGPIPE, &act, NULL)) + { + handle_error(RIG_DEBUG_ERR, "sigaction SIGPIPE"); + } + +#endif + +#ifdef SIGINT + memset(&act, 0, sizeof act); + act.sa_handler = signal_handler; + + if (sigaction(SIGINT, &act, NULL)) + { + handle_error(RIG_DEBUG_ERR, "sigaction SIGINT"); + } + +#endif +#elif defined (WIN32) + + if (!SetConsoleCtrlHandler(CtrlHandler, TRUE)) + { + handle_error(RIG_DEBUG_ERR, "SetConsoleCtrlHandler"); + } + +#elif HAVE_SIGNAL +#ifdef SIGPIPE + + if (SIG_ERR == signal(SIGPIPE, SIG_IGN)) + { + handle_error(RIG_DEBUG_ERR, "signal SIGPIPE"); + } + +#endif +#ifdef SIGINT + + if (SIG_ERR == signal(SIGINT, signal_handler)) + { + handle_error(RIG_DEBUG_ERR, "signal SIGINT"); + } + +#endif +#endif + + /* + * main loop accepting connections + */ + rig_debug(RIG_DEBUG_TRACE, "%s: rigctltcp listening on port %s\n", __func__, + portno); + + do + { + fd_set set; + struct timeval timeout; + + arg = calloc(1, sizeof(struct handle_data)); + + if (!arg) + { + rig_debug(RIG_DEBUG_ERR, "calloc: %s\n", strerror(errno)); + exit(1); + } + + if (rigctld_password[0] != 0) { arg->use_password = 1; } + + /* use select to allow for periodic checks for CTRL+C */ + FD_ZERO(&set); + FD_SET(sock_listen, &set); + timeout.tv_sec = 5; + timeout.tv_usec = 0; + retcode = select(sock_listen + 1, &set, NULL, NULL, &timeout); + + if (retcode == -1) + { + int errno_stored = errno; + rig_debug(RIG_DEBUG_ERR, "%s: select() failed: %s\n", __func__, + strerror(errno_stored)); + + if (ctrl_c) + { + rig_debug(RIG_DEBUG_VERBOSE, "%s: ctrl_c when retcode==-1\n", __func__); + break; + } + + if (errno == EINTR) + { + rig_debug(RIG_DEBUG_VERBOSE, "%s: ignoring interrupted system call\n", + __func__); + retcode = 0; + } + } + else if (retcode == 0) + { + if (ctrl_c) + { + rig_debug(RIG_DEBUG_VERBOSE, "%s: ctrl_c when retcode==0\n", __func__); + break; + } + } + else + { + arg->rig = my_rig; + arg->clilen = sizeof(arg->cli_addr); + arg->vfo_mode = vfo_mode; + arg->sock = accept(sock_listen, + (struct sockaddr *)&arg->cli_addr, + &arg->clilen); + + if (arg->sock < 0) + { + handle_error(RIG_DEBUG_ERR, "accept"); + break; + } + + if ((retcode = getnameinfo((struct sockaddr const *)&arg->cli_addr, + arg->clilen, + host, + sizeof(host), + serv, + sizeof(serv), + NI_NUMERICHOST | NI_NUMERICSERV)) + < 0) + { + rig_debug(RIG_DEBUG_WARN, + "Peer lookup error: %s", + gai_strerror(retcode)); + } + + rig_debug(RIG_DEBUG_VERBOSE, + "Connection opened from %s:%s\n", + host, + serv); + +#ifdef HAVE_PTHREAD + pthread_attr_init(&attr); + pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); + + retcode = pthread_create(&thread, &attr, handle_socket, arg); + + if (retcode != 0) + { + rig_debug(RIG_DEBUG_ERR, "pthread_create: %s\n", strerror(retcode)); + break; + } + +#else + handle_socket(arg); +#endif + } + } + while (retcode == 0 && !ctrl_c); + + rig_debug(RIG_DEBUG_VERBOSE, "%s: while loop done\n", __func__); + +#ifdef HAVE_PTHREAD + /* allow threads to finish current action */ + mutex_rigctld(1); + HAMLIB_TRACE; + + if (client_count) + { + rig_debug(RIG_DEBUG_WARN, "%u outstanding client(s)\n", client_count); + } + + rig_close(my_rig); + HAMLIB_TRACE; + mutex_rigctld(0); + HAMLIB_TRACE; +#else + rig_close(my_rig); /* close port */ +#endif + + HAMLIB_TRACE; + network_multicast_publisher_stop(my_rig); + + HAMLIB_TRACE; + rig_cleanup(my_rig); /* if you care about memory */ + +#ifdef __MINGW32__ + WSACleanup(); +#endif + + return 0; +} + +static FILE *get_fsockout(struct handle_data *handle_data_arg) +{ +#ifdef __MINGW32__ + int sock_osfhandle = _open_osfhandle(handle_data_arg->sock, _O_RDONLY); + return _fdopen(sock_osfhandle, "wb"); +#else + return fdopen(handle_data_arg->sock, "wb"); +#endif +} + +static FILE *get_fsockin(struct handle_data *handle_data_arg) +{ +#ifdef __MINGW32__ + int sock_osfhandle = _open_osfhandle(handle_data_arg->sock, _O_RDONLY); + + if (sock_osfhandle == -1) + { + rig_debug(RIG_DEBUG_ERR, "_open_osfhandle error: %s\n", strerror(errno)); + return NULL; + } + + return _fdopen(sock_osfhandle, "rb"); +#else + return fdopen(handle_data_arg->sock, "rb"); +#endif +} + +/* + * This is the function run by the threads + */ +void *handle_socket(void *arg) +{ + struct handle_data *handle_data_arg = (struct handle_data *)arg; + FILE *fsockin = NULL; + FILE *fsockout = NULL; + int retcode = RIG_OK; + char host[NI_MAXHOST]; + char serv[NI_MAXSERV]; + rig_powerstat = RIG_POWER_ON; // defaults to power on + + fsockin = get_fsockin(handle_data_arg); + + if (!fsockin) + { + rig_debug(RIG_DEBUG_ERR, "%s: fdopen(0x%d) in: %s\n", __func__, + handle_data_arg->sock, + strerror(errno)); + goto handle_exit; + } + + fsockout = get_fsockout(handle_data_arg); + + if (!fsockout) + { + rig_debug(RIG_DEBUG_ERR, "%s: fdopen out: %s\n", __func__, strerror(errno)); + fclose(fsockin); + fsockin = NULL; + + goto handle_exit; + } + +#ifdef HAVE_PTHREAD + mutex_rigctld(1); + + ++client_count; +#if 0 + + if (!client_count++) + { + retcode = rig_open(my_rig); + + if (RIG_OK == retcode && verbose > RIG_DEBUG_ERR) + { + printf("Opened rig model %d, '%s'\n", + my_rig->caps->rig_model, + my_rig->caps->model_name); + } + } + +#endif + + mutex_rigctld(0); +#else + mutext_rigctld(1); + retcode = rig_open(my_rig); + mutext_rigctld(1); + + if (RIG_OK == retcode && verbose > RIG_DEBUG_ERR) + { + printf("Opened rig model %d, '%s'\n", + my_rig->caps->rig_model, + my_rig->caps->model_name); + } + +#endif + + if (my_rig->caps->get_powerstat) + { + mutex_rigctld(1); + rig_get_powerstat(my_rig, &rig_powerstat); + mutex_rigctld(0); + my_rig->state.powerstat = rig_powerstat; + } + + do + { + mutex_rigctld(1); + + if (!rig_opened) + { + retcode = rig_open(my_rig); + rig_opened = retcode == RIG_OK ? 1 : 0; + rig_debug(RIG_DEBUG_ERR, "%s: rig_open reopened retcode=%d\n", __func__, + retcode); + } + + mutex_rigctld(0); + + int nbytes = -1; + + if (rig_opened) // only do this if rig is open + { + powerstat_t powerstat; + unsigned char cmd[64]; + unsigned char reply[64]; + unsigned char *term = (unsigned char *)";"; + rig_debug(RIG_DEBUG_TRACE, "%s: doing rigctl_parse vfo_mode=%d, secure=%d\n", + __func__, + handle_data_arg->vfo_mode, handle_data_arg->use_password); +#if 0 + retcode = rigctl_parse(handle_data_arg->rig, fsockin, fsockout, NULL, 0, + mutex_rigctld, + 1, 0, &handle_data_arg->vfo_mode, send_cmd_term, &ext_resp, &resp_sep, + handle_data_arg->use_password); +#else + memset(cmd, 0, sizeof(cmd)); + nbytes = -1; + + do + { + ++nbytes; + int val = fgetc(fsockin); + + if (val == EOF) { goto client_done; } + + rig_debug(RIG_DEBUG_ERR, "%s: val=0x%02x @ %d\n", __func__, val, nbytes); + + cmd[nbytes] = val; + } + while (nbytes < sizeof(cmd) - 1 && cmd[nbytes] != ';' && cmd[nbytes] != 0xfd); + + ++nbytes; + rig_debug(RIG_DEBUG_ERR, "%s: bytes=%d, cmd=%s\n", __func__, nbytes, cmd); + + if (cmd[nbytes - 1] == ';') + { + rig_debug(RIG_DEBUG_ERR, "%s: cmd kenwood=%s\n", __func__, cmd); + term[0] = ';'; + term[1] = 0; + } + else if (cmd[0] == 0xfe && cmd[1] == 0xfe) + { + rig_debug(RIG_DEBUG_ERR, "%s: cmd#2 icom=%s\n", __func__, cmd); + dump_hex(cmd, nbytes); + term[0] = 0xfd; + term[1] = 0; + } + else + { + rig_debug(RIG_DEBUG_ERR, "%s: unknown cmd:", __func__); + dump_hex(cmd, nbytes); + cmd[0] = 0; + } + + // This should work with Icom binary cmds any ASCII cmd with last char being standard terminator + // This means some of the 5-byte rigs won't be handled correctly -- to be fixed? +#if 1 + + if (cmd[0] != 0) + { + memset(reply, 0, sizeof(reply)); + rig_flush(&my_rig->state.rigport); + retcode = rig_send_raw(my_rig, cmd, nbytes, reply, sizeof(reply), + &cmd[nbytes - 1]); + + if (retcode < 0) + { + rig_debug(RIG_DEBUG_ERR, "%s: rig_send_raw error=%s\n", __func__, + rigerror(retcode)); + } + else + { + + rig_debug(RIG_DEBUG_VERBOSE, "%s: reply(%d bytes)='%s'\n", __func__, retcode, reply); + + fwrite(reply, retcode, 1, fsockout); + fflush(fsockout); + } + } + +#endif +#if 0 + + if (strncmp(cmd, "FA", 2) == 0) + { + char *s = "FA00014074000;"; + printf("%s\n", s); + fwrite(s, strlen(s), 1, fsockout); + fflush(fsockout); + } + else if (strncmp(cmd, "FB", 2) == 0) + { + char *s = "FB00014075000;"; + printf("%s\n", s); + fwrite(s, strlen(s), 1, fsockout); + fflush(fsockout); + } + else if (strncmp(cmd, "AG0", 2) == 0) + { + char *s = "AG0000;"; + printf("%s\n", s); + fwrite(s, strlen(s), 1, fsockout); + fflush(fsockout); + } + else if (strncmp(cmd, "IF", 2) == 0) + { + char *s = "IF000101310001000+0000000000020010000;"; + printf("%s\n", s); + fwrite(s, strlen(s), 1, fsockout); + fflush(fsockout); + } + +#endif + +#endif + + if (retcode != 0) { rig_debug(RIG_DEBUG_VERBOSE, "%s: rigctl_parse retcode=%d\n", __func__, retcode); } + + // update our power stat in case power gets turned off + if (retcode == -RIG_ETIMEOUT + && my_rig->caps->get_powerstat) // if we get a timeout we might be powered off + { + rig_get_powerstat(my_rig, &powerstat); + rig_powerstat = powerstat; + + if (powerstat == RIG_POWER_OFF) { retcode = -RIG_EPOWER; } + } + } + else + { + retcode = -RIG_EIO; + } + + // if we get a hard error we try to reopen the rig again + // this should cover short dropouts that can occur + if (retcode < 0 && !RIG_IS_SOFT_ERRCODE(-retcode)) + { + int retry = 3; + rig_debug(RIG_DEBUG_ERR, "%s: i/o error\n", __func__); + + do + { + mutex_rigctld(1); + retcode = rig_close(my_rig); + rig_opened = 0; + mutex_rigctld(0); + rig_debug(RIG_DEBUG_ERR, "%s: rig_close retcode=%d\n", __func__, retcode); + + hl_usleep(1000 * 1000); + + mutex_rigctld(1); + + if (!rig_opened) + { + retcode = rig_open(my_rig); + rig_opened = retcode == RIG_OK ? 1 : 0; + rig_debug(RIG_DEBUG_ERR, "%s: rig_open retcode=%d, opened=%d\n", __func__, + retcode, rig_opened); + } + + mutex_rigctld(0); + } + while (!ctrl_c && !rig_opened && retry-- > 0 && retcode != RIG_OK); + } + } + while (!ctrl_c && (retcode == RIG_OK || RIG_IS_SOFT_ERRCODE(-retcode))); + +client_done: + + if (rigctld_idle && client_count == 1) + { + rig_close(my_rig); + + if (verbose > RIG_DEBUG_ERR) { printf("Closed rig model %s. Will reopen for new clients\n", my_rig->caps->model_name); } + } + + +#ifdef HAVE_PTHREAD + --client_count; + + if (rigctld_idle && client_count > 0) { printf("%d client%s still connected so rig remains open\n", client_count, client_count > 1 ? "s" : ""); } + +#if 0 + mutex_rigctld(1); + + /* Release rig if there are no clients */ + if (!--client_count) + { + rig_close(my_rig); + + if (verbose > RIG_DEBUG_ERR) + { + printf("Closed rig model %d, '%s - no clients, will reopen for new clients'\n", + my_rig->caps->rig_model, + my_rig->caps->model_name); + } + } + + mutex_rigctld(0); +#endif +#else + rig_close(my_rig); + + if (verbose > RIG_DEBUG_ERR) + { + printf("Closed rig model %d, '%s - will reopen for new clients'\n", + my_rig->caps->rig_model, + my_rig->caps->model_name); + } + +#endif + + if ((retcode = getnameinfo((struct sockaddr const *)&handle_data_arg->cli_addr, + handle_data_arg->clilen, + host, + sizeof(host), + serv, + sizeof(serv), + NI_NUMERICHOST | NI_NUMERICSERV)) + < 0) + { + + rig_debug(RIG_DEBUG_WARN, "Peer lookup error: %s", gai_strerror(retcode)); + } + + rig_debug(RIG_DEBUG_VERBOSE, + "Connection closed from %s:%s\n", + host, + serv); + +handle_exit: + +// for MINGW we close the handle before fclose +#ifdef __MINGW32__ + retcode = closesocket(handle_data_arg->sock); + + if (retcode != 0) { rig_debug(RIG_DEBUG_ERR, "%s: fclose(fsockin) %s\n", __func__, strerror(retcode)); } + +#endif + + if (fsockin) { fclose(fsockin); } + + if (fsockout) { fclose(fsockout); } + +// for everybody else we close the handle after fclose +#ifndef __MINGW32__ + retcode = close(handle_data_arg->sock); + + if (retcode != 0 && errno != EBADF) { rig_debug(RIG_DEBUG_ERR, "%s: close(handle_data_arg->sock) %s\n", __func__, strerror(errno)); } + +#endif + + free(arg); + +#ifdef HAVE_PTHREAD + pthread_exit(NULL); +#endif + return NULL; +} + + +void usage(void) +{ + printf("Usage: rigctld [OPTION]...\n" + "Daemon serving COMMANDs to a connected radio transceiver or receiver.\n\n"); + + + printf( + " -m, --model=ID select radio model number. See model list\n" + " -r, --rig-file=DEVICE set device of the radio to operate on\n" + " -p, --ptt-file=DEVICE set device of the PTT device to operate on\n" + " -d, --dcd-file=DEVICE set device of the DCD device to operate on\n" + " -P, --ptt-type=TYPE set type of the PTT device to operate on\n" + " -D, --dcd-type=TYPE set type of the DCD device to operate on\n" + " -s, --serial-speed=BAUD set serial speed of the serial port\n" + " -c, --civaddr=ID set CI-V address, decimal (for Icom rigs only)\n" + " -t, --port=NUM set TCP listening port, default %s\n" + " -S, --separator=CHAR set char as rigctld response separator, default is \\n\n" + " -T, --listen-addr=IPADDR set listening IP address, default ANY\n" + " -C, --set-conf=PARM=VAL set config parameters\n" + " -L, --show-conf list all config parameters\n" + " -l, --list list all model numbers and exit\n" + " -u, --dump-caps dump capabilities and exit\n" + " -o, --vfo do not default to VFO_CURR, require extra vfo arg\n" + " -v, --verbose set verbose mode, cumulative (-v to -vvvvv)\n" + " -W, --twiddle_timeout timeout after detecting vfo manual change\n" + " -w, --twiddle_rit suppress VFOB getfreq so RIT can be twiddled\n" + " -x, --uplink set uplink get_freq ignore, 1=Sub, 2=Main\n" + " -Z, --debug-time-stamps enable time stamps for debug messages\n" + " -M, --multicast-addr=addr set multicast UDP address, default 0.0.0.0 (off), recommend 224.0.1.1\n" + " -n, --multicast-port=port set multicast UDP port, default 4532\n" + " -A, --password set password for rigctld access\n" + " -R, --rigctld-idle make rigctld close the rig when no clients are connected\n" + " -h, --help display this help and exit\n" + " -V, --version output version information and exit\n\n", + portno); + + usage_rig(stdout); + + printf("\nError codes and messages\n"); + + for (enum rig_errcode_e e = 0; e < RIG_EEND; ++e) + { + printf("-%d - %s", e, rigerror2(e)); + } + + + printf("\nReport bugs to <ham...@li...>.\n"); + +} commit 0b2f0873b036b339f5f65412cc17a464cc2ef3ba Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Jan 2 11:32:18 2023 -0600 Update NEWS diff --git a/NEWS b/NEWS index 5290f313..0facc972 100644 --- a/NEWS +++ b/NEWS @@ -26,7 +26,7 @@ Version 4.6 Version 4.5.4 * 2023-XX-XX - * Remove get_powerstat from Icom ID-5100 + * Remove get_powerstat from Icom ID-5100,ID-4100,ID-31,ID-51 and fix get/set freq in all Version 4.5.3 * 2022-12-31 commit c7b33ef0b3296a88ca387db1ac3634e19075dab1 Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Jan 2 11:30:52 2023 -0600 Fix ID5100 ID4100 ID31 ID51 get/set freq Remove get_powerstat from ID4100 ID31 ID51 as it they are not capable Add new rig_is_model function to help with Icom rig identification checks https://github.com/Hamlib/Hamlib/issues/1202 https://github.com/Hamlib/Hamlib/issues/1200 diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h index eb3d9a0e..a55ef92f 100644 --- a/include/hamlib/rig.h +++ b/include/hamlib/rig.h @@ -3428,6 +3428,8 @@ extern HAMLIB_EXPORT(char*) rig_make_md5(char *pass); extern HAMLIB_EXPORT(int) rig_set_lock_mode(RIG *rig, int lock); extern HAMLIB_EXPORT(int) rig_get_lock_mode(RIG *rig, int *lock); +extern HAMLIB_EXPORT(int) rig_is_model(RIG *rig, rig_model_t model); + //! @endcond diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index e17d1e98..41f236f2 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -1324,7 +1324,15 @@ int icom_set_freq(RIG *rig, vfo_t vfo, freq_t freq) RETURNFUNC2(retval); } - freq_len = priv->civ_731_mode ? 4 : 5; + if (ICOM_IS_ID5100 || ICOM_IS_ID5100) + { + freq_len = 3; + } + else + { + freq_len = priv->civ_731_mode ? 4 : 5; + } + /* * to_bcd requires nibble len */ @@ -1688,7 +1696,11 @@ int icom_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) RETURNFUNC(RIG_OK); } - if (freq_len != 4 && freq_len != 5) + if (freq_len == 3 && (ICOM_IS_ID5100 || ICOM_IS_ID4100 || ICOM_IS_ID31 || ICOM_IS_ID51)) + { + rig_debug(RIG_DEBUG_TRACE, "%s: 3-byte ID5100/4100 length\n", __func__); + } + else if (freq_len != 4 && freq_len != 5) { rig_debug(RIG_DEBUG_ERR, "%s: wrong frame len=%d\n", __func__, freq_len); @@ -1698,7 +1710,7 @@ int icom_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) RETURNFUNC(-RIG_ERJCTED); } - if (freq_len != (priv->civ_731_mode ? 4 : 5)) + if (freq_len != 3 && freq_len != (priv->civ_731_mode ? 4 : 5)) { rig_debug(RIG_DEBUG_WARN, "%s: freq len (%d) differs from expected\n", __func__, freq_len); diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h index be4475cd..0ddce378 100644 --- a/rigs/icom/icom.h +++ b/rigs/icom/icom.h @@ -31,7 +31,12 @@ #include <sys/time.h> #endif -#define BACKEND_VER "20221120" +#define BACKEND_VER "20230102" + +#define ICOM_IS_ID31 rig_is_model(rig, RIG_MODEL_ID31) +#define ICOM_IS_ID51 rig_is_model(rig, RIG_MODEL_ID51) +#define ICOM_IS_ID4100 rig_is_model(rig, RIG_MODEL_ID4100) +#define ICOM_IS_ID5100 rig_is_model(rig, RIG_MODEL_ID5100) #define ICOM_IS_SECONDARY_VFO(vfo) ((vfo) & (RIG_VFO_B | RIG_VFO_SUB | RIG_VFO_SUB_B | RIG_VFO_MAIN_B)) #define ICOM_GET_VFO_NUMBER(vfo) (ICOM_IS_SECONDARY_VFO(vfo) ? 0x01 : 0x00) diff --git a/rigs/icom/id31.c b/rigs/icom/id31.c index 26453be7..03e9e535 100644 --- a/rigs/icom/id31.c +++ b/rigs/icom/id31.c @@ -82,7 +82,7 @@ const struct rig_caps id31_caps = RIG_MODEL(RIG_MODEL_ID31), .model_name = "ID-31", .mfg_name = "Icom", - .version = BACKEND_VER ".0", + .version = BACKEND_VER ".1", .copyright = "LGPL", .status = RIG_STATUS_ALPHA, .rig_type = RIG_TYPE_HANDHELD, @@ -179,7 +179,7 @@ const struct rig_caps id31_caps = .get_mode = icom_get_mode, .set_powerstat = icom_set_powerstat, - .get_powerstat = icom_get_powerstat, +// .get_powerstat = icom_get_powerstat, // not capable .decode_event = icom_decode_event, .set_func = icom_set_func, diff --git a/rigs/icom/id4100.c b/rigs/icom/id4100.c index d46e7a6c..83efa22a 100644 --- a/rigs/icom/id4100.c +++ b/rigs/icom/id4100.c @@ -86,9 +86,9 @@ const struct rig_caps id4100_caps = RIG_MODEL(RIG_MODEL_ID4100), .model_name = "ID-4100", .mfg_name = "Icom", - .version = BACKEND_VER ".0", + .version = BACKEND_VER ".1", .copyright = "LGPL", - .status = RIG_STATUS_ALPHA, + .status = RIG_STATUS_BETA, .rig_type = RIG_TYPE_MOBILE, .ptt_type = RIG_PTT_RIG, .dcd_type = RIG_DCD_RIG, @@ -98,7 +98,7 @@ const struct rig_caps id4100_caps = .serial_data_bits = 8, .serial_stop_bits = 1, .serial_parity = RIG_PARITY_NONE, - .serial_handshake = RIG_HANDSHAKE_NONE, + .serial_handshake = RIG_HANDSHAKE_XONXOFF, .write_delay = 0, .post_write_delay = 0, .timeout = 1000, @@ -187,7 +187,7 @@ const struct rig_caps id4100_caps = .get_mode = icom_get_mode, .set_vfo = icom_set_vfo, - .set_powerstat = icom_set_powerstat, + //.set_powerstat = icom_set_powerstat, // ID-4100 does cannot query power .get_powerstat = icom_get_powerstat, .decode_event = icom_decode_event, diff --git a/rigs/icom/id51.c b/rigs/icom/id51.c index 1d10da00..25f56e7c 100644 --- a/rigs/icom/id51.c +++ b/rigs/icom/id51.c @@ -89,7 +89,7 @@ const struct rig_caps id51_caps = RIG_MODEL(RIG_MODEL_ID51), .model_name = "ID-51", .mfg_name = "Icom", - .version = BACKEND_VER ".0", + .version = BACKEND_VER ".1", .copyright = "LGPL", .status = RIG_STATUS_ALPHA, .rig_type = RIG_TYPE_HANDHELD, @@ -185,7 +185,7 @@ const struct rig_caps id51_caps = .rig_open = icom_rig_open, .rig_close = icom_rig_close, .set_powerstat = icom_set_powerstat, - .get_powerstat = icom_get_powerstat, +// .get_powerstat = icom_get_powerstat, // not capable .set_freq = icom_set_freq, .get_freq = icom_get_freq, diff --git a/src/rig.c b/src/rig.c index 87876dcb..7422fd27 100644 --- a/src/rig.c +++ b/src/rig.c @@ -7717,3 +7717,15 @@ HAMLIB_EXPORT(int) rig_get_lock_mode(RIG *rig, int *mode) return (retcode); } + +HAMLIB_EXPORT(int) rig_is_model(RIG *rig, rig_model_t model) +{ + int is_rig; + + //a bit too verbose so disable this unless needed + //rig_debug(RIG_DEBUG_TRACE, "%s(%d):%s called\n", __FILE__, __LINE__, __func__); + is_rig = (model == rig->caps->rig_model) ? 1 : 0; + + return (is_rig); // RETURN is too verbose here +} + diff --git a/tests/Makefile.am b/tests/Makefile.am index 69cd60be..cd0d8cb8 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -14,7 +14,7 @@ endif DISTCLEANFILES = rigctl.log rigctl.sum testbcd.log testbcd.sum -bin_PROGRAMS = rigctl rigctld rigmem rigsmtr rigswr rotctl rotctld rigctlcom ampctl ampctld $(TESTLIBUSB) +bin_PROGRAMS = rigctl rigctld rigmem rigsmtr rigswr rotctl rotctld rigctlcom rigctltcp ampctl ampctld $(TESTLIBUSB) #check_PROGRAMS = dumpmem testrig testrigopen testrigcaps testtrn testbcd testfreq listrigs testloc rig_bench testcache cachetest cachetest2 testcookie testgrid testsecurity check_PROGRAMS = dumpmem testrig testrigopen testrigcaps testtrn testbcd testfreq listrigs testloc rig_bench testcache cachetest cachetest2 testcookie testgrid @@ -26,6 +26,7 @@ AMPCOMMONSRC = ampctl_parse.c ampctl_parse.h dumpcaps_amp.c uthash.h rigctl_SOURCES = rigctl.c $(RIGCOMMONSRC) rigctld_SOURCES = rigctld.c $(RIGCOMMONSRC) rigctlcom_SOURCES = rigctlcom.c $(RIGCOMMONSRC) +rigctltcp_SOURCES = rigctltcp.c $(RIGCOMMONSRC) rotctl_SOURCES = rotctl.c $(ROTCOMMONSRC) rotctld_SOURCES = rotctld.c $(ROTCOMMONSRC) ampctl_SOURCES = ampctl.c $(AMPCOMMONSRC) @@ -50,6 +51,7 @@ rotctld_CFLAGS = $(AM_CFLAGS) $(PTHREAD_CFLAGS) -I$(top_builddir)/src ampctl_CFLAGS = $(AM_CFLAGS) $(PTHREAD_CFLAGS) -I$(top_builddir)/src ampctld_CFLAGS = $(AM_CFLAGS) $(PTHREAD_CFLAGS) -I$(top_builddir)/src rigctlcom_CFLAGS = $(AM_CFLAGS) $(PTHREAD_CFLAGS) -I$(top_builddir)/security +rigctltcp_CFLAGS = $(AM_CFLAGS) $(PTHREAD_CFLAGS) -I$(top_builddir)/security if HAVE_LIBUSB rigtestlibusb_CFLAGS = $(AM_CFLAGS) $(PTHREAD_CFLAGS) $(LIBUSB_CFLAGS) endif @@ -63,6 +65,7 @@ ampctl_LDADD = $(PTHREAD_LIBS) $(LDADD) $(READLINE_LIBS) ampctld_LDADD = $(NET_LIBS) $(PTHREAD_LIBS) $(LDADD) $(READLINE_LIBS) rigmem_LDADD = $(LIBXML2_LIBS) $(LDADD) rigctlcom_LDADD = $(NET_LIBS) $(PTHREAD_LIBS) $(LDADD) $(READLINE_LIBS) +rigctltcp_LDADD = $(NET_LIBS) $(PTHREAD_LIBS) $(LDADD) $(READLINE_LIBS) if HAVE_LIBUSB rigtestlibusb_LDADD = $(LIBUSB_LIBS) endif @@ -78,6 +81,7 @@ rigctld_LDFLAGS = $(WINEXELDFLAGS) rotctld_LDFLAGS = $(WINEXELDFLAGS) ampctld_LDFLAGS = $(WINEXELDFLAGS) rigctlcom_LDFLAGS = $(WINEXELDFLAGS) +rigctltcp_LDFLAGS = $(WINEXELDFLAGS) if HAVE_LIBUSB rigtestlibusb_LDFLAGS = $(WINEXELDFLAGS) endif commit f68d45d99b5b08ac64d19a20d8aedfc27270de3e Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Jan 2 08:58:21 2023 -0600 Update NEWS diff --git a/NEWS b/NEWS index 8d1f0e39..5290f313 100644 --- a/NEWS +++ b/NEWS @@ -26,6 +26,7 @@ Version 4.6 Version 4.5.4 * 2023-XX-XX + * Remove get_powerstat from Icom ID-5100 Version 4.5.3 * 2022-12-31 commit fa7289995c29719739edd13d3e945248adc0905a Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Jan 2 08:48:59 2023 -0600 Remove get_powerstat from Icom ID-5100 -- does not have the ability to get power status https://github.com/Hamlib/Hamlib/issues/1201 diff --git a/rigs/icom/id5100.c b/rigs/icom/id5100.c index e9769737..2448ff8f 100644 --- a/rigs/icom/id5100.c +++ b/rigs/icom/id5100.c @@ -86,7 +86,7 @@ const struct rig_caps id5100_caps = RIG_MODEL(RIG_MODEL_ID5100), .model_name = "ID-5100", .mfg_name = "Icom", - .version = BACKEND_VER ".1", + .version = BACKEND_VER ".2", .copyright = "LGPL", .status = RIG_STATUS_BETA, .rig_type = RIG_TYPE_MOBILE, @@ -189,7 +189,7 @@ const struct rig_caps id5100_caps = .set_vfo = icom_set_vfo, .set_powerstat = icom_set_powerstat, - .get_powerstat = icom_get_powerstat, + //.get_powerstat = icom_get_powerstat, // ID-5100 cannot get power status .decode_event = icom_decode_event, .set_func = icom_set_func, commit 582686505cbbc43f2013b7b8355d1f877671ef7e Author: Mike Black W9MDB <mdb...@ya...> Date: Sun Jan 1 16:40:19 2023 -0600 TS-890S query rig to find out which meter type the operator has selected Thanks to N3GB George Baltz diff --git a/rigs/kenwood/ts890s.c b/rigs/kenwood/ts890s.c index dc2781b9..cae17b1c 100644 --- a/rigs/kenwood/ts890s.c +++ b/rigs/kenwood/ts890s.c @@ -17,10 +17,12 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ #include <hamlib/config.h> #include <stdio.h> +#include <math.h> #include <hamlib/rig.h> #include "kenwood.h" @@ -366,6 +368,59 @@ int kenwood_ts890_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) #endif return -RIG_ENIMPL; + case RIG_LEVEL_STRENGTH: + { + cal_table_float_t *table; + /* Values taken from the TS-890S In-Depth Manual (IDM), p. 8 + * 0.03 - 21.5 MHz, Preamp 1 + */ + /* Meter Type 1 - Kenwood specific, factory default */ + static cal_table_float_t meter_type1 = + { + 9, { { 0, -28.4f}, { 3, -26}, {11, -19.5f}, + {19, -13}, {27, -6.5f}, {35, 0}, + {48, 20}, {59, 40}, {70, 60} + } }; + /* Meter Type 2 - IARU recommended */ + static cal_table_float_t meter_type2 = + { + 9, { { 0, -54}, { 3, -48}, {11, -36}, + {19, -24}, {27, -12}, {35, 0}, + {48, 20}, {59, 40}, {70, 60} + } }; + /* Find out which meter type is in use */ + retval = kenwood_safe_transaction(rig, "EX00011", ackbuf, sizeof(ackbuf), 11); + + if (retval != RIG_OK) + { + return retval; + } + if (strncmp(ackbuf + 8, "000", 3) == 0) + { + table = &meter_type1; + } + else if (strncmp(ackbuf + 8, "001", 3) == 0) + { + table = &meter_type2; + } + else + { + rig_debug(RIG_DEBUG_ERR, "%s: Unexpected meter type: %s\n", + __func__, ackbuf); + return -RIG_EPROTO; + } + retval = kenwood_safe_transaction(rig, "SM", ackbuf, 10, 6); + if (retval != RIG_OK) + { + return retval; + } + + sscanf(ackbuf + 2, "%d", &val->i); + /* Convert reading back to dB (rounded) */ + val->i = (int)floorf(rig_raw2val_float(val->i, table) + 0.5f); + return RIG_OK; + } + default: return kenwood_get_level(rig, vfo, level, val); } @@ -378,39 +433,6 @@ static struct kenwood_priv_caps ts890s_priv_caps = .cmdtrm = EOM_KEN, }; -/* S-meter calibration table - * The TS-890S has two distinct S-meter curves, selectable - * by menu option. Define both, but since Hamlib has only - * one slot, use the the IARU one. - * Values taken from TS-890S In-Depth Manual, p. 8 - */ -/* Meter Type 1 - Kenwood specific (default) */ -#define TS890_SM_CAL2 { 9, \ - { \ - { 0, -28 }, \ - { 3, -26 }, \ - { 11, -20 }, \ - { 19, -13 }, \ - { 27, -7 }, \ - { 35, 0 }, \ - { 48, 20 }, \ - { 59, 40 }, \ - { 70, 60 }, \ - } } -/* Meter Type 2 - IARU Standard */ -#define TS890_SM_CAL1 { 9, \ - { \ - { 0, -54 }, \ - { 3, -48 }, \ - { 11, -36 }, \ - { 19, -24 }, \ - { 27, -12 }, \ - { 35, 0 }, \ - { 48, 20 }, \ - { 59, 40 }, \ - { 70, 60 }, \ - } } - /* SWR meter calibration table */ /* The full scale value reads infinity, so arbitrary */ #define TS890_SWR_CAL { 5, \ @@ -543,7 +565,6 @@ const struct rig_caps ts890s_caps = }, .vfo_ops = TS890_VFO_OPS, - .str_cal = TS890_SM_CAL1, .swr_cal = TS890_SWR_CAL, .priv = (void *)& ts890s_priv_caps, commit 712564a2ae97343c5ed7001f90e79716939ed1d0 Author: Mike Black W9MDB <mdb...@ya...> Date: Sun Jan 1 16:39:25 2023 -0600 ... [truncated message content] |
From: n0nb <n0...@us...> - 2023-01-01 00:29:25
|
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.5.3 has been updated via b6209911b0a54473c21fbe33845fb64af6dfacd6 (commit) via 6a677b99195933b484fa053da1c62d9abebc91a7 (commit) from 084617dbb9686c4f72014ce78b75f87001f18c99 (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 b6209911b0a54473c21fbe33845fb64af6dfacd6 Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Dec 31 14:46:26 2022 -0600 Update NEWS diff --git a/NEWS b/NEWS index 55d6b54b..63a39459 100644 --- a/NEWS +++ b/NEWS @@ -23,6 +23,7 @@ Version 4.6 * Fix FTDX3000 rig split Version 4.5.3 + * 2022-12-31 * Fix serial.c for hardware flow control on Linux and MacOSy * Add QRPLabs QCX/QDX rig -- not quite a TS480 * Fix QRP QRDX firmware bugs in IF message so PTT works now commit 6a677b99195933b484fa053da1c62d9abebc91a7 Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Dec 31 13:44:53 2022 -0600 Bump version to 4.5.3 diff --git a/configure.ac b/configure.ac index 7f2a7007..88b73e34 100644 --- a/configure.ac +++ b/configure.ac @@ -14,7 +14,7 @@ dnl Please do not use '-' in the version number, as package managers will fail, dnl however, the use of '~' should be fine as apt (others?) will treat dnl it as an earlier version than the actual release. TNX KA6MAL dnl PACKAGE_NAME + " " + PACKAGE_VERSION must not exceed 20 chars! -AC_INIT([Hamlib],[4.5.2],[ham...@li...],[hamlib],[http://www.hamlib.org]) +AC_INIT([Hamlib],[4.5.3],[ham...@li...],[hamlib],[http://www.hamlib.org]) AC_CONFIG_SRCDIR([include/hamlib/rig.h]) AC_CONFIG_MACRO_DIR([macros]) ----------------------------------------------------------------------- Summary of changes: NEWS | 1 + configure.ac | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: n0nb <n0...@us...> - 2022-12-31 20:36:34
|
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.5.3 has been created at 084617dbb9686c4f72014ce78b75f87001f18c99 (commit) - Log ----------------------------------------------------------------- commit 084617dbb9686c4f72014ce78b75f87001f18c99 Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Dec 31 09:34:29 2022 -0600 Update NEWS diff --git a/NEWS b/NEWS index 81605135..55d6b54b 100644 --- a/NEWS +++ b/NEWS @@ -23,6 +23,7 @@ Version 4.6 * Fix FTDX3000 rig split Version 4.5.3 + * Fix serial.c for hardware flow control on Linux and MacOSy * Add QRPLabs QCX/QDX rig -- not quite a TS480 * Fix QRP QRDX firmware bugs in IF message so PTT works now * FTDX5000 will now remember startup front/read settings and restore it commit 6643d44ed9963c387fbeaaa155f69ca096335c7a Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Dec 31 09:30:25 2022 -0600 Remove set_rts and set_dtr low from serial.c This was causing hardward flow control to fail on Linux and MacOS https://github.com/Hamlib/Hamlib/issues/1198 https://github.com/Hamlib/Hamlib/issues/1199 diff --git a/src/serial.c b/src/serial.c index 378117ee..a22aed95 100644 --- a/src/serial.c +++ b/src/serial.c @@ -290,8 +290,10 @@ int HAMLIB_API serial_setup(hamlib_port_t *rp) fd = rp->fd; // Linux sets pins high so we force them low once - ser_set_rts(rp, 0); - ser_set_dtr(rp, 0); + // This fails on Linux and MacOS with hardware flow control + // Seems setting low disables hardware flow setting later +// ser_set_rts(rp, 0); +// ser_set_dtr(rp, 0); /* * Get the current options for the port... commit 1f332d733347eaa5bddceabd315b1848346e05f6 Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Dec 31 08:10:06 2022 -0600 Update NEWS diff --git a/NEWS b/NEWS index d4f6fee1..81605135 100644 --- a/NEWS +++ b/NEWS @@ -23,6 +23,7 @@ Version 4.6 * Fix FTDX3000 rig split Version 4.5.3 + * Add QRPLabs QCX/QDX rig -- not quite a TS480 * Fix QRP QRDX firmware bugs in IF message so PTT works now * FTDX5000 will now remember startup front/read settings and restore it * Fix FTDX5000 write_delay with microham commit 85c4f730619968fd7b4e34f54076bb2cf949b010 Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Dec 30 16:04:39 2022 -0600 Add QRPLabs QCX/QDX for better behavior/capability from ts480 entry diff --git a/include/hamlib/riglist.h b/include/hamlib/riglist.h index a6843224..c5b56fc2 100644 --- a/include/hamlib/riglist.h +++ b/include/hamlib/riglist.h @@ -185,6 +185,7 @@ #define RIG_MODEL_MALACHITE RIG_MAKE_MODEL(RIG_KENWOOD, 49) #define RIG_MODEL_LAB599_TX500 RIG_MAKE_MODEL(RIG_KENWOOD,50) #define RIG_MODEL_SDRUNO RIG_MAKE_MODEL(RIG_KENWOOD,51) +#define RIG_MODEL_QRPLABS RIG_MAKE_MODEL(RIG_KENWOOD,52) /* * Icom diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index 055bb3e1..223adfae 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -5774,6 +5774,7 @@ DECLARE_INITRIG_BACKEND(kenwood) rig_register(&malachite_caps); rig_register(&tx500_caps); rig_register(&sdruno_caps); + rig_register(&qrplabs_caps); return (RIG_OK); } diff --git a/rigs/kenwood/kenwood.h b/rigs/kenwood/kenwood.h index e7278771..4787ae93 100644 --- a/rigs/kenwood/kenwood.h +++ b/rigs/kenwood/kenwood.h @@ -29,7 +29,7 @@ #include "misc.h" #include "idx_builtin.h" -#define BACKEND_VER "20221128" +#define BACKEND_VER "20221230" #define EOM_KEN ';' #define EOM_TH '\r' @@ -110,6 +110,7 @@ extern struct confparams kenwood_cfg_params[]; #define RIG_IS_PT8000A (rig->caps->rig_model == RIG_MODEL_PT8000A) #define RIG_IS_POWERSDR (rig->caps->rig_model == RIG_MODEL_POWERSDR) #define RIG_IS_MALACHITE (rig->caps->rig_model == RIG_MODEL_MALACHITE) +#define RIG_IS_QRPLABS (rig->caps->rig_model == RIG_MODEL_QRPLABS) struct kenwood_filter_width { @@ -311,6 +312,7 @@ extern const struct rig_caps pt8000a_caps; extern const struct rig_caps malachite_caps; extern const struct rig_caps tx500_caps; extern const struct rig_caps sdruno_caps; +extern const struct rig_caps qrplabs_caps; /* use when not interested in the answer, but want to check its len */ static int inline kenwood_simple_transaction(RIG *rig, const char *cmd, diff --git a/rigs/kenwood/ts480.c b/rigs/kenwood/ts480.c index 880221b1..1d4fb807 100644 --- a/rigs/kenwood/ts480.c +++ b/rigs/kenwood/ts480.c @@ -1448,6 +1448,198 @@ const struct rig_caps ts480_caps = .hamlib_check_rig_caps = HAMLIB_CHECK_RIG_CAPS }; +/* + * QRPLabs TS-480 emulation rig capabilities + * Notice that some rigs share the same functions. + */ +const struct rig_caps qrplabs_caps = +{ + RIG_MODEL(RIG_MODEL_QRPLABS), + .model_name = "QCX/QDX", + .mfg_name = "QRPLabs", + .version = BACKEND_VER ".0", + .copyright = "LGPL", + .status = RIG_STATUS_STABLE, + .rig_type = RIG_TYPE_TRANSCEIVER, + .ptt_type = RIG_PTT_RIG, + .dcd_type = RIG_DCD_RIG, + .port_type = RIG_PORT_SERIAL, + .serial_rate_min = 4800, + .serial_rate_max = 115200, + .serial_data_bits = 8, + .serial_stop_bits = 1, + .serial_parity = RIG_PARITY_NONE, + .serial_handshake = RIG_HANDSHAKE_NONE, + .write_delay = 0, + .post_write_delay = 0, + .timeout = 500, + .retry = 3, + .preamp = {12, RIG_DBLST_END,}, + .attenuator = {12, RIG_DBLST_END,}, + .max_rit = kHz(9.99), + .max_xit = kHz(9.99), + .max_ifshift = Hz(0), + .targetable_vfo = RIG_TARGETABLE_FREQ, + .transceive = RIG_TRN_RIG, + .agc_level_count = 3, + .agc_levels = { RIG_AGC_OFF, RIG_AGC_FAST, RIG_AGC_SLOW }, + + .rx_range_list1 = { + {kHz(100), Hz(59999999), TS480_ALL_MODES, -1, -1, TS480_VFO}, + RIG_FRNG_END, + }, /*!< Receive frequency range list for ITU region 1 */ + .tx_range_list1 = { + {kHz(1810), kHz(1850), TS480_OTHER_TX_MODES, 5000, 100000, TS480_VFO}, /* 100W class */ + {kHz(1810), kHz(1850), TS480_AM_TX_MODES, 5000, 25000, TS480_VFO}, /* 25W class */ + {kHz(3500), kHz(3800), TS480_OTHER_TX_MODES, 5000, 100000, TS480_VFO}, + {kHz(3500), kHz(3800), TS480_AM_TX_MODES, 5000, 25000, TS480_VFO}, + {MHz(7), kHz(7200), TS480_OTHER_TX_MODES, 5000, 100000, TS480_VFO}, + {MHz(7), kHz(7200), TS480_AM_TX_MODES, 5000, 25000, TS480_VFO}, + {kHz(10100), kHz(10150), TS480_OTHER_TX_MODES, 5000, 100000, TS480_VFO}, + {kHz(10100), kHz(10150), TS480_AM_TX_MODES, 5000, 25000, TS480_VFO}, + {MHz(14), kHz(14350), TS480_OTHER_TX_MODES, 5000, 100000, TS480_VFO}, + {MHz(14), kHz(14350), TS480_AM_TX_MODES, 5000, 25000, TS480_VFO}, + {kHz(18068), kHz(18168), TS480_OTHER_TX_MODES, 5000, 100000, TS480_VFO}, + {kHz(18068), kHz(18168), TS480_AM_TX_MODES, 5000, 25000, TS480_VFO}, + {MHz(21), kHz(21450), TS480_OTHER_TX_MODES, 5000, 100000, TS480_VFO}, + {MHz(21), kHz(21450), TS480_AM_TX_MODES, 5000, 25000, TS480_VFO}, + {kHz(24890), kHz(24990), TS480_OTHER_TX_MODES, 5000, 100000, TS480_VFO}, + {kHz(24890), kHz(24990), TS480_AM_TX_MODES, 5000, 25000, TS480_VFO}, + {MHz(28), kHz(29700), TS480_OTHER_TX_MODES, 5000, 100000, TS480_VFO}, + {MHz(28), kHz(29700), TS480_AM_TX_MODES, 5000, 25000, TS480_VFO}, + {MHz(50), kHz(52000), TS480_OTHER_TX_MODES, 5000, 100000, TS480_VFO}, + {MHz(50), kHz(52000), TS480_AM_TX_MODES, 5000, 25000, TS480_VFO}, + RIG_FRNG_END, + }, /*!< Transmit frequency range list for ITU region 1 */ + .rx_range_list2 = { + {kHz(100), Hz(59999999), TS480_ALL_MODES, -1, -1, TS480_VFO}, + RIG_FRNG_END, + }, /*!< Receive frequency range list for ITU region 2 */ + .tx_range_list2 = { + {kHz(1800), MHz(2) - 1, TS480_OTHER_TX_MODES, 5000, 100000, TS480_VFO}, /* 100W class */ + {kHz(1800), MHz(2) - 1, TS480_AM_TX_MODES, 5000, 25000, TS480_VFO}, /* 25W class */ + {kHz(3500), MHz(4) - 1, TS480_OTHER_TX_MODES, 5000, 100000, TS480_VFO}, + {kHz(3500), MHz(4) - 1, TS480_AM_TX_MODES, 5000, 25000, TS480_VFO}, + {kHz(5250), kHz(5450), TS480_OTHER_TX_MODES, 5000, 100000, TS480_VFO}, + {kHz(5250), kHz(5450), TS480_AM_TX_MODES, 5000, 25000, TS480_VFO}, + {MHz(7), kHz(7300), TS480_OTHER_TX_MODES, 5000, 100000, TS480_VFO}, + {MHz(7), kHz(7300), TS480_AM_TX_MODES, 5000, 25000, TS480_VFO}, + {kHz(10100), kHz(10150), TS480_OTHER_TX_MODES, 5000, 100000, TS480_VFO}, + {kHz(10100), kHz(10150), TS480_AM_TX_MODES, 5000, 25000, TS480_VFO}, + {MHz(14), kHz(14350), TS480_OTHER_TX_MODES, 5000, 100000, TS480_VFO}, + {MHz(14), kHz(14350), TS480_AM_TX_MODES, 5000, 25000, TS480_VFO}, + {kHz(18068), kHz(18168), TS480_OTHER_TX_MODES, 5000, 100000, TS480_VFO}, + {kHz(18068), kHz(18168), TS480_AM_TX_MODES, 5000, 25000, TS480_VFO}, + {MHz(21), kHz(21450), TS480_OTHER_TX_MODES, 5000, 100000, TS480_VFO}, + {MHz(21), kHz(21450), TS480_AM_TX_MODES, 5000, 25000, TS480_VFO}, + {kHz(24890), kHz(24990), TS480_OTHER_TX_MODES, 5000, 100000, TS480_VFO}, + {kHz(24890), kHz(24990), TS480_AM_TX_MODES, 5000, 25000, TS480_VFO}, + {MHz(28), kHz(29700), TS480_OTHER_TX_MODES, 5000, 100000, TS480_VFO}, + {MHz(28), kHz(29700), TS480_AM_TX_MODES, 5000, 25000, TS480_VFO}, + {MHz(50), kHz(52000), TS480_OTHER_TX_MODES, 5000, 100000, TS480_VFO}, + {MHz(50), kHz(52000), TS480_AM_TX_MODES, 5000, 25000, TS480_VFO}, + RIG_FRNG_END, + }, /*!< Transmit frequency range list for ITU region 2 */ + .tuning_steps = { + {TS480_ALL_MODES, kHz(1)}, + {TS480_ALL_MODES, Hz(2500)}, + {TS480_ALL_MODES, kHz(5)}, + {TS480_ALL_MODES, Hz(6250)}, + {TS480_ALL_MODES, kHz(10)}, + {TS480_ALL_MODES, Hz(12500)}, + {TS480_ALL_MODES, kHz(15)}, + {TS480_ALL_MODES, kHz(20)}, + {TS480_ALL_MODES, kHz(25)}, + {TS480_ALL_MODES, kHz(30)}, + {TS480_ALL_MODES, kHz(100)}, + {TS480_ALL_MODES, kHz(500)}, + {TS480_ALL_MODES, MHz(1)}, + {TS480_ALL_MODES, 0}, /* any tuning step */ + RIG_TS_END, + }, + /* mode/filter list, remember: order matters! */ + .filters = { + {RIG_MODE_SSB, kHz(2.4)}, + {RIG_MODE_SSB, Hz(270)}, + {RIG_MODE_SSB, Hz(500)}, + {RIG_MODE_CW | RIG_MODE_CWR, Hz(200)}, + {RIG_MODE_CW | RIG_MODE_CWR, Hz(50)}, + {RIG_MODE_CW | RIG_MODE_CWR, Hz(1000)}, + {RIG_MODE_CW | RIG_MODE_CWR, Hz(80)}, + {RIG_MODE_CW | RIG_MODE_CWR, Hz(100)}, + {RIG_MODE_CW | RIG_MODE_CWR, Hz(150)}, + {RIG_MODE_CW | RIG_MODE_CWR, Hz(300)}, + {RIG_MODE_CW | RIG_MODE_CWR, Hz(400)}, + {RIG_MODE_CW | RIG_MODE_CWR, Hz(500)}, + {RIG_MODE_CW | RIG_MODE_CWR, Hz(600)}, + {RIG_MODE_CW | RIG_MODE_CWR, Hz(2000)}, + {RIG_MODE_RTTY | RIG_MODE_RTTYR, Hz(500)}, + {RIG_MODE_RTTY | RIG_MODE_RTTYR, Hz(250)}, + {RIG_MODE_RTTY | RIG_MODE_RTTYR, Hz(1000)}, + {RIG_MODE_RTTY | RIG_MODE_RTTYR, Hz(1500)}, + {RIG_MODE_AM, kHz(6)}, + {RIG_MODE_AM, kHz(2.4)}, + {RIG_MODE_FM, kHz(12)}, + RIG_FLT_END, + }, + .vfo_ops = TS480_VFO_OPS, + .level_gran = + { +#include "level_gran_kenwood.h" + [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, + [LVL_VOXDELAY] = { .min = { .i = 0 }, .max = { .i = 30 }, .step = { .i = 1 } }, + [LVL_KEYSPD] = {.min = {.i = 10}, .max = {.i = 60}, .step = {.i = 1}}, + [LVL_CWPITCH] = {.min = {.i = 400}, .max = {.i = 1000}, .step = {.i = 50}}, + [LVL_BKIN_DLYMS] = {.min = {.i = 0}, .max = {.i = 1000}, .step = {.i = 50}}, + [LVL_SLOPE_LOW] = {.min = {.i = 0}, .max = {.i = 2400}, .step = {.i = 10}}, + [LVL_SLOPE_HIGH] = {.min = {.i = 0}, .max = {.i = 5000}, .step = {.i = 10}}, + }, + .str_cal = TS480_STR_CAL, + .swr_cal = TS480_SWR_CAL, + + .ext_tokens = ts480_ext_tokens, + .extfuncs = ts480_ext_funcs, + .extlevels = ts480_ext_levels, + + .priv = (void *)& ts480_priv_caps, + .rig_init = ts480_init, + .rig_open = kenwood_open, + .rig_cleanup = kenwood_cleanup, + .set_freq = kenwood_set_freq, + .get_freq = kenwood_get_freq, + .set_rit = ts480_set_rit, + .get_rit = ts480_get_rit, + .set_xit = ts480_set_rit, + .get_xit = ts480_get_rit, + .set_mode = kenwood_set_mode, + .get_mode = kenwood_get_mode, + .set_vfo = kenwood_set_vfo, + .get_vfo = kenwood_get_vfo_if, + .set_split_vfo = kenwood_set_split_vfo, + .get_split_vfo = kenwood_get_split_vfo_if, + .get_ptt = kenwood_get_ptt, + .set_ptt = kenwood_set_ptt, + .get_dcd = kenwood_get_dcd, + .get_info = kenwood_ts480_get_info, + .reset = kenwood_reset, + .has_set_level = TS480_LEVEL_SET, + .has_get_level = TS480_LEVEL_GET, + .set_level = kenwood_ts480_set_level, + .get_level = kenwood_ts480_get_level, + .set_ext_level = ts480_set_ext_level, + .get_ext_level = ts480_get_ext_level, + .has_get_func = TS480_FUNC_ALL, + .has_set_func = TS480_FUNC_ALL, + .set_func = ts480_set_func, + .get_func = ts480_get_func, + .set_ext_func = ts480_set_ext_func, + .get_ext_func = ts480_get_ext_func, + .send_morse = kenwood_send_morse, + .wait_morse = rig_wait_morse, + .vfo_op = kenwood_vfo_op, + .hamlib_check_rig_caps = HAMLIB_CHECK_RIG_CAPS +}; + /* * Hilberling PS8000A TS480 emulation * Notice that some rigs share the same functions. commit 96c8278d3b9f47b4a38a23f7d4b39d376dd6a08d Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Dec 30 09:37:50 2022 -0600 Update NEWS diff --git a/NEWS b/NEWS index e3da9970..d4f6fee1 100644 --- a/NEWS +++ b/NEWS @@ -23,6 +23,8 @@ Version 4.6 * Fix FTDX3000 rig split Version 4.5.3 + * Fix QRP QRDX firmware bugs in IF message so PTT works now + * FTDX5000 will now remember startup front/read settings and restore it * Fix FTDX5000 write_delay with microham * Fix grep error on MingW build commit 7898baf6ed162f4c5dbe721a32f697b71f32a782 Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Dec 29 11:36:50 2022 -0600 Allow for 36 and 37 byte IF lengths for ic10.c This should fix QRP QRDX buggy IF message -- hopefully the fix theirs to send 33 bytes. https://github.com/Hamlib/Hamlib/issues/1196#issuecomment-1367473810 diff --git a/rigs/kenwood/ic10.c b/rigs/kenwood/ic10.c index 73cd64e6..d89e7882 100644 --- a/rigs/kenwood/ic10.c +++ b/rigs/kenwood/ic10.c @@ -532,7 +532,7 @@ int ic10_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt) { struct kenwood_priv_caps *priv = (struct kenwood_priv_caps *)rig->caps->priv; char infobuf[50]; - int retval, iflen; + int retval, iflen, offset; retval = get_ic10_if(rig, infobuf); @@ -546,8 +546,15 @@ int ic10_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt) /* IFggmmmkkkhhh snnnzrx yytdfcp */ /* IFggmmmkkkhhhxxxxxrrrrrssxcctmfcp */ - - *ptt = infobuf[iflen - 5] == '0' ? RIG_PTT_OFF : RIG_PTT_ON; + /* IFggmmmkkkhhhxxxxxrrrrrssxcctmfcp#### what should be if p13/p14/p15 included */ + /* IF00014074000 +00000000003000000 ; QRP QDX bad IF command -- 36 bytes instead of 33 */ + /* QRP QDX should be 37 bytes but used only 1 byte for p14 instead of 2 bytes */ + /* 12345678901234567890123456789012345678 */ + offset = 5; + if (iflen == 36) offset = 8; // QRP QDX gets completely bogus length + else if (iflen == 37) offset = 9; // just incase somebody does this add p13/p14x2/p15 + + *ptt = infobuf[iflen - offset] == '0' ? RIG_PTT_OFF : RIG_PTT_ON; return RIG_OK; } commit 4f8c9b1f497df7fa1331ddf8b8424fa9309c63de Author: Mike Black W9MDB <mdb...@ya...> Date: Wed Dec 28 16:36:59 2022 -0600 astyle newcat.c diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index c782afa1..bf219832 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -637,11 +637,13 @@ int newcat_open(RIG *rig) SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "EX103;"); rig_debug(RIG_DEBUG_TRACE, "%s: cmd_str = %s\n", __func__, priv->cmd_str); err = newcat_get_cmd(rig); + if (RIG_OK != (err = newcat_get_cmd(rig))) { RETURNFUNC(err); } - if (priv->ret_data[6] == ';') priv->front_rear_status = priv->ret_data[5]; + + if (priv->ret_data[6] == ';') { priv->front_rear_status = priv->ret_data[5]; } } RETURNFUNC(RIG_OK); @@ -678,7 +680,8 @@ int newcat_close(RIG *rig) if (is_ftdx5000) { // Restore EX103 status - SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "EX103%c;", priv->front_rear_status); + SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "EX103%c;", + priv->front_rear_status); rig_debug(RIG_DEBUG_TRACE, "%s: cmd_str = %s\n", __func__, priv->cmd_str); newcat_set_cmd(rig); // don't care about the return } @@ -1770,6 +1773,7 @@ int newcat_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) switch (ptt) { case RIG_PTT_ON_MIC: + /* Build the command string */ // the FTDX5000 uses menu 103 for front/rear audio in USB mode if (is_ftdx5000) @@ -1779,12 +1783,14 @@ int newcat_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) rig_debug(RIG_DEBUG_TRACE, "%s: cmd_str = %s\n", __func__, priv->cmd_str); newcat_set_cmd(rig); // don't care about the return } + SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "%s", txon); rig_debug(RIG_DEBUG_TRACE, "%s: cmd_str = %s\n", __func__, priv->cmd_str); err = newcat_set_cmd(rig); break; case RIG_PTT_ON_DATA: + /* Build the command string */ // the FTDX5000 uses menu 103 for front/rear audio in USB mode if (is_ftdx5000) @@ -1794,6 +1800,7 @@ int newcat_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) rig_debug(RIG_DEBUG_TRACE, "%s: cmd_str = %s\n", __func__, priv->cmd_str); newcat_set_cmd(rig); // don't care about the return } + SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "%s", txon); rig_debug(RIG_DEBUG_TRACE, "%s: cmd_str = %s\n", __func__, priv->cmd_str); err = newcat_set_cmd(rig); commit 43e46d49c5ec10f28b97aaddf9c3b6ef2c98e703 Author: Mike Black W9MDB <mdb...@ya...> Date: Wed Dec 28 16:34:32 2022 -0600 FTDX5000 will now remember startup front/rear setting and restore it Will also allow front/rear selection in WSJT-X/JTDX https://github.com/Hamlib/Hamlib/issues/1195 diff --git a/rigs/yaesu/ft5000.c b/rigs/yaesu/ft5000.c index 06ac95eb..70aa44df 100644 --- a/rigs/yaesu/ft5000.c +++ b/rigs/yaesu/ft5000.c @@ -51,7 +51,7 @@ const struct newcat_priv_caps ftdx5000_priv_caps = { .index = 8, .set_value = 0, .get_value = '6', .width = 3000, .optional = 0 }, { .index = 9, .set_value = 0, .get_value = '9', .width = 600, .optional = 0 }, { .index = 10, .set_value = 0, .get_value = 'A', .width = 300, .optional = 0 }, - } + }, }; const struct confparams ftdx5000_ext_levels[] = @@ -140,11 +140,11 @@ const struct rig_caps ftdx5000_caps = RIG_MODEL(RIG_MODEL_FTDX5000), .model_name = "FTDX-5000", .mfg_name = "Yaesu", - .version = NEWCAT_VER ".8", + .version = NEWCAT_VER ".9", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, - .ptt_type = RIG_PTT_RIG, + .ptt_type = RIG_PTT_RIG_MICDATA, .dcd_type = RIG_DCD_NONE, .port_type = RIG_PORT_SERIAL, .serial_rate_min = 4800, /* Default rate per manual */ diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index c5f87e37..c782afa1 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -545,6 +545,7 @@ int newcat_open(RIG *rig) struct newcat_priv_data *priv = rig->state.priv; struct rig_state *rig_s = &rig->state; const char *handshake[3] = {"None", "Xon/Xoff", "Hardware"}; + int err; ENTERFUNC; @@ -600,7 +601,6 @@ int newcat_open(RIG *rig) || priv->rig_id == NC_RIGID_FTDX3000 || priv->rig_id == NC_RIGID_FTDX3000DM) { - int err; char *cmd = "EX0291;EX029;"; // FT2000/D if (priv->rig_id == NC_RIGID_FT950 || rig->caps->rig_model == RIG_MODEL_FT950) { cmd = "EX0271;EX027;"; } @@ -631,6 +631,19 @@ int newcat_open(RIG *rig) rig_debug(RIG_DEBUG_VERBOSE, "%s: disabling FTDX3000 band select\n", __func__); } + if (is_ftdx5000) + { + // Remember EX103 status + SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "EX103;"); + rig_debug(RIG_DEBUG_TRACE, "%s: cmd_str = %s\n", __func__, priv->cmd_str); + err = newcat_get_cmd(rig); + if (RIG_OK != (err = newcat_get_cmd(rig))) + { + RETURNFUNC(err); + } + if (priv->ret_data[6] == ';') priv->front_rear_status = priv->ret_data[5]; + } + RETURNFUNC(RIG_OK); } @@ -664,8 +677,8 @@ int newcat_close(RIG *rig) if (is_ftdx5000) { - // Ensure FT5000 is back to MIC input - SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "EX1030;"); + // Restore EX103 status + SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "EX103%c;", priv->front_rear_status); rig_debug(RIG_DEBUG_TRACE, "%s: cmd_str = %s\n", __func__, priv->cmd_str); newcat_set_cmd(rig); // don't care about the return } @@ -1757,13 +1770,21 @@ int newcat_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) switch (ptt) { case RIG_PTT_ON_MIC: + /* Build the command string */ + // the FTDX5000 uses menu 103 for front/rear audio in USB mode + if (is_ftdx5000) + { + // Ensure FT5000 is back to MIC input + SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "EX1030;"); + rig_debug(RIG_DEBUG_TRACE, "%s: cmd_str = %s\n", __func__, priv->cmd_str); + newcat_set_cmd(rig); // don't care about the return + } + SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "%s", txon); + rig_debug(RIG_DEBUG_TRACE, "%s: cmd_str = %s\n", __func__, priv->cmd_str); + err = newcat_set_cmd(rig); break; case RIG_PTT_ON_DATA: - break; - - case RIG_PTT_ON: - /* Build the command string */ // the FTDX5000 uses menu 103 for front/rear audio in USB mode if (is_ftdx5000) @@ -1776,6 +1797,12 @@ int newcat_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "%s", txon); rig_debug(RIG_DEBUG_TRACE, "%s: cmd_str = %s\n", __func__, priv->cmd_str); err = newcat_set_cmd(rig); + break; + + case RIG_PTT_ON: + SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "%s", txon); + rig_debug(RIG_DEBUG_TRACE, "%s: cmd_str = %s\n", __func__, priv->cmd_str); + err = newcat_set_cmd(rig); break; diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h index 11051545..914c535f 100644 --- a/rigs/yaesu/newcat.h +++ b/rigs/yaesu/newcat.h @@ -128,6 +128,7 @@ struct newcat_priv_data char last_if_response[NEWCAT_DATA_LEN]; int poweron; /* to prevent powering on more than once */ int question_mark_response_means_rejected; /* the question mark response has multiple meanings */ + char front_rear_status; /* e.g. FTDX5000 EX103 status */ }; /* diff --git a/simulators/simftdx5000.c b/simulators/simftdx5000.c index 4b435257..e8ce7d1d 100644 --- a/simulators/simftdx5000.c +++ b/simulators/simftdx5000.c @@ -22,6 +22,7 @@ int ai = 0; int sh = 25; int na = 0; int ex039 = 0; +int ex103 = 0; // ID 0310 == 310, Must drop leading zero typedef enum nc_rigid_e @@ -316,6 +317,20 @@ int main(int argc, char *argv[]) { sscanf(buf, "EX039%d", &ex039); } + else if (strcmp(buf, "EX103;") == 0) + { + SNPRINTF(buf, sizeof(buf), "EX103%d;", ex103); + n = write(fd, buf, strlen(buf)); + } + else if (strncmp(buf, "EX103", 3) == 0) + { + sscanf(buf, "EX103%d", &ex103); + } + else if (strcmp(buf, "PS;") == 0) + { + SNPRINTF(buf, sizeof(buf), "PS1;"); + n = write(fd, buf, strlen(buf)); + } else if (strlen(buf) > 0) { fprintf(stderr, "Unknown command: %s\n", buf); commit ba079fe7f05306ef0a001048fecf2f6c65cb42a0 Author: Mike Black W9MDB <mdb...@ya...> Date: Wed Dec 28 14:27:05 2022 -0600 Make FT5000 EX1031;TX1; command two commands https://github.com/Hamlib/Hamlib/issues/1193 diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 019f10e1..c5f87e37 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -1769,17 +1769,13 @@ int newcat_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) if (is_ftdx5000) { // Ensure FT5000 is back to MIC input - SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "EX1031;%s", txon); + SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "EX1031;"); rig_debug(RIG_DEBUG_TRACE, "%s: cmd_str = %s\n", __func__, priv->cmd_str); newcat_set_cmd(rig); // don't care about the return } - else - { - SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "%s", txon); - rig_debug(RIG_DEBUG_TRACE, "%s: cmd_str = %s\n", __func__, priv->cmd_str); - err = newcat_set_cmd(rig); - } - + SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "%s", txon); + rig_debug(RIG_DEBUG_TRACE, "%s: cmd_str = %s\n", __func__, priv->cmd_str); + err = newcat_set_cmd(rig); break; commit 9ad6f24089d124a30efc2efec805c0a74a0670b4 Author: Mike Black W9MDB <mdb...@ya...> Date: Wed Dec 28 14:11:25 2022 -0600 Make sure FT5000 is in data mode for PTT request -- returns to MIC mode on shutdown https://github.com/Hamlib/Hamlib/issues/1193 diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 9bff762a..019f10e1 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -1741,7 +1741,7 @@ int newcat_get_vfo(RIG *rig, vfo_t *vfo) int newcat_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) { struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; - int err; + int err = -RIG_EPROTO; char txon[] = "TX1;"; char txoff[] = "TX0;"; @@ -1756,24 +1756,31 @@ int newcat_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) switch (ptt) { - // the FTDX5000 uses menu 103 for front/rear audio in USB mode case RIG_PTT_ON_MIC: - SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "EX1030;"); - rig_debug(RIG_DEBUG_TRACE, "%s: cmd_str = %s\n", __func__, priv->cmd_str); - err = newcat_set_cmd(rig); break; case RIG_PTT_ON_DATA: - SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "EX1031;"); - rig_debug(RIG_DEBUG_TRACE, "%s: cmd_str = %s\n", __func__, priv->cmd_str); - err = newcat_set_cmd(rig); break; case RIG_PTT_ON: + /* Build the command string */ - SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "%s", txon); - rig_debug(RIG_DEBUG_TRACE, "%s: cmd_str = %s\n", __func__, priv->cmd_str); - err = newcat_set_cmd(rig); + // the FTDX5000 uses menu 103 for front/rear audio in USB mode + if (is_ftdx5000) + { + // Ensure FT5000 is back to MIC input + SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "EX1031;%s", txon); + rig_debug(RIG_DEBUG_TRACE, "%s: cmd_str = %s\n", __func__, priv->cmd_str); + newcat_set_cmd(rig); // don't care about the return + } + else + { + SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "%s", txon); + rig_debug(RIG_DEBUG_TRACE, "%s: cmd_str = %s\n", __func__, priv->cmd_str); + err = newcat_set_cmd(rig); + } + + break; case RIG_PTT_OFF: diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h index a0be7487..11051545 100644 --- a/rigs/yaesu/newcat.h +++ b/rigs/yaesu/newcat.h @@ -50,7 +50,7 @@ typedef char ncboolean; /* shared function version */ -#define NEWCAT_VER "20221223" +#define NEWCAT_VER "20221228" /* Hopefully large enough for future use, 128 chars plus '\0' */ #define NEWCAT_DATA_LEN 129 commit 35946f5d6b96f6f5866d54d87281731e12389599 Author: Mike Black W9MDB <mdb...@ya...> Date: Wed Dec 28 12:41:39 2022 -0600 FT5000 cannot use RIG_PTT_ON_DATA/MIC menu 103 control and is now set for rear automatically too https://github.com/Hamlib/Hamlib/issues/1193 diff --git a/rigs/yaesu/ft5000.c b/rigs/yaesu/ft5000.c index cd1ebfb9..06ac95eb 100644 --- a/rigs/yaesu/ft5000.c +++ b/rigs/yaesu/ft5000.c @@ -140,11 +140,11 @@ const struct rig_caps ftdx5000_caps = RIG_MODEL(RIG_MODEL_FTDX5000), .model_name = "FTDX-5000", .mfg_name = "Yaesu", - .version = NEWCAT_VER ".7", + .version = NEWCAT_VER ".8", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, - .ptt_type = RIG_PTT_RIG_MICDATA, + .ptt_type = RIG_PTT_RIG, .dcd_type = RIG_DCD_NONE, .port_type = RIG_PORT_SERIAL, .serial_rate_min = 4800, /* Default rate per manual */ commit fcffad9ff2df583d89f2bf60131dfc0d6bd9e85d Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Dec 26 10:25:06 2022 -0600 Update NEWS diff --git a/NEWS b/NEWS index 43c762c5..e3da9970 100644 --- a/NEWS +++ b/NEWS @@ -23,6 +23,7 @@ Version 4.6 * Fix FTDX3000 rig split Version 4.5.3 + * Fix FTDX5000 write_delay with microham * Fix grep error on MingW build Version 4.5.2 commit a3fecb63a28b9519cf7ccd1885babdac008c87d6 Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Dec 26 10:23:44 2022 -0600 Change FTDX5000 write_delay to zero -- was causing microham to return ?; to every command https://github.com/Hamlib/Hamlib/issues/1080 diff --git a/rigs/yaesu/ft5000.h b/rigs/yaesu/ft5000.h index cecd304f..becd0c14 100644 --- a/rigs/yaesu/ft5000.h +++ b/rigs/yaesu/ft5000.h @@ -141,7 +141,7 @@ /* Delay between bytes sent to FT-5000 * Should not exceed value set in CAT TOT menu (rig default is 10 mSec) */ -#define FTDX5000_WRITE_DELAY 1 +#define FTDX5000_WRITE_DELAY 0 /* Delay sequential fast writes */ commit 5b46a408f3ea193a4fffb66d70c82eff2fc5a102 Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Dec 24 14:03:18 2022 -0600 Update NEWS diff --git a/NEWS b/NEWS index 6eba3a94..43c762c5 100644 --- a/NEWS +++ b/NEWS @@ -22,6 +22,9 @@ Version 4.6 * Add FLIR PTU-D48, E46, D100, D300 rotors * Fix FTDX3000 rig split +Version 4.5.3 + * Fix grep error on MingW build + Version 4.5.2 * 2022-12-23 * Fix PowerSDR ability to do commands while powered off commit 16e55b604707ec7f0222efb451d3c62f8d1824d9 Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Dec 24 11:28:11 2022 -0600 Fix grep error on mingw build diff --git a/src/Makefile.am b/src/Makefile.am index fe4431de..751dc984 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -30,9 +30,10 @@ EXTRA_DIST = Android.mk hamlibdatetime.h.in # directory before the source directory for the hamlibdatetime.h # header. hamlibdatetime.h: FORCE + echo "#define HAMLIBDATETIME "\"$$(TZ=UTC git --git-dir=$(top_srcdir)/.git log --no-merges --date='format-local:%b %d %H:%M:%SZ %Y SHA=' --format='%cd' -n 1)$$(git --git-dir=$(top_srcdir)/.git log --no-merges -n 1 | cut -c8-13)\" @if test -x $(top_srcdir)/.git ; then \ echo "/* This date time is from the last non-merge commit to Hamlib. */" > $(builddir)/$(@F).tmp ;\ - echo "#define HAMLIBDATETIME "\"$$(TZ=UTC git --git-dir=$(top_srcdir)/.git log --no-merges --date='format-local:%a %b %d %H:%M:%S %Y %z SHA=' --format='%cd' -n 1)$$(git --git-dir=$(top_srcdir)/.git log --no-merges | grep commit | head -n 1 | cut -c8-13)\" >> $(builddir)/$(@F).tmp ;\ + echo "#define HAMLIBDATETIME "\"$$(TZ=UTC git --git-dir=$(top_srcdir)/.git log --no-merges --date='format-local:%b %d %H:%M:%SZ %Y SHA=' --format='%cd' -n 1)$$(git --git-dir=$(top_srcdir)/.git log --no-merges -n 1 | head -n 1 | cut -c8-13)\" >> $(builddir)/$(@F).tmp ;\ diff -qN $(builddir)/$(@F).tmp $(builddir)/$(@F) ; test $$? -eq 0 || { echo "Generating SCS header \"$(builddir)/$(@F)\"" ; mv -f $(builddir)/$(@F).tmp $(builddir)/$(@F) ; } ;\ rm -f $(builddir)/$(@F).tmp ;\ else \ ----------------------------------------------------------------------- hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: n0nb <n0...@us...> - 2022-12-24 17:25:55
|
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 annotated tag, 4.5.2 has been created at 062c8c1c6556887813beb043ff0ea557cf6a3fb4 (tag) tagging f12ac6279b421ea12a4440c5b1a3caddfc183916 (commit) replaces 4.5.1 tagged by Nate Bargmann on Sat Dec 24 11:23:22 2022 -0600 - Log ----------------------------------------------------------------- Hamlib 4.5.2 release -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQSC1k9rDmfNQfaJu6b7LFEw1VqIGQUCY6c1swAKCRD7LFEw1VqI GazOAJwLkYXCDjrqlCuoSiRsnES1hqaohQCbBUPlsEU9DsmXoYiBry2vK7Upx1Y= =1zi6 -----END PGP SIGNATURE----- Mike Black W9MDB (34): Update simftdx3000.c Hamlib-4.5.2 bug fixes Add --disable-parallel configure option https://github.com/Hamlib/Hamlib/issues/1181 Fix rigctld segfault when using -P RTS https://github.com/Hamlib/Hamlib/issues/1182 astyle newcat.c Add FTDX1200 to rigs that need to ensure PTT is off before changing frequency https://github.com/Hamlib/Hamlib/issues/1185 Update simftdx1200.c If get_powerstat fails assume rig is powered on -- should fix sdr++ problem https://github.com/Hamlib/Hamlib/issues/1186 Allow rigctld to close the rig with the -R option when client disconnects. This makes it close when any one client disconnects. Should only close when no clients are connected -- that will be the next patch This is for the FT736R and gpredict https://github.com/Hamlib/Hamlib/issues/1187 -R option will keep rig open as long as 1 or more clients are connected https://github.com/Hamlib/Hamlib/issues/1187 Update NEWS Update NEWS If get_powerstat fails in any way then always return RIG_POWER_ON https://github.com/Hamlib/Hamlib/issues/1189 If get_powerstat fails assume rig is powered on -- should fix sdr++ problem https://github.com/Hamlib/Hamlib/issues/1186 Add get_freq cached for FT736R to allow working with gpredict https://github.com/Hamlib/Hamlib/issues/1187 Update NEWS Update NEWS Update NEWS Fix kenwood_ts890_get_level -- thanks to N3GB George Baltz Update NEWS Update NEWS FT-736 did not have get_mode so only call get_mode when available https://github.com/Hamlib/Hamlib/issues/1187 Do not reset cache for unidirectional rigs https://github.com/Hamlib/Hamlib/issues/1187 FT-736 did not have get_mode so only call get_mode when available https://github.com/Hamlib/Hamlib/issues/1187 Reset rig->state.cache.split so it can be set again when rigctld reopens the rig https://github.com/Hamlib/Hamlib/issues/1187 Ensure get_powerstat return RIG_OK when rig does not have get_powerstat https://github.com/Hamlib/Hamlib/issues/1189 Fix unidirectional rig cached frequency (e.g. FT736R) https://github.com/Hamlib/Hamlib/issues/1187 Change TX-500 to only have 9600 baud available https://github.com/Hamlib/Hamlib/issues/1188 Allow POWERSDR to do commands when powered off Remove powerstat from TX-500 -- was always responding PS0; https://github.com/Hamlib/Hamlib/issues/1188 Update NEWS Make FTDX5000 return to MIC input on closing https://github.com/Hamlib/Hamlib/issues/1193 Update NEWS Update NEWS Nate Bargmann (1): Quell groff warning of "font p not found". PianetaRadio (4): Update prosistel.c Update prosistel.h Update prosistel.c Update rotlist.h ----------------------------------------------------------------------- hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: n0nb <n0...@us...> - 2022-12-24 17:25:42
|
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.5.2 has been created at f12ac6279b421ea12a4440c5b1a3caddfc183916 (commit) - Log ----------------------------------------------------------------- commit f12ac6279b421ea12a4440c5b1a3caddfc183916 Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Dec 23 17:04:12 2022 -0600 Update NEWS diff --git a/NEWS b/NEWS index 38f6f3e7..6eba3a94 100644 --- a/NEWS +++ b/NEWS @@ -14,16 +14,22 @@ Version 5.x -- future Version 4.6 * 2023-11-XX -- Planned for Nov 2023 + * Add --set-conf=tuner_control_pathname=hamlib_tuner_control (default) + If file exists then it will be called with 0/1 (Off/On) argument + with 'U TUNER 0' or 'U TUNER 1" + Default path is for current directory * Add MDS 4710/9710 rigs + * Add FLIR PTU-D48, E46, D100, D300 rotors + * Fix FTDX3000 rig split Version 4.5.2 + * 2022-12-23 * Fix PowerSDR ability to do commands while powered off * Fix TX-500 operations * Fix FTDX5000 to return to MIC input on closing * Fix rig.c calling rig_get_mode when backend does not have get_mode * Fix kenwood_ts890_get_level * Add Prosistel D elevation CBOX az to fix problem with azimuth control - * 2022-12-XX -- Planned for Dec 2022 * Fix FT736R gpredict usage by adding cached get_freq * Fix get_powerstat problem with Log4OM/Flex and others * Fix -R option to not need argument @@ -34,7 +40,7 @@ Version 4.5.2 Version 4.5.1 * 2022-12-08 * FT2000, FTDX3000/D, FT891, FT991, FT950, FTDX5000 now set CAT TOT to 100ms - * Add missing NB2 setting to FT-950, FTDX-1200, FTDX-3000, FTDX-5000, FTDX-9000 + * Add missing NB2 setting to FT-950, FTDX-1200, FT-2000, FTDX-3000, FTDX-5000, FTDX-9000 * Add missing meter reading to TS-890S -- thanks to Geore Baltz N3GB * Fix FT736 VFOB freq and mode set * Added send_raw to rigctl -- see rigctl man page commit ad511c496efd6965052966448f0dcd67c58d43de Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Dec 23 16:53:18 2022 -0600 Update NEWS diff --git a/NEWS b/NEWS index 82344221..38f6f3e7 100644 --- a/NEWS +++ b/NEWS @@ -19,6 +19,7 @@ Version 4.6 Version 4.5.2 * Fix PowerSDR ability to do commands while powered off * Fix TX-500 operations + * Fix FTDX5000 to return to MIC input on closing * Fix rig.c calling rig_get_mode when backend does not have get_mode * Fix kenwood_ts890_get_level * Add Prosistel D elevation CBOX az to fix problem with azimuth control commit ee96efd5bca8b5bda03a98438ad28fed805bfe32 Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Dec 23 16:49:45 2022 -0600 Make FTDX5000 return to MIC input on closing https://github.com/Hamlib/Hamlib/issues/1193 diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index fda8aa01..9bff762a 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -662,6 +662,14 @@ int newcat_close(RIG *rig) priv->poweron = 0; } + if (is_ftdx5000) + { + // Ensure FT5000 is back to MIC input + SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "EX1030;"); + rig_debug(RIG_DEBUG_TRACE, "%s: cmd_str = %s\n", __func__, priv->cmd_str); + newcat_set_cmd(rig); // don't care about the return + } + RETURNFUNC(RIG_OK); } diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h index c45a4d9d..a0be7487 100644 --- a/rigs/yaesu/newcat.h +++ b/rigs/yaesu/newcat.h @@ -50,7 +50,7 @@ typedef char ncboolean; /* shared function version */ -#define NEWCAT_VER "20221211" +#define NEWCAT_VER "20221223" /* Hopefully large enough for future use, 128 chars plus '\0' */ #define NEWCAT_DATA_LEN 129 commit 289788bae98f02d81a6afb1fc2fdb683f72302a3 Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Dec 20 08:50:32 2022 -0600 Update NEWS diff --git a/NEWS b/NEWS index 908ad034..82344221 100644 --- a/NEWS +++ b/NEWS @@ -17,6 +17,8 @@ Version 4.6 * Add MDS 4710/9710 rigs Version 4.5.2 + * Fix PowerSDR ability to do commands while powered off + * Fix TX-500 operations * Fix rig.c calling rig_get_mode when backend does not have get_mode * Fix kenwood_ts890_get_level * Add Prosistel D elevation CBOX az to fix problem with azimuth control commit 0d2fd757bf91476f98cfe47c61d3785d16b40887 Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Dec 19 14:55:14 2022 -0600 Remove powerstat from TX-500 -- was always responding PS0; https://github.com/Hamlib/Hamlib/issues/1188 diff --git a/rigs/kenwood/tx500.c b/rigs/kenwood/tx500.c index 5f2c4f5c..6edeffdc 100644 --- a/rigs/kenwood/tx500.c +++ b/rigs/kenwood/tx500.c @@ -318,8 +318,8 @@ const struct rig_caps tx500_caps = .set_channel = ts2000_set_channel, .set_trn = kenwood_set_trn, .get_trn = kenwood_get_trn, - .set_powerstat = kenwood_set_powerstat, - .get_powerstat = kenwood_get_powerstat, + //.set_powerstat = kenwood_set_powerstat, + //.get_powerstat = kenwood_get_powerstat, .get_info = kenwood_get_info, .reset = kenwood_reset, .hamlib_check_rig_caps = HAMLIB_CHECK_RIG_CAPS commit fef4c674a10242271c896be61e775a686a96688c Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Dec 19 16:58:44 2022 -0600 Allow POWERSDR to do commands when powered off diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c index 6cb82915..1b356aac 100644 --- a/tests/rigctl_parse.c +++ b/tests/rigctl_parse.c @@ -1752,7 +1752,8 @@ readline_repeat: && cmd_entry->cmd != '3' // dump_conf && cmd_entry->cmd != 0x8f // dump_state && cmd_entry->cmd != 0xf0 // chk_vfo - && cmd_entry->cmd != 0x87) // set_powerstat + && cmd_entry->cmd != 0x87 // set_powerstat + && my_rig->caps->rig_model != RIG_MODEL_POWERSDR) // some rigs can do stuff when powered off { rig_debug(RIG_DEBUG_WARN, "%s: command %s not allowed when rig is powered off\n", __func__, commit b041a7f6075cc3c6594800ad78794ab7ed5f8754 Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Dec 20 08:29:12 2022 -0600 Change TX-500 to only have 9600 baud available https://github.com/Hamlib/Hamlib/issues/1188 diff --git a/rigs/kenwood/tx500.c b/rigs/kenwood/tx500.c index d5cb6398..5f2c4f5c 100644 --- a/rigs/kenwood/tx500.c +++ b/rigs/kenwood/tx500.c @@ -127,15 +127,15 @@ const struct rig_caps tx500_caps = RIG_MODEL(RIG_MODEL_LAB599_TX500), .model_name = "TX-500", .mfg_name = "Lab599", - .version = BACKEND_VER ".1", + .version = BACKEND_VER ".3", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, .ptt_type = RIG_PTT_RIG, .dcd_type = RIG_DCD_RIG, .port_type = RIG_PORT_SERIAL, - .serial_rate_min = 1200, - .serial_rate_max = 57600, + .serial_rate_min = 9600, + .serial_rate_max = 9600, .serial_data_bits = 8, .serial_stop_bits = 1, .serial_parity = RIG_PARITY_NONE, commit ac882ee896afff59ebc54e4fafc26dd0466c65b1 Author: Mike Black W9MDB <mdb...@ya...> Date: Sun Dec 18 09:01:27 2022 -0600 Fix unidirectional rig cached frequency (e.g. FT736R) https://github.com/Hamlib/Hamlib/issues/1187 diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h index 066db187..b9e90cd5 100644 --- a/include/hamlib/rig.h +++ b/include/hamlib/rig.h @@ -3396,6 +3396,7 @@ extern HAMLIB_EXPORT(int) rig_set_vfo_opt(RIG *rig, int status); extern HAMLIB_EXPORT(int) rig_get_vfo_info(RIG *rig, vfo_t vfo, freq_t *freq, rmode_t *mode, pbwidth_t *width, split_t *split, int *satmode); extern HAMLIB_EXPORT(int) rig_get_rig_info(RIG *rig, char *response, int max_response_len); extern HAMLIB_EXPORT(int) rig_get_cache(RIG *rig, vfo_t vfo, freq_t *freq, int * cache_ms_freq, rmode_t *mode, int *cache_ms_mode, pbwidth_t *width, int *cache_ms_width); +extern HAMLIB_EXPORT(int) rig_get_cache_freq(RIG *rig, vfo_t vfo, freq_t *freq, int * cache_ms_freq); extern HAMLIB_EXPORT(int) rig_set_clock(RIG *rig, int year, int month, int day, int hour, int min, int sec, double msec, int utc_offset); extern HAMLIB_EXPORT(int) rig_get_clock(RIG *rig, int *year, int *month, int *day, int *hour, int *min, int *sec, double *msec, int *utc_offset); diff --git a/rigs/yaesu/ft736.c b/rigs/yaesu/ft736.c index 52cd85fc..8858512f 100644 --- a/rigs/yaesu/ft736.c +++ b/rigs/yaesu/ft736.c @@ -31,6 +31,7 @@ #include "misc.h" #include "yaesu.h" #include "tones.h" +#include "cache.h" @@ -99,7 +100,7 @@ const struct rig_caps ft736_caps = RIG_MODEL(RIG_MODEL_FT736R), .model_name = "FT-736R", .mfg_name = "Yaesu", - .version = "20221214.0", + .version = "20221218.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -270,6 +271,7 @@ int ft736_set_freq(RIG *rig, vfo_t vfo, freq_t freq) { unsigned char cmd[YAESU_CMD_LENGTH] = { 0x00, 0x00, 0x00, 0x00, 0x01}; struct ft736_priv_data *priv = (struct ft736_priv_data *)rig->state.priv; + int retval; // we will assume requesting to set VFOB is split mode if (vfo == RIG_VFO_B) { return rig_set_split_freq(rig, vfo, freq); } @@ -288,8 +290,11 @@ int ft736_set_freq(RIG *rig, vfo_t vfo, freq_t freq) cmd[0] = (cmd[0] & 0x0f) | 0xc0; } - /* Frequency set */ - return write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH); + retval = write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH); + + if (retval == RIG_OK) { rig_set_cache_freq(rig, vfo, freq); } + + return retval; } int ft736_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) @@ -297,7 +302,7 @@ int ft736_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) rig_debug(RIG_DEBUG_VERBOSE, "%s: called\n", __func__); if (vfo == RIG_VFO_A || vfo == RIG_VFO_MAIN) { *freq = rig->state.cache.freqMainA; } - else { *freq = rig->state.cache.freqMainB; } + else { rig_get_cache_freq(rig, vfo, freq, NULL); } return RIG_OK; } diff --git a/src/cache.c b/src/cache.c index 7bdafbfa..b912bdee 100644 --- a/src/cache.c +++ b/src/cache.c @@ -442,6 +442,41 @@ int rig_get_cache(RIG *rig, vfo_t vfo, freq_t *freq, int *cache_ms_freq, return RIG_OK; } +/** + * \brief get cached values for a VFO + * \param rig The rig handle + * \param vfo The VFO to get information from + * \param freq The frequency is stored here + * \param cache_ms_freq The age of the last frequency update in ms -- NULL if you don't want it + + * Use this to query the frequency cache and then determine to actually fetch data from + * the rig. + * + * \return RIG_OK if the operation has been successful, otherwise + * a negative value if an error occurred (in which case, cause is + * set appropriately). + * + */ +int rig_get_cache_freq(RIG *rig, vfo_t vfo, freq_t *freq, int *cache_ms_freq_p) +{ + rmode_t mode; + int cache_ms_freq; + int cache_ms_mode; + pbwidth_t width; + int cache_ms_width; + int retval; + retval = rig_get_cache(rig, vfo, freq, &cache_ms_freq, &mode, &cache_ms_mode, + &width, &cache_ms_width); + + if (retval == RIG_OK) + { + if (cache_ms_freq_p) { *cache_ms_freq_p = cache_ms_freq; } + } + + return retval; +} + + void rig_cache_show(RIG *rig, const char *func, int line) { rig_debug(RIG_DEBUG_CACHE, diff --git a/src/rig.c b/src/rig.c index 5523ef42..b42cf331 100644 --- a/src/rig.c +++ b/src/rig.c @@ -1808,7 +1808,11 @@ int HAMLIB_API rig_set_freq(RIG *rig, vfo_t vfo, freq_t freq) if (retcode != RIG_OK) { RETURNFUNC(retcode); } - rig_set_cache_freq(rig, vfo, (freq_t)0); + // Unidirectional rigs do not reset cache + if (rig->caps->rig_model != RIG_MODEL_FT736R) + { + rig_set_cache_freq(rig, vfo, (freq_t)0); + } #if 0 // this verification seems to be causing bad behavior on some rigs commit ce8f50d04ccfb2760482f4e40b8a3f6fb724d4b5 Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Dec 17 17:23:52 2022 -0600 Ensure get_powerstat return RIG_OK when rig does not have get_powerstat https://github.com/Hamlib/Hamlib/issues/1189 diff --git a/src/rig.c b/src/rig.c index c50f047a..5523ef42 100644 --- a/src/rig.c +++ b/src/rig.c @@ -6032,7 +6032,7 @@ 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); + RETURNFUNC(RIG_OK); } *status = RIG_POWER_OFF; // default now to power off until proven otherwise in get_powerstat commit 701a53ce2339598744a5a9739d400525610cec11 Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Dec 17 10:35:56 2022 -0600 Reset rig->state.cache.split so it can be set again when rigctld reopens the rig https://github.com/Hamlib/Hamlib/issues/1187 diff --git a/src/rig.c b/src/rig.c index 5ffaa221..c50f047a 100644 --- a/src/rig.c +++ b/src/rig.c @@ -1520,6 +1520,8 @@ int HAMLIB_API rig_close(RIG *rig) remove_opened_rig(rig); + // zero split so it will allow it to be set again on open for rigctld + rig->state.cache.split = 0; rs->comm_state = 0; rig_debug(RIG_DEBUG_VERBOSE, "%s(%d): %p rs->comm_state==0?=%d\n", __func__, __LINE__, &rs->comm_state, commit baaf214f9ca759d267b2f47fa4b92e6e50c6f189 Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Dec 17 09:59:04 2022 -0600 FT-736 did not have get_mode so only call get_mode when available https://github.com/Hamlib/Hamlib/issues/1187 commit 777a40216e7ffcb82b206bde626cf0b117547188 Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Dec 17 10:19:46 2022 -0600 Do not reset cache for unidirectional rigs https://github.com/Hamlib/Hamlib/issues/1187 diff --git a/src/rig.c b/src/rig.c index b1533efc..5ffaa221 100644 --- a/src/rig.c +++ b/src/rig.c @@ -1897,7 +1897,12 @@ int HAMLIB_API rig_set_freq(RIG *rig, vfo_t vfo, freq_t freq) #endif ) { - rig_set_cache_freq(rig, RIG_VFO_ALL, (freq_t)0); + // Unidirectional rigs do not reset cache + if (rig->caps->rig_model != RIG_MODEL_FT736R) + { + rig_set_cache_freq(rig, RIG_VFO_ALL, (freq_t)0); + } + HAMLIB_TRACE; retcode = rig_get_freq(rig, vfo, &freq_new); commit 7a3600295f4359d3323332a1a62d72e35abcf604 Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Dec 17 09:59:04 2022 -0600 FT-736 did not have get_mode so only call get_mode when available https://github.com/Hamlib/Hamlib/issues/1187 diff --git a/src/rig.c b/src/rig.c index 7c8b326f..b1533efc 100644 --- a/src/rig.c +++ b/src/rig.c @@ -1346,14 +1346,18 @@ int HAMLIB_API rig_open(RIG *rig) rig_debug(RIG_DEBUG_VERBOSE, "%s(%d): Current split=%d, tx_vfo=%s\n", __func__, __LINE__, split, rig_strvfo(tx_vfo)); rmode_t mode; - pbwidth_t width; - rig_get_mode(rig, RIG_VFO_A, &mode, &width); + pbwidth_t width = 2400; // we'll use 2400Hz as default width - if (split) + if (rig->caps->get_mode) { - rig_debug(RIG_DEBUG_VERBOSE, "xxxsplit=%d\n", split); - HAMLIB_TRACE; - rig_get_mode(rig, RIG_VFO_B, &mode, &width); + rig_get_mode(rig, RIG_VFO_A, &mode, &width); + + if (split) + { + rig_debug(RIG_DEBUG_VERBOSE, "xxxsplit=%d\n", split); + HAMLIB_TRACE; + rig_get_mode(rig, RIG_VFO_B, &mode, &width); + } } } } @@ -2892,8 +2896,9 @@ int HAMLIB_API rig_get_vfo(RIG *rig, vfo_t *vfo) if (cache_ms < rig->state.cache.timeout_ms) { - rig_debug(RIG_DEBUG_TRACE, "%s: cache hit age=%dms\n", __func__, cache_ms); *vfo = rig->state.cache.vfo; + rig_debug(RIG_DEBUG_TRACE, "%s: cache hit age=%dms, vfo=%s\n", __func__, + cache_ms, rig_strvfo(*vfo)); ELAPSED2; RETURNFUNC(RIG_OK); } commit 3b8bc150d12f5f56e3ebb05c588d6aa022528934 Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Dec 17 10:00:07 2022 -0600 Update NEWS diff --git a/NEWS b/NEWS index 6b8bc4fe..908ad034 100644 --- a/NEWS +++ b/NEWS @@ -17,6 +17,7 @@ Version 4.6 * Add MDS 4710/9710 rigs Version 4.5.2 + * Fix rig.c calling rig_get_mode when backend does not have get_mode * Fix kenwood_ts890_get_level * Add Prosistel D elevation CBOX az to fix problem with azimuth control * 2022-12-XX -- Planned for Dec 2022 commit b35dc746cc728477a3c769ccffb6729e331ee553 Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Dec 15 17:14:00 2022 -0600 Update NEWS diff --git a/NEWS b/NEWS index 026f9410..6b8bc4fe 100644 --- a/NEWS +++ b/NEWS @@ -17,6 +17,7 @@ Version 4.6 * Add MDS 4710/9710 rigs Version 4.5.2 + * Fix kenwood_ts890_get_level * Add Prosistel D elevation CBOX az to fix problem with azimuth control * 2022-12-XX -- Planned for Dec 2022 * Fix FT736R gpredict usage by adding cached get_freq commit 9f67561d230133dbc7154ae16742e209c69a36e3 Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Dec 15 17:11:08 2022 -0600 Fix kenwood_ts890_get_level -- thanks to N3GB George Baltz diff --git a/rigs/kenwood/ts890s.c b/rigs/kenwood/ts890s.c index 9c23b131..dc2781b9 100644 --- a/rigs/kenwood/ts890s.c +++ b/rigs/kenwood/ts890s.c @@ -305,7 +305,7 @@ int kenwood_ts890_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) if (rig->caps->swr_cal.size) { - val->f = rig_raw2val_float(val->i, &rig->caps->swr_cal); + val->f = rig_raw2val_float(levelint, &rig->caps->swr_cal); } else { @@ -432,7 +432,7 @@ const struct rig_caps ts890s_caps = RIG_MODEL(RIG_MODEL_TS890S), .model_name = "TS-890S", .mfg_name = "Kenwood", - .version = BACKEND_VER ".9", + .version = BACKEND_VER ".10", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, commit 2d226f446485b8fc4da22a32fb595d5af47e1fff Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Dec 15 12:04:14 2022 -0600 Update NEWS diff --git a/NEWS b/NEWS index c717fd69..026f9410 100644 --- a/NEWS +++ b/NEWS @@ -17,6 +17,7 @@ Version 4.6 * Add MDS 4710/9710 rigs Version 4.5.2 + * Add Prosistel D elevation CBOX az to fix problem with azimuth control * 2022-12-XX -- Planned for Dec 2022 * Fix FT736R gpredict usage by adding cached get_freq * Fix get_powerstat problem with Log4OM/Flex and others commit d31d651de55797c298a4808ee19f00a57bce604c Author: PianetaRadio <789...@us...> Date: Thu Dec 15 18:24:55 2022 +0100 Update rotlist.h Add Elevation rotator with Control box responding to azimuth logic diff --git a/include/hamlib/rotlist.h b/include/hamlib/rotlist.h index 744c716c..62d64ffe 100644 --- a/include/hamlib/rotlist.h +++ b/include/hamlib/rotlist.h @@ -557,6 +557,7 @@ #define ROT_MODEL_PROSISTEL_D_AZ ROT_MAKE_MODEL(ROT_PROSISTEL, 1) #define ROT_MODEL_PROSISTEL_D_EL ROT_MAKE_MODEL(ROT_PROSISTEL, 2) #define ROT_MODEL_PROSISTEL_COMBI_TRACK_AZEL ROT_MAKE_MODEL(ROT_PROSISTEL, 3) +#define ROT_MODEL_PROSISTEL_D_EL_CBOXAZ ROT_MAKE_MODEL(ROT_PROSISTEL, 4) /** commit bc7e88dd9d0f93a8eece5d2c9ea4122114f8ce2f Author: PianetaRadio <789...@us...> Date: Thu Dec 15 18:21:23 2022 +0100 Update prosistel.c Add Elevation rotator with Control box responding to azimuth logic diff --git a/rotators/prosistel/prosistel.c b/rotators/prosistel/prosistel.c index 1ab58602..76a2a37f 100644 --- a/rotators/prosistel/prosistel.c +++ b/rotators/prosistel/prosistel.c @@ -379,6 +379,15 @@ static const struct prosistel_rot_priv_caps prosistel_rot_combitrack_priv_caps = }; +// Elevation rotator with Control box D using azimuth logic +static const struct prosistel_rot_priv_caps prosistel_rot_el_cboxaz = +{ + .angle_multiplier = 1.0f, + .stop_angle = 997, + .elevation_id = 'A', +}; + + /* * Prosistel rotator capabilities */ @@ -487,7 +496,7 @@ const struct rot_caps prosistel_combi_track_azel_rot_caps = }; -//Elevation rotator with ControlBox using azimuth logic +// Elevation rotator with Control box D using azimuth logic const struct rot_caps prosistel_d_el_cboxaz_rot_caps = { ROT_MODEL(ROT_MODEL_PROSISTEL_D_EL_CBOXAZ), commit fcf69dff5e3388caaa5d2d21968c2b83227550fc Author: PianetaRadio <789...@us...> Date: Thu Dec 15 18:12:32 2022 +0100 Update prosistel.h Add Elevation rotator with Control box responding to azimuth logic diff --git a/rotators/prosistel/prosistel.h b/rotators/prosistel/prosistel.h index ee7b3594..2b1b90c8 100644 --- a/rotators/prosistel/prosistel.h +++ b/rotators/prosistel/prosistel.h @@ -25,5 +25,6 @@ extern const struct rot_caps prosistel_d_az_rot_caps; extern const struct rot_caps prosistel_d_el_rot_caps; extern const struct rot_caps prosistel_combi_track_azel_rot_caps; +extern const struct rot_caps prosistel_d_el_cboxaz_rot_caps; #endif /* _ROT_PROSISTEL_H */ commit b1e501a856b8caa2535a7d06853b7979dc87d5eb Author: PianetaRadio <789...@us...> Date: Thu Dec 15 18:09:51 2022 +0100 Update prosistel.c Add Elevation rotator with Control box responding to azimuth logic diff --git a/rotators/prosistel/prosistel.c b/rotators/prosistel/prosistel.c index 511cde4a..1ab58602 100644 --- a/rotators/prosistel/prosistel.c +++ b/rotators/prosistel/prosistel.c @@ -486,6 +486,43 @@ const struct rot_caps prosistel_combi_track_azel_rot_caps = .get_position = prosistel_rot_get_position, }; + +//Elevation rotator with ControlBox using azimuth logic +const struct rot_caps prosistel_d_el_cboxaz_rot_caps = +{ + ROT_MODEL(ROT_MODEL_PROSISTEL_D_EL_CBOXAZ), + .model_name = "D elevation CBOX az", + .mfg_name = "Prosistel", + .version = "20221215.0", + .copyright = "LGPL", + .status = RIG_STATUS_STABLE, + .rot_type = ROT_TYPE_ELEVATION, + .port_type = RIG_PORT_SERIAL, + .serial_rate_min = 9600, + .serial_rate_max = 9600, + .serial_data_bits = 8, + .serial_stop_bits = 1, + .serial_parity = RIG_PARITY_NONE, + .serial_handshake = RIG_HANDSHAKE_NONE, + .write_delay = 0, + .post_write_delay = 0, + .timeout = 3000, + .retry = 3, + + .min_az = 0.0, + .max_az = 0.0, + .min_el = 0.0, + .max_el = 90.0, + + .priv = &prosistel_rot_el_cboxaz, + + .rot_open = prosistel_rot_open, + .stop = prosistel_rot_stop, + .set_position = prosistel_rot_set_position, + .get_position = prosistel_rot_get_position, +}; + + DECLARE_INITROT_BACKEND(prosistel) { rig_debug(RIG_DEBUG_VERBOSE, "%s: _init called\n", __func__); @@ -493,6 +530,7 @@ DECLARE_INITROT_BACKEND(prosistel) rot_register(&prosistel_d_az_rot_caps); rot_register(&prosistel_d_el_rot_caps); rot_register(&prosistel_combi_track_azel_rot_caps); + rot_register(&prosistel_d_el_cboxaz_rot_caps); return RIG_OK; } commit 4e88d847b08cbff97de5c1a7b5ee5ad376d2cb0f Author: Mike Black W9MDB <mdb...@ya...> Date: Wed Dec 14 11:17:17 2022 -0600 Update NEWS diff --git a/NEWS b/NEWS index 6595b48e..c717fd69 100644 --- a/NEWS +++ b/NEWS @@ -18,6 +18,7 @@ Version 4.6 Version 4.5.2 * 2022-12-XX -- Planned for Dec 2022 + * Fix FT736R gpredict usage by adding cached get_freq * Fix get_powerstat problem with Log4OM/Flex and others * Fix -R option to not need argument * Fix -R option to close rig on last rigctld client disconnect commit 80cdb9b953fcdf9b4b027aeed33df6758806492a Author: Mike Black W9MDB <mdb...@ya...> Date: Wed Dec 14 11:04:30 2022 -0600 Update NEWS diff --git a/NEWS b/NEWS index 08d9411b..6595b48e 100644 --- a/NEWS +++ b/NEWS @@ -18,6 +18,7 @@ Version 4.6 Version 4.5.2 * 2022-12-XX -- Planned for Dec 2022 + * Fix get_powerstat problem with Log4OM/Flex and others * Fix -R option to not need argument * Fix -R option to close rig on last rigctld client disconnect * Add FTDX1200 to rigs that need to ensure PTT is off before changing frequency commit f0636bc87590d84ca9b205222854704286a0319c Author: Mike Black W9MDB <mdb...@ya...> Date: Wed Dec 14 11:14:54 2022 -0600 Add get_freq cached for FT736R to allow working with gpredict https://github.com/Hamlib/Hamlib/issues/1187 diff --git a/rigs/yaesu/ft736.c b/rigs/yaesu/ft736.c index eda6cea0..52cd85fc 100644 --- a/rigs/yaesu/ft736.c +++ b/rigs/yaesu/ft736.c @@ -58,6 +58,7 @@ static int ft736_open(RIG *rig); static int ft736_close(RIG *rig); static int ft736_set_freq(RIG *rig, vfo_t vfo, freq_t freq); +static int ft736_get_freq(RIG *rig, vfo_t vfo, freq_t *freq); // cached answer static int ft736_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width); static int ft736_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo); @@ -98,7 +99,7 @@ const struct rig_caps ft736_caps = RIG_MODEL(RIG_MODEL_FT736R), .model_name = "FT-736R", .mfg_name = "Yaesu", - .version = "20211271.0", + .version = "20221214.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -195,6 +196,7 @@ const struct rig_caps ft736_caps = .rig_close = ft736_close, .set_freq = ft736_set_freq, + .get_freq = ft736_get_freq, .set_mode = ft736_set_mode, .set_ptt = ft736_set_ptt, .get_dcd = ft736_get_dcd, @@ -290,6 +292,17 @@ int ft736_set_freq(RIG *rig, vfo_t vfo, freq_t freq) return write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH); } +int ft736_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) +{ + rig_debug(RIG_DEBUG_VERBOSE, "%s: called\n", __func__); + + if (vfo == RIG_VFO_A || vfo == RIG_VFO_MAIN) { *freq = rig->state.cache.freqMainA; } + else { *freq = rig->state.cache.freqMainB; } + + return RIG_OK; +} + + #define MD_LSB 0x00 commit bc45b17ae2d995e05d8bb8d10d4652a65b648d31 Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Dec 12 17:38:52 2022 -0600 If get_powerstat fails assume rig is powered on -- should fix sdr++ problem https://github.com/Hamlib/Hamlib/issues/1186 commit 2dd31355fc5fe3dd1a4afdd8843f53132bce7395 Author: Mike Black W9MDB <mdb...@ya...> Date: Wed Dec 14 09:05:27 2022 -0600 If get_powerstat fails in any way then always return RIG_POWER_ON https://github.com/Hamlib/Hamlib/issues/1189 diff --git a/rigs/dummy/netrigctl.c b/rigs/dummy/netrigctl.c index eed16b83..cd6a7c63 100644 --- a/rigs/dummy/netrigctl.c +++ b/rigs/dummy/netrigctl.c @@ -2052,23 +2052,22 @@ static int netrigctl_get_powerstat(RIG *rig, powerstat_t *status) ret = netrigctl_transaction(rig, cmd, strlen(cmd), buf); - if (ret == 1) + if (ret == 0) + { + *status = atoi(buf); + } + else { // was causing problems with sdr++ since it does not have PS command // a return of 1 should indicate there is no powerstat command available // so we fake the ON status + // also a problem with Flex 6xxx and Log4OM not working due to lack of PS command + rig_debug(RIG_DEBUG_VERBOSE, + "%s: PS command failed (ret=%d) so returning RIG_POWER_ON\n", __func__, ret); *status = RIG_POWER_ON; - return RIG_OK; - } - - if (ret <= 0) - { - return (ret < 0) ? ret : -RIG_EPROTO; } - *status = atoi(buf); - - return RIG_OK; + return RIG_OK; // always return RIG_OK } @@ -2735,7 +2734,7 @@ struct rig_caps netrigctl_caps = RIG_MODEL(RIG_MODEL_NETRIGCTL), .model_name = "NET rigctl", .mfg_name = "Hamlib", - .version = "20221212.0", + .version = "20221214.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_OTHER, commit 9edbc9e4b0a231e835b9c4331821aa955366f272 Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Dec 13 08:02:24 2022 -0600 Update NEWS diff --git a/NEWS b/NEWS index 5a48443e..08d9411b 100644 --- a/NEWS +++ b/NEWS @@ -21,7 +21,7 @@ Version 4.5.2 * Fix -R option to not need argument * Fix -R option to close rig on last rigctld client disconnect * Add FTDX1200 to rigs that need to ensure PTT is off before changing frequency - * Add --disable-parallel configure option for mingw builds + * Add --disable-parallel configure option for mingw builds on Linux Version 4.5.1 * 2022-12-08 commit 23d98c1e5628597a37b68f9b53859ea1ba37e5b2 Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Dec 12 23:53:41 2022 -0600 Update NEWS diff --git a/NEWS b/NEWS index 70890f3c..5a48443e 100644 --- a/NEWS +++ b/NEWS @@ -16,6 +16,13 @@ Version 4.6 * 2023-11-XX -- Planned for Nov 2023 * Add MDS 4710/9710 rigs +Version 4.5.2 + * 2022-12-XX -- Planned for Dec 2022 + * Fix -R option to not need argument + * Fix -R option to close rig on last rigctld client disconnect + * Add FTDX1200 to rigs that need to ensure PTT is off before changing frequency + * Add --disable-parallel configure option for mingw builds + Version 4.5.1 * 2022-12-08 * FT2000, FTDX3000/D, FT891, FT991, FT950, FTDX5000 now set CAT TOT to 100ms commit fd186abcaeb63506bff9c65b7332fb913f64569d Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Dec 12 23:46:53 2022 -0600 -R option will keep rig open as long as 1 or more clients are connected https://github.com/Hamlib/Hamlib/issues/1187 diff --git a/tests/rigctld.c b/tests/rigctld.c index 6b837ae6..9bc906b2 100644 --- a/tests/rigctld.c +++ b/tests/rigctld.c @@ -1197,7 +1197,7 @@ void *handle_socket(void *arg) #ifdef HAVE_PTHREAD mutex_rigctld(1); -// ++client_count; + ++client_count; #if 0 if (!client_count++) @@ -1313,14 +1313,19 @@ void *handle_socket(void *arg) } while (!ctrl_c && (retcode == RIG_OK || RIG_IS_SOFT_ERRCODE(-retcode))); - if (rigctld_idle) + if (rigctld_idle && client_count == 1) { rig_close(my_rig); if (verbose > RIG_DEBUG_ERR) { printf("Closed rig model %s. Will reopen for new clients\n", my_rig->caps->model_name); } } + #ifdef HAVE_PTHREAD + --client_count; + + if (rigctld_idle && client_count > 0) { printf("%d client%s still connected so rig remains open\n", client_count, client_count > 1 ? "s" : ""); } + #if 0 mutex_rigctld(1); commit 01799cb64f2afa8a8be06a46c0a6f0d4f8a38351 Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Dec 12 23:28:22 2022 -0600 Allow rigctld to close the rig with the -R option when client disconnects. This makes it close when any one client disconnects. Should only close when no clients are connected -- that will be the next patch This is for the FT736R and gpredict https://github.com/Hamlib/Hamlib/issues/1187 diff --git a/tests/rigctld.c b/tests/rigctld.c index bd2915dd..6b837ae6 100644 --- a/tests/rigctld.c +++ b/tests/rigctld.c @@ -83,7 +83,7 @@ * keep up to date SHORT_OPTIONS, usage()'s output and man page. thanks. * TODO: add an option to read from a file */ -#define SHORT_OPTIONS "m:r:R:p:d:P:D:s:S:c:T:t:C:W:w:x:z:lLuovhVZMA:n:" +#define SHORT_OPTIONS "m:r:p:d:P:D:s:S:c:T:t:C:W:w:x:z:lLuovhVZMRA:n:" static struct option long_options[] = { {"model", 1, 0, 'm'}, @@ -154,6 +154,8 @@ extern char rigctld_password[65]; char resp_sep = '\n'; extern int lock_mode; extern powerstat_t rig_powerstat; +static int rigctld_idle = + 0; // if true then rig will close when no clients are connected #define MAXCONFLEN 1024 @@ -262,8 +264,6 @@ int main(int argc, char *argv[]) int twiddle_timeout = 0; int twiddle_rit = 0; int uplink = 0; - int rigctld_idle = - 0; // if true then rig will close when no clients are connected char host[NI_MAXHOST]; char serv[NI_MAXSERV]; char rigstartup[1024]; @@ -1313,6 +1313,13 @@ void *handle_socket(void *arg) } while (!ctrl_c && (retcode == RIG_OK || RIG_IS_SOFT_ERRCODE(-retcode))); + if (rigctld_idle) + { + rig_close(my_rig); + + if (verbose > RIG_DEBUG_ERR) { printf("Closed rig model %s. Will reopen for new clients\n", my_rig->caps->model_name); } + } + #ifdef HAVE_PTHREAD #if 0 mutex_rigctld(1); commit 46f30345b9c57e85f08630fad9b1c3c2b0b98a7c Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Dec 12 17:38:52 2022 -0600 If get_powerstat fails assume rig is powered on -- should fix sdr++ problem https://github.com/Hamlib/Hamlib/issues/1186 diff --git a/rigs/dummy/netrigctl.c b/rigs/dummy/netrigctl.c index 3aba3def..eed16b83 100644 --- a/rigs/dummy/netrigctl.c +++ b/rigs/dummy/netrigctl.c @@ -2052,6 +2052,15 @@ static int netrigctl_get_powerstat(RIG *rig, powerstat_t *status) ret = netrigctl_transaction(rig, cmd, strlen(cmd), buf); + if (ret == 1) + { + // was causing problems with sdr++ since it does not have PS command + // a return of 1 should indicate there is no powerstat command available + // so we fake the ON status + *status = RIG_POWER_ON; + return RIG_OK; + } + if (ret <= 0) { return (ret < 0) ? ret : -RIG_EPROTO; @@ -2726,7 +2735,7 @@ struct rig_caps netrigctl_caps = RIG_MODEL(RIG_MODEL_NETRIGCTL), .model_name = "NET rigctl", .mfg_name = "Hamlib", - .version = "20221201.0", + .version = "20221212.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_OTHER, commit 859204026277a3f396a88b5e8f06415fe363cc22 Author: Mike Black W9MDB <mdb...@ya...> Date: Sun Dec 11 14:50:13 2022 -0600 Update simftdx1200.c diff --git a/simulators/simftdx1200.c b/simulators/simftdx1200.c new file mode 100644 index 00000000..2808405a --- /dev/null +++ b/simulators/simftdx1200.c @@ -0,0 +1,309 @@ +// can run this using rigctl/rigctld and socat pty devices +// gcc -o simyaesu simyaesu.c +#define _XOPEN_SOURCE 600 +#include <stdio.h> +#include <stdlib.h> +#include <fcntl.h> +#include <string.h> +#include <unistd.h> +#include "../include/hamlib/rig.h" + +#define BUFSIZE 256 + +float freqA = 14074000; +float freqB = 14074500; +int vfo = 0; +int ft = 0; +int md = 1; +int vs = 0; +int tx = 0; +int ai = 0; +int sh = 25; +int na = 0; +int ex039 = 0; + +// ID 0310 == 310, Must drop leading zero +typedef enum nc_rigid_e +{ + NC_RIGID_NONE = 0, + NC_RIGID_FT450 = 241, + NC_RIGID_FT450D = 244, + NC_RIGID_FT950 = 310, + NC_RIGID_FT891 = 135, + NC_RIGID_FT991 = 135, + NC_RIGID_FT2000 = 251, + NC_RIGID_FT2000D = 252, + NC_RIGID_FTDX1200 = 583, + NC_RIGID_FTDX9000D = 101, + NC_RIGID_FTDX9000Contest = 102, + NC_RIGID_FTDX9000MP = 103, + NC_RIGID_FTDX5000 = 362, + NC_RIGID_FTDX3000 = 460, + NC_RIGID_FTDX101D = 681, + NC_RIGID_FTDX101MP = 682 +} nc_rigid_t; + +int +getmyline(int fd, char *buf) +{ + char c; + int i = 0; + memset(buf, 0, BUFSIZE); + + while (read(fd, &c, 1) > 0) + { + buf[i++] = c; + + if (c == ';') { return strlen(buf); } + } + + return strlen(buf); +} + +#if defined(WIN32) || defined(_WIN32) +int openPort(char *comport) // doesn't matter for using pts devices +{ + int fd; + fd = open(comport, O_RDWR); + + if (fd < 0) + { + perror(comport); + } + + return fd; +} + +#else +int openPort(char *comport) // doesn't matter for using pts devices +{ + int fd = posix_openpt(O_RDWR); + char *name = ptsname(fd); + + if (name == NULL) + { + perror("pstname"); + return -1; + } + + printf("name=%s\n", name); + + if (fd == -1 || grantpt(fd) == -1 || unlockpt(fd) == -1) + { + perror("posix_openpt"); + return -1; + } + + return fd; +} +#endif + + + +int main(int argc, char *argv[]) +{ + char buf[256]; + char *pbuf; + int n; + int fd = openPort(argv[1]); + + while (1) + { + if (getmyline(fd, buf)) + { + printf("Cmd:%s\n", buf); + } + else { continue; } + + if (strcmp(buf, "RM5;") == 0) + { + printf("%s\n", buf); + usleep(50 * 1000); + pbuf = "RM5100000;"; + n = write(fd, pbuf, strlen(pbuf)); + printf("n=%d\n", n); + + if (n <= 0) { perror("RM5"); } + } + + if (strcmp(buf, "AN0;") == 0) + { + printf("%s\n", buf); + usleep(50 * 1000); + pbuf = "AN030;"; + n = write(fd, pbuf, strlen(pbuf)); + printf("n=%d\n", n); + + if (n <= 0) { perror("AN"); } + } + else if (strcmp(buf, "IF;") == 0) + { + printf("%s\n", buf); + usleep(50 * 1000); + pbuf = "IF059014200000+000000700000;"; + n = write(fd, pbuf, strlen(pbuf)); + printf("n=%d\n", n); + + if (n <= 0) { perror("IF"); } + } + else if (strcmp(buf, "ID;") == 0) + { + printf("%s\n", buf); + usleep(50 * 1000); + int id = NC_RIGID_FTDX3000; + SNPRINTF(buf, sizeof(buf), "ID%03d;", id); + n = write(fd, buf, strlen(buf)); + printf("n=%d\n", n); + + if (n <= 0) { perror("ID"); } + } + else if (strcmp(buf, "AI;") == 0) + { + printf("%s\n", buf); + usleep(50 * 1000); + SNPRINTF(buf, sizeof(buf), "AI0;"); + n = write(fd, buf, strlen(buf)); + printf("n=%d\n", n); + + if (n <= 0) { perror("ID"); } + } + +#if 0 + else if (strncmp(buf, "AI", 2) == 0) + { + if (strcmp(buf, "AI;")) + { + printf("%s\n", buf); + usleep(50 * 1000); + n = fprintf(fp, "%s", "AI0;"); + printf("n=%d\n", n); + + if (n <= 0) { perror("AI"); } + } + } + +#endif + else if (strcmp(buf, "VS;") == 0) + { + printf("%s\n", buf); + usleep(50 * 1000); + pbuf = "VS0;"; + n = write(fd, pbuf, strlen(pbuf)); + printf("n=%d\n", n); + + if (n < 0) { perror("VS"); } + } + else if (strcmp(buf, "EX032;") == 0) + { + static int ant = 0; + ant = (ant + 1) % 3; + printf("%s\n", buf); + usleep(50 * 1000); + SNPRINTF(buf, sizeof(buf), "EX032%1d;", ant); + n = write(fd, buf, strlen(buf)); + printf("n=%d\n", n); + + if (n < 0) { perror("EX032"); } + } + + else if (strcmp(buf, "FA;") == 0) + { + SNPRINTF(buf, sizeof(buf), "FA%08.0f;", freqA); + n = write(fd, buf, strlen(buf)); + } + else if (strncmp(buf, "FA", 2) == 0) + { + sscanf(buf, "FA%f", &freqA); + } + else if (strcmp(buf, "FB;") == 0) + { + SNPRINTF(buf, sizeof(buf), "FB%08.0f;", freqB); + n = write(fd, buf, strlen(buf)); + } + else if (strncmp(buf, "FB", 2) == 0) + { + sscanf(buf, "FB%f", &freqB); + } + else if (strcmp(buf, "VS;") == 0) + { + SNPRINTF(buf, sizeof(buf), "VS%c;", vfo == 0 ? '0' : '1'); + n = write(fd, buf, strlen(buf)); + } + else if (strcmp(buf, "FT;") == 0) + { + SNPRINTF(buf, sizeof(buf), "FT%d;", ft); + n = write(fd, buf, strlen(buf)); + } + else if (strcmp(buf, "MD0;") == 0) + { + SNPRINTF(buf, sizeof(buf), "MD0%d;", md); + n = write(fd, buf, strlen(buf)); + } + else if (strcmp(buf, "VS;") == 0) + { + SNPRINTF(buf, sizeof(buf), "VS%d;", vs); + n = write(fd, buf, strlen(buf)); + } + else if (strncmp(buf, "VS", 2) == 0) + { + sscanf(buf, "VS%d", &vs); + } + else if (strcmp(buf, "TX;") == 0) + { + SNPRINTF(buf, sizeof(buf), "TX%d;", tx); + n = write(fd, buf, strlen(buf)); + } + else if (strncmp(buf, "TX", 2) == 0) + { + sscanf(buf, "TX%d", &tx); + } + else if (strcmp(buf, "AI;") == 0) + { + SNPRINTF(buf, sizeof(buf), "AI%d;", ai); + n = write(fd, buf, strlen(buf)); + } + else if (strncmp(buf, "AI", 2) == 0) + { + sscanf(buf, "AI%d", &ai); + } + else if (strcmp(buf, "SH0;") == 0) + { + SNPRINTF(buf, sizeof(buf), "SH0%d;", sh); + n = write(fd, buf, strlen(buf)); + } + else if (strncmp(buf, "SH0", 3) == 0) + { + sscanf(buf, "SH0%d", &sh); + } + else if (strcmp(buf, "NA0;") == 0) + { + SNPRINTF(buf, sizeof(buf), "NA0%d;", na); + n = write(fd, buf, strlen(buf)); + } + else if (strncmp(buf, "NA0", 3) == 0) + { + sscanf(buf, "NA0%d", &na); + } + else if (strcmp(buf, "EX039;") == 0) + { + SNPRINTF(buf, sizeof(buf), "EX039%d;", ex039); + n = write(fd, buf, strlen(buf)); + } + else if (strncmp(buf, "EX039", 3) == 0) + { + sscanf(buf, "EX039%d", &ex039); + } + else if (strcmp(buf,"PS;") == 0) + { + SNPRINTF(buf, sizeof(buf), "PS1;"); + n = write(fd, buf, strlen(buf)); + } + else if (strlen(buf) > 0) + { + fprintf(stderr, "Unknown command: %s\n", buf); + } + + } + + return 0; +} commit 0d4f647da3d0510b48a7a04821bccaa67f72c5aa Author: Mike Black W9MDB <mdb...@ya...> Date: Sun Dec 11 11:53:22 2022 -0600 Add FTDX1200 to rigs that need to ensure PTT is off before changing frequency https://github.com/Hamlib/Hamlib/issues/1185 diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index c5f987b4..fda8aa01 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -886,7 +886,7 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) if (vfo != rig->state.tx_vfo) { return -RIG_ENTARGET; } } - if (is_ftdx3000 || is_ftdx3000dm || is_ftdx5000) + if (is_ftdx3000 || is_ftdx3000dm || is_ftdx5000 || is_ftdx1200) { // we have a few rigs that can't set freq while PTT_ON // so we'll try a few times to see if we just need to wait a bit diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h index 3f35b553..c45a4d9d 100644 --- a/rigs/yaesu/newcat.h +++ b/rigs/yaesu/newcat.h @@ -50,7 +50,7 @@ typedef char ncboolean; /* shared function version */ -#define NEWCAT_VER "20221204" +#define NEWCAT_VER "20221211" /* Hopefully large enough for future use, 128 chars plus '\0' */ #define NEWCAT_DATA_LEN 129 commit ec5dde91c594533cf842a859f61ec45443266dea Author: Mike Black W9MDB <mdb...@ya...> Date: Sun Dec 11 13:56:29 2022 -0600 astyle newcat.c diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 5bdae1f4..c5f987b4 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -604,12 +604,18 @@ int newcat_open(RIG *rig) char *cmd = "EX0291;EX029;"; // FT2000/D if (priv->rig_id == NC_RIGID_FT950 || rig->caps->rig_model == RIG_MODEL_FT950) { cmd = "EX0271;EX027;"; } - else if (priv->rig_id == NC_RIGID_FT891 || rig->caps->rig_model == RIG_MODEL_FT891) { cmd = "EX05071;EX0507;"; } - else if (priv->rig_id == NC_RIGID_FT991 || rig->caps->rig_model == RIG_MODEL_FT991) { cmd = "EX0321;EX032;"; } - else if (priv->rig_id == NC_RIGID_FT991A || rig->caps->rig_model == RIG_MODEL_FT991) { cmd = "EX0321;EX032;"; } - else if (priv->rig_id == NC_RIGID_FTDX3000 || rig->caps->rig_model == RIG_MODEL_FTDX3000) { cmd = "EX0391;EX039;"; } - else if (priv->rig_id == NC_RIGID_FTDX3000DM || rig->caps->rig_model == RIG_MODEL_FTDX3000) { cmd = "EX0391;EX039;"; } - else if (priv->rig_id == NC_RIGID_FTDX5000 || rig->caps->rig_model == RIG_MODEL_FTDX5000) { cmd = "EX0331;EX033"; } + else if (priv->rig_id == NC_RIGID_FT891 + || rig->caps->rig_model == RIG_MODEL_FT891) { cmd = "EX05071;EX0507;"; } + else if (priv->rig_id == NC_RIGID_FT991 + || rig->caps->rig_model == RIG_MODEL_FT991) { cmd = "EX0321;EX032;"; } + else if (priv->rig_id == NC_RIGID_FT991A + || rig->caps->rig_model == RIG_MODEL_FT991) { cmd = "EX0321;EX032;"; } + else if (priv->rig_id == NC_RIGID_FTDX3000 + || rig->caps->rig_model == RIG_MODEL_FTDX3000) { cmd = "EX0391;EX039;"; } + else if (priv->rig_id == NC_RIGID_FTDX3000DM + || rig->caps->rig_model == RIG_MODEL_FTDX3000) { cmd = "EX0391;EX039;"; } + else if (priv->rig_id == NC_RIGID_FTDX5000 + || rig->caps->rig_model == RIG_MODEL_FTDX5000) { cmd = "EX0331;EX033"; } SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "%s", cmd); commit e883918d853043f5d434925ffb945e9f25474860 Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Dec 10 11:49:45 2022 -0600 Fix rigctld segfault when using -P RTS https://github.com/Hamlib/Hamlib/issues/1182 diff --git a/Segfault-award b/Segfault-award index 2d02ce1b..e09c6749 100644 --- a/Segfault-award +++ b/Segfault-award @@ -7,6 +7,8 @@ A developer cannot apply for HSHR for segfaults on his/her own code. Here is the list of the brave fellows: +* Saku Nyland OH1KH v4.5.1, 10/2022, rigctld.c using ptt_type=RTS + * David Kjellquist WB5NHL, v1.1.3, 09/2002, kenwood/ts570.c caught on TS570D backend startup. diff --git a/tests/rigctld.c b/tests/rigctld.c index 470534c3..bd2915dd 100644 --- a/tests/rigctld.c +++ b/tests/rigctld.c @@ -701,7 +701,9 @@ int main(int argc, char *argv[]) { my_rig->state.pttport.type.ptt = ptt_type; my_rig->state.pttport_deprecated.type.ptt = ptt_type; - my_rig->caps->ptt_type = ptt_type; + // This causes segfault since backend rig_caps are const + // rigctld will use the rig->state version of this for clients + //my_rig->caps->ptt_type = ptt_type; } if (dcd_type != RIG_DCD_NONE) commit 5c12619117c959ad7fba4406a7fe8381410ebfcc Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Dec 9 23:32:51 2022 -0600 Add --disable-parallel configure option https://github.com/Hamlib/Hamlib/issues/1181 diff --git a/configure.ac b/configure.ac index 203b640b..7f2a7007 100644 --- a/configure.ac +++ b/configure.ac @@ -694,6 +694,15 @@ AC_ARG_ENABLE([winradio], [cf_with_winradio="yes" AC_DEFINE([HAVE_WINRADIO],[1],[Define if winradio backend is built])]) AC_MSG_RESULT([$cf_with_winradio]) +dnl Parallel port device disable +AC_MSG_CHECKING([whether to build parallel port devices]) +AC_ARG_ENABLE([parallel], + [AS_HELP_STRING([--disable-parallel], + [do not build parallel devices @<:@default=yes@:>@])], + [cf_with_parallel="no"], + [cf_with_parallel="yes" AC_DEFINE([HAVE_PARALLEL],[1],[Define if parallel devices are to be built])]) +AC_MSG_RESULT([$cf_with_parallel]) + DL_LIBS="" AS_IF([test x"${cf_with_winradio}" = "xyes"], @@ -912,6 +921,7 @@ echo \ Enable HTML rig feature matrix ${cf_enable_html_matrix} Enable WinRadio ${cf_with_winradio} + Enable Parallel ${cf_with_parallel} Enable USRP ${cf_with_usrp} Enable USB backends ${cf_with_libusb} Enable shared libs ${enable_shared} diff --git a/rotators/fodtrack/fodtrack.c b/rotators/fodtrack/fodtrack.c index ad9e5850..9f6006ce 100644 --- a/rotators/fodtrack/fodtrack.c +++ b/rotators/fodtrack/fodtrack.c @@ -26,9 +26,11 @@ #include <sys/ioctl.h> #endif +#ifdef HAVE_PARALLEL #ifdef HAVE_LINUX_PARPORT_H #include <linux/parport.h> #endif +#endif #include "hamlib/rotator.h" #include "parallel.h" diff --git a/src/parallel.h b/src/parallel.h index c676ee43..0cdc1f0b 100644 --- a/src/parallel.h +++ b/src/parallel.h @@ -26,9 +26,11 @@ #include <hamlib/rig.h> #include "iofunc.h" +#ifdef HAVE_PARALLEL #ifdef HAVE_LINUX_PARPORT_H # include <linux/parport.h> #endif +#endif #ifndef PARPORT_CONTROL_STROBE # define PARPORT_CONTROL_STROBE 0x1 commit 64b333944a374f4d56b3509cdb1d5b550ce1ac8f Author: Nate Bargmann <n0...@n0...> Date: Fri Dec 9 08:24:36 2022 -0600 Quell groff warning of "font p not found". Font names need to be upper case in nroff. diff --git a/doc/man1/rigctl.1 b/doc/man1/rigctl.1 index 772173be..73bc1320 100644 --- a/doc/man1/rigctl.1 +++ b/doc/man1/rigctl.1 @@ -1289,7 +1289,7 @@ CW Skimmer is started and "set_lock_mode 0" when CW Skimmer is stopped. Returns current lock mode status 1=On, 2=Off (only useful when using rigctld) . .TP -.BR send_raw " \(aq" \fITerminator\fP "\(aq \(aq" \fIString\fp \(aq +.BR send_raw " \(aq" \fITerminator\fP "\(aq \(aq" \fIString\fP \(aq .EX Can send ASCII string or 0xnn values -- there can be no spaces in the command string. Possible terminator values are CR, LF, ;, ICOM, 0-100 (bytes to read), or -1 meaning unknown (will timeout on read) commit 18da3525081c15182760af21f5b8895f5adc96f5 Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Dec 9 08:30:02 2022 -0600 Hamlib-4.5.2 bug fixes diff --git a/configure.ac b/configure.ac index c92e77cc..203b640b 100644 --- a/configure.ac +++ b/configure.ac @@ -14,7 +14,7 @@ dnl Please do not use '-' in the version number, as package managers will fail, dnl however, the use of '~' should be fine as apt (others?) will treat dnl it as an earlier version than the actual release. TNX KA6MAL dnl PACKAGE_NAME + " " + PACKAGE_VERSION must not exceed 20 chars! -AC_INIT([Hamlib],[4.5.1],[ham...@li...],[hamlib],[http://www.hamlib.org]) +AC_INIT([Hamlib],[4.5.2],[ham...@li...],[hamlib],[http://www.hamlib.org]) AC_CONFIG_SRCDIR([include/hamlib/rig.h]) AC_CONFIG_MACRO_DIR([macros]) commit 71a9976d9fa674410fa1532c5dba022b8a54fcf6 Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Dec 8 22:37:10 2022 -0600 Update simftdx3000.c diff --git a/simulators/simftdx3000.c b/simulators/simftdx3000.c index e8c4a31f..33b0cd00 100644 --- a/simulators/simftdx3000.c +++ b/simulators/simftdx3000.c @@ -252,6 +252,11 @@ int main(int argc, char *argv[]) { sscanf(buf, "MD0%d", &md); } + else if (strcmp(buf, "PS;") == 0) + { + SNPRINTF(buf, sizeof(buf), "PS1;"); + n = write(fd, buf, strlen(buf)); + } else if (strcmp(buf, "VS;") == 0) { SNPRINTF(buf, sizeof(buf), "VS%d;", vs); ----------------------------------------------------------------------- hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: n0nb <n0...@us...> - 2022-12-24 17:09:39
|
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 b61550bf6b53c0cef885ed1443967a6c9aa2fb78 (commit) via 4689a2ff11674da65c1a1245a204010c5f4b758e (commit) via bfa4bbd50da3f143074fa87b46b50b749d7d7948 (commit) via 70f38022b6da3375c4b321b810f417d20e29ac45 (commit) via 33b24561291db92010a851e2fda4660bb9fc3bb1 (commit) via 17f88dccbf97259f5ea1728ad39f57a08e96a0e7 (commit) via 267d07f708bea7a6734129b469dc55fdddb5a3b5 (commit) via f31e1b7ad9b9cc3f035a3942fc4dc303e53b1ac4 (commit) via cafc094788fcdd65e5fb936e5451a08b780c8ecd (commit) via b153bcd1e5604b55fd5c0d1b46389909f074c169 (commit) via f468fa3c1d93e93652cbdbfc8998546b6a79a422 (commit) via 31e911edb87e3eeec794cb4d26e8bcfea9cd6834 (commit) via 287fb9091b6479b06eaa55981da149c43145ce60 (commit) via 04b18c9d5be503a064c9198843408799d2c53e0f (commit) via ea29263f3512dda2f93ba3429189a20a6782a305 (commit) via b1828d951a2159e87b6208f6eb3aabdacc03b6aa (commit) via 9970a2767d2f49c427c51c6a0780a41010269b89 (commit) via 04f5195cfd68df95bdaaa185b577555390f1276c (commit) via 9508c45f00558bce22409c472b0de3d5d95f40c8 (commit) via 120c580de0b67a9da1deac2b53e4238fd3774d57 (commit) via 250a5b0211fd2e8000dcf02e943915940a2ff911 (commit) via f554c3a7ffb495cb0ad007d0b1cc86c183c78696 (commit) via 32b1ce161e5f2726be1f195b531eca14c196514a (commit) via 830bf5a94171847ff82ce9f22edcfd3a2a2fecf8 (commit) via 9eecfc3b2df1804f6ddccafea160fe6f9d80efc6 (commit) via 40066a6cfa0cc7d49d9e2a25edf5dcac46421e84 (commit) via b1ac588667e74af74e7eb32be3badfc4ad1e77d8 (commit) via 7fc23e59a337e853e292e8e89d39d6a2179498ea (commit) via 2a84386ae89989158d9bc628654188219138f9d5 (commit) via 57f2646daaeac87ee430ec485f0abc1c4c5f1d80 (commit) via e9192f5a8b19a609960d76506c189141ab25fe31 (commit) via a9497b295854d942b3605294622c9402b14c5245 (commit) via eb03592d002af78ff7755f463680ab75ac1bd972 (commit) via d1fffb7c84c3d9e2ade81ef6baeff66fe421155d (commit) via 368a07ad78b46ea8ed010a9bc039b5ea4cafebd4 (commit) via f224e71a5830eaabe1f751a5d172bdea3ce6f618 (commit) via 5b704d24fb4556be7e76603d7a3bcfdde76bee16 (commit) via 5c4c2f7748d05c390754e52c81bf017789999723 (commit) via df8b88072a74947ffc14d70e0902d43a5a2b2436 (commit) via 3a91446287b1ab3fe3630be108141e306d5caf2e (commit) via d977f3fbdb0131315c7a8c9395899a3ee09a8e64 (commit) via 294bdc7d2aa04909abc638fad877083dc1ac8cbd (commit) via d1dccffd6b01360c0bb72acd988a09d6a94fcf1c (commit) via fd245473865a22704941ca1ca92ce6a51e68daeb (commit) via 5339b431e4f47faaa380dc8f909d0de0efe4ee28 (commit) via 17ad0fcb90bbcc060c94f9bed6aa302a4789298f (commit) via 6331709fd6fd015dd8eb8aac8a0ebf3cc4411ca2 (commit) via ebdad6d736282756f59b365386b347b7ba5f5543 (commit) via 6ef7009f6c2302cc954efdf401fd9bf5edd28e37 (commit) via 2f7e5ab733c9b1ebb919959550b02cc9938c2871 (commit) via f359f32bc4075973ab6b8bbc570cbae56c973ec4 (commit) via 34ef939350ba0add7f1604e7377a65882e72c41e (commit) via f17a08fe85ebff5e6962b420a48cba51fb0d84ba (commit) via f4923723fb1ac46daf6e9beb5fb8b88acba0c49b (commit) via 05a8aaebe327ef0a738a2cd5743d57d2ef1a2510 (commit) via a5773f6f4e430dcff9de7beb0ac8a2da8f88f3e9 (commit) via 3f077a5cf5a179b2258d857cd5facda43649eb4b (commit) via 6008979708c64d27b1684ab278e1856dac5e37ec (commit) via 93c4c28d0627c490818a7750aecaa2512ab097d8 (commit) via 84fc3169df66aba2a5ce940c1f9ad162fa73f092 (commit) via b93551712fb0d77f0957275f6dc4005721dccec5 (commit) via 2f6b80d98d475c8cc4a7a3bf0ca8a771dee78d4b (commit) via 6de45dd331c289f21be597b9e4d49e3629eca73e (commit) via f7fe2912eca74a9edb8818c6e3fb6ac6ef53dd1d (commit) from 477c94c8fbf1ec4b82fb976d569c9d87357f7d1d (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 b61550bf6b53c0cef885ed1443967a6c9aa2fb78 Merge: 4689a2ff bfa4bbd5 Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Dec 23 23:40:11 2022 -0600 Merge branch 'master' of https://github.com/Hamlib/Hamlib commit 4689a2ff11674da65c1a1245a204010c5f4b758e Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Dec 23 23:39:20 2022 -0600 Add client_version for rigctld clients to report their version to rigctld This should allow for rigctld to report deprecation, compatibility, or alternatives https://github.com/Hamlib/Hamlib/issues/1153 diff --git a/NEWS b/NEWS index 77ccf2c2..23e9b44e 100644 --- a/NEWS +++ b/NEWS @@ -14,6 +14,7 @@ Version 5.x -- future Version 4.6 * 2023-11-XX -- Planned for Nov 2023 + * Add client_version to rigctld so client can report it's version for future use/compatility/alternatives * Add --set-conf=tuner_control_pathname=hamlib_tuner_control (default) If file exists then it will be called with 0/1 (Off/On) argument with 'U TUNER 0' or 'U TUNER 1" @@ -23,11 +24,13 @@ Version 4.6 * Fix FTDX3000 rig split Version 4.5.2 + * 2022-12-23 + * Fix PowerSDR ability to do commands while powered off + * Fix TX-500 operations * Fix FTDX5000 to return to MIC input on closing * Fix rig.c calling rig_get_mode when backend does not have get_mode * Fix kenwood_ts890_get_level * Add Prosistel D elevation CBOX az to fix problem with azimuth control - * 2022-12-XX -- Planned for Dec 2022 * Fix FT736R gpredict usage by adding cached get_freq * Fix get_powerstat problem with Log4OM/Flex and others * Fix -R option to not need argument diff --git a/doc/man1/rigctl.1 b/doc/man1/rigctl.1 index 33e75464..d68fae78 100644 --- a/doc/man1/rigctl.1 +++ b/doc/man1/rigctl.1 @@ -1321,6 +1321,11 @@ Examples: send_raw -1 0xFE;0xFE;0x94;0x03;0xFD send_raw 14 0xFE;0xFE;0x94;0x03;0xFD . +.TP +.BR client_version " \(aq" \fIString\fP "\(aq +.EX + Client can send it's version to rigctld and get feedback on compatibility, deprecation, and alternatives +. .SH READLINE . If diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h index d93e7986..eb3d9a0e 100644 --- a/include/hamlib/rig.h +++ b/include/hamlib/rig.h @@ -2589,6 +2589,7 @@ struct rig_state { int lock_mode; /*<! flag that prevents mode changes if ~= 0 -- see set/get_lock_mode */ powerstat_t powerstat; /*<! power status */ char *tuner_control_pathname; /*<! Path to external tuner control program that get 0/1 (Off/On) argument */ + char client_version[32]; /*<! Allow client to report version for compatility checks/capability */ }; //! @cond Doxygen_Suppress diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c index 1b356aac..c1aeb838 100644 --- a/tests/rigctl_parse.c +++ b/tests/rigctl_parse.c @@ -259,6 +259,7 @@ declare_proto_rig(get_separator); declare_proto_rig(set_lock_mode); declare_proto_rig(get_lock_mode); declare_proto_rig(send_raw); +declare_proto_rig(client_version); /* @@ -372,6 +373,7 @@ static struct test_table test_list[] = { 0xa2, "set_lock_mode", ACTION(set_lock_mode), ARG_IN | ARG_NOVFO, "Locked" }, { 0xa3, "get_lock_mode", ACTION(get_lock_mode), ARG_NOVFO, "Locked" }, { 0xa4, "send_raw", ACTION(send_raw), ARG_NOVFO | ARG_IN1 | ARG_IN2 | ARG_OUT3, "Terminator", "Command", "Send raw answer" }, + { 0xa5, "client_version", ACTION(client_version), ARG_NOVFO | ARG_IN1, "Version", "Client version" }, { 0x00, "", NULL }, }; @@ -674,6 +676,7 @@ int rigctl_parse(RIG *my_rig, FILE *fin, FILE *fout, char *argv[], int argc, char arg2[MAXARGSZ + 1], *p2 = NULL; char arg3[MAXARGSZ + 1], *p3 = NULL; vfo_t vfo = RIG_VFO_CURR; + char client_version[32]; rig_debug(RIG_DEBUG_TRACE, "%s: called, interactive=%d\n", __func__, interactive); @@ -1753,7 +1756,9 @@ readline_repeat: && cmd_entry->cmd != 0x8f // dump_state && cmd_entry->cmd != 0xf0 // chk_vfo && cmd_entry->cmd != 0x87 // set_powerstat - && my_rig->caps->rig_model != RIG_MODEL_POWERSDR) // some rigs can do stuff when powered off + && cmd_entry->cmd != 0xa5 // client_version + && my_rig->caps->rig_model != + RIG_MODEL_POWERSDR) // some rigs can do stuff when powered off { rig_debug(RIG_DEBUG_WARN, "%s: command %s not allowed when rig is powered off\n", __func__, @@ -1778,6 +1783,10 @@ readline_repeat: p2 ? p2 : "", p3 ? p3 : ""); } + + // we need to copy client_version to our thread in case there are multiple client versions + // client_version is used to determine any backward compatiblity requirements or problems + strncpy(client_version, my_rig->state.client_version, sizeof(client_version)); } @@ -1855,6 +1864,20 @@ void version() printf("%s\n", hamlib_copyright); } +declare_proto_rig(client_version) +{ + if ((interactive && prompt) || (interactive && !prompt && ext_resp)) + { + fprintf(fout, "%s: ", cmd->arg1); + } + + fprintf(fout, "%s%c", arg1, resp_sep); + strncpy(rig->state.client_version, arg1, sizeof(rig->state.client_version) - 1); + rig_debug(RIG_DEBUG_VERBOSE, "%s: client_version=%s\n", __func__, + rig->state.client_version); + return RIG_OK; +} + void usage_rig(FILE *fout) { commit bfa4bbd50da3f143074fa87b46b50b749d7d7948 Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Dec 23 17:44:44 2022 -0600 Full version info now available for Windows File/Properties/Details Will show git version until released https://github.com/Hamlib/Hamlib/issues/1168 diff --git a/src/Makefile.am b/src/Makefile.am index 90c34e42..47c8ec9b 100755 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -51,7 +51,7 @@ LTRCCOMPILE = $(LIBTOOL) --mode=compile --tag=RC $(RCCOMPILE) $(LTRCCOMPILE) -i "$<" -o "$@" .rc.o: - $(RCCOMPILE) -i "$<" -o "$@" + $(RCCOMPILE) -O coff -i "$<" -o "$@" .mc.rc: $(WINDMC) "$<" diff --git a/src/version_dll.rc b/src/version_dll.rc index 1abe9f54..329aefc6 100755 --- a/src/version_dll.rc +++ b/src/version_dll.rc @@ -1,20 +1,22 @@ #include <windows.h> #include <hamlibdatetime.h> +#include <config.h> -#define VERSIONINFO_1 1 +//#define HAMLIB_RC_FILEVERSION 4,6,0,0 -VERSIONINFO_1 VERSIONINFO +VS_VERSION_INFO VERSIONINFO +FILEVERSION ABI_VERSION,ABI_REVISION,ABI_AGE,0 +FILETYPE VFT_DLL +FILESUBTYPE VFT2_UNKNOWN { BLOCK "StringFileInfo" { BLOCK "040904E4" { VALUE "FileDescription", "Hamlib DLL" - VALUE "FileVersion", "4.6.0.0" - VALUE "ProductName", "Hamlib" + VALUE "ProductName", PACKAGE_STRING VALUE "ProductVersion", HAMLIBDATETIME - VALUE "InternalName", "sha256" - VALUE "LegalCopyright", "Copyright Hamlib Team 2022" + VALUE "LegalCopyright", "Copyright Hamlib Team 1991-2023" VALUE "OriginalFilename", "libhamlib-4.dll" } @@ -22,7 +24,6 @@ VERSIONINFO_1 VERSIONINFO BLOCK "VarFileInfo" { - VALUE "Translation", 0x409, 1200 + VALUE "Translation", 0x409, 20127 } - } commit 70f38022b6da3375c4b321b810f417d20e29ac45 Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Dec 23 16:53:18 2022 -0600 Update NEWS diff --git a/NEWS b/NEWS index 36502060..77ccf2c2 100644 --- a/NEWS +++ b/NEWS @@ -23,6 +23,7 @@ Version 4.6 * Fix FTDX3000 rig split Version 4.5.2 + * Fix FTDX5000 to return to MIC input on closing * Fix rig.c calling rig_get_mode when backend does not have get_mode * Fix kenwood_ts890_get_level * Add Prosistel D elevation CBOX az to fix problem with azimuth control commit 33b24561291db92010a851e2fda4660bb9fc3bb1 Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Dec 23 16:49:45 2022 -0600 Make FTDX5000 return to MIC input on closing https://github.com/Hamlib/Hamlib/issues/1193 diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index fda8aa01..9bff762a 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -662,6 +662,14 @@ int newcat_close(RIG *rig) priv->poweron = 0; } + if (is_ftdx5000) + { + // Ensure FT5000 is back to MIC input + SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "EX1030;"); + rig_debug(RIG_DEBUG_TRACE, "%s: cmd_str = %s\n", __func__, priv->cmd_str); + newcat_set_cmd(rig); // don't care about the return + } + RETURNFUNC(RIG_OK); } diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h index c45a4d9d..a0be7487 100644 --- a/rigs/yaesu/newcat.h +++ b/rigs/yaesu/newcat.h @@ -50,7 +50,7 @@ typedef char ncboolean; /* shared function version */ -#define NEWCAT_VER "20221211" +#define NEWCAT_VER "20221223" /* Hopefully large enough for future use, 128 chars plus '\0' */ #define NEWCAT_DATA_LEN 129 commit 17f88dccbf97259f5ea1728ad39f57a08e96a0e7 Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Dec 22 12:14:29 2022 -0600 Fix version_dll.c https://github.com/Hamlib/Hamlib/issues/1168 diff --git a/src/version_dll.rc b/src/version_dll.rc index a5703f90..1abe9f54 100755 --- a/src/version_dll.rc +++ b/src/version_dll.rc @@ -9,7 +9,6 @@ VERSIONINFO_1 VERSIONINFO { BLOCK "040904E4" { -<<<<<<< HEAD VALUE "FileDescription", "Hamlib DLL" VALUE "FileVersion", "4.6.0.0" VALUE "ProductName", "Hamlib" @@ -17,27 +16,13 @@ VERSIONINFO_1 VERSIONINFO VALUE "InternalName", "sha256" VALUE "LegalCopyright", "Copyright Hamlib Team 2022" VALUE "OriginalFilename", "libhamlib-4.dll" -======= - VALUE "CompanyName", "Hamlib Team\000" - VALUE "FileDescription", "Hamlib DLL\000" - VALUE "ProductName", "Hamlib\000" - VALUE "FileVersion", 4,6,0,0 - VALUE "ProductVersion", HAMLIBDATETIME - VALUE "InternalName", "sha256" - VALUE "LegalCopyright", "Copyright Hamlib Team 2022\000" - VALUE "OriginalFilename", "libhamlib-4.dll\000" ->>>>>>> cafc094788fcdd65e5fb936e5451a08b780c8ecd } } BLOCK "VarFileInfo" { -<<<<<<< HEAD VALUE "Translation", 0x409, 1200 -======= - VALUE "Translation", 0x409, 1252 ->>>>>>> cafc094788fcdd65e5fb936e5451a08b780c8ecd } } commit 267d07f708bea7a6734129b469dc55fdddb5a3b5 Merge: f31e1b7a cafc0947 Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Dec 22 11:58:13 2022 -0600 Merge branch 'master' of https://github.com/Hamlib/Hamlib diff --cc configure.ac index 394d2701,265279c9..d0938071 --- a/configure.ac +++ b/configure.ac @@@ -285,8 -284,8 +285,9 @@@ AS_CASE(["$host_os"] AC_SUBST([OSXLDFLAGS])], [mingw* | pw32* | cygwin*], [ + AM_CONDITIONAL([VERSIONDLL], true) WINLDFLAGS="-Wl,--output-def,libhamlib.def -Wl,--add-stdcall-alias" + VERSIONDLL="version_dll.rc" AC_SUBST([WINLDFLAGS]) # Enable ld's "auto import" for executables diff --cc src/Makefile.am index 94ed7462,25e4f7cd..90c34e42 mode 100755,100644..100755 --- a/src/Makefile.am +++ b/src/Makefile.am @@@ -10,15 -11,10 +10,15 @@@ RIGSRC = hamlibdatetime.h rig.c serial. network.c network.h cm108.c cm108.h gpio.c gpio.h idx_builtin.h token.h \ par_nt.h microham.c microham.h amplifier.c amp_reg.c amp_conf.c \ amp_conf.h amp_settings.c extamp.c sleep.c sleep.h sprintflst.c \ - sprintflst.h cache.c cache.h snapshot_data.c snapshot_data.h $(VERSIONDLL) + sprintflst.h cache.c cache.h snapshot_data.c snapshot_data.h + +if VERSIONDLL +RIGSRC += \ + version_dll.rc +endif lib_LTLIBRARIES = libhamlib.la - libhamlib_la_SOURCES = $(RIGSRC) + libhamlib_la_SOURCES = $(RIGSRC) $(VERSIONDLL) libhamlib_la_LDFLAGS = $(WINLDFLAGS) $(OSXLDFLAGS) -no-undefined -version-info $(ABI_VERSION):$(ABI_REVISION):$(ABI_AGE) libhamlib_la_LIBADD = $(top_builddir)/lib/libmisc.la $(top_builddir)/security/libsecurity.la \ diff --cc src/version_dll.rc index 1abe9f54,70e758ad..a5703f90 --- a/src/version_dll.rc +++ b/src/version_dll.rc @@@ -9,20 -9,21 +9,35 @@@ VERSIONINFO_1 VERSIONINF { BLOCK "040904E4" { ++<<<<<<< HEAD + VALUE "FileDescription", "Hamlib DLL" + VALUE "FileVersion", "4.6.0.0" + VALUE "ProductName", "Hamlib" + VALUE "ProductVersion", HAMLIBDATETIME + VALUE "InternalName", "sha256" + VALUE "LegalCopyright", "Copyright Hamlib Team 2022" + VALUE "OriginalFilename", "libhamlib-4.dll" ++======= + VALUE "CompanyName", "Hamlib Team\000" + VALUE "FileDescription", "Hamlib DLL\000" + VALUE "ProductName", "Hamlib\000" + VALUE "FileVersion", 4,6,0,0 + VALUE "ProductVersion", HAMLIBDATETIME + VALUE "InternalName", "sha256" + VALUE "LegalCopyright", "Copyright Hamlib Team 2022\000" + VALUE "OriginalFilename", "libhamlib-4.dll\000" ++>>>>>>> cafc094788fcdd65e5fb936e5451a08b780c8ecd } } BLOCK "VarFileInfo" { ++<<<<<<< HEAD + VALUE "Translation", 0x409, 1200 ++======= + VALUE "Translation", 0x409, 1252 ++>>>>>>> cafc094788fcdd65e5fb936e5451a08b780c8ecd } } commit f31e1b7ad9b9cc3f035a3942fc4dc303e53b1ac4 Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Dec 22 11:50:50 2022 -0600 File/Properties/Details on hamlib-X.dll now shows information except for File version (still to be fixed) https://github.com/Hamlib/Hamlib/issues/1168 diff --git a/configure.ac b/configure.ac index a8527b8e..394d2701 100644 --- a/configure.ac +++ b/configure.ac @@ -15,6 +15,8 @@ dnl however, the use of '~' should be fine as apt (others?) will treat dnl it as an earlier version than the actual release. TNX KA6MAL dnl PACKAGE_NAME + " " + PACKAGE_VERSION must not exceed 20 chars! AC_INIT([Hamlib],[4.6~git],[ham...@li...],[hamlib],[http://www.hamlib.org]) +#AC_INIT([PRODUCT_NAME], [Hamlib]) +#AC_DEFINE([Hamlib], [PRODUCT_VERSION_RESOURCE]) AC_CONFIG_SRCDIR([include/hamlib/rig.h]) AC_CONFIG_MACRO_DIR([macros]) @@ -260,6 +262,7 @@ LT_PREREQ([2.2.6b]) dnl N.B. LT_INIT([win32-dll]) does not work for older libtool dnl so require new enough version above. LT_INIT([win32-dll]) +LT_LANG([Windows Resource]) ## -------------------------- ## @@ -267,6 +270,7 @@ LT_INIT([win32-dll]) ## -------------------------- ## dnl The host_os variable is set by the AC_CANONICAL_HOST macro above. +AM_CONDITIONAL([VERSIONDLL], false) AS_CASE(["$host_os"], [freebsd*], [ AM_CPPFLAGS="-I/usr/local/include ${AM_CPPFLAGS}" @@ -281,6 +285,7 @@ AS_CASE(["$host_os"], AC_SUBST([OSXLDFLAGS])], [mingw* | pw32* | cygwin*], [ + AM_CONDITIONAL([VERSIONDLL], true) WINLDFLAGS="-Wl,--output-def,libhamlib.def -Wl,--add-stdcall-alias" AC_SUBST([WINLDFLAGS]) diff --git a/src/Makefile.am b/src/Makefile.am old mode 100644 new mode 100755 index fe4431de..94ed7462 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,4 +1,3 @@ -# src/Makefile.am BUILT_SOURCES = $(builddir)/hamlibdatetime.h @@ -11,7 +10,12 @@ RIGSRC = hamlibdatetime.h rig.c serial.c serial.h misc.c misc.h register.c regis network.c network.h cm108.c cm108.h gpio.c gpio.h idx_builtin.h token.h \ par_nt.h microham.c microham.h amplifier.c amp_reg.c amp_conf.c \ amp_conf.h amp_settings.c extamp.c sleep.c sleep.h sprintflst.c \ - sprintflst.h cache.c cache.h snapshot_data.c snapshot_data.h + sprintflst.h cache.c cache.h snapshot_data.c snapshot_data.h + +if VERSIONDLL +RIGSRC += \ + version_dll.rc +endif lib_LTLIBRARIES = libhamlib.la libhamlib_la_SOURCES = $(RIGSRC) @@ -20,7 +24,7 @@ libhamlib_la_LDFLAGS = $(WINLDFLAGS) $(OSXLDFLAGS) -no-undefined -version-info $ libhamlib_la_LIBADD = $(top_builddir)/lib/libmisc.la $(top_builddir)/security/libsecurity.la \ $(BACKENDEPS) $(RIG_BACKENDEPS) $(ROT_BACKENDEPS) $(AMP_BACKENDEPS) $(NET_LIBS) $(MATH_LIBS) $(LIBUSB_LIBS) $(INDI_LIBS) -libhamlib_la_DEPENDENCIES = $(top_builddir)/lib/libmisc.la $(top_builddir)/security/libsecurity.la $(BACKENDEPS) $(RIG_BACKENDEPS) $(ROT_BACKENDEPS) $(AMP_BACKENDEPS) +libhamlib_la_DEPENDENCIES = $(top_builddir)/lib/libmisc.la $(top_builddir)/security/libsecurity.la $(BACKENDEPS) $(RIG_BACKENDEPS) $(ROT_BACKENDEPS) $(AMP_BACKENDEPS) EXTRA_DIST = Android.mk hamlibdatetime.h.in @@ -32,13 +36,29 @@ EXTRA_DIST = Android.mk hamlibdatetime.h.in hamlibdatetime.h: FORCE @if test -x $(top_srcdir)/.git ; then \ echo "/* This date time is from the last non-merge commit to Hamlib. */" > $(builddir)/$(@F).tmp ;\ - echo "#define HAMLIBDATETIME "\"$$(TZ=UTC git --git-dir=$(top_srcdir)/.git log --no-merges --date='format-local:%a %b %d %H:%M:%S %Y %z SHA=' --format='%cd' -n 1)$$(git --git-dir=$(top_srcdir)/.git log --no-merges | grep commit | head -n 1 | cut -c8-13)\" >> $(builddir)/$(@F).tmp ;\ + echo "#define HAMLIBDATETIME "\"$$(TZ=UTC git --git-dir=$(top_srcdir)/.git log --no-merges --date='format-local:%b %d %H:%M:%SZ %Y SHA=' --format='%cd' -n 1)$$(git --git-dir=$(top_srcdir)/.git log --no-merges | grep commit | head -n 1 | cut -c8-13)\" >> $(builddir)/$(@F).tmp ;\ diff -qN $(builddir)/$(@F).tmp $(builddir)/$(@F) ; test $$? -eq 0 || { echo "Generating SCS header \"$(builddir)/$(@F)\"" ; mv -f $(builddir)/$(@F).tmp $(builddir)/$(@F) ; } ;\ rm -f $(builddir)/$(@F).tmp ;\ else \ test -f $(srcdir)/$(@F) || cp $(srcdir)/$(@F).in $(srcdir)/$(@F) ;\ fi +RCCOMPILE = $(RC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) + +LTRCCOMPILE = $(LIBTOOL) --mode=compile --tag=RC $(RCCOMPILE) + +.rc.lo: + $(LTRCCOMPILE) -i "$<" -o "$@" + +.rc.o: + $(RCCOMPILE) -i "$<" -o "$@" + +.mc.rc: + $(WINDMC) "$<" + +#version.la: version.rc +# windres $(srcdir)/version.rc -o $(builddir)/version.o + FORCE: # If we are making a distribution out-of-source and we have generated diff --git a/src/version_dll.rc b/src/version_dll.rc new file mode 100755 index 00000000..1abe9f54 --- /dev/null +++ b/src/version_dll.rc @@ -0,0 +1,28 @@ +#include <windows.h> +#include <hamlibdatetime.h> + +#define VERSIONINFO_1 1 + +VERSIONINFO_1 VERSIONINFO +{ + BLOCK "StringFileInfo" + { + BLOCK "040904E4" + { + VALUE "FileDescription", "Hamlib DLL" + VALUE "FileVersion", "4.6.0.0" + VALUE "ProductName", "Hamlib" + VALUE "ProductVersion", HAMLIBDATETIME + VALUE "InternalName", "sha256" + VALUE "LegalCopyright", "Copyright Hamlib Team 2022" + VALUE "OriginalFilename", "libhamlib-4.dll" + } + + } + + BLOCK "VarFileInfo" + { + VALUE "Translation", 0x409, 1200 + } + +} commit cafc094788fcdd65e5fb936e5451a08b780c8ecd Author: Mike Black W9MDB <mdb...@ya...> Date: Wed Dec 21 15:44:36 2022 -0600 Add version information for Windows file/Properties/Details https://github.com/Hamlib/Hamlib/issues/1168 diff --git a/configure.ac b/configure.ac index a8527b8e..265279c9 100644 --- a/configure.ac +++ b/configure.ac @@ -15,6 +15,8 @@ dnl however, the use of '~' should be fine as apt (others?) will treat dnl it as an earlier version than the actual release. TNX KA6MAL dnl PACKAGE_NAME + " " + PACKAGE_VERSION must not exceed 20 chars! AC_INIT([Hamlib],[4.6~git],[ham...@li...],[hamlib],[http://www.hamlib.org]) +#AC_INIT([PRODUCT_NAME], [Hamlib]) +#AC_DEFINE([Hamlib], [PRODUCT_VERSION_RESOURCE]) AC_CONFIG_SRCDIR([include/hamlib/rig.h]) AC_CONFIG_MACRO_DIR([macros]) @@ -260,6 +262,7 @@ LT_PREREQ([2.2.6b]) dnl N.B. LT_INIT([win32-dll]) does not work for older libtool dnl so require new enough version above. LT_INIT([win32-dll]) +LT_LANG([Windows Resource]) ## -------------------------- ## @@ -282,6 +285,7 @@ AS_CASE(["$host_os"], [mingw* | pw32* | cygwin*], [ WINLDFLAGS="-Wl,--output-def,libhamlib.def -Wl,--add-stdcall-alias" + VERSIONDLL="version_dll.rc" AC_SUBST([WINLDFLAGS]) # Enable ld's "auto import" for executables diff --git a/src/Makefile.am b/src/Makefile.am index fe4431de..25e4f7cd 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -11,16 +11,16 @@ RIGSRC = hamlibdatetime.h rig.c serial.c serial.h misc.c misc.h register.c regis network.c network.h cm108.c cm108.h gpio.c gpio.h idx_builtin.h token.h \ par_nt.h microham.c microham.h amplifier.c amp_reg.c amp_conf.c \ amp_conf.h amp_settings.c extamp.c sleep.c sleep.h sprintflst.c \ - sprintflst.h cache.c cache.h snapshot_data.c snapshot_data.h + sprintflst.h cache.c cache.h snapshot_data.c snapshot_data.h $(VERSIONDLL) lib_LTLIBRARIES = libhamlib.la -libhamlib_la_SOURCES = $(RIGSRC) +libhamlib_la_SOURCES = $(RIGSRC) $(VERSIONDLL) libhamlib_la_LDFLAGS = $(WINLDFLAGS) $(OSXLDFLAGS) -no-undefined -version-info $(ABI_VERSION):$(ABI_REVISION):$(ABI_AGE) libhamlib_la_LIBADD = $(top_builddir)/lib/libmisc.la $(top_builddir)/security/libsecurity.la \ $(BACKENDEPS) $(RIG_BACKENDEPS) $(ROT_BACKENDEPS) $(AMP_BACKENDEPS) $(NET_LIBS) $(MATH_LIBS) $(LIBUSB_LIBS) $(INDI_LIBS) -libhamlib_la_DEPENDENCIES = $(top_builddir)/lib/libmisc.la $(top_builddir)/security/libsecurity.la $(BACKENDEPS) $(RIG_BACKENDEPS) $(ROT_BACKENDEPS) $(AMP_BACKENDEPS) +libhamlib_la_DEPENDENCIES = $(top_builddir)/lib/libmisc.la $(top_builddir)/security/libsecurity.la $(BACKENDEPS) $(RIG_BACKENDEPS) $(ROT_BACKENDEPS) $(AMP_BACKENDEPS) EXTRA_DIST = Android.mk hamlibdatetime.h.in @@ -32,13 +32,29 @@ EXTRA_DIST = Android.mk hamlibdatetime.h.in hamlibdatetime.h: FORCE @if test -x $(top_srcdir)/.git ; then \ echo "/* This date time is from the last non-merge commit to Hamlib. */" > $(builddir)/$(@F).tmp ;\ - echo "#define HAMLIBDATETIME "\"$$(TZ=UTC git --git-dir=$(top_srcdir)/.git log --no-merges --date='format-local:%a %b %d %H:%M:%S %Y %z SHA=' --format='%cd' -n 1)$$(git --git-dir=$(top_srcdir)/.git log --no-merges | grep commit | head -n 1 | cut -c8-13)\" >> $(builddir)/$(@F).tmp ;\ + echo "#define HAMLIBDATETIME "\"$$(TZ=UTC git --git-dir=$(top_srcdir)/.git log --no-merges --date='format-local:%b %d %H:%M:%SZ %Y SHA=' --format='%cd' -n 1)$$(git --git-dir=$(top_srcdir)/.git log --no-merges | grep commit | head -n 1 | cut -c8-13)\" >> $(builddir)/$(@F).tmp ;\ diff -qN $(builddir)/$(@F).tmp $(builddir)/$(@F) ; test $$? -eq 0 || { echo "Generating SCS header \"$(builddir)/$(@F)\"" ; mv -f $(builddir)/$(@F).tmp $(builddir)/$(@F) ; } ;\ rm -f $(builddir)/$(@F).tmp ;\ else \ test -f $(srcdir)/$(@F) || cp $(srcdir)/$(@F).in $(srcdir)/$(@F) ;\ fi +RCCOMPILE = $(RC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) + +LTRCCOMPILE = $(LIBTOOL) --mode=compile --tag=RC $(RCCOMPILE) + +.rc.lo: + $(LTRCCOMPILE) -i "$<" -o "$@" + +.rc.o: + $(RCCOMPILE) -i "$<" -o "$@" + +.mc.rc: + $(WINDMC) "$<" + +#version.la: version.rc +# windres $(srcdir)/version.rc -o $(builddir)/version.o + FORCE: # If we are making a distribution out-of-source and we have generated diff --git a/src/version_dll.rc b/src/version_dll.rc new file mode 100755 index 00000000..70e758ad --- /dev/null +++ b/src/version_dll.rc @@ -0,0 +1,29 @@ +#include <windows.h> +#include <hamlibdatetime.h> + +#define VERSIONINFO_1 1 + +VERSIONINFO_1 VERSIONINFO +{ + BLOCK "StringFileInfo" + { + BLOCK "040904E4" + { + VALUE "CompanyName", "Hamlib Team\000" + VALUE "FileDescription", "Hamlib DLL\000" + VALUE "ProductName", "Hamlib\000" + VALUE "FileVersion", 4,6,0,0 + VALUE "ProductVersion", HAMLIBDATETIME + VALUE "InternalName", "sha256" + VALUE "LegalCopyright", "Copyright Hamlib Team 2022\000" + VALUE "OriginalFilename", "libhamlib-4.dll\000" + } + + } + + BLOCK "VarFileInfo" + { + VALUE "Translation", 0x409, 1252 + } + +} commit b153bcd1e5604b55fd5c0d1b46389909f074c169 Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Dec 20 08:29:12 2022 -0600 Change TX-500 to only have 9600 baud available https://github.com/Hamlib/Hamlib/issues/1188 diff --git a/rigs/kenwood/tx500.c b/rigs/kenwood/tx500.c index 0cb037ba..6edeffdc 100644 --- a/rigs/kenwood/tx500.c +++ b/rigs/kenwood/tx500.c @@ -127,15 +127,15 @@ const struct rig_caps tx500_caps = RIG_MODEL(RIG_MODEL_LAB599_TX500), .model_name = "TX-500", .mfg_name = "Lab599", - .version = BACKEND_VER ".2", + .version = BACKEND_VER ".3", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, .ptt_type = RIG_PTT_RIG, .dcd_type = RIG_DCD_RIG, .port_type = RIG_PORT_SERIAL, - .serial_rate_min = 1200, - .serial_rate_max = 57600, + .serial_rate_min = 9600, + .serial_rate_max = 9600, .serial_data_bits = 8, .serial_stop_bits = 1, .serial_parity = RIG_PARITY_NONE, commit f468fa3c1d93e93652cbdbfc8998546b6a79a422 Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Dec 19 16:58:44 2022 -0600 Allow POWERSDR to do commands when powered off diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c index 6cb82915..1b356aac 100644 --- a/tests/rigctl_parse.c +++ b/tests/rigctl_parse.c @@ -1752,7 +1752,8 @@ readline_repeat: && cmd_entry->cmd != '3' // dump_conf && cmd_entry->cmd != 0x8f // dump_state && cmd_entry->cmd != 0xf0 // chk_vfo - && cmd_entry->cmd != 0x87) // set_powerstat + && cmd_entry->cmd != 0x87 // set_powerstat + && my_rig->caps->rig_model != RIG_MODEL_POWERSDR) // some rigs can do stuff when powered off { rig_debug(RIG_DEBUG_WARN, "%s: command %s not allowed when rig is powered off\n", __func__, commit 31e911edb87e3eeec794cb4d26e8bcfea9cd6834 Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Dec 19 14:55:14 2022 -0600 Remove powerstat from TX-500 -- was always responding PS0; https://github.com/Hamlib/Hamlib/issues/1188 diff --git a/rigs/kenwood/tx500.c b/rigs/kenwood/tx500.c index d5cb6398..0cb037ba 100644 --- a/rigs/kenwood/tx500.c +++ b/rigs/kenwood/tx500.c @@ -127,7 +127,7 @@ const struct rig_caps tx500_caps = RIG_MODEL(RIG_MODEL_LAB599_TX500), .model_name = "TX-500", .mfg_name = "Lab599", - .version = BACKEND_VER ".1", + .version = BACKEND_VER ".2", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -318,8 +318,8 @@ const struct rig_caps tx500_caps = .set_channel = ts2000_set_channel, .set_trn = kenwood_set_trn, .get_trn = kenwood_get_trn, - .set_powerstat = kenwood_set_powerstat, - .get_powerstat = kenwood_get_powerstat, + //.set_powerstat = kenwood_set_powerstat, + //.get_powerstat = kenwood_get_powerstat, .get_info = kenwood_get_info, .reset = kenwood_reset, .hamlib_check_rig_caps = HAMLIB_CHECK_RIG_CAPS commit 287fb9091b6479b06eaa55981da149c43145ce60 Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Dec 19 14:38:58 2022 -0600 Update info in hamlib_tuner_control https://github.com/Hamlib/Hamlib/issues/1192 diff --git a/tests/hamlib_tuner_control b/tests/hamlib_tuner_control index 4f5b923e..d8836c06 100755 --- a/tests/hamlib_tuner_control +++ b/tests/hamlib_tuner_control @@ -1,4 +1,9 @@ #!/bin/sh +# Put this script in /usr/local/bin +# --set-conf=tuner_contrl_pathname=/usr/local/bin/hamlib_tuner_control +# Or use a batch file in Windows for example in C:\Util\tuner.bat +# echo Tuner %1 +# --set-conf=C:/Util/tuner.bat if [ "$#" -eq 0 ] then echo "Expected arg 0 or 1...got nothing" commit 04b18c9d5be503a064c9198843408799d2c53e0f Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Dec 19 12:55:18 2022 -0600 Add --set-conf=tuner_control_pathname=hamlib_tuner_control Program will be passed 0 or 1 (Off or On) Example script in tests/hamlib_tuner_control https://github.com/Hamlib/Hamlib/issues/1192 diff --git a/NEWS b/NEWS index 730d3779..36502060 100644 --- a/NEWS +++ b/NEWS @@ -14,6 +14,10 @@ Version 5.x -- future Version 4.6 * 2023-11-XX -- Planned for Nov 2023 + * Add --set-conf=tuner_control_pathname=hamlib_tuner_control (default) + If file exists then it will be called with 0/1 (Off/On) argument + with 'U TUNER 0' or 'U TUNER 1" + Default path is for current directory * Add MDS 4710/9710 rigs * Add FLIR PTU-D48, E46, D100, D300 rotors * Fix FTDX3000 rig split diff --git a/doc/man1/rigctl.1 b/doc/man1/rigctl.1 index 73bc1320..33e75464 100644 --- a/doc/man1/rigctl.1 +++ b/doc/man1/rigctl.1 @@ -187,8 +187,30 @@ above. Note the dummy device has no serial parameters. . .TP .BR \-C ", " \-\-set\-conf = \fIparm=val\fP [ \fI,parm=val\fP ] -Set radio configuration parameter(s), e.g. -.IR stop_bits=2 . +Set configuration parameter(s). Some common ones are: +.in +4n +.EX +.RB write_delay: "Delay in ms between each byte sent out" +.RB post_write_delay: "Delay in ms between each command sent out" +.RB timeout: "Timeout in ms" +.RB retry: "Max number of retry" +.RB ptt_type: "Push-To-Talk interface type override" +.RB ptt_pathname: "Path name to the device file of the Push-To-Talk" +.RB ptt_bitnum: "Push-To-Talk GPIO bit number" +.RB dcd_type: "Data Carrier Detect (or squelch) interface type override" +.RB dcd_pathname: "Path name to the device file of the Data Carrier Detect (or squelch)" +.RB lo_freq: "Frequency to add to the VFO frequency for use with a transverter" +.RB auto_power_on: "True enables compatible rigs to be powered up on open" +.RB auto_power_off: "True enables compatible rigs to be powered down on close" +.RB auto_disable_screensaver: "True enables compatible rigs to have their screen saver disabled on open" +.RB disable_yaesu_bandselect: "True disables the automatic band select on band change for Yaesu rigs" +.RB ptt_share: "True enables ptt port to be shared with other apps" +.RB twiddle_timeout: "For satellite ops when VFOB is twiddled will pause VFOB commands until timeout" +.RB twiddle_rit: "Suppress get_freq on VFOB for RIT tuning satellites" +.RB async: "True enables asynchronous data transfer for backends that support it. This allows use of transceive and spectrum data." +.RB tuner_control_pathname: "Path name to a script/program to control a tuner with 1 argument of 0/1 for Tuner Off/On" +.EE +.in .IP Use the .B -L diff --git a/doc/man1/rigctld.1 b/doc/man1/rigctld.1 index 391920a7..0e82f40d 100644 --- a/doc/man1/rigctld.1 +++ b/doc/man1/rigctld.1 @@ -293,8 +293,30 @@ above. . .TP .BR \-C ", " \-\-set\-conf = \fIparm=val\fP [ \fI,parm=val\fP ] -Set radio configuration parameter(s), e.g. -.IR stop_bits=2 . +Set configuration parameter(s). Some common ones are: +.in +4 +.EX +.RB write_delay: "Delay in ms between each byte sent out" +.RB post_write_delay: "Delay in ms between each command sent out" +.RB timeout: "Timeout in ms" +.RB retry: "Max number of retry" +.RB ptt_type: "Push-To-Talk interface type override" +.RB ptt_pathname: "Path name to the device file of the Push-To-Talk" +.RB ptt_bitnum: "Push-To-Talk GPIO bit number" +.RB dcd_type: "Data Carrier Detect (or squelch) interface type override" +.RB dcd_pathname: "Path name to the device file of the Data Carrier Detect (or squelch)" +.RB lo_freq: "Frequency to add to the VFO frequency for use with a transverter" +.RB auto_power_on: "True enables compatible rigs to be powered up on open" +.RB auto_power_off: "True enables compatible rigs to be powered down on close" +.RB auto_disable_screensaver: "True enables compatible rigs to have their screen saver disabled on open" +.RB disable_yaesu_bandselect: "True disables the automatic band select on band change for Yaesu rigs" +.RB ptt_share: "True enables ptt port to be shared with other apps" +.RB twiddle_timeout: "For satellite ops when VFOB is twiddled will pause VFOB commands until timeout" +.RB twiddle_rit: "Suppress get_freq on VFOB for RIT tuning satellites" +.RB async: "True enables asynchronous data transfer for backends that support it. This allows use of transceive and spectrum data." +.RB tuner_control_pathname: "Path name to a script/program to control a tuner with 1 argument of 0/1 for Tuner Off/On" +.EE +.in .IP Use the .B -L diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h index 6c768168..d93e7986 100644 --- a/include/hamlib/rig.h +++ b/include/hamlib/rig.h @@ -2588,6 +2588,7 @@ struct rig_state { int depth; /*<! a depth counter to use for debug indentation and such */ int lock_mode; /*<! flag that prevents mode changes if ~= 0 -- see set/get_lock_mode */ powerstat_t powerstat; /*<! power status */ + char *tuner_control_pathname; /*<! Path to external tuner control program that get 0/1 (Off/On) argument */ }; //! @cond Doxygen_Suppress diff --git a/src/conf.c b/src/conf.c index e2149692..92f067a3 100644 --- a/src/conf.c +++ b/src/conf.c @@ -170,6 +170,11 @@ static const struct confparams frontend_cfg_params[] = "True enables asynchronous data transfer for backends that support it. This allows use of transceive and spectrum data.", "0", RIG_CONF_CHECKBUTTON, { } }, + { + TOK_TUNER_CONTROL_PATHNAME, "tuner_control_pathname", "Tuner script/program path name", + "Path name to a script/program to control a tuner with 1 argument of 0/1 for Tuner Off/On", + "hamlib_tuner_control", RIG_CONF_STRING, + }, { RIG_CONF_END, NULL, } }; @@ -715,6 +720,11 @@ static int frontend_set_conf(RIG *rig, token_t token, const char *val) rs->async_data_enabled = val_i ? 1 : 0; break; + case TOK_TUNER_CONTROL_PATHNAME: + rs->tuner_control_pathname = strdup(val); // yeah -- need to free it + break; + + default: return -RIG_EINVAL; } diff --git a/src/rig.c b/src/rig.c index 52a7a393..87876dcb 100644 --- a/src/rig.c +++ b/src/rig.c @@ -143,6 +143,8 @@ const char hamlib_copyright[231] = /* hamlib 1.2 ABI specifies 231 bytes */ # define DEFAULT_CM108_PORT "/dev/hidraw0" #endif +#define DEFAULT_TUNER_CONTROL_PATHNAME "hamlib_tuner_control" + #if defined(WIN32) && !defined(__CYGWIN__) /* FIXME: Determine correct GPIO bit number for W32 using MinGW. */ # define DEFAULT_CM108_PTT_BITNUM 2 @@ -564,6 +566,8 @@ RIG *HAMLIB_API rig_init(rig_model_t rig_model) rs->rigport.asyncio = 0; #endif + rs->tuner_control_pathname = DEFAULT_TUNER_CONTROL_PATHNAME; + switch (caps->port_type) { case RIG_PORT_SERIAL: diff --git a/src/settings.c b/src/settings.c index 73d1fc98..33c24b76 100644 --- a/src/settings.c +++ b/src/settings.c @@ -39,6 +39,7 @@ #include <stdio.h> #include <stdlib.h> #include <errno.h> /* Error number definitions */ +#include <unistd.h> #include <hamlib/rig.h> #include "cal.h" @@ -488,11 +489,34 @@ int HAMLIB_API rig_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) caps = rig->caps; - if (caps->set_func == NULL || !rig_has_set_func(rig, func)) + if ((caps->set_func == NULL || !rig_has_set_func(rig, func)) + && access(rig->state.tuner_control_pathname, X_OK) == -1) { return -RIG_ENAVAIL; } + if (access(rig->state.tuner_control_pathname, X_OK) != -1) + { + char cmd[1024]; + snprintf(cmd, sizeof(cmd), "%s %d", rig->state.tuner_control_pathname, status); + rig_debug(RIG_DEBUG_TRACE, "%s: Calling external script '%s'\n", __func__, + rig->state.tuner_control_pathname); + retcode = system(cmd); + + if (retcode != 0) { rig_debug(RIG_DEBUG_ERR, "%s: executing %s failed\n", __func__, rig->state.tuner_control_pathname); } + + return (retcode == 0 ? RIG_OK : -RIG_ERJCTED); + } + else + { + if (strcmp(rig->state.tuner_control_pathname, "hamlib_tuner_control")) + { + rig_debug(RIG_DEBUG_ERR, "%s: unable to find '%s'\n", __func__, + rig->state.tuner_control_pathname); + return -RIG_EINVAL; + } + } + if ((caps->targetable_vfo & RIG_TARGETABLE_FUNC) || vfo == RIG_VFO_CURR || vfo == rig->state.current_vfo) diff --git a/src/token.h b/src/token.h index 46b80f19..186f9b1e 100644 --- a/src/token.h +++ b/src/token.h @@ -93,6 +93,8 @@ #define TOK_FLUSHX TOKEN_FRONTEND(36) /** \brief Asynchronous data transfer support */ #define TOK_ASYNC TOKEN_FRONTEND(37) +/** \brief Tuner external control pathname */ +#define TOK_TUNER_CONTROL_PATHNAME TOKEN_FRONTEND(38) /* * rig specific tokens diff --git a/tests/hamlib_tuner_control b/tests/hamlib_tuner_control new file mode 100755 index 00000000..4f5b923e --- /dev/null +++ b/tests/hamlib_tuner_control @@ -0,0 +1,8 @@ +#!/bin/sh +if [ "$#" -eq 0 ] +then +echo "Expected arg 0 or 1...got nothing" +exit 1 +fi +echo Tuner Control $1 +echo `date` " " Tuner Control $1 >>tuner_control.log commit ea29263f3512dda2f93ba3429189a20a6782a305 Author: Mike Black W9MDB <mdb...@ya...> Date: Sun Dec 18 09:01:27 2022 -0600 Fix unidirectional rig cached frequency (e.g. FT736R) https://github.com/Hamlib/Hamlib/issues/1187 diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h index e0d31a52..6c768168 100644 --- a/include/hamlib/rig.h +++ b/include/hamlib/rig.h @@ -3395,6 +3395,7 @@ extern HAMLIB_EXPORT(int) rig_set_vfo_opt(RIG *rig, int status); extern HAMLIB_EXPORT(int) rig_get_vfo_info(RIG *rig, vfo_t vfo, freq_t *freq, rmode_t *mode, pbwidth_t *width, split_t *split, int *satmode); extern HAMLIB_EXPORT(int) rig_get_rig_info(RIG *rig, char *response, int max_response_len); extern HAMLIB_EXPORT(int) rig_get_cache(RIG *rig, vfo_t vfo, freq_t *freq, int * cache_ms_freq, rmode_t *mode, int *cache_ms_mode, pbwidth_t *width, int *cache_ms_width); +extern HAMLIB_EXPORT(int) rig_get_cache_freq(RIG *rig, vfo_t vfo, freq_t *freq, int * cache_ms_freq); extern HAMLIB_EXPORT(int) rig_set_clock(RIG *rig, int year, int month, int day, int hour, int min, int sec, double msec, int utc_offset); extern HAMLIB_EXPORT(int) rig_get_clock(RIG *rig, int *year, int *month, int *day, int *hour, int *min, int *sec, double *msec, int *utc_offset); diff --git a/rigs/yaesu/ft736.c b/rigs/yaesu/ft736.c index 52cd85fc..8858512f 100644 --- a/rigs/yaesu/ft736.c +++ b/rigs/yaesu/ft736.c @@ -31,6 +31,7 @@ #include "misc.h" #include "yaesu.h" #include "tones.h" +#include "cache.h" @@ -99,7 +100,7 @@ const struct rig_caps ft736_caps = RIG_MODEL(RIG_MODEL_FT736R), .model_name = "FT-736R", .mfg_name = "Yaesu", - .version = "20221214.0", + .version = "20221218.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -270,6 +271,7 @@ int ft736_set_freq(RIG *rig, vfo_t vfo, freq_t freq) { unsigned char cmd[YAESU_CMD_LENGTH] = { 0x00, 0x00, 0x00, 0x00, 0x01}; struct ft736_priv_data *priv = (struct ft736_priv_data *)rig->state.priv; + int retval; // we will assume requesting to set VFOB is split mode if (vfo == RIG_VFO_B) { return rig_set_split_freq(rig, vfo, freq); } @@ -288,8 +290,11 @@ int ft736_set_freq(RIG *rig, vfo_t vfo, freq_t freq) cmd[0] = (cmd[0] & 0x0f) | 0xc0; } - /* Frequency set */ - return write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH); + retval = write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH); + + if (retval == RIG_OK) { rig_set_cache_freq(rig, vfo, freq); } + + return retval; } int ft736_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) @@ -297,7 +302,7 @@ int ft736_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) rig_debug(RIG_DEBUG_VERBOSE, "%s: called\n", __func__); if (vfo == RIG_VFO_A || vfo == RIG_VFO_MAIN) { *freq = rig->state.cache.freqMainA; } - else { *freq = rig->state.cache.freqMainB; } + else { rig_get_cache_freq(rig, vfo, freq, NULL); } return RIG_OK; } diff --git a/src/cache.c b/src/cache.c index 7bdafbfa..b912bdee 100644 --- a/src/cache.c +++ b/src/cache.c @@ -442,6 +442,41 @@ int rig_get_cache(RIG *rig, vfo_t vfo, freq_t *freq, int *cache_ms_freq, return RIG_OK; } +/** + * \brief get cached values for a VFO + * \param rig The rig handle + * \param vfo The VFO to get information from + * \param freq The frequency is stored here + * \param cache_ms_freq The age of the last frequency update in ms -- NULL if you don't want it + + * Use this to query the frequency cache and then determine to actually fetch data from + * the rig. + * + * \return RIG_OK if the operation has been successful, otherwise + * a negative value if an error occurred (in which case, cause is + * set appropriately). + * + */ +int rig_get_cache_freq(RIG *rig, vfo_t vfo, freq_t *freq, int *cache_ms_freq_p) +{ + rmode_t mode; + int cache_ms_freq; + int cache_ms_mode; + pbwidth_t width; + int cache_ms_width; + int retval; + retval = rig_get_cache(rig, vfo, freq, &cache_ms_freq, &mode, &cache_ms_mode, + &width, &cache_ms_width); + + if (retval == RIG_OK) + { + if (cache_ms_freq_p) { *cache_ms_freq_p = cache_ms_freq; } + } + + return retval; +} + + void rig_cache_show(RIG *rig, const char *func, int line) { rig_debug(RIG_DEBUG_CACHE, diff --git a/src/rig.c b/src/rig.c index 175bfd9c..52a7a393 100644 --- a/src/rig.c +++ b/src/rig.c @@ -1806,7 +1806,11 @@ int HAMLIB_API rig_set_freq(RIG *rig, vfo_t vfo, freq_t freq) if (retcode != RIG_OK) { RETURNFUNC(retcode); } - rig_set_cache_freq(rig, vfo, (freq_t)0); + // Unidirectional rigs do not reset cache + if (rig->caps->rig_model != RIG_MODEL_FT736R) + { + rig_set_cache_freq(rig, vfo, (freq_t)0); + } #if 0 // this verification seems to be causing bad behavior on some rigs commit b1828d951a2159e87b6208f6eb3aabdacc03b6aa Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Dec 17 17:23:52 2022 -0600 Ensure get_powerstat return RIG_OK when rig does not have get_powerstat https://github.com/Hamlib/Hamlib/issues/1189 diff --git a/src/rig.c b/src/rig.c index e5075d15..175bfd9c 100644 --- a/src/rig.c +++ b/src/rig.c @@ -6032,7 +6032,7 @@ 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); + RETURNFUNC(RIG_OK); } *status = RIG_POWER_OFF; // default now to power off until proven otherwise in get_powerstat commit 9970a2767d2f49c427c51c6a0780a41010269b89 Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Dec 17 10:35:56 2022 -0600 Reset rig->state.cache.split so it can be set again when rigctld reopens the rig https://github.com/Hamlib/Hamlib/issues/1187 diff --git a/src/rig.c b/src/rig.c index 71f32138..e5075d15 100644 --- a/src/rig.c +++ b/src/rig.c @@ -1518,6 +1518,8 @@ int HAMLIB_API rig_close(RIG *rig) remove_opened_rig(rig); + // zero split so it will allow it to be set again on open for rigctld + rig->state.cache.split = 0; rs->comm_state = 0; rig_debug(RIG_DEBUG_VERBOSE, "%s(%d): %p rs->comm_state==0?=%d\n", __func__, __LINE__, &rs->comm_state, commit 04f5195cfd68df95bdaaa185b577555390f1276c Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Dec 17 10:19:46 2022 -0600 Do not reset cache for unidirectional rigs https://github.com/Hamlib/Hamlib/issues/1187 diff --git a/src/rig.c b/src/rig.c index f5c792fd..71f32138 100644 --- a/src/rig.c +++ b/src/rig.c @@ -1895,7 +1895,12 @@ int HAMLIB_API rig_set_freq(RIG *rig, vfo_t vfo, freq_t freq) #endif ) { - rig_set_cache_freq(rig, RIG_VFO_ALL, (freq_t)0); + // Unidirectional rigs do not reset cache + if (rig->caps->rig_model != RIG_MODEL_FT736R) + { + rig_set_cache_freq(rig, RIG_VFO_ALL, (freq_t)0); + } + HAMLIB_TRACE; retcode = rig_get_freq(rig, vfo, &freq_new); commit 9508c45f00558bce22409c472b0de3d5d95f40c8 Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Dec 17 10:00:07 2022 -0600 Update NEWS diff --git a/NEWS b/NEWS index 3fadca9e..730d3779 100644 --- a/NEWS +++ b/NEWS @@ -19,6 +19,7 @@ Version 4.6 * Fix FTDX3000 rig split Version 4.5.2 + * Fix rig.c calling rig_get_mode when backend does not have get_mode * Fix kenwood_ts890_get_level * Add Prosistel D elevation CBOX az to fix problem with azimuth control * 2022-12-XX -- Planned for Dec 2022 commit 120c580de0b67a9da1deac2b53e4238fd3774d57 Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Dec 17 09:59:04 2022 -0600 FT-736 did not have get_mode so only call get_mode when available https://github.com/Hamlib/Hamlib/issues/1187 diff --git a/src/rig.c b/src/rig.c index 477c5c74..f5c792fd 100644 --- a/src/rig.c +++ b/src/rig.c @@ -1344,14 +1344,18 @@ int HAMLIB_API rig_open(RIG *rig) rig_debug(RIG_DEBUG_VERBOSE, "%s(%d): Current split=%d, tx_vfo=%s\n", __func__, __LINE__, split, rig_strvfo(tx_vfo)); rmode_t mode; - pbwidth_t width; - rig_get_mode(rig, RIG_VFO_A, &mode, &width); + pbwidth_t width = 2400; // we'll use 2400Hz as default width - if (split) + if (rig->caps->get_mode) { - rig_debug(RIG_DEBUG_VERBOSE, "xxxsplit=%d\n", split); - HAMLIB_TRACE; - rig_get_mode(rig, RIG_VFO_B, &mode, &width); + rig_get_mode(rig, RIG_VFO_A, &mode, &width); + + if (split) + { + rig_debug(RIG_DEBUG_VERBOSE, "xxxsplit=%d\n", split); + HAMLIB_TRACE; + rig_get_mode(rig, RIG_VFO_B, &mode, &width); + } } } } @@ -2891,7 +2895,8 @@ int HAMLIB_API rig_get_vfo(RIG *rig, vfo_t *vfo) if (cache_ms < rig->state.cache.timeout_ms) { *vfo = rig->state.cache.vfo; - rig_debug(RIG_DEBUG_TRACE, "%s: cache hit age=%dms, vfo=%s\n", __func__, cache_ms, rig_strvfo(*vfo)); + rig_debug(RIG_DEBUG_TRACE, "%s: cache hit age=%dms, vfo=%s\n", __func__, + cache_ms, rig_strvfo(*vfo)); ELAPSED2; RETURNFUNC(RIG_OK); } @@ -4424,7 +4429,7 @@ int HAMLIB_API rig_set_split_mode(RIG *rig, if (tx_vfo == RIG_VFO_B || tx_vfo == RIG_VFO_SUB) { rx_vfo = RIG_VFO_A; } - if (vfo == RIG_VFO_CURR && tx_vfo == RIG_VFO_B) { rx_vfo = RIG_VFO_A; } + if (vfo == RIG_VFO_CURR && tx_vfo == RIG_VFO_B) { rx_vfo = RIG_VFO_A; } else if (vfo == RIG_VFO_CURR && tx_vfo == RIG_VFO_A) { rx_vfo = RIG_VFO_B; } else if (vfo == RIG_VFO_CURR && tx_vfo == RIG_VFO_MAIN) { rx_vfo = RIG_VFO_SUB; } else if (vfo == RIG_VFO_CURR && tx_vfo == RIG_VFO_SUB) { rx_vfo = RIG_VFO_MAIN; } commit 250a5b0211fd2e8000dcf02e943915940a2ff911 Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Dec 15 17:14:00 2022 -0600 Update NEWS diff --git a/NEWS b/NEWS index d2d0bb3c..3fadca9e 100644 --- a/NEWS +++ b/NEWS @@ -19,6 +19,7 @@ Version 4.6 * Fix FTDX3000 rig split Version 4.5.2 + * Fix kenwood_ts890_get_level * Add Prosistel D elevation CBOX az to fix problem with azimuth control * 2022-12-XX -- Planned for Dec 2022 * Fix FT736R gpredict usage by adding cached get_freq commit f554c3a7ffb495cb0ad007d0b1cc86c183c78696 Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Dec 15 17:11:08 2022 -0600 Fix kenwood_ts890_get_level -- thanks to N3GB George Baltz diff --git a/rigs/kenwood/ts890s.c b/rigs/kenwood/ts890s.c index 9c23b131..dc2781b9 100644 --- a/rigs/kenwood/ts890s.c +++ b/rigs/kenwood/ts890s.c @@ -305,7 +305,7 @@ int kenwood_ts890_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) if (rig->caps->swr_cal.size) { - val->f = rig_raw2val_float(val->i, &rig->caps->swr_cal); + val->f = rig_raw2val_float(levelint, &rig->caps->swr_cal); } else { @@ -432,7 +432,7 @@ const struct rig_caps ts890s_caps = RIG_MODEL(RIG_MODEL_TS890S), .model_name = "TS-890S", .mfg_name = "Kenwood", - .version = BACKEND_VER ".9", + .version = BACKEND_VER ".10", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, commit 32b1ce161e5f2726be1f195b531eca14c196514a Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Dec 15 12:04:14 2022 -0600 Update NEWS diff --git a/NEWS b/NEWS index c665f25e..d2d0bb3c 100644 --- a/NEWS +++ b/NEWS @@ -19,6 +19,7 @@ Version 4.6 * Fix FTDX3000 rig split Version 4.5.2 + * Add Prosistel D elevation CBOX az to fix problem with azimuth control * 2022-12-XX -- Planned for Dec 2022 * Fix FT736R gpredict usage by adding cached get_freq * Fix get_powerstat problem with Log4OM/Flex and others commit 830bf5a94171847ff82ce9f22edcfd3a2a2fecf8 Merge: 2a84386a 9eecfc3b Author: Michael Black <mdb...@ya...> Date: Thu Dec 15 11:42:53 2022 -0600 Merge pull request #1191 from PianetaRadio/master Rotator Prosistel elevation with azimuth logic commit 9eecfc3b2df1804f6ddccafea160fe6f9d80efc6 Author: PianetaRadio <789...@us...> Date: Thu Dec 15 18:24:55 2022 +0100 Update rotlist.h Add Elevation rotator with Control box responding to azimuth logic diff --git a/include/hamlib/rotlist.h b/include/hamlib/rotlist.h index 2ede3f89..2565d56a 100644 --- a/include/hamlib/rotlist.h +++ b/include/hamlib/rotlist.h @@ -557,6 +557,7 @@ #define ROT_MODEL_PROSISTEL_D_AZ ROT_MAKE_MODEL(ROT_PROSISTEL, 1) #define ROT_MODEL_PROSISTEL_D_EL ROT_MAKE_MODEL(ROT_PROSISTEL, 2) #define ROT_MODEL_PROSISTEL_COMBI_TRACK_AZEL ROT_MAKE_MODEL(ROT_PROSISTEL, 3) +#define ROT_MODEL_PROSISTEL_D_EL_CBOXAZ ROT_MAKE_MODEL(ROT_PROSISTEL, 4) /** commit 40066a6cfa0cc7d49d9e2a25edf5dcac46421e84 Author: PianetaRadio <789...@us...> Date: Thu Dec 15 18:21:23 2022 +0100 Update prosistel.c Add Elevation rotator with Control box responding to azimuth logic diff --git a/rotators/prosistel/prosistel.c b/rotators/prosistel/prosistel.c index 1ab58602..76a2a37f 100644 --- a/rotators/prosistel/prosistel.c +++ b/rotators/prosistel/prosistel.c @@ -379,6 +379,15 @@ static const struct prosistel_rot_priv_caps prosistel_rot_combitrack_priv_caps = }; +// Elevation rotator with Control box D using azimuth logic +static const struct prosistel_rot_priv_caps prosistel_rot_el_cboxaz = +{ + .angle_multiplier = 1.0f, + .stop_angle = 997, + .elevation_id = 'A', +}; + + /* * Prosistel rotator capabilities */ @@ -487,7 +496,7 @@ const struct rot_caps prosistel_combi_track_azel_rot_caps = }; -//Elevation rotator with ControlBox using azimuth logic +// Elevation rotator with Control box D using azimuth logic const struct rot_caps prosistel_d_el_cboxaz_rot_caps = { ROT_MODEL(ROT_MODEL_PROSISTEL_D_EL_CBOXAZ), commit b1ac588667e74af74e7eb32be3badfc4ad1e77d8 Author: PianetaRadio <789...@us...> Date: Thu Dec 15 18:12:32 2022 +0100 Update prosistel.h Add Elevation rotator with Control box responding to azimuth logic diff --git a/rotators/prosistel/prosistel.h b/rotators/prosistel/prosistel.h index ee7b3594..2b1b90c8 100644 --- a/rotators/prosistel/prosistel.h +++ b/rotators/prosistel/prosistel.h @@ -25,5 +25,6 @@ extern const struct rot_caps prosistel_d_az_rot_caps; extern const struct rot_caps prosistel_d_el_rot_caps; extern const struct rot_caps prosistel_combi_track_azel_rot_caps; +extern const struct rot_caps prosistel_d_el_cboxaz_rot_caps; #endif /* _ROT_PROSISTEL_H */ commit 7fc23e59a337e853e292e8e89d39d6a2179498ea Author: PianetaRadio <789...@us...> Date: Thu Dec 15 18:09:51 2022 +0100 Update prosistel.c Add Elevation rotator with Control box responding to azimuth logic diff --git a/rotators/prosistel/prosistel.c b/rotators/prosistel/prosistel.c index 511cde4a..1ab58602 100644 --- a/rotators/prosistel/prosistel.c +++ b/rotators/prosistel/prosistel.c @@ -486,6 +486,43 @@ const struct rot_caps prosistel_combi_track_azel_rot_caps = .get_position = prosistel_rot_get_position, }; + +//Elevation rotator with ControlBox using azimuth logic +const struct rot_caps prosistel_d_el_cboxaz_rot_caps = +{ + ROT_MODEL(ROT_MODEL_PROSISTEL_D_EL_CBOXAZ), + .model_name = "D elevation CBOX az", + .mfg_name = "Prosistel", + .version = "20221215.0", + .copyright = "LGPL", + .status = RIG_STATUS_STABLE, + .rot_type = ROT_TYPE_ELEVATION, + .port_type = RIG_PORT_SERIAL, + .serial_rate_min = 9600, + .serial_rate_max = 9600, + .serial_data_bits = 8, + .serial_stop_bits = 1, + .serial_parity = RIG_PARITY_NONE, + .serial_handshake = RIG_HANDSHAKE_NONE, + .write_delay = 0, + .post_write_delay = 0, + .timeout = 3000, + .retry = 3, + + .min_az = 0.0, + .max_az = 0.0, + .min_el = 0.0, + .max_el = 90.0, + + .priv = &prosistel_rot_el_cboxaz, + + .rot_open = prosistel_rot_open, + .stop = prosistel_rot_stop, + .set_position = prosistel_rot_set_position, + .get_position = prosistel_rot_get_position, +}; + + DECLARE_INITROT_BACKEND(prosistel) { rig_debug(RIG_DEBUG_VERBOSE, "%s: _init called\n", __func__); @@ -493,6 +530,7 @@ DECLARE_INITROT_BACKEND(prosistel) rot_register(&prosistel_d_az_rot_caps); rot_register(&prosistel_d_el_rot_caps); rot_register(&prosistel_combi_track_azel_rot_caps); + rot_register(&prosistel_d_el_cboxaz_rot_caps); return RIG_OK; } commit 2a84386ae89989158d9bc628654188219138f9d5 Author: Mike Black W9MDB <mdb...@ya...> Date: Wed Dec 14 22:59:46 2022 -0600 Add simft736.c and update others diff --git a/simulators/simft747gx.c b/simulators/simft736.c similarity index 70% copy from simulators/simft747gx.c copy to simulators/simft736.c index a0ce5cb8..da4e5c39 100644 --- a/simulators/simft747gx.c +++ b/simulators/simft736.c @@ -28,7 +28,7 @@ getmyline(int fd, unsigned char *buf) int n = 0; memset(buf, 0, BUFSIZE); - while (read(fd, &c, 1) > 0 && i < 5) + while (i < 5 && read(fd, &c, 1) > 0) { buf[i++] = c; n++; @@ -102,78 +102,63 @@ again: if (bytes != 5) { printf("Not 5 bytes? bytes=%d\n", bytes); + continue; } switch (buf[4]) { - case 0x01: - printf("SPLIT\n"); - break; - - case 0x02: - printf("MEMORY\n"); + case 0x00: + printf("CAT On\n"); break; - case 0x03: - printf("VFO_TO_M\n"); + case 0x80: + printf("CAT Off\n"); break; - case 0x04: - printf("DLOCK\n"); + case 0x01: + printf("FREQ_SET\n"); break; - case 0x05: - printf("A_BVFO\n"); + case 0x07: + printf("MODE_SET\n"); break; - case 0x06: - printf("M_TO_VFO\n"); + case 0x0e: + printf("Full Duplex On\n"); break; - case 0x07: - printf("UP500K\n"); + case 0x8e: + printf("Full Duplex Off\n"); break; case 0x08: - printf("DN500K\n"); + printf("Tx\n"); break; - case 0x09: - printf("CLAR\n"); + case 0x88: + printf("Rx\n"); break; - case 0x0a: - printf("FREQ_SET\n"); - break; - - case 0x0c: - ... [truncated message content] |
From: n0nb <n0...@us...> - 2022-12-09 14:26:01
|
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 477c94c8fbf1ec4b82fb976d569c9d87357f7d1d (commit) from aa50482c831001eef1bd585035b83dace93fdbfc (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 477c94c8fbf1ec4b82fb976d569c9d87357f7d1d Author: Nate Bargmann <n0...@n0...> Date: Fri Dec 9 08:24:36 2022 -0600 Quell groff warning of "font p not found". Font names need to be upper case in nroff. diff --git a/doc/man1/rigctl.1 b/doc/man1/rigctl.1 index 772173be..73bc1320 100644 --- a/doc/man1/rigctl.1 +++ b/doc/man1/rigctl.1 @@ -1289,7 +1289,7 @@ CW Skimmer is started and "set_lock_mode 0" when CW Skimmer is stopped. Returns current lock mode status 1=On, 2=Off (only useful when using rigctld) . .TP -.BR send_raw " \(aq" \fITerminator\fP "\(aq \(aq" \fIString\fp \(aq +.BR send_raw " \(aq" \fITerminator\fP "\(aq \(aq" \fIString\fP \(aq .EX Can send ASCII string or 0xnn values -- there can be no spaces in the command string. Possible terminator values are CR, LF, ;, ICOM, 0-100 (bytes to read), or -1 meaning unknown (will timeout on read) ----------------------------------------------------------------------- Summary of changes: doc/man1/rigctl.1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: n0nb <n0...@us...> - 2022-12-09 12:25:25
|
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 aa50482c831001eef1bd585035b83dace93fdbfc (commit) via 9eddf62687bd894a09ff02fef53500f5977794a0 (commit) via 0489df5bf10af2746b952c9cd00bb12ebdf8bd8f (commit) via d369b60f6d089a2a8691a9d9e8715156e8fcdafe (commit) via dd029a3082a1c53a3c139bcb98bb48ba6a69fd06 (commit) via 180e49754fe41754b5a075cdea1701830cabc01b (commit) via 458bb2d9e470afcec45601f90262c34cdbbc9153 (commit) via 8a057d8bf4fef2849698d820dc0250d22bad5ae8 (commit) via 07cc887432be93b191aa7b67c68a5b2962c4f06e (commit) via 0860bda83214382d1d0c887573d553cd0d9a4e86 (commit) via 0cc4ca778dc580ed5078eed51bbe4eeb294637ee (commit) via a522e6f6e7e0cdca8e0cbb8204a29d584431cc41 (commit) via c7d0004b36e60691f5f2e87acf538f505d6e5175 (commit) via b2d6a856a432aa7394d6b7887660d4dca504d842 (commit) via db690f37ff31fc303edf87c41358bcdc0d9ad9fc (commit) via 0bdb6827dabab3321fb10d835810c180f77fde99 (commit) via 82ef0a39bfb9ff5be56cd28c212b1954e8f39ba0 (commit) from 7b7a0460edfcef8afe1ef7f5b5b0f3e109751926 (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 aa50482c831001eef1bd585035b83dace93fdbfc Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Dec 8 22:37:22 2022 -0600 astyle flir.c diff --git a/rotators/flir/flir.c b/rotators/flir/flir.c index 7ae3ffc0..b1a8fa79 100644 --- a/rotators/flir/flir.c +++ b/rotators/flir/flir.c @@ -63,12 +63,12 @@ struct flir_priv_data char *magic_conf; - float_t resolution_pp; - float_t resolution_tp; + float_t resolution_pp; + float_t resolution_tp; }; static int flir_request(ROT *rot, char *request, char *response, - int resp_size) + int resp_size) { int return_value = -RIG_EINVAL; int retry_read = 0; @@ -78,45 +78,51 @@ static int flir_request(ROT *rot, char *request, char *response, rig_flush(&rot->state.rotport); - if (request) + if (request) + { + return_value = write_block(&rot->state.rotport, (unsigned char *)request, + strlen(request)); + + if (return_value != RIG_OK) { - return_value = write_block(&rot->state.rotport, (unsigned char *)request, - strlen(request)); - if (return_value != RIG_OK) - { - rig_debug(RIG_DEBUG_VERBOSE, "%s request not OK\n", __func__); - return return_value; - } + rig_debug(RIG_DEBUG_VERBOSE, "%s request not OK\n", __func__); + return return_value; } - //Is a direct response expected? - if (response != NULL) + } + + //Is a direct response expected? + if (response != NULL) + { + while (retry_read < rot->state.rotport.retry) { - while(retry_read < rot->state.rotport.retry) + memset(response, 0, (size_t)resp_size); + read_char = read_string(&rot->state.rotport, (unsigned char *)response, + resp_size, + "\r\n", sizeof("\r\n"), 0, 1); + + if (read_char > 0) { - memset(response, 0, (size_t)resp_size); - read_char = read_string(&rot->state.rotport, (unsigned char *)response, resp_size, - "\r\n", sizeof("\r\n"), 0, 1); - if(read_char > 0) + if (response[0] == '*') + { + rig_debug(RIG_DEBUG_VERBOSE, "accepted command %s\n", request); + return RIG_OK; + } + else { - if(response[0] == '*') - { - rig_debug(RIG_DEBUG_VERBOSE, "accepted command %s\n", request); - return RIG_OK; - } - else - { - rig_debug(RIG_DEBUG_VERBOSE, "NOT accepted command %s\n", request); - return -RIG_ERJCTED; - } - + rig_debug(RIG_DEBUG_VERBOSE, "NOT accepted command %s\n", request); + return -RIG_ERJCTED; } - retry_read++; + } - response = ""; - rig_debug(RIG_DEBUG_VERBOSE, "timeout for command %s\n", request); - return -RIG_ETIMEOUT; + + retry_read++; } + response = ""; + rig_debug(RIG_DEBUG_VERBOSE, "timeout for command %s\n", request); + return -RIG_ETIMEOUT; + } + return return_value; }; @@ -151,7 +157,7 @@ static int flir_init(ROT *rot) static int flir_cleanup(ROT *rot) { struct flir_priv_data *priv = (struct flir_priv_data *) - rot->state.priv; + rot->state.priv; rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); @@ -188,21 +194,24 @@ static int flir_open(ROT *rot) return_value = flir_request(rot, "FT\n", return_str, MAXBUF); // Get PAN resolution in arcsecs - if(flir_request(rot, "PR\n", return_str, MAXBUF) == RIG_OK) + if (flir_request(rot, "PR\n", return_str, MAXBUF) == RIG_OK) { sscanf(return_str, "* %f", &resolution_pp); - rig_debug(RIG_DEBUG_VERBOSE, "PAN resolution: %f arcsecs per position\n", resolution_pp); + rig_debug(RIG_DEBUG_VERBOSE, "PAN resolution: %f arcsecs per position\n", + resolution_pp); priv->resolution_pp = resolution_pp; } else { return_value = -RIG_EPROTO; } + // Get TILT resolution in arcsecs - if(flir_request(rot, "TR\n", return_str, MAXBUF) == RIG_OK) + if (flir_request(rot, "TR\n", return_str, MAXBUF) == RIG_OK) { sscanf(return_str, "* %f", &resolution_tp); - rig_debug(RIG_DEBUG_VERBOSE, "TILT resolution: %f arcsecs per position\n", resolution_tp); + rig_debug(RIG_DEBUG_VERBOSE, "TILT resolution: %f arcsecs per position\n", + resolution_tp); priv->resolution_tp = resolution_tp; } else @@ -236,7 +245,7 @@ static int flir_set_position(ROT *rot, azimuth_t az, elevation_t el) char return_str[MAXBUF]; char cmd_str[MAXBUF]; struct flir_priv_data *priv = (struct flir_priv_data *) - rot->state.priv; + rot->state.priv; rig_debug(RIG_DEBUG_VERBOSE, "%s called: %.2f %.2f\n", __func__, az, el); @@ -260,14 +269,14 @@ static int flir_get_position(ROT *rot, azimuth_t *az, elevation_t *el) int return_value = RIG_OK; char return_str[MAXBUF]; int32_t pan_positions, tilt_positions; - + struct flir_priv_data *priv = (struct flir_priv_data *) - rot->state.priv; + rot->state.priv; rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); - if(flir_request(rot, "PP\n", return_str, MAXBUF) == RIG_OK) + if (flir_request(rot, "PP\n", return_str, MAXBUF) == RIG_OK) { rig_debug(RIG_DEBUG_VERBOSE, "PP Return String: %s\n", return_str); sscanf(return_str, "* %d", &pan_positions); @@ -279,8 +288,8 @@ static int flir_get_position(ROT *rot, azimuth_t *az, elevation_t *el) rig_debug(RIG_DEBUG_VERBOSE, "PP Wrong Return String: %s\n", return_str); return_value = -RIG_EPROTO; } - - if(flir_request(rot, "TP\n", return_str, MAXBUF) == RIG_OK) + + if (flir_request(rot, "TP\n", return_str, MAXBUF) == RIG_OK) { rig_debug(RIG_DEBUG_VERBOSE, "TP Return String: %s\n", return_str); sscanf(return_str, "* %d", &tilt_positions); @@ -301,7 +310,7 @@ static int flir_stop(ROT *rot) int return_value = RIG_OK; struct flir_priv_data *priv = (struct flir_priv_data *) - rot->state.priv; + rot->state.priv; azimuth_t az; elevation_t el; @@ -333,22 +342,25 @@ static int flir_reset(ROT *rot, rot_reset_t reset) { int return_value = RIG_OK; rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + if (reset != 0) { return_value = flir_request(rot, "r\n", NULL, 0); + // After Reset: Disable Hard Limits - if(return_value == RIG_OK) + if (return_value == RIG_OK) { return_value = flir_request(rot, "LD\n", NULL, MAXBUF); } } + return return_value; } static int flir_move(ROT *rot, int direction, int speed) { struct flir_priv_data *priv = (struct flir_priv_data *) - rot->state.priv; + rot->state.priv; rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); rig_debug(RIG_DEBUG_TRACE, "%s: Direction = %d, Speed = %d\n", __func__, @@ -381,20 +393,24 @@ static const char *flir_get_info(ROT *rot) char info_str[101]; struct flir_priv_data *priv = (struct flir_priv_data *) - rot->state.priv; + rot->state.priv; sprintf(priv->info, "No Info"); rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); - if(flir_request(rot, "V\n", firmware_str, 120) != RIG_OK) + + if (flir_request(rot, "V\n", firmware_str, 120) != RIG_OK) { return "No Info available"; } + hl_usleep(500000); - if(flir_request(rot, "O\n", info_str, 100) != RIG_OK) + + if (flir_request(rot, "O\n", info_str, 100) != RIG_OK) { return "No Info available"; } + sprintf(priv->info, "Firmware: %s\nPower: %s", firmware_str, info_str); return priv->info; @@ -463,7 +479,7 @@ static int flir_get_ext_parm(ROT *rot, token_t token, value_t *val) static int flir_get_status(ROT *rot, rot_status_t *status) { struct flir_priv_data *priv = (struct flir_priv_data *) - rot->state.priv; + rot->state.priv; *status = priv->status; return RIG_OK; commit 9eddf62687bd894a09ff02fef53500f5977794a0 Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Dec 8 22:37:10 2022 -0600 Update simftdx3000.c diff --git a/simulators/simftdx3000.c b/simulators/simftdx3000.c index e8c4a31f..33b0cd00 100644 --- a/simulators/simftdx3000.c +++ b/simulators/simftdx3000.c @@ -252,6 +252,11 @@ int main(int argc, char *argv[]) { sscanf(buf, "MD0%d", &md); } + else if (strcmp(buf, "PS;") == 0) + { + SNPRINTF(buf, sizeof(buf), "PS1;"); + n = write(fd, buf, strlen(buf)); + } else if (strcmp(buf, "VS;") == 0) { SNPRINTF(buf, sizeof(buf), "VS%d;", vs); commit 0489df5bf10af2746b952c9cd00bb12ebdf8bd8f Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Dec 8 22:36:35 2022 -0600 Update NEWS diff --git a/NEWS b/NEWS index eb8e4432..8becd307 100644 --- a/NEWS +++ b/NEWS @@ -15,6 +15,7 @@ Version 5.x -- future Version 4.6 * 2023-11-XX -- Planned for Nov 2023 * Add MDS 4710/9710 rigs + * Add FLIR PTU-D48, E46, D100, D300 rotors * Add NB2 for FT2000 * Fix FTDX3000 rig split commit d369b60f6d089a2a8691a9d9e8715156e8fcdafe Merge: dd029a30 07cc8874 Author: Michael Black <mdb...@ya...> Date: Thu Dec 8 22:30:24 2022 -0600 Merge pull request #1164 from andz82/master Added FLIR/DirectedPerception PTU rotor backend commit dd029a3082a1c53a3c139bcb98bb48ba6a69fd06 Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Dec 8 22:26:09 2022 -0600 Fix FTDX3000 split problem with sticking on Sub VFO https://github.com/Hamlib/Hamlib/issues/1177 diff --git a/NEWS b/NEWS index 13a3d4e0..eb8e4432 100644 --- a/NEWS +++ b/NEWS @@ -16,6 +16,7 @@ Version 4.6 * 2023-11-XX -- Planned for Nov 2023 * Add MDS 4710/9710 rigs * Add NB2 for FT2000 + * Fix FTDX3000 rig split Version 4.5.1 * 2022-XX-XX diff --git a/src/rig.c b/src/rig.c index 7c8b326f..bddad1e8 100644 --- a/src/rig.c +++ b/src/rig.c @@ -2888,12 +2888,12 @@ int HAMLIB_API rig_get_vfo(RIG *rig, vfo_t *vfo) } cache_ms = elapsed_ms(&rig->state.cache.time_vfo, HAMLIB_ELAPSED_GET); - rig_debug(RIG_DEBUG_TRACE, "%s: cache check age=%dms\n", __func__, cache_ms); + //rig_debug(RIG_DEBUG_TRACE, "%s: cache check age=%dms\n", __func__, cache_ms); if (cache_ms < rig->state.cache.timeout_ms) { - rig_debug(RIG_DEBUG_TRACE, "%s: cache hit age=%dms\n", __func__, cache_ms); *vfo = rig->state.cache.vfo; + rig_debug(RIG_DEBUG_TRACE, "%s: cache hit age=%dms, vfo=%s\n", __func__, cache_ms, rig_strvfo(*vfo)); ELAPSED2; RETURNFUNC(RIG_OK); } @@ -4424,12 +4424,12 @@ int HAMLIB_API rig_set_split_mode(RIG *rig, // so we turn it off, do our thing, and turn split back on rx_vfo = vfo; - if (tx_vfo == RIG_VFO_B) { rx_vfo = RIG_VFO_A; } + if (tx_vfo == RIG_VFO_B || tx_vfo == RIG_VFO_SUB) { rx_vfo = RIG_VFO_A; } - if (vfo == RIG_VFO_CURR && tx_vfo == RIG_VFO_B) { rx_vfo = RIG_VFO_A; } - else if (vfo == RIG_VFO_CURR && tx_vfo == RIG_VFO_A) { rx_vfo = RIG_VFO_B; } + if (vfo == RIG_VFO_CURR && tx_vfo == RIG_VFO_B) { rx_vfo = RIG_VFO_A; } + else if (vfo == RIG_VFO_CURR && tx_vfo == RIG_VFO_A) { rx_vfo = RIG_VFO_B; } else if (vfo == RIG_VFO_CURR && tx_vfo == RIG_VFO_MAIN) { rx_vfo = RIG_VFO_SUB; } - else if (vfo == RIG_VFO_CURR && tx_vfo == RIG_VFO_SUB) { rx_vfo = RIG_VFO_MAIN; } + else if (vfo == RIG_VFO_CURR && tx_vfo == RIG_VFO_SUB) { rx_vfo = RIG_VFO_MAIN; } rig_debug(RIG_DEBUG_VERBOSE, "%s(%d): rx_vfo=%s, tx_vfo=%s\n", __func__, __LINE__, rig_strvfo(rx_vfo), rig_strvfo(tx_vfo)); @@ -4927,8 +4927,10 @@ int HAMLIB_API rig_set_split_vfo(RIG *rig, { switch (tx_vfo) { + case RIG_VFO_MAIN: case RIG_VFO_A: rx_vfo = split == 1 ? RIG_VFO_B : RIG_VFO_A; break; + case RIG_VFO_SUB: case RIG_VFO_B: rx_vfo = split == 1 ? RIG_VFO_A : RIG_VFO_B; break; } commit 180e49754fe41754b5a075cdea1701830cabc01b Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Dec 8 22:25:18 2022 -0600 Update NEWS diff --git a/NEWS b/NEWS index 5cc62a02..13a3d4e0 100644 --- a/NEWS +++ b/NEWS @@ -15,6 +15,7 @@ Version 5.x -- future Version 4.6 * 2023-11-XX -- Planned for Nov 2023 * Add MDS 4710/9710 rigs + * Add NB2 for FT2000 Version 4.5.1 * 2022-XX-XX commit 458bb2d9e470afcec45601f90262c34cdbbc9153 Merge: 7b7a0460 8a057d8b Author: Michael Black <mdb...@ya...> Date: Thu Dec 8 16:43:15 2022 -0600 Merge pull request #1179 from PianetaRadio/patch-1 Update NEWS commit 8a057d8bf4fef2849698d820dc0250d22bad5ae8 Author: PianetaRadio <789...@us...> Date: Thu Dec 8 21:03:22 2022 +0100 Update NEWS FT-2000 NB2 diff --git a/NEWS b/NEWS index 7fc4511d..5cc62a02 100644 --- a/NEWS +++ b/NEWS @@ -19,7 +19,7 @@ Version 4.6 Version 4.5.1 * 2022-XX-XX * FT2000, FTDX3000/D, FT891, FT991, FT950, FTDX5000 now set CAT TOT to 100ms - * Add missing NB2 setting to FT-950, FTDX-1200, FTDX-3000, FTDX-5000, FTDX-9000 + * Add missing NB2 setting to FT-950, FTDX-1200, FT-2000, FTDX-3000, FTDX-5000, FTDX-9000 * Add missing meter reading to TS-890S -- thanks to Geore Baltz N3GB * Fix FT736 VFOB freq and mode set * Added send_raw to rigctl -- see rigctl man page commit 07cc887432be93b191aa7b67c68a5b2962c4f06e Author: andz <an...@an...> Date: Wed Nov 30 16:06:27 2022 +0100 Added Android.mk diff --git a/rotators/flir/Android.mk b/rotators/flir/Android.mk new file mode 100644 index 00000000..3fa35ec0 --- /dev/null +++ b/rotators/flir/Android.mk @@ -0,0 +1,12 @@ +LOCAL_PATH:= $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := flir.c +LOCAL_MODULE := flir + +LOCAL_CFLAGS := +LOCAL_C_INCLUDES := android include src +LOCAL_LDLIBS := -lhamlib -Lobj/local/$(TARGET_ARCH_ABI) + +include $(BUILD_STATIC_LIBRARY) commit 0860bda83214382d1d0c887573d553cd0d9a4e86 Author: andz <an...@an...> Date: Wed Nov 30 15:55:27 2022 +0100 Changed header description diff --git a/rotators/flir/flir.h b/rotators/flir/flir.h index 5b32e1c3..e20c05c7 100644 --- a/rotators/flir/flir.h +++ b/rotators/flir/flir.h @@ -1,6 +1,6 @@ /* - * Hamlib Dummy backend - main header - * Copyright (c) 2001-2008 by Stephane Fillod + * Hamlib FLIR PTU rotor backend - main header + * Copyright (c) 2022 by Andreas Mueller (DC1MIL) * * * This library is free software; you can redistribute it and/or commit 0cc4ca778dc580ed5078eed51bbe4eeb294637ee Merge: a522e6f6 526b1853 Author: andz <an...@us...> Date: Wed Nov 30 15:50:38 2022 +0100 Merge branch 'Hamlib:master' into master commit a522e6f6e7e0cdca8e0cbb8204a29d584431cc41 Author: andz <an...@an...> Date: Wed Nov 30 15:41:41 2022 +0100 Added README.md diff --git a/rotators/flir/README b/rotators/flir/README deleted file mode 100644 index 0601a099..00000000 --- a/rotators/flir/README +++ /dev/null @@ -1 +0,0 @@ -tbd diff --git a/rotators/flir/README.md b/rotators/flir/README.md new file mode 100644 index 00000000..11d3b9bc --- /dev/null +++ b/rotators/flir/README.md @@ -0,0 +1,75 @@ +# FLIR/DirectedPerception PTU Rotor Module + +This module interfaces FLIR and DirectedPerception +rotor using the PTU protocol via serial. + +This includes: + +* PTU-D48(E) +* PTU-E46 +* PTU-D100(E) +* PTU-D300(E) + +Tested only with PTU-D48 yet and with one rotor per chain only. + +## Usage + +1. Connect the rotor via serial (RS232 or RS485) +2. Power up the rotor +3. The rotor must be calibrated after each power up. This can be accived +either using the rotctl `Reset` command (R) or manually via serial terminal +sending the `R\n` command. +4. To enable the rotor to fully turn +/- 180°, the softlock must be disabled. +This is included in the rotctl `Reset` commnad or manually via serial terminal +seinden the command `LD\n`. **WARNING:** Send this command only after the rotor is +calibrated, or you risk damage running into the hard endstops (at about +/-190°) +5. Start `rotctl` or `rotctld` with the arguments `-m 2501 -r <Serial + Interface>` + +Have Fun. + +### Hints + +1. Setup the max. velocity, power and acceleration according to your antenna load. +This must be done via serial terminal, as the functions are not implemented yet. +2. Never use the maximum hold power, only use the low or off. If you use max or regular, +the rotor may easily overheat! + +## PTU Protocol + +* [Protocol Version 3.02 (2011)](https://flir.netx.net/file/asset/11556/original/attachment) + +## Current Status + +The current status is **ALPHA**. It is tested with DirectedPercepiton PTU-D48 (Firmware v2.13.4r0(D48-C14/E)) +Linux with `rotctl` and `gpredict`. + +### Implemented so far: + +* init +* cleanup +* open +* close +* set_position +* get_position +* park +* stop +* reset +* move +* info + +### Needs to be implemented: + +#### Parameters + +* velocity +* acceleration +* velocity profile +* user soft-limits +* power commands (move and hold) +* step mode +* reset on startup + +#### Functions + +* usage of chained rotors via RS485 commit c7d0004b36e60691f5f2e87acf538f505d6e5175 Author: andz <an...@an...> Date: Wed Nov 30 15:33:55 2022 +0100 Fixed Info command diff --git a/rotators/flir/flir.c b/rotators/flir/flir.c index 8adaa892..7ae3ffc0 100644 --- a/rotators/flir/flir.c +++ b/rotators/flir/flir.c @@ -377,21 +377,26 @@ static int flir_move(ROT *rot, int direction, int speed) static const char *flir_get_info(ROT *rot) { - char firmware_str[120]; - char info_str[120]; + char firmware_str[121]; + char info_str[101]; + struct flir_priv_data *priv = (struct flir_priv_data *) rot->state.priv; sprintf(priv->info, "No Info"); rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); - - if(flir_request(rot, "V\n", firmware_str, 120) == RIG_OK && - flir_request(rot, "O\n", info_str, 120) == RIG_OK) + if(flir_request(rot, "V\n", firmware_str, 120) != RIG_OK) { - sprintf(priv->info, "Firmware: %s Info: %s", firmware_str, info_str); + return "No Info available"; } - //rig_debug(RIG_DEBUG_VERBOSE, "Return String: %s", return_str); + hl_usleep(500000); + if(flir_request(rot, "O\n", info_str, 100) != RIG_OK) + { + return "No Info available"; + } + sprintf(priv->info, "Firmware: %s\nPower: %s", firmware_str, info_str); + return priv->info; } commit b2d6a856a432aa7394d6b7887660d4dca504d842 Author: andz <an...@an...> Date: Wed Nov 30 15:00:29 2022 +0100 Fixed segfault when read_string failed diff --git a/rotators/flir/flir.c b/rotators/flir/flir.c index ee3d317c..8adaa892 100644 --- a/rotators/flir/flir.c +++ b/rotators/flir/flir.c @@ -72,6 +72,7 @@ static int flir_request(ROT *rot, char *request, char *response, { int return_value = -RIG_EINVAL; int retry_read = 0; + int read_char = 0; rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); @@ -83,6 +84,7 @@ static int flir_request(ROT *rot, char *request, char *response, strlen(request)); if (return_value != RIG_OK) { + rig_debug(RIG_DEBUG_VERBOSE, "%s request not OK\n", __func__); return return_value; } } @@ -92,9 +94,9 @@ static int flir_request(ROT *rot, char *request, char *response, while(retry_read < rot->state.rotport.retry) { memset(response, 0, (size_t)resp_size); - resp_size = read_string(&rot->state.rotport, (unsigned char *)response, resp_size, + read_char = read_string(&rot->state.rotport, (unsigned char *)response, resp_size, "\r\n", sizeof("\r\n"), 0, 1); - if(resp_size > 0) + if(read_char > 0) { if(response[0] == '*') { @@ -110,6 +112,7 @@ static int flir_request(ROT *rot, char *request, char *response, } retry_read++; } + response = ""; rig_debug(RIG_DEBUG_VERBOSE, "timeout for command %s\n", request); return -RIG_ETIMEOUT; } @@ -273,6 +276,7 @@ static int flir_get_position(ROT *rot, azimuth_t *az, elevation_t *el) } else { + rig_debug(RIG_DEBUG_VERBOSE, "PP Wrong Return String: %s\n", return_str); return_value = -RIG_EPROTO; } @@ -285,6 +289,7 @@ static int flir_get_position(ROT *rot, azimuth_t *az, elevation_t *el) } else { + rig_debug(RIG_DEBUG_VERBOSE, "PP Wrong Return String: %s\n", return_str); return_value = -RIG_EPROTO; } commit db690f37ff31fc303edf87c41358bcdc0d9ad9fc Author: andz <an...@an...> Date: Wed Nov 30 13:55:00 2022 +0100 Cleaned up * removed all warnings * retrun -RIG_ENIMPL for all not yet implemented functions diff --git a/rotators/flir/flir.c b/rotators/flir/flir.c index 0e1b839c..ee3d317c 100644 --- a/rotators/flir/flir.c +++ b/rotators/flir/flir.c @@ -29,6 +29,7 @@ #include "hamlib/rotator.h" #include "register.h" #include "idx_builtin.h" +#include "serial.h" #include "flir.h" @@ -40,8 +41,6 @@ ROT_STATUS_MOVING_EL | ROT_STATUS_MOVING_UP | ROT_STATUS_MOVING_DOWN | \ ROT_STATUS_LIMIT_UP | ROT_STATUS_LIMIT_DOWN | ROT_STATUS_LIMIT_LEFT | ROT_STATUS_LIMIT_RIGHT) -//static int simulating = 0; // do we need rotator emulation for debug? - struct flir_priv_data { azimuth_t az; @@ -56,6 +55,8 @@ struct flir_priv_data value_t levels[RIG_SETTING_MAX]; value_t parms[RIG_SETTING_MAX]; + char info[256]; + struct ext_list *ext_funcs; struct ext_list *ext_levels; struct ext_list *ext_parms; @@ -66,61 +67,11 @@ struct flir_priv_data float_t resolution_tp; }; -// static const struct confparams flir_ext_levels[] = -// { -// { -// TOK_EL_ROT_MAGICLEVEL, "MGL", "Magic level", "Magic level, as an example", -// NULL, RIG_CONF_NUMERIC, { .n = { 0, 1, .001 } } -// }, -// { -// TOK_EL_ROT_MAGICFUNC, "MGF", "Magic func", "Magic function, as an example", -// NULL, RIG_CONF_CHECKBUTTON -// }, -// { -// TOK_EL_ROT_MAGICOP, "MGO", "Magic Op", "Magic Op, as an example", -// NULL, RIG_CONF_BUTTON -// }, -// { -// TOK_EL_ROT_MAGICCOMBO, "MGC", "Magic combo", "Magic combo, as an example", -// "VALUE1", RIG_CONF_COMBO, { .c = { .combostr = { "VALUE1", "VALUE2", "NONE", NULL } } } -// }, -// { RIG_CONF_END, NULL, } -// }; - -// static const struct confparams flir_ext_funcs[] = -// { -// { -// TOK_EL_ROT_MAGICEXTFUNC, "MGEF", "Magic ext func", "Magic ext function, as an example", -// NULL, RIG_CONF_CHECKBUTTON -// }, -// { RIG_CONF_END, NULL, } -// }; - -// static const struct confparams flir_ext_parms[] = -// { -// { -// TOK_EP_ROT_MAGICPARM, "MGP", "Magic parm", "Magic parameter, as an example", -// NULL, RIG_CONF_NUMERIC, { .n = { 0, 1, .001 } } -// }, -// { RIG_CONF_END, NULL, } -// }; - -/* cfgparams are configuration item generally used by the backend's open() method */ -// static const struct confparams flir_cfg_params[] = -// { -// { -// TOK_CFG_ROT_MAGICCONF, "mcfg", "Magic conf", "Magic parameter, as an example", -// "ROTATOR", RIG_CONF_STRING, { } -// }, -// { RIG_CONF_END, NULL, } -// }; - static int flir_request(ROT *rot, char *request, char *response, - uint32_t *resp_size) + int resp_size) { int return_value = -RIG_EINVAL; int retry_read = 0; - unsigned char cmd_ok; rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); @@ -128,20 +79,20 @@ static int flir_request(ROT *rot, char *request, char *response, if (request) { - return_value = write_block(&rot->state.rotport, (unsigned char *) request, + return_value = write_block(&rot->state.rotport, (unsigned char *)request, strlen(request)); if (return_value != RIG_OK) { return return_value; } } - //Is a direct request expected? + //Is a direct response expected? if (response != NULL) { while(retry_read < rot->state.rotport.retry) { - memset(response, 0, resp_size); - resp_size = read_string(&rot->state.rotport, response, resp_size, + memset(response, 0, (size_t)resp_size); + resp_size = read_string(&rot->state.rotport, (unsigned char *)response, resp_size, "\r\n", sizeof("\r\n"), 0, 1); if(resp_size > 0) { @@ -182,30 +133,6 @@ static int flir_init(ROT *rot) priv = rot->state.priv; - // priv->ext_funcs = alloc_init_ext(flir_ext_funcs); - - // if (!priv->ext_funcs) - // { - // return -RIG_ENOMEM; - // } - - // priv->ext_levels = alloc_init_ext(flir_ext_levels); - - // if (!priv->ext_levels) - // { - // return -RIG_ENOMEM; - // } - - // priv->ext_parms = alloc_init_ext(flir_ext_parms); - - // if (!priv->ext_parms) - // { - // return -RIG_ENOMEM; - // } - - //rot->state.rotport.type.rig = RIG_PORT_SERIAL; - //flir_request(rot, "r\n", sizeof("r\n"), NULL, NULL); - priv->az = priv->el = 0; priv->target_az = priv->target_el = 0; @@ -290,56 +217,15 @@ static int flir_close(ROT *rot) return RIG_OK; } -// static int flir_set_conf(ROT *rot, token_t token, const char *val) -// { -// struct flir_priv_data *priv; - -// priv = (struct flir_priv_data *)rot->state.priv; - -// switch (token) -// { -// case TOK_CFG_ROT_MAGICCONF: -// if (val) -// { -// free(priv->magic_conf); -// priv->magic_conf = strdup(val); -// } - -// break; - -// default: -// return -RIG_EINVAL; -// } - -// return RIG_OK; -// } - - -// static int flir_get_conf2(ROT *rot, token_t token, char *val, int val_len) -// { -// struct flir_priv_data *priv; - -// priv = (struct flir_priv_data *)rot->state.priv; - -// switch (token) -// { -// case TOK_CFG_ROT_MAGICCONF: -// SNPRINTF(val, val_len, "%s", priv->magic_conf); -// break; - -// default: -// return -RIG_EINVAL; -// } - -// return RIG_OK; -// } - -// static int flir_get_conf(ROT *rot, token_t token, char *val) -// { -// return flir_get_conf2(rot, token, val, 128); -// } - +static int flir_set_conf(ROT *rot, token_t token, const char *val) +{ + return -RIG_ENIMPL; +} +static int flir_get_conf(ROT *rot, token_t token, char *val) +{ + return -RIG_ENIMPL; +} static int flir_set_position(ROT *rot, azimuth_t az, elevation_t el) { @@ -383,6 +269,7 @@ static int flir_get_position(ROT *rot, azimuth_t *az, elevation_t *el) rig_debug(RIG_DEBUG_VERBOSE, "PP Return String: %s\n", return_str); sscanf(return_str, "* %d", &pan_positions); priv->az = (pan_positions * priv->resolution_pp) / 3600; + *az = priv->az; } else { @@ -394,23 +281,19 @@ static int flir_get_position(ROT *rot, azimuth_t *az, elevation_t *el) rig_debug(RIG_DEBUG_VERBOSE, "TP Return String: %s\n", return_str); sscanf(return_str, "* %d", &tilt_positions); priv->el = 90.0 + ((tilt_positions * priv->resolution_tp) / 3600); + *el = priv->el; } else { return_value = -RIG_EPROTO; } - *az = priv->az; - *el = priv->el; - return return_value; } - static int flir_stop(ROT *rot) { int return_value = RIG_OK; - char return_str[MAXBUF]; struct flir_priv_data *priv = (struct flir_priv_data *) rot->state.priv; @@ -431,7 +314,6 @@ static int flir_stop(ROT *rot) return return_value; } - static int flir_park(ROT *rot) { rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); @@ -448,7 +330,7 @@ static int flir_reset(ROT *rot, rot_reset_t reset) rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); if (reset != 0) { - return_value = flir_request(rot, "r\n", NULL, NULL); + return_value = flir_request(rot, "r\n", NULL, 0); // After Reset: Disable Hard Limits if(return_value == RIG_OK) { @@ -490,490 +372,93 @@ static int flir_move(ROT *rot, int direction, int speed) static const char *flir_get_info(ROT *rot) { - const char* firmware_str[120]; - const char* info_str[120]; - const char* return_str[256]; + char firmware_str[120]; + char info_str[120]; + struct flir_priv_data *priv = (struct flir_priv_data *) + rot->state.priv; - sprintf(return_str, "No Info"); + sprintf(priv->info, "No Info"); rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); if(flir_request(rot, "V\n", firmware_str, 120) == RIG_OK && flir_request(rot, "O\n", info_str, 120) == RIG_OK) { - sprintf(return_str, "Firmware: %s Info: %s", firmware_str, info_str); + sprintf(priv->info, "Firmware: %s Info: %s", firmware_str, info_str); } //rig_debug(RIG_DEBUG_VERBOSE, "Return String: %s", return_str); - return *return_str; + return priv->info; } -// static int flir_set_func(ROT *rot, setting_t func, int status) -// { -// struct flir_priv_data *priv = (struct flir_priv_data *) -// rot->state.priv; - -// rig_debug(RIG_DEBUG_VERBOSE, "%s called: %s %d\n", __func__, -// rot_strfunc(func), status); - -// if (status) -// { -// priv->funcs |= func; -// } -// else -// { -// priv->funcs &= ~func; -// } - -// return RIG_OK; -// } - - -// static int flir_get_func(ROT *rot, setting_t func, int *status) -// { -// struct flir_priv_data *priv = (struct flir_priv_data *) -// rot->state.priv; - -// *status = (priv->funcs & func) ? 1 : 0; - -// rig_debug(RIG_DEBUG_VERBOSE, "%s called: %s\n", __func__, -// rot_strfunc(func)); - -// return RIG_OK; -// } - - -// static int flir_set_level(ROT *rot, setting_t level, value_t val) -// { -// struct flir_priv_data *priv = (struct flir_priv_data *) -// rot->state.priv; -// int idx; -// char lstr[32]; - -// idx = rig_setting2idx(level); - -// if (idx >= RIG_SETTING_MAX) -// { -// return -RIG_EINVAL; -// } - -// priv->levels[idx] = val; - -// if (ROT_LEVEL_IS_FLOAT(level)) -// { -// SNPRINTF(lstr, sizeof(lstr), "%f", val.f); -// } -// else -// { -// SNPRINTF(lstr, sizeof(lstr), "%d", val.i); -// } - -// rig_debug(RIG_DEBUG_VERBOSE, "%s called: %s %s\n", __func__, -// rot_strlevel(level), lstr); - -// return RIG_OK; -// } - - -// static int flir_get_level(ROT *rot, setting_t level, value_t *val) -// { -// struct flir_priv_data *priv = (struct flir_priv_data *) -// rot->state.priv; -// int idx; - -// idx = rig_setting2idx(level); - -// if (idx >= RIG_SETTING_MAX) -// { -// return -RIG_EINVAL; -// } - -// *val = priv->levels[idx]; - -// rig_debug(RIG_DEBUG_VERBOSE, "%s called: %s\n", __func__, -// rot_strlevel(level)); - -// return RIG_OK; -// } - -// static int flir_set_ext_level(ROT *rot, token_t token, value_t val) -// { -// struct flir_priv_data *priv = (struct flir_priv_data *) -// rot->state.priv; -// char lstr[64]; -// const struct confparams *cfp; -// struct ext_list *elp; - -// cfp = rot_ext_lookup_tok(rot, token); - -// if (!cfp) -// { -// return -RIG_EINVAL; -// } - -// switch (token) -// { -// case TOK_EL_ROT_MAGICLEVEL: -// case TOK_EL_ROT_MAGICFUNC: -// case TOK_EL_ROT_MAGICOP: -// case TOK_EL_ROT_MAGICCOMBO: -// break; - -// default: -// return -RIG_EINVAL; -// } - -// switch (cfp->type) -// { -// case RIG_CONF_STRING: -// strcpy(lstr, val.s); -// break; - -// case RIG_CONF_COMBO: -// SNPRINTF(lstr, sizeof(lstr), "%d", val.i); -// break; - -// case RIG_CONF_NUMERIC: -// SNPRINTF(lstr, sizeof(lstr), "%f", val.f); -// break; - -// case RIG_CONF_CHECKBUTTON: -// SNPRINTF(lstr, sizeof(lstr), "%s", val.i ? "ON" : "OFF"); -// break; - -// case RIG_CONF_BUTTON: -// lstr[0] = '\0'; -// break; - -// default: -// return -RIG_EINTERNAL; -// } - -// elp = find_ext(priv->ext_levels, token); - -// if (!elp) -// { -// return -RIG_EINTERNAL; -// } - -// /* store value */ -// elp->val = val; - -// rig_debug(RIG_DEBUG_VERBOSE, "%s called: %s %s\n", __func__, -// cfp->name, lstr); - -// return RIG_OK; -// } - -// static int flir_get_ext_level(ROT *rot, token_t token, value_t *val) -// { -// struct flir_priv_data *priv = (struct flir_priv_data *) -// rot->state.priv; -// const struct confparams *cfp; -// struct ext_list *elp; - -// cfp = rot_ext_lookup_tok(rot, token); - -// if (!cfp) -// { -// return -RIG_EINVAL; -// } - -// switch (token) -// { -// case TOK_EL_ROT_MAGICLEVEL: -// case TOK_EL_ROT_MAGICFUNC: -// case TOK_EL_ROT_MAGICOP: -// case TOK_EL_ROT_MAGICCOMBO: -// break; - -// default: -// return -RIG_EINVAL; -// } - -// elp = find_ext(priv->ext_levels, token); - -// if (!elp) -// { -// return -RIG_EINTERNAL; -// } - -// /* load value */ -// *val = elp->val; - -// rig_debug(RIG_DEBUG_VERBOSE, "%s called: %s\n", __func__, -// cfp->name); - -// return RIG_OK; -// } - - -// static int flir_set_ext_func(ROT *rot, token_t token, int status) -// { -// struct flir_priv_data *priv = (struct flir_priv_data *) -// rot->state.priv; -// const struct confparams *cfp; -// struct ext_list *elp; - -// cfp = rot_ext_lookup_tok(rot, token); - -// if (!cfp) -// { -// return -RIG_EINVAL; -// } - -// switch (token) -// { -// case TOK_EL_ROT_MAGICEXTFUNC: -// break; - -// default: -// return -RIG_EINVAL; -// } - -// switch (cfp->type) -// { -// case RIG_CONF_CHECKBUTTON: -// break; - -// case RIG_CONF_BUTTON: -// break; - -// default: -// return -RIG_EINTERNAL; -// } - -// elp = find_ext(priv->ext_funcs, token); - -// if (!elp) -// { -// return -RIG_EINTERNAL; -// } - -// /* store value */ -// elp->val.i = status; - -// rig_debug(RIG_DEBUG_VERBOSE, "%s called: %s %d\n", __func__, -// cfp->name, status); - -// return RIG_OK; -// } - - -// static int flir_get_ext_func(ROT *rot, token_t token, int *status) -// { -// struct flir_priv_data *priv = (struct flir_priv_data *) -// rot->state.priv; -// const struct confparams *cfp; -// struct ext_list *elp; - -// cfp = rot_ext_lookup_tok(rot, token); - -// if (!cfp) -// { -// return -RIG_EINVAL; -// } - -// switch (token) -// { -// case TOK_EL_ROT_MAGICEXTFUNC: -// break; - -// default: -// return -RIG_EINVAL; -// } - -// elp = find_ext(priv->ext_funcs, token); - -// if (!elp) -// { -// return -RIG_EINTERNAL; -// } - -// /* load value */ -// *status = elp->val.i; - -// rig_debug(RIG_DEBUG_VERBOSE, "%s called: %s\n", __func__, -// cfp->name); - -// return RIG_OK; -// } - - -// static int flir_set_parm(ROT *rot, setting_t parm, value_t val) -// { -// struct flir_priv_data *priv = (struct flir_priv_data *) -// rot->state.priv; -// int idx; -// char pstr[32]; - -// idx = rig_setting2idx(parm); - -// if (idx >= RIG_SETTING_MAX) -// { -// return -RIG_EINVAL; -// } - -// if (ROT_PARM_IS_FLOAT(parm)) -// { -// SNPRINTF(pstr, sizeof(pstr), "%f", val.f); -// } -// else -// { -// SNPRINTF(pstr, sizeof(pstr), "%d", val.i); -// } - -// rig_debug(RIG_DEBUG_VERBOSE, "%s called: %s %s\n", __func__, -// rig_strparm(parm), pstr); - -// priv->parms[idx] = val; - -// return RIG_OK; -// } - - -// static int flir_get_parm(ROT *rot, setting_t parm, value_t *val) -// { -// struct flir_priv_data *priv = (struct flir_priv_data *) -// rot->state.priv; -// int idx; - -// idx = rig_setting2idx(parm); - -// if (idx >= RIG_SETTING_MAX) -// { -// return -RIG_EINVAL; -// } - -// *val = priv->parms[idx]; - -// rig_debug(RIG_DEBUG_VERBOSE, "%s called %s\n", __func__, -// rig_strparm(parm)); - -// return RIG_OK; -// } - -// static int flir_set_ext_parm(ROT *rot, token_t token, value_t val) -// { -// struct flir_priv_data *priv = (struct flir_priv_data *) -// rot->state.priv; -// char lstr[64]; -// const struct confparams *cfp; -// struct ext_list *epp; - -// cfp = rot_ext_lookup_tok(rot, token); - -// if (!cfp) -// { -// return -RIG_EINVAL; -// } - -// switch (token) -// { -// case TOK_EP_ROT_MAGICPARM: -// break; - -// default: -// return -RIG_EINVAL; -// } - -// switch (cfp->type) -// { -// case RIG_CONF_STRING: -// strcpy(lstr, val.s); -// break; - -// case RIG_CONF_COMBO: -// SNPRINTF(lstr, sizeof(lstr), "%d", val.i); -// break; - -// case RIG_CONF_NUMERIC: -// SNPRINTF(lstr, sizeof(lstr), "%f", val.f); -// break; - -// case RIG_CONF_CHECKBUTTON: -// SNPRINTF(lstr, sizeof(lstr), "%s", val.i ? "ON" : "OFF"); -// break; - -// case RIG_CONF_BUTTON: -// lstr[0] = '\0'; -// break; - -// default: -// return -RIG_EINTERNAL; -// } - -// epp = find_ext(priv->ext_parms, token); - -// if (!epp) -// { -// return -RIG_EINTERNAL; -// } - -// /* store value */ -// epp->val = val; - -// rig_debug(RIG_DEBUG_VERBOSE, "%s called: %s %s\n", __func__, -// cfp->name, lstr); - -// return RIG_OK; -// } +static int flir_set_func(ROT *rot, setting_t func, int status) +{ + return -RIG_ENIMPL; +} -// static int flir_get_ext_parm(ROT *rot, token_t token, value_t *val) -// { -// struct flir_priv_data *priv = (struct flir_priv_data *) -// rot->state.priv; -// const struct confparams *cfp; -// struct ext_list *epp; +static int flir_get_func(ROT *rot, setting_t func, int *status) +{ + return -RIG_ENIMPL; +} -// cfp = rot_ext_lookup_tok(rot, token); +static int flir_set_level(ROT *rot, setting_t level, value_t val) +{ + return -RIG_ENIMPL; +} -// if (!cfp) -// { -// return -RIG_EINVAL; -// } +static int flir_get_level(ROT *rot, setting_t level, value_t *val) +{ + return -RIG_ENIMPL; +} -// switch (token) -// { -// case TOK_EP_ROT_MAGICPARM: -// break; +static int flir_set_ext_level(ROT *rot, token_t token, value_t val) +{ + return -RIG_ENIMPL; +} -// default: -// return -RIG_EINVAL; -// } +static int flir_get_ext_level(ROT *rot, token_t token, value_t *val) +{ + return -RIG_ENIMPL; +} -// epp = find_ext(priv->ext_parms, token); +static int flir_set_ext_func(ROT *rot, token_t token, int status) +{ + return -RIG_ENIMPL; +} -// if (!epp) -// { -// return -RIG_EINTERNAL; -// } +static int flir_get_ext_func(ROT *rot, token_t token, int *status) +{ + return -RIG_ENIMPL; +} -// /* load value */ -// *val = epp->val; +static int flir_set_parm(ROT *rot, setting_t parm, value_t val) +{ + return -RIG_ENIMPL; +} -// rig_debug(RIG_DEBUG_VERBOSE, "%s called: %s\n", __func__, -// cfp->name); +static int flir_get_parm(ROT *rot, setting_t parm, value_t *val) +{ + return -RIG_ENIMPL; +} -// return RIG_OK; -// } +static int flir_set_ext_parm(ROT *rot, token_t token, value_t val) +{ + return -RIG_ENIMPL; +} +static int flir_get_ext_parm(ROT *rot, token_t token, value_t *val) +{ + return -RIG_ENIMPL; +} static int flir_get_status(ROT *rot, rot_status_t *status) { struct flir_priv_data *priv = (struct flir_priv_data *) rot->state.priv; - - // if (simulating) - // { - // flir_simulate_rotation(rot); - // } - *status = priv->status; return RIG_OK; } - /* * flir rotator capabilities. */ @@ -1003,23 +488,16 @@ struct rot_caps flir_caps = .min_el = 0., .max_el = 90., - - .priv = NULL, /* priv */ - // .has_get_func = FLIR_FUNC, - // .has_set_func = FLIR_FUNC, - // .has_get_level = FLIR_LEVEL, - // .has_set_level = ROT_LEVEL_SET(FLIR_LEVEL), - // .has_get_parm = FLIR_PARM, - // .has_set_parm = ROT_PARM_SET(FLIR_PARM), - - // .level_gran = { [ROT_LVL_SPEED] = { .min = { .i = 1 }, .max = { .i = 4 }, .step = { .i = 1 } } }, + .has_get_func = FLIR_FUNC, + .has_set_func = FLIR_FUNC, + .has_get_level = FLIR_LEVEL, + .has_set_level = ROT_LEVEL_SET(FLIR_LEVEL), + .has_get_parm = FLIR_PARM, + .has_set_parm = ROT_PARM_SET(FLIR_PARM), - // .extlevels = flir_ext_levels, - // .extfuncs = flir_ext_funcs, - // .extparms = flir_ext_parms, - // .cfgparams = flir_cfg_params, + .level_gran = { [ROT_LVL_SPEED] = { .min = { .i = 1 }, .max = { .i = 4 }, .step = { .i = 1 } } }, .has_status = FLIR_STATUS, @@ -1028,8 +506,8 @@ struct rot_caps flir_caps = .rot_open = flir_open, .rot_close = flir_close, - // .set_conf = flir_set_conf, - // .get_conf = flir_get_conf, + .set_conf = flir_set_conf, + .get_conf = flir_get_conf, .set_position = flir_set_position, .get_position = flir_get_position, @@ -1038,19 +516,19 @@ struct rot_caps flir_caps = .reset = flir_reset, .move = flir_move, - // .set_func = flir_set_func, - // .get_func = flir_get_func, - // .set_level = flir_set_level, - // .get_level = flir_get_level, - // .set_parm = flir_set_parm, - // .get_parm = flir_get_parm, - - // .set_ext_func = flir_set_ext_func, - // .get_ext_func = flir_get_ext_func, - // .set_ext_level = flir_set_ext_level, - // .get_ext_level = flir_get_ext_level, - // .set_ext_parm = flir_set_ext_parm, - // .get_ext_parm = flir_get_ext_parm, + .set_func = flir_set_func, + .get_func = flir_get_func, + .set_level = flir_set_level, + .get_level = flir_get_level, + .set_parm = flir_set_parm, + .get_parm = flir_get_parm, + + .set_ext_func = flir_set_ext_func, + .get_ext_func = flir_get_ext_func, + .set_ext_level = flir_set_ext_level, + .get_ext_level = flir_get_ext_level, + .set_ext_parm = flir_set_ext_parm, + .get_ext_parm = flir_get_ext_parm, .get_info = flir_get_info, .get_status = flir_get_status, commit 0bdb6827dabab3321fb10d835810c180f77fde99 Author: andz <an...@an...> Date: Wed Nov 30 12:20:25 2022 +0100 Implemented FLIR basic funktions: * flir_init * flir_cleanup * flir_open * flir_close * flir_set_position * flir_get_position * flir_park * flir_stop * flir_reset * flir_move diff --git a/rotators/flir/flir.c b/rotators/flir/flir.c index 04f648af..0e1b839c 100644 --- a/rotators/flir/flir.c +++ b/rotators/flir/flir.c @@ -1,6 +1,6 @@ /* - * Hamlib Dummy backend - main file - * Copyright (c) 2001-2009 by Stephane Fillod + * Hamlib FLIR PTU rotor backend - main file + * Copyright (c) 2022 by Andreas Mueller (DC1MIL) * * * This library is free software; you can redistribute it and/or @@ -27,7 +27,6 @@ #include <sys/time.h> #include "hamlib/rotator.h" -//#include "dummy_common.h" #include "register.h" #include "idx_builtin.h" @@ -41,7 +40,7 @@ ROT_STATUS_MOVING_EL | ROT_STATUS_MOVING_UP | ROT_STATUS_MOVING_DOWN | \ ROT_STATUS_LIMIT_UP | ROT_STATUS_LIMIT_DOWN | ROT_STATUS_LIMIT_LEFT | ROT_STATUS_LIMIT_RIGHT) -static int simulating = 0; // do we need rotator emulation for debug? +//static int simulating = 0; // do we need rotator emulation for debug? struct flir_priv_data { @@ -62,57 +61,110 @@ struct flir_priv_data struct ext_list *ext_parms; char *magic_conf; -}; -static const struct confparams flir_ext_levels[] = -{ - { - TOK_EL_ROT_MAGICLEVEL, "MGL", "Magic level", "Magic level, as an example", - NULL, RIG_CONF_NUMERIC, { .n = { 0, 1, .001 } } - }, - { - TOK_EL_ROT_MAGICFUNC, "MGF", "Magic func", "Magic function, as an example", - NULL, RIG_CONF_CHECKBUTTON - }, - { - TOK_EL_ROT_MAGICOP, "MGO", "Magic Op", "Magic Op, as an example", - NULL, RIG_CONF_BUTTON - }, - { - TOK_EL_ROT_MAGICCOMBO, "MGC", "Magic combo", "Magic combo, as an example", - "VALUE1", RIG_CONF_COMBO, { .c = { .combostr = { "VALUE1", "VALUE2", "NONE", NULL } } } - }, - { RIG_CONF_END, NULL, } -}; - -static const struct confparams flir_ext_funcs[] = -{ - { - TOK_EL_ROT_MAGICEXTFUNC, "MGEF", "Magic ext func", "Magic ext function, as an example", - NULL, RIG_CONF_CHECKBUTTON - }, - { RIG_CONF_END, NULL, } + float_t resolution_pp; + float_t resolution_tp; }; -static const struct confparams flir_ext_parms[] = -{ - { - TOK_EP_ROT_MAGICPARM, "MGP", "Magic parm", "Magic parameter, as an example", - NULL, RIG_CONF_NUMERIC, { .n = { 0, 1, .001 } } - }, - { RIG_CONF_END, NULL, } -}; +// static const struct confparams flir_ext_levels[] = +// { +// { +// TOK_EL_ROT_MAGICLEVEL, "MGL", "Magic level", "Magic level, as an example", +// NULL, RIG_CONF_NUMERIC, { .n = { 0, 1, .001 } } +// }, +// { +// TOK_EL_ROT_MAGICFUNC, "MGF", "Magic func", "Magic function, as an example", +// NULL, RIG_CONF_CHECKBUTTON +// }, +// { +// TOK_EL_ROT_MAGICOP, "MGO", "Magic Op", "Magic Op, as an example", +// NULL, RIG_CONF_BUTTON +// }, +// { +// TOK_EL_ROT_MAGICCOMBO, "MGC", "Magic combo", "Magic combo, as an example", +// "VALUE1", RIG_CONF_COMBO, { .c = { .combostr = { "VALUE1", "VALUE2", "NONE", NULL } } } +// }, +// { RIG_CONF_END, NULL, } +// }; + +// static const struct confparams flir_ext_funcs[] = +// { +// { +// TOK_EL_ROT_MAGICEXTFUNC, "MGEF", "Magic ext func", "Magic ext function, as an example", +// NULL, RIG_CONF_CHECKBUTTON +// }, +// { RIG_CONF_END, NULL, } +// }; + +// static const struct confparams flir_ext_parms[] = +// { +// { +// TOK_EP_ROT_MAGICPARM, "MGP", "Magic parm", "Magic parameter, as an example", +// NULL, RIG_CONF_NUMERIC, { .n = { 0, 1, .001 } } +// }, +// { RIG_CONF_END, NULL, } +// }; /* cfgparams are configuration item generally used by the backend's open() method */ -static const struct confparams flir_cfg_params[] = +// static const struct confparams flir_cfg_params[] = +// { +// { +// TOK_CFG_ROT_MAGICCONF, "mcfg", "Magic conf", "Magic parameter, as an example", +// "ROTATOR", RIG_CONF_STRING, { } +// }, +// { RIG_CONF_END, NULL, } +// }; + +static int flir_request(ROT *rot, char *request, char *response, + uint32_t *resp_size) { - { - TOK_CFG_ROT_MAGICCONF, "mcfg", "Magic conf", "Magic parameter, as an example", - "ROTATOR", RIG_CONF_STRING, { } - }, - { RIG_CONF_END, NULL, } -}; + int return_value = -RIG_EINVAL; + int retry_read = 0; + unsigned char cmd_ok; + + rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + + rig_flush(&rot->state.rotport); + if (request) + { + return_value = write_block(&rot->state.rotport, (unsigned char *) request, + strlen(request)); + if (return_value != RIG_OK) + { + return return_value; + } + } + //Is a direct request expected? + if (response != NULL) + { + while(retry_read < rot->state.rotport.retry) + { + memset(response, 0, resp_size); + resp_size = read_string(&rot->state.rotport, response, resp_size, + "\r\n", sizeof("\r\n"), 0, 1); + if(resp_size > 0) + { + if(response[0] == '*') + { + rig_debug(RIG_DEBUG_VERBOSE, "accepted command %s\n", request); + return RIG_OK; + } + else + { + rig_debug(RIG_DEBUG_VERBOSE, "NOT accepted command %s\n", request); + return -RIG_ERJCTED; + } + + } + retry_read++; + } + rig_debug(RIG_DEBUG_VERBOSE, "timeout for command %s\n", request); + return -RIG_ETIMEOUT; + } + + return return_value; +}; static int flir_init(ROT *rot) { @@ -130,28 +182,29 @@ static int flir_init(ROT *rot) priv = rot->state.priv; - priv->ext_funcs = alloc_init_ext(flir_ext_funcs); + // priv->ext_funcs = alloc_init_ext(flir_ext_funcs); - if (!priv->ext_funcs) - { - return -RIG_ENOMEM; - } + // if (!priv->ext_funcs) + // { + // return -RIG_ENOMEM; + // } - priv->ext_levels = alloc_init_ext(flir_ext_levels); + // priv->ext_levels = alloc_init_ext(flir_ext_levels); - if (!priv->ext_levels) - { - return -RIG_ENOMEM; - } + // if (!priv->ext_levels) + // { + // return -RIG_ENOMEM; + // } - priv->ext_parms = alloc_init_ext(flir_ext_parms); + // priv->ext_parms = alloc_init_ext(flir_ext_parms); - if (!priv->ext_parms) - { - return -RIG_ENOMEM; - } + // if (!priv->ext_parms) + // { + // return -RIG_ENOMEM; + // } - rot->state.rotport.type.rig = RIG_PORT_NONE; + //rot->state.rotport.type.rig = RIG_PORT_SERIAL; + //flir_request(rot, "r\n", sizeof("r\n"), NULL, NULL); priv->az = priv->el = 0; @@ -159,6 +212,9 @@ static int flir_init(ROT *rot) priv->magic_conf = strdup("ROTATOR"); + priv->resolution_pp = 92.5714; + priv->resolution_tp = 46.2857; + return RIG_OK; } @@ -186,16 +242,45 @@ static int flir_cleanup(ROT *rot) static int flir_open(ROT *rot) { + struct flir_priv_data *priv; + char return_str[MAXBUF]; + float_t resolution_pp, resolution_tp; + int return_value = RIG_OK; + rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); - if (rot->caps->rot_model == ROT_MODEL_FLIR) + priv = rot->state.priv; + + // Disable ECHO + return_value = flir_request(rot, "ED\n", NULL, MAXBUF); + + // Disable Verbose Mode + return_value = flir_request(rot, "FT\n", return_str, MAXBUF); + + // Get PAN resolution in arcsecs + if(flir_request(rot, "PR\n", return_str, MAXBUF) == RIG_OK) + { + sscanf(return_str, "* %f", &resolution_pp); + rig_debug(RIG_DEBUG_VERBOSE, "PAN resolution: %f arcsecs per position\n", resolution_pp); + priv->resolution_pp = resolution_pp; + } + else + { + return_value = -RIG_EPROTO; + } + // Get TILT resolution in arcsecs + if(flir_request(rot, "TR\n", return_str, MAXBUF) == RIG_OK) { - simulating = 1; - rig_debug(RIG_DEBUG_VERBOSE, "%s: flir rotator so simulating speed\n", - __func__); + sscanf(return_str, "* %f", &resolution_tp); + rig_debug(RIG_DEBUG_VERBOSE, "TILT resolution: %f arcsecs per position\n", resolution_tp); + priv->resolution_tp = resolution_tp; + } + else + { + return_value = -RIG_EPROTO; } - return RIG_OK; + return return_value; } static int flir_close(ROT *rot) @@ -205,185 +290,128 @@ static int flir_close(ROT *rot) return RIG_OK; } -static int flir_set_conf(ROT *rot, token_t token, const char *val) -{ - struct flir_priv_data *priv; +// static int flir_set_conf(ROT *rot, token_t token, const char *val) +// { +// struct flir_priv_data *priv; - priv = (struct flir_priv_data *)rot->state.priv; +// priv = (struct flir_priv_data *)rot->state.priv; - switch (token) - { - case TOK_CFG_ROT_MAGICCONF: - if (val) - { - free(priv->magic_conf); - priv->magic_conf = strdup(val); - } +// switch (token) +// { +// case TOK_CFG_ROT_MAGICCONF: +// if (val) +// { +// free(priv->magic_conf); +// priv->magic_conf = strdup(val); +// } - break; +// break; - default: - return -RIG_EINVAL; - } +// default: +// return -RIG_EINVAL; +// } - return RIG_OK; -} +// return RIG_OK; +// } -static int flir_get_conf2(ROT *rot, token_t token, char *val, int val_len) -{ - struct flir_priv_data *priv; +// static int flir_get_conf2(ROT *rot, token_t token, char *val, int val_len) +// { +// struct flir_priv_data *priv; - priv = (struct flir_priv_data *)rot->state.priv; +// priv = (struct flir_priv_data *)rot->state.priv; - switch (token) - { - case TOK_CFG_ROT_MAGICCONF: - SNPRINTF(val, val_len, "%s", priv->magic_conf); - break; +// switch (token) +// { +// case TOK_CFG_ROT_MAGICCONF: +// SNPRINTF(val, val_len, "%s", priv->magic_conf); +// break; - default: - return -RIG_EINVAL; - } +// default: +// return -RIG_EINVAL; +// } - return RIG_OK; -} +// return RIG_OK; +// } -static int flir_get_conf(ROT *rot, token_t token, char *val) -{ - return flir_get_conf2(rot, token, val, 128); -} +// static int flir_get_conf(ROT *rot, token_t token, char *val) +// { +// return flir_get_conf2(rot, token, val, 128); +// } static int flir_set_position(ROT *rot, azimuth_t az, elevation_t el) { + int32_t t_pan_positions, t_tilt_positions; + char return_str[MAXBUF]; + char cmd_str[MAXBUF]; struct flir_priv_data *priv = (struct flir_priv_data *) rot->state.priv; rig_debug(RIG_DEBUG_VERBOSE, "%s called: %.2f %.2f\n", __func__, az, el); - if (simulating) - { - priv->target_az = az; - priv->target_el = el; - gettimeofday(&priv->tv, NULL); - } - else - { - priv->az = priv->target_az = az; - priv->el = priv->target_az = el; - } + priv->target_az = az; + priv->target_el = el; + t_pan_positions = (az * 3600) / priv->resolution_pp; + t_tilt_positions = - ((90.0 - el) * 3600) / priv->resolution_tp; - return RIG_OK; + sprintf(cmd_str, "PP%d TP%d\n", t_pan_positions, t_tilt_positions); + + return flir_request(rot, cmd_str, return_str, MAXBUF); } -static void flir_simulate_rotation(ROT *rot) +/* + * Get position of rotor + */ +static int flir_get_position(ROT *rot, azimuth_t *az, elevation_t *el) { + int return_value = RIG_OK; + char return_str[MAXBUF]; + int32_t pan_positions, tilt_positions; + struct flir_priv_data *priv = (struct flir_priv_data *) rot->state.priv; - struct timeval tv; - unsigned elapsed; /* ms */ - - gettimeofday(&tv, NULL); - elapsed = (tv.tv_sec - priv->tv.tv_sec) * 1000 + - (tv.tv_usec - priv->tv.tv_usec) / 1000; + rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); - /* - * Simulate rotation speed of 360 deg per minute - */ -#define DEG_PER_MS (360./60/1000) - if (fabs(priv->target_az - priv->az) / DEG_PER_MS <= elapsed) + if(flir_request(rot, "PP\n", return_str, MAXBUF) == RIG_OK) { - /* target reached */ - priv->az = priv->target_az; - priv->status &= ~(ROT_STATUS_MOVING_AZ | ROT_STATUS_MOVING_LEFT | - ROT_STATUS_MOVING_RIGHT); + rig_debug(RIG_DEBUG_VERBOSE, "PP Return String: %s\n", return_str); + sscanf(return_str, "* %d", &pan_positions); + priv->az = (pan_positions * priv->resolution_pp) / 3600; } else { - if (priv->az < priv->target_az) - { - priv->az += (azimuth_t)elapsed * DEG_PER_MS; - priv->status |= ROT_STATUS_MOVING_AZ | ROT_STATUS_MOVING_RIGHT; - } - else - { - priv->az -= (azimuth_t)elapsed * DEG_PER_MS; - priv->status |= ROT_STATUS_MOVING_AZ | ROT_STATUS_MOVING_LEFT; - } + return_value = -RIG_EPROTO; } - - if (fabs(priv->target_el - pr... [truncated message content] |
From: n0nb <n0...@us...> - 2022-12-08 20:43:01
|
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 7b7a0460edfcef8afe1ef7f5b5b0f3e109751926 (commit) via 299f1de2f93d8ca778c104221de7e9cfd6b7ee1f (commit) via c103d55effdf77b52ef0527e6aea3fdf7adca82b (commit) via b5e258228e3559ff615768c1d148676279144512 (commit) via 2fc6344d546d456f4d4749ebe18159a3baf17e93 (commit) via 22af811d5ff3fe7260d54044ce748a1963547499 (commit) via 6a80385f8bc2658b1f29aa5cb32d3ea1b60c82a3 (commit) via 5f634df53843d1e5235b067c0470993952e99cac (commit) via dae50c7a953fb6b1ba5a0a091eb508b28c9a2aa6 (commit) via 40d1bad1e144feacdbe229af8afd9e36173b25de (commit) via e3487cb5c6330243cf8cf7f0081e5b4b74c1becc (commit) via e603da4cb6cbc2d540bb29591c5a141b9a226ef2 (commit) via ea1a718bb52339a8f5f9c582d083bc9ac5448063 (commit) via 156b810319cfeaefdbbf0f4e78090be7bc0d4a61 (commit) via a2b3e1348c374c6e2ef555636704471eb4d813e3 (commit) via 825fc07d0007b6b5661c255a08d76badd3765513 (commit) via fdd88c317e56131099a5de73b72727868c3bde3e (commit) via 1e1ed4c9e61f08e4022e2b3ce1a2e196c6958ba3 (commit) via d3d1fd7c40b916e912469a5d51afc3a3f04b9ad8 (commit) via 20caf608acd01f0162032240bfed3412163f83e5 (commit) via 827ae18f2e3cce61a95974394eee7428dd465ecb (commit) via 4fe9f5918d9b41fffcaabb1d78abea273b8dce4e (commit) via 560afb9de2841cc8d76e608437af2b6cd3aaf000 (commit) via a9de174335f86ab3db9bd2199b44ee871f522baa (commit) via aaab26686a2b44d4a273c8d2239f3ced0867ce6b (commit) via 57f6c863c6b3b2062a23ffbd1c120fb3ce448d3e (commit) via 545811a9786ba5b9ae1b3d7fb8b7051cd9e98b9a (commit) via 2b145fe71770c079ee6b7bae047d5ff51d9321ca (commit) via 3e01e7e9a7b7c013403ea2c6ddb3186950f07ebf (commit) via 13538c38e0db9d7046ee07ed98b790237c0901ec (commit) via cb72a054eaafaf6a4e7309078790cb4be713dc52 (commit) via 01706287ff1fc6481ae3eda65faba57d091dc691 (commit) via 1102dede64ac324af7e98f0895612773e3608d89 (commit) via be499866b9b97b24416366eb609eedc041ebb8b4 (commit) via 887aeae114739af812e1e12b24f771ea31b0e6e3 (commit) via ed3d7ed32382cbfb41a1f293d9283cdea7e239ca (commit) via c9ec1adc9f972c85056bf7c6e51f839f0d473082 (commit) via e46da0c86ed6350f52ea5b8b16f6e0c1bc9138b1 (commit) via b504d251070b3356f93583197ebb58b85e29c4e9 (commit) via 84b4620a94a4ff6e37619bf52f12c4145fa625d9 (commit) via 3112c2f9e05dc57f606f96c4593944c2edae1ae7 (commit) via 54bfba3c14e74d8e9eaf5426a1094d7d853bdb84 (commit) via 033cc8a192646e753f4e8a9516f5bf0601a82787 (commit) via 72701a9032e024a506e4e54f8860ecdabe112681 (commit) via 479d7a080aa56c381049921b9c58c0c387bd84c2 (commit) via bb7d3cbad40f7ab55dc88d59ac9b9632d379837e (commit) via 20233b92c0f03e819298145e2b063f2336bc8f93 (commit) via b90afcb438245c7351851f091518fd6d6eb52896 (commit) via 9c3405465cbe4a98454bac7dab622e90199ee7c7 (commit) via dc7e9bd7e9f2174f9ee245672000c97a84077fbe (commit) via a116cbe5025e8cc0f499c8616f5e47e1c729905c (commit) via a400539d09df8fa4bf20051469b93f29d3f18198 (commit) via c6b11728c9b4424109bd66aecdd91531bdfe6914 (commit) via ea11358379abae2a524950d29480fd8b3658daa4 (commit) via 526b1853b6a6c7fa32bee11e5fc502dc609d75b2 (commit) via e2570d9d49b5f07da22d2877fc4a10b68c4dd25e (commit) via 09fb0818475bbc72a609ddf4316c125a689822a1 (commit) via c5a83b1652d00cee5cdfdf472a87ba440b7009da (commit) via b4a6f985247a2289dee8554d27f89132feeb1781 (commit) via 3e6ca76c31a9a4f2e9e76d16899bd8090c9f2555 (commit) via 39a78a4af7b8eed216a97ed3a9aa4a1920f30d04 (commit) via 4d7db63b975ae5a3e3f0f216659f52395c2fce56 (commit) via 72e86bf18bf0d22da1c01e1c64043c4cf11cf8fd (commit) via f81c20eb378c14ab405389d13e48530aebbdce43 (commit) via ce1932fb9ac26dcc289adcece33756e547142f23 (commit) via 66d0dc9a5de100875d269c6c397bb4ae66c3f1c9 (commit) via 8b75fc8ea6231ba95c469e681412296d25d0f101 (commit) via 16826c5a88c371870332997fe4f5101b8871aa79 (commit) via 5957b8697d7e56a34f806435c9bb50c082c352e9 (commit) via 9824ff6bf0ccf153c7f48a4f4e670c224e0b25fe (commit) via d8fcb16a589959a52aa6b3e39dee2b4c30aca632 (commit) via 7368609a76728af32f7686fb472289d4fe4ce1f7 (commit) via c932468a11091d5a532fa1c0b24af64cd4c7ae6c (commit) via 340045384d9141f6ce428cfc31246540e722df67 (commit) via 427ca8d90f8252998f59e42e41ba1ec0ef7387ca (commit) via 3ce5718a655b2cc3c7c21d6ae4524afe0a95d7fb (commit) via 09e73b2ec9b2b624e33cdd19a25072616fa69e0f (commit) via 6995986880f9a1f3b788ec4c147ebca6f06173c5 (commit) via 58f2549a994062c5e3b3f68e93f349ef8e6cdfd8 (commit) via a0711bfa715faf6985a232c2caee423d94f7e1d7 (commit) via af6d4d03e365ace65bb544c614d988740a26de63 (commit) via 5d7f69572717b89d62cc2844ba20cc419eb7203f (commit) via f8a5b92bc7d84bca1319c78c21a7048a9ad2f395 (commit) via ca4814c4722b361e329a5e3ad59cc7b29fab8c2f (commit) via 1ef3549e9405b782caa8c32f9f13488035f60f0c (commit) via 93d3a9e213c56a41b67232c6ca2ec3e39a9e6a8c (commit) via 6679eaf8bff191b2d8826359498b5efc5039b347 (commit) via edcbd17612813103f931a882e3c767156448addf (commit) via 508eef31f913cfd6530c85ac9a8566a0d941bd24 (commit) via e3a1d8c96c80eeae321edb3c9cf60e75fb4acccf (commit) via 7068378a915662904a1c6a4aa0f81e7107af181e (commit) via 09f83cbfb7b2be5909dfa329e0c7d20ad253a694 (commit) via 2c384ece6b3f6b474ffe2154b2d30ad97f426049 (commit) via 0bacb35f06b5d8a0677491879e8f6d5fb8769fa1 (commit) via b133b90419e0a161b933829b45aaec59281fb7fa (commit) via 3c273c001af1357afe6c23b64b29f80e23fde823 (commit) via 37a40eabf2b8b61070dd16453eddcf8829f40e6a (commit) via 8193d9cedaa0bb771a0acf5f24dc9bdbbdb79a19 (commit) via 8cffaf387530950794d367519933aa34d4215dd5 (commit) via e55f43a0273f679cbf0ea5c63adf66c01ff4f4b9 (commit) via 1a4745a7c21b5e55653540e8a003f2ad0cee6d9f (commit) via 25ac6d77d663861aa3c293c155267ad629de1e3b (commit) via 6c5e0e69748e0261b0b064870c41e1f54a99855c (commit) via 2b487fe718ace903697a85718e4ffc3995d25df8 (commit) via 31e40d2751f519a7e77d570b3aeebfa069186db9 (commit) via a20c21aab023e23396f0f2ac380207aa7c9d0dbe (commit) via 6b41f0738fe627e86c1b758f3c65005a59a42efb (commit) via 99627855a20a1c61781f5c3cc148efa8c0b5f1c4 (commit) via a29e89cf939cbdd3de33d90ac7b8df83bc788373 (commit) via 1e68b06b53829221567792276f7de335991331f5 (commit) via d7edd89a12be134a904d0a3d5fc3e4f68f111c16 (commit) via 1aebee2da9d29ff1d1a16e19f23bbff4e0f319a8 (commit) via 5fa3d59810f7310e5e0d0e3447c4be083d39496d (commit) via 4f5bf9aaddb3ef4b0a92daafee63641c67e293ef (commit) via 1ea7241bbf297736cf465da1d3c25051a28e93c0 (commit) via a563c749f4a582ca43624e8d1d4113a2314057c6 (commit) via 20ce6004485ae1d8910ff032cd9d826f8933a795 (commit) via ae0f7f423776a644befae3bac8c854905bb64292 (commit) via d8caad3d1b609aef97a4c2bb821f3ff77999d3ba (commit) via 7bcf599afc47c791da994042ad785dbee08026d7 (commit) via 4bede074fc0e1b5ca0fb22c1e8f348e6e4118580 (commit) via 8533002f8e5e6943afe810ebd6aed818470c37ae (commit) via 2aaa05b96735b5db65a1ed9a1c6a16b5b4657398 (commit) via ba065466230196cfebd5081956a492b74b17e7f5 (commit) via 5a5fc68922a56ce9f6c8b2138f06acd55e19dc67 (commit) via 5164c1c366714ed46659718b4890372b4e334f20 (commit) via 8616be635ee36b01774a2235009b5f8a6eb90cdc (commit) via cc3d912a76cd80bebcbf3509d885754d10e7ec38 (commit) via c168a99c832d53227233915e041e615ef5375c03 (commit) via 60a6170545d5f63a754df4435ab65c5094fbbec2 (commit) via c844b02ed11e38b8b423352fd99ab0ece2c3f8cd (commit) via d7ab03957329b991a4f248dcac437ecf8d804ae6 (commit) via 42f65cc5fb8a486f001027c452c29645ed4cd1cc (commit) via 782e54e4f2aa92418f4eca42a242c41e90f3d934 (commit) from 9a6d4d761249c553ef71093754213ca72e94eeb9 (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 7b7a0460edfcef8afe1ef7f5b5b0f3e109751926 Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Dec 8 11:39:22 2022 -0600 Bump .Net verison to 7.0 for multicast testing diff --git a/bindings/csharp/multicast/multicast.csproj b/bindings/csharp/multicast/multicast.csproj index f3006615..d08b4c72 100644 --- a/bindings/csharp/multicast/multicast.csproj +++ b/bindings/csharp/multicast/multicast.csproj @@ -2,7 +2,7 @@ <PropertyGroup> <OutputType>Exe</OutputType> - <TargetFramework>net5.0</TargetFramework> + <TargetFramework>net7.0</TargetFramework> </PropertyGroup> <ItemGroup> commit 299f1de2f93d8ca778c104221de7e9cfd6b7ee1f Merge: b5e25822 c103d55e Author: Michael Black <mdb...@ya...> Date: Thu Dec 8 10:10:26 2022 -0600 Merge pull request #1178 from Hamlib/dependabot/nuget/bindings/csharp/multicast/Newtonsoft.Json-13.0.2 Bump Newtonsoft.Json from 13.0.1 to 13.0.2 in /bindings/csharp/multicast commit c103d55effdf77b52ef0527e6aea3fdf7adca82b Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu Dec 8 15:26:53 2022 +0000 Bump Newtonsoft.Json from 13.0.1 to 13.0.2 in /bindings/csharp/multicast Bumps [Newtonsoft.Json](https://github.com/JamesNK/Newtonsoft.Json) from 13.0.1 to 13.0.2. - [Release notes](https://github.com/JamesNK/Newtonsoft.Json/releases) - [Commits](https://github.com/JamesNK/Newtonsoft.Json/compare/13.0.1...13.0.2) --- updated-dependencies: - dependency-name: Newtonsoft.Json dependency-type: direct:production ... Signed-off-by: dependabot[bot] <su...@gi...> diff --git a/bindings/csharp/multicast/multicast.csproj b/bindings/csharp/multicast/multicast.csproj index e7a76d33..f3006615 100644 --- a/bindings/csharp/multicast/multicast.csproj +++ b/bindings/csharp/multicast/multicast.csproj @@ -6,7 +6,7 @@ </PropertyGroup> <ItemGroup> - <PackageReference Include="Newtonsoft.Json" Version="13.0.1" /> + <PackageReference Include="Newtonsoft.Json" Version="13.0.2" /> </ItemGroup> </Project> ----------------------------------------------------------------------- Summary of changes: .github/codeql-analysis.yml | 6 +- .github/workflows/codeql-analysis.yml | 6 +- NEWS | 15 +- astyle.sh | 1 + bindings/csharp/multicast/multicast.csproj | 4 +- configure.ac | 3 +- doc/man1/rigctl.1 | 11 + include/hamlib/rig.h | 37 +- include/hamlib/riglist.h | 7 + include/hamlib/rotlist.h | 4 +- rigs/adat/adt_200a.c | 1 + rigs/adat/adt_200a.h | 14 + rigs/alinco/dx77.c | 18 +- rigs/alinco/dxsr8.c | 2 +- rigs/aor/aor.c | 4 +- rigs/dummy/dummy.c | 7 +- rigs/dummy/flrig.c | 22 +- rigs/dummy/netrigctl.c | 39 +- rigs/dummy/netrotctl.c | 105 +++--- rigs/dummy/tci1x.c | 1 + rigs/dummy/trxmanager.c | 1 + rigs/flexradio/sdr1k.c | 6 +- rigs/gomspace/gs100.c | 8 +- rigs/icom/Makefile.am | 2 +- rigs/icom/ic7000.c | 4 +- rigs/icom/ic703.c | 4 +- rigs/icom/ic706.c | 16 +- rigs/icom/ic7100.c | 4 +- rigs/icom/ic718.c | 4 +- rigs/icom/ic7200.c | 4 +- rigs/icom/ic7410.c | 4 +- rigs/icom/ic746.c | 8 +- rigs/icom/ic751.c | 4 +- rigs/icom/ic756.c | 16 +- rigs/icom/ic7600.c | 4 +- rigs/icom/ic7610.c | 2 +- rigs/icom/ic765.c | 11 +- rigs/icom/ic7700.c | 4 +- rigs/icom/ic78.c | 4 +- rigs/icom/ic7800.c | 4 +- rigs/icom/ic781.c | 9 +- rigs/icom/ic785x.c | 2 +- rigs/icom/ic910.c | 20 +- rigs/icom/ic9100.c | 7 +- rigs/icom/ic92d.c | 4 +- rigs/icom/icom.c | 9 +- rigs/icom/icom.h | 5 +- rigs/icom/icr10.c | 4 +- rigs/icom/icr20.c | 4 +- rigs/icom/icr6.c | 6 +- rigs/icom/icr75.c | 4 +- rigs/icom/icr8500.c | 4 +- rigs/icom/icr8600.c | 2 +- rigs/icom/icr9000.c | 4 +- rigs/icom/icr9500.c | 4 +- rigs/icom/icrx7.c | 4 +- rigs/icom/id1.c | 8 +- rigs/icom/id31.c | 2 + rigs/icom/id4100.c | 2 + rigs/icom/id51.c | 2 + rigs/icom/id5100.c | 5 +- rigs/icom/level_gran_icom.h | 57 +++ rigs/icom/xiegu.c | 32 +- rigs/kenwood/Makefile.am | 2 +- rigs/kenwood/flex6xxx.c | 9 +- rigs/kenwood/k3.c | 5 +- rigs/kenwood/kenwood.c | 62 +++- rigs/kenwood/kenwood.h | 3 +- rigs/kenwood/level_gran_kenwood.h | 43 +++ rigs/kenwood/r5000.c | 4 +- rigs/kenwood/thd7.c | 12 +- rigs/kenwood/thd72.c | 11 +- rigs/kenwood/thd74.c | 7 +- rigs/kenwood/thf6a.c | 7 +- rigs/kenwood/thf7.c | 7 +- rigs/kenwood/thg71.c | 8 +- rigs/kenwood/tmd700.c | 9 +- rigs/kenwood/tmd710.c | 10 +- rigs/kenwood/tmv7.c | 11 +- rigs/kenwood/trc80.c | 5 +- rigs/kenwood/ts140.c | 4 +- rigs/kenwood/ts2000.c | 7 +- rigs/kenwood/ts440.c | 4 +- rigs/kenwood/ts450s.c | 5 +- rigs/kenwood/ts480.c | 42 ++- rigs/kenwood/ts50s.c | 9 +- rigs/kenwood/ts570.c | 20 +- rigs/kenwood/ts590.c | 6 + rigs/kenwood/ts680.c | 4 +- rigs/kenwood/ts690.c | 9 +- rigs/kenwood/ts711.c | 5 +- rigs/kenwood/ts790.c | 6 +- rigs/kenwood/ts811.c | 5 +- rigs/kenwood/ts850.c | 6 +- rigs/kenwood/ts870s.c | 11 +- rigs/kenwood/ts890s.c | 214 ++++++++++- rigs/kenwood/ts930.c | 10 +- rigs/kenwood/ts940.c | 1 + rigs/kenwood/ts950.c | 23 +- rigs/kenwood/ts990s.c | 11 +- rigs/kenwood/tx500.c | 4 +- rigs/kenwood/xg3.c | 9 + rigs/kit/fifisdr.c | 2 +- rigs/kit/miniVNA.c | 15 +- rigs/kit/rs_hfiq.c | 22 +- rigs/mds/4710.c | 93 +++++ rigs/mds/9710.c | 94 +++++ {rotators/ars => rigs/mds}/Android.mk | 4 +- rigs/mds/Makefile.am | 6 + rigs/mds/mds.c | 565 +++++++++++++++++++++++++++++ rigs/mds/mds.h | 28 ++ rigs/rs/ek89x.c | 6 + rigs/rs/xk2100.c | 6 + rigs/skanti/trp8000.c | 2 +- rigs/tapr/dsp10.c | 4 +- rigs/tentec/argonaut.c | 27 +- rigs/tentec/jupiter.c | 25 +- rigs/tentec/rx350.c | 27 +- rigs/tentec/tentec2.h | 1 + rigs/winradio/g313-posix.c | 2 +- rigs/winradio/g313-win.c | 4 +- rigs/winradio/winradio.c | 2 + rigs/yaesu/Makefile.am | 2 +- rigs/yaesu/YaesuTargetableVFO.ods | Bin 3800 -> 20521 bytes rigs/yaesu/frg100.c | 12 +- rigs/yaesu/frg8800.c | 4 + rigs/yaesu/frg9600.c | 4 + rigs/yaesu/ft100.c | 7 +- rigs/yaesu/ft1000d.c | 6 +- rigs/yaesu/ft1000mp.c | 12 + rigs/yaesu/ft1200.c | 8 +- rigs/yaesu/ft1200.h | 2 +- rigs/yaesu/ft2000.c | 6 +- rigs/yaesu/ft2000.h | 2 +- rigs/yaesu/ft3000.c | 5 +- rigs/yaesu/ft450.c | 6 +- rigs/yaesu/ft5000.c | 8 +- rigs/yaesu/ft5000.h | 2 +- rigs/yaesu/ft600.c | 11 +- rigs/yaesu/ft710.c | 10 +- rigs/yaesu/ft736.c | 13 +- rigs/yaesu/ft747.c | 4 + rigs/yaesu/ft757gx.c | 14 +- rigs/yaesu/ft767gx.c | 8 +- rigs/yaesu/ft817.c | 10 +- rigs/yaesu/ft840.c | 4 + rigs/yaesu/ft847.c | 25 +- rigs/yaesu/ft857.c | 6 +- rigs/yaesu/ft890.c | 4 + rigs/yaesu/ft891.c | 6 +- rigs/yaesu/ft897.c | 12 +- rigs/yaesu/ft900.c | 4 + rigs/yaesu/ft9000.c | 9 +- rigs/yaesu/ft9000.h | 2 +- rigs/yaesu/ft920.c | 4 + rigs/yaesu/ft950.c | 7 +- rigs/yaesu/ft950.h | 2 +- rigs/yaesu/ft980.h | 4 + rigs/yaesu/ft990.c | 4 + rigs/yaesu/ft991.c | 44 +-- rigs/yaesu/ft991.h | 2 +- rigs/yaesu/ftdx10.c | 10 +- rigs/yaesu/ftdx101.c | 10 +- rigs/yaesu/ftdx101mp.c | 6 +- rigs/yaesu/level_gran_yaesu.h | 42 +++ rigs/yaesu/newcat.c | 219 +++++++---- rigs/yaesu/newcat.h | 2 +- rigs/yaesu/vr5000.c | 4 + rigs/yaesu/vx1700.c | 1 - rigs/yaesu/yaesu.h | 1 + simulators/simft818.c | 2 + simulators/simftdx3000.c | 15 +- simulators/simicom.c | 1 + simulators/simicom9700.c | 27 +- simulators/simkenwood.c | 2 +- simulators/simpowersdr.c | 15 +- simulators/simyaesu.c | 3 +- src/iofunc.c | 13 +- src/mem.c | 15 +- src/misc.c | 2 + src/register.c | 4 +- src/rig.c | 263 +++++++++++++- src/serial.c | 4 + src/sprintflst.c | 60 +++ src/sprintflst.h | 1 + tests/ampctl_parse.c | 1 + tests/dumpcaps.c | 125 ++++--- tests/memcsv.c | 2 + tests/rigctl.c | 3 +- tests/rigctl_parse.c | 136 ++++++- tests/rigctlcom.c | 97 ++++- tests/rigctld.c | 4 +- tests/rotctl_parse.c | 33 +- tests/sendraw.c | 38 ++ tests/testcaps.sh | 12 + tests/testrig.c | 10 +- 196 files changed, 2998 insertions(+), 666 deletions(-) create mode 100755 astyle.sh create mode 100644 rigs/icom/level_gran_icom.h create mode 100644 rigs/kenwood/level_gran_kenwood.h create mode 100644 rigs/mds/4710.c create mode 100644 rigs/mds/9710.c copy {rotators/ars => rigs/mds}/Android.mk (81%) create mode 100644 rigs/mds/Makefile.am create mode 100644 rigs/mds/mds.c create mode 100644 rigs/mds/mds.h create mode 100644 rigs/yaesu/level_gran_yaesu.h create mode 100644 tests/sendraw.c create mode 100755 tests/testcaps.sh hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Nate B. <n0...@us...> - 2022-12-08 16:47:30
|
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 annotated tag, 4.5.1 has been created at 4504d86bec77ec0cbaa3aabf0e093cb6597a2ad9 (tag) tagging 75fbd097b1508e0a29b80206e193fd45a9a332cf (commit) replaces 4.5 tagged by Nate Bargmann on Thu Dec 8 10:44:04 2022 -0600 - Log ----------------------------------------------------------------- Hamlib 4.5.1 release -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQSC1k9rDmfNQfaJu6b7LFEw1VqIGQUCY5IUdQAKCRD7LFEw1VqI GTxGAKCid+a39lgEr/GG0umzfv7cnXtrwQCePkAKJ0b9C3aXXGvmHzgsS3aYa/A= =Qay3 -----END PGP SIGNATURE----- Michael Black (7): Merge pull request #1137 from PianetaRadio/master Merge pull request #1148 from PianetaRadio/master Merge pull request #1161 from mdblack98/master Merge pull request #1166 from PianetaRadio/master Merge pull request #1167 from PianetaRadio/master Merge pull request #1169 from PianetaRadio/master Merge pull request #1175 from PianetaRadio/master Mike Black W9MDB (136): Add ability to enter terminator char for W send_cmd_rx so one can do 'W FA; ;' without a timeout needed Merge branch 'master' of https://github.com/Hamlib/Hamlib Update NEWS Fix space in string compare in flrig.c https://github.com/Hamlib/Hamlib/issues/1134 Small update to newcat.c notes Add RIG_LEVEL_USB_AF for IC-705, IC-7300, IC-9700, IC-785x, and IC-R8600 In combination with RIG_LEVEL_RF we should be able to create an AGC control for WSJTX and JTDX for example to keep audio levels within a good A/D range automagically https://github.com/Hamlib/Hamlib/issues/1135 Update simicom9700.c Fix LEVEL_USB_AF https://github.com/Hamlib/Hamlib/issues/1135 Remove debug from misc.c IC7300 cannot get powerstat so use get_freq instead. There are likely more Icom rigs like this Add AGC_OFF to IC7300 agc levels Add simft747gx.c Add AGC_TIME to IC-7300, IC-9700, and IC-705 https://github.com/Hamlib/Hamlib/issues/1136 Update NEWS Fix flrig get_ptt https://github.com/Hamlib/Hamlib/issues/1138 Add ID 800 for FT710 Add RIG_FUNC_OVF_STATUS for IC-7300, IC-9700, IC-705, IC-R8600 Add RIG_LEVEL_KEYSPD to ts890s.c https://github.com/Hamlib/Hamlib/issues/1139 Fix dummy_set_split_freq Fix if_len in flex6xxx.c https://github.com/Hamlib/Hamlib/issues/1141 Update NEWS Fix IC-7300 rig power on hopefully https://github.com/Hamlib/Hamlib/issues/1142 Fix NEWS Fix segfault in icom_get_powerstat Update simicom9700.c Fix 5W level of ftdx10.c based on user testing Improve README.md by adding github and sourceforge info Add RIG_FUNC_TUNER to flrig.c Update ftdx10.h power levels Fix FT-991 level_gran https://github.com/Hamlib/Hamlib/issues/1144 Fix rotctld dumpcaps to expose client rot_type instead of Other Fix rotctld dumpcaps to expose client rot_type instead of Other https://github.com/Hamlib/Hamlib/issues/1035 Merge branch 'master' of https://github.com/Hamlib/Hamlib Fix new protocol in rotctl functions to duplicate logic in rigctl new protocol https://github.com/Hamlib/Hamlib/issues/1035 Move rotctl south_zero to new dump protocol section for backwards compatibility https://github.com/Hamlib/Hamlib/issues/1035 Fix backwards compatibility of rotctl with rotctld https://github.com/Hamlib/Hamlib/issues/1035 Fix dumpcap level_gran for Yaesu rigs Update Makefile.am for Yaesu to include level_gran_yaesu.h Fix all Icom level_gran values Fix readonly set_level in flex6xxx.c Fix level_gran on kenwood rigs https://github.com/Hamlib/Hamlib/issues/1035 Fix dummy ptt_type when ptt_type is specified on command line for rigctl and rigctld https://github.com/Hamlib/Hamlib/issues/888 Add missing level_gran_kenwood.h https://github.com/Hamlib/Hamlib/issues/1035 Fix segfault with ptt_type --- seems to be constant on LHS so can't set it Update simicom9700.c Update level_gran_yaesu.h Fix some dumpcaps warnings in many rigs Merge branch 'master' of https://github.com/Hamlib/Hamlib Fix clang warning on callback functions https://github.com/Hamlib/Hamlib/issues/1149 Fix memcsv.c https://github.com/Hamlib/Hamlib/issues/1149 Add MDS 4710 rig Update NEWS Add mds.h to mds/Makefile.am Clean up rest of dumpcap backend warnings Fix duplicate MODES in g313-win.c ser_open now sets rts and dtr low on startup https://github.com/Hamlib/Hamlib/issues/1131 Move ser_set_rts/dtr to beggining of serial_setup https://github.com/Hamlib/Hamlib/issues/1131 Update astyle formatting Fix dumpcaps filter printout to only show valid filters https://github.com/Hamlib/Hamlib/issues/1151 Split MDS 4710/9710 Add astyle.sh to format all .c files Change minimum timeout on all Kenwood rigs to 500ms -- legacy timeouts were a touch too short for all situations Update NEWS Correct NEWS Fix Xiegu X6100 rig split https://github.com/Hamlib/Hamlib/issues/1152 Update NEWS Make kenwood a bit more robust to discern between no reply and corrupted/unexpected reply This logic should be usable to use AI mode eventually or share serial splitter line Improve debug a bit in rig.c so show model and remove unnecessary debug Change MDS 4710/9710 to Alpha status -- no testing has been done yet Add data mode and targetable freq/mode to Xiegu X6100 https://github.com/Hamlib/Hamlib/issues/1154 Update icom.h data https://github.com/Hamlib/Hamlib/issues/1154 Add set_mode_with_data and get_mode_with_data to Xiegu G90 Fix rig_send_raw to return bytes read, fill buffer, and also work with fixed length response/null terminator https://github.com/Hamlib/Hamlib/issues/1157 Update NEWS Add sendraw.c to test directory https://github.com/Hamlib/Hamlib/issues/1157 Fix rigctld showing the real rig agc_levels instead of all levels Fix display of RIG_AGC_OFF Add RIG_AGC_LONG Fix PowerSDR AGC values https://github.com/Hamlib/Hamlib/issues/1155 astyle files Add AGC levels to ts2000.c and fix AGC Level printout to show index number instead of enumeration number. Add RIG_AGC_LONG and RIG_AGC_ON levels to match rig's capabilities better Still need to allow setting AGC level using mnemonics instead of level value to make it more usable Add AGC levels to Kenwood rigs that we can verify have them https://github.com/Hamlib/Hamlib/milestone/16 Add send_raw to rigctl Fix send_raw and add some debug to it https://github.com/Hamlib/Hamlib/issues/1157 Change rigctl send_raw to also require terminator https://github.com/Hamlib/Hamlib/issues/1157 Change rigctl_powerstat message to only show when powerstat shows off and promote to error Remove misc.h dependency from testrig.h For FT736 fix set_vfo to also work for VFOB and set split when VFOB is requested https://github.com/Hamlib/Hamlib/issues/1160 For FT736 add TARGETABLE_MODE and fix set_mode to work with VFOB https://github.com/Hamlib/Hamlib/issues/1160 Update codeql due to deprecation Merge branch 'master' of https://github.com/Hamlib/Hamlib Update NEWS Update github actions for deprecation Remove accidental commit Fix compilation warning on fifisdr.c Fix 32-bit compile warning in sprintflst.c Fix mingw64 warnings Fix send_raw for Windows https://github.com/Hamlib/Hamlib/issues/1157 Astyle files Fix logic in dummy.c Fix rx_range_list2 problem in dx77.x Fix duplicate targetable_vfo in xiegu.c Fix frequency check in k3.c Fix range list in mds.c Fix compiler warnings Fix k3.c math.h Fix misc TS890S items -- thanks to George Baltz N3GB Update NEWS Astyle newcat.c Re-enable O_NDELAY -- slowed things down by about 2X https://github.com/Hamlib/Hamlib/issues/1163 Update NEWS Fix newcat check for passband nochange https://github.com/Hamlib/Hamlib/issues/1163 Balance the ELAPSED functions Add netrigctl_send_raw to allow send_raw to work with rigctld https://github.com/Hamlib/Hamlib/issues/1157 astyle newcat.c Change FT991 write_delay to 5ms -- was seeing many serial errors with 0ms https://github.com/Hamlib/Hamlib/issues/1163 Add SM and KS commands to rigctlcom to work better with DXCommander https://github.com/Hamlib/Hamlib/issues/1170 If mode for VFOB is requested but rig does not have TARGETABLE_MODE then just return VFOA mode https://github.com/Hamlib/Hamlib/issues/1172 Reduce FT991 write_delay to 2ms and post_write_delay to 0ms This works with CAT TOT = 10ms at 38,400 baud https://github.com/Hamlib/Hamlib/issues/1163 For the FT991 change write_delay=0 and post_write_delay=2 https://github.com/Hamlib/Hamlib/issues/1163 Force the FT-991 to 100ms along with FT-DX2000, Ft-891, FT950, FTDX3000/D 10ms was seeing timeouts on some rigs using rigctl https://github.com/Hamlib/Hamlib/issues/1163 Update NEWS Fix ID for FT991 and FT991 in newcat.c so CAT TOT settings work https://github.com/Hamlib/Hamlib/issues/1163 Add secondary check for rig_model in newcat.c for CAT TOT in case ID command fails https://github.com/Hamlib/Hamlib/issues/1163 Change CAT TOT command in newcat.c to expect a response https://github.com/Hamlib/Hamlib/issues/1163 If rig does not have TARGETABLE_MODE then we return the cached values from VFOA https://github.com/Hamlib/Hamlib/issues/1172 Add RIG_TARGETABLE_MODE to ts890.c https://github.com/Hamlib/Hamlib/issues/1172 Fix Jupiter set_freq problem -- was messing up strlen due to binary format https://github.com/Hamlib/Hamlib/issues/1174 Merge branch 'master' of https://github.com/Hamlib/Hamlib Fix spelling error in rig.c Update simftdx3000.c Add missing calibration tables for TS890S Merge remote-tracking branch 'origin/master' into Hamlib-4.5.1 Revert "Fix range list in mds.c" Revert "Change MDS 4710/9710 to Alpha status -- no testing has been done yet" Revert "Split MDS 4710/9710" Revert "Add mds.h to mds/Makefile.am" Revert "Add MDS 4710 rig" Remove 9710.c Nate Bargmann (1): Advance configure.ac to 4.6~git PianetaRadio (30): Update netrotctl.c Update ft991.c Update newcat.c Update ft991.c Merge branch 'Hamlib:master' into master Update ft991.c Update newcat.c Added RIG_FUNC_NB2 get/send func Added RIG_FUNC_NB2 Update newcat version NB2 NB2 NB2 NB2 NB2 NB2 NB2 NB2 Update targetable_vfo NB2 Update targetable_vfo Update targetable_vfo Update targetable_vfo Update targetable_vfo Update targetable_vfo Update newcat.c Update newcat.c Update Merge branch 'Hamlib:master' into master Merge branch 'Hamlib:master' into master ----------------------------------------------------------------------- hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: n0nb <n0...@us...> - 2022-12-08 16:46:57
|
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.5.1 has been created at 75fbd097b1508e0a29b80206e193fd45a9a332cf (commit) - Log ----------------------------------------------------------------- commit 75fbd097b1508e0a29b80206e193fd45a9a332cf Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Dec 8 09:11:46 2022 -0600 Remove 9710.c diff --git a/rigs/mds/9710.c b/rigs/mds/9710.c deleted file mode 100644 index 0f6bd72f..00000000 --- a/rigs/mds/9710.c +++ /dev/null @@ -1,91 +0,0 @@ -#include "mds.h" - -const struct rig_caps mds_9710_caps = -{ - RIG_MODEL(RIG_MODEL_MDS9710), - .model_name = "9710", - .mfg_name = "MDS", - .version = "20221116.0", - .copyright = "LGPL", - .status = RIG_STATUS_BETA, - .rig_type = RIG_TYPE_TRANSCEIVER, - .ptt_type = RIG_PTT_RIG, - .dcd_type = RIG_DCD_NONE, - .port_type = RIG_PORT_SERIAL, - .serial_rate_min = 110, - .serial_rate_max = 38400, - .serial_data_bits = 8, - .serial_stop_bits = 1, - .serial_parity = RIG_PARITY_NONE, - .serial_handshake = RIG_HANDSHAKE_HARDWARE, - .write_delay = 0, - .post_write_delay = 0, - .timeout = 1000, - .retry = 3, - - .has_get_func = RIG_FUNC_NONE, - .has_set_func = RIG_FUNC_NONE, - .has_get_level = MDS_LEVELS, - .has_set_level = RIG_LEVEL_NONE, - .has_get_parm = RIG_PARM_NONE, - .has_set_parm = RIG_PARM_NONE, -// .level_gran = { [LVL_CWPITCH] = { .step = { .i = 10 } } }, -// .ctcss_list = common_ctcss_list, -// .dcs_list = full_dcs_list, -// 2050 does have channels...not implemented yet as no need yet -// .chan_list = { -// { 0, 18, RIG_MTYPE_MEM, DUMMY_MEM_CAP }, -// { 19, 19, RIG_MTYPE_CALL }, -// { 20, NB_CHAN-1, RIG_MTYPE_EDGE }, -// RIG_CHAN_END, -// }, -// .scan_ops = DUMMY_SCAN, -// .vfo_ops = DUMMY_VFO_OP, - .transceive = RIG_TRN_RIG, - .rx_range_list1 = { - { - .startf = MHz(800), .endf = MHz(880), .modes = MDS_ALL_MODES, - .startf = MHz(880), .endf = MHz(960), .modes = MDS_ALL_MODES, - .low_power = 0, .high_power = 0, MDS_ALL_MODES, RIG_ANT_1, - }, - RIG_FRNG_END, - }, - .rx_range_list2 = {RIG_FRNG_END,}, - .tx_range_list1 = { - {MHz(380), MHz(530), MDS_ALL_MODES, W(.1), W(5), RIG_VFO_A, RIG_ANT_NONE}, - RIG_FRNG_END, - }, -// .tx_range_list2 = {RIG_FRNG_END,} - .tuning_steps = { - // Rem: no support for changing tuning step - {MDS_ALL_MODES, 6250}, - RIG_TS_END, - }, - - .filters = { - {MDS_ALL_MODES, RIG_FLT_ANY}, - RIG_FLT_END - }, - .priv = NULL, - - .rig_init = mds_init, - .rig_open = mds_open, - .rig_cleanup = mds_cleanup, - -// .set_conf = dummy_set_conf, -// .get_conf = dummy_get_conf, - - .set_freq = mds_set_freq, - .get_freq = mds_get_freq, -// .set_mode = mds_set_mode, -// .get_mode = mds_get_mode, - -// .set_level = dummy_set_level, -// .get_level = mds_get_level, - - .get_info = mds_get_info, - .set_ptt = mds_set_ptt, - .get_ptt = mds_get_ptt, -// .get_dcd = dummy_get_dcd, - .hamlib_check_rig_caps = HAMLIB_CHECK_RIG_CAPS -}; commit 9a1ea33d0e254bf89100dc47cc74bc8ab9698ed4 Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Dec 8 09:08:50 2022 -0600 Revert "Add MDS 4710 rig" This reverts commit 1e68b06b53829221567792276f7de335991331f5. diff --git a/configure.ac b/configure.ac index d6c9f11b..c92e77cc 100644 --- a/configure.ac +++ b/configure.ac @@ -47,7 +47,7 @@ dnl added to AC_CONFIG_FILES near the end of this file. See README.developer dnl Beware of duplication should a backend directory include both rig and dnl rotor definitions, e.g. "dummy". Optional backends will not be listed dnl here but will be added later, e.g. "winradio". -RIG_BACKEND_LIST="rigs/adat rigs/alinco rigs/aor rigs/barrett rigs/codan rigs/dorji rigs/drake rigs/dummy rigs/elad rigs/flexradio rigs/icom rigs/icmarine rigs/jrc rigs/kachina rigs/kenwood rigs/kit rigs/lowe rigs/pcr rigs/prm80 rigs/racal rigs/rft rigs/rs rigs/skanti rigs/tapr rigs/tentec rigs/tuner rigs/uniden rigs/winradio rigs/wj rigs/yaesu rigs/gomspace rigs/mds" +RIG_BACKEND_LIST="rigs/adat rigs/alinco rigs/aor rigs/barrett rigs/codan rigs/dorji rigs/drake rigs/dummy rigs/elad rigs/flexradio rigs/icom rigs/icmarine rigs/jrc rigs/kachina rigs/kenwood rigs/kit rigs/lowe rigs/pcr rigs/prm80 rigs/racal rigs/rft rigs/rs rigs/skanti rigs/tapr rigs/tentec rigs/tuner rigs/uniden rigs/winradio rigs/wj rigs/yaesu rigs/gomspace" ROT_BACKEND_LIST="rotators/amsat rotators/ars rotators/celestron rotators/cnctrk rotators/grbltrk rotators/easycomm rotators/ether6 rotators/fodtrack rotators/gs232a rotators/heathkit rotators/m2 rotators/meade rotators/rotorez rotators/sartek rotators/spid rotators/ts7400 rotators/prosistel rotators/ioptron rotators/satel rotators/radant" # Amplifiers are all in the amplifiers directory AMP_BACKEND_LIST="amplifiers/elecraft amplifiers/gemini" @@ -879,7 +879,6 @@ rigs/winradio/Makefile rigs/wj/Makefile rigs/yaesu/Makefile rigs/gomspace/Makefile -rigs/mds/Makefile tests/Makefile scripts/Makefile android/Makefile diff --git a/include/hamlib/riglist.h b/include/hamlib/riglist.h index fd7a1d93..a6843224 100644 --- a/include/hamlib/riglist.h +++ b/include/hamlib/riglist.h @@ -659,12 +659,6 @@ #define RIG_MODEL_GS100 RIG_MAKE_MODEL(RIG_GOMSPACE, 1) //! @endcond -/* - * MDS Microwave Data Systems https://en.wikipedia.org/wiki/Microwave_Data_Systems - */ -#define RIG_MDS 36 -#define RIG_BACKEND_MDS "MDS" -#define RIG_MODEL_MDS4710 RIG_MAKE_MODEL(RIG_MDS, 1) /* * TODO: RIG_MODEL_KWZ30, KNEISNER +DOERING diff --git a/rigs/mds/Android.mk b/rigs/mds/Android.mk deleted file mode 100644 index 1de62734..00000000 --- a/rigs/mds/Android.mk +++ /dev/null @@ -1,12 +0,0 @@ -LOCAL_PATH:= $(call my-dir) - -include $(CLEAR_VARS) - -LOCAL_SRC_FILES := mds.c -LOCAL_MODULE := mds - -LOCAL_CFLAGS := -LOCAL_C_INCLUDES := android include src -LOCAL_LDLIBS := -lhamlib -Lobj/local/$(TARGET_ARCH_ABI) - -include $(BUILD_STATIC_LIBRARY) diff --git a/rigs/mds/Makefile.am b/rigs/mds/Makefile.am deleted file mode 100644 index ca478dde..00000000 --- a/rigs/mds/Makefile.am +++ /dev/null @@ -1,6 +0,0 @@ -MDSSRC = mds.c - -noinst_LTLIBRARIES = libhamlib-mds.la -libhamlib_mds_la_SOURCES = $(MDSSRC) - -EXTRA_DIST = Android.mk diff --git a/rigs/mds/mds.c b/rigs/mds/mds.c deleted file mode 100644 index e2a9e1ef..00000000 --- a/rigs/mds/mds.c +++ /dev/null @@ -1,660 +0,0 @@ -/* - * Hamlib MDS 4710/9710 backend - main file - * Copyright (c) 2022 by Michael Black W9MDB - * - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ -#include <hamlib/config.h> - -#include <stdio.h> -#include <stdlib.h> -#include <string.h> - -#include <hamlib/rig.h> -#include "serial.h" -#include "misc.h" -#include "cal.h" -#include "token.h" -#include "register.h" - -#include "mds.h" - -#define MAXCMDLEN 32 - -#define MDS_VFOS (RIG_VFO_A) - -#define MDS_MODES (RIG_MODE_NONE) - -#define MDS_LEVELS (RIG_LEVEL_NONE) - - -const struct rig_caps mds_caps; - -DECLARE_INITRIG_BACKEND(mds) -{ - rig_debug(RIG_DEBUG_VERBOSE, "%s: _init called\n", __func__); - - rig_register(&mds_caps); - rig_debug(RIG_DEBUG_VERBOSE, "%s: _init back from rig_register\n", __func__); - - return RIG_OK; -} - -int mds_transaction(RIG *rig, char *cmd, int expected, char **result) -{ - char cmd_buf[MAXCMDLEN]; - int retval; - struct rig_state *rs = &rig->state; - struct mds_priv_data *priv = rig->state.priv; - - rig_debug(RIG_DEBUG_VERBOSE, "%s: cmd=%s\n", __func__, cmd); - - SNPRINTF(cmd_buf, sizeof(cmd_buf), "%s\n", cmd); - - rig_flush(&rs->rigport); - retval = write_block(&rs->rigport, (unsigned char *) cmd_buf, strlen(cmd_buf)); - - if (retval < 0) - { - return retval; - } - - if (expected == 0) - { - return RIG_OK; - } - else - { - char cmdtrm_str[2]; /* Default Command/Reply termination char */ - cmdtrm_str[0] = 0x0d; - cmdtrm_str[1] = 0x00; - retval = read_string(&rs->rigport, (unsigned char *) priv->ret_data, - sizeof(priv->ret_data), cmdtrm_str, strlen(cmdtrm_str), 0, expected); - - if (retval < 0) - { - rig_debug(RIG_DEBUG_ERR, "%s(%d): error in read_block\n", __func__, __LINE__); - return retval; - } - } - - if (result != NULL) - { - rig_debug(RIG_DEBUG_VERBOSE, "%s: setting result\n", __func__); - *result = &(priv->ret_data[0]); - } - else - { - rig_debug(RIG_DEBUG_VERBOSE, "%s: no result requested\n", __func__); - } - - return RIG_OK; -} - -int mds_init(RIG *rig) -{ - rig_debug(RIG_DEBUG_VERBOSE, "%s version %s\n", __func__, rig->caps->version); - // cppcheck claims leak here but it's freed in cleanup - rig->state.priv = (struct mds_priv_data *)calloc(1, - sizeof(struct mds_priv_data)); - - if (!rig->state.priv) - { - return -RIG_ENOMEM; - } - - return RIG_OK; -} - -/* - * mds_cleanup - * - */ - -int mds_cleanup(RIG *rig) -{ - - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); - - if (!rig) - { - return -RIG_EINVAL; - } - - if (rig->state.priv) - { - free(rig->state.priv); - } - - rig->state.priv = NULL; - - return RIG_OK; -} - -/* - * mds_get_freq - * Assumes rig!=NULL, rig->state.priv!=NULL, freq!=NULL - */ -int mds_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) -{ - int retval; - char *response = NULL; - - rig_debug(RIG_DEBUG_VERBOSE, "%s: vfo=%s\n", __func__, rig_strvfo(vfo)); - *freq = 0; - - retval = mds_transaction(rig, "TX", 16, &response); - - if (retval != RIG_OK) - { - rig_debug(RIG_DEBUG_ERR, "%s: invalid response=%s\n", __func__, response); - return retval; - } - - retval = sscanf(response, "%lg", freq); - - if (retval != 1) - { - rig_debug(RIG_DEBUG_ERR, "%s: Unable to parse response\n", __func__); - return -RIG_EPROTO; - } - - return RIG_OK; -} - -// TC command does not work on 4050 -- not implemented as of 2022-01-12 -/* - * mds_set_freq - * assumes rig!=NULL, rig->state.priv!=NULL - */ -int mds_set_freq(RIG *rig, vfo_t vfo, freq_t freq) -{ - char cmd_buf[MAXCMDLEN]; - int retval; - freq_t tfreq; - - rig_debug(RIG_DEBUG_VERBOSE, "%s: vfo=%s freq=%.0f\n", __func__, - rig_strvfo(vfo), freq); - - retval = rig_get_freq(rig, vfo, &tfreq); - - if (retval != RIG_OK) - { - rig_debug(RIG_DEBUG_VERBOSE, "%s: get_freq failed: %s\n", __func__, - strerror(retval)); - return retval; - } - - if (tfreq == freq) - { - rig_debug(RIG_DEBUG_VERBOSE, "%s: freq not changing\n", __func__); - return RIG_OK; - } - - // If we are not explicitly asking for VFO_B then we'll set the receive side also - if (vfo != RIG_VFO_B) - { - char *response = NULL; - SNPRINTF((char *) cmd_buf, sizeof(cmd_buf), "TX%.4f", freq / 1e6); - retval = mds_transaction(rig, cmd_buf, 0, &response); - - if (retval < 0) - { - rig_debug(RIG_DEBUG_ERR, "%s: TX failed\n", __func__); - return retval; - } - - SNPRINTF((char *) cmd_buf, sizeof(cmd_buf), "RX%.4f", freq / 1e6); - retval = mds_transaction(rig, cmd_buf, 0, &response); - - if (retval < 0) - { - rig_debug(RIG_DEBUG_ERR, "%s: RX failed\n", __func__); - return retval; - } - } - - return RIG_OK; -} - -/* - * mds_set_ptt - * Assumes rig!=NULL - */ -int mds_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) -{ - int retval; - char cmd_buf[MAXCMDLEN]; - char *response = NULL; - - rig_debug(RIG_DEBUG_VERBOSE, "%s: ptt=%d\n", __func__, ptt); - - SNPRINTF(cmd_buf, sizeof(cmd_buf), "%s", ptt ? "KEY" : "DKEY"); - retval = mds_transaction(rig, cmd_buf, 0, &response); - - if (retval < 0) - { - rig_debug(RIG_DEBUG_ERR, "%s: invalid response=%s\n", __func__, response); - return retval; - } - - if (strncmp(response, "OK", 2) != 0) - { - rig_debug(RIG_DEBUG_ERR, "%s: Expected OK, got '%s'\n", __func__, response); - return -RIG_EINVAL; - } - - rig_debug(RIG_DEBUG_VERBOSE, "%s: cmd:IP result=%s\n", __func__, response); - - return RIG_OK; -} - -/* - * mds_get_ptt - * Assumes rig!=NULL - */ -int mds_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt) -{ - int retval; - char *response = NULL; - char c; - - rig_debug(RIG_DEBUG_VERBOSE, "%s: vfo=%s\n", __func__, rig_strvfo(vfo)); - - retval = mds_transaction(rig, "IP", 0, &response); - - if (retval != RIG_OK) - { - rig_debug(RIG_DEBUG_ERR, "%s: error response?='%s'\n", __func__, response); - return retval; - } - - c = response[0]; - - if (c == '1' || c == '0') - { - *ptt = c - '0'; - } - else - { - rig_debug(RIG_DEBUG_ERR, "%s: error response='%s'\n", __func__, response); - return -RIG_EPROTO; - } - - return RIG_OK; -} - -/* - * mds_set_mode - * Assumes rig!=NULL - * Note that 2050 does not have set or get width - */ -int mds_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) -{ - char cmd_buf[32], ttmode; - int retval; - rmode_t tmode; - pbwidth_t twidth; - - //struct tt588_priv_data *priv = (struct tt588_priv_data *) rig->state.priv; - - rig_debug(RIG_DEBUG_VERBOSE, "%s: vfo=%s mode=%s width=%d\n", __func__, - rig_strvfo(vfo), rig_strrmode(mode), (int)width); - - retval = rig_get_mode(rig, vfo, &tmode, &twidth); - - if (retval != RIG_OK) - { - rig_debug(RIG_DEBUG_ERR, "%s: get_mode failed %s\n", __func__, - strerror(retval)); - } - - if (tmode == mode) - { - rig_debug(RIG_DEBUG_VERBOSE, "%s: already mode %s so not changing\n", __func__, - rig_strrmode(mode)); - return RIG_OK; - } - - switch (mode) - { - case RIG_MODE_USB: - ttmode = 'U'; - break; - - case RIG_MODE_LSB: - ttmode = 'L'; - break; - - case RIG_MODE_CW: - ttmode = 'C'; - break; - - case RIG_MODE_AM: - ttmode = 'A'; - break; - - case RIG_MODE_RTTY: - ttmode = 'F'; - break; - - default: - rig_debug(RIG_DEBUG_ERR, "%s: unsupported mode %s\n", __func__, - rig_strrmode(mode)); - return -RIG_EINVAL; - } - - SNPRINTF((char *) cmd_buf, sizeof(cmd_buf), "TB%c\n", ttmode); - - retval = mds_transaction(rig, cmd_buf, 0, NULL); - - if (retval < 0) - { - return retval; - } - - return RIG_OK; -} - -/* - * mds_get_mode - * Assumes rig!=NULL - * Note that 2050 does not have set or get width - */ -int mds_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) -{ - char *result = NULL; - int retval; - - rig_debug(RIG_DEBUG_VERBOSE, "%s: vfo=%s\n", __func__, rig_strvfo(vfo)); - - retval = mds_transaction(rig, "IB", 0, &result); - - if (retval != RIG_OK) - { - rig_debug(RIG_DEBUG_ERR, "%s: bad response=%s\n", __func__, result); - return retval; - } - - //dump_hex((unsigned char *)result,strlen(result)); - switch (result[1]) - { - case 'L': - *mode = RIG_MODE_LSB; - break; - - case 'U': - *mode = RIG_MODE_USB; - break; - - case 'A': - *mode = RIG_MODE_AM; - break; - - case 'F': - *mode = RIG_MODE_RTTY; - break; - - case 'C': - *mode = RIG_MODE_CW; - break; - - default: - rig_debug(RIG_DEBUG_ERR, "%s: Unknown mode='%c%c'\n", __func__, result[0], - result[1]); - return -RIG_EPROTO; - } - - *width = 3000; // we'll default this to 3000 for now - rig_debug(RIG_DEBUG_VERBOSE, "%s: vfo=%s mode=%s width=%d\n", __func__, - rig_strvfo(vfo), rig_strrmode(*mode), (int)*width); - - return RIG_OK; -} - -#if 0 -int mds_get_vfo(RIG *rig, vfo_t *vfo) -{ - *vfo = RIG_VFO_A; - - if (check_vfo(*vfo) == FALSE) - { - rig_debug(RIG_DEBUG_ERR, "%s: unsupported VFO %s\n", __func__, - rig_strvfo(*vfo)); - return -RIG_EINVAL; - } - - rig_debug(RIG_DEBUG_VERBOSE, "%s: vfo=%s\n", __func__, rig_strvfo(*vfo)); - - return RIG_OK; -} -#endif - -/* - * mds_get_level - */ -int mds_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) -{ - int retval = 0; - char *response = NULL; - - switch (level) - { - int strength; - int n; - - case RIG_LEVEL_STRENGTH: - retval = mds_transaction(rig, "IAL", 0, &response); - - if (retval < 0) - { - rig_debug(RIG_DEBUG_ERR, "%s: invalid response=%s\n", __func__, - response); - return retval; - } - - n = sscanf(response, "%2d", &strength); - - if (n == 1) - { - val->i = strength; - } - else - { - rig_debug(RIG_DEBUG_ERR, "%s: unable to parse STRENGTH from %s\n", - __func__, response); - return -RIG_EPROTO; - } - - break; - - default: - rig_debug(RIG_DEBUG_ERR, "%s: unsupported level %s\n", __func__, - rig_strlevel(level)); - return -RIG_EINVAL; - } - - rig_debug(RIG_DEBUG_VERBOSE, "%s: vfo=%s level=%s val=%s\n", __func__, - rig_strvfo(vfo), rig_strlevel(level), response); - - return RIG_OK; -} - -/* - * mds_get_info - */ -const char *mds_get_info(RIG *rig) -{ - char *response = NULL; - int retval; - - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); - - retval = mds_transaction(rig, "MODEL", 16, &response); - - if (retval != RIG_OK) - { - rig_debug(RIG_DEBUG_WARN, "%s: MODEL command failed: %s\n", __func__, - strerror(retval)); - } - else - { - rig_debug(RIG_DEBUG_VERBOSE, "Model: %s\n", response); - } - - response = NULL; - retval = mds_transaction(rig, "SER", 16, &response); - - if (retval != RIG_OK) - { - rig_debug(RIG_DEBUG_WARN, "%s: SER command failed: %s\n", __func__, - strerror(retval)); - } - else - { - rig_debug(RIG_DEBUG_VERBOSE, "Serial# %s\n", response); - } - - response = NULL; - retval = mds_transaction(rig, "SREV", 16, &response); - - if (retval != RIG_OK) - { - rig_debug(RIG_DEBUG_WARN, "%s: SREV command failed: %s\n", __func__, - strerror(retval)); - } - else - { - rig_debug(RIG_DEBUG_VERBOSE, "Firmware %s\n", response); - } - - response = NULL; - retval = mds_transaction(rig, "SHOW DC", 16, &response); - - if (retval != RIG_OK) - { - rig_debug(RIG_DEBUG_ERR, "%s: SHOW DC failed result=%s\n", __func__, response); - } - else - { - rig_debug(RIG_DEBUG_VERBOSE, "DC %s\n", response); - } - - return response; -} - -int mds_open(RIG *rig) -{ - char *response = NULL; - int retval; - - ENTERFUNC; - mds_get_info(rig); - retval = mds_transaction(rig, "MODEM NONE", 0, &response); - retval = mds_transaction(rig, "PTT 0", 0, &response); - RETURNFUNC(retval); -} - -const struct rig_caps mds_caps = -{ - RIG_MODEL(RIG_MODEL_MDS4710), - .model_name = "4710", - .mfg_name = "MDS", - .version = "20221114.0", - .copyright = "LGPL", - .status = RIG_STATUS_BETA, - .rig_type = RIG_TYPE_TRANSCEIVER, -// .targetable_vfo = RIG_TARGETABLE_FREQ | RIG_TARGETABLE_MODE, - .ptt_type = RIG_PTT_RIG, - .dcd_type = RIG_DCD_NONE, - .port_type = RIG_PORT_SERIAL, - .serial_rate_min = 110, - .serial_rate_max = 38400, - .serial_data_bits = 8, - .serial_stop_bits = 1, - .serial_parity = RIG_PARITY_NONE, - .serial_handshake = RIG_HANDSHAKE_HARDWARE, - .write_delay = 0, - .post_write_delay = 0, - .timeout = 1000, - .retry = 3, - - .has_get_func = RIG_FUNC_NONE, - .has_set_func = RIG_FUNC_NONE, - .has_get_level = MDS_LEVELS, - .has_set_level = RIG_LEVEL_NONE, - .has_get_parm = RIG_PARM_NONE, - .has_set_parm = RIG_PARM_NONE, -// .level_gran = { [LVL_CWPITCH] = { .step = { .i = 10 } } }, -// .ctcss_list = common_ctcss_list, -// .dcs_list = full_dcs_list, -// 2050 does have channels...not implemented yet as no need yet -// .chan_list = { -// { 0, 18, RIG_MTYPE_MEM, DUMMY_MEM_CAP }, -// { 19, 19, RIG_MTYPE_CALL }, -// { 20, NB_CHAN-1, RIG_MTYPE_EDGE }, -// RIG_CHAN_END, -// }, -// .scan_ops = DUMMY_SCAN, -// .vfo_ops = DUMMY_VFO_OP, - .transceive = RIG_TRN_RIG, - .rx_range_list1 = { - { - .startf = MHz(380), .endf = MHz(530), .modes = RIG_MODE_ALL, - .low_power = 0, .high_power = 0, MDS_VFOS, RIG_ANT_1 - }, - RIG_FRNG_END, - }, - .rx_range_list2 = {RIG_FRNG_END,}, - .tx_range_list1 = { - {MHz(380), MHz(530), RIG_MODE_ALL, W(.1), W(5), RIG_VFO_A, RIG_ANT_NONE}, - RIG_FRNG_END, - }, -// .tx_range_list2 = {RIG_FRNG_END,} - .tuning_steps = { - // Rem: no support for changing tuning step - {RIG_MODE_ALL, 6250}, - RIG_TS_END, - }, - - .filters = { - {RIG_MODE_ALL, RIG_FLT_ANY}, - RIG_FLT_END - }, - .priv = NULL, - - .rig_init = mds_init, - .rig_open = mds_open, - .rig_cleanup = mds_cleanup, - -// .set_conf = dummy_set_conf, -// .get_conf = dummy_get_conf, - - .set_freq = mds_set_freq, - .get_freq = mds_get_freq, -// .set_mode = mds_set_mode, -// .get_mode = mds_get_mode, - -// .set_level = dummy_set_level, -// .get_level = mds_get_level, - - .get_info = mds_get_info, - .set_ptt = mds_set_ptt, - .get_ptt = mds_get_ptt, -// .get_dcd = dummy_get_dcd, - .hamlib_check_rig_caps = HAMLIB_CHECK_RIG_CAPS -}; diff --git a/rigs/mds/mds.h b/rigs/mds/mds.h deleted file mode 100644 index b9d0cfce..00000000 --- a/rigs/mds/mds.h +++ /dev/null @@ -1,9 +0,0 @@ -#define MDS_DATA_LEN 256 -#define MDS_RET_LEN 256 -struct mds_priv_data { - char cmd_str[MDS_DATA_LEN]; /* command string buffer */ - char ret_data[MDS_RET_LEN]; /* returned data--max value, most are less */ -}; - -extern const struct rig_caps barrett_caps; - diff --git a/src/register.c b/src/register.c index d49f2b9f..c9aa4841 100644 --- a/src/register.c +++ b/src/register.c @@ -44,7 +44,7 @@ # define PATH_MAX 1024 #endif -#define RIG_BACKEND_MAX 50 +#define RIG_BACKEND_MAX 32 #define DEFINE_INITRIG_BACKEND(backend) \ int MAKE_VERSIONED_FN(PREFIX_INITRIG, ABI_VERSION, backend(void *be_handle)); \ @@ -89,7 +89,6 @@ DEFINE_INITRIG_BACKEND(barrett); DEFINE_INITRIG_BACKEND(elad); DEFINE_INITRIG_BACKEND(codan); DEFINE_INITRIG_BACKEND(gomspace); -DEFINE_INITRIG_BACKEND(mds); //! @endcond #ifdef HAVE_WINRADIO @@ -148,7 +147,6 @@ static struct { RIG_ELAD, RIG_BACKEND_ELAD, RIG_FUNCNAMA(elad) }, { RIG_CODAN, RIG_BACKEND_CODAN, RIG_FUNCNAMA(codan) }, { RIG_GOMSPACE, RIG_BACKEND_GOMSPACE, RIG_FUNCNAM(gomspace) }, - { RIG_MDS, RIG_BACKEND_MDS, RIG_FUNCNAMA(mds) }, { 0, NULL }, /* end */ }; commit bffec5b5284dc2e6e9a8097b842d8b587b8fd87f Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Dec 8 09:08:05 2022 -0600 Revert "Add mds.h to mds/Makefile.am" This reverts commit 99627855a20a1c61781f5c3cc148efa8c0b5f1c4. diff --git a/rigs/mds/Makefile.am b/rigs/mds/Makefile.am index 12bfe7ee..ca478dde 100644 --- a/rigs/mds/Makefile.am +++ b/rigs/mds/Makefile.am @@ -1,4 +1,4 @@ -MDSSRC = mds.c mds.h +MDSSRC = mds.c noinst_LTLIBRARIES = libhamlib-mds.la libhamlib_mds_la_SOURCES = $(MDSSRC) commit 4b794bf08f0d6444efaa6e46968ef6939ab4aa9d Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Dec 8 09:07:29 2022 -0600 Revert "Split MDS 4710/9710" This reverts commit 1a4745a7c21b5e55653540e8a003f2ad0cee6d9f. diff --git a/include/hamlib/riglist.h b/include/hamlib/riglist.h index 0850f5ed..fd7a1d93 100644 --- a/include/hamlib/riglist.h +++ b/include/hamlib/riglist.h @@ -665,7 +665,6 @@ #define RIG_MDS 36 #define RIG_BACKEND_MDS "MDS" #define RIG_MODEL_MDS4710 RIG_MAKE_MODEL(RIG_MDS, 1) -#define RIG_MODEL_MDS9710 RIG_MAKE_MODEL(RIG_MDS, 2) /* * TODO: RIG_MODEL_KWZ30, KNEISNER +DOERING diff --git a/rigs/mds/4710.c b/rigs/mds/4710.c deleted file mode 100644 index 8d3725e5..00000000 --- a/rigs/mds/4710.c +++ /dev/null @@ -1,93 +0,0 @@ -#include "mds.h" - -const struct rig_caps mds_4710_caps = -{ - RIG_MODEL(RIG_MODEL_MDS4710), - .model_name = "4710", - .mfg_name = "MDS", - .version = "20221114.0", - .copyright = "LGPL", - .status = RIG_STATUS_BETA, - .rig_type = RIG_TYPE_TRANSCEIVER, - .ptt_type = RIG_PTT_RIG, - .dcd_type = RIG_DCD_NONE, - .port_type = RIG_PORT_SERIAL, - .serial_rate_min = 110, - .serial_rate_max = 38400, - .serial_data_bits = 8, - .serial_stop_bits = 1, - .serial_parity = RIG_PARITY_NONE, - .serial_handshake = RIG_HANDSHAKE_HARDWARE, - .write_delay = 0, - .post_write_delay = 0, - .timeout = 1000, - .retry = 3, - - .has_get_func = RIG_FUNC_NONE, - .has_set_func = RIG_FUNC_NONE, - .has_get_level = MDS_LEVELS, - .has_set_level = RIG_LEVEL_NONE, - .has_get_parm = RIG_PARM_NONE, - .has_set_parm = RIG_PARM_NONE, -// .level_gran = { [LVL_CWPITCH] = { .step = { .i = 10 } } }, -// .ctcss_list = common_ctcss_list, -// .dcs_list = full_dcs_list, -// 2050 does have channels...not implemented yet as no need yet -// .chan_list = { -// { 0, 18, RIG_MTYPE_MEM, DUMMY_MEM_CAP }, -// { 19, 19, RIG_MTYPE_CALL }, -// { 20, NB_CHAN-1, RIG_MTYPE_EDGE }, -// RIG_CHAN_END, -// }, -// .scan_ops = DUMMY_SCAN, -// .vfo_ops = DUMMY_VFO_OP, - .transceive = RIG_TRN_RIG, - .rx_range_list1 = { - { - .startf = MHz(380), .endf = MHz(530), .modes = MDS_ALL_MODES, - .low_power = 0, .high_power = 0, MDS_VFOS, RIG_ANT_1, "USA" - }, - RIG_FRNG_END, - }, - .rx_range_list2 = {RIG_FRNG_END,}, - .tx_range_list1 = { - {MHz(380), MHz(400), MDS_ALL_MODES, W(.1), W(5), RIG_VFO_A, RIG_ANT_NONE, "USA"}, - {MHz(400), MHz(450), MDS_ALL_MODES, W(.1), W(5), RIG_VFO_A, RIG_ANT_NONE, "USA"}, - {MHz(450), MHz(512), MDS_ALL_MODES, W(.1), W(5), RIG_VFO_A, RIG_ANT_NONE, "USA"}, - {MHz(406), MHz(530), MDS_ALL_MODES, W(.1), W(5), RIG_VFO_A, RIG_ANT_NONE, "USA"}, - RIG_FRNG_END, - }, -// .tx_range_list2 = {RIG_FRNG_END,} - .tuning_steps = { - // Rem: no support for changing tuning step - {MDS_ALL_MODES, 6250}, - RIG_TS_END, - }, - - .filters = { - {MDS_ALL_MODES, RIG_FLT_ANY}, - RIG_FLT_END - }, - .priv = NULL, - - .rig_init = mds_init, - .rig_open = mds_open, - .rig_cleanup = mds_cleanup, - -// .set_conf = dummy_set_conf, -// .get_conf = dummy_get_conf, - - .set_freq = mds_set_freq, - .get_freq = mds_get_freq, -// .set_mode = mds_set_mode, -// .get_mode = mds_get_mode, - -// .set_level = dummy_set_level, -// .get_level = mds_get_level, - - .get_info = mds_get_info, - .set_ptt = mds_set_ptt, - .get_ptt = mds_get_ptt, -// .get_dcd = dummy_get_dcd, - .hamlib_check_rig_caps = HAMLIB_CHECK_RIG_CAPS -}; diff --git a/rigs/mds/Makefile.am b/rigs/mds/Makefile.am index 20144ede..12bfe7ee 100644 --- a/rigs/mds/Makefile.am +++ b/rigs/mds/Makefile.am @@ -1,4 +1,4 @@ -MDSSRC = mds.c mds.h 4710.c 9710.c +MDSSRC = mds.c mds.h noinst_LTLIBRARIES = libhamlib-mds.la libhamlib_mds_la_SOURCES = $(MDSSRC) diff --git a/rigs/mds/mds.c b/rigs/mds/mds.c index 37f73c25..e2a9e1ef 100644 --- a/rigs/mds/mds.c +++ b/rigs/mds/mds.c @@ -35,15 +35,20 @@ #define MAXCMDLEN 32 -extern const struct rig_caps mds_4710_caps; -extern const struct rig_caps mds_9710_caps; +#define MDS_VFOS (RIG_VFO_A) + +#define MDS_MODES (RIG_MODE_NONE) + +#define MDS_LEVELS (RIG_LEVEL_NONE) + + +const struct rig_caps mds_caps; DECLARE_INITRIG_BACKEND(mds) { rig_debug(RIG_DEBUG_VERBOSE, "%s: _init called\n", __func__); - rig_register(&mds_4710_caps); - rig_register(&mds_9710_caps); + rig_register(&mds_caps); rig_debug(RIG_DEBUG_VERBOSE, "%s: _init back from rig_register\n", __func__); return RIG_OK; @@ -563,3 +568,93 @@ int mds_open(RIG *rig) retval = mds_transaction(rig, "PTT 0", 0, &response); RETURNFUNC(retval); } + +const struct rig_caps mds_caps = +{ + RIG_MODEL(RIG_MODEL_MDS4710), + .model_name = "4710", + .mfg_name = "MDS", + .version = "20221114.0", + .copyright = "LGPL", + .status = RIG_STATUS_BETA, + .rig_type = RIG_TYPE_TRANSCEIVER, +// .targetable_vfo = RIG_TARGETABLE_FREQ | RIG_TARGETABLE_MODE, + .ptt_type = RIG_PTT_RIG, + .dcd_type = RIG_DCD_NONE, + .port_type = RIG_PORT_SERIAL, + .serial_rate_min = 110, + .serial_rate_max = 38400, + .serial_data_bits = 8, + .serial_stop_bits = 1, + .serial_parity = RIG_PARITY_NONE, + .serial_handshake = RIG_HANDSHAKE_HARDWARE, + .write_delay = 0, + .post_write_delay = 0, + .timeout = 1000, + .retry = 3, + + .has_get_func = RIG_FUNC_NONE, + .has_set_func = RIG_FUNC_NONE, + .has_get_level = MDS_LEVELS, + .has_set_level = RIG_LEVEL_NONE, + .has_get_parm = RIG_PARM_NONE, + .has_set_parm = RIG_PARM_NONE, +// .level_gran = { [LVL_CWPITCH] = { .step = { .i = 10 } } }, +// .ctcss_list = common_ctcss_list, +// .dcs_list = full_dcs_list, +// 2050 does have channels...not implemented yet as no need yet +// .chan_list = { +// { 0, 18, RIG_MTYPE_MEM, DUMMY_MEM_CAP }, +// { 19, 19, RIG_MTYPE_CALL }, +// { 20, NB_CHAN-1, RIG_MTYPE_EDGE }, +// RIG_CHAN_END, +// }, +// .scan_ops = DUMMY_SCAN, +// .vfo_ops = DUMMY_VFO_OP, + .transceive = RIG_TRN_RIG, + .rx_range_list1 = { + { + .startf = MHz(380), .endf = MHz(530), .modes = RIG_MODE_ALL, + .low_power = 0, .high_power = 0, MDS_VFOS, RIG_ANT_1 + }, + RIG_FRNG_END, + }, + .rx_range_list2 = {RIG_FRNG_END,}, + .tx_range_list1 = { + {MHz(380), MHz(530), RIG_MODE_ALL, W(.1), W(5), RIG_VFO_A, RIG_ANT_NONE}, + RIG_FRNG_END, + }, +// .tx_range_list2 = {RIG_FRNG_END,} + .tuning_steps = { + // Rem: no support for changing tuning step + {RIG_MODE_ALL, 6250}, + RIG_TS_END, + }, + + .filters = { + {RIG_MODE_ALL, RIG_FLT_ANY}, + RIG_FLT_END + }, + .priv = NULL, + + .rig_init = mds_init, + .rig_open = mds_open, + .rig_cleanup = mds_cleanup, + +// .set_conf = dummy_set_conf, +// .get_conf = dummy_get_conf, + + .set_freq = mds_set_freq, + .get_freq = mds_get_freq, +// .set_mode = mds_set_mode, +// .get_mode = mds_get_mode, + +// .set_level = dummy_set_level, +// .get_level = mds_get_level, + + .get_info = mds_get_info, + .set_ptt = mds_set_ptt, + .get_ptt = mds_get_ptt, +// .get_dcd = dummy_get_dcd, + .hamlib_check_rig_caps = HAMLIB_CHECK_RIG_CAPS +}; diff --git a/rigs/mds/mds.h b/rigs/mds/mds.h index 2b985eb8..b9d0cfce 100644 --- a/rigs/mds/mds.h +++ b/rigs/mds/mds.h @@ -1,28 +1,9 @@ -#include <hamlib/rig.h> - #define MDS_DATA_LEN 256 #define MDS_RET_LEN 256 - -#define MDS_VFOS (RIG_VFO_A) - -#define MDS_ALL_MODES (RIG_MODE_USB) - -#define MDS_LEVELS (RIG_LEVEL_NONE) - - struct mds_priv_data { char cmd_str[MDS_DATA_LEN]; /* command string buffer */ char ret_data[MDS_RET_LEN]; /* returned data--max value, most are less */ }; -extern const struct rig_caps mds_4710_caps; -extern const struct rig_caps mds_9710_caps; +extern const struct rig_caps barrett_caps; -int mds_init(RIG *rig); -int mds_open(RIG *rig); -int mds_cleanup(RIG *rig); -int mds_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt); -int mds_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt); -int mds_get_freq(RIG *rig, vfo_t vfo, freq_t *freq); -int mds_set_freq(RIG *rig, vfo_t vfo, freq_t freq); -const char *mds_get_info(RIG *rig); commit 6ad428e09180d5d6a79f39ad6e6ce0c649415e5b Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Dec 8 09:01:55 2022 -0600 Revert "Change MDS 4710/9710 to Alpha status -- no testing has been done yet" This reverts commit 09f83cbfb7b2be5909dfa329e0c7d20ad253a694. diff --git a/rigs/mds/4710.c b/rigs/mds/4710.c index 879bf38a..8d3725e5 100644 --- a/rigs/mds/4710.c +++ b/rigs/mds/4710.c @@ -7,7 +7,7 @@ const struct rig_caps mds_4710_caps = .mfg_name = "MDS", .version = "20221114.0", .copyright = "LGPL", - .status = RIG_STATUS_ALPHA, + .status = RIG_STATUS_BETA, .rig_type = RIG_TYPE_TRANSCEIVER, .ptt_type = RIG_PTT_RIG, .dcd_type = RIG_DCD_NONE, diff --git a/rigs/mds/9710.c b/rigs/mds/9710.c index 5bd40740..0f6bd72f 100644 --- a/rigs/mds/9710.c +++ b/rigs/mds/9710.c @@ -7,7 +7,7 @@ const struct rig_caps mds_9710_caps = .mfg_name = "MDS", .version = "20221116.0", .copyright = "LGPL", - .status = RIG_STATUS_ALPHA, + .status = RIG_STATUS_BETA, .rig_type = RIG_TYPE_TRANSCEIVER, .ptt_type = RIG_PTT_RIG, .dcd_type = RIG_DCD_NONE, commit f1464f5a1ce9b1de39f6100690b4bb46daa226f9 Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Dec 8 09:01:44 2022 -0600 Revert "Fix range list in mds.c" This reverts commit b4a6f985247a2289dee8554d27f89132feeb1781. diff --git a/rigs/mds/9710.c b/rigs/mds/9710.c index f380dbc7..5bd40740 100644 --- a/rigs/mds/9710.c +++ b/rigs/mds/9710.c @@ -45,9 +45,6 @@ const struct rig_caps mds_9710_caps = .rx_range_list1 = { { .startf = MHz(800), .endf = MHz(880), .modes = MDS_ALL_MODES, - .low_power = 0, .high_power = 0, MDS_ALL_MODES, RIG_ANT_1, - }, - { .startf = MHz(880), .endf = MHz(960), .modes = MDS_ALL_MODES, .low_power = 0, .high_power = 0, MDS_ALL_MODES, RIG_ANT_1, }, commit 96134330391def67cac21be64a74e7e29efc708e Merge: 58f9fd41 b5e25822 Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Dec 8 09:00:38 2022 -0600 Merge remote-tracking branch 'origin/master' into Hamlib-4.5.1 diff --cc NEWS index 35dfca97,7fc4511d..70890f3c --- a/NEWS +++ b/NEWS @@@ -13,7 -13,33 +13,33 @@@ Version 5.x -- futur * Change FT1000MP Mark V model names to align with FT1000MP Version 4.6 - * 2023-XX-XX + * 2023-11-XX -- Planned for Nov 2023 + * Add MDS 4710/9710 rigs + + Version 4.5.1 - * 2022-XX-XX ++ * 2022-12-08 + * FT2000, FTDX3000/D, FT891, FT991, FT950, FTDX5000 now set CAT TOT to 100ms + * Add missing NB2 setting to FT-950, FTDX-1200, FTDX-3000, FTDX-5000, FTDX-9000 + * Add missing meter reading to TS-890S -- thanks to Geore Baltz N3GB + * Fix FT736 VFOB freq and mode set + * Added send_raw to rigctl -- see rigctl man page + * Fix AGC Level dumpcaps on most rigs + * Fix rig_send_raw to return bytes read, fill buffer, and also work with fixed length response/null terminator + * Change all Kenwood rigs to 500ms serial timeout + * Fix dumpcaps filter printout to only show declared filters + * Fix triggering PTT on XGComms device on Linux + * Fix level_gran in all rigs + * 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 + * Fix missing 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 + * Add RIG_FUNC_OVF_STATUS to get overflow status for IC-7300, IC-9700, IC-705, and IC-R8600 + Version 4.5 * 2022-10-30 diff --cc configure.ac index 28908b58,866ebff4..d6c9f11b --- a/configure.ac +++ b/configure.ac @@@ -14,7 -14,7 +14,7 @@@ dnl Please do not use '-' in the versio dnl however, the use of '~' should be fine as apt (others?) will treat dnl it as an earlier version than the actual release. TNX KA6MAL dnl PACKAGE_NAME + " " + PACKAGE_VERSION must not exceed 20 chars! - AC_INIT([Hamlib],[4.5],[ham...@li...],[hamlib],[http://www.hamlib.org]) -AC_INIT([Hamlib],[4.6~git],[ham...@li...],[hamlib],[http://www.hamlib.org]) ++AC_INIT([Hamlib],[4.5.1],[ham...@li...],[hamlib],[http://www.hamlib.org]) AC_CONFIG_SRCDIR([include/hamlib/rig.h]) AC_CONFIG_MACRO_DIR([macros]) commit b5e258228e3559ff615768c1d148676279144512 Author: Mike Black W9MDB <mdb...@ya...> Date: Wed Dec 7 15:30:38 2022 -0600 Add missing calibration tables for TS890S diff --git a/rigs/kenwood/ts890s.c b/rigs/kenwood/ts890s.c index d30217bd..9c23b131 100644 --- a/rigs/kenwood/ts890s.c +++ b/rigs/kenwood/ts890s.c @@ -24,6 +24,7 @@ #include <hamlib/rig.h> #include "kenwood.h" +#include "cal.h" // TODO: Copied from TS-480, to be verified #define TS890_VFO (RIG_VFO_A|RIG_VFO_B) @@ -37,7 +38,7 @@ // TODO: Copied from TS-480, to be verified #define TS890_LEVEL_SET (RIG_LEVEL_RFPOWER|RIG_LEVEL_AF|RIG_LEVEL_RF|RIG_LEVEL_SQL|RIG_LEVEL_AGC|RIG_LEVEL_KEYSPD|RIG_LEVEL_CWPITCH) -#define TS890_LEVEL_GET (RIG_LEVEL_RFPOWER|RIG_LEVEL_AF|RIG_LEVEL_RF|RIG_LEVEL_SQL|RIG_LEVEL_AGC|RIG_LEVEL_KEYSPD|RIG_LEVEL_ALC|RIG_LEVEL_SWR|RIG_LEVEL_COMP_METER|RIG_LEVEL_ID_METER|RIG_LEVEL_VD_METER|RIG_LEVEL_TEMP_METER|RIG_LEVEL_CWPITCH) +#define TS890_LEVEL_GET (RIG_LEVEL_RFPOWER|RIG_LEVEL_AF|RIG_LEVEL_RF|RIG_LEVEL_SQL|RIG_LEVEL_AGC|RIG_LEVEL_KEYSPD|RIG_LEVEL_ALC|RIG_LEVEL_SWR|RIG_LEVEL_COMP_METER|RIG_LEVEL_ID_METER|RIG_LEVEL_VD_METER|RIG_LEVEL_TEMP_METER|RIG_LEVEL_CWPITCH|RIG_LEVEL_RAWSTR|RIG_LEVEL_STRENGTH) #define TS890_FUNC_ALL (RIG_FUNC_NB|RIG_FUNC_NB2|RIG_FUNC_COMP|RIG_FUNC_VOX|RIG_FUNC_NR|RIG_FUNC_BC|RIG_FUNC_BC2|RIG_FUNC_RIT|RIG_FUNC_XIT|RIG_FUNC_TUNER|RIG_FUNC_SEND_MORSE) #define TS890_VFO_OPS (RIG_OP_UP|RIG_OP_DOWN|RIG_OP_BAND_UP|RIG_OP_BAND_DOWN|RIG_OP_CPY|RIG_OP_TUNE) @@ -302,23 +303,17 @@ int kenwood_ts890_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) return retval; } - if (levelint < 0 || levelint >= 70) + if (rig->caps->swr_cal.size) { - val->f = 99.0; /* 99 == infinty */ + val->f = rig_raw2val_float(val->i, &rig->caps->swr_cal); } else { -#if 0 - val->f = 70.0 / (70 - levelint); -#else - /* Linear approximations of a very non-linear function */ if (levelint < 12) { val->f = 1.0 + (float)levelint / 22.0; } else if (levelint < 24) { val->f = 1.5 + (float)(levelint - 11) / 24.0; } else if (levelint < 36) { val->f = 2.0 + (float)(levelint - 23) / 12.0; } else { val->f = 3.0 + (float)(levelint - 35) / 6.0; } - -#endif } return RIG_OK; @@ -383,6 +378,50 @@ static struct kenwood_priv_caps ts890s_priv_caps = .cmdtrm = EOM_KEN, }; +/* S-meter calibration table + * The TS-890S has two distinct S-meter curves, selectable + * by menu option. Define both, but since Hamlib has only + * one slot, use the the IARU one. + * Values taken from TS-890S In-Depth Manual, p. 8 + */ +/* Meter Type 1 - Kenwood specific (default) */ +#define TS890_SM_CAL2 { 9, \ + { \ + { 0, -28 }, \ + { 3, -26 }, \ + { 11, -20 }, \ + { 19, -13 }, \ + { 27, -7 }, \ + { 35, 0 }, \ + { 48, 20 }, \ + { 59, 40 }, \ + { 70, 60 }, \ + } } +/* Meter Type 2 - IARU Standard */ +#define TS890_SM_CAL1 { 9, \ + { \ + { 0, -54 }, \ + { 3, -48 }, \ + { 11, -36 }, \ + { 19, -24 }, \ + { 27, -12 }, \ + { 35, 0 }, \ + { 48, 20 }, \ + { 59, 40 }, \ + { 70, 60 }, \ + } } + +/* SWR meter calibration table */ +/* The full scale value reads infinity, so arbitrary */ +#define TS890_SWR_CAL { 5, \ + { \ + { 0, 1.0 }, \ + { 11, 1.5 }, \ + { 23, 2.0 }, \ + { 35, 3.0 }, \ + { 70, 15.0 } \ + } } + /* * TS-890S rig capabilities * Copied from ts480_caps, many of the values have not been verified. @@ -393,7 +432,7 @@ const struct rig_caps ts890s_caps = RIG_MODEL(RIG_MODEL_TS890S), .model_name = "TS-890S", .mfg_name = "Kenwood", - .version = BACKEND_VER ".8", + .version = BACKEND_VER ".9", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -415,7 +454,7 @@ const struct rig_caps ts890s_caps = .max_rit = kHz(9.99), .max_xit = kHz(9.99), .max_ifshift = Hz(0), - .targetable_vfo = RIG_TARGETABLE_FREQ|RIG_TARGETABLE_MODE, + .targetable_vfo = RIG_TARGETABLE_FREQ | RIG_TARGETABLE_MODE, .transceive = RIG_TRN_RIG, .agc_level_count = 5, .agc_levels = { RIG_AGC_OFF, RIG_AGC_SLOW, RIG_AGC_MEDIUM, RIG_AGC_FAST, RIG_AGC_ON }, @@ -504,6 +543,9 @@ const struct rig_caps ts890s_caps = }, .vfo_ops = TS890_VFO_OPS, + .str_cal = TS890_SM_CAL1, + .swr_cal = TS890_SWR_CAL, + .priv = (void *)& ts890s_priv_caps, .rig_init = kenwood_init, .rig_open = kenwood_open, commit 2fc6344d546d456f4d4749ebe18159a3baf17e93 Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Dec 6 23:27:28 2022 -0600 Update simftdx3000.c diff --git a/simulators/simftdx3000.c b/simulators/simftdx3000.c index 6438f634..e8c4a31f 100644 --- a/simulators/simftdx3000.c +++ b/simulators/simftdx3000.c @@ -231,14 +231,27 @@ int main(int argc, char *argv[]) } else if (strcmp(buf, "FT;") == 0) { - SNPRINTF(buf, sizeof(buf), "FT%d;", ft); + int val = ft; + + if (ft == 2) { val == 0; } + else if (ft == 3) { val == 1; } + + SNPRINTF(buf, sizeof(buf), "FT%d;", val); n = write(fd, buf, strlen(buf)); } + else if (strncmp(buf, "FT", 2) == 0) + { + sscanf(buf, "FT%d", &ft); + } else if (strcmp(buf, "MD0;") == 0) { SNPRINTF(buf, sizeof(buf), "MD0%d;", md); n = write(fd, buf, strlen(buf)); } + else if (strncmp(buf, "MD0", 3) == 0) + { + sscanf(buf, "MD0%d", &md); + } else if (strcmp(buf, "VS;") == 0) { SNPRINTF(buf, sizeof(buf), "VS%d;", vs); commit 22af811d5ff3fe7260d54044ce748a1963547499 Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Dec 6 12:56:13 2022 -0600 Fix spelling error in rig.c diff --git a/src/rig.c b/src/rig.c index c0d7f269..7c8b326f 100644 --- a/src/rig.c +++ b/src/rig.c @@ -7403,7 +7403,7 @@ static int async_data_handler_start(RIG *rig) if (!rs->async_data_enabled) { rig_debug(RIG_DEBUG_TRACE, - "%s: async data support disabled since asynd_data_enabled=%d\n", __func__, + "%s: async data support disabled since async_data_enabled=%d\n", __func__, rs->async_data_enabled); RETURNFUNC(RIG_OK); } commit 6a80385f8bc2658b1f29aa5cb32d3ea1b60c82a3 Merge: 40d1bad1 5f634df5 Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Dec 5 13:59:55 2022 -0600 Merge branch 'master' of https://github.com/Hamlib/Hamlib commit 5f634df53843d1e5235b067c0470993952e99cac Merge: e3487cb5 dae50c7a Author: Michael Black <mdb...@ya...> Date: Mon Dec 5 13:51:53 2022 -0600 Merge pull request #1175 from PianetaRadio/master Updated YaesuTargetableVFO.ods commit dae50c7a953fb6b1ba5a0a091eb508b28c9a2aa6 Merge: 825fc07d e3487cb5 Author: PianetaRadio <789...@us...> Date: Mon Dec 5 20:40:50 2022 +0100 Merge branch 'Hamlib:master' into master commit 40d1bad1e144feacdbe229af8afd9e36173b25de Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Dec 5 12:49:03 2022 -0600 Fix Jupiter set_freq problem -- was messing up strlen due to binary format https://github.com/Hamlib/Hamlib/issues/1174 diff --git a/rigs/tentec/jupiter.c b/rigs/tentec/jupiter.c index bb54dec5..5009991a 100644 --- a/rigs/tentec/jupiter.c +++ b/rigs/tentec/jupiter.c @@ -130,7 +130,7 @@ const struct rig_caps tt538_caps = RIG_MODEL(RIG_MODEL_TT538), .model_name = "TT-538 Jupiter", .mfg_name = "Ten-Tec", - .version = "20191209.0", + .version = "20221205.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -444,20 +444,20 @@ int tt538_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) int tt538_set_freq(RIG *rig, vfo_t vfo, freq_t freq) { - char bytes[4]; + unsigned char bytes[4]; unsigned char cmdbuf[16]; /* Freq is 4 bytes long, MSB sent first. */ - bytes[3] = ((int) freq >> 24) & 0xff; - bytes[2] = ((int) freq >> 16) & 0xff; - bytes[1] = ((int) freq >> 8) & 0xff; - bytes[0] = (int) freq & 0xff; + bytes[3] = ((unsigned int) freq >> 24) & 0xff; + bytes[2] = ((unsigned int) freq >> 16) & 0xff; + bytes[1] = ((unsigned int) freq >> 8) & 0xff; + bytes[0] = ((unsigned int) freq ) & 0xff; SNPRINTF((char *) cmdbuf, sizeof(cmdbuf), "*%c%c%c%c%c" EOM, which_vfo(rig, vfo), bytes[3], bytes[2], bytes[1], bytes[0]); - return tt538_transaction(rig, (char *) cmdbuf, strlen((char *)cmdbuf), NULL, + return tt538_transaction(rig, (char *) cmdbuf, 6, NULL, NULL); } @@ -716,7 +716,7 @@ int tt538_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) width = tt538_filter_number((int) width); SNPRINTF((char *) cmdbuf, sizeof(cmdbuf), "*W%c" EOM, (unsigned char) width); - return tt538_transaction(rig, (char *) cmdbuf, strlen((char *)cmdbuf), NULL, + return tt538_transaction(rig, (char *) cmdbuf, 4, NULL, NULL); return RIG_OK; @@ -1006,6 +1006,7 @@ int tt538_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) { char cc, cmdbuf[32], c1, c2; int retval; + int len; switch (level) { @@ -1023,20 +1024,24 @@ int tt538_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) } SNPRINTF(cmdbuf, sizeof(cmdbuf), "*G%c" EOM, cc); + len = 4; break; case RIG_LEVEL_AF: SNPRINTF(cmdbuf, sizeof(cmdbuf), "*U%c" EOM, (int)(127 * val.f)); + len = 4; break; case RIG_LEVEL_RF: SNPRINTF(cmdbuf, sizeof(cmdbuf), "*I%c" EOM, (int)(127 * val.f)); + len = 4; break; case RIG_LEVEL_IF: c1 = val.i >> 8; c2 = val.i & 0xff; SNPRINTF(cmdbuf, sizeof(cmdbuf), "*P%c%c" EOM, c1, c2); + len = 5; break; case RIG_LEVEL_ATT: @@ -1050,10 +1055,12 @@ int tt538_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) } SNPRINTF(cmdbuf, sizeof(cmdbuf), "*J%c" EOM, cc); + len = 4; break; case RIG_LEVEL_SQL: SNPRINTF(cmdbuf, sizeof(cmdbuf), "*H%c" EOM, (int)(127 * val.f)); + len = 4; break; default: @@ -1062,7 +1069,7 @@ int tt538_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) return -RIG_EINVAL; } - retval = tt538_transaction(rig, cmdbuf, strlen((char *)cmdbuf), NULL, NULL); + retval = tt538_transaction(rig, cmdbuf, len, NULL, NULL); if (retval != RIG_OK) { commit e3487cb5c6330243cf8cf7f0081e5b4b74c1becc Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Dec 5 09:13:13 2022 -0600 Add RIG_TARGETABLE_MODE to ts890.c https://github.com/Hamlib/Hamlib/issues/1172 diff --git a/rigs/kenwood/ts890s.c b/rigs/kenwood/ts890s.c index bfcd067f..d30217bd 100644 --- a/rigs/kenwood/ts890s.c +++ b/rigs/kenwood/ts890s.c @@ -393,7 +393,7 @@ const struct rig_caps ts890s_caps = RIG_MODEL(RIG_MODEL_TS890S), .model_name = "TS-890S", .mfg_name = "Kenwood", - .version = BACKEND_VER ".7", + .version = BACKEND_VER ".8", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -415,7 +415,7 @@ const struct rig_caps ts890s_caps = .max_rit = kHz(9.99), .max_xit = kHz(9.99), .max_ifshift = Hz(0), - .targetable_vfo = RIG_TARGETABLE_FREQ, + .targetable_vfo = RIG_TARGETABLE_FREQ|RIG_TARGETABLE_MODE, .transceive = RIG_TRN_RIG, .agc_level_count = 5, .agc_levels = { RIG_AGC_OFF, RIG_AGC_SLOW, RIG_AGC_MEDIUM, RIG_AGC_FAST, RIG_AGC_ON }, commit e603da4cb6cbc2d540bb29591c5a141b9a226ef2 Author: Mike Black W9MDB <mdb...@ya...> Date: Sun Dec 4 11:59:28 2022 -0600 If rig does not have TARGETABLE_MODE then we return the cached values from VFOA https://github.com/Hamlib/Hamlib/issues/1172 diff --git a/src/rig.c b/src/rig.c index 6efc6540..c0d7f269 100644 --- a/src/rig.c +++ b/src/rig.c @@ -2433,7 +2433,9 @@ int HAMLIB_API rig_get_mode(RIG *rig, if (vfo == RIG_VFO_B && !(caps->targetable_vfo & RIG_TARGETABLE_MODE)) { - vfo = RIG_VFO_A; // we'll just return VFO_A mode which is probably cached + *mode = rig->state.cache.modeMainA; + *width = rig->state.cache.widthMainA; + return RIG_OK; } if ((*mode != RIG_MODE_NONE && cache_ms_mode < rig->state.cache.timeout_ms) commit ea1a718bb52339a8f5f9c582d083bc9ac5448063 Author: Mike Black W9MDB <mdb...@ya...> Date: Sun Dec 4 11:18:33 2022 -0600 Change CAT TOT command in newcat.c to expect a response https://github.com/Hamlib/Hamlib/issues/1163 diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index dda61be6..5bdae1f4 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -613,7 +613,7 @@ int newcat_open(RIG *rig) SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "%s", cmd); - if (RIG_OK != (err = newcat_set_cmd(rig))) + if (RIG_OK != (err = newcat_get_cmd(rig))) { RETURNFUNC(err); } diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h index b5f302fc..3f35b553 100644 --- a/rigs/yaesu/newcat.h +++ b/rigs/yaesu/newcat.h @@ -50,7 +50,7 @@ typedef char ncboolean; /* shared function version */ -#define NEWCAT_VER "20221203" +#define NEWCAT_VER "20221204" /* Hopefully large enough for future use, 128 chars plus '\0' */ #define NEWCAT_DATA_LEN 129 commit 156b810319cfeaefdbbf0f4e78090be7bc0d4a61 Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Dec 3 22:39:38 2022 -0600 Add secondary check for rig_model in newcat.c for CAT TOT in case ID command fails https://github.com/Hamlib/Hamlib/issues/1163 diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 5515ae66..dda61be6 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -603,13 +603,13 @@ int newcat_open(RIG *rig) int err; char *cmd = "EX0291;EX029;"; // FT2000/D - if (priv->rig_id == NC_RIGID_FT950) { cmd = "EX0271;EX027;"; } - else if (priv->rig_id == NC_RIGID_FT891) { cmd = "EX05071;EX0507;"; } - else if (priv->rig_id == NC_RIGID_FT991) { cmd = "EX0321;EX032;"; } - else if (priv->rig_id == NC_RIGID_FT991A) { cmd = "EX0321;EX032;"; } - else if (priv->rig_id == NC_RIGID_FTDX3000) { cmd = "EX0391;EX039;"; } - else if (priv->rig_id == NC_RIGID_FTDX3000DM) { cmd = "EX0391;EX039;"; } - else if (priv->rig_id == NC_RIGID_FTDX5000) { cmd = "EX0331;EX033"; } + if (priv->rig_id == NC_RIGID_FT950 || rig->caps->rig_model == RIG_MODEL_FT950) { cmd = "EX0271;EX027;"; } + else if (priv->rig_id == NC_RIGID_FT891 || rig->caps->rig_model == RIG_MODEL_FT891) { cmd = "EX05071;EX0507;"; } + else if (priv->rig_id == NC_RIGID_FT991 || rig->caps->rig_model == RIG_MODEL_FT991) { cmd = "EX0321;EX032;"; } + else if (priv->rig_id == NC_RIGID_FT991A || rig->caps->rig_model == RIG_MODEL_FT991) { cmd = "EX0321;EX032;"; } + else if (priv->rig_id == NC_RIGID_FTDX3000 || rig->caps->rig_model == RIG_MODEL_FTDX3000) { cmd = "EX0391;EX039;"; } + else if (priv->rig_id == NC_RIGID_FTDX3000DM || rig->caps->rig_model == RIG_MODEL_FTDX3000) { cmd = "EX0391;EX039;"; } + else if (priv->rig_id == NC_RIGID_FTDX5000 || rig->caps->rig_model == RIG_MODEL_FTDX5000) { cmd = "EX0331;EX033"; } SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "%s", cmd); commit a2b3e1348c374c6e2ef555636704471eb4d813e3 Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Dec 3 22:24:05 2022 -0600 Fix ID for FT991 and FT991 in newcat.c so CAT TOT settings work https://github.com/Hamlib/Hamlib/issues/1163 diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index db01775d..5515ae66 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -57,7 +57,8 @@ typedef enum nc_rigid_e NC_RIGID_FT450D = 244, NC_RIGID_FT950 = 310, NC_RIGID_FT891 = 135, - NC_RIGID_FT991 = 135, + NC_RIGID_FT991 = 570, + NC_RIGID_FT991A = 670, NC_RIGID_FT2000 = 251, NC_RIGID_FT2000D = 252, NC_RIGID_FTDX1200 = 583, @@ -594,6 +595,7 @@ int newcat_open(RIG *rig) || priv->rig_id == NC_RIGID_FT2000D || priv->rig_id == NC_RIGID_FT891 || priv->rig_id == NC_RIGID_FT991 + || priv->rig_id == NC_RIGID_FT991A || priv->rig_id == NC_RIGID_FT950 || priv->rig_id == NC_RIGID_FTDX3000 || priv->rig_id == NC_RIGID_FTDX3000DM) @@ -604,6 +606,7 @@ int newcat_open(RIG *rig) if (priv->rig_id == NC_RIGID_FT950) { cmd = "EX0271;EX027;"; } else if (priv->rig_id == NC_RIGID_FT891) { cmd = "EX05071;EX0507;"; } else if (priv->rig_id == NC_RIGID_FT991) { cmd = "EX0321;EX032;"; } + else if (priv->rig_id == NC_RIGID_FT991A) { cmd = "EX0321;EX032;"; } else if (priv->rig_id == NC_RIGID_FTDX3000) { cmd = "EX0391;EX039;"; } else if (priv->rig_id == NC_RIGID_FTDX3000DM) { cmd = "EX0391;EX039;"; } else if (priv->rig_id == NC_RIGID_FTDX5000) { cmd = "EX0331;EX033"; } commit 825fc07d0007b6b5661c255a08d76badd3765513 Merge: d3d1fd7c fdd88c31 Author: PianetaRadio <789...@us...> Date: Sun Dec 4 00:44:32 2022 +0100 Merge branch 'Hamlib:master' into master commit fdd88c317e56131099a5de73b72727868c3bde3e Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Dec 3 15:44:19 2022 -0600 Update NEWS diff --git a/NEWS b/NEWS index 5a09d4f7..7fc4511d 100644 --- a/NEWS +++ b/NEWS @@ -18,6 +18,7 @@ Version 4.6 Version 4.5.1 * 2022-XX-XX + * FT2000, FTDX3000/D, FT891, FT991, FT950, FTDX5000 now set CAT TOT to 100ms * Add missing NB2 setting to FT-950, FTDX-1200, FTDX-3000, FTDX-5000, FTDX-9000 * Add missing meter reading to TS-890S -- thanks to Geore Baltz N3GB * Fix FT736 VFOB freq and mode set commit 1e1ed4c9e61f08e4022e2b3ce1a2e196c6958ba3 Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Dec 3 15:18:02 2022 -0600 Force the FT-991 to 100ms along with FT-DX2000, Ft-891, FT950, FTDX3000/D 10ms was seeing timeouts on some rigs using rigctl https://github.com/Hamlib/Hamlib/issues/1163 diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 6eddf0c2..db01775d 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -587,24 +587,28 @@ int newcat_open(RIG *rig) rig_debug(RIG_DEBUG_VERBOSE, "%s: rig_id=%d\n", __func__, priv->rig_id); rig->state.rigport.timeout = timeout; -#if 0 // possible future enhancement? - // some rigs have a CAT TOT timeout that defaults to 10ms // so we'll increase CAT timeout to 100ms + // 10ms seemed problematic on some rigs/computers if (priv->rig_id == NC_RIGID_FT2000 || priv->rig_id == NC_RIGID_FT2000D || priv->rig_id == NC_RIGID_FT891 || priv->rig_id == NC_RIGID_FT991 - || priv->rig_id == NC_RIGID_FT950) + || priv->rig_id == NC_RIGID_FT950 + || priv->rig_id == NC_RIGID_FTDX3000 + || priv->rig_id == NC_RIGID_FTDX3000DM) { int err; - char *cmd = "EX0291%c"; + char *cmd = "EX0291;EX029;"; // FT2000/D - if (priv->rig_id == NC_RIGID_FT950) { cmd = "EX0271%c"; } - else if (priv->rig_id == NC_RIGID_FT891) { cmd = "EX05071c"; } - else if (priv->rig_id == NC_RIGID_FT991) { cmd = "EX0321c"; } + if (priv->rig_id == NC_RIGID_FT950) { cmd = "EX0271;EX027;"; } + else if (priv->rig_id == NC_RIGID_FT891) { cmd = "EX05071;EX0507;"; } + else if (priv->rig_id == NC_RIGID_FT991) { cmd = "EX0321;EX032;"; } + else if (priv->rig_id == NC_RIGID_FTDX3000) { cmd = "EX0391;EX039;"; } + else if (priv->rig_id == NC_RIGID_FTDX3000DM) { cmd = "EX0391;EX039;"; } + else if (priv->rig_id == NC_RIGID_FTDX5000) { cmd = "EX0331;EX033"; } - SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), cmd, cat_term); + SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "%s", cmd); if (RIG_OK != (err = newcat_set_cmd(rig))) { @@ -612,40 +616,12 @@ int newcat_open(RIG *rig) } } -#endif - if (priv->rig_id == NC_RIGID_FTDX3000 || priv->rig_id == NC_RIGID_FTDX3000DM) { rig->state.disable_yaesu_bandselect = 1; rig_debug(RIG_DEBUG_VERBOSE, "%s: disabling FTDX3000 band select\n", __func__); } - if (priv->rig_id == NC_RIGID_FTDX5000) - { - int err; - // set the CAT TIME OUT TIMER to 100ms - SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "EX0331;"); - - if (RIG_OK != (err = newcat_set_cmd(rig))) - { - rig_debug(RIG_DEBUG_ERR, "%s: FTDX5000 CAT RATE error: %s\n", __func__, - rigerror(err)); - } - } - - if (priv->rig_id == NC_RIGID_FTDX3000 || priv->rig_id == NC_RIGID_FTDX3000DM) - { - ... [truncated message content] |
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 |
From: Nate B. <n0...@us...> - 2022-11-06 19:49:12
|
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 1074410bd527271f2f1f13b930911dd38a59e179 (commit) via c218996e2fc1fb2626956f1fbed63c2114ac1161 (commit) via 8789321465b0a6b9128ad09f86032668e134ee34 (commit) via bf22bc4b02d6a89ac21536e09a61d51a4ca540d0 (commit) via 3c3112ddc601a411137c358e36ded3358efe2236 (commit) via d311153f6386a77508943368e536193c50e4ffb8 (commit) via dac5175cad340df649fb9a674257259b5d4aa773 (commit) via a397b39ca3f3143abda61346f8b253032b4eb3da (commit) via aedf39adc2c30a95a944e130b5d7398a77aab7d4 (commit) via eff048d729dd56f86aead6c4c670bc8435a1a22e (commit) via b2cf596b5494d6201f8d506a881bb8aaf3df7970 (commit) via 790bf7704c8a175aabfe8cd54ec267c0d5b7fbd3 (commit) via 0d73bb22a080ea04b489f723cdbac6ee4c5744a2 (commit) via eb667185ef587323809a298e171d2e538e2005cd (commit) via 2a30396d70dda90ae8e2218bf761b0ffc7ee5e8d (commit) via b2bd93a7be8fb48189337e2dc0961a58d9d82651 (commit) via 1cb999af01c1a2e4298d66b94485730c706adf16 (commit) via 6b1555365ab5dbe4fc82037d0737d72d01cdaf29 (commit) via 4ce202a5798daba37a63abd3ab0357644b617f5a (commit) via cd1dc4c05df3ed96a0c1384b45f589e86bb0aa17 (commit) from 56b2814e75ca6b3ce622f90f6160ce8088bc5987 (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 1074410bd527271f2f1f13b930911dd38a59e179 Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Nov 5 12:58:40 2022 -0500 Add RIG_LEVEL_KEYSPD to ts890s.c https://github.com/Hamlib/Hamlib/issues/1139 diff --git a/rigs/kenwood/ts890s.c b/rigs/kenwood/ts890s.c index 69dde65b..6a40b43a 100644 --- a/rigs/kenwood/ts890s.c +++ b/rigs/kenwood/ts890s.c @@ -36,7 +36,7 @@ #define TS890_AM_TX_MODES RIG_MODE_AM // TODO: Copied from TS-480, to be verified -#define TS890_LEVEL_ALL (RIG_LEVEL_RFPOWER|RIG_LEVEL_AF|RIG_LEVEL_RF|RIG_LEVEL_SQL|RIG_LEVEL_AGC) +#define TS890_LEVEL_ALL (RIG_LEVEL_RFPOWER|RIG_LEVEL_AF|RIG_LEVEL_RF|RIG_LEVEL_SQL|RIG_LEVEL_AGC|RIG_LEVEL_KEYSPD) #define TS890_FUNC_ALL (RIG_FUNC_NB|RIG_FUNC_NB2|RIG_FUNC_COMP|RIG_FUNC_VOX|RIG_FUNC_NR|RIG_FUNC_NR|RIG_FUNC_BC|RIG_FUNC_BC2|RIG_FUNC_RIT|RIG_FUNC_XIT|RIG_FUNC_TUNER|RIG_FUNC_SEND_MORSE) #define TS890_VFO_OPS (RIG_OP_UP|RIG_OP_DOWN|RIG_OP_BAND_UP|RIG_OP_BAND_DOWN|RIG_OP_CPY|RIG_OP_TUNE) @@ -241,7 +241,7 @@ const struct rig_caps ts890s_caps = RIG_MODEL(RIG_MODEL_TS890S), .model_name = "TS-890S", .mfg_name = "Kenwood", - .version = BACKEND_VER ".3", + .version = BACKEND_VER ".4", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, commit c218996e2fc1fb2626956f1fbed63c2114ac1161 Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Nov 4 23:31:51 2022 -0500 Add RIG_FUNC_OVF_STATUS for IC-7300, IC-9700, IC-705, IC-R8600 diff --git a/NEWS b/NEWS index 07908008..36abaaee 100644 --- a/NEWS +++ b/NEWS @@ -17,6 +17,7 @@ Version 4.6 * 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 + * Add RIG_FUNC_OVF_STATUS to get overflow status for IC-7300, IC-9700, IC-705, and IC-R8600 Version 4.5 diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h index 6f1474ab..705f9dd0 100644 --- a/include/hamlib/rig.h +++ b/include/hamlib/rig.h @@ -1180,9 +1180,9 @@ typedef uint64_t setting_t; #define RIG_FUNC_TRANSCEIVE CONSTANT_64BIT_FLAG (42) /*!< \c TRANSCEIVE -- Send radio state changes automatically ON/OFF */ #define RIG_FUNC_SPECTRUM CONSTANT_64BIT_FLAG (43) /*!< \c SPECTRUM -- Spectrum scope data output ON/OFF */ #define RIG_FUNC_SPECTRUM_HOLD CONSTANT_64BIT_FLAG (44) /*!< \c SPECTRUM_HOLD -- Pause spectrum scope updates ON/OFF */ -#define RIG_FUNC_SEND_MORSE CONSTANT_64BIT_FLAG (45) /*!< \c SEND_MORSE -- Send specified characters using CW */ -#define RIG_FUNC_SEND_VOICE_MEM CONSTANT_64BIT_FLAG (46) /*!< \c SEND_VOICE_MEM -- Transmit in SSB message stored in memory */ -#define RIG_FUNC_BIT47 CONSTANT_64BIT_FLAG (47) /*!< \c available for future RIG_FUNC items */ +#define RIG_FUNC_SEND_MORSE CONSTANT_64BIT_FLAG (45) /*!< \c SEND_MORSE -- Send specified characters using CW */ +#define RIG_FUNC_SEND_VOICE_MEM CONSTANT_64BIT_FLAG (46) /*!< \c SEND_VOICE_MEM -- Transmit in SSB message stored in memory */ +#define RIG_FUNC_OVF_STATUS CONSTANT_64BIT_FLAG (47) /*!< \c OVF -- Read overflow status 0=Off, 1=On */ #define RIG_FUNC_BIT48 CONSTANT_64BIT_FLAG (48) /*!< \c available for future RIG_FUNC items */ #define RIG_FUNC_BIT49 CONSTANT_64BIT_FLAG (49) /*!< \c available for future RIG_FUNC items */ #define RIG_FUNC_BIT50 CONSTANT_64BIT_FLAG (50) /*!< \c available for future RIG_FUNC items */ diff --git a/rigs/icom/ic7300.c b/rigs/icom/ic7300.c index 143aeab1..2fcb1c55 100644 --- a/rigs/icom/ic7300.c +++ b/rigs/icom/ic7300.c @@ -52,7 +52,7 @@ int ic7300_get_clock(RIG *rig, int *year, int *month, int *day, #define IC7300_OTHER_TX_MODES (RIG_MODE_FM|RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|RIG_MODE_RTTY|RIG_MODE_RTTYR) #define IC7300_AM_TX_MODES (RIG_MODE_AM|RIG_MODE_PKTAM) -#define IC7300_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_XIT|RIG_FUNC_SCOPE|RIG_FUNC_TUNER|RIG_FUNC_TRANSCEIVE|RIG_FUNC_SPECTRUM|RIG_FUNC_SPECTRUM_HOLD|RIG_FUNC_SEND_MORSE|RIG_FUNC_SEND_VOICE_MEM) +#define IC7300_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_XIT|RIG_FUNC_SCOPE|RIG_FUNC_TUNER|RIG_FUNC_TRANSCEIVE|RIG_FUNC_SPECTRUM|RIG_FUNC_SPECTRUM_HOLD|RIG_FUNC_SEND_MORSE|RIG_FUNC_SEND_VOICE_MEM|RIG_FUNC_OVF_STATUS) #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) @@ -146,7 +146,7 @@ int ic7300_get_clock(RIG *rig, int *year, int *month, int *day, */ #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) #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) +#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) #define IC9700_VFO_OPS (RIG_OP_CPY|RIG_OP_XCHG|RIG_OP_FROM_VFO|RIG_OP_TO_VFO|RIG_OP_MCL) #define IC9700_SCAN_OPS (RIG_SCAN_STOP|RIG_SCAN_MEM|RIG_SCAN_PROG|RIG_SCAN_SLCT) @@ -549,7 +549,7 @@ const struct rig_caps ic7300_caps = RIG_MODEL(RIG_MODEL_IC7300), .model_name = "IC-7300", .mfg_name = "Icom", - .version = BACKEND_VER ".9", + .version = BACKEND_VER ".10", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -786,7 +786,7 @@ struct rig_caps ic9700_caps = RIG_MODEL(RIG_MODEL_IC9700), .model_name = "IC-9700", .mfg_name = "Icom", - .version = BACKEND_VER ".10", + .version = BACKEND_VER ".11", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -1099,7 +1099,7 @@ const struct rig_caps ic705_caps = RIG_MODEL(RIG_MODEL_IC705), .model_name = "IC-705", .mfg_name = "Icom", - .version = BACKEND_VER ".7", + .version = BACKEND_VER ".8", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, diff --git a/rigs/icom/ic7610.c b/rigs/icom/ic7610.c index b273bf33..2079f60d 100644 --- a/rigs/icom/ic7610.c +++ b/rigs/icom/ic7610.c @@ -39,7 +39,7 @@ #define IC7610_OTHER_TX_MODES (RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|RIG_MODE_RTTY|RIG_MODE_RTTYR|RIG_MODE_FM|RIG_MODE_PSK|RIG_MODE_PSKR|RIG_MODE_PKTLSB|RIG_MODE_PKTUSB|RIG_MODE_PKTFM) #define IC7610_AM_TX_MODES (RIG_MODE_AM|RIG_MODE_PKTAM) -#define IC7610_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_XIT|RIG_FUNC_TUNER|RIG_FUNC_APF|RIG_FUNC_DUAL_WATCH|RIG_FUNC_TRANSCEIVE|RIG_FUNC_SPECTRUM|RIG_FUNC_SPECTRUM_HOLD) +#define IC7610_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_XIT|RIG_FUNC_TUNER|RIG_FUNC_APF|RIG_FUNC_DUAL_WATCH|RIG_FUNC_TRANSCEIVE|RIG_FUNC_SPECTRUM|RIG_FUNC_SPECTRUM_HOLD|RIG_FUNC_OVF_STATUS) #define IC7610_LEVELS (RIG_LEVEL_PREAMP|RIG_LEVEL_ATT|RIG_LEVEL_AGC|RIG_LEVEL_COMP|RIG_LEVEL_BKINDL|RIG_LEVEL_BALANCE|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) @@ -350,7 +350,7 @@ const struct rig_caps ic7610_caps = RIG_MODEL(RIG_MODEL_IC7610), .model_name = "IC-7610", .mfg_name = "Icom", - .version = BACKEND_VER ".8", + .version = BACKEND_VER ".9", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index ad142127..2dd50a07 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -7338,6 +7338,13 @@ int icom_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status) break; + case RIG_FUNC_OVF_STATUS: + { + fct_cn = C_RD_SQSM; + fct_sc = S_OVF; + break; + } + default: rig_debug(RIG_DEBUG_ERR, "%s: unsupported get_func %s\n", __func__, rig_strfunc(func)); diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h index 8e232e8f..4373583f 100644 --- a/rigs/icom/icom.h +++ b/rigs/icom/icom.h @@ -30,7 +30,7 @@ #include <sys/time.h> #endif -#define BACKEND_VER "20220909" +#define BACKEND_VER "20221104" #define ICOM_IS_SECONDARY_VFO(vfo) ((vfo) & (RIG_VFO_B | RIG_VFO_SUB | RIG_VFO_SUB_B | RIG_VFO_MAIN_B)) #define ICOM_GET_VFO_NUMBER(vfo) (ICOM_IS_SECONDARY_VFO(vfo) ? 0x01 : 0x00) diff --git a/rigs/icom/icr8600.c b/rigs/icom/icr8600.c index 90c360c8..aaa60787 100644 --- a/rigs/icom/icr8600.c +++ b/rigs/icom/icr8600.c @@ -37,7 +37,7 @@ #define ICR8600_FUNC_ALL (RIG_FUNC_NB|RIG_FUNC_ANF|RIG_FUNC_MN|RIG_FUNC_AFC|\ RIG_FUNC_NR|RIG_FUNC_AIP|RIG_FUNC_LOCK|RIG_FUNC_VSC|RIG_FUNC_RESUME|RIG_FUNC_TSQL|\ - RIG_FUNC_CSQL|RIG_FUNC_DSQL|RIG_FUNC_TRANSCEIVE|RIG_FUNC_SPECTRUM|RIG_FUNC_SPECTRUM_HOLD) + RIG_FUNC_CSQL|RIG_FUNC_DSQL|RIG_FUNC_TRANSCEIVE|RIG_FUNC_SPECTRUM|RIG_FUNC_SPECTRUM_HOLD|RIG_FUNC_OVF_STATUS) #define ICR8600_LEVEL_ALL (RIG_LEVEL_ATT|RIG_LEVEL_AF|RIG_LEVEL_RF|RIG_LEVEL_SQL|\ RIG_LEVEL_NR|RIG_LEVEL_PBT_IN|RIG_LEVEL_PBT_OUT|RIG_LEVEL_CWPITCH|RIG_LEVEL_PREAMP|\ @@ -132,7 +132,7 @@ const struct rig_caps icr8600_caps = RIG_MODEL(RIG_MODEL_ICR8600), .model_name = "IC-R8600", .mfg_name = "Icom", - .version = BACKEND_VER ".2", + .version = BACKEND_VER ".3", .copyright = "LGPL", .status = RIG_STATUS_BETA, .rig_type = RIG_TYPE_RECEIVER, diff --git a/simulators/simicom9700.c b/simulators/simicom9700.c index 0b19acf6..f19be87c 100644 --- a/simulators/simicom9700.c +++ b/simulators/simicom9700.c @@ -35,6 +35,7 @@ int ant_option = 0; int ptt = 0; int satmode = 0; int agc_time = 1; +int ovf_status = 0; void dumphex(unsigned char *buf, int n) { @@ -226,6 +227,13 @@ void frameParse(int fd, unsigned char *frame, int len) { static int meter_level = 0; + case 0x07: + frame[6] = ovf_status; + frame[7] = 0xfd; + n = write(fd, frame, 8); + ovf_status = ovf_status==0?1:0; + break; + case 0x11: printf("Using meter level %d\n", meter_level); meter_level += 10; diff --git a/src/misc.c b/src/misc.c index 2946ec69..c0ab5071 100644 --- a/src/misc.c +++ b/src/misc.c @@ -736,6 +736,7 @@ static const struct { RIG_FUNC_SPECTRUM_HOLD, "SPECTRUM_HOLD" }, { RIG_FUNC_SEND_MORSE, "SEND_MORSE" }, { RIG_FUNC_SEND_VOICE_MEM, "SEND_VOICE_MEM" }, + { RIG_FUNC_OVF_STATUS, "OVF_STATUS" }, { RIG_FUNC_NONE, "" }, }; commit 8789321465b0a6b9128ad09f86032668e134ee34 Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Nov 4 22:41:02 2022 -0500 Add ID 800 for FT710 diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index dd67ff66..560cb290 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -68,7 +68,8 @@ typedef enum nc_rigid_e NC_RIGID_FTDX3000 = 460, NC_RIGID_FTDX3000DM = 462, // an undocumented FT-DX3000DM 50W rig NC_RIGID_FTDX101D = 681, - NC_RIGID_FTDX101MP = 682 + NC_RIGID_FTDX101MP = 682, + NC_RIGID_FT710 = 800, } nc_rigid_t; @@ -10484,7 +10485,7 @@ int newcat_set_cmd_validate(RIG *rig) // For FA and FB rig.c now tries to verify the set_freq actually works // For example the FT-2000 can't do a FA set followed by an immediate read // We were using "ID" to verify the command but rig.c now does - // a verifcation of frequency and retries if it doesn't match + // a verification of frequency and retries if it doesn't match if ((strncmp(priv->cmd_str, "FA", 2) == 0) && (strlen(priv->cmd_str) > 3)) { strcpy(valcmd, "FA;"); diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h index 76547210..68b64270 100644 --- a/rigs/yaesu/newcat.h +++ b/rigs/yaesu/newcat.h @@ -50,7 +50,7 @@ typedef char ncboolean; /* shared function version */ -#define NEWCAT_VER "20221025" +#define NEWCAT_VER "20221104" /* Hopefully large enough for future use, 128 chars plus '\0' */ #define NEWCAT_DATA_LEN 129 commit bf22bc4b02d6a89ac21536e09a61d51a4ca540d0 Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Nov 4 13:26:52 2022 -0500 Fix flrig get_ptt https://github.com/Hamlib/Hamlib/issues/1138 diff --git a/rigs/dummy/flrig.c b/rigs/dummy/flrig.c index f3fa1286..507d6cc0 100644 --- a/rigs/dummy/flrig.c +++ b/rigs/dummy/flrig.c @@ -141,7 +141,7 @@ const struct rig_caps flrig_caps = RIG_MODEL(RIG_MODEL_FLRIG), .model_name = "FLRig", .mfg_name = "FLRig", - .version = "20221030.0", + .version = "20221104.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -1308,7 +1308,7 @@ static int flrig_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt) RETURNFUNC(retval); } - if (strlen(xml) > 0) + if (strlen(value) > 0) { xml_parse(xml, value, sizeof(value)); *ptt = atoi(value); commit 3c3112ddc601a411137c358e36ded3358efe2236 Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Nov 4 10:52:16 2022 -0500 Update NEWS diff --git a/NEWS b/NEWS index 73490b44..07908008 100644 --- a/NEWS +++ b/NEWS @@ -16,6 +16,7 @@ Version 4.6 * 2023-XX-XX * 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 Version 4.5 commit d311153f6386a77508943368e536193c50e4ffb8 Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Nov 4 10:49:14 2022 -0500 Add AGC_TIME to IC-7300, IC-9700, and IC-705 https://github.com/Hamlib/Hamlib/issues/1136 diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h index e1678106..6f1474ab 100644 --- a/include/hamlib/rig.h +++ b/include/hamlib/rig.h @@ -598,10 +598,8 @@ typedef unsigned int vfo_t; */ typedef shortfreq_t pbwidth_t; +typedef float agc_time_t; -/** - * \brief DCD status - */ typedef enum dcd_e { RIG_DCD_OFF = 0, /*!< Squelch closed */ RIG_DCD_ON /*!< Squelch open */ @@ -1005,7 +1003,7 @@ typedef uint64_t rig_level_e; #define RIG_LEVEL_TEMP_METER CONSTANT_64BIT_FLAG(48) /*!< \c TEMP_METER -- arg float (C, centigrade) */ #define RIG_LEVEL_BAND_SELECT CONSTANT_64BIT_FLAG(49) /*!< \c BAND_SELECT -- arg enum BAND_ENUM */ #define RIG_LEVEL_USB_AF CONSTANT_64BIT_FLAG(50) /*!< \c ACC/USB AF output level */ -#define RIG_LEVEL_51 CONSTANT_64BIT_FLAG(51) /*!< \c Future use */ +#define RIG_LEVEL_AGC_TIME CONSTANT_64BIT_FLAG(51) /*!< \c AGC_TIME -- in seconds, rig dependent */ #define RIG_LEVEL_52 CONSTANT_64BIT_FLAG(52) /*!< \c Future use */ #define RIG_LEVEL_53 CONSTANT_64BIT_FLAG(53) /*!< \c Future use */ #define RIG_LEVEL_54 CONSTANT_64BIT_FLAG(54) /*!< \c Future use */ @@ -1020,7 +1018,7 @@ typedef uint64_t rig_level_e; #define RIG_LEVEL_63 CONSTANT_64BIT_FLAG(63) /*!< \c Future use */ //! @cond Doxygen_Suppress -#define RIG_LEVEL_FLOAT_LIST (RIG_LEVEL_AF|RIG_LEVEL_RF|RIG_LEVEL_SQL|RIG_LEVEL_APF|RIG_LEVEL_NR|RIG_LEVEL_PBT_IN|RIG_LEVEL_PBT_OUT|RIG_LEVEL_RFPOWER|RIG_LEVEL_MICGAIN|RIG_LEVEL_COMP|RIG_LEVEL_BALANCE|RIG_LEVEL_SWR|RIG_LEVEL_ALC|RIG_LEVEL_VOXGAIN|RIG_LEVEL_ANTIVOX|RIG_LEVEL_RFPOWER_METER|RIG_LEVEL_RFPOWER_METER_WATTS|RIG_LEVEL_COMP_METER|RIG_LEVEL_VD_METER|RIG_LEVEL_ID_METER|RIG_LEVEL_NOTCHF_RAW|RIG_LEVEL_MONITOR_GAIN|RIG_LEVEL_NB|RIG_LEVEL_SPECTRUM_REF|RIG_LEVEL_TEMP_METER|RIG_LEVEL_USB_AF) +#define RIG_LEVEL_FLOAT_LIST (RIG_LEVEL_AF|RIG_LEVEL_RF|RIG_LEVEL_SQL|RIG_LEVEL_APF|RIG_LEVEL_NR|RIG_LEVEL_PBT_IN|RIG_LEVEL_PBT_OUT|RIG_LEVEL_RFPOWER|RIG_LEVEL_MICGAIN|RIG_LEVEL_COMP|RIG_LEVEL_BALANCE|RIG_LEVEL_SWR|RIG_LEVEL_ALC|RIG_LEVEL_VOXGAIN|RIG_LEVEL_ANTIVOX|RIG_LEVEL_RFPOWER_METER|RIG_LEVEL_RFPOWER_METER_WATTS|RIG_LEVEL_COMP_METER|RIG_LEVEL_VD_METER|RIG_LEVEL_ID_METER|RIG_LEVEL_NOTCHF_RAW|RIG_LEVEL_MONITOR_GAIN|RIG_LEVEL_NB|RIG_LEVEL_SPECTRUM_REF|RIG_LEVEL_TEMP_METER|RIG_LEVEL_USB_AF|RIG_LEVEL_AGC_TIME) #define RIG_LEVEL_READONLY_LIST (RIG_LEVEL_SWR|RIG_LEVEL_ALC|RIG_LEVEL_STRENGTH|RIG_LEVEL_RAWSTR|RIG_LEVEL_RFPOWER_METER|RIG_LEVEL_COMP_METER|RIG_LEVEL_VD_METER|RIG_LEVEL_ID_METER) diff --git a/rigs/icom/ic7300.c b/rigs/icom/ic7300.c index b3f6a8c5..143aeab1 100644 --- a/rigs/icom/ic7300.c +++ b/rigs/icom/ic7300.c @@ -54,7 +54,7 @@ int ic7300_get_clock(RIG *rig, int *year, int *month, int *day, #define IC7300_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_XIT|RIG_FUNC_SCOPE|RIG_FUNC_TUNER|RIG_FUNC_TRANSCEIVE|RIG_FUNC_SPECTRUM|RIG_FUNC_SPECTRUM_HOLD|RIG_FUNC_SEND_MORSE|RIG_FUNC_SEND_VOICE_MEM) -#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) +#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) #define IC7300_PARMS (RIG_PARM_ANN|RIG_PARM_BACKLIGHT|RIG_PARM_TIME|RIG_PARM_BEEP) @@ -255,7 +255,7 @@ struct cmdparams ic705_extcmds[] = { {.s = RIG_FUNC_TRANSCEIVE}, CMD_PARAM_TYPE_FUNC, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x31}, CMD_DAT_BOL, 1 }, { {.s = RIG_LEVEL_SPECTRUM_AVG}, CMD_PARAM_TYPE_LEVEL, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x78}, CMD_DAT_INT, 1 }, { {.s = RIG_LEVEL_USB_AF}, CMD_PARAM_TYPE_LEVEL, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x13}, CMD_DAT_LVL, 2 }, - { {0} } + { {.s = RIG_PARM_NONE} } }; int ic7300_ext_tokens[] = @@ -284,7 +284,7 @@ static const struct icom_priv_caps IC7300_priv_caps = ic7300_ts_sc_list, .agc_levels_present = 1, .agc_levels = { - { .level = RIG_AGC_OFF, .icom_level = 0 }, + { .level = RIG_AGC_OFF, .icom_level = 0 }, // note this is handled by AGC time constant instead { .level = RIG_AGC_FAST, .icom_level = 1 }, { .level = RIG_AGC_MEDIUM, .icom_level = 2 }, { .level = RIG_AGC_SLOW, .icom_level = 3 }, @@ -382,6 +382,7 @@ static const struct icom_priv_caps IC9700_priv_caps = .serial_USB_echo_check = 1, /* USB CI-V may not echo */ .agc_levels_present = 1, .agc_levels = { + { .level = RIG_AGC_OFF, .icom_level = 0 }, // note this is handled by AGC time constant instead { .level = RIG_AGC_FAST, .icom_level = 1 }, { .level = RIG_AGC_MEDIUM, .icom_level = 2 }, { .level = RIG_AGC_SLOW, .icom_level = 3 }, @@ -429,6 +430,7 @@ static const struct icom_priv_caps IC705_priv_caps = .serial_USB_echo_check = 1, /* USB CI-V may not echo */ .agc_levels_present = 1, .agc_levels = { + { .level = RIG_AGC_OFF, .icom_level = 0 }, { .level = RIG_AGC_FAST, .icom_level = 1 }, { .level = RIG_AGC_MEDIUM, .icom_level = 2 }, { .level = RIG_AGC_SLOW, .icom_level = 3 }, @@ -579,7 +581,8 @@ const struct rig_caps ic7300_caps = [LVL_SPECTRUM_SPEED] = {.min = {.i = 0}, .max = {.i = 2}, .step = {.i = 1}}, [LVL_SPECTRUM_REF] = {.min = {.f = -20.0f}, .max = {.f = 20.0f}, .step = {.f = 0.5f}}, [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 }}, + [LVL_USB_AF] = {.min = {.f = 0.0f}, .max = {.f = 1.0f}, .step = {.f = 1.0f / 255.0f }}, + [LVL_AGC_TIME] = {.min = {.f = 0.0f}, .max = {.f = 8.0f}, .step = {.f = 0.1f }}, }, .parm_gran = {}, .ext_tokens = ic7300_ext_tokens, @@ -592,7 +595,7 @@ const struct rig_caps ic7300_caps = .max_xit = Hz(9999), .max_ifshift = Hz(0), .agc_level_count = 3, - .agc_levels = { RIG_AGC_FAST, RIG_AGC_MEDIUM, RIG_AGC_SLOW }, + .agc_levels = { RIG_AGC_OFF, RIG_AGC_FAST, RIG_AGC_MEDIUM, RIG_AGC_SLOW }, .targetable_vfo = RIG_TARGETABLE_FREQ | RIG_TARGETABLE_MODE, .vfo_ops = IC7300_VFO_OPS, .scan_ops = IC7300_SCAN_OPS, @@ -814,7 +817,8 @@ struct rig_caps ic9700_caps = [LVL_SPECTRUM_SPEED] = {.min = {.i = 0}, .max = {.i = 2}, .step = {.i = 1}}, [LVL_SPECTRUM_REF] = {.min = {.f = -20.0f}, .max = {.f = 20.0f}, .step = {.f = 0.5f}}, [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 }}, + [LVL_USB_AF] = {.min = {.f = 0.0f}, .max = {.f = 1.0f}, .step = {.f = 1.0f / 255.0f }}, + [LVL_AGC_TIME] = {.min = {.f = 0.0f}, .max = {.f = 8.0f}, .step = {.f = 0.1f }}, }, .parm_gran = {}, .ext_tokens = ic9700_ext_tokens, @@ -827,7 +831,7 @@ struct rig_caps ic9700_caps = .max_xit = Hz(9999), .max_ifshift = Hz(0), .agc_level_count = 3, - .agc_levels = { RIG_AGC_FAST, RIG_AGC_MEDIUM, RIG_AGC_SLOW }, + .agc_levels = { RIG_AGC_OFF, RIG_AGC_FAST, RIG_AGC_MEDIUM, RIG_AGC_SLOW }, .targetable_vfo = RIG_TARGETABLE_FREQ | RIG_TARGETABLE_MODE | RIG_TARGETABLE_SPECTRUM, .vfo_ops = IC9700_VFO_OPS, .scan_ops = IC9700_SCAN_OPS, @@ -1126,7 +1130,8 @@ const struct rig_caps ic705_caps = [LVL_SPECTRUM_SPEED] = {.min = {.i = 0}, .max = {.i = 2}, .step = {.i = 1}}, [LVL_SPECTRUM_REF] = {.min = {.f = -20.0f}, .max = {.f = 20.0f}, .step = {.f = 0.5f}}, [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 }}, + [LVL_USB_AF] = {.min = {.f = 0.0f}, .max = {.f = 1.0f}, .step = {.f = 1.0f / 255.0f }}, + [LVL_AGC_TIME] = {.min = {.f = 0.0f}, .max = {.f = 8.0f}, .step = {.f = 0.1f }}, }, .parm_gran = {}, .ext_tokens = ic705_ext_tokens, @@ -1139,7 +1144,7 @@ const struct rig_caps ic705_caps = .max_xit = Hz(9999), .max_ifshift = Hz(0), .agc_level_count = 3, - .agc_levels = { RIG_AGC_FAST, RIG_AGC_MEDIUM, RIG_AGC_SLOW }, + .agc_levels = { RIG_AGC_OFF, RIG_AGC_FAST, RIG_AGC_MEDIUM, RIG_AGC_SLOW }, .targetable_vfo = RIG_TARGETABLE_FREQ | RIG_TARGETABLE_MODE, .vfo_ops = IC7300_VFO_OPS, .scan_ops = IC7300_SCAN_OPS, diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index f9ff2b77..ad142127 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -418,6 +418,16 @@ const pbwidth_t rtty_fil[] = 0, }; +/* AGC Time value lookups */ +const agc_time_t agc_level[] = // default +{ + 0, 0.1, 0.2, 0.3, 0.5, 0.8, 1.2, 1.6, 2.0, 2.5, 3.0, 4.0, 5.0, 6.0 +}; +const agc_time_t agc_level2[] = // AM Mode for 7300/9700/705 +{ + 0, 0.3, 0.5, 0.8, 1.2, 1.6, 2.0, 2.5, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 +}; + struct icom_addr { rig_model_t model; @@ -3450,6 +3460,33 @@ int icom_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) lvl_sc = S_LVL_COMP; break; + case RIG_LEVEL_AGC_TIME: + lvl_cn = C_CTL_MEM; + lvl_sc = 0x04; + cmd_len = 1; + { + int i; + icom_val = 0; + const float *agcp = agc_level; + + if (rig->state.current_mode == RIG_MODE_AM) { agcp = agc_level2; } + + rig_debug(RIG_DEBUG_ERR, "%s: val.f=%g\n", __func__, val.f); + + for (i = 0; i <= 13; ++i) + { + if (agcp[i] <= val.f) + { + rig_debug(RIG_DEBUG_ERR, "%s: agcp=%g <= val.f=%g at %d\n", __func__, agcp[i], + val.f, i); + icom_val = i; + } + } + + cmdbuf[0] = icom_val; + } + break; + case RIG_LEVEL_AGC: lvl_cn = C_CTL_FUNC; lvl_sc = S_FUNC_AGC; @@ -4058,6 +4095,13 @@ int icom_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) break; + case RIG_LEVEL_AGC_TIME: + lvl_cn = C_CTL_MEM; + lvl_sc = 0x04; // IC-9700, 7300, 705 so far + cmd_len = 0; + + break; + default: rig_debug(RIG_DEBUG_ERR, "%s: unsupported get_level %s\n", __func__, rig_strlevel(level)); @@ -4358,6 +4402,20 @@ int icom_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) val->i = (int) from_bcd(respbuf + cmdhead + 5, 5 * 2); break; + case RIG_LEVEL_AGC_TIME: + + // some rigs have different level interpretaions for different modes + if (rig->state.current_mode == RIG_MODE_AM) + { + val->f = agc_level2[icom_val]; + } + else + { + val->f = agc_level[icom_val]; + } + + break; + /* RIG_LEVEL_ATT/RIG_LEVEL_SPECTRUM_ATT: returned value is already an integer in dB (coded in BCD) */ default: if (RIG_LEVEL_IS_FLOAT(level)) @@ -8001,6 +8059,7 @@ int icom_get_powerstat(RIG *rig, powerstat_t *status) *status = ((ack_len == 6) && (ackbuf[0] == C_CTL_MEM)) ? RIG_POWER_ON : RIG_POWER_OFF; } + if (rig->caps->rig_model == RIG_MODEL_IC7300) { freq_t freq; diff --git a/simulators/simicom9700.c b/simulators/simicom9700.c index 963f2113..0b19acf6 100644 --- a/simulators/simicom9700.c +++ b/simulators/simicom9700.c @@ -24,8 +24,8 @@ int split = 0; // we make B different from A to ensure we see a difference at startup float freqA = 14074000; float freqB = 14074500; -mode_t modeA = RIG_MODE_CW; -mode_t modeB = RIG_MODE_USB; +mode_t modeA = RIG_MODE_PKTUSB; +mode_t modeB = RIG_MODE_PKTUSB; int datamodeA = 0; int datamodeB = 0; pbwidth_t widthA = 0; @@ -34,6 +34,7 @@ ant_t ant_curr = 0; int ant_option = 0; int ptt = 0; int satmode = 0; +int agc_time = 1; void dumphex(unsigned char *buf, int n) { @@ -274,15 +275,28 @@ void frameParse(int fd, unsigned char *frame, int len) n = write(fd, frame, 8); break; - case 0x04: // IC7200 data mode - frame[6] = 0; - frame[7] = 0; - frame[8] = 0xfd; - n = write(fd, frame, 9); + case 0x04: // AGC TIME + printf("frame[6]==x%02x, frame[7]=0%02x\n", frame[6], frame[7]); + + if (frame[6] == 0xfd) // the we are reading + { + frame[6] = agc_time; + frame[7] = 0xfd; + n = write(fd, frame, 8); + } + else + { + printf("AGC_TIME RESPONSE******************************"); + agc_time = frame[6]; + frame[4] = 0xfb; + frame[5] = 0xfd; + n = write(fd, frame, 6); + } + break; case 0x07: // satmode - frame[6] = 0; + frame[4] = 0; frame[7] = 0xfd; n = write(fd, frame, 8); break; @@ -412,6 +426,8 @@ void frameParse(int fd, unsigned char *frame, int len) default: printf("cmd 0x%02x unknown\n", frame[4]); } + if (n == 0) { printf("Write failed?\n"); } + // don't care about the rig type yet } diff --git a/src/idx_builtin.h b/src/idx_builtin.h index 0585c916..004bdbbf 100644 --- a/src/idx_builtin.h +++ b/src/idx_builtin.h @@ -164,7 +164,7 @@ #define LVL_SPECTRUM_ATT setting2idx_builtin(RIG_LEVEL_SPECTRUM_ATT) #define LVL_USB_AF setting2idx_builtin(RIG_LEVEL_USB_AF) -#define LVL_49 setting2idx_builtin(RIG_LEVEL_49) +#define LVL_AGC_TIME setting2idx_builtin(RIG_LEVEL_AGC_TIME) #define LVL_50 setting2idx_builtin(RIG_LEVEL_50) #define LVL_51 setting2idx_builtin(RIG_LEVEL_51) #define LVL_52 setting2idx_builtin(RIG_LEVEL_52) diff --git a/src/misc.c b/src/misc.c index 91cc8d04..2946ec69 100644 --- a/src/misc.c +++ b/src/misc.c @@ -926,6 +926,7 @@ static const struct { RIG_LEVEL_TEMP_METER, "TEMP_METER" }, { RIG_LEVEL_BAND_SELECT, "BAND_SELECT" }, { RIG_LEVEL_USB_AF, "USB_AF" }, + { RIG_LEVEL_AGC_TIME, "AGC_TIME" }, { RIG_LEVEL_NONE, "" }, }; commit dac5175cad340df649fb9a674257259b5d4aa773 Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Nov 4 10:12:09 2022 -0500 Add simft747gx.c diff --git a/simulators/simft747gx.c b/simulators/simft747gx.c new file mode 100644 index 00000000..a0ce5cb8 --- /dev/null +++ b/simulators/simft747gx.c @@ -0,0 +1,180 @@ +// can run this using rigctl/rigctld and socat pty devices +// gcc -o simft897 simft897.c +#define _XOPEN_SOURCE 600 +#include <stdio.h> +#include <stdlib.h> +#include <fcntl.h> +#include <string.h> +#include <unistd.h> +#include "../include/hamlib/rig.h" + +#define BUFSIZE 256 + +float freqA = 14074000; +float freqB = 14074500; +char tx_vfo = '0'; +char rx_vfo = '0'; +char modeA = '1'; +char modeB = '1'; +int width_main = 500; +int width_sub = 700; + + +int +getmyline(int fd, unsigned char *buf) +{ + unsigned char c; + int i = 0; + int n = 0; + memset(buf, 0, BUFSIZE); + + while (read(fd, &c, 1) > 0 && i < 5) + { + buf[i++] = c; + n++; + } + + printf("n=%d %02x %02x %02x %02x %02x\n", n, buf[0], buf[1], buf[2], buf[3], + buf[4]); + return n; +} + +#if defined(WIN32) || defined(_WIN32) +int openPort(char *comport) // doesn't matter for using pts devices +{ + int fd; + fd = open(comport, O_RDWR); + + if (fd < 0) + { + perror(comport); + } + + return fd; +} + +#else +int openPort(char *comport) // doesn't matter for using pts devices +{ + int fd = posix_openpt(O_RDWR); + char *name = ptsname(fd); + + if (name == NULL) + { + perror("pstname"); + return -1; + } + + printf("name=%s\n", name); + + if (fd == -1 || grantpt(fd) == -1 || unlockpt(fd) == -1) + { + perror("posix_openpt"); + return -1; + } + + return fd; +} +#endif + + + +int main(int argc, char *argv[]) +{ + unsigned char buf[256]; + unsigned char *pbuf; + int n; + + +again: + int fd = openPort(argv[1]); + + while (1) + { + int bytes = getmyline(fd, buf); + + if (bytes == 0) + { + close(fd); + goto again; + } + + if (bytes != 5) + { + printf("Not 5 bytes? bytes=%d\n", bytes); + } + + switch (buf[4]) + { + case 0x01: + printf("SPLIT\n"); + break; + + case 0x02: + printf("MEMORY\n"); + break; + + case 0x03: + printf("VFO_TO_M\n"); + break; + + case 0x04: + printf("DLOCK\n"); + break; + + case 0x05: + printf("A_BVFO\n"); + break; + + case 0x06: + printf("M_TO_VFO\n"); + break; + + case 0x07: + printf("UP500K\n"); + break; + + case 0x08: + printf("DN500K\n"); + break; + + case 0x09: + printf("CLAR\n"); + break; + + case 0x0a: + printf("FREQ_SET\n"); + break; + + case 0x0c: + printf("MODE_SET\n"); + break; + + case 0x0e: + printf("PACING\n"); // no reply + break; + + case 0x0f: + printf("PTT\n"); + break; + + case 0x10: + printf("UPDATE\n"); + buf[0] = 0x01; // status byte -- split on + buf[1] = 0x14; + buf[2] = 0x07; + buf[3] = 0x41; + buf[4] = 0x02; + write(fd, buf, 5); + buf[0] = 0; + + for (int i = 5; i < 340; ++i) { write(fd, buf, 1); } + + break; + + default: printf("Unknown cmd=%02x\n", buf[4]); + } + } + + return 0; +} commit a397b39ca3f3143abda61346f8b253032b4eb3da Merge: eff048d7 aedf39ad Author: Michael Black <mdb...@ya...> Date: Fri Nov 4 08:47:45 2022 -0500 Merge pull request #1137 from PianetaRadio/master Update netrotctl.c commit aedf39adc2c30a95a944e130b5d7398a77aab7d4 Author: PianetaRadio <789...@us...> Date: Fri Nov 4 11:32:39 2022 +0100 Update netrotctl.c Add south_zero from dump_state in open function diff --git a/rigs/dummy/netrotctl.c b/rigs/dummy/netrotctl.c index 38b64554..16b6c22e 100644 --- a/rigs/dummy/netrotctl.c +++ b/rigs/dummy/netrotctl.c @@ -144,6 +144,16 @@ 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); + + if (ret <= 0) + { + return (ret < 0) ? ret : -RIG_EPROTO; + } + + rs->south_zero = atoi(buf); return RIG_OK; } commit eff048d729dd56f86aead6c4c670bc8435a1a22e Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Nov 1 14:57:37 2022 -0500 Add AGC_OFF to IC7300 agc levels diff --git a/rigs/icom/ic7300.c b/rigs/icom/ic7300.c index 7f954412..b3f6a8c5 100644 --- a/rigs/icom/ic7300.c +++ b/rigs/icom/ic7300.c @@ -284,6 +284,7 @@ static const struct icom_priv_caps IC7300_priv_caps = ic7300_ts_sc_list, .agc_levels_present = 1, .agc_levels = { + { .level = RIG_AGC_OFF, .icom_level = 0 }, { .level = RIG_AGC_FAST, .icom_level = 1 }, { .level = RIG_AGC_MEDIUM, .icom_level = 2 }, { .level = RIG_AGC_SLOW, .icom_level = 3 }, commit b2cf596b5494d6201f8d506a881bb8aaf3df7970 Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Nov 1 14:51:47 2022 -0500 IC7300 cannot get powerstat so use get_freq instead. There are likely more Icom rigs like this diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 987008aa..f9ff2b77 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -8001,6 +8001,12 @@ int icom_get_powerstat(RIG *rig, powerstat_t *status) *status = ((ack_len == 6) && (ackbuf[0] == C_CTL_MEM)) ? RIG_POWER_ON : RIG_POWER_OFF; } + if (rig->caps->rig_model == RIG_MODEL_IC7300) + { + freq_t freq; + int retval = rig_get_freq(rig, RIG_VFO_A, &freq); + return retval; + } else { retval = icom_transaction(rig, C_SET_PWR, -1, NULL, 0, commit 790bf7704c8a175aabfe8cd54ec267c0d5b7fbd3 Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Nov 1 12:27:33 2022 -0500 Remove debug from misc.c diff --git a/src/misc.c b/src/misc.c index 1ec46810..91cc8d04 100644 --- a/src/misc.c +++ b/src/misc.c @@ -1051,7 +1051,7 @@ const char *HAMLIB_API rig_strlevel(setting_t level) { int i; - rig_debug(RIG_DEBUG_VERBOSE, "%s called level=%lx\n", __func__, level); + rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); if (level == RIG_LEVEL_NONE) { commit 0d73bb22a080ea04b489f723cdbac6ee4c5744a2 Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Nov 1 12:25:42 2022 -0500 Fix LEVEL_USB_AF https://github.com/Hamlib/Hamlib/issues/1135 diff --git a/rigs/icom/ic7300.c b/rigs/icom/ic7300.c index 187e5d2a..7f954412 100644 --- a/rigs/icom/ic7300.c +++ b/rigs/icom/ic7300.c @@ -226,7 +226,7 @@ struct cmdparams ic7300_extcmds[] = { {.s = RIG_LEVEL_VOXDELAY}, CMD_PARAM_TYPE_LEVEL, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x59}, CMD_DAT_INT, 1 }, { {.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_FUNC, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x60}, CMD_DAT_LVL, 2 }, + { {.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_NONE} } }; @@ -240,7 +240,7 @@ struct cmdparams ic9700_extcmds[] = { {.s = RIG_LEVEL_VOXDELAY}, CMD_PARAM_TYPE_LEVEL, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x03, 0x30}, CMD_DAT_INT, 1 }, { {.s = RIG_FUNC_TRANSCEIVE}, CMD_PARAM_TYPE_FUNC, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x27}, CMD_DAT_BOL, 1 }, { {.s = RIG_LEVEL_SPECTRUM_AVG}, CMD_PARAM_TYPE_LEVEL, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x92}, CMD_DAT_INT, 1 }, - { {.s = RIG_LEVEL_USB_AF}, CMD_PARAM_TYPE_FUNC, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x06}, CMD_DAT_LVL, 2 }, + { {.s = RIG_LEVEL_USB_AF}, CMD_PARAM_TYPE_LEVEL, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x06}, CMD_DAT_LVL, 2 }, { {.s = RIG_PARM_NONE} } }; @@ -254,7 +254,7 @@ struct cmdparams ic705_extcmds[] = { {.s = RIG_LEVEL_VOXDELAY}, CMD_PARAM_TYPE_LEVEL, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x03, 0x59}, CMD_DAT_INT, 1 }, { {.s = RIG_FUNC_TRANSCEIVE}, CMD_PARAM_TYPE_FUNC, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x31}, CMD_DAT_BOL, 1 }, { {.s = RIG_LEVEL_SPECTRUM_AVG}, CMD_PARAM_TYPE_LEVEL, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x78}, CMD_DAT_INT, 1 }, - { {.s = RIG_LEVEL_USB_AF}, CMD_PARAM_TYPE_FUNC, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x13}, CMD_DAT_LVL, 2 }, + { {.s = RIG_LEVEL_USB_AF}, CMD_PARAM_TYPE_LEVEL, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x13}, CMD_DAT_LVL, 2 }, { {0} } }; diff --git a/rigs/icom/ic7610.c b/rigs/icom/ic7610.c index e84a6714..b273bf33 100644 --- a/rigs/icom/ic7610.c +++ b/rigs/icom/ic7610.c @@ -137,7 +137,7 @@ struct cmdparams ic7610_extcmds[] = { {.s = RIG_LEVEL_VOXDELAY}, CMD_PARAM_TYPE_LEVEL, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x02, 0x92}, CMD_DAT_INT, 1 }, { {.s = RIG_FUNC_TRANSCEIVE}, CMD_PARAM_TYPE_FUNC, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x12}, CMD_DAT_BOL, 1 }, { {.s = RIG_LEVEL_SPECTRUM_AVG}, CMD_PARAM_TYPE_LEVEL, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x70}, CMD_DAT_INT, 1 }, - { {.s = RIG_LEVEL_USB_AF}, CMD_PARAM_TYPE_FUNC, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x82}, CMD_DAT_LVL, 2 }, + { {.s = RIG_LEVEL_USB_AF}, CMD_PARAM_TYPE_LEVEL, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x82}, CMD_DAT_LVL, 2 }, { { 0 } } }; diff --git a/rigs/icom/ic785x.c b/rigs/icom/ic785x.c index c5acc0ca..7b9b4b61 100644 --- a/rigs/icom/ic785x.c +++ b/rigs/icom/ic785x.c @@ -128,7 +128,7 @@ struct cmdparams ic785x_extcmds[] = { {.s = RIG_LEVEL_VOXDELAY}, CMD_PARAM_TYPE_LEVEL, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x03, 0x09}, CMD_DAT_INT, 1 }, { {.s = RIG_FUNC_TRANSCEIVE}, CMD_PARAM_TYPE_FUNC, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x55}, CMD_DAT_BOL, 1 }, { {.s = RIG_LEVEL_SPECTRUM_AVG}, CMD_PARAM_TYPE_LEVEL, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x87}, CMD_DAT_INT, 1 }, - { {.s = RIG_LEVEL_USB_AF}, CMD_PARAM_TYPE_FUNC, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x52}, CMD_DAT_LVL, 2 }, + { {.s = RIG_LEVEL_USB_AF}, CMD_PARAM_TYPE_LEVEL, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x52}, CMD_DAT_LVL, 2 }, { { 0 } } }; diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 4b04e5cb..987008aa 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -4051,6 +4051,13 @@ int icom_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) cmdbuf[0] = icom_get_spectrum_vfo(rig, vfo); break; + case RIG_LEVEL_USB_AF: + lvl_cn = C_CTL_SCP; + lvl_sc = S_SCP_ATT; + cmd_len = 1; + + break; + default: rig_debug(RIG_DEBUG_ERR, "%s: unsupported get_level %s\n", __func__, rig_strlevel(level)); diff --git a/rigs/icom/icr8600.c b/rigs/icom/icr8600.c index 39f2bf78..90c360c8 100644 --- a/rigs/icom/icr8600.c +++ b/rigs/icom/icr8600.c @@ -70,7 +70,7 @@ struct cmdparams icr8600_extcmds[] = { {.s = RIG_PARM_TIME}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x32}, CMD_DAT_TIM, 2 }, { {.s = RIG_FUNC_TRANSCEIVE}, CMD_PARAM_TYPE_FUNC, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x92}, CMD_DAT_BOL, 1 }, { {.s = RIG_LEVEL_SPECTRUM_AVG}, CMD_PARAM_TYPE_LEVEL, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x40}, CMD_DAT_INT, 1 }, - { {.s = RIG_LEVEL_USB_AF}, CMD_PARAM_TYPE_FUNC, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x81}, CMD_DAT_LVL, 2 }, + { {.s = RIG_LEVEL_USB_AF}, CMD_PARAM_TYPE_LEVEL, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x81}, CMD_DAT_LVL, 2 }, { {.s = RIG_PARM_NONE} } }; diff --git a/src/misc.c b/src/misc.c index 91cc8d04..1ec46810 100644 --- a/src/misc.c +++ b/src/misc.c @@ -1051,7 +1051,7 @@ const char *HAMLIB_API rig_strlevel(setting_t level) { int i; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + rig_debug(RIG_DEBUG_VERBOSE, "%s called level=%lx\n", __func__, level); if (level == RIG_LEVEL_NONE) { diff --git a/src/sprintflst.h b/src/sprintflst.h index 940a378f..919ee896 100644 --- a/src/sprintflst.h +++ b/src/sprintflst.h @@ -25,7 +25,7 @@ #include <hamlib/rig.h> #include <hamlib/rotator.h> -#define SPRINTF_MAX_SIZE 512 +#define SPRINTF_MAX_SIZE 1024 __BEGIN_DECLS commit eb667185ef587323809a298e171d2e538e2005cd Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Nov 1 10:34:45 2022 -0500 Update simicom9700.c diff --git a/simulators/simicom9700.c b/simulators/simicom9700.c index 35502894..963f2113 100644 --- a/simulators/simicom9700.c +++ b/simulators/simicom9700.c @@ -257,6 +257,11 @@ void frameParse(int fd, unsigned char *frame, int len) break; + case 0x18: // miscellaneous things + frame[5] = 1; + frame[6] = 0xfd; + n = write(fd, frame, 7); + break; case 0x1a: // miscellaneous things switch (frame[5]) commit 2a30396d70dda90ae8e2218bf761b0ffc7ee5e8d Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Nov 1 09:14:19 2022 -0500 Add RIG_LEVEL_USB_AF for IC-705, IC-7300, IC-9700, IC-785x, and IC-R8600 In combination with RIG_LEVEL_RF we should be able to create an AGC control for WSJTX and JTDX for example to keep audio levels within a good A/D range automagically https://github.com/Hamlib/Hamlib/issues/1135 diff --git a/NEWS b/NEWS index ccad1326..73490b44 100644 --- a/NEWS +++ b/NEWS @@ -15,6 +15,7 @@ Version 5.x -- future Version 4.6 * 2023-XX-XX * 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 Version 4.5 diff --git a/doc/man1/rigctl.1 b/doc/man1/rigctl.1 index 29ad2090..b29f030a 100644 --- a/doc/man1/rigctl.1 +++ b/doc/man1/rigctl.1 @@ -847,13 +847,17 @@ Set and .RI \(aq "Level Value" \(aq. .IP -Level is a token: \(oqPREAMP\(cq, \(oqATT\(cq, \(oqVOX\(cq, \(oqAF\(cq, +Level is a token: \(oqPREAMP\(cq, \(oqATT\(cq, \(oqVOXDELAY\(cq, \(oqAF\(cq, \(oqRF\(cq, \(oqSQL\(cq, \(oqIF\(cq, \(oqAPF\(cq, \(oqNR\(cq, \(oqPBT_IN\(cq, -\(oqPBT_OUT\(cq, \(oqCWPITCH\(cq, \(oqRFPOWER\(cq, \(oqRFPOWER_METER\(cq, \(oqRFPOWER_METER_WATTS\(cq, \(oqMICGAIN\(cq, +\(oqPBT_OUT\(cq, \(oqCWPITCH\(cq, \(oqRFPOWER\(cq, \(oqMICGAIN\(cq, \(oqKEYSPD\(cq, \(oqNOTCHF\(cq, \(oqCOMP\(cq, \(oqAGC\(cq, \(oqBKINDL\(cq, \(oqBAL\(cq, \(oqMETER\(cq, \(oqVOXGAIN\(cq, \(oqANTIVOX\(cq, -\(oqSLOPE_LOW\(cq, \(oqSLOPE_HIGH\(cq, \(oqRAWSTR\(cq, \(oqSWR\(cq, -\(oqALC\(cq, \(oqSTRENGTH\(cq. +\(oqSLOPE_LOW\(cq, \(oqSLOPE_HIGH\(cq, \(oqBKIN_DLYMS\(cq, \(oqRAWSTR\(cq, \(oqSWR\(cq, +\(oqALC\(cq, \(oqSTRENGTH\(cq, \(oqRFPOWER_METER\(cq, \(oqCOMPMETER\(cq, \(oqVD_METER\(cq, \(oqID_METER\(cq, +\(oqNOTCHF_RAW\(cq, \(oqMONITOR_GAIN\(cq, \(oqNQ\(cq, \(oqRFPOWER_METER_WATTS\cq, \(oqSPECTRUM_MODE\(cq, +\(oqSPECTRUM_SPAN\(cq, \(oqSPECTRUM_EDGE_LOW\(cq, \(oqSPECTRUM_EDGE_HIGH\(cq, \(oqSPECTRUM_SPEED\cq, +\(oqSPECTRUM_REF\(cq, (oqSPECTRUM_AVG\(cq, \(oqSPECTRUM_ATT\cq, \(oqTEMP_METER\cq, \(oqBAND_SELECT\(cq, +\(oqUSB_AF\(cq. .IP 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, diff --git a/doc/man1/rigctld.1 b/doc/man1/rigctld.1 index 876518ef..391920a7 100644 --- a/doc/man1/rigctld.1 +++ b/doc/man1/rigctld.1 @@ -839,13 +839,17 @@ Set and .RI \(aq "Level Value" \(aq. .IP -Level is a token: \(oqPREAMP\(cq, \(oqATT\(cq, \(oqVOX\(cq, \(oqAF\(cq, +evel is a token: \(oqPREAMP\(cq, \(oqATT\(cq, \(oqVOXDELAY\(cq, \(oqAF\(cq, \(oqRF\(cq, \(oqSQL\(cq, \(oqIF\(cq, \(oqAPF\(cq, \(oqNR\(cq, \(oqPBT_IN\(cq, -\(oqPBT_OUT\(cq, \(oqCWPITCH\(cq, \(oqRFPOWER\(cq, \(oqRFPOWER_METER\(cq, \(oqRFPOWER_METER_WATTS\(cq, \(oqMICGAIN\(cq, +\(oqPBT_OUT\(cq, \(oqCWPITCH\(cq, \(oqRFPOWER\(cq, \(oqMICGAIN\(cq, \(oqKEYSPD\(cq, \(oqNOTCHF\(cq, \(oqCOMP\(cq, \(oqAGC\(cq, \(oqBKINDL\(cq, \(oqBAL\(cq, \(oqMETER\(cq, \(oqVOXGAIN\(cq, \(oqANTIVOX\(cq, -\(oqSLOPE_LOW\(cq, \(oqSLOPE_HIGH\(cq, \(oqRAWSTR\(cq, \(oqSWR\(cq, -\(oqALC\(cq, \(oqSTRENGTH\(cq. +\(oqSLOPE_LOW\(cq, \(oqSLOPE_HIGH\(cq, \(oqBKIN_DLYMS\(cq, \(oqRAWSTR\(cq, \(oqSWR\(cq, +\(oqALC\(cq, \(oqSTRENGTH\(cq, \(oqRFPOWER_METER\(cq, \(oqCOMPMETER\(cq, \(oqVD_METER\(cq, \(oqID_METER\(cq, +\(oqNOTCHF_RAW\(cq, \(oqMONITOR_GAIN\(cq, \(oqNQ\(cq, \(oqRFPOWER_METER_WATTS\cq, \(oqSPECTRUM_MODE\(cq, +\(oqSPECTRUM_SPAN\(cq, \(oqSPECTRUM_EDGE_LOW\(cq, \(oqSPECTRUM_EDGE_HIGH\(cq, \(oqSPECTRUM_SPEED\cq, +\(oqSPECTRUM_REF\(cq, (oqSPECTRUM_AVG\(cq, \(oqSPECTRUM_ATT\cq, \(oqTEMP_METER\cq, \(oqBAND_SELECT\(cq, +\(oqUSB_AF\(cq. .IP 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, diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h index 8b7f72b4..e1678106 100644 --- a/include/hamlib/rig.h +++ b/include/hamlib/rig.h @@ -978,7 +978,7 @@ typedef uint64_t rig_level_e; #define RIG_LEVEL_SLOPE_HIGH CONSTANT_64BIT_FLAG(24) /*!< \c SLOPE_HIGH -- Slope tune, high frequency cut, arg int (Hz) */ #define RIG_LEVEL_BKIN_DLYMS CONSTANT_64BIT_FLAG(25) /*!< \c BKIN_DLYMS -- BKin Delay, arg int Milliseconds */ - /*!< These are not settable */ + /*!< Some of these are not settable after this point */ #define RIG_LEVEL_RAWSTR CONSTANT_64BIT_FLAG(26) /*!< \c RAWSTR -- Raw (A/D) value for signal strength, specific to each rig, arg int */ //#define RIG_LEVEL_SQLSTAT CONSTANT_64BIT_FLAG(27) /*!< \c SQLSTAT -- SQL status, arg int (open=1/closed=0). Deprecated, use get_dcd instead */ #define RIG_LEVEL_SWR CONSTANT_64BIT_FLAG(28) /*!< \c SWR -- SWR, arg float [0.0 ... infinite] */ @@ -1004,7 +1004,7 @@ typedef uint64_t rig_level_e; #define RIG_LEVEL_SPECTRUM_ATT CONSTANT_64BIT_FLAG(47) /*!< \c SPECTRUM_ATT -- Spectrum scope attenuator, arg int (dB). Supported attenuator values defined in rig caps. */ #define RIG_LEVEL_TEMP_METER CONSTANT_64BIT_FLAG(48) /*!< \c TEMP_METER -- arg float (C, centigrade) */ #define RIG_LEVEL_BAND_SELECT CONSTANT_64BIT_FLAG(49) /*!< \c BAND_SELECT -- arg enum BAND_ENUM */ -#define RIG_LEVEL_50 CONSTANT_64BIT_FLAG(50) /*!< \c Future use */ +#define RIG_LEVEL_USB_AF CONSTANT_64BIT_FLAG(50) /*!< \c ACC/USB AF output level */ #define RIG_LEVEL_51 CONSTANT_64BIT_FLAG(51) /*!< \c Future use */ #define RIG_LEVEL_52 CONSTANT_64BIT_FLAG(52) /*!< \c Future use */ #define RIG_LEVEL_53 CONSTANT_64BIT_FLAG(53) /*!< \c Future use */ @@ -1020,7 +1020,7 @@ typedef uint64_t rig_level_e; #define RIG_LEVEL_63 CONSTANT_64BIT_FLAG(63) /*!< \c Future use */ //! @cond Doxygen_Suppress -#define RIG_LEVEL_FLOAT_LIST (RIG_LEVEL_AF|RIG_LEVEL_RF|RIG_LEVEL_SQL|RIG_LEVEL_APF|RIG_LEVEL_NR|RIG_LEVEL_PBT_IN|RIG_LEVEL_PBT_OUT|RIG_LEVEL_RFPOWER|RIG_LEVEL_MICGAIN|RIG_LEVEL_COMP|RIG_LEVEL_BALANCE|RIG_LEVEL_SWR|RIG_LEVEL_ALC|RIG_LEVEL_VOXGAIN|RIG_LEVEL_ANTIVOX|RIG_LEVEL_RFPOWER_METER|RIG_LEVEL_RFPOWER_METER_WATTS|RIG_LEVEL_COMP_METER|RIG_LEVEL_VD_METER|RIG_LEVEL_ID_METER|RIG_LEVEL_NOTCHF_RAW|RIG_LEVEL_MONITOR_GAIN|RIG_LEVEL_NB|RIG_LEVEL_SPECTRUM_REF|RIG_LEVEL_TEMP_METER) +#define RIG_LEVEL_FLOAT_LIST (RIG_LEVEL_AF|RIG_LEVEL_RF|RIG_LEVEL_SQL|RIG_LEVEL_APF|RIG_LEVEL_NR|RIG_LEVEL_PBT_IN|RIG_LEVEL_PBT_OUT|RIG_LEVEL_RFPOWER|RIG_LEVEL_MICGAIN|RIG_LEVEL_COMP|RIG_LEVEL_BALANCE|RIG_LEVEL_SWR|RIG_LEVEL_ALC|RIG_LEVEL_VOXGAIN|RIG_LEVEL_ANTIVOX|RIG_LEVEL_RFPOWER_METER|RIG_LEVEL_RFPOWER_METER_WATTS|RIG_LEVEL_COMP_METER|RIG_LEVEL_VD_METER|RIG_LEVEL_ID_METER|RIG_LEVEL_NOTCHF_RAW|RIG_LEVEL_MONITOR_GAIN|RIG_LEVEL_NB|RIG_LEVEL_SPECTRUM_REF|RIG_LEVEL_TEMP_METER|RIG_LEVEL_USB_AF) #define RIG_LEVEL_READONLY_LIST (RIG_LEVEL_SWR|RIG_LEVEL_ALC|RIG_LEVEL_STRENGTH|RIG_LEVEL_RAWSTR|RIG_LEVEL_RFPOWER_METER|RIG_LEVEL_COMP_METER|RIG_LEVEL_VD_METER|RIG_LEVEL_ID_METER) diff --git a/rigs/icom/ic7300.c b/rigs/icom/ic7300.c index 19b276d0..187e5d2a 100644 --- a/rigs/icom/ic7300.c +++ b/rigs/icom/ic7300.c @@ -54,7 +54,7 @@ int ic7300_get_clock(RIG *rig, int *year, int *month, int *day, #define IC7300_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_XIT|RIG_FUNC_SCOPE|RIG_FUNC_TUNER|RIG_FUNC_TRANSCEIVE|RIG_FUNC_SPECTRUM|RIG_FUNC_SPECTRUM_HOLD|RIG_FUNC_SEND_MORSE|RIG_FUNC_SEND_VOICE_MEM) -#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) +#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) #define IC7300_VFOS (RIG_VFO_A|RIG_VFO_B|RIG_VFO_MEM) #define IC7300_PARMS (RIG_PARM_ANN|RIG_PARM_BACKLIGHT|RIG_PARM_TIME|RIG_PARM_BEEP) @@ -147,7 +147,7 @@ int ic7300_get_clock(RIG *rig, int *year, int *month, int *day, #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) #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) -#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) +#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) #define IC9700_VFO_OPS (RIG_OP_CPY|RIG_OP_XCHG|RIG_OP_FROM_VFO|RIG_OP_TO_VFO|RIG_OP_MCL) #define IC9700_SCAN_OPS (RIG_SCAN_STOP|RIG_SCAN_MEM|RIG_SCAN_PROG|RIG_SCAN_SLCT) #define IC9700_ALL_TX_MODES (RIG_MODE_FM|RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|RIG_MODE_RTTY|RIG_MODE_RTTYR|RIG_MODE_DSTAR|RIG_MODE_DD) @@ -226,6 +226,7 @@ struct cmdparams ic7300_extcmds[] = { {.s = RIG_LEVEL_VOXDELAY}, CMD_PARAM_TYPE_LEVEL, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x59}, CMD_DAT_INT, 1 }, { {.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_FUNC, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x60}, CMD_DAT_LVL, 2 }, { {.s = RIG_PARM_NONE} } }; @@ -239,7 +240,8 @@ struct cmdparams ic9700_extcmds[] = { {.s = RIG_LEVEL_VOXDELAY}, CMD_PARAM_TYPE_LEVEL, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {... [truncated message content] |