hamlib-cvs-digest Mailing List for Ham Radio Control Libraries (Page 30)
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
(29) |
Sep
|
Oct
|
Nov
|
Dec
|
From: Michael B. <mdb...@us...> - 2020-06-23 13:29: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, master has been updated via 2c64ba9bbaa58b70efa0d89351e45256170e3c89 (commit) from 835caf34f9e4767a2a7d0c552c526c8b0399de09 (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 2c64ba9bbaa58b70efa0d89351e45256170e3c89 Author: Michael Black W9MDB <mdb...@ya...> Date: Tue Jun 23 08:27:45 2020 -0500 First round of rigs switched over to new rig_flush function When done this will allow all rigs to use network connections and stil flush properly https://github.com/Hamlib/Hamlib/issues/307 diff --git a/dummy/flrig.c b/dummy/flrig.c index 8d9a6b8f..49af67f9 100644 --- a/dummy/flrig.c +++ b/dummy/flrig.c @@ -494,7 +494,7 @@ static int write_transaction(RIG *rig, char *xml, int xml_len) // appears we can lose sync if we don't clear things out // shouldn't be anything for us now anyways - network_flush(&rig->state.rigport); + rig_flush(&rig->state.rigport); while (try-- >= 0 && retval != RIG_OK) { diff --git a/dummy/netrigctl.c b/dummy/netrigctl.c index cf5f2818..dad7d075 100644 --- a/dummy/netrigctl.c +++ b/dummy/netrigctl.c @@ -68,15 +68,7 @@ static int netrigctl_transaction(RIG *rig, char *cmd, int len, char *buf) rig_debug(RIG_DEBUG_VERBOSE, "%s: called len=%d\n", __func__, len); /* flush anything in the read buffer before command is sent */ - if (rig->state.rigport.type.rig == RIG_PORT_NETWORK - || rig->state.rigport.type.rig == RIG_PORT_UDP_NETWORK) - { - network_flush(&rig->state.rigport); - } - else - { - serial_flush(&rig->state.rigport); - } + rig_flush(&rig->state.rigport); ret = write_block(&rig->state.rigport, cmd, len); diff --git a/dummy/netrotctl.c b/dummy/netrotctl.c index d99e0fe3..76c07433 100644 --- a/dummy/netrotctl.c +++ b/dummy/netrotctl.c @@ -48,15 +48,7 @@ static int netrotctl_transaction(ROT *rot, char *cmd, int len, char *buf) int ret; /* flush anything in the read buffer before command is sent */ - if (rot->state.rotport.type.rig == RIG_PORT_NETWORK - || rot->state.rotport.type.rig == RIG_PORT_UDP_NETWORK) - { - network_flush(&rot->state.rotport); - } - else - { - serial_flush(&rot->state.rotport); - } + rig_flush(&rot->state.rotport); ret = write_block(&rot->state.rotport, cmd, len); diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h index d8bc4df5..86f2cbdb 100644 --- a/include/hamlib/rig.h +++ b/include/hamlib/rig.h @@ -2113,7 +2113,7 @@ extern HAMLIB_EXPORT(int) rig_open HAMLIB_PARAMS((RIG *rig)); */ extern HAMLIB_EXPORT(int) -rig_flush(RIG *rig); +rig_flush(hamlib_port_t *port); extern HAMLIB_EXPORT(int) rig_set_freq HAMLIB_PARAMS((RIG *rig, diff --git a/src/misc.c b/src/misc.c index 0dae9c3d..b8f90c8d 100644 --- a/src/misc.c +++ b/src/misc.c @@ -1480,17 +1480,21 @@ int HAMLIB_API parse_hoststr(char *hoststr, char host[256], char port[6]) return -1; } -int HAMLIB_API rig_flush(RIG *rig) +int HAMLIB_API rig_flush(hamlib_port_t *port) { - if (rig->state.rigport.type.rig == RIG_PORT_NETWORK - || rig->state.rigport.type.rig == RIG_PORT_UDP_NETWORK) + rig_debug(RIG_DEBUG_TRACE, "%s: called for %s device\n", __func__, + port->type.rig == RIG_PORT_SERIAL ? "serial" : "network"); + + if (port->type.rig == RIG_PORT_NETWORK + || port->type.rig == RIG_PORT_UDP_NETWORK) { - network_flush(&rig->state.rigport); + network_flush(port); return RIG_OK; } - return serial_flush(&rig->state.rigport); + + return serial_flush(port); } //! @endcond - /** @} */ +/** @} */ ----------------------------------------------------------------------- Summary of changes: dummy/flrig.c | 2 +- dummy/netrigctl.c | 10 +--------- dummy/netrotctl.c | 10 +--------- include/hamlib/rig.h | 2 +- src/misc.c | 16 ++++++++++------ 5 files changed, 14 insertions(+), 26 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2020-06-23 04:54:59
|
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 835caf34f9e4767a2a7d0c552c526c8b0399de09 (commit) from 253a3d8643895a6ec45705007d9e7121b64850bc (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 835caf34f9e4767a2a7d0c552c526c8b0399de09 Author: Michael Black W9MDB <mdb...@ya...> Date: Mon Jun 22 23:54:11 2020 -0500 Add rig_flush function https://github.com/Hamlib/Hamlib/issues/307 diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h index 53e0f294..d8bc4df5 100644 --- a/include/hamlib/rig.h +++ b/include/hamlib/rig.h @@ -2112,6 +2112,9 @@ extern HAMLIB_EXPORT(int) rig_open HAMLIB_PARAMS((RIG *rig)); * List Set/Get functions pairs */ +extern HAMLIB_EXPORT(int) +rig_flush(RIG *rig); + extern HAMLIB_EXPORT(int) rig_set_freq HAMLIB_PARAMS((RIG *rig, vfo_t vfo, diff --git a/src/misc.c b/src/misc.c index 33d54755..0dae9c3d 100644 --- a/src/misc.c +++ b/src/misc.c @@ -54,6 +54,8 @@ #include <hamlib/amplifier.h> #include "misc.h" +#include "serial.h" +#include "network.h" /** @@ -1385,8 +1387,9 @@ int HAMLIB_API parse_hoststr(char *hoststr, char host[256], char port[6]) dummy[0] = 0; // Handle device names 1st - if (strstr(hoststr, "/dev")) return -1; - if (strncasecmp(hoststr, "com", 3)==0) return -1; + if (strstr(hoststr, "/dev")) { return -1; } + + if (strncasecmp(hoststr, "com", 3) == 0) { return -1; } // bracketed IPV6 with optional port int n = sscanf(hoststr, "[%255[^]]]:%5s", host, port); @@ -1399,6 +1402,7 @@ int HAMLIB_API parse_hoststr(char *hoststr, char host[256], char port[6]) // non-bracketed full IPV6 with optional link addr n = sscanf(hoststr, "%x:%x:%x:%x:%x:%x:%x:%x%%%31[^:]:%5s", &net1, &net2, &net3, &net4, &net5, &net6, &net7, &net8, link, port); + if (n == 8 || n == 9) { strcpy(host, hoststr); @@ -1411,6 +1415,7 @@ int HAMLIB_API parse_hoststr(char *hoststr, char host[256], char port[6]) *p = 0; return RIG_OK; } + // non-bracketed IPV6 with optional link addr and optional port n = sscanf(hoststr, "%x::%x:%x:%x:%x%%%31[^:]:%5s", &net1, &net2, &net3, &net4, &net5, link, port); @@ -1475,6 +1480,17 @@ int HAMLIB_API parse_hoststr(char *hoststr, char host[256], char port[6]) return -1; } +int HAMLIB_API rig_flush(RIG *rig) +{ + if (rig->state.rigport.type.rig == RIG_PORT_NETWORK + || rig->state.rigport.type.rig == RIG_PORT_UDP_NETWORK) + { + network_flush(&rig->state.rigport); + return RIG_OK; + } + return serial_flush(&rig->state.rigport); +} + //! @endcond -/** @} */ + /** @} */ ----------------------------------------------------------------------- Summary of changes: include/hamlib/rig.h | 3 +++ src/misc.c | 22 +++++++++++++++++++--- 2 files changed, 22 insertions(+), 3 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2020-06-23 04:46: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 253a3d8643895a6ec45705007d9e7121b64850bc (commit) from e8bd6517af1893a3991ea2a7ad6a09f0eae4565f (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 253a3d8643895a6ec45705007d9e7121b64850bc Author: Michael Black W9MDB <mdb...@ya...> Date: Mon Jun 22 23:46:27 2020 -0500 Fix spelling error diff --git a/src/network.c b/src/network.c index b1e93167..7273606d 100644 --- a/src/network.c +++ b/src/network.c @@ -205,7 +205,7 @@ int network_open(hamlib_port_t *rp, int default_port) { status = inet_pton(AF_INET6, hoststr, &serveraddr); - if (status == 1) /* valide IPv6 address */ + if (status == 1) /* valid IPv6 address */ { hints.ai_family = AF_INET6; hints.ai_flags |= AI_NUMERICHOST; ----------------------------------------------------------------------- Summary of changes: src/network.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2020-06-23 04:44:26
|
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 e8bd6517af1893a3991ea2a7ad6a09f0eae4565f (commit) from 4ff31d008fd21f1768862a774dd1b93bdb2c56c3 (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 e8bd6517af1893a3991ea2a7ad6a09f0eae4565f Author: Michael Black W9MDB <mdb...@ya...> Date: Mon Jun 22 23:42:01 2020 -0500 Update rigctld.1 manpage with ip6 info and examples diff --git a/doc/man1/rigctld.1 b/doc/man1/rigctld.1 index 5ee440db..9007909d 100644 --- a/doc/man1/rigctld.1 +++ b/doc/man1/rigctld.1 @@ -208,6 +208,34 @@ Use as the listening IP address. .IP The default is ANY. +.IP +Can be run and connected to like this: +.IP +.nf +rigctld + rigctl -m 2 + rigctl -m 2 -r 127.0.0.1 + rigctl -m 2 -r localhost + rigctl -m 2 -r 192.168.1.1 (local IP address) + rigctl -m 2 -r ::1 (does not work on Linux as does not listen on IPV6 by default) +.BR +rigctld -T 127.0.0.1 + rigctl -m 2 + rigctl -m 2 -r 127.0.0.1 + Exceptions: + rigctl -m 2 -r localhost (only works if localhost is IPV4 address) +.BR +rigctld -T localhost (will set up on IPV4 or IPV6 based on localhost) + rigctl -m 2 + rigctl -m 2 -r localhost + rigctl -m 2 ip6-localhost + Exceptions: + rigctl -m 2 -r 127.0.0.1 (only works if localhost is IPV4 address) + rigctl -m 2 -r ::1 (only works localhost is IPV6 address) +.BR +On Linux only where ip6-localhost fe00::0 +rigctld -T ip6-localhost + rigctl -m 2 -r ip6-localhost . .TP .BR \-t ", " \-\-port = \fInumber\fP ----------------------------------------------------------------------- Summary of changes: doc/man1/rigctld.1 | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2020-06-23 04:16:48
|
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 4ff31d008fd21f1768862a774dd1b93bdb2c56c3 (commit) from b380ed5dbf24da3333f9bbdd46a21903d00b4eab (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 4ff31d008fd21f1768862a774dd1b93bdb2c56c3 Author: Michael Black W9MDB <mdb...@ya...> Date: Mon Jun 22 23:16:02 2020 -0500 Fix rigctl -o with rigctld https://github.com/Hamlib/Hamlib/issues/287 diff --git a/src/rig.c b/src/rig.c index 8ff9ca2a..257a3205 100644 --- a/src/rig.c +++ b/src/rig.c @@ -1459,10 +1459,10 @@ int HAMLIB_API rig_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) // If we're in vfo_mode then rigctld will do any VFO swapping we need if ((caps->targetable_vfo & RIG_TARGETABLE_FREQ) || vfo == RIG_VFO_CURR || vfo == rig->state.current_vfo - || rig->state.vfo_opt == 1) - { - // If rig does not have set_vfo we need to change vfo - if (vfo == RIG_VFO_CURR && caps->set_vfo == NULL) + || (rig->state.vfo_opt == 1 && rig->caps->rig_model == RIG_MODEL_NETRIGCTL)) +{ + // If rig does not have set_vfo we need to change vfo + if (vfo == RIG_VFO_CURR && caps->set_vfo == NULL) { vfo = vfo_fixup(rig, RIG_VFO_A); rig_debug(RIG_DEBUG_TRACE, "%s: no set_vfo so vfo=%s\n", __func__, @@ -1540,29 +1540,29 @@ int HAMLIB_API rig_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) /* VFO compensation */ if (rig->state.vfo_comp != 0.0) - { - *freq = (freq_t)(*freq / (1.0 + (double)rig->state.vfo_comp)); +{ + *freq = (freq_t)(*freq / (1.0 + (double)rig->state.vfo_comp)); } if (retcode == RIG_OK && (vfo == RIG_VFO_CURR || vfo == rig->state.current_vfo)) - { - rig->state.current_freq = *freq; - } +{ + rig->state.current_freq = *freq; +} - if (rig->state.lo_freq != 0.0) - { - *freq += rig->state.lo_freq; - } +if (rig->state.lo_freq != 0.0) +{ + *freq += rig->state.lo_freq; +} - cache_ms = elapsed_ms(&(rig->state.cache.time_freq), ELAPSED_SET); - rig_debug(RIG_DEBUG_TRACE, "%s: cache reset age=%dms, vfo=%s, freq=%.0f\n", - __func__, cache_ms, rig_strvfo(vfo), *freq); - rig->state.cache.freq = *freq; - rig->state.cache.vfo_freq = vfo; +cache_ms = elapsed_ms(&(rig->state.cache.time_freq), ELAPSED_SET); + rig_debug(RIG_DEBUG_TRACE, "%s: cache reset age=%dms, vfo=%s, freq=%.0f\n", + __func__, cache_ms, rig_strvfo(vfo), *freq); + rig->state.cache.freq = *freq; + rig->state.cache.vfo_freq = vfo; - return retcode; + return retcode; } ----------------------------------------------------------------------- Summary of changes: src/rig.c | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2020-06-23 03:24: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, master has been updated via b380ed5dbf24da3333f9bbdd46a21903d00b4eab (commit) via ebb91ff181729d76a93e8990bdf3ec62b69fe7c0 (commit) from 10fce9f4b50a702fe622551429675522c94c812d (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 b380ed5dbf24da3333f9bbdd46a21903d00b4eab Author: Michael Black W9MDB <mdb...@ya...> Date: Mon Jun 22 22:24:23 2020 -0500 Add restore VFOB freq after A/B copy in set_split for ft1000mp.c diff --git a/rigs/yaesu/ft1000mp.c b/rigs/yaesu/ft1000mp.c index 0e6e5960..8c7ae3dc 100644 --- a/rigs/yaesu/ft1000mp.c +++ b/rigs/yaesu/ft1000mp.c @@ -1528,6 +1528,7 @@ int ft1000mp_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo) // FT1000 transmits on A and receives on B unsigned char cmd_index = 0; /* index of sequence to send */ + freq_t tx_freq; rig_debug(RIG_DEBUG_TRACE, "%s called rx_vfo=%s, tx_vfo=%s\n", __func__, rig_strvfo(vfo), rig_strvfo(tx_vfo)); @@ -1547,12 +1548,14 @@ int ft1000mp_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo) return -RIG_EINVAL; /* sorry, wrong VFO */ } + rig_get_freq(rig,RIG_VFO_B,&tx_freq); // manual says VFO_A=Tx and VFO_B=Rx but testing shows otherwise rig->state.current_vfo = RIG_VFO_A; rig->state.tx_vfo = RIG_VFO_B; ft1000mp_send_priv_cmd(rig, FT1000MP_NATIVE_AB); // Copy A to B ft1000mp_send_priv_cmd(rig, FT1000MP_NATIVE_VFO_A); // make A active ft1000mp_send_priv_cmd(rig, cmd_index); + rig_set_freq(rig,RIG_VFO_B,tx_freq); // restore orig frequency return RIG_OK; } commit ebb91ff181729d76a93e8990bdf3ec62b69fe7c0 Author: Michael Black W9MDB <mdb...@ya...> Date: Mon Jun 22 17:12:31 2020 -0500 Add copy VFOA>VFOB to ft1000mp.c diff --git a/rigs/yaesu/ft1000mp.c b/rigs/yaesu/ft1000mp.c index a3c35403..0e6e5960 100644 --- a/rigs/yaesu/ft1000mp.c +++ b/rigs/yaesu/ft1000mp.c @@ -123,6 +123,7 @@ static const yaesu_cmd_set_t ncmd[] = /* { 1, { 0x00, 0x00, 0x00, 0x00, 0x81 } }, */ /* tuner off */ /* { 1, { 0x00, 0x00, 0x00, 0x01, 0x81 } }, */ /* tuner on */ /* { 1, { 0x00, 0x00, 0x00, 0x00, 0x82 } }, */ /* tuner start*/ + { 1, { 0x00, 0x00, 0x00, 0x00, 0x85 } }, /* A>B */ }; @@ -215,7 +216,7 @@ const struct rig_caps ft1000mp_caps = RIG_MODEL(RIG_MODEL_FT1000MP), .model_name = "FT-1000MP", .mfg_name = "Yaesu", - .version = "20200621.0", + .version = "20200622.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -346,7 +347,7 @@ const struct rig_caps ft1000mpmkv_caps = RIG_MODEL(RIG_MODEL_FT1000MPMKV), .model_name = "MARK-V FT-1000MP", .mfg_name = "Yaesu", - .version = "20200619.0", + .version = "202006ww.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -477,7 +478,7 @@ const struct rig_caps ft1000mpmkvfld_caps = RIG_MODEL(RIG_MODEL_FT1000MPMKVFLD), .model_name = "MARK-V Field FT-1000MP", .mfg_name = "Yaesu", - .version = "20200619.0", + .version = "20200622.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -1549,7 +1550,8 @@ int ft1000mp_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo) // manual says VFO_A=Tx and VFO_B=Rx but testing shows otherwise rig->state.current_vfo = RIG_VFO_A; rig->state.tx_vfo = RIG_VFO_B; - ft1000mp_send_priv_cmd(rig, FT1000MP_NATIVE_VFO_A); // make B active + ft1000mp_send_priv_cmd(rig, FT1000MP_NATIVE_AB); // Copy A to B + ft1000mp_send_priv_cmd(rig, FT1000MP_NATIVE_VFO_A); // make A active ft1000mp_send_priv_cmd(rig, cmd_index); return RIG_OK; diff --git a/rigs/yaesu/ft1000mp.h b/rigs/yaesu/ft1000mp.h index 3f51d42a..04757f87 100644 --- a/rigs/yaesu/ft1000mp.h +++ b/rigs/yaesu/ft1000mp.h @@ -98,6 +98,7 @@ enum ft1000mp_native_cmd_e { FT1000MP_NATIVE_VFO_UPDATE, FT1000MP_NATIVE_CURR_VFO_UPDATE, FT1000MP_NATIVE_UPDATE, + FT1000MP_NATIVE_AB, FT1000MP_NATIVE_SIZE /* end marker, value indicates number of */ /* native cmd entries */ ----------------------------------------------------------------------- Summary of changes: rigs/yaesu/ft1000mp.c | 13 +++++++++---- rigs/yaesu/ft1000mp.h | 1 + 2 files changed, 10 insertions(+), 4 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2020-06-22 14:53:16
|
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 10fce9f4b50a702fe622551429675522c94c812d (commit) via ac1f99047435253fa736ba7796f8a26551f60dce (commit) from 19d55c4188d24adf2d4962f24a1d3a703ad0ea67 (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 10fce9f4b50a702fe622551429675522c94c812d Merge: ac1f9904 19d55c41 Author: Michael Black W9MDB <mdb...@ya...> Date: Mon Jun 22 09:52:56 2020 -0500 Merge branch 'master' of https://github.com/Hamlib/Hamlib commit ac1f99047435253fa736ba7796f8a26551f60dce Author: Michael Black W9MDB <mdb...@ya...> Date: Mon Jun 22 09:46:15 2020 -0500 Remove AI_CANONNAME from rigctld.c Didn't work with simple "rigctld" and no -T https://github.com/Hamlib/Hamlib/issues/298 diff --git a/tests/rigctld.c b/tests/rigctld.c index f6a6d0cb..cc00e516 100644 --- a/tests/rigctld.c +++ b/tests/rigctld.c @@ -685,7 +685,7 @@ int main(int argc, char *argv[]) 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 | AI_CANONNAME; /* For wildcard IP address */ + hints.ai_flags = AI_PASSIVE; /* For wildcard IP address */ hints.ai_protocol = 0; /* Any protocol */ retcode = getaddrinfo(src_addr, portno, &hints, &result); ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2020-06-22 14:51:22
|
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 19d55c4188d24adf2d4962f24a1d3a703ad0ea67 (commit) via fd1e72f009abfdc74bcf773e57cd5c9fa8b57a42 (commit) via f7f9653b97926b6dc6bfc55d5031e7630bd26b9e (commit) via a88faf29c78b6994d4e27a4e228d7b8ead783432 (commit) via 0f97f33877de57ac524ec93b4c7f9ce00af92d35 (commit) via d27d84c44b337e908ab2bb9eac00100c4d3ad061 (commit) via bc77820fe22769ef98f28f4cc75aacbf2a44a4eb (commit) via 57622bdb9ea1419f817d6cbe8d7480c050b4d856 (commit) from c4a11e90c8a0e5cf4261e41f19fba3a413ac9518 (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 19d55c4188d24adf2d4962f24a1d3a703ad0ea67 Author: Michael Black W9MDB <mdb...@ya...> Date: Mon Jun 22 09:46:15 2020 -0500 Remove AI_CANONNAME from rigctld.c diff --git a/tests/rigctld.c b/tests/rigctld.c index f6a6d0cb..cc00e516 100644 --- a/tests/rigctld.c +++ b/tests/rigctld.c @@ -685,7 +685,7 @@ int main(int argc, char *argv[]) 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 | AI_CANONNAME; /* For wildcard IP address */ + hints.ai_flags = AI_PASSIVE; /* For wildcard IP address */ hints.ai_protocol = 0; /* Any protocol */ retcode = getaddrinfo(src_addr, portno, &hints, &result); commit fd1e72f009abfdc74bcf773e57cd5c9fa8b57a42 Author: Michael Black W9MDB <mdb...@ya...> Date: Mon Jun 22 07:48:09 2020 -0500 Fix com port device opening https://github.com/Hamlib/Hamlib/issues/298 diff --git a/src/misc.c b/src/misc.c index 874e36a8..33d54755 100644 --- a/src/misc.c +++ b/src/misc.c @@ -1386,7 +1386,7 @@ int HAMLIB_API parse_hoststr(char *hoststr, char host[256], char port[6]) // Handle device names 1st if (strstr(hoststr, "/dev")) return -1; - if (strncasecmp(hoststr, "com", 3)) return -1; + if (strncasecmp(hoststr, "com", 3)==0) return -1; // bracketed IPV6 with optional port int n = sscanf(hoststr, "[%255[^]]]:%5s", host, port); commit f7f9653b97926b6dc6bfc55d5031e7630bd26b9e Author: Michael Black W9MDB <mdb...@ya...> Date: Mon Jun 22 07:10:43 2020 -0500 Fix rig_open with device names diff --git a/src/misc.c b/src/misc.c index 8c773c46..874e36a8 100644 --- a/src/misc.c +++ b/src/misc.c @@ -1384,6 +1384,10 @@ int HAMLIB_API parse_hoststr(char *hoststr, char host[256], char port[6]) port[0] = 0; dummy[0] = 0; + // Handle device names 1st + if (strstr(hoststr, "/dev")) return -1; + if (strncasecmp(hoststr, "com", 3)) return -1; + // bracketed IPV6 with optional port int n = sscanf(hoststr, "[%255[^]]]:%5s", host, port); @@ -1393,7 +1397,7 @@ int HAMLIB_API parse_hoststr(char *hoststr, char host[256], char port[6]) } // non-bracketed full IPV6 with optional link addr - n = sscanf(hoststr, "%x:%x:%x:%x:%x:%x:%x:%x:%%%31[^:]:%5s", &net1, &net2, &net3, + n = sscanf(hoststr, "%x:%x:%x:%x:%x:%x:%x:%x%%%31[^:]:%5s", &net1, &net2, &net3, &net4, &net5, &net6, &net7, &net8, link, port); if (n == 8 || n == 9) { @@ -1407,8 +1411,8 @@ int HAMLIB_API parse_hoststr(char *hoststr, char host[256], char port[6]) *p = 0; return RIG_OK; } - // non-bracketed IPV6 with optional link addr - n = sscanf(hoststr, "%x::%x:%x:%x:%x:%%%31[^:]:%5s", &net1, &net2, &net3, + // non-bracketed IPV6 with optional link addr and optional port + n = sscanf(hoststr, "%x::%x:%x:%x:%x%%%31[^:]:%5s", &net1, &net2, &net3, &net4, &net5, link, port); if (strchr(hoststr, '%') && (n == 5 || n == 6)) commit a88faf29c78b6994d4e27a4e228d7b8ead783432 Author: Michael Black W9MDB <mdb...@ya...> Date: Mon Jun 22 00:00:33 2020 -0500 Fix IPV6 addresses with link local https://github.com/Hamlib/Hamlib/issues/298 diff --git a/src/network.c b/src/network.c index 7a2e6ac0..b1e93167 100644 --- a/src/network.c +++ b/src/network.c @@ -63,6 +63,7 @@ #elif HAVE_WS2TCPIP_H #undef _WIN32_WINNT // We need inet_pton to get defined and 0x0600 does it +// Eventually we should be able to get rid of this hack #define _WIN32_WINNT 0x0600 # include <ws2tcpip.h> #undef _WIN32_WINNT commit 0f97f33877de57ac524ec93b4c7f9ce00af92d35 Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Jun 21 23:51:02 2020 -0500 Had to mess with _WIN32_WINNT to get inet_pton defined So we change it to 0x0600 and then back to 0x0502 https://github.com/Hamlib/Hamlib/issues/298 diff --git a/src/network.c b/src/network.c index 0d1e1a54..7a2e6ac0 100644 --- a/src/network.c +++ b/src/network.c @@ -61,7 +61,13 @@ # include <sys/socket.h> # include <sys/ioctl.h> #elif HAVE_WS2TCPIP_H +#undef _WIN32_WINNT +// We need inet_pton to get defined and 0x0600 does it +#define _WIN32_WINNT 0x0600 # include <ws2tcpip.h> +#undef _WIN32_WINNT +// Then we'll go back to Server 2003 +#define _WIN32_WINNT 0x0502 # if defined(HAVE_WSPIAPI_H) # include <wspiapi.h> # endif commit d27d84c44b337e908ab2bb9eac00100c4d3ad061 Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Jun 21 23:23:55 2020 -0500 Change AI_NUMERICSERV to NI_NUMERICSERV for Windows compatibility diff --git a/src/network.c b/src/network.c index efe3952c..0d1e1a54 100644 --- a/src/network.c +++ b/src/network.c @@ -152,7 +152,7 @@ int network_open(hamlib_port_t *rp, int default_port) } memset(&hints, 0, sizeof(hints)); - hints.ai_flags = AI_NUMERICSERV; + hints.ai_flags = NI_NUMERICSERV; hints.ai_family = AF_UNSPEC; if (rp->type.rig == RIG_PORT_UDP_NETWORK) commit bc77820fe22769ef98f28f4cc75aacbf2a44a4eb Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Jun 21 23:16:05 2020 -0500 Add parsing for full 8 byte IPV6 address https://github.com/Hamlib/Hamlib/issues/298 diff --git a/src/misc.c b/src/misc.c index 21bca2e5..8c773c46 100644 --- a/src/misc.c +++ b/src/misc.c @@ -1378,7 +1378,7 @@ vfo_t HAMLIB_API vfo_fixup(RIG *rig, vfo_t vfo) int HAMLIB_API parse_hoststr(char *hoststr, char host[256], char port[6]) { - unsigned int net1, net2, net3, net4, net5; + unsigned int net1, net2, net3, net4, net5, net6, net7, net8; char dummy[2], link[32], *p; host[0] = 0; port[0] = 0; @@ -1392,6 +1392,21 @@ int HAMLIB_API parse_hoststr(char *hoststr, char host[256], char port[6]) return RIG_OK; } + // non-bracketed full IPV6 with optional link addr + n = sscanf(hoststr, "%x:%x:%x:%x:%x:%x:%x:%x:%%%31[^:]:%5s", &net1, &net2, &net3, + &net4, &net5, &net6, &net7, &net8, link, port); + if (n == 8 || n == 9) + { + strcpy(host, hoststr); + return RIG_OK; + } + else if (n == 10) + { + strcpy(host, hoststr); + p = strrchr(host, ':'); // remove port from host + *p = 0; + return RIG_OK; + } // non-bracketed IPV6 with optional link addr n = sscanf(hoststr, "%x::%x:%x:%x:%x:%%%31[^:]:%5s", &net1, &net2, &net3, &net4, &net5, link, port); commit 57622bdb9ea1419f817d6cbe8d7480c050b4d856 Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Jun 21 23:09:40 2020 -0500 Added set_split_freq get_split_freq defs to ft1000mp.h https://github.com/Hamlib/Hamlib/issues/308 diff --git a/rigs/yaesu/ft1000mp.h b/rigs/yaesu/ft1000mp.h index fe2fbdc4..3f51d42a 100644 --- a/rigs/yaesu/ft1000mp.h +++ b/rigs/yaesu/ft1000mp.h @@ -202,6 +202,8 @@ int ft1000mp_close(RIG *rig); int ft1000mp_set_freq(RIG *rig, vfo_t vfo, freq_t freq); int ft1000mp_get_freq(RIG *rig, vfo_t vfo, freq_t *freq); +int ft1000mp_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq); +int ft1000mp_get_split_freq(RIG *rig, vfo_t vfo, freq_t *tx_freq); int ft1000mp_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo); int ft1000mp_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo); ----------------------------------------------------------------------- Summary of changes: rigs/yaesu/ft1000mp.h | 2 ++ src/misc.c | 25 ++++++++++++++++++++++--- src/network.c | 9 ++++++++- tests/rigctld.c | 2 +- 4 files changed, 33 insertions(+), 5 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2020-06-22 03:52:46
|
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 c4a11e90c8a0e5cf4261e41f19fba3a413ac9518 (commit) from a3c4eb9ee0e966a1bce194abe2fdb282bce2ef91 (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 c4a11e90c8a0e5cf4261e41f19fba3a413ac9518 Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Jun 21 22:48:40 2020 -0500 Add set_split_freq and get_split_freq to ft1000mp.c Change split setup as testing shows the manual is wrong. Manual says VFO_A=Tx and VFO_B=Rx but that's not the behavior seen https://github.com/Hamlib/Hamlib/issues/308 diff --git a/rigs/yaesu/ft1000mp.c b/rigs/yaesu/ft1000mp.c index 9b609651..a3c35403 100644 --- a/rigs/yaesu/ft1000mp.c +++ b/rigs/yaesu/ft1000mp.c @@ -215,7 +215,7 @@ const struct rig_caps ft1000mp_caps = RIG_MODEL(RIG_MODEL_FT1000MP), .model_name = "FT-1000MP", .mfg_name = "Yaesu", - .version = "20200620.0", + .version = "20200621.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -325,6 +325,8 @@ const struct rig_caps ft1000mp_caps = .set_vfo = ft1000mp_set_vfo, /* set vfo */ .get_vfo = ft1000mp_get_vfo, /* get vfo */ + .set_split_freq = ft1000mp_set_split_freq, + .get_split_freq = ft1000mp_get_split_freq, .set_split_vfo = ft1000mp_set_split_vfo, .get_split_vfo = ft1000mp_get_split_vfo, @@ -454,6 +456,8 @@ const struct rig_caps ft1000mpmkv_caps = .set_vfo = ft1000mp_set_vfo, /* set vfo */ .get_vfo = ft1000mp_get_vfo, /* get vfo */ + .set_split_freq = ft1000mp_set_split_freq, + .get_split_freq = ft1000mp_get_split_freq, .set_split_vfo = ft1000mp_set_split_vfo, .get_split_vfo = ft1000mp_get_split_vfo, @@ -583,6 +587,8 @@ const struct rig_caps ft1000mpmkvfld_caps = .set_vfo = ft1000mp_set_vfo, /* set vfo */ .get_vfo = ft1000mp_get_vfo, /* get vfo */ + .set_split_freq = ft1000mp_set_split_freq, + .get_split_freq = ft1000mp_get_split_freq, .set_split_vfo = ft1000mp_set_split_vfo, .get_split_vfo = ft1000mp_get_split_vfo, @@ -1540,9 +1546,10 @@ int ft1000mp_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo) return -RIG_EINVAL; /* sorry, wrong VFO */ } - rig->state.current_vfo = RIG_VFO_B; // Rx on VFO_B - rig->state.tx_vfo = RIG_VFO_A; - ft1000mp_send_priv_cmd(rig, FT1000MP_NATIVE_VFO_B); // make B active + // manual says VFO_A=Tx and VFO_B=Rx but testing shows otherwise + rig->state.current_vfo = RIG_VFO_A; + rig->state.tx_vfo = RIG_VFO_B; + ft1000mp_send_priv_cmd(rig, FT1000MP_NATIVE_VFO_A); // make B active ft1000mp_send_priv_cmd(rig, cmd_index); return RIG_OK; @@ -1585,3 +1592,13 @@ int ft1000mp_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo) return RIG_OK; } + +int ft1000mp_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq) +{ + return ft1000mp_set_freq(rig, RIG_VFO_B, tx_freq); +} + +int ft1000mp_get_split_freq(RIG *rig, vfo_t vfo, freq_t *tx_freq) +{ + return ft1000mp_get_freq(rig, RIG_VFO_B, tx_freq); +} ----------------------------------------------------------------------- Summary of changes: rigs/yaesu/ft1000mp.c | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2020-06-22 03: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 a3c4eb9ee0e966a1bce194abe2fdb282bce2ef91 (commit) via e092a4a0a4d04743001ded926804a1bd76dd98cf (commit) from 379caace7cce869ab919919db26e72a4c3e76d83 (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 a3c4eb9ee0e966a1bce194abe2fdb282bce2ef91 Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Jun 21 22:31:31 2020 -0500 Fix cppcheck warnings diff --git a/rigs/alinco/dxsr8.c b/rigs/alinco/dxsr8.c index 3ac50134..86eae83e 100644 --- a/rigs/alinco/dxsr8.c +++ b/rigs/alinco/dxsr8.c @@ -346,6 +346,7 @@ int dxsr8_set_freq(RIG *rig, vfo_t vfo, freq_t freq) return -RIG_EINVAL; } + // cppcheck-suppress * cmd_len = sprintf(cmd, AL "~RW_RXF%08"PRIll EOM, (int64_t)freq); return dxsr8_transaction(rig, cmd, cmd_len, NULL, NULL); } @@ -769,4 +770,4 @@ int dxsr8_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) cmd_len = sprintf(cmd, AL "~RW_PTT%02d" EOM, ptt); return dxsr8_transaction(rig, cmd, cmd_len, NULL, NULL); -} \ No newline at end of file +} diff --git a/src/misc.c b/src/misc.c index f177f783..21bca2e5 100644 --- a/src/misc.c +++ b/src/misc.c @@ -1385,7 +1385,7 @@ int HAMLIB_API parse_hoststr(char *hoststr, char host[256], char port[6]) dummy[0] = 0; // bracketed IPV6 with optional port - int n = sscanf(hoststr, "[%255[^]]]:%s", host, port); + int n = sscanf(hoststr, "[%255[^]]]:%5s", host, port); if (n >= 1) { @@ -1393,7 +1393,7 @@ int HAMLIB_API parse_hoststr(char *hoststr, char host[256], char port[6]) } // non-bracketed IPV6 with optional link addr - n = sscanf(hoststr, "%x::%x:%x:%x:%x:%%%31[^:]:%s", &net1, &net2, &net3, + n = sscanf(hoststr, "%x::%x:%x:%x:%x:%%%31[^:]:%5s", &net1, &net2, &net3, &net4, &net5, link, port); if (strchr(hoststr, '%') && (n == 5 || n == 6)) @@ -1433,7 +1433,7 @@ int HAMLIB_API parse_hoststr(char *hoststr, char host[256], char port[6]) // bracketed localhost if (strstr(hoststr, "::1")) { - n = sscanf(hoststr, "::1%s", dummy); + n = sscanf(hoststr, "::1%5s", dummy); strcpy(host, hoststr); if (n == 1) diff --git a/src/network.c b/src/network.c index b4ed224c..efe3952c 100644 --- a/src/network.c +++ b/src/network.c @@ -130,7 +130,7 @@ int network_open(hamlib_port_t *rp, int default_port) int status; struct addrinfo hints, *res, *saved_res; struct in6_addr serveraddr; - char hoststr[256], portstr[6]; + char hoststr[256], portstr[6] = ""; rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); rig_debug(RIG_DEBUG_VERBOSE, "%s version 1.0\n", __func__); diff --git a/src/rig.c b/src/rig.c index e5ab5ee8..8ff9ca2a 100644 --- a/src/rig.c +++ b/src/rig.c @@ -558,7 +558,6 @@ int HAMLIB_API rig_open(RIG *rig) value_t parm_value; //unsigned int net1, net2, net3, net4, net5, net6, net7, net8, port; int is_network = 0; - char hoststr[256], portstr[6]; rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); @@ -572,6 +571,7 @@ int HAMLIB_API rig_open(RIG *rig) if (strlen(rs->rigport.pathname) > 0) { + char hoststr[256], portstr[6]; status = parse_hoststr(rs->rigport.pathname, hoststr, portstr); if (status == RIG_OK) { is_network = 1; } @@ -2911,14 +2911,14 @@ int HAMLIB_API rig_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq) int retcode, rc2; vfo_t curr_vfo, tx_vfo; - rig_debug(RIG_DEBUG_VERBOSE, "%s called vfo=%s, curr_vfo=%s\n", __func__, - rig_strvfo(vfo), rig_strvfo(rig->state.current_vfo)); - if (CHECK_RIG_ARG(rig)) { return -RIG_EINVAL; } + rig_debug(RIG_DEBUG_VERBOSE, "%s called vfo=%s, curr_vfo=%s\n", __func__, + rig_strvfo(vfo), rig_strvfo(rig->state.current_vfo)); + caps = rig->caps; if (caps->set_split_freq diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c index d89985aa..3c9befc9 100644 --- a/tests/rigctl_parse.c +++ b/tests/rigctl_parse.c @@ -1957,6 +1957,7 @@ declare_proto_rig(get_freq) { int status; freq_t freq; + // cppcheck-suppress * char *fmt = "%"PRIll"%c"; status = rig_get_freq(rig, vfo, &freq); diff --git a/tests/rigctlcom.c b/tests/rigctlcom.c index a2b63ec8..e3f3f9f3 100644 --- a/tests/rigctlcom.c +++ b/tests/rigctlcom.c @@ -737,8 +737,8 @@ static int handle_ts2000(void *arg) int p15 = 0; // P15 Shift status dummy value for now int retval = rig_get_freq(my_rig, RIG_VFO_A, &freq); char response[64]; - // cppcheck-suppress * char *fmt = + // cppcheck-suppress * "IF%011"PRIll"%04d+%05d%1d%1d%1d%02d%1d%1"PRIll"%1d%1d%1d%1d%02d%1d;"; if (retval != RIG_OK) diff --git a/tests/rigctld.c b/tests/rigctld.c index 144f6ad6..f6a6d0cb 100644 --- a/tests/rigctld.c +++ b/tests/rigctld.c @@ -685,8 +685,7 @@ int main(int argc, char *argv[]) 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_flags = AI_CANONNAME; + hints.ai_flags = AI_PASSIVE | AI_CANONNAME; /* For wildcard IP address */ hints.ai_protocol = 0; /* Any protocol */ retcode = getaddrinfo(src_addr, portno, &hints, &result); commit e092a4a0a4d04743001ded926804a1bd76dd98cf Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Jun 21 17:47:04 2020 -0500 rigctld -T ::1 now works with rigctl -r ::1 More IPV6 testing needed on Windows and MacOS Still not binding to link local addresses to be addressed next https://github.com/Hamlib/Hamlib/issues/29 diff --git a/src/misc.c b/src/misc.c index c2db7804..f177f783 100644 --- a/src/misc.c +++ b/src/misc.c @@ -1376,6 +1376,85 @@ vfo_t HAMLIB_API vfo_fixup(RIG *rig, vfo_t vfo) return vfo; } +int HAMLIB_API parse_hoststr(char *hoststr, char host[256], char port[6]) +{ + unsigned int net1, net2, net3, net4, net5; + char dummy[2], link[32], *p; + host[0] = 0; + port[0] = 0; + dummy[0] = 0; + + // bracketed IPV6 with optional port + int n = sscanf(hoststr, "[%255[^]]]:%s", host, port); + + if (n >= 1) + { + return RIG_OK; + } + + // non-bracketed IPV6 with optional link addr + n = sscanf(hoststr, "%x::%x:%x:%x:%x:%%%31[^:]:%s", &net1, &net2, &net3, + &net4, &net5, link, port); + + if (strchr(hoststr, '%') && (n == 5 || n == 6)) + { + strcpy(host, hoststr); + return RIG_OK; + } + else if (n == 7) + { + strcpy(host, hoststr); + p = strrchr(host, ':'); // remove port from host + *p = 0; + return RIG_OK; + } + + // non-bracketed IPV6 short form with optional port + n = sscanf(hoststr, "%x::%x:%x:%x:%x:%5[0-9]%1s", &net1, &net2, &net3, &net4, + &net5, port, dummy); + + if (n == 5) + { + strcpy(host, hoststr); + return RIG_OK; + } + else if (n == 6) + { + strcpy(host, hoststr); + p = strrchr(host, ':'); + *p = 0; + return RIG_OK; + } + else if (n == 7) + { + return -RIG_EINVAL; + } + + // bracketed localhost + if (strstr(hoststr, "::1")) + { + n = sscanf(hoststr, "::1%s", dummy); + strcpy(host, hoststr); + + if (n == 1) + { + p = strrchr(host, ':'); + *p = 0; + strcpy(port, p + 1); + } + + return RIG_OK; + } + + // if we're here then we must have a hostname + n = sscanf(hoststr, "%255[^:]:%5[0-9]%1s", host, port, dummy); + + if (n >= 1 && strlen(dummy) == 0) { return RIG_OK; } + + printf("Unhandled host=%s\n", hoststr); + + return -1; +} //! @endcond diff --git a/src/misc.h b/src/misc.h index 382b949d..75b09fd0 100644 --- a/src/misc.h +++ b/src/misc.h @@ -106,6 +106,8 @@ extern HAMLIB_EXPORT(double) elapsed_ms(struct timespec *start, int start_flag); extern HAMLIB_EXPORT(vfo_t) vfo_fixup(RIG *rig, vfo_t vfo); +extern HAMLIB_EXPORT(int) parse_hoststr(char *host, char hoststr[256], char port[6]); + #ifdef PRId64 /** \brief printf(3) format to be used for long long (64bits) type */ # define PRIll PRId64 diff --git a/src/network.c b/src/network.c index 36c1739e..b4ed224c 100644 --- a/src/network.c +++ b/src/network.c @@ -114,7 +114,6 @@ static void handle_error(enum rig_debug_level_e lvl, const char *msg) #endif } - /** * \brief Open network port using rig.state data * @@ -130,9 +129,8 @@ int network_open(hamlib_port_t *rp, int default_port) int fd; /* File descriptor for the port */ int status; struct addrinfo hints, *res, *saved_res; - char *hoststr = NULL, *portstr = NULL, *bracketstr1, *bracketstr2; - char hostname[FILPATHLEN]; - char defaultportstr[8]; + struct in6_addr serveraddr; + char hoststr[256], portstr[6]; rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); rig_debug(RIG_DEBUG_VERBOSE, "%s version 1.0\n", __func__); @@ -154,7 +152,8 @@ int network_open(hamlib_port_t *rp, int default_port) } memset(&hints, 0, sizeof(hints)); - hints.ai_family = PF_UNSPEC; + hints.ai_flags = AI_NUMERICSERV; + hints.ai_family = AF_UNSPEC; if (rp->type.rig == RIG_PORT_UDP_NETWORK) { @@ -165,53 +164,55 @@ int network_open(hamlib_port_t *rp, int default_port) hints.ai_socktype = SOCK_STREAM; } - /* default of all local interfaces */ - hoststr = NULL; - - if (rp->pathname[0] == ':') + if (rp->pathname[0] == ':' && rp->pathname[1] != ':') { - portstr = rp->pathname + 1; + snprintf(portstr, sizeof(portstr) - 1, "%s", rp->pathname + 1); } else { if (strlen(rp->pathname)) { - snprintf(hostname, sizeof(hostname), "%s", rp->pathname); - hoststr = hostname; - /* look for IPv6 numeric form [<addr>] */ - bracketstr1 = strchr(hoststr, '['); - bracketstr2 = strrchr(hoststr, ']'); + status = parse_hoststr(rp->pathname, hoststr, portstr); - if (bracketstr1 && bracketstr2 && bracketstr2 > bracketstr1) - { - hoststr = bracketstr1 + 1; - *bracketstr2 = '\0'; - portstr = bracketstr2 + 1; /* possible port after ]: */ - } - else - { - bracketstr2 = NULL; - portstr = hoststr; /* possible port after : */ - } + if (status != RIG_OK) { return status; } - /* search last ':' */ - portstr = strrchr(portstr, ':'); + rig_debug(RIG_DEBUG_ERR, "%s: hoststr=%s, portstr=%s\n", __func__, hoststr, + portstr); - if (portstr) - { - *portstr++ = '\0'; - } } - if (!portstr) + if (strlen(portstr) == 0) { - sprintf(defaultportstr, "%d", default_port); - portstr = defaultportstr; + sprintf(portstr, "%d", default_port); + } + } + + status = inet_pton(AF_INET, hoststr, &serveraddr); + + if (status == 1) /* valid IPv4 address */ + { + hints.ai_family = AF_INET; + hints.ai_flags |= AI_NUMERICHOST; + } + else + { + status = inet_pton(AF_INET6, hoststr, &serveraddr); + + if (status == 1) /* valide IPv6 address */ + { + hints.ai_family = AF_INET6; + hints.ai_flags |= AI_NUMERICHOST; } } status = getaddrinfo(hoststr, portstr, &hints, &res); + if (status == 0 && res->ai_family == AF_INET6) + { + rig_debug(RIG_DEBUG_ERR, "%s: Using IPV6\n", __func__); + //inet_pton(AF_INET6, hoststr, &h_addr.sin6_addr); + } + if (status != 0) { rig_debug(RIG_DEBUG_ERR, diff --git a/src/rig.c b/src/rig.c index 67af05e6..e5ab5ee8 100644 --- a/src/rig.c +++ b/src/rig.c @@ -556,9 +556,9 @@ int HAMLIB_API rig_open(RIG *rig) struct rig_state *rs; int status = RIG_OK; value_t parm_value; - unsigned int net1, net2, net3, net4, net5, net6, net7, net8, port; + //unsigned int net1, net2, net3, net4, net5, net6, net7, net8, port; int is_network = 0; - char *token, *strtokp; + char hoststr[256], portstr[6]; rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); @@ -570,6 +570,14 @@ int HAMLIB_API rig_open(RIG *rig) caps = rig->caps; rs = &rig->state; + if (strlen(rs->rigport.pathname) > 0) + { + status = parse_hoststr(rs->rigport.pathname, hoststr, portstr); + + if (status == RIG_OK) { is_network = 1; } + } + +#if 0 // determine if we have a network address // is_network |= sscanf(rs->rigport.pathname, "%u.%u.%u.%u:%u", &net1, &net2, @@ -594,6 +602,8 @@ int HAMLIB_API rig_open(RIG *rig) } } +#endif + if (is_network) { rig_debug(RIG_DEBUG_TRACE, "%s: using network address %s\n", __func__, @@ -3054,9 +3064,11 @@ int HAMLIB_API rig_get_split_freq(RIG *rig, vfo_t vfo, freq_t *tx_freq) if (!rig_has_vfo_op(rig, RIG_OP_XCHG)) { retcode = caps->set_vfo(rig, tx_vfo); - if (retcode != RIG_OK) return retcode; + + if (retcode != RIG_OK) { return retcode; } } - retcode = RIG_OK; + + retcode = RIG_OK; } else if (rig_has_vfo_op(rig, RIG_OP_TOGGLE) && caps->vfo_op) { @@ -3084,11 +3096,14 @@ int HAMLIB_API rig_get_split_freq(RIG *rig, vfo_t vfo, freq_t *tx_freq) /* try and revert even if we had an error above */ if (caps->set_vfo) { - // If we started with RIG_VFO_CURR we need to choose VFO_A/MAIN as appropriate to return to - if (save_vfo == RIG_VFO_CURR) { - save_vfo = VFO_HAS_A_B_ONLY?RIG_VFO_A:RIG_VFO_MAIN; - } - rig_debug(RIG_DEBUG_TRACE,"%s: retoring vfo=%s\n", __func__, rig_strvfo(save_vfo)); + // If we started with RIG_VFO_CURR we need to choose VFO_A/MAIN as appropriate to return to + if (save_vfo == RIG_VFO_CURR) + { + save_vfo = VFO_HAS_A_B_ONLY ? RIG_VFO_A : RIG_VFO_MAIN; + } + + rig_debug(RIG_DEBUG_TRACE, "%s: retoring vfo=%s\n", __func__, + rig_strvfo(save_vfo)); rc2 = caps->set_vfo(rig, save_vfo); } else @@ -3631,6 +3646,7 @@ int HAMLIB_API rig_get_split_vfo(RIG *rig, { return retcode; } + #endif retcode = caps->get_split_vfo(rig, vfo, split, tx_vfo); @@ -3643,6 +3659,7 @@ int HAMLIB_API rig_get_split_vfo(RIG *rig, /* return the first error code */ retcode = rc2; } + #endif if (retcode == RIG_OK) // only update cache on success diff --git a/tests/rigctld.c b/tests/rigctld.c index b5f09cbd..144f6ad6 100644 --- a/tests/rigctld.c +++ b/tests/rigctld.c @@ -686,11 +686,20 @@ int main(int argc, char *argv[]) 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_flags = AI_CANONNAME; hints.ai_protocol = 0; /* Any protocol */ retcode = getaddrinfo(src_addr, portno, &hints, &result); - if (retcode != 0) + 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); ----------------------------------------------------------------------- Summary of changes: rigs/alinco/dxsr8.c | 3 +- src/misc.c | 79 ++++++++++++++++++++++++++++++++++++++++++++++++++++ src/misc.h | 2 ++ src/network.c | 71 +++++++++++++++++++++++----------------------- src/rig.c | 41 +++++++++++++++++++-------- tests/rigctl_parse.c | 1 + tests/rigctlcom.c | 2 +- tests/rigctld.c | 12 ++++++-- 8 files changed, 160 insertions(+), 51 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2020-06-21 22:04:26
|
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 379caace7cce869ab919919db26e72a4c3e76d83 (commit) via d95bcccc9406d027cacb216e45c3d399ca180136 (commit) via 3cb79b3bca3360abad2f767305dee65938dcbb5b (commit) via 35001b12c07214d6d687850c9e12bd2b04a6c1d6 (commit) via 9dc12e8b63e68e9bb2fa50366aeab170b0523afe (commit) via c2ee1ecb025469879d849ef2930636375066ef9f (commit) via 83521b26948cebce9170a9b624178fc442e48424 (commit) via fe8decf47500828e2a469e6b49ed8712293e19d8 (commit) via e6b62e4f3e277440a6cbe64fe8a1dd3b71cc8e56 (commit) via 63357389d673d031b3a37acc5bba374a93920ed2 (commit) via 8ff077d7a9fb0138f3a1462f985f10c8d5d1ab67 (commit) via abe2697f4e05801bd66c33fbe7338e1385c1a881 (commit) via d61d1c13e108bb4131f8710f4adc163757fafbc5 (commit) via 68e6dd0e21aa872883655c2e677e1fc9193a8b3f (commit) via 9c87990a763455255293b25dc33b72e829e63477 (commit) via d5ff0f24780f3d3e0d43631ade9d474c667f8456 (commit) via bcb6add4d25f22cc24eda7d7842f247c641ae6c5 (commit) via 93992efe42a5d017551df0cc07d22c46d2c3d8c8 (commit) via 0bd366b05b81fcdf14e1095579379f3a3d75253a (commit) via 2ef81310238a9838d342699a389c3e79de1c681c (commit) via 031b1017815b966cd04c7fc2c93568a6482d25a7 (commit) via e5a61a5a1457aace614eb7918d398ec2faf92e78 (commit) via 805b4aa269a530a58f465a63eec356c89451a6e0 (commit) via b2f1b1880af592442ba453a648fc168002f5affa (commit) via 5a28ef9a20207e638aac197e3177a6bf98f6cbf2 (commit) via 3b3c2abb009a8380ee142123f238c1e124bd6a3e (commit) via bbc67d598e6b4dbf4ef50ab272787018eb25e209 (commit) from 9033eb733a5891acfc2c2940bab4f26dcdedc1bd (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 379caace7cce869ab919919db26e72a4c3e76d83 Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Jun 21 16:15:00 2020 -0500 update comm_state when port_close is called diff --git a/src/rig.c b/src/rig.c index ceb7586c..67af05e6 100644 --- a/src/rig.c +++ b/src/rig.c @@ -604,6 +604,7 @@ int HAMLIB_API rig_open(RIG *rig) if (rs->comm_state) { port_close(&rs->rigport, rs->rigport.type.rig); + rs->comm_state = 0; return -RIG_EINVAL; } commit d95bcccc9406d027cacb216e45c3d399ca180136 Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Jun 21 15:44:01 2020 -0500 Add newer Set 2 RIT command to appropriate kenwood rigs diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index 7ba802db..5bcee48d 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -744,6 +744,18 @@ int kenwood_open(RIG *rig) } } + if (RIG_IS_TS2000 + || RIG_IS_TS480 + || RIG_IS_TS590S + || RIG_IS_TS590SG + || RIG_IS_TS890S + || RIG_IS_TS990S) + { + // rig has Set 2 RIT/XIT function + rig_debug(RIG_DEBUG_TRACE, "%s: rig has_rit2\n", __func__); + priv->has_rit2 = 1; + } + if (RIG_IS_TS590S) { /* we need the firmware version for these rigs to deal with f/w defects */ @@ -1652,9 +1664,11 @@ int kenwood_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit) int retval, i; shortfreq_t curr_rit; int diff; + struct kenwood_priv_data *priv = rig->state.priv; - rig_debug(RIG_DEBUG_VERBOSE, "%s called: vfo=%s, rit=%ld\n", __func__, - rig_strvfo(vfo), rit); + rig_debug(RIG_DEBUG_VERBOSE, "%s called: vfo=%s, rit=%ld, has_rit2=%d\n", + __func__, + rig_strvfo(vfo), rit, priv->has_rit2); retval = kenwood_get_rit(rig, vfo, &curr_rit); @@ -1663,28 +1677,32 @@ int kenwood_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit) return retval; } - rig_debug(RIG_DEBUG_VERBOSE, "%s get_rit=%ld\n", __func__, curr_rit); - - if (rit == 0) + if (priv->has_rit2) // if backend shows it has the Set 2 command { - return kenwood_transaction(rig, "RC", NULL, 0); + char cmd[10]; + snprintf(cmd, sizeof(cmd) - 1, "R%c%05d", rit > 0 ? 'U' : 'D', (int)rit); + retval = kenwood_transaction(rig, cmd, NULL, 0); } + else + { + retval = kenwood_transaction(rig, "RC", NULL, 0); - retval = kenwood_transaction(rig, "RC", NULL, 0); + if (retval != RIG_OK) + { + return retval; + } - if (retval != RIG_OK) - { - return retval; - } + if (rit == 0) { return RIG_OK; } // we're done here - snprintf(buf, sizeof(buf), "R%c", (rit > 0) ? 'U' : 'D'); + snprintf(buf, sizeof(buf), "R%c", (rit > 0) ? 'U' : 'D'); - diff = labs((rit + rit >= 0 ? 5 : -5) / 10); // round to nearest - rig_debug(RIG_DEBUG_TRACE, "%s: rit change loop=%d\n", __func__, diff); + diff = labs((rit + rit >= 0 ? 5 : -5) / 10); // round to nearest + rig_debug(RIG_DEBUG_TRACE, "%s: rit change loop=%d\n", __func__, diff); - for (i = 0; i < diff; i++) - { - retval = kenwood_transaction(rig, buf, NULL, 0); + for (i = 0; i < diff; i++) + { + retval = kenwood_transaction(rig, buf, NULL, 0); + } } return retval; diff --git a/rigs/kenwood/kenwood.h b/rigs/kenwood/kenwood.h index ea6c6603..c96827ca 100644 --- a/rigs/kenwood/kenwood.h +++ b/rigs/kenwood/kenwood.h @@ -84,7 +84,7 @@ extern const struct confparams kenwood_cfg_params[]; #define RIG_IS_TS2000 (rig->caps->rig_model == RIG_MODEL_TS2000) #define RIG_IS_TS50 (rig->caps->rig_model == RIG_MODEL_TS50) #define RIG_IS_TS450S (rig->caps->rig_model == RIG_MODEL_TS450S) -#define RIG_IS_TS450S (rig->caps->rig_model == RIG_MODEL_TS450S) +#define RIG_IS_TS480 (rig->caps->rig_model == RIG_MODEL_TS480) #define RIG_IS_TS590S (rig->caps->rig_model == RIG_MODEL_TS590S) #define RIG_IS_TS590SG (rig->caps->rig_model == RIG_MODEL_TS590SG) #define RIG_IS_TS690S (rig->caps->rig_model == RIG_MODEL_TS690S) @@ -120,13 +120,10 @@ struct kenwood_priv_data int is_emulation; /* flag for TS-2000 emulations */ void *data; /* model specific data */ rmode_t curr_mode; /* used for is_emulation to avoid get_mode on VFOB */ - // Boolean flags true when model is in use - int is_590s; - int is_590sg; - int is_950; struct timespec cache_start; char last_if_response[KENWOOD_MAX_BUF_LEN]; int poweron; /* to avoid powering on more than once */ + int has_rit2; /* rig has set 2 rit command */ }; commit 3cb79b3bca3360abad2f767305dee65938dcbb5b Merge: 35001b12 e6b62e4f Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Jun 21 14:47:52 2020 -0500 Merge branch 'master' of https://github.com/Hamlib/Hamlib commit 35001b12c07214d6d687850c9e12bd2b04a6c1d6 Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Jun 21 14:47:38 2020 -0500 astyle icom.c diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index f1e3ead2..c9a2988d 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -754,6 +754,7 @@ icom_rig_open(RIG *rig) return retval; } } + priv->poweron = 1; if (rig->caps->has_get_func & RIG_FUNC_SATMODE) commit 9dc12e8b63e68e9bb2fa50366aeab170b0523afe Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Jun 21 14:47:22 2020 -0500 astyle kenwood.c diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index 2868e0c7..7ba802db 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -1679,7 +1679,7 @@ int kenwood_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit) snprintf(buf, sizeof(buf), "R%c", (rit > 0) ? 'U' : 'D'); - diff = labs((rit + rit>=0?5:-5) / 10); // round to nearest + diff = labs((rit + rit >= 0 ? 5 : -5) / 10); // round to nearest rig_debug(RIG_DEBUG_TRACE, "%s: rit change loop=%d\n", __func__, diff); for (i = 0; i < diff; i++) commit c2ee1ecb025469879d849ef2930636375066ef9f Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Jun 21 14:46:50 2020 -0500 astyle files diff --git a/rigs/alinco/dx77.c b/rigs/alinco/dx77.c index d057440d..b6f07ce2 100644 --- a/rigs/alinco/dx77.c +++ b/rigs/alinco/dx77.c @@ -289,10 +289,10 @@ const struct rig_caps dx77_caps = * TODO: error case handling */ int dx77_transaction(RIG *rig, - const char *cmd, - int cmd_len, - char *data, - int *data_len) + const char *cmd, + int cmd_len, + char *data, + int *data_len) { int retval; @@ -398,10 +398,10 @@ int dx77_set_vfo(RIG *rig, vfo_t vfo) case RIG_VFO_MEM: return dx77_transaction(rig, - AL CMD_MEMMD "0" EOM, - strlen(AL CMD_MEMMD "0" EOM), - NULL, - NULL); + AL CMD_MEMMD "0" EOM, + strlen(AL CMD_MEMMD "0" EOM), + NULL, + NULL); default: rig_debug(RIG_DEBUG_ERR, @@ -427,10 +427,10 @@ int dx77_get_vfo(RIG *rig, vfo_t *vfo) int vfo_len, retval; retval = dx77_transaction(rig, - AL CMD_RMV EOM, - strlen(AL CMD_RMV EOM), - vfobuf, - &vfo_len); + AL CMD_RMV EOM, + strlen(AL CMD_RMV EOM), + vfobuf, + &vfo_len); if (retval != RIG_OK) { @@ -506,10 +506,10 @@ static int current_data_read(RIG *rig, char *databuf) int data_len, retval; retval = dx77_transaction(rig, - AL CMD_RDATA EOM, - strlen(AL CMD_RDATA EOM), - databuf, - &data_len); + AL CMD_RDATA EOM, + strlen(AL CMD_RDATA EOM), + databuf, + &data_len); if (retval != RIG_OK) { @@ -702,10 +702,10 @@ int dx77_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo) char spltbuf[BUFSZ]; retval = dx77_transaction(rig, - AL CMD_RSPLT EOM, - strlen(AL CMD_RSPLT EOM), - spltbuf, - &splt_len); + AL CMD_RSPLT EOM, + strlen(AL CMD_RSPLT EOM), + spltbuf, + &splt_len); if (retval != RIG_OK) { @@ -805,10 +805,10 @@ int dx77_get_rit(RIG *rig, vfo_t vfo, shortfreq_t *rit) /* read in Hertz unit */ retval = dx77_transaction(rig, - AL CMD_RIT "0" EOM, - strlen(AL CMD_RIT "0" EOM), - ritbuf, - &rit_len); + AL CMD_RIT "0" EOM, + strlen(AL CMD_RIT "0" EOM), + ritbuf, + &rit_len); if (retval != RIG_OK) { @@ -1113,10 +1113,10 @@ int dx77_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) case RIG_LEVEL_RAWSTR: /* read A/D converted value */ retval = dx77_transaction(rig, - AL CMD_SMETER "1" EOM, - strlen(AL CMD_SMETER "1" EOM), - lvlbuf, - &lvl_len); + AL CMD_SMETER "1" EOM, + strlen(AL CMD_SMETER "1" EOM), + lvlbuf, + &lvl_len); if (retval != RIG_OK) { @@ -1187,10 +1187,10 @@ int dx77_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) case RIG_LEVEL_RFPOWER: retval = dx77_transaction(rig, - AL CMD_RPOWER EOM, - strlen(AL CMD_RPOWER EOM), - lvlbuf, - &lvl_len); + AL CMD_RPOWER EOM, + strlen(AL CMD_RPOWER EOM), + lvlbuf, + &lvl_len); if (retval != RIG_OK) { @@ -1294,10 +1294,10 @@ int dx77_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt) int ptt_len, retval; retval = dx77_transaction(rig, - AL CMD_PTT EOM, - strlen(AL CMD_PTT EOM), - pttbuf, - &ptt_len); + AL CMD_PTT EOM, + strlen(AL CMD_PTT EOM), + pttbuf, + &ptt_len); if (retval != RIG_OK) { @@ -1347,10 +1347,10 @@ int dx77_get_dcd(RIG *rig, vfo_t vfo, dcd_t *dcd) int dcd_len, retval; retval = dx77_transaction(rig, - AL CMD_SQL EOM, - strlen(AL CMD_SQL EOM), - dcdbuf, - &dcd_len); + AL CMD_SQL EOM, + strlen(AL CMD_SQL EOM), + dcdbuf, + &dcd_len); if (retval != RIG_OK) { @@ -1421,10 +1421,10 @@ int dx77_get_mem(RIG *rig, vfo_t vfo, int *ch) int mem_len, retval; retval = dx77_transaction(rig, - AL CMD_RMEM EOM, - strlen(AL CMD_RMEM EOM), - membuf, - &mem_len); + AL CMD_RMEM EOM, + strlen(AL CMD_RMEM EOM), + membuf, + &mem_len); if (retval != RIG_OK) { diff --git a/rigs/alinco/dxsr8.c b/rigs/alinco/dxsr8.c index fa5be083..3ac50134 100644 --- a/rigs/alinco/dxsr8.c +++ b/rigs/alinco/dxsr8.c @@ -74,7 +74,7 @@ int dxsr8_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt); /* * DX-SR8 rig capabilities. * - * thanks to + * thanks to * https://yo5ptd.wordpress.com/2017/02/12/alinco-dx-sr8/ * for a partially documented protocol */ @@ -131,12 +131,12 @@ const struct rig_caps dxsr8_caps = RIG_CHAN_END, }, - .rx_range_list1 = + .rx_range_list1 = { {kHz(135), MHz(30), DXSR8_ALL_MODES, -1, -1, DXSR8_VFO, 0, "DX-SR8T"}, RIG_FRNG_END, }, - .tx_range_list1 = + .tx_range_list1 = { {kHz(1800), MHz(2) - 100, DXSR8_OTHER_TX_MODES, W(10), W(100), DXSR8_VFO, 0, "DX-SR8T"}, {kHz(1800), MHz(2) - 100, DXSR8_AM_TX_MODES, W(4), W(40), DXSR8_VFO, 0, "DX-SR8T"}, @@ -168,7 +168,7 @@ const struct rig_caps dxsr8_caps = {kHz(135), MHz(30), DXSR8_ALL_MODES, -1, -1, DXSR8_VFO, 0, "DX-SR8E"}, RIG_FRNG_END, }, - .tx_range_list2 = + .tx_range_list2 = { {kHz(1800), MHz(2) - 100, DXSR8_OTHER_TX_MODES, W(10), W(100), DXSR8_VFO, 0, "DX-SR8E"}, {kHz(1800), MHz(2) - 100, DXSR8_AM_TX_MODES, W(4), W(40), DXSR8_VFO, 0, "DX-SR8E"}, @@ -231,10 +231,10 @@ const struct rig_caps dxsr8_caps = * TODO: error case handling */ int dxsr8_transaction(RIG *rig, - const char *cmd, - int cmd_len, - char *data, - int *data_len) + const char *cmd, + int cmd_len, + char *data, + int *data_len) { int retval; @@ -265,12 +265,12 @@ int dxsr8_transaction(RIG *rig, * TODO: check whether cmd and echobuf match (optional) */ retval = read_string(&rs->rigport, replybuf, BUFSZ, LF, strlen(LF)); - + if (retval < 0) { return retval; } - + retval = read_string(&rs->rigport, replybuf, BUFSZ, LF, strlen(LF)); @@ -302,7 +302,7 @@ int dxsr8_transaction(RIG *rig, strcpy(data, replybuf); *data_len = reply_len; - + return RIG_OK; } @@ -312,8 +312,8 @@ int dxsr8_transaction(RIG *rig, * Convenience function to read a numeric value from the radio */ int dxsr8_read_num(RIG *rig, - const char *cmd, - int *reply_num) + const char *cmd, + int *reply_num) { int retval; int reply_len; @@ -334,8 +334,9 @@ int dxsr8_read_num(RIG *rig, * dxsr8_set_freq * Assumes rig!=NULL */ -int dxsr8_set_freq(RIG *rig, vfo_t vfo, freq_t freq) { - +int dxsr8_set_freq(RIG *rig, vfo_t vfo, freq_t freq) +{ + char cmd[BUFSZ]; int cmd_len; @@ -353,9 +354,10 @@ int dxsr8_set_freq(RIG *rig, vfo_t vfo, freq_t freq) { * dxsr8_get_freq * Assumes rig!=NULL, freq!=NULL */ -int dxsr8_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) { +int dxsr8_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) +{ int retval, data_len; - + char cmd[] = AL "~RR_RXF" EOM; char freqbuf[BUFSZ]; @@ -376,18 +378,24 @@ int dxsr8_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) { * dxsr8_set_mode * Assumes rig!=NULL */ -int dxsr8_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) { - char mdbuf[BUFSZ]; +int dxsr8_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) +{ + char mdbuf[BUFSZ]; int mdbuf_len, wide_filter, retval; int amode; switch (mode) { case RIG_MODE_CW: amode = MD_CWU; break; + case RIG_MODE_CWR: amode = MD_CWL; break; + case RIG_MODE_USB: amode = MD_USB; break; + case RIG_MODE_LSB: amode = MD_LSB; break; + case RIG_MODE_FM: amode = MD_FM; break; + case RIG_MODE_AM: amode = MD_AM; break; default: @@ -427,14 +435,16 @@ int dxsr8_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) { * dxsr8_get_mode * Assumes rig!=NULL, mode!=NULL */ -int dxsr8_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) { - +int dxsr8_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) +{ + int retval; int amode; int filter; retval = dxsr8_read_num(rig, AL "~RR_RFM" EOM, &amode); - if (retval != RIG_OK) + + if (retval != RIG_OK) { return retval; } @@ -443,9 +453,13 @@ int dxsr8_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) { { case MD_CWL: case MD_CWU: *mode = RIG_MODE_CW; break; + case MD_USB: *mode = RIG_MODE_USB; break; + case MD_LSB: *mode = RIG_MODE_LSB; break; + case MD_AM: *mode = RIG_MODE_AM; break; + case MD_FM: *mode = RIG_MODE_FM; break; default: @@ -458,10 +472,12 @@ int dxsr8_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) { retval = dxsr8_read_num(rig, AL "~RR_NAR" EOM, &filter); - if (filter == 0) + if (filter == 0) { *width = rig_passband_wide(rig, *mode); - } else { + } + else + { *width = rig_passband_normal(rig, *mode); } @@ -472,7 +488,8 @@ int dxsr8_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) { * dxsr8_set_func * Assumes rig!=NULL */ -int dxsr8_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) { +int dxsr8_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) +{ int cmd_len; char cmd[BUFSZ]; @@ -489,7 +506,7 @@ int dxsr8_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) { return dxsr8_transaction(rig, cmd, cmd_len, NULL, NULL); - + default: rig_debug(RIG_DEBUG_ERR, "Unsupported set_func %d\n", (int)func); return -RIG_EINVAL; @@ -502,7 +519,8 @@ int dxsr8_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) { * dxsr8_get_func * Assumes rig!=NULL, status!=NULL */ -int dxsr8_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status) { +int dxsr8_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status) +{ int retval; int setting; @@ -535,7 +553,7 @@ int dxsr8_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status) { *status = setting ? 1 : 0; break; - + default: rig_debug(RIG_DEBUG_ERR, "Unsupported get_func %d\n", (int)func); return -RIG_EINVAL; @@ -549,7 +567,8 @@ int dxsr8_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status) { * Assumes rig!=NULL * FIXME: cannot support PREAMP and ATT both at same time (make sense though) */ -int dxsr8_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) { +int dxsr8_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) +{ int cmd_len, lvl; char cmd[BUFSZ]; @@ -559,6 +578,7 @@ int dxsr8_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) { switch (val.i) { case 0: lvl = 0; break; // AL~RW_RFG00 - RF gain 0dB + case 10: lvl = 3; break; // AL~RW_RFG03 - RF gain +10dB default: rig_debug(RIG_DEBUG_ERR, @@ -575,7 +595,9 @@ int dxsr8_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) { switch (val.i) { case 0: lvl = 0; break; // AL~RW_RFG00 - RF gain 0dB + case 10: lvl = 1; break; // AL~RW_RFG01 - RF gain -10dB + case 20: lvl = 2; break; // AL~RW_RFG02 - RF gain -20dB default: rig_debug(RIG_DEBUG_ERR, @@ -590,11 +612,16 @@ int dxsr8_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) { case RIG_LEVEL_RFPOWER: - if (val.f <= 0.01) { + if (val.f <= 0.01) + { lvl = 2; // AL~RW_PWR02 - Sub low power (QRP mode) - } else if (val.f <= 0.1) { + } + else if (val.f <= 0.1) + { lvl = 1; // AL~RW_PWR01 - Low power - } else { + } + else + { lvl = 0; // AL~RW_PWR00 - High power } @@ -614,7 +641,8 @@ int dxsr8_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) { * dxsr8_get_level * Assumes rig!=NULL, val!=NULL */ -int dxsr8_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) { +int dxsr8_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) +{ int retval; int lvl; @@ -630,12 +658,15 @@ int dxsr8_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) { return retval; } - switch (lvl) { + switch (lvl) + { case 0: val->i = 0; break; // RF gain 0dB + case 3: val->i = 10; break; // RF gain +10dB - default: + + default: rig_debug(RIG_DEBUG_ERR, "Unknown RF Gain %02d\n", lvl); } @@ -649,14 +680,18 @@ int dxsr8_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) { return retval; } - switch (lvl) { + switch (lvl) + { case 0: val->i = 0; break; // RF gain 0dB + case 1: val->i = 10; break; // RF gain -10dB + case 2: val->i = 10; break; // RF gain -20dB - default: + + default: rig_debug(RIG_DEBUG_ERR, "Unknown RF Gain %02d\n", lvl); } @@ -684,7 +719,7 @@ int dxsr8_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) { case 3: // 02 - Sub low power (QRP mode) val->f = 0.01; // 1 W break; - + default: rig_debug(RIG_DEBUG_ERR, "Unknown RF Power %02d\n", lvl); break; @@ -705,7 +740,8 @@ int dxsr8_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) { * dxsr8_get_ptt * Assumes rig!=NULL, ptt!=NULL */ -int dxsr8_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt) { +int dxsr8_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt) +{ int retval; int pttval; @@ -725,7 +761,8 @@ int dxsr8_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt) { * dxsr8_set_ptt * Assumes rig!=NULL */ -int dxsr8_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) { +int dxsr8_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) +{ char cmd[BUFSZ]; int cmd_len; diff --git a/rigs/yaesu/ft991.c b/rigs/yaesu/ft991.c index 5921e14f..60d020bf 100644 --- a/rigs/yaesu/ft991.c +++ b/rigs/yaesu/ft991.c @@ -736,6 +736,7 @@ static int ft991_set_ctcss_sql(RIG *rig, vfo_t vfo, tone_t tone) { int i; ncboolean tone_match; + for (i = 0, tone_match = FALSE; rig->caps->ctcss_list[i] != 0; i++) { if (tone == rig->caps->ctcss_list[i]) diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 68da054c..8cc8b187 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -366,7 +366,8 @@ int newcat_open(RIG *rig) __func__, rig_s->rigport.post_write_delay); /* Ensure rig is powered on */ - if (priv->poweron == 0) { + if (priv->poweron == 0) + { priv->poweron = 1; rig_set_powerstat(rig, 1); } commit 83521b26948cebce9170a9b624178fc442e48424 Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Jun 21 14:43:33 2020 -0500 Fix kenwood set_rit for negative values diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index 1d1aac72..2868e0c7 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -1679,7 +1679,7 @@ int kenwood_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit) snprintf(buf, sizeof(buf), "R%c", (rit > 0) ? 'U' : 'D'); - diff = labs((rit + 5) / 10); // round to nearest + diff = labs((rit + rit>=0?5:-5) / 10); // round to nearest rig_debug(RIG_DEBUG_TRACE, "%s: rit change loop=%d\n", __func__, diff); for (i = 0; i < diff; i++) commit fe8decf47500828e2a469e6b49ed8712293e19d8 Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Jun 21 14:32:07 2020 -0500 Fix kenwood get_xit to correct status bit diff --git a/rigs/kenwood/kenwood.h b/rigs/kenwood/kenwood.h index fcae7b42..ea6c6603 100644 --- a/rigs/kenwood/kenwood.h +++ b/rigs/kenwood/kenwood.h @@ -27,7 +27,7 @@ #include <string.h> #include "token.h" -#define BACKEND_VER "20200619" +#define BACKEND_VER "20200621" #define EOM_KEN ';' #define EOM_TH '\r' commit e6b62e4f3e277440a6cbe64fe8a1dd3b71cc8e56 Merge: 8ff077d7 63357389 Author: Michael Black <mdb...@ya...> Date: Sun Jun 21 12:59:29 2020 -0500 Merge pull request #324 from hiteki/hiteki_323 get_dcd responds without crashing #323 commit 63357389d673d031b3a37acc5bba374a93920ed2 Author: hiteki <tb...@ya...> Date: Sun Jun 21 19:10:21 2020 +0200 get_dcd responds without crashing #323 diff --git a/rigs/uniden/uniden.c b/rigs/uniden/uniden.c index 2d2f56d0..b19c07ab 100644 --- a/rigs/uniden/uniden.c +++ b/rigs/uniden/uniden.c @@ -229,8 +229,8 @@ transaction_write: #endif /* Special case for SQuelch */ - if (replystr && !memcmp(cmdstr, "SQ", 2) && (replystr[0] == '-' - || replystr[0] == '+')) + if (replystr && !memcmp(cmdstr, "SQ", 2) && (data[0] == '-' + || data[0] == '+')) { retval = RIG_OK; goto transaction_quit; commit 8ff077d7a9fb0138f3a1462f985f10c8d5d1ab67 Merge: d61d1c13 abe2697f Author: Michael Black <mdb...@ya...> Date: Sun Jun 21 11:13:42 2020 -0500 Merge pull request #322 from hiteki/hiteki_321 uniden_get_mode report WFM mode correctly #321 commit abe2697f4e05801bd66c33fbe7338e1385c1a881 Author: hiteki <tb...@ya...> Date: Sun Jun 21 18:09:18 2020 +0200 uniden_get_mode report WFM mode correctly #321 diff --git a/rigs/uniden/uniden.c b/rigs/uniden/uniden.c index b79fac04..2d2f56d0 100644 --- a/rigs/uniden/uniden.c +++ b/rigs/uniden/uniden.c @@ -406,7 +406,7 @@ int uniden_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) } else if (!strcmp(modebuf + 3, "WFM")) { - *mode = RIG_MODE_AM; + *mode = RIG_MODE_WFM; } else if (!strcmp(modebuf + 3, "FM")) { commit d61d1c13e108bb4131f8710f4adc163757fafbc5 Merge: 9c87990a 68e6dd0e Author: Michael Black <mdb...@ya...> Date: Sun Jun 21 09:26:11 2020 -0500 Merge pull request #320 from hiteki/hiteki_319 Correctly compare response strings #319 commit 68e6dd0e21aa872883655c2e677e1fc9193a8b3f Author: hiteki <tb...@ya...> Date: Sun Jun 21 16:09:45 2020 +0200 Correctly compare response strings #319 diff --git a/rigs/uniden/uniden.c b/rigs/uniden/uniden.c index 8117de7a..b79fac04 100644 --- a/rigs/uniden/uniden.c +++ b/rigs/uniden/uniden.c @@ -187,7 +187,7 @@ transaction_write: goto transaction_quit; } - if (strcmp(data, "OK"EOM)) + if (strcmp(data, "OK"EOM) == 0) { /* everything is fine */ retval = RIG_OK; @@ -198,7 +198,7 @@ transaction_write: * in the right mode or using the correct parameters. ERR indicates * an INVALID Command. */ - if (strcmp(data, "NG"EOM) || strcmp(data, "ORER"EOM)) + if (strcmp(data, "NG"EOM) == 0 || strcmp(data, "ORER"EOM) == 0) { /* Invalid command */ rig_debug(RIG_DEBUG_VERBOSE, "%s: NG/Overflow for '%s'\n", __func__, cmdstr); @@ -206,7 +206,7 @@ transaction_write: goto transaction_quit; } - if (strcmp(data, "ERR"EOM)) + if (strcmp(data, "ERR"EOM) == 0) { /* Command format error */ rig_debug(RIG_DEBUG_VERBOSE, "%s: Error for '%s'\n", __func__, cmdstr); commit 9c87990a763455255293b25dc33b72e829e63477 Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Jun 21 06:44:40 2020 -0500 Update uniden BACKEND date diff --git a/rigs/uniden/uniden.h b/rigs/uniden/uniden.h index c3631981..4ea114ff 100644 --- a/rigs/uniden/uniden.h +++ b/rigs/uniden/uniden.h @@ -25,7 +25,7 @@ #include <hamlib/rig.h> #include <cal.h> -#define BACKEND_VER "20200114" +#define BACKEND_VER "20200621" /* TODO: Trunk, Delay, Recording * commit d5ff0f24780f3d3e0d43631ade9d474c667f8456 Merge: bcb6add4 93992efe Author: Michael Black <mdb...@ya...> Date: Sun Jun 21 06:41:58 2020 -0500 Merge pull request #318 from hiteki/hiteki_317 Uniden bc780xlt channel ranges is 1..500 #317 commit bcb6add4d25f22cc24eda7d7842f247c641ae6c5 Merge: 2ef81310 0bd366b0 Author: Michael Black <mdb...@ya...> Date: Sun Jun 21 06:41:42 2020 -0500 Merge pull request #316 from hiteki/hiteki_315 uniden_get_channel correctly parses rig's response #315 commit 93992efe42a5d017551df0cc07d22c46d2c3d8c8 Author: hiteki <tb...@ya...> Date: Sun Jun 21 12:27:59 2020 +0200 Uniden bc780xlt channel ranges is 1..500 #317 diff --git a/rigs/uniden/bc780.c b/rigs/uniden/bc780.c index 43753df1..45ee2259 100644 --- a/rigs/uniden/bc780.c +++ b/rigs/uniden/bc780.c @@ -98,7 +98,7 @@ const struct rig_caps bc780_caps = .str_cal = BC780_STR_CAL, .chan_list = { - { 0, 499, RIG_MTYPE_MEM, {BC780_CHANNEL_CAPS} }, + { 1, 500, RIG_MTYPE_MEM, {BC780_CHANNEL_CAPS} }, RIG_CHAN_END, }, commit 0bd366b05b81fcdf14e1095579379f3a3d75253a Author: hiteki <tb...@ya...> Date: Sun Jun 21 12:06:40 2020 +0200 uniden_get_channel correctly parses rig's response #315 diff --git a/rigs/uniden/uniden.c b/rigs/uniden/uniden.c index 249bd0b2..8117de7a 100644 --- a/rigs/uniden/uniden.c +++ b/rigs/uniden/uniden.c @@ -619,12 +619,12 @@ int uniden_get_channel(RIG *rig, channel_t *chan, int read_only) */ if (mem_len < 30 || membuf[5] != 'F' || - membuf[25] != 'T' || - membuf[28] != 'D' || - membuf[31] != 'L' || - membuf[34] != 'A' || - membuf[37] != 'R' || - membuf[40] != 'N') + membuf[15] != 'T' || + membuf[18] != 'D' || + membuf[21] != 'L' || + membuf[24] != 'A' || + membuf[27] != 'R' || + membuf[30] != 'N') { return -RIG_EPROTO; } commit 2ef81310238a9838d342699a389c3e79de1c681c Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Jun 20 17:04:14 2020 -0500 Remove DATA_USB from ft1000mp.c diff --git a/rigs/yaesu/ft1000mp.c b/rigs/yaesu/ft1000mp.c index d30cb004..9b609651 100644 --- a/rigs/yaesu/ft1000mp.c +++ b/rigs/yaesu/ft1000mp.c @@ -877,10 +877,6 @@ int ft1000mp_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) cmd_index = FT1000MP_NATIVE_MODE_SET_DATA_LSB; break; - case RIG_MODE_PKTUSB: - cmd_index = FT1000MP_NATIVE_MODE_SET_DATA_USB; - break; - case RIG_MODE_PKTFM: cmd_index = FT1000MP_NATIVE_MODE_SET_DATA_FM; break; commit 031b1017815b966cd04c7fc2c93568a6482d25a7 Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Jun 20 16:12:48 2020 -0500 Promote bc780.c to stable diff --git a/rigs/uniden/bc780.c b/rigs/uniden/bc780.c index b31f09ec..43753df1 100644 --- a/rigs/uniden/bc780.c +++ b/rigs/uniden/bc780.c @@ -60,7 +60,7 @@ const struct rig_caps bc780_caps = .mfg_name = "Uniden", .version = BACKEND_VER ".0", .copyright = "LGPL", - .status = RIG_STATUS_UNTESTED, + .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRUNKSCANNER, .ptt_type = RIG_PTT_NONE, .dcd_type = RIG_DCD_RIG, commit e5a61a5a1457aace614eb7918d398ec2faf92e78 Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Jun 20 16:03:07 2020 -0500 Change ft1000mp.c back to TARGETABLE_FREQ diff --git a/rigs/yaesu/ft1000mp.c b/rigs/yaesu/ft1000mp.c index 0d10027a..d30cb004 100644 --- a/rigs/yaesu/ft1000mp.c +++ b/rigs/yaesu/ft1000mp.c @@ -215,7 +215,7 @@ const struct rig_caps ft1000mp_caps = RIG_MODEL(RIG_MODEL_FT1000MP), .model_name = "FT-1000MP", .mfg_name = "Yaesu", - .version = "20200619.0", + .version = "20200620.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -246,7 +246,7 @@ const struct rig_caps ft1000mp_caps = .max_rit = Hz(9999), .max_xit = Hz(9999), .max_ifshift = kHz(1.12), - .targetable_vfo = RIG_TARGETABLE_PURE, + .targetable_vfo = RIG_TARGETABLE_FREQ, .transceive = RIG_TRN_OFF, .bank_qty = 0, .chan_desc_sz = 0, @@ -877,6 +877,10 @@ int ft1000mp_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) cmd_index = FT1000MP_NATIVE_MODE_SET_DATA_LSB; break; + case RIG_MODE_PKTUSB: + cmd_index = FT1000MP_NATIVE_MODE_SET_DATA_USB; + break; + case RIG_MODE_PKTFM: cmd_index = FT1000MP_NATIVE_MODE_SET_DATA_FM; break; commit 805b4aa269a530a58f465a63eec356c89451a6e0 Merge: 5a28ef9a b2f1b188 Author: Michael Black <mdb...@ya...> Date: Sat Jun 20 15:51:22 2020 -0500 Merge pull request #314 from hiteki/hiteki_313 uniden_get_freq_2 to use SG<cr> instead of RF<cr> for bc780xlt #313 commit b2f1b1880af592442ba453a648fc168002f5affa Author: tb <tb...@xs...n> Date: Sat Jun 20 20:38:46 2020 +0200 uniden_get_freq_2 to use SG<cr> instead of RF<cr> for bc780xlt #313 - RF<cr> responds NG on bc780xlt - SG<cr> responds with the gain + the current frequency - SG<cr> is valid in manual mode, scan mode and search mode diff --git a/rigs/uniden/bc780.c b/rigs/uniden/bc780.c index e5b41b08..b31f09ec 100644 --- a/rigs/uniden/bc780.c +++ b/rigs/uniden/bc780.c @@ -129,7 +129,7 @@ const struct rig_caps bc780_caps = .priv = NULL, .set_freq = uniden_set_freq, - .get_freq = uniden_get_freq, + .get_freq = uniden_get_freq_2, .set_mode = uniden_set_mode, .get_mode = uniden_get_mode, .set_mem = uniden_set_mem, diff --git a/rigs/uniden/uniden.c b/rigs/uniden/uniden.c index 3e6b6479..249bd0b2 100644 --- a/rigs/uniden/uniden.c +++ b/rigs/uniden/uniden.c @@ -318,6 +318,35 @@ int uniden_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) return RIG_OK; } +/* + * uniden_get_freq + * Assumes rig!=NULL + */ +int uniden_get_freq_2(RIG *rig, vfo_t vfo, freq_t *freq) +{ + char freqbuf[BUFSZ]; + size_t freq_len = BUFSZ; + int ret; + + ret = uniden_transaction(rig, "SG" EOM, 3, "S", freqbuf, &freq_len); + + if (ret != RIG_OK) + { + return ret; + } + + if (freq_len < 10) + { + return -RIG_EPROTO; + } + + sscanf(freqbuf + 6, "%"SCNfreq, freq); + /* returned freq in hundreds of Hz */ + *freq *= 100; + + return RIG_OK; +} + int uniden_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) { const char *modebuf; diff --git a/rigs/uniden/uniden.h b/rigs/uniden/uniden.h index 2212dbc5..c3631981 100644 --- a/rigs/uniden/uniden.h +++ b/rigs/uniden/uniden.h @@ -58,6 +58,7 @@ int uniden_transaction (RIG *rig, const char *cmdstr, int cmd_len, const char *replystr, char *data, size_t *datasize); int uniden_set_freq(RIG *rig, vfo_t vfo, freq_t freq); int uniden_get_freq(RIG *rig, vfo_t vfo, freq_t *freq); +int uniden_get_freq_2(RIG *rig, vfo_t vfo, freq_t *freq); int uniden_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width); int uniden_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width); int uniden_set_mem(RIG *rig, vfo_t vfo, int ch); commit 5a28ef9a20207e638aac197e3177a6bf98f6cbf2 Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Jun 20 06:54:28 2020 -0500 Update ic703 to beta diff --git a/rigs/icom/ic703.c b/rigs/icom/ic703.c index da2a395d..0f368a20 100644 --- a/rigs/icom/ic703.c +++ b/rigs/icom/ic703.c @@ -91,7 +91,7 @@ const struct rig_caps ic703_caps = .mfg_name = "Icom", .version = BACKEND_VER ".0", .copyright = "LGPL", - .status = RIG_STATUS_UNTESTED, + .status = RIG_STATUS_BETA, .rig_type = RIG_TYPE_MOBILE, .ptt_type = RIG_PTT_NONE, .dcd_type = RIG_DCD_RIG, commit 3b3c2abb009a8380ee142123f238c1e124bd6a3e Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Jun 19 23:26:59 2020 -0500 On a 2nd rig_open call it would fail since port was still open. We now force close the port during rig_open. This should prevent the invalid configuration error WSJT-X sees on rig_open diff --git a/src/rig.c b/src/rig.c index e12a35a9..ceb7586c 100644 --- a/src/rig.c +++ b/src/rig.c @@ -570,13 +570,6 @@ int HAMLIB_API rig_open(RIG *rig) caps = rig->caps; rs = &rig->state; - if (rs->comm_state) - { - return -RIG_EINVAL; - } - - rs->rigport.fd = -1; - // determine if we have a network address // is_network |= sscanf(rs->rigport.pathname, "%u.%u.%u.%u:%u", &net1, &net2, @@ -608,6 +601,14 @@ int HAMLIB_API rig_open(RIG *rig) rs->rigport.type.rig = RIG_PORT_NETWORK; } + if (rs->comm_state) + { + port_close(&rs->rigport, rs->rigport.type.rig); + return -RIG_EINVAL; + } + + rs->rigport.fd = -1; + if (rs->rigport.type.rig == RIG_PORT_SERIAL) { if (rs->rigport.parm.serial.rts_state != RIG_SIGNAL_UNSET commit bbc67d598e6b4dbf4ef50ab272787018eb25e209 Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Jun 19 22:40:07 2020 -0500 Change ft1000mp.c to TARGETABLE_PURE to avoid VFO swap on set_split diff --git a/rigs/yaesu/ft1000mp.c b/rigs/yaesu/ft1000mp.c index c7b7fe80..0d10027a 100644 --- a/rigs/yaesu/ft1000mp.c +++ b/rigs/yaesu/ft1000mp.c @@ -246,7 +246,7 @@ const struct rig_caps ft1000mp_caps = .max_rit = Hz(9999), .max_xit = Hz(9999), .max_ifshift = kHz(1.12), - .targetable_vfo = RIG_TARGETABLE_FREQ, + .targetable_vfo = RIG_TARGETABLE_PURE, .transceive = RIG_TRN_OFF, .bank_qty = 0, .chan_desc_sz = 0, ----------------------------------------------------------------------- Summary of changes: rigs/alinco/dx77.c | 88 ++++++++++++++++++------------------- rigs/alinco/dxsr8.c | 117 ++++++++++++++++++++++++++++++++----------------- rigs/icom/ic703.c | 2 +- rigs/icom/icom.c | 1 + rigs/kenwood/kenwood.c | 52 +++++++++++++++------- rigs/kenwood/kenwood.h | 9 ++-- rigs/uniden/bc780.c | 6 +-- rigs/uniden/uniden.c | 53 +++++++++++++++++----- rigs/uniden/uniden.h | 3 +- rigs/yaesu/ft1000mp.c | 2 +- rigs/yaesu/ft991.c | 1 + rigs/yaesu/newcat.c | 3 +- src/rig.c | 16 ++++--- 13 files changed, 220 insertions(+), 133 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2020-06-19 22:47:50
|
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 9033eb733a5891acfc2c2940bab4f26dcdedc1bd (commit) from 92b7fc32ba54a89411b07560acd07c6acdeb302b (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 9033eb733a5891acfc2c2940bab4f26dcdedc1bd Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Jun 19 17:46:14 2020 -0500 Add RIT to get_func for kenwood.c diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index d64e485a..1d1aac72 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -2810,6 +2810,9 @@ int kenwood_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status) case RIG_FUNC_AIP: return get_kenwood_func(rig, "MX", status); + case RIG_FUNC_RIT: + return get_kenwood_func(rig, "RT", status); + default: rig_debug(RIG_DEBUG_ERR, "Unsupported get_func %s", rig_strfunc(func)); return -RIG_EINVAL; diff --git a/rigs/kenwood/kenwood.h b/rigs/kenwood/kenwood.h index 358a06bd..fcae7b42 100644 --- a/rigs/kenwood/kenwood.h +++ b/rigs/kenwood/kenwood.h @@ -27,7 +27,7 @@ #include <string.h> #include "token.h" -#define BACKEND_VER "20200617" +#define BACKEND_VER "20200619" #define EOM_KEN ';' #define EOM_TH '\r' ----------------------------------------------------------------------- Summary of changes: rigs/kenwood/kenwood.c | 3 +++ rigs/kenwood/kenwood.h | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2020-06-19 22:22: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, master has been updated via 92b7fc32ba54a89411b07560acd07c6acdeb302b (commit) via 542e227f85df8ebbacd7937af81c5dd61eea5a41 (commit) via 0ec3d475b577475188f55405b247f4bad378e659 (commit) from a516e18ece89fc9d05484f23bd6f3d5a84121bf8 (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 92b7fc32ba54a89411b07560acd07c6acdeb302b Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Jun 19 17:19:02 2020 -0500 Add get_split_vfo to ft1000mp.c and promote to stable diff --git a/rigs/yaesu/ft1000mp.c b/rigs/yaesu/ft1000mp.c index 1a806461..c7b7fe80 100644 --- a/rigs/yaesu/ft1000mp.c +++ b/rigs/yaesu/ft1000mp.c @@ -215,9 +215,9 @@ const struct rig_caps ft1000mp_caps = RIG_MODEL(RIG_MODEL_FT1000MP), .model_name = "FT-1000MP", .mfg_name = "Yaesu", - .version = "20200618.0", + .version = "20200619.0", .copyright = "LGPL", - .status = RIG_STATUS_BETA, + .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, .ptt_type = RIG_PTT_RIG, .dcd_type = RIG_DCD_RIG, @@ -326,6 +326,7 @@ const struct rig_caps ft1000mp_caps = .get_vfo = ft1000mp_get_vfo, /* get vfo */ .set_split_vfo = ft1000mp_set_split_vfo, + .get_split_vfo = ft1000mp_get_split_vfo, .get_rit = ft1000mp_get_rit, .set_rit = ft1000mp_set_rit, @@ -343,9 +344,9 @@ const struct rig_caps ft1000mpmkv_caps = RIG_MODEL(RIG_MODEL_FT1000MPMKV), .model_name = "MARK-V FT-1000MP", .mfg_name = "Yaesu", - .version = "20200618.0", + .version = "20200619.0", .copyright = "LGPL", - .status = RIG_STATUS_BETA, + .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, .ptt_type = RIG_PTT_RIG, .dcd_type = RIG_DCD_RIG, @@ -454,6 +455,7 @@ const struct rig_caps ft1000mpmkv_caps = .get_vfo = ft1000mp_get_vfo, /* get vfo */ .set_split_vfo = ft1000mp_set_split_vfo, + .get_split_vfo = ft1000mp_get_split_vfo, .get_rit = ft1000mp_get_rit, .set_rit = ft1000mp_set_rit, @@ -471,9 +473,9 @@ const struct rig_caps ft1000mpmkvfld_caps = RIG_MODEL(RIG_MODEL_FT1000MPMKVFLD), .model_name = "MARK-V Field FT-1000MP", .mfg_name = "Yaesu", - .version = "20200618.0", + .version = "20200619.0", .copyright = "LGPL", - .status = RIG_STATUS_BETA, + .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, .ptt_type = RIG_PTT_RIG, .dcd_type = RIG_DCD_RIG, @@ -582,6 +584,7 @@ const struct rig_caps ft1000mpmkvfld_caps = .get_vfo = ft1000mp_get_vfo, /* get vfo */ .set_split_vfo = ft1000mp_set_split_vfo, + .get_split_vfo = ft1000mp_get_split_vfo, .get_rit = ft1000mp_get_rit, .set_rit = ft1000mp_set_rit, @@ -1544,3 +1547,41 @@ int ft1000mp_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo) return RIG_OK; } + +/* + * get split + * + */ + +int ft1000mp_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo) +{ + struct ft1000mp_priv_data *p; + int retval; + + rig_debug(RIG_DEBUG_VERBOSE, "%s: called\n", __func__); + + + p = (struct ft1000mp_priv_data *)rig->state.priv; + + /* Get flags for split status */ + retval = ft1000mp_get_update_data(rig, FT1000MP_NATIVE_UPDATE, + FT1000MP_STATUS_FLAGS_LENGTH); + + if (retval < 0) + { + return retval; + } + + if (p->update_data[0] & 0x01) + { + *tx_vfo = RIG_VFO_B; + *split = RIG_SPLIT_ON; + } + else + { + *tx_vfo = RIG_VFO_A; + *split = RIG_SPLIT_OFF; + } + + return RIG_OK; +} diff --git a/rigs/yaesu/ft1000mp.h b/rigs/yaesu/ft1000mp.h index f04cc18b..fe2fbdc4 100644 --- a/rigs/yaesu/ft1000mp.h +++ b/rigs/yaesu/ft1000mp.h @@ -203,6 +203,7 @@ int ft1000mp_set_freq(RIG *rig, vfo_t vfo, freq_t freq); int ft1000mp_get_freq(RIG *rig, vfo_t vfo, freq_t *freq); int ft1000mp_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo); +int ft1000mp_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo); int ft1000mp_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width); /* select mode */ int ft1000mp_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width); /* get mode */ commit 542e227f85df8ebbacd7937af81c5dd61eea5a41 Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Jun 19 06:55:56 2020 -0500 Remove retries for rigctl.c rig_open as they were never used and didn't work diff --git a/tests/rigctl.c b/tests/rigctl.c index 8d065630..901a7e81 100644 --- a/tests/rigctl.c +++ b/tests/rigctl.c @@ -153,7 +153,6 @@ int main(int argc, char *argv[]) char send_cmd_term = '\r'; /* send_cmd termination char */ int ext_resp = 0; char resp_sep = '\n'; - int i; while (1) { @@ -524,19 +523,7 @@ int main(int argc, char *argv[]) exit(0); } - i = 0; - - do // we'll try 5 times and sleep 200ms between tries - { - retcode = rig_open(my_rig); - - if (retcode != RIG_OK) - { - hl_usleep(200000); - rig_debug(RIG_DEBUG_TRACE, "%s: error opening rig, try#%d\n", __func__, i + 1); - } - } - while (retcode != RIG_OK && ++i < 5); + retcode = rig_open(my_rig); if (retcode != RIG_OK) { commit 0ec3d475b577475188f55405b247f4bad378e659 Author: Michael Black W9MDB <mdb...@ya...> Date: Thu Jun 18 22:33:50 2020 -0500 Fix ft100mp set_split_vfo function diff --git a/rigs/yaesu/ft1000mp.c b/rigs/yaesu/ft1000mp.c index fe7e11eb..1a806461 100644 --- a/rigs/yaesu/ft1000mp.c +++ b/rigs/yaesu/ft1000mp.c @@ -1513,7 +1513,7 @@ static int ft1000mp_send_priv_cmd(RIG *rig, unsigned char ci) } -int newcat_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo) +int ft1000mp_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo) { // FT1000 transmits on A and receives on B ----------------------------------------------------------------------- Summary of changes: rigs/yaesu/ft1000mp.c | 55 ++++++++++++++++++++++++++++++++++++++++++++------- rigs/yaesu/ft1000mp.h | 1 + tests/rigctl.c | 15 +------------- 3 files changed, 50 insertions(+), 21 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2020-06-18 22:12: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 branch, master has been updated via a516e18ece89fc9d05484f23bd6f3d5a84121bf8 (commit) via ec15323293cc5633e2c7421d6093d0f8176199e3 (commit) from c66044f89bc55e24395d31c9d227c322b4b57de0 (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 a516e18ece89fc9d05484f23bd6f3d5a84121bf8 Author: Michael Black W9MDB <mdb...@ya...> Date: Thu Jun 18 17:09:50 2020 -0500 Adjust timeout values for netrigctl.c for 5 seconds total instead of 7.5 seconds https://github.com/Hamlib/Hamlib/issues/308 diff --git a/dummy/netrigctl.c b/dummy/netrigctl.c index 0d5a20a4..cf5f2818 100644 --- a/dummy/netrigctl.c +++ b/dummy/netrigctl.c @@ -2236,8 +2236,8 @@ struct rig_caps netrigctl_caps = .ptt_type = RIG_PTT_RIG_MICDATA, .dcd_type = RIG_DCD_RIG, .port_type = RIG_PORT_NETWORK, - .timeout = 2500, /* enough for a network */ - .retry = 3, + .timeout = 1000, /* enough for the worst rig we have */ + .retry = 5, /* 5 seconds total */ /* following fields updated in rig_state at openning time */ .has_get_func = RIG_FUNC_NONE, commit ec15323293cc5633e2c7421d6093d0f8176199e3 Author: Michael Black W9MDB <mdb...@ya...> Date: Thu Jun 18 17:08:12 2020 -0500 Adjust time values in ft1000mp.c based on testing with user https://github.com/Hamlib/Hamlib/issues/308 diff --git a/rigs/yaesu/ft1000mp.c b/rigs/yaesu/ft1000mp.c index 911e2879..fe7e11eb 100644 --- a/rigs/yaesu/ft1000mp.c +++ b/rigs/yaesu/ft1000mp.c @@ -230,8 +230,8 @@ const struct rig_caps ft1000mp_caps = .serial_handshake = RIG_HANDSHAKE_NONE, .write_delay = FT1000MP_WRITE_DELAY, .post_write_delay = FT1000MP_POST_WRITE_DELAY, - .timeout = 500, // was 2000 -- see https://github.com/Hamlib/Hamlib/issues/308 - .retry = 1, + .timeout = 400, // was 2000 -- see https://github.com/Hamlib/Hamlib/issues/308 + .retry = 6, .has_get_func = FT1000MP_FUNC_ALL, .has_set_func = FT1000MP_FUNC_ALL, .has_get_level = FT1000MP_LEVEL_GET, @@ -358,8 +358,8 @@ const struct rig_caps ft1000mpmkv_caps = .serial_handshake = RIG_HANDSHAKE_NONE, .write_delay = FT1000MP_WRITE_DELAY, .post_write_delay = FT1000MP_POST_WRITE_DELAY, - .timeout = 1000, - .retry = 1, + .timeout = 400, + .retry = 6, .has_get_func = FT1000MP_FUNC_ALL, .has_set_func = FT1000MP_FUNC_ALL, .has_get_level = FT1000MP_LEVEL_GET, @@ -486,8 +486,8 @@ const struct rig_caps ft1000mpmkvfld_caps = .serial_handshake = RIG_HANDSHAKE_NONE, .write_delay = FT1000MP_WRITE_DELAY, .post_write_delay = FT1000MP_POST_WRITE_DELAY, - .timeout = 1000, - .retry = 1, + .timeout = 400, + .retry = 6, .has_get_func = FT1000MP_FUNC_ALL, .has_set_func = FT1000MP_FUNC_ALL, .has_get_level = FT1000MP_LEVEL_GET, diff --git a/rigs/yaesu/ft1000mp.h b/rigs/yaesu/ft1000mp.h index b7838b8c..f04cc18b 100644 --- a/rigs/yaesu/ft1000mp.h +++ b/rigs/yaesu/ft1000mp.h @@ -30,7 +30,7 @@ #define FT1000MP_PACING_INTERVAL 5 #define FT1000MP_PACING_DEFAULT_VALUE 0 -#define FT1000MP_WRITE_DELAY 50 +#define FT1000MP_WRITE_DELAY 5 /* Delay sequential fast writes */ @@ -202,6 +202,8 @@ int ft1000mp_close(RIG *rig); int ft1000mp_set_freq(RIG *rig, vfo_t vfo, freq_t freq); int ft1000mp_get_freq(RIG *rig, vfo_t vfo, freq_t *freq); +int ft1000mp_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo); + int ft1000mp_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width); /* select mode */ int ft1000mp_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width); /* get mode */ ----------------------------------------------------------------------- Summary of changes: dummy/netrigctl.c | 4 ++-- rigs/yaesu/ft1000mp.c | 12 ++++++------ rigs/yaesu/ft1000mp.h | 4 +++- 3 files changed, 11 insertions(+), 9 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Nate B. <n0...@us...> - 2020-06-18 21:57: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, master has been updated via c66044f89bc55e24395d31c9d227c322b4b57de0 (commit) via 44a61ac9d908c1ffeb04b840aaaaca661f94b3c1 (commit) via 95e869d087a0d186835cdaad19be6a9e027b6ce7 (commit) via 90609a4bfc2dad91868f76e33860db225d66f964 (commit) from 5d890fd1735726148bbe69718e6bc209a0157d89 (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 c66044f89bc55e24395d31c9d227c322b4b57de0 Author: Michael Black W9MDB <mdb...@ya...> Date: Thu Jun 18 16:48:28 2020 -0500 Add set_split_vfo to ft1000mp.c diff --git a/rigs/yaesu/ft1000mp.c b/rigs/yaesu/ft1000mp.c index eec9b808..911e2879 100644 --- a/rigs/yaesu/ft1000mp.c +++ b/rigs/yaesu/ft1000mp.c @@ -230,7 +230,7 @@ const struct rig_caps ft1000mp_caps = .serial_handshake = RIG_HANDSHAKE_NONE, .write_delay = FT1000MP_WRITE_DELAY, .post_write_delay = FT1000MP_POST_WRITE_DELAY, - .timeout = 1000, // was 2000 -- see https://github.com/Hamlib/Hamlib/issues/308 + .timeout = 500, // was 2000 -- see https://github.com/Hamlib/Hamlib/issues/308 .retry = 1, .has_get_func = FT1000MP_FUNC_ALL, .has_set_func = FT1000MP_FUNC_ALL, @@ -325,6 +325,8 @@ const struct rig_caps ft1000mp_caps = .set_vfo = ft1000mp_set_vfo, /* set vfo */ .get_vfo = ft1000mp_get_vfo, /* get vfo */ + .set_split_vfo = ft1000mp_set_split_vfo, + .get_rit = ft1000mp_get_rit, .set_rit = ft1000mp_set_rit, .get_xit = ft1000mp_get_xit, @@ -451,6 +453,8 @@ const struct rig_caps ft1000mpmkv_caps = .set_vfo = ft1000mp_set_vfo, /* set vfo */ .get_vfo = ft1000mp_get_vfo, /* get vfo */ + .set_split_vfo = ft1000mp_set_split_vfo, + .get_rit = ft1000mp_get_rit, .set_rit = ft1000mp_set_rit, .get_xit = ft1000mp_get_xit, @@ -577,6 +581,8 @@ const struct rig_caps ft1000mpmkvfld_caps = .set_vfo = ft1000mp_set_vfo, /* set vfo */ .get_vfo = ft1000mp_get_vfo, /* get vfo */ + .set_split_vfo = ft1000mp_set_split_vfo, + .get_rit = ft1000mp_get_rit, .set_rit = ft1000mp_set_rit, .get_xit = ft1000mp_get_xit, @@ -1506,3 +1512,35 @@ static int ft1000mp_send_priv_cmd(RIG *rig, unsigned char ci) return RIG_OK; } + +int newcat_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo) +{ + // FT1000 transmits on A and receives on B + + unsigned char cmd_index = 0; /* index of sequence to send */ + + rig_debug(RIG_DEBUG_TRACE, "%s called rx_vfo=%s, tx_vfo=%s\n", __func__, + rig_strvfo(vfo), rig_strvfo(tx_vfo)); + + switch (split) + { + case RIG_SPLIT_OFF: + cmd_index = FT1000MP_NATIVE_SPLIT_OFF; + break; + + case RIG_SPLIT_ON: + cmd_index = FT1000MP_NATIVE_SPLIT_ON; + break; + + default: + rig_debug(RIG_DEBUG_VERBOSE, "%s: Unknown split value = %d\n", __func__, split); + return -RIG_EINVAL; /* sorry, wrong VFO */ + } + + rig->state.current_vfo = RIG_VFO_B; // Rx on VFO_B + rig->state.tx_vfo = RIG_VFO_A; + ft1000mp_send_priv_cmd(rig, FT1000MP_NATIVE_VFO_B); // make B active + ft1000mp_send_priv_cmd(rig, cmd_index); + + return RIG_OK; +} commit 44a61ac9d908c1ffeb04b840aaaaca661f94b3c1 Author: Michael Black W9MDB <mdb...@ya...> Date: Thu Jun 18 11:09:15 2020 -0500 Add debug for retry for ft1000mp https://github.com/Hamlib/Hamlib/issues/308 diff --git a/rigs/yaesu/ft1000mp.c b/rigs/yaesu/ft1000mp.c index d35513e9..eec9b808 100644 --- a/rigs/yaesu/ft1000mp.c +++ b/rigs/yaesu/ft1000mp.c @@ -1456,6 +1456,11 @@ static int ft1000mp_get_update_data(RIG *rig, unsigned char ci, ft1000mp_send_priv_cmd(rig, ci); n = read_block(&rig_s->rigport, (char *) p->update_data, rl); + + if (n == -RIG_ETIMEOUT) + { + rig_debug(RIG_DEBUG_TRACE, "%s: Timeout retry count = %d\n", __func__, retry); + } } while (retry-- && n == -RIG_ETIMEOUT); commit 95e869d087a0d186835cdaad19be6a9e027b6ce7 Author: Michael Black W9MDB <mdb...@ya...> Date: Thu Jun 18 10:54:21 2020 -0500 Fix ft1000mp to use rig->state retry value instead of caps https://github.com/Hamlib/Hamlib/issues/308 diff --git a/rigs/yaesu/ft1000mp.c b/rigs/yaesu/ft1000mp.c index 781707b7..d35513e9 100644 --- a/rigs/yaesu/ft1000mp.c +++ b/rigs/yaesu/ft1000mp.c @@ -215,7 +215,7 @@ const struct rig_caps ft1000mp_caps = RIG_MODEL(RIG_MODEL_FT1000MP), .model_name = "FT-1000MP", .mfg_name = "Yaesu", - .version = "20200617.0", + .version = "20200618.0", .copyright = "LGPL", .status = RIG_STATUS_BETA, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -341,7 +341,7 @@ const struct rig_caps ft1000mpmkv_caps = RIG_MODEL(RIG_MODEL_FT1000MPMKV), .model_name = "MARK-V FT-1000MP", .mfg_name = "Yaesu", - .version = "20200616.0", + .version = "20200618.0", .copyright = "LGPL", .status = RIG_STATUS_BETA, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -467,7 +467,7 @@ const struct rig_caps ft1000mpmkvfld_caps = RIG_MODEL(RIG_MODEL_FT1000MPMKVFLD), .model_name = "MARK-V Field FT-1000MP", .mfg_name = "Yaesu", - .version = "20200616.0", + .version = "20200618.0", .copyright = "LGPL", .status = RIG_STATUS_BETA, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -1316,7 +1316,7 @@ int ft1000mp_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) unsigned char lvl_data[YAESU_CMD_LENGTH]; int m; int retval; - int retry = rig->caps->retry; + int retry = rig->state.rigport.retry; rs = &rig->state; priv = (struct ft1000mp_priv_data *)rs->priv; @@ -1442,7 +1442,7 @@ static int ft1000mp_get_update_data(RIG *rig, unsigned char ci, struct rig_state *rig_s; struct ft1000mp_priv_data *p; int n; /* for read_ */ - int retry = rig->caps->retry; + int retry = rig->state.rigport.retry; rig_debug(RIG_DEBUG_VERBOSE, "%s: called\n", __func__); commit 90609a4bfc2dad91868f76e33860db225d66f964 Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Jun 17 22:29:32 2020 -0500 Move ft100mp get_vfo from init to open diff --git a/rigs/yaesu/ft1000mp.c b/rigs/yaesu/ft1000mp.c index 3027bb3c..781707b7 100644 --- a/rigs/yaesu/ft1000mp.c +++ b/rigs/yaesu/ft1000mp.c @@ -215,7 +215,7 @@ const struct rig_caps ft1000mp_caps = RIG_MODEL(RIG_MODEL_FT1000MP), .model_name = "FT-1000MP", .mfg_name = "Yaesu", - .version = "20200616.0", + .version = "20200617.0", .copyright = "LGPL", .status = RIG_STATUS_BETA, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -621,7 +621,6 @@ int ft1000mp_init(RIG *rig) FT1000MP_PACING_DEFAULT_VALUE; /* set pacing to minimum for now */ priv->read_update_delay = FT1000MP_DEFAULT_READ_TIMEOUT; /* set update timeout to safe value */ - ft1000mp_get_vfo(rig, &rig->state.current_vfo); return RIG_OK; } @@ -682,6 +681,7 @@ int ft1000mp_open(RIG *rig) cmd = p->p_cmd; write_block(&rig_s->rigport, (char *) cmd, YAESU_CMD_LENGTH); + ft1000mp_get_vfo(rig, &rig->state.current_vfo); /* TODO */ return RIG_OK; ----------------------------------------------------------------------- Summary of changes: rigs/yaesu/ft1000mp.c | 57 ++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 50 insertions(+), 7 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2020-06-18 03:25:19
|
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 5d890fd1735726148bbe69718e6bc209a0157d89 (commit) via 7520a3a70289a7f973dd0416189a898ef343271a (commit) via 5a65ae46921a0ad3f7fe1752e6e514dcb9817913 (commit) via 7e3ed7074aa2fb94124872182a794370d71d119e (commit) from e6a5e4ca31015e161a86a41871ba9123f149914d (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 5d890fd1735726148bbe69718e6bc209a0157d89 Merge: e6a5e4ca 7520a3a7 Author: Michael Black <mdb...@ya...> Date: Wed Jun 17 22:23:17 2020 -0500 Merge pull request #312 from w8wjb/alinco-dxsr8 Adding support for Alinco DX-SR8 commit 7520a3a70289a7f973dd0416189a898ef343271a Author: Weston Bustraan <wbu...@gm...> Date: Wed Jun 17 19:59:53 2020 -0400 DX-SR8 echos back the command sent to it. Need to read past that to get to the next line containing the value diff --git a/rigs/alinco/dxsr8.c b/rigs/alinco/dxsr8.c index 5d26e862..fa5be083 100644 --- a/rigs/alinco/dxsr8.c +++ b/rigs/alinco/dxsr8.c @@ -260,6 +260,18 @@ int dxsr8_transaction(RIG *rig, return retval; } + /* + * Transceiver sends an echo of cmd followed by a CR/LF + * TODO: check whether cmd and echobuf match (optional) + */ + retval = read_string(&rs->rigport, replybuf, BUFSZ, LF, strlen(LF)); + + if (retval < 0) + { + return retval; + } + + retval = read_string(&rs->rigport, replybuf, BUFSZ, LF, strlen(LF)); if (retval < 0) commit 5a65ae46921a0ad3f7fe1752e6e514dcb9817913 Author: Weston Bustraan <wbu...@gm...> Date: Wed Jun 17 17:13:20 2020 -0400 Initial implementation for Alinco DX-SR8T diff --git a/include/hamlib/riglist.h b/include/hamlib/riglist.h index ee75238c..0c4c5ae6 100644 --- a/include/hamlib/riglist.h +++ b/include/hamlib/riglist.h @@ -467,6 +467,7 @@ #define RIG_ALINCO 17 #define RIG_BACKEND_ALINCO "alinco" #define RIG_MODEL_DX77 RIG_MAKE_MODEL(RIG_ALINCO, 1) +#define RIG_MODEL_DXSR8 RIG_MAKE_MODEL(RIG_ALINCO, 2) /* diff --git a/rigs/alinco/Makefile.am b/rigs/alinco/Makefile.am index 4ceadc7e..e57ace4f 100644 --- a/rigs/alinco/Makefile.am +++ b/rigs/alinco/Makefile.am @@ -1,4 +1,4 @@ -ALINCOSRC = dx77.c alinco.c alinco.h +ALINCOSRC = dx77.c dxsr8.c alinco.c alinco.h noinst_LTLIBRARIES = libhamlib-alinco.la libhamlib_alinco_la_SOURCES = $(ALINCOSRC) diff --git a/rigs/alinco/alinco.c b/rigs/alinco/alinco.c index 2699f9c3..5537ffd9 100644 --- a/rigs/alinco/alinco.c +++ b/rigs/alinco/alinco.c @@ -30,5 +30,24 @@ #include <math.h> #include <hamlib/rig.h> +#include <register.h> #include "alinco.h" + + + +/* + * initrigs_alinco is called by rig_backend_load + */ +DECLARE_INITRIG_BACKEND(alinco) +{ + rig_register(&dx77_caps); + rig_register(&dxsr8_caps); + + return RIG_OK; +} + +/* + * Function definitions below + */ + diff --git a/rigs/alinco/alinco.h b/rigs/alinco/alinco.h index c1210f37..ac98d270 100644 --- a/rigs/alinco/alinco.h +++ b/rigs/alinco/alinco.h @@ -27,30 +27,12 @@ #define BACKEND_VER "20200323" -int alinco_set_vfo(RIG *rig, vfo_t vfo); -int alinco_get_vfo(RIG *rig, vfo_t *vfo); -int alinco_set_freq(RIG *rig, vfo_t vfo, freq_t freq); -int alinco_get_freq(RIG *rig, vfo_t vfo, freq_t *freq); -int alinco_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width); -int alinco_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width); -int alinco_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo); -int alinco_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo); -int alinco_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq); -int alinco_get_split_freq(RIG *rig, vfo_t vfo, freq_t *tx_freq); -int alinco_set_func(RIG *rig, vfo_t vfo, setting_t func, int status); -int alinco_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status); -int alinco_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val); -int alinco_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val); -int alinco_set_parm(RIG *rig, setting_t parm, value_t val); -int alinco_get_parm(RIG *rig, setting_t parm, value_t *val); -int alinco_set_ctcss_tone(RIG *rig, vfo_t vfo, tone_t tone); -int alinco_get_rit(RIG *rig, vfo_t vfo, shortfreq_t *rit); -int alinco_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt); -int alinco_get_dcd(RIG *rig, vfo_t vfo, dcd_t *dcd); -int alinco_set_mem(RIG *rig, vfo_t vfo, int ch); -int alinco_get_mem(RIG *rig, vfo_t vfo, int *ch); - extern const struct rig_caps dx77_caps; +extern const struct rig_caps dxsr8_caps; + +#define BUFSZ 32 + +#define AL "AL" #endif /* _ALINCO_H */ diff --git a/rigs/alinco/dx77.c b/rigs/alinco/dx77.c index 9168e225..d057440d 100644 --- a/rigs/alinco/dx77.c +++ b/rigs/alinco/dx77.c @@ -31,19 +31,11 @@ #include <hamlib/rig.h> -#include <serial.h> #include "idx_builtin.h" #include "alinco.h" +#include <serial.h> #include <misc.h> #include <cal.h> -#include <register.h> - -#define BUFSZ 32 - - -/* Line Feed */ -#define EOM "\x0d" -#define LF "\x0a" /* * modes in use by the "2G" command @@ -55,7 +47,10 @@ #define MD_AM '4' #define MD_FM '5' -#define AL "AL" +/* Line Feed */ +#define EOM "\x0d" +#define LF "\x0a" + #define CMD_TXFREQ "0A" /* Transmit frequency */ #define CMD_RXFREQ "0B" /* Receive frequency */ #define CMD_VFO "1A" @@ -120,6 +115,173 @@ { 216, 60 }, \ } } + +int dx77_set_vfo(RIG *rig, vfo_t vfo); +int dx77_get_vfo(RIG *rig, vfo_t *vfo); +int dx77_set_freq(RIG *rig, vfo_t vfo, freq_t freq); +int dx77_get_freq(RIG *rig, vfo_t vfo, freq_t *freq); +int dx77_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width); +int dx77_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width); +int dx77_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo); +int dx77_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo); +int dx77_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq); +int dx77_get_split_freq(RIG *rig, vfo_t vfo, freq_t *tx_freq); +int dx77_set_func(RIG *rig, vfo_t vfo, setting_t func, int status); +int dx77_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status); +int dx77_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val); +int dx77_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val); +int dx77_set_parm(RIG *rig, setting_t parm, value_t val); +int dx77_get_parm(RIG *rig, setting_t parm, value_t *val); +int dx77_set_ctcss_tone(RIG *rig, vfo_t vfo, tone_t tone); +int dx77_get_rit(RIG *rig, vfo_t vfo, shortfreq_t *rit); +int dx77_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt); +int dx77_get_dcd(RIG *rig, vfo_t vfo, dcd_t *dcd); +int dx77_set_mem(RIG *rig, vfo_t vfo, int ch); +int dx77_get_mem(RIG *rig, vfo_t vfo, int *ch); + + + +/* + * dx77 rig capabilities. + * + * protocol is documented at + * http://www.alinco.com/pdf.files/DX77-77_SOFTWARE_MANUAL.pdf + * + * This backend was a pleasure to develop. Documentation is clear, + * and the protocol logical. I'm wondering is the rig's good too. --SF + * + * TODO: + * - get_parm/set_parm and some LEVELs left (Set Data "2W" command). + * - tuner + * - up/down + * - scan + */ +const struct rig_caps dx77_caps = +{ + RIG_MODEL(RIG_MODEL_DX77), + .model_name = "DX-77", + .mfg_name = "Alinco", + .version = BACKEND_VER ".0", + .copyright = "LGPL", + .status = RIG_STATUS_BETA, + .rig_type = RIG_TYPE_TRANSCEIVER, + .ptt_type = RIG_PTT_NONE, + .dcd_type = RIG_DCD_RIG, + .port_type = RIG_PORT_SERIAL, + .serial_rate_min = 9600, + .serial_rate_max = 9600, + .serial_data_bits = 8, + .serial_stop_bits = 2, + .serial_parity = RIG_PARITY_NONE, + .serial_handshake = RIG_HANDSHAKE_NONE, + .write_delay = 0, + .post_write_delay = 0, + .timeout = 200, + .retry = 3, + + .has_get_func = DX77_FUNC, + .has_set_func = DX77_FUNC | RIG_FUNC_MON | RIG_FUNC_COMP, + .has_get_level = DX77_LEVEL_ALL, + .has_set_level = RIG_LEVEL_SET(DX77_LEVEL_ALL), + .has_get_parm = RIG_PARM_NONE, + .has_set_parm = RIG_PARM_SET(DX77_PARM_ALL), + .level_gran = + { + [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, + }, + .parm_gran = {}, + .ctcss_list = common_ctcss_list, + .dcs_list = NULL, + .preamp = { 10, RIG_DBLST_END }, + .attenuator = { 10, 20, RIG_DBLST_END }, + .max_rit = kHz(1), + .max_xit = Hz(0), + .max_ifshift = Hz(0), + .targetable_vfo = 0, + .transceive = RIG_TRN_OFF, + .bank_qty = 0, + .chan_desc_sz = 0, + + .chan_list = + { + { 0, 99, RIG_MTYPE_MEM }, + RIG_CHAN_END, + }, + + .rx_range_list1 = { RIG_FRNG_END, }, /* FIXME: enter region 1 setting */ + .tx_range_list1 = { RIG_FRNG_END, }, + .rx_range_list2 = + { + {kHz(500), MHz(30), DX77_ALL_MODES, -1, -1, DX77_VFO}, + RIG_FRNG_END, + }, + .tx_range_list2 = + { + {kHz(1800), MHz(2) - 100, DX77_OTHER_TX_MODES, W(10), W(100), DX77_VFO}, + {kHz(1800), MHz(2) - 100, DX77_AM_TX_MODES, W(4), W(40), DX77_VFO}, + {kHz(3500), MHz(4) - 100, DX77_OTHER_TX_MODES, W(10), W(100), DX77_VFO}, + {kHz(3500), MHz(4) - 100, DX77_AM_TX_MODES, W(4), W(40), DX77_VFO}, + {MHz(7), kHz(7300), DX77_OTHER_TX_MODES, W(10), W(100), DX77_VFO}, + {MHz(7), kHz(7300), DX77_AM_TX_MODES, W(4), W(40), DX77_VFO}, + {kHz(10100), kHz(10150), DX77_OTHER_TX_MODES, W(10), W(100), DX77_VFO}, + {kHz(10100), kHz(10150), DX77_AM_TX_MODES, W(4), W(40), DX77_VFO}, + {MHz(14), kHz(14350), DX77_OTHER_TX_MODES, W(10), W(100), DX77_VFO}, + {MHz(14), kHz(14350), DX77_AM_TX_MODES, W(4), W(40), DX77_VFO}, + {kHz(18068), kHz(18168), DX77_OTHER_TX_MODES, W(10), W(100), DX77_VFO}, + {kHz(18068), kHz(18168), DX77_AM_TX_MODES, W(4), W(40), DX77_VFO}, + {MHz(21), kHz(21450), DX77_OTHER_TX_MODES, W(10), W(100), DX77_VFO}, + {MHz(21), kHz(21450), DX77_AM_TX_MODES, W(4), W(40), DX77_VFO}, + {kHz(24890), kHz(24990), DX77_OTHER_TX_MODES, W(10), W(100), DX77_VFO}, + {kHz(24890), kHz(24990), DX77_AM_TX_MODES, W(4), W(40), DX77_VFO}, + {MHz(28), kHz(29700), DX77_OTHER_TX_MODES, W(10), W(100), DX77_VFO}, + {MHz(28), kHz(29700), DX77_AM_TX_MODES, W(4), W(40), DX77_VFO}, + RIG_FRNG_END, + }, + .tuning_steps = + { + {DX77_ALL_MODES, 10}, /* FIXME: add other ts */ + RIG_TS_END, + }, + /* mode/filter list, remember: order matters! */ + .filters = + { + {RIG_MODE_SSB | RIG_MODE_CW, kHz(2.7)}, + {RIG_MODE_CW, kHz(0.5)}, + {RIG_MODE_AM | RIG_MODE_FM, kHz(8)}, + {RIG_MODE_AM, kHz(2.7)}, + RIG_FLT_END, + }, + .str_cal = DX77_STR_CAL, + + .set_freq = dx77_set_freq, + .get_freq = dx77_get_freq, + .set_mode = dx77_set_mode, + .get_mode = dx77_get_mode, + .set_vfo = dx77_set_vfo, + .get_vfo = dx77_get_vfo, + .set_split_vfo = dx77_set_split_vfo, + .get_split_vfo = dx77_get_split_vfo, + .set_split_freq = dx77_set_split_freq, + .get_split_freq = dx77_get_split_freq, + .set_ctcss_tone = dx77_set_ctcss_tone, + .get_rit = dx77_get_rit, + .get_ptt = dx77_get_ptt, + .get_dcd = dx77_get_dcd, + .set_func = dx77_set_func, + .get_func = dx77_get_func, + .set_parm = dx77_set_parm, + .set_level = dx77_set_level, + .get_level = dx77_get_level, + .set_mem = dx77_set_mem, + .get_mem = dx77_get_mem, + +}; + + +/* + * Function definitions below + */ + /* * dx77_transaction * We assume that rig!=NULL, rig->state!= NULL, data!=NULL, data_len!=NULL @@ -132,6 +294,7 @@ int dx77_transaction(RIG *rig, char *data, int *data_len) { + int retval; struct rig_state *rs; char echobuf[BUFSZ + 1]; @@ -217,7 +380,6 @@ int dx77_transaction(RIG *rig, return RIG_OK; } - /* * dx77_set_vfo * Assumes rig!=NULL @@ -1293,155 +1455,3 @@ int dx77_get_mem(RIG *rig, vfo_t vfo, int *ch) return RIG_OK; } - -/* - * initrigs_alinco is called by rig_backend_load - */ -DECLARE_INITRIG_BACKEND(alinco) -{ - rig_register(&dx77_caps); - - return RIG_OK; -} - - - -/* - * dx77 rig capabilities. - * - * protocol is documented at - * http://www.alinco.com/pdf.files/DX77-77_SOFTWARE_MANUAL.pdf - * - * This backend was a pleasure to develop. Documentation is clear, - * and the protocol logical. I'm wondering is the rig's good too. --SF - * - * TODO: - * - get_parm/set_parm and some LEVELs left (Set Data "2W" command). - * - tuner - * - up/down - * - scan - */ -const struct rig_caps dx77_caps = -{ - RIG_MODEL(RIG_MODEL_DX77), - .model_name = "DX-77", - .mfg_name = "Alinco", - .version = BACKEND_VER ".0", - .copyright = "LGPL", - .status = RIG_STATUS_BETA, - .rig_type = RIG_TYPE_TRANSCEIVER, - .ptt_type = RIG_PTT_NONE, - .dcd_type = RIG_DCD_RIG, - .port_type = RIG_PORT_SERIAL, - .serial_rate_min = 9600, - .serial_rate_max = 9600, - .serial_data_bits = 8, - .serial_stop_bits = 2, - .serial_parity = RIG_PARITY_NONE, - .serial_handshake = RIG_HANDSHAKE_NONE, - .write_delay = 0, - .post_write_delay = 0, - .timeout = 200, - .retry = 3, - - .has_get_func = DX77_FUNC, - .has_set_func = DX77_FUNC | RIG_FUNC_MON | RIG_FUNC_COMP, - .has_get_level = DX77_LEVEL_ALL, - .has_set_level = RIG_LEVEL_SET(DX77_LEVEL_ALL), - .has_get_parm = RIG_PARM_NONE, - .has_set_parm = RIG_PARM_SET(DX77_PARM_ALL), - .level_gran = - { - [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, - }, - .parm_gran = {}, - .ctcss_list = common_ctcss_list, - .dcs_list = NULL, - .preamp = { 10, RIG_DBLST_END }, - .attenuator = { 10, 20, RIG_DBLST_END }, - .max_rit = kHz(1), - .max_xit = Hz(0), - .max_ifshift = Hz(0), - .targetable_vfo = 0, - .transceive = RIG_TRN_OFF, - .bank_qty = 0, - .chan_desc_sz = 0, - - .chan_list = - { - { 0, 99, RIG_MTYPE_MEM }, - RIG_CHAN_END, - }, - - .rx_range_list1 = { RIG_FRNG_END, }, /* FIXME: enter region 1 setting */ - .tx_range_list1 = { RIG_FRNG_END, }, - .rx_range_list2 = - { - {kHz(500), MHz(30), DX77_ALL_MODES, -1, -1, DX77_VFO}, - RIG_FRNG_END, - }, - .tx_range_list2 = - { - {kHz(1800), MHz(2) - 100, DX77_OTHER_TX_MODES, W(10), W(100), DX77_VFO}, - {kHz(1800), MHz(2) - 100, DX77_AM_TX_MODES, W(4), W(40), DX77_VFO}, - {kHz(3500), MHz(4) - 100, DX77_OTHER_TX_MODES, W(10), W(100), DX77_VFO}, - {kHz(3500), MHz(4) - 100, DX77_AM_TX_MODES, W(4), W(40), DX77_VFO}, - {MHz(7), kHz(7300), DX77_OTHER_TX_MODES, W(10), W(100), DX77_VFO}, - {MHz(7), kHz(7300), DX77_AM_TX_MODES, W(4), W(40), DX77_VFO}, - {kHz(10100), kHz(10150), DX77_OTHER_TX_MODES, W(10), W(100), DX77_VFO}, - {kHz(10100), kHz(10150), DX77_AM_TX_MODES, W(4), W(40), DX77_VFO}, - {MHz(14), kHz(14350), DX77_OTHER_TX_MODES, W(10), W(100), DX77_VFO}, - {MHz(14), kHz(14350), DX77_AM_TX_MODES, W(4), W(40), DX77_VFO}, - {kHz(18068), kHz(18168), DX77_OTHER_TX_MODES, W(10), W(100), DX77_VFO}, - {kHz(18068), kHz(18168), DX77_AM_TX_MODES, W(4), W(40), DX77_VFO}, - {MHz(21), kHz(21450), DX77_OTHER_TX_MODES, W(10), W(100), DX77_VFO}, - {MHz(21), kHz(21450), DX77_AM_TX_MODES, W(4), W(40), DX77_VFO}, - {kHz(24890), kHz(24990), DX77_OTHER_TX_MODES, W(10), W(100), DX77_VFO}, - {kHz(24890), kHz(24990), DX77_AM_TX_MODES, W(4), W(40), DX77_VFO}, - {MHz(28), kHz(29700), DX77_OTHER_TX_MODES, W(10), W(100), DX77_VFO}, - {MHz(28), kHz(29700), DX77_AM_TX_MODES, W(4), W(40), DX77_VFO}, - RIG_FRNG_END, - }, - .tuning_steps = - { - {DX77_ALL_MODES, 10}, /* FIXME: add other ts */ - RIG_TS_END, - }, - /* mode/filter list, remember: order matters! */ - .filters = - { - {RIG_MODE_SSB | RIG_MODE_CW, kHz(2.7)}, - {RIG_MODE_CW, kHz(0.5)}, - {RIG_MODE_AM | RIG_MODE_FM, kHz(8)}, - {RIG_MODE_AM, kHz(2.7)}, - RIG_FLT_END, - }, - .str_cal = DX77_STR_CAL, - - .set_freq = alinco_set_freq, - .get_freq = alinco_get_freq, - .set_mode = alinco_set_mode, - .get_mode = alinco_get_mode, - .set_vfo = alinco_set_vfo, - .get_vfo = alinco_get_vfo, - .set_split_vfo = alinco_set_split_vfo, - .get_split_vfo = alinco_get_split_vfo, - .set_split_freq = alinco_set_split_freq, - .get_split_freq = alinco_get_split_freq, - .set_ctcss_tone = alinco_set_ctcss_tone, - .get_rit = alinco_get_rit, - .get_ptt = alinco_get_ptt, - .get_dcd = alinco_get_dcd, - .set_func = alinco_set_func, - .get_func = alinco_get_func, - .set_parm = alinco_set_parm, - .set_level = alinco_set_level, - .get_level = alinco_get_level, - .set_mem = alinco_set_mem, - .get_mem = alinco_get_mem, - -}; - -/* - * Function definitions below - */ diff --git a/rigs/alinco/dxsr8.c b/rigs/alinco/dxsr8.c new file mode 100644 index 00000000..5d26e862 --- /dev/null +++ b/rigs/alinco/dxsr8.c @@ -0,0 +1,723 @@ +/* + * Hamlib Alinco backend - DXSR8 description + * Copyright (c) 2020 by Wes Bustraan (W8WJB) + * + * + * 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 + * + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include <stdlib.h> +#include <string.h> /* String function definitions */ +#include <unistd.h> /* UNIX standard function definitions */ + +#include <hamlib/rig.h> +#include <serial.h> +#include <misc.h> +#include <iofunc.h> +#include <num_stdio.h> +#include "idx_builtin.h" +#include "alinco.h" + + +#define DXSR8_ALL_MODES (RIG_MODE_USB|RIG_MODE_LSB|RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_AM|RIG_MODE_FM) +#define DXSR8_OTHER_TX_MODES (RIG_MODE_CW|RIG_MODE_SSB|RIG_MODE_FM) +#define DXSR8_AM_TX_MODES RIG_MODE_AM + +#define DXSR8_FUNC (RIG_FUNC_FAGC|RIG_FUNC_NB) + +#define DXSR8_LEVEL_ALL (RIG_LEVEL_RFPOWER|RIG_LEVEL_RF) + +#define DXSR8_PARM_ALL RIG_PARM_NONE + +#define DXSR8_VFO RIG_VFO_NONE + +/* Line Feed */ +#define EOM "\r\n" +#define LF "\n" + +#define MD_USB 0 +#define MD_LSB 1 +#define MD_CWU 2 +#define MD_CWL 3 +#define MD_AM 4 +#define MD_FM 5 + +int dxsr8_set_freq(RIG *rig, vfo_t vfo, freq_t freq); +int dxsr8_get_freq(RIG *rig, vfo_t vfo, freq_t *freq); +int dxsr8_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width); +int dxsr8_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width); +int dxsr8_set_func(RIG *rig, vfo_t vfo, setting_t func, int status); +int dxsr8_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status); +int dxsr8_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val); +int dxsr8_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val); +int dxsr8_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt); +int dxsr8_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt); + + +/* + * DX-SR8 rig capabilities. + * + * thanks to + * https://yo5ptd.wordpress.com/2017/02/12/alinco-dx-sr8/ + * for a partially documented protocol + */ +const struct rig_caps dxsr8_caps = +{ + RIG_MODEL(RIG_MODEL_DXSR8), + .model_name = "DX-SR8", + .mfg_name = "Alinco", + .version = BACKEND_VER ".0", + .copyright = "LGPL", + .status = RIG_STATUS_BETA, + .rig_type = RIG_TYPE_TRANSCEIVER, + .ptt_type = RIG_PTT_RIG, + .dcd_type = RIG_DCD_RIG, + .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 = 200, + .retry = 3, + + .has_get_func = DXSR8_FUNC, + .has_set_func = DXSR8_FUNC, + .has_get_level = DXSR8_LEVEL_ALL, + .has_set_level = RIG_LEVEL_SET(DXSR8_LEVEL_ALL), + .has_get_parm = RIG_PARM_NONE, + .has_set_parm = RIG_PARM_NONE, + .level_gran = + { + [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, + }, + .parm_gran = {}, + .ctcss_list = common_ctcss_list, + .dcs_list = NULL, + .preamp = { 10, RIG_DBLST_END }, + .attenuator = { 10, 20, RIG_DBLST_END }, + .max_rit = kHz(1.2), + .max_xit = kHz(1.2), + .max_ifshift = kHz(1.5), + .targetable_vfo = 0, + .transceive = RIG_TRN_OFF, + .bank_qty = 0, + .chan_desc_sz = 0, + + .chan_list = + { + { 0, 199, RIG_MTYPE_MEM }, + { 0, 199, RIG_MTYPE_MEM }, + RIG_CHAN_END, + }, + + .rx_range_list1 = + { + {kHz(135), MHz(30), DXSR8_ALL_MODES, -1, -1, DXSR8_VFO, 0, "DX-SR8T"}, + RIG_FRNG_END, + }, + .tx_range_list1 = + { + {kHz(1800), MHz(2) - 100, DXSR8_OTHER_TX_MODES, W(10), W(100), DXSR8_VFO, 0, "DX-SR8T"}, + {kHz(1800), MHz(2) - 100, DXSR8_AM_TX_MODES, W(4), W(40), DXSR8_VFO, 0, "DX-SR8T"}, + {kHz(3500), MHz(4) - 100, DXSR8_OTHER_TX_MODES, W(10), W(100), DXSR8_VFO, 0, "DX-SR8T"}, + {kHz(3500), MHz(4) - 100, DXSR8_AM_TX_MODES, W(4), W(40), DXSR8_VFO, 0, "DX-SR8T"}, + {5330500, 5330500, DXSR8_AM_TX_MODES, W(1), W(50), DXSR8_VFO, 0, "DX-SR8T"}, + {5346500, 5346500, DXSR8_AM_TX_MODES, W(1), W(50), DXSR8_VFO, 0, "DX-SR8T"}, + {5366500, 5366500, DXSR8_AM_TX_MODES, W(1), W(50), DXSR8_VFO, 0, "DX-SR8T"}, + {5371500, 5371500, DXSR8_AM_TX_MODES, W(1), W(50), DXSR8_VFO, 0, "DX-SR8T"}, + {5403500, 5403500, DXSR8_AM_TX_MODES, W(1), W(50), DXSR8_VFO, 0, "DX-SR8T"}, + {MHz(7), kHz(7300), DXSR8_OTHER_TX_MODES, W(10), W(100), DXSR8_VFO, 0, "DX-SR8T"}, + {MHz(7), kHz(7300), DXSR8_AM_TX_MODES, W(4), W(40), DXSR8_VFO, 0, "DX-SR8T"}, + {kHz(10100), kHz(10150), DXSR8_OTHER_TX_MODES, W(10), W(100), DXSR8_VFO, 0, "DX-SR8T"}, + {kHz(10100), kHz(10150), DXSR8_AM_TX_MODES, W(4), W(40), DXSR8_VFO, 0, "DX-SR8T"}, + {MHz(14), kHz(14350), DXSR8_OTHER_TX_MODES, W(10), W(100), DXSR8_VFO, 0, "DX-SR8T"}, + {MHz(14), kHz(14350), DXSR8_AM_TX_MODES, W(4), W(40), DXSR8_VFO, 0, "DX-SR8T"}, + {kHz(18068), kHz(18168), DXSR8_OTHER_TX_MODES, W(10), W(100), DXSR8_VFO, 0, "DX-SR8T"}, + {kHz(18068), kHz(18168), DXSR8_AM_TX_MODES, W(4), W(40), DXSR8_VFO, 0, "DX-SR8T"}, + {MHz(21), kHz(21450), DXSR8_OTHER_TX_MODES, W(10), W(100), DXSR8_VFO, 0, "DX-SR8T"}, + {MHz(21), kHz(21450), DXSR8_AM_TX_MODES, W(4), W(40), DXSR8_VFO, 0, "DX-SR8T"}, + {kHz(24890), kHz(24990), DXSR8_OTHER_TX_MODES, W(10), W(100), DXSR8_VFO, 0, "DX-SR8T"}, + {kHz(24890), kHz(24990), DXSR8_AM_TX_MODES, W(4), W(40), DXSR8_VFO, 0, "DX-SR8T"}, + {MHz(28), kHz(29700), DXSR8_OTHER_TX_MODES, W(10), W(100), DXSR8_VFO, 0, "DX-SR8T"}, + {MHz(28), kHz(29700), DXSR8_AM_TX_MODES, W(4), W(40), DXSR8_VFO, 0, "DX-SR8T"}, + RIG_FRNG_END, + }, + .rx_range_list2 = + { + {kHz(135), MHz(30), DXSR8_ALL_MODES, -1, -1, DXSR8_VFO, 0, "DX-SR8E"}, + RIG_FRNG_END, + }, + .tx_range_list2 = + { + {kHz(1800), MHz(2) - 100, DXSR8_OTHER_TX_MODES, W(10), W(100), DXSR8_VFO, 0, "DX-SR8E"}, + {kHz(1800), MHz(2) - 100, DXSR8_AM_TX_MODES, W(4), W(40), DXSR8_VFO, 0, "DX-SR8E"}, + {kHz(3500), MHz(4) - 100, DXSR8_OTHER_TX_MODES, W(10), W(100), DXSR8_VFO, 0, "DX-SR8E"}, + {kHz(3500), MHz(4) - 100, DXSR8_AM_TX_MODES, W(4), W(40), DXSR8_VFO, 0, "DX-SR8E"}, + {kHz(6900), kHz(7500), DXSR8_OTHER_TX_MODES, W(10), W(100), DXSR8_VFO, 0, "DX-SR8E"}, + {kHz(6900), kHz(7500), DXSR8_AM_TX_MODES, W(4), W(40), DXSR8_VFO, 0, "DX-SR8E"}, + {kHz(9900), kHz(10500), DXSR8_OTHER_TX_MODES, W(10), W(100), DXSR8_VFO, 0, "DX-SR8E"}, + {kHz(9900), kHz(10500), DXSR8_AM_TX_MODES, W(4), W(40), DXSR8_VFO, 0, "DX-SR8E"}, + {kHz(13900), kHz(14500), DXSR8_OTHER_TX_MODES, W(10), W(100), DXSR8_VFO, 0, "DX-SR8E"}, + {kHz(13900), kHz(14500), DXSR8_AM_TX_MODES, W(4), W(40), DXSR8_VFO, 0, "DX-SR8E"}, + {kHz(17900), kHz(18500), DXSR8_OTHER_TX_MODES, W(10), W(100), DXSR8_VFO, 0, "DX-SR8E"}, + {kHz(17900), kHz(18500), DXSR8_AM_TX_MODES, W(4), W(40), DXSR8_VFO, 0, "DX-SR8E"}, + {kHz(20900), kHz(21500), DXSR8_OTHER_TX_MODES, W(10), W(100), DXSR8_VFO, 0, "DX-SR8E"}, + {kHz(20900), kHz(21500), DXSR8_AM_TX_MODES, W(4), W(40), DXSR8_VFO, 0, "DX-SR8E"}, + {kHz(24400), kHz(25099), DXSR8_OTHER_TX_MODES, W(10), W(100), DXSR8_VFO, 0, "DX-SR8E"}, + {kHz(24400), kHz(25099), DXSR8_AM_TX_MODES, W(4), W(40), DXSR8_VFO, 0, "DX-SR8E"}, + {MHz(28), MHz(30), DXSR8_OTHER_TX_MODES, W(10), W(100), DXSR8_VFO, 0, "DX-SR8E"}, + {MHz(28), MHz(30), DXSR8_AM_TX_MODES, W(4), W(40), DXSR8_VFO, 0, "DX-SR8E"}, + RIG_FRNG_END, + }, + .tuning_steps = + { + {DXSR8_ALL_MODES, 10}, /* FIXME: add other ts */ + RIG_TS_END, + }, + /* mode/filter list, remember: order matters! */ + .filters = + { + {RIG_MODE_CW, kHz(1)}, + {RIG_MODE_CW, kHz(0.5)}, + {RIG_MODE_SSB, kHz(2.4)}, + {RIG_MODE_SSB, kHz(1)}, + {RIG_MODE_AM | RIG_MODE_FM, kHz(9)}, + {RIG_MODE_AM, kHz(2.4)}, + RIG_FLT_END, + }, + .set_freq = dxsr8_set_freq, // AL~RW_RXF14212000 + .get_freq = dxsr8_get_freq, // AL~RR_RXF + .set_mode = dxsr8_set_mode, // AL~RW_RFM00, AL~RW_NAR00 + .get_mode = dxsr8_get_mode, // AL~RR_RFM, AL~RR_NAR + .get_ptt = dxsr8_get_ptt, // AL~RR_PTT + .set_ptt = dxsr8_set_ptt, // AL~RW_PTT00 + .set_func = dxsr8_set_func, // AL~RW_AGC00, AL~RW_NZB00 + .get_func = dxsr8_get_func, // AL~RR_AGC, AL~RR_NZB + .set_level = dxsr8_set_level, // AL~RW_RFG00, AL~RW_PWR00 + .get_level = dxsr8_get_level, // AL~RR_RFG, AL~RR_PWR + +}; + +/* + * Function definitions below + */ + + +/* + * dxsr8_transaction + * We assume that rig!=NULL, rig->state!= NULL, data!=NULL, data_len!=NULL + * Otherwise, you'll get a nice seg fault. You've been warned! + * TODO: error case handling + */ +int dxsr8_transaction(RIG *rig, + const char *cmd, + int cmd_len, + char *data, + int *data_len) +{ + + int retval; + struct rig_state *rs; + char replybuf[BUFSZ + 1]; + int reply_len; + + if (cmd == NULL) + { + rig_debug(RIG_DEBUG_ERR, + "%s: null argument for cmd?\n", __func__); + return -RIG_EINTERNAL; + } + + rs = &rig->state; + + serial_flush(&rs->rigport); + + retval = write_block(&rs->rigport, cmd, cmd_len); + + if (retval != RIG_OK) + { + return retval; + } + + retval = read_string(&rs->rigport, replybuf, BUFSZ, LF, strlen(LF)); + + if (retval < 0) + { + return retval; + } + + /* no data expected, check for OK returned */ + if (data == NULL) + { + if (retval > 2) { retval -= 2; } + + replybuf[retval] = 0; + + if (strcmp(replybuf, "OK") == 0) + { + return RIG_OK; + } + else + { + return -RIG_ERJCTED; + } + } + + // strip CR/LF from string + reply_len = strcspn(replybuf, "\r\n"); + replybuf[reply_len] = 0; + + strcpy(data, replybuf); + *data_len = reply_len; + + return RIG_OK; +} + + +/** + * dxsr8_read_num + * Convenience function to read a numeric value from the radio + */ +int dxsr8_read_num(RIG *rig, + const char *cmd, + int *reply_num) +{ + int retval; + int reply_len; + char replybuf[10]; + + retval = dxsr8_transaction(rig, cmd, strlen(cmd), replybuf, &reply_len); + + if (retval != RIG_OK) + { + return retval; + } + + *reply_num = atoi(replybuf); + return RIG_OK; +} + +/* + * dxsr8_set_freq + * Assumes rig!=NULL + */ +int dxsr8_set_freq(RIG *rig, vfo_t vfo, freq_t freq) { + + char cmd[BUFSZ]; + int cmd_len; + + /* max 10 digits */ + if (freq >= GHz(10)) + { + return -RIG_EINVAL; + } + + cmd_len = sprintf(cmd, AL "~RW_RXF%08"PRIll EOM, (int64_t)freq); + return dxsr8_transaction(rig, cmd, cmd_len, NULL, NULL); +} + +/* + * dxsr8_get_freq + * Assumes rig!=NULL, freq!=NULL + */ +int dxsr8_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) { + int retval, data_len; + + char cmd[] = AL "~RR_RXF" EOM; + char freqbuf[BUFSZ]; + + retval = dxsr8_transaction(rig, cmd, strlen(cmd), freqbuf, &data_len); + + if (retval != RIG_OK) + { + return retval; + } + + /* extract RX freq */ + retval = num_sscanf(freqbuf, "%"SCNfreq, freq); + + return RIG_OK; +} + +/* + * dxsr8_set_mode + * Assumes rig!=NULL + */ +int dxsr8_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) { + char mdbuf[BUFSZ]; + int mdbuf_len, wide_filter, retval; + int amode; + + switch (mode) + { + case RIG_MODE_CW: amode = MD_CWU; break; + case RIG_MODE_CWR: amode = MD_CWL; break; + case RIG_MODE_USB: amode = MD_USB; break; + case RIG_MODE_LSB: amode = MD_LSB; break; + case RIG_MODE_FM: amode = MD_FM; break; + case RIG_MODE_AM: amode = MD_AM; break; + + default: + rig_debug(RIG_DEBUG_ERR, "dxsr8_set_mode: unsupported mode %s\n", + rig_strrmode(mode)); + + return -RIG_EINVAL; + } + + mdbuf_len = sprintf(mdbuf, AL "~RW_RFM%02d" EOM, amode); + retval = dxsr8_transaction(rig, mdbuf, mdbuf_len, NULL, NULL); + + if (retval != RIG_OK) + { + return retval; + } + + if (width == RIG_PASSBAND_NOCHANGE) { return retval; } + + if (width != RIG_PASSBAND_NORMAL + && width < rig_passband_normal(rig, mode)) + { + wide_filter = 1; // AL~RW_NAR01 Set narrow bandwidth + } + else + { + wide_filter = 0; // AL~RW_NAR00 Set wide bandwidth + } + + mdbuf_len = sprintf(mdbuf, AL "~RW_NAR%02d" EOM, wide_filter); + retval = dxsr8_transaction(rig, mdbuf, mdbuf_len, NULL, NULL); + + return retval; +} + +/* + * dxsr8_get_mode + * Assumes rig!=NULL, mode!=NULL + */ +int dxsr8_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) { + + int retval; + int amode; + int filter; + + retval = dxsr8_read_num(rig, AL "~RR_RFM" EOM, &amode); + if (retval != RIG_OK) + { + return retval; + } + + switch (amode) + { + case MD_CWL: + case MD_CWU: *mode = RIG_MODE_CW; break; + case MD_USB: *mode = RIG_MODE_USB; break; + case MD_LSB: *mode = RIG_MODE_LSB; break; + case MD_AM: *mode = RIG_MODE_AM; break; + case MD_FM: *mode = RIG_MODE_FM; break; + + default: + rig_debug(RIG_DEBUG_ERR, + "dxsr8_get_mode: unknown mode %02d\n", + amode); + + return -RIG_EINVAL; + } + + retval = dxsr8_read_num(rig, AL "~RR_NAR" EOM, &filter); + + if (filter == 0) + { + *width = rig_passband_wide(rig, *mode); + } else { + *width = rig_passband_normal(rig, *mode); + } + + return RIG_OK; +} + +/* + * dxsr8_set_func + * Assumes rig!=NULL + */ +int dxsr8_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) { + + int cmd_len; + char cmd[BUFSZ]; + + switch (func) + { + case RIG_FUNC_FAGC: + cmd_len = sprintf(cmd, AL "~RW_AGC%02d" EOM, status ? 0 : 1); + + return dxsr8_transaction(rig, cmd, cmd_len, NULL, NULL); + + case RIG_FUNC_NB: + cmd_len = sprintf(cmd, AL "~RW_NZB%d" EOM, status ? 1 : 0); + + return dxsr8_transaction(rig, cmd, cmd_len, NULL, NULL); + + + default: + rig_debug(RIG_DEBUG_ERR, "Unsupported set_func %d\n", (int)func); + return -RIG_EINVAL; + } + + return RIG_OK; +} + +/* + * dxsr8_get_func + * Assumes rig!=NULL, status!=NULL + */ +int dxsr8_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status) { + + int retval; + int setting; + + switch (func) + { + case RIG_FUNC_FAGC: + retval = dxsr8_read_num(rig, AL "~RR_AGC" EOM, &setting); + + if (retval != RIG_OK) + { + return retval; + } + + // 00 = Fast AGC + // 01 = Slow AGC + *status = setting ? 0 : 1; + break; + + case RIG_FUNC_NB: + retval = dxsr8_read_num(rig, AL "~RR_NZB" EOM, &setting); + + if (retval != RIG_OK) + { + return retval; + } + + // 00 = noise blanker off + // 01 = noise blanker on + *status = setting ? 1 : 0; + break; + + + default: + rig_debug(RIG_DEBUG_ERR, "Unsupported get_func %d\n", (int)func); + return -RIG_EINVAL; + } + + return RIG_OK; +} + +/* + * dxsr8_set_level + * Assumes rig!=NULL + * FIXME: cannot support PREAMP and ATT both at same time (make sense though) + */ +int dxsr8_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) { + int cmd_len, lvl; + char cmd[BUFSZ]; + + switch (level) + { + case RIG_LEVEL_PREAMP: + switch (val.i) + { + case 0: lvl = 0; break; // AL~RW_RFG00 - RF gain 0dB + case 10: lvl = 3; break; // AL~RW_RFG03 - RF gain +10dB + + default: rig_debug(RIG_DEBUG_ERR, + "Unsupported Preamp %d\n", + val.i); + + return -RIG_EINVAL; + } + + cmd_len = sprintf(cmd, AL "~RW_RFG%02d" EOM, lvl); + return dxsr8_transaction(rig, cmd, cmd_len, NULL, NULL); + + case RIG_LEVEL_ATT: + switch (val.i) + { + case 0: lvl = 0; break; // AL~RW_RFG00 - RF gain 0dB + case 10: lvl = 1; break; // AL~RW_RFG01 - RF gain -10dB + case 20: lvl = 2; break; // AL~RW_RFG02 - RF gain -20dB + + default: rig_debug(RIG_DEBUG_ERR, + "Unsupported Att %d\n", + val.i); + + return -RIG_EINVAL; + } + + cmd_len = sprintf(cmd, AL "~RW_RFG%02d" EOM, lvl); + return dxsr8_transaction(rig, cmd, cmd_len, NULL, NULL); + + case RIG_LEVEL_RFPOWER: + + if (val.f <= 0.01) { + lvl = 2; // AL~RW_PWR02 - Sub low power (QRP mode) + } else if (val.f <= 0.1) { + lvl = 1; // AL~RW_PWR01 - Low power + } else { + lvl = 0; // AL~RW_PWR00 - High power + } + + cmd_len = sprintf(cmd, AL "~RW_PWR%02d" EOM, lvl); + return dxsr8_transaction(rig, cmd, cmd_len, NULL, NULL); + + default: + rig_debug(RIG_DEBUG_ERR, "Unsupported set_level %s\n", rig_strlevel(level)); + + return -RIG_EINVAL; + } + + return RIG_OK; +} + +/* + * dxsr8_get_level + * Assumes rig!=NULL, val!=NULL + */ +int dxsr8_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) { + + int retval; + int lvl; + + switch (level) + { + + case RIG_LEVEL_PREAMP: + retval = dxsr8_read_num(rig, AL "~RR_RFG" EOM, &lvl); + + if (retval != RIG_OK) + { + return retval; + } + + switch (lvl) { + case 0: + val->i = 0; break; // RF gain 0dB + case 3: + val->i = 10; break; // RF gain +10dB + default: + rig_debug(RIG_DEBUG_ERR, "Unknown RF Gain %02d\n", lvl); + } + + break; + + case RIG_LEVEL_ATT: + retval = dxsr8_read_num(rig, AL "~RR_RFG" EOM, &lvl); + + if (retval != RIG_OK) + { + return retval; + } + + switch (lvl) { + case 0: + val->i = 0; break; // RF gain 0dB + case 1: + val->i = 10; break; // RF gain -10dB + case 2: + val->i = 10; break; // RF gain -20dB + default: + rig_debug(RIG_DEBUG_ERR, "Unknown RF Gain %02d\n", lvl); + } + + break; + + case RIG_LEVEL_RFPOWER: + + retval = dxsr8_read_num(rig, AL "~RR_PWR" EOM, &lvl); + + if (retval != RIG_OK) + { + return retval; + } + + switch (lvl) + { + case 0: // 00 - High power + val->f = 1.0; // 100 W + break; + + case 1: // 01 - Low power + val->f = 0.1; // 10 W + break; + + case 3: // 02 - Sub low power (QRP mode) + val->f = 0.01; // 1 W + break; + + default: + rig_debug(RIG_DEBUG_ERR, "Unknown RF Power %02d\n", lvl); + break; + } + + break; + + default: + rig_debug(RIG_DEBUG_ERR, "Unsupported get_level %s\n", rig_strlevel(level)); + + return -RIG_EINVAL; + } + + return RIG_OK; +} + +/* + * dxsr8_get_ptt + * Assumes rig!=NULL, ptt!=NULL + */ +int dxsr8_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt) { + + int retval; + int pttval; + + retval = dxsr8_read_num(rig, AL "~RR_PTT" EOM, &pttval); + + if (retval != RIG_OK) + { + return retval; + } + + *ptt = pttval ? RIG_PTT_ON : RIG_PTT_OFF; + return RIG_OK; +} + +/* + * dxsr8_set_ptt + * Assumes rig!=NULL + */ +int dxsr8_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) { + + char cmd[BUFSZ]; + int cmd_len; + + cmd_len = sprintf(cmd, AL "~RW_PTT%02d" EOM, ptt); + return dxsr8_transaction(rig, cmd, cmd_len, NULL, NULL); +} \ No newline at end of file commit 7e3ed7074aa2fb94124872182a794370d71d119e Author: Weston Bustraan <wbu...@gm...> Date: Tue Jun 16 16:46:53 2020 -0400 Moved Alinco DX-77-specific functions out of alinco.c and into dx77.c. The protocol used by the DX-77 is different than the DX-SR* line diff --git a/rigs/alinco/alinco.c b/rigs/alinco/alinco.c index daa2ec1f..2699f9c3 100644 --- a/rigs/alinco/alinco.c +++ b/rigs/alinco/alinco.c @@ -30,1246 +30,5 @@ #include <math.h> #include <hamlib/rig.h> -#include <serial.h> -#include <misc.h> -#include <cal.h> -#include <register.h> #include "alinco.h" - - -/* Line Feed */ -#define EOM "\x0d" -#define LF "\x0a" - -#define BUFSZ 32 - -/* - * modes in use by the "2G" command - */ -#define MD_LSB '0' -#define MD_USB '1' -#define MD_CWL '2' -#define MD_CWU '3' -#define MD_AM '4' -#define MD_FM '5' - -#define AL "AL" -#define CMD_TXFREQ "0A" /* Transmit frequency */ -#define CMD_RXFREQ "0B" /* Receive frequency */ -#define CMD_VFO "1A" -#define CMD_MEMMD "1B" /* Memory mode */ -#define CMD_CHAN "1D" /* Channel Display */ -#define CMD_UPDWN "2A" /* UP/DOWN */ -#define CMD_MON "2B" /* Check Transmit Frequency */ -#define CMD_PWR "2C" /* Transmit Output Power */ -#define CMD_SCAN "2D" /* Scanning */ -#define CMD_PRIO "2E" /* Priority */ -#define CMD_SPLT "2F" /* Split */ -#define CMD_MODE "2G" /* Mode */ -#define CMD_RFGAIN "2H" /* RF Gain */ -#define CMD_AGC "2I" -#define CMD_FLTER "2J" /* Filter */ -#define CMD_NB "2K" -#define CMD_CTCSS "2L" -#define CMD_TUNE "2M" -#define CMD_SELECT "2N" -#define CMD_MCALL "2V" /* Memory Channel Call Up */ -#define CMD_SDATA "2W" /* Set Data */ - -/* Data Output Commands */ -#define CMD_SMETER "3A" /* S-meter read */ -#define CMD_PTT "3B" /* PTT status read */ -#define CMD_SQL "3C" /* Squelch status */ -#define CMD_RIT "3D" /* RIT status */ -#define CMD_RMEM "3E" /* Current Memory-channel Number read */ -#define CMD_RMV "3G" /* Memory/VFO -mode read */ -#define CMD_RDATA "3H" /* Current Data read */ -#define CMD_RSPLT "3I" /* Split read */ -#define CMD_RPOWER "3J" /* Transmitter Output read */ -#define CMD_RSELECT "3K" /* SELECT Postion read */ - - -/* - * alinco_transaction - * We assume that rig!=NULL, rig->state!= NULL, data!=NULL, data_len!=NULL - * Otherwise, you'll get a nice seg fault. You've been warned! - * TODO: error case handling - */ -int alinco_transaction(RIG *rig, - const char *cmd, - int cmd_len, - char *data, - int *data_len) -{ - int retval; - struct rig_state *rs; - char echobuf[BUFSZ + 1]; - - if (cmd == NULL) - { - rig_debug(RIG_DEBUG_ERR, - "%s: null argument for cmd?\n", __func__); - return -RIG_EINTERNAL; - } - - rs = &rig->state; - - serial_flush(&rs->rigport); - - retval = write_block(&rs->rigport, cmd, cmd_len); - - if (retval != RIG_OK) - { - return retval; - } - - /* - * Transceiver sends an echo of cmd followed by a CR/LF - * TODO: check whether cmd and echobuf match (optional) - */ - retval = read_string(&rs->rigport, echobuf, BUFSZ, LF, strlen(LF)); - - if (retval < 0) - { - return retval; - } - - if (!(data && data_len)) - { - rig_debug(RIG_DEBUG_ERR, "%s: data and datalen not both NULL??\n", __func__); - return -RIG_EINTERNAL; - } - - /* no data expected, check for OK returned */ - if (data == NULL) - { - retval = read_string(&rs->rigport, echobuf, BUFSZ, LF, strlen(LF)); - - if (retval < 0) - { - return retval; - } - - if (retval > 2) { retval -= 2; } - - echobuf[retval] = 0; - - if (strcmp(echobuf, "OK") == 0) - { - return RIG_OK; - } - else - { - return -RIG_ERJCTED; - } - } - - retval = read_string(&rs->rigport, data, BUFSZ, LF, strlen(LF)); - - if (retval < 0) - { - return retval; - } - - *data_len = retval; - - /* strip CR/LF from string - */ - data[0] = 0; - - if (*data_len > 2) - { - *data_len -= 2; - data[*data_len] = 0; - } - - return RIG_OK; -} - - -/* - * alinco_set_vfo - * Assumes rig!=NULL - */ -int alinco_set_vfo(RIG *rig, vfo_t vfo) -{ - char cmdbuf[BUFSZ]; - int cmd_len; - char vfo_num; - - switch (vfo) - { - case RIG_VFO_A: vfo_num = '1'; break; - - case RIG_VFO_B: vfo_num = '2'; break; - - case RIG_VFO_MEM: - return alinco_transaction(rig, - AL CMD_MEMMD "0" EOM, - strlen(AL CMD_MEMMD "0" EOM), - NULL, - NULL); - - default: - rig_debug(RIG_DEBUG_ERR, - "alinco_set_vfo: unsupported VFO %s\n", - rig_strvfo(vfo)); - - return -RIG_EINVAL; - } - - cmd_len = sprintf(cmdbuf, AL CMD_VFO "%c" EOM, vfo_num); - - return alinco_transaction(rig, cmdbuf, cmd_len, NULL, NULL); -} - - -/* - * alinco_get_vfo - * Assumes rig!=NULL, !vfo - */ -int alinco_get_vfo(RIG *rig, vfo_t *vfo) -{ - char vfobuf[BUFSZ]; - int vfo_len, retval; - - retval = alinco_transaction(rig, - AL CMD_RMV EOM, - strlen(AL CMD_RMV EOM), - vfobuf, - &vfo_len); - - if (retval != RIG_OK) - { - return retval; - } - - if (vfo_len != 4) - { - rig_debug(RIG_DEBUG_ERR, - "alinco_get_vfo: wrong answer %s, " - "len=%d\n", - vfobuf, - vfo_len); - - return -RIG_ERJCTED; - } - - vfobuf[vfo_len] = '\0'; - - if (!strcmp(vfobuf, "VFOA")) - { - *vfo = RIG_VFO_A; - } - else if (!strcmp(vfobuf, "VFOB")) - { - *vfo = RIG_VFO_B; - } - else if (!strcmp(vfobuf, "MEMO")) - { - *vfo = RIG_VFO_MEM; - } - else - { - rig_debug(RIG_DEBUG_ERR, - "alinco_get_vfo: unsupported VFO %s\n", - vfobuf); - - return -RIG_EPROTO; - } - - return RIG_OK; -} - - -/* - * alinco_set_freq - * Assumes rig!=NULL - */ -int alinco_set_freq(RIG *rig, vfo_t vfo, freq_t freq) -{ - char freqbuf[BUFSZ]; - int freq_len; - - /* max 10 digits */ - if (freq >= GHz(10)) - { - return -RIG_EINVAL; - } - - /* at least 6 digits */ - // cppcheck-suppress * - freq_len = sprintf(freqbuf, AL CMD_RXFREQ "%06"PRIll EOM, (int64_t)freq); - - return alinco_transaction(rig, freqbuf, freq_len, NULL, NULL); -} - - -/* - * where databuf points to a 26 char long buffer - */ -static int current_data_read(RIG *rig, char *databuf) -{ - int data_len, retval; - - retval = alinco_transaction(rig, - AL CMD_RDATA EOM, - strlen(AL CMD_RDATA EOM), - databuf, - &data_len); - - if (retval != RIG_OK) - { - return retval; - } - - if (data_len != 26) - { - rig_debug(RIG_DEBUG_ERR, - "alinco_current_data_read: wrong answer %s, len=%d\n", - databuf, - data_len); - - return -RIG_ERJCTED; - } - - return RIG_OK; -} - - -/* - * alinco_get_freq - * Assumes rig!=NULL, freq!=NULL - */ -int alinco_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) -{ - int retval; - char freqbuf[BUFSZ]; - - retval = current_data_read(rig, freqbuf); - - if (retval != RIG_OK) - { - return retval; - } - - /* extract RX freq */ - freqbuf[16] = '\0'; - sscanf(freqbuf + 6, "%"SCNfreq, freq); - - return RIG_OK; -} - - -/* - * alinco_set_mode - * Assumes rig!=NULL - */ -int alinco_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) -{ - char mdbuf[BUFSZ]; - int mdbuf_len, wide_filter, retval; - char amode; - - switch (mode) - { - /* FIXME: MD_CWL or MD_CWU? */ - case RIG_MODE_CW: amode = MD_CWU; break; - - case RIG_MODE_USB: amode = MD_USB; break; - - case RIG_MODE_LSB: amode = MD_LSB; break; - - case RIG_MODE_FM: amode = MD_FM; break; - - case RIG_MODE_AM: amode = MD_AM; break; - - default: - rig_debug(RIG_DEBUG_ERR, "alinco_set_mode: unsupported mode %s\n", - rig_strrmode(mode)); - - return -RIG_EINVAL; - } - - mdbuf_len = sprintf(mdbuf, AL CMD_MODE "%c" EOM, amode); - retval = alinco_transaction(rig, mdbuf, mdbuf_len, NULL, NULL); - - if (retval != RIG_OK) - { - return retval; - } - - if (width == RIG_PASSBAND_NOCHANGE) { return retval; } - - /* - * TODO: please DX77 owners, check this, I'm not sure - * which passband is default! - */ - if (width != RIG_PASSBAND_NORMAL - && width < rig_passband_normal(rig, mode)) - { - wide_filter = 0; - } - else - { - wide_filter = 1; - } - - mdbuf_len = sprintf(mdbuf, AL CMD_FLTER "%02d" EOM, wide_filter); - retval = alinco_transaction(rig, mdbuf, mdbuf_len, NULL, NULL); - - return retval; -} - - -/* - * alinco_get_mode - * Assumes rig!=NULL, mode!=NULL - */ -int alinco_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) -{ - int retval; - int settings; - char modebuf[BUFSZ]; - - retval = current_data_read(rig, modebuf); - - if (retval != RIG_OK) - { - return retval; - } - - /* FIXME: CWL&CWU: what are they? CW & CWR? */ - switch (modebuf[3]) - { - case MD_CWL: - case MD_CWU: *mode = RIG_MODE_CW; break; - - case MD_USB: *mode = RIG_MODE_USB; break; - - case MD_LSB: *mode = RIG_MODE_LSB; break; - - case MD_AM: *mode = RIG_MODE_AM; break; - - case MD_FM: *mode = RIG_MODE_FM; break; - - default: - rig_debug(RIG_DEBUG_ERR, - "alinco_get_mode: unknown mode %c%c\n", - modebuf[2], - modebuf[3]); - - return -RIG_EINVAL; - } - - modebuf[2] = '\0'; - settings = strtol(modebuf, (char **)NULL, 16); - - /* - * TODO: please DX77 owners, check this, I'm not sure - * which passband is default! - */ - if (settings & 0x02) - { - *width = rig_passband_narrow(rig, *mode); - } - else - { - *width = rig_passband_normal(rig, *mode); - } - - return RIG_OK; -} - - -/* - * alinco_set_split - * Assumes rig!=NULL - */ -int alinco_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo) -{ - int cmd_len; - char cmdbuf[BUFSZ]; - - cmd_len = sprintf(cmdbuf, - AL CMD_SPLT "%d" EOM, - split == RIG_SPLIT_ON ? 1 : 0); - - return alinco_transaction(rig, cmdbuf, cmd_len, NULL, NULL); -} - - -/* - * alinco_get_split - * Assumes rig!=NULL, split!=NULL - */ -int alinco_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo) -{ - int splt_len, retval; - char spltbuf[BUFSZ]; - - retval = alinco_transaction(rig, - AL CMD_RSPLT EOM, - strlen(AL CMD_RSPLT EOM), - spltbuf, - &splt_len); - - if (retval != RIG_OK) - { - return retval; - } - - if (splt_len != 2) - { - rig_debug(RIG_DEBUG_ERR, - "alinco_get_split: wrong answer %s, len=%d\n", - spltbuf, - splt_len); - - return -RIG_ERJCTED; - } - - spltbuf[splt_len] = '\0'; - - if (!strcmp(spltbuf, "OF")) - { - *split = RIG_SPLIT_OFF; - } - else if (!strcmp(spltbuf, "ON")) - { - *split = RIG_SPLIT_ON; - } - else - { - rig_debug(RIG_DEBUG_ERR, - "alinco_get_split: unsupported SPLIT %s\n", - spltbuf); - - return -RIG_EPROTO; - } - - return RIG_OK; -} - - -/* - * alinco_set_split_freq - * Assumes rig!=NULL - */ -int alinco_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq) -{ - char freqbuf[BUFSZ]; - int freq_len; - int retval; - - /* max 10 digits */ - if (tx_freq >= GHz(10)) - { - return -RIG_EINVAL; - } - - /* at least 6 digits */ - freq_len = sprintf(freqbuf, AL CMD_TXFREQ "%06"PRIll EOM, (int64_t)tx_freq); - - retval = alinco_transaction(rig, freqbuf, freq_len, NULL, NULL); - - return retval; -} - - -/* - * alinco_get_split_freq - * Assumes rig!=NULL, rx_freq!=NULL, tx_freq!=NULL - */ -int alinco_get_split_freq(RIG *rig, vfo_t vfo, freq_t *tx_freq) -{ - int retval; - char freqbuf[BUFSZ]; - - retval = current_data_read(rig, freqbuf); - - if (retval != RIG_OK) - { - return retval; - } - - /* extract TX freq first, as RX kills freqbuf[16] */ - freqbuf[26] = '\0'; - sscanf(freqbuf + 16, "%"SCNfreq, tx_freq); - - return RIG_OK; -} - - -/* - * alinco_get_rit - * Assumes rig!=NULL, split!=NULL - */ -int alinco_get_rit(RIG *rig, vfo_t vfo, shortfreq_t *rit) -{ - int rit_len, retval; - char ritbuf[BUFSZ]; - - /* read in Hertz unit */ - retval = alinco_transaction(rig, - AL CMD_RIT "0" EOM, - strlen(AL CMD_RIT "0" EOM), - ritbuf, - &rit_len); - - if (retval != RIG_OK) - { - return retval; - } - - if (rit_len != 8) /* || (ritbuf[0] != '+' && ritbuf[0] != '-')) { */ - { - rig_debug(RIG_DEBUG_ERR, - "alinco_get_rit: wrong answer %s, len=%d\n", - ritbuf, - rit_len); - - return -RIG_ERJCTED; - } - - ritbuf[rit_len] = '\0'; - ritbuf[0] = ' '; - ritbuf[1] = ' '; - ritbuf[2] = ' '; - - *rit = atoi(ritbuf); - - return RIG_OK; -} - - -/* - * alinco_set_func - * Assumes rig!=NULL - */ -int alinco_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) -{ - int cmd_len; - char cmdbuf[BUFSZ]; - - /* Optimize: - * sort the switch cases with the most frequent first - */ - switch (func) - { - case RIG_FUNC_TONE: - cmd_len = sprintf(cmdbuf, AL CMD_CTCSS "%02d" EOM, status ? 51 : 0); - - return alinco_transaction(rig, cmdbuf, cmd_len, NULL, NULL); - - case RIG_FUNC_FAGC: - cmd_len = sprintf(cmdbuf, AL CMD_AGC "%02d" EOM, status ? 1 : 2); - - return alinco_transaction(rig, cmdbuf, cmd_len, NULL, NULL); - - case RIG_FUNC_NB: - cmd_len = sprintf(cmdbuf, AL CMD_NB "%d" EOM, status ? 1 : 0); - - return alinco_transaction(rig, cmdbuf, cmd_len, NULL, NULL); - - case RIG_FUNC_COMP: - cmd_len = sprintf(cmdbuf, AL CMD_SDATA "C%d" EOM, status ? 1 : 0); - return alinco_transaction(rig, cmdbuf, cmd_len, NULL, NULL); - - case RIG_FUNC_MON: - cmd_len = sprintf(cmdbuf, AL CMD_MON "%d" EOM, status ? 1 : 0); - - return alinco_transaction(rig, cmdbuf, cmd_len, NULL, NULL); - - default: - rig_debug(RIG_DEBUG_ERR, "Unsupported set_func %d\n", (int)func); - return -RIG_EINVAL; - } - - return RIG_OK; -} - - -/* - * alinco_get_func - * Assumes rig!=NULL, status!=NULL - */ -int alinco_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status) -{ - int retval; - int settings; - char funcbuf[BUFSZ]; - - /* Optimize: - * sort the switch cases with the most frequent first - */ - switch (func) - { - case RIG_FUNC_TONE: - retval = current_data_read(rig, funcbuf); - - if (retval != RIG_OK) - { - return retval; - } - - funcbuf[2] = '\0'; - settings = strtol(funcbuf, (char **)NULL, 16); - *status = (settings & 0x08) ? 1 : 0; - break; - - case RIG_FUNC_FAGC: - retval = current_data_read(rig, funcbuf); - - if (retval != RIG_OK) - { - return retval; - } - - funcbuf[2] = '\0'; - settings = strtol(funcbuf, (char **)NULL, 16); - *status = (settings & 0x01) ? 1 : 0; - break; - - case RIG_FUNC_NB: - retval = current_data_read(rig, funcbuf); - - if (retval != RIG_OK) - { - return retval; - } - - funcbuf[2] = '\0'; - settings = strtol(funcbuf, (char **)NULL, 16); - *status = (settings & 0x04) ? 1 : 0; - break; - - default: - rig_debug(RIG_DEBUG_ERR, "Unsupported get_func %d\n", (int)func); - return -RIG_EINVAL; - } - - return RIG_OK; -} - - -/* - * alinco_set_level - * Assumes rig!=NULL - * FIXME: cannot support PREAMP and ATT both at same time (make sense though) - */ -int alinco_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) -{ - int cmd_len, lvl; - char cmdbuf[BUFSZ]; - - /* Optimize: - * sort the switch cases with the most frequent first - */ - switch (level) - { - case RIG_LEVEL_PREAMP: - switch (val.i) - { - case 0: lvl = 0; break; - - case 10: lvl = 1; break; - - default: rig_debug(RIG_DEBUG_ERR, - "Unsupported Preamp %d\n", - val.i); - - return -RIG_EINVAL; - } - - cmd_len = sprintf(cmdbuf, AL CMD_RFGAIN "%02d" EOM, lvl); - - return alinco_transaction(rig, cmdbuf, cmd_len, NULL, NULL); - - case RIG_LEVEL_ATT: - switch (val.i) - { - case 0: lvl = 0; break; - - case 10: lvl = 11; break; - - case 20: lvl = 10; break; - - default: rig_debug(RIG_DEBUG_ERR, - "Unsupported Att %d\n", - val.i); - - return -RIG_EINVAL; - } - - cmd_len = sprintf(cmdbuf, AL CMD_RFGAIN "%02d" EOM, lvl); - - return alinco_transaction(rig, cmdbuf, cmd_len, NULL, NULL); - - case RIG_LEVEL_RFPOWER: - cmd_len = sprintf(cmdbuf, AL CMD_PWR "%1d" EOM, val.f < 0.5 ? 1 : 0); - - return alinco_transaction(rig, cmdbuf, cmd_len, NULL, NULL); - - case RIG_LEVEL_KEYSPD: - if (val.i < 6) - { - lvl = 31; - } - else if (val.i >= 6 && val.i < 20) - { - lvl = val.i + 25; - } - else if (val.i >= 20 && val.i <= 50) - { - lvl = val.i - 20; - } - else - { - lvl = 30; - } - - cmd_len = sprintf(cmdbuf, AL CMD_SDATA "P%02d" EOM, lvl); - - return alinco_transaction(rig, cmdbuf, cmd_len, NULL, NULL); - - case RIG_LEVEL_CWPITCH: - lvl = 4; - - if (val.i < 426) - { - lvl = 5; - } - else if (val.i >= 426 && val.i <= 475) - { - lvl = 6; - } - else if (val.i >= 476 && val.i <= 525) - { - lvl = 7; - } - else if (val.i >= 526 && val.i <= 575) - { - lvl = 8; - } - else if (val.i >= 576 && val.i <= 625) - { - lvl = 9; - } - else if (val.i >= 626 && val.i <= 675) - { - lvl = 10; - } - else if (val.i >= 676 && val.i <= 725) - { - lvl = 11; - } - else if (val.i >= 726 && val.i <= 775) - { - lvl = 12; - } - else if (val.i >= 776 && val.i <= 825) - { - lvl = 0; - } - else if (val.i >= 826 && val.i <= 875) - { - lvl = 1; - } - else if (val.i >= 876 && val.i <= 925) - { - lvl = 2; - } - else if (val.i >= 926 && val.i <= 975) - { - lvl = 3; - } - else if (val.i >= 976 && val.i <= 1025) - { - lvl = 4; - } - - cmd_len = sprintf(cmdbuf, AL CMD_SDATA "M%02d" EOM, lvl); - - return alinco_transaction(rig, cmdbuf, cmd_len, NULL, NULL); - - default: - rig_debug(RIG_DEBUG_ERR, "Unsupported set_level %s\n", rig_strlevel(level)); - - return -RIG_EINVAL; - } - - return RIG_OK; -} - - -/* - * alinco_get_level - * Assumes rig!=NULL, val!=NULL - */ -int alinco_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) -{ - int retval, lvl_len; - char lvlbuf[BUFSZ]; - - /* Optimize: - * sort the switch cases with the most frequent first - */ - switch (level) - { - case RIG_LEVEL_RAWSTR: - /* read A/D converted value */ - retval = alinco_transaction(rig, - AL CMD_SMETER "1" EOM, - strlen(AL CMD_SMETER "1" EOM), - lvlbuf, - &lvl_len); - - if (retval != RIG_OK) - { - return retval; - } - - if (lvl_len != 6) - { - rig_debug(RIG_DEBUG_ERR, - "alinco_get_level: wrong answer len=%d\n", - lvl_len); - - return -RIG_ERJCTED; - ... [truncated message content] |
From: Michael B. <mdb...@us...> - 2020-06-17 15:48: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 e6a5e4ca31015e161a86a41871ba9123f149914d (commit) from 325754c580a160733aa9ea269d80bcd0be5a475f (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 e6a5e4ca31015e161a86a41871ba9123f149914d Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Jun 17 10:47:50 2020 -0500 Only update kenwood.c IF cache when RIG_OK diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index deee900b..d64e485a 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -543,7 +543,7 @@ transaction_read: transaction_quit: // update the cache - if (strcmp(cmdstr, "IF") == 0) + if (retval == RIG_OK && strcmp(cmdstr, "IF") == 0) { elapsed_ms(&priv->cache_start, 1); strncpy(priv->last_if_response, buffer, caps->if_len); diff --git a/rigs/kenwood/kenwood.h b/rigs/kenwood/kenwood.h index f793068a..358a06bd 100644 --- a/rigs/kenwood/kenwood.h +++ b/rigs/kenwood/kenwood.h @@ -27,7 +27,7 @@ #include <string.h> #include "token.h" -#define BACKEND_VER "20200615" +#define BACKEND_VER "20200617" #define EOM_KEN ';' #define EOM_TH '\r' ----------------------------------------------------------------------- Summary of changes: rigs/kenwood/kenwood.c | 2 +- rigs/kenwood/kenwood.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2020-06-17 15:38:56
|
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 325754c580a160733aa9ea269d80bcd0be5a475f (commit) from 786c1ae9256a437dfb101bd58ed303d4008e670e (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 325754c580a160733aa9ea269d80bcd0be5a475f Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Jun 17 10:37:57 2020 -0500 Fix FLRig get_mode function https://github.com/Hamlib/Hamlib/issues/310 diff --git a/dummy/flrig.c b/dummy/flrig.c index 174c8354..8d9a6b8f 100644 --- a/dummy/flrig.c +++ b/dummy/flrig.c @@ -642,7 +642,7 @@ static rmode_t modeMapGetHamlib(const char *modeFLRig) } } - rig_debug(RIG_DEBUG_TRACE, "%s: Unknown mode requested: %s\n", __func__, + rig_debug(RIG_DEBUG_TRACE, "%s: mode requested: %s, not in modeMap\n", __func__, modeFLRig); return RIG_MODE_NONE; } @@ -1383,6 +1383,7 @@ static int flrig_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) char value[MAXCMDLEN]; char *cmdp; vfo_t curr_vfo; + rmode_t my_mode; struct flrig_priv_data *priv = (struct flrig_priv_data *) rig->state.priv; rig_debug(RIG_DEBUG_TRACE, "%s: vfo=%s\n", __func__, @@ -1456,14 +1457,8 @@ static int flrig_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) return retval; } - retval = modeMapGetHamlib(value); - - if (retval != RIG_OK) - { - return retval; - } - - *mode = retval; + my_mode = modeMapGetHamlib(value); + *mode = my_mode; rig_debug(RIG_DEBUG_TRACE, "%s: mode='%s'\n", __func__, rig_strrmode(*mode)); diff --git a/dummy/flrig.h b/dummy/flrig.h index 00e841d8..8459eb8e 100644 --- a/dummy/flrig.h +++ b/dummy/flrig.h @@ -28,7 +28,7 @@ #include <sys/time.h> #endif -#define BACKEND_VER "20200613" +#define BACKEND_VER "20200617" #define EOM "\r" #define TRUE 1 ----------------------------------------------------------------------- Summary of changes: dummy/flrig.c | 13 ++++--------- dummy/flrig.h | 2 +- 2 files changed, 5 insertions(+), 10 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2020-06-17 12:33:11
|
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 786c1ae9256a437dfb101bd58ed303d4008e670e (commit) from 7dedf007a14b76eca07184f71a333f8ba2bc33b0 (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 786c1ae9256a437dfb101bd58ed303d4008e670e Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Jun 17 07:22:11 2020 -0500 Change gs232b parsing to mandate at least AZ= and make EL= optional This covers the 12PR1A rotor which claims gs232b compatibility The 12PR1A also claims gs232a compability which is wrong as the AZ= EL= format is gs232b https://github.com/Hamlib/Hamlib/issues/309 Simplify gs232a parsing but mandate both arguments in +0xxx+0xxx format diff --git a/rotators/gs232a/gs232a.c b/rotators/gs232a/gs232a.c index 8d868587..d837ed4b 100644 --- a/rotators/gs232a/gs232a.c +++ b/rotators/gs232a/gs232a.c @@ -180,33 +180,27 @@ static int gs232a_rot_get_position(ROT *rot, azimuth_t *az, elevation_t *el) { char posbuf[32]; - int retval, angle; + int retval, int_az, int_el = 0; rig_debug(RIG_DEBUG_TRACE, "%s called\n", __func__); retval = gs232a_transaction(rot, "C2" EOM, posbuf, sizeof(posbuf), 0); - if (retval != RIG_OK || strlen(posbuf) < 10) - { - return retval < 0 ? retval : -RIG_EPROTO; - } - - /* parse "+0aaa+0eee" */ - if (sscanf(posbuf + 2, "%d", &angle) != 1) + if (retval != RIG_OK) { - rig_debug(RIG_DEBUG_ERR, "%s: wrong reply '%s'\n", __func__, posbuf); - return -RIG_EPROTO; + return retval; } - *az = (azimuth_t)angle; - - if (sscanf(posbuf + 7, "%d", &angle) != 1) + // parse "+0aaa+0eee" and expect both arguments + if (sscanf(posbuf, "+0%d+0%d", &int_az, &int_el) != 2) { - rig_debug(RIG_DEBUG_ERR, "%s: wrong reply '%s'\n", __func__, posbuf); + rig_debug(RIG_DEBUG_ERR, "%s: wrong reply '%s', not +0xxx+0xxx format?\n", + __func__, posbuf); return -RIG_EPROTO; } - *el = (elevation_t)angle; + *az = (azimuth_t) int_az; + *el = (elevation_t) int_el; rig_debug(RIG_DEBUG_TRACE, "%s: (az, el) = (%.1f, %.1f)\n", __func__, *az, *el); @@ -298,9 +292,9 @@ const struct rot_caps gs23_rot_caps = ROT_MODEL(ROT_MODEL_GS23), .model_name = "GS-23", .mfg_name = "Yaesu/Kenpro", - .version = "20200505.0", + .version = "20200617.0", .copyright = "LGPL", - .status = RIG_STATUS_ALPHA, + .status = RIG_STATUS_STABLE, .rot_type = ROT_TYPE_AZEL, .port_type = RIG_PORT_SERIAL, .serial_rate_min = 150, diff --git a/rotators/gs232a/gs232b.c b/rotators/gs232a/gs232b.c index f0b21073..935f4e4d 100644 --- a/rotators/gs232a/gs232b.c +++ b/rotators/gs232a/gs232b.c @@ -141,7 +141,8 @@ transaction_write: #endif #if 0 - https://github.com/Hamlib/Hamlib/issues/272 +https://github.com/Hamlib/Hamlib/issues/272 + // If asked for we will check for connection // we don't expect a reply...just a prompt return // Seems some GS232B's only echo the CR @@ -152,6 +153,7 @@ transaction_write: __func__, data, cmdstr); return -RIG_EPROTO; } + #endif if (data[0] == '?') @@ -207,7 +209,7 @@ static int gs232b_rot_get_position(ROT *rot, azimuth_t *az, elevation_t *el) { char posbuf[32]; - int retval, int_az, int_el; + int retval, int_az = 0, int_el = 0; rig_debug(RIG_DEBUG_TRACE, "%s called\n", __func__); @@ -223,9 +225,10 @@ gs232b_rot_get_position(ROT *rot, azimuth_t *az, elevation_t *el) /* With the format string containing a space character as one of the * directives, any amount of space is matched, including none in the input. */ - if (sscanf(posbuf, "AZ=%d EL=%d", &int_az, &int_el) != 2) - { - rig_debug(RIG_DEBUG_ERR, "%s: wrong reply '%s'\n", __func__, + // There's a 12PR1A rotor that only returns AZ so we may only get AZ=xxx + if (sscanf(posbuf, "AZ=%d EL=%d", &int_az, &int_el) == 0) + { // only give error if we didn't parse anything + rig_debug(RIG_DEBUG_ERR, "%s: wrong reply '%s', expected AZ=xxx EL=xxx\n", __func__, posbuf); return -RIG_EPROTO; } @@ -324,7 +327,7 @@ const struct rot_caps gs232b_rot_caps = ROT_MODEL(ROT_MODEL_GS232B), .model_name = "GS-232B", .mfg_name = "Yaesu", - .version = "20200615.0", + .version = "20200617.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rot_type = ROT_TYPE_OTHER, ----------------------------------------------------------------------- Summary of changes: rotators/gs232a/gs232a.c | 28 +++++++++++----------------- rotators/gs232a/gs232b.c | 15 +++++++++------ 2 files changed, 20 insertions(+), 23 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2020-06-17 04:18: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 branch, master has been updated via 7dedf007a14b76eca07184f71a333f8ba2bc33b0 (commit) from 81be0ad3e85296a3e3cc19eff8bf557ceb0271e7 (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 7dedf007a14b76eca07184f71a333f8ba2bc33b0 Author: Michael Black W9MDB <mdb...@ya...> Date: Tue Jun 16 23:16:55 2020 -0500 Add 1 retry to FT1000MP https://github.com/Hamlib/Hamlib/issues/308 diff --git a/rigs/yaesu/ft1000mp.c b/rigs/yaesu/ft1000mp.c index 1c9632d9..3027bb3c 100644 --- a/rigs/yaesu/ft1000mp.c +++ b/rigs/yaesu/ft1000mp.c @@ -196,7 +196,6 @@ struct ft1000mp_priv_data { unsigned char pacing; /* pacing value */ unsigned int read_update_delay; /* depends on pacing value */ - unsigned char current_vfo; /* active VFO from last cmd */ unsigned char p_cmd[YAESU_CMD_LENGTH]; /* private copy of 1 constructed CAT cmd */ yaesu_cmd_set_t pcs[FT1000MP_NATIVE_SIZE]; /* private cmd set */ @@ -216,7 +215,7 @@ const struct rig_caps ft1000mp_caps = RIG_MODEL(RIG_MODEL_FT1000MP), .model_name = "FT-1000MP", .mfg_name = "Yaesu", - .version = "20200522.0", + .version = "20200616.0", .copyright = "LGPL", .status = RIG_STATUS_BETA, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -231,8 +230,8 @@ const struct rig_caps ft1000mp_caps = .serial_handshake = RIG_HANDSHAKE_NONE, .write_delay = FT1000MP_WRITE_DELAY, .post_write_delay = FT1000MP_POST_WRITE_DELAY, - .timeout = 2000, - .retry = 0, + .timeout = 1000, // was 2000 -- see https://github.com/Hamlib/Hamlib/issues/308 + .retry = 1, .has_get_func = FT1000MP_FUNC_ALL, .has_set_func = FT1000MP_FUNC_ALL, .has_get_level = FT1000MP_LEVEL_GET, @@ -342,7 +341,7 @@ const struct rig_caps ft1000mpmkv_caps = RIG_MODEL(RIG_MODEL_FT1000MPMKV), .model_name = "MARK-V FT-1000MP", .mfg_name = "Yaesu", - .version = "20200522.0", + .version = "20200616.0", .copyright = "LGPL", .status = RIG_STATUS_BETA, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -357,8 +356,8 @@ const struct rig_caps ft1000mpmkv_caps = .serial_handshake = RIG_HANDSHAKE_NONE, .write_delay = FT1000MP_WRITE_DELAY, .post_write_delay = FT1000MP_POST_WRITE_DELAY, - .timeout = 2000, - .retry = 0, + .timeout = 1000, + .retry = 1, .has_get_func = FT1000MP_FUNC_ALL, .has_set_func = FT1000MP_FUNC_ALL, .has_get_level = FT1000MP_LEVEL_GET, @@ -468,7 +467,7 @@ const struct rig_caps ft1000mpmkvfld_caps = RIG_MODEL(RIG_MODEL_FT1000MPMKVFLD), .model_name = "MARK-V Field FT-1000MP", .mfg_name = "Yaesu", - .version = "20200522.0", + .version = "20200616.0", .copyright = "LGPL", .status = RIG_STATUS_BETA, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -483,8 +482,8 @@ const struct rig_caps ft1000mpmkvfld_caps = .serial_handshake = RIG_HANDSHAKE_NONE, .write_delay = FT1000MP_WRITE_DELAY, .post_write_delay = FT1000MP_POST_WRITE_DELAY, - .timeout = 2000, - .retry = 0, + .timeout = 1000, + .retry = 1, .has_get_func = FT1000MP_FUNC_ALL, .has_set_func = FT1000MP_FUNC_ALL, .has_get_level = FT1000MP_LEVEL_GET, @@ -622,7 +621,7 @@ int ft1000mp_init(RIG *rig) FT1000MP_PACING_DEFAULT_VALUE; /* set pacing to minimum for now */ priv->read_update_delay = FT1000MP_DEFAULT_READ_TIMEOUT; /* set update timeout to safe value */ - priv->current_vfo = RIG_VFO_A; /* default to VFO_A ? */ + ft1000mp_get_vfo(rig, &rig->state.current_vfo); return RIG_OK; } @@ -711,7 +710,7 @@ int ft1000mp_set_freq(RIG *rig, vfo_t vfo, freq_t freq) if (vfo == RIG_VFO_CURR) { - vfo = p->current_vfo; + vfo = rig->state.current_vfo; } switch (vfo) @@ -1008,14 +1007,11 @@ int ft1000mp_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) int ft1000mp_set_vfo(RIG *rig, vfo_t vfo) { - struct ft1000mp_priv_data *p; unsigned char cmd_index = 0; /* index of sequence to send */ rig_debug(RIG_DEBUG_TRACE, "ft1000mp: ft1000mp_set_vfo called %s\n", rig_strvfo(vfo)); - p = (struct ft1000mp_priv_data *)rig->state.priv; - /* * RIG_VFO_VFO/RIG_VFO_MEM are not available * so try to emulate them. @@ -1025,20 +1021,20 @@ int ft1000mp_set_vfo(RIG *rig, vfo_t vfo) if (vfo == RIG_VFO_VFO) { - vfo = p->current_vfo; + vfo = rig->state.current_vfo; } switch (vfo) { case RIG_VFO_A: cmd_index = FT1000MP_NATIVE_VFO_A; - p->current_vfo = vfo; /* update active VFO */ + rig->state.current_vfo = vfo; /* update active VFO */ rig_debug(RIG_DEBUG_TRACE, "%s: vfo == RIG_VFO_A\n", __func__); break; case RIG_VFO_B: cmd_index = FT1000MP_NATIVE_VFO_B; - p->current_vfo = vfo; /* update active VFO */ + rig->state.current_vfo = vfo; /* update active VFO */ rig_debug(RIG_DEBUG_TRACE, "%s: vfo == RIG_VFO_B\n", __func__); break; @@ -1092,11 +1088,11 @@ int ft1000mp_get_vfo(RIG *rig, vfo_t *vfo) } else if (p->update_data[FT1000MP_SUMO_DISPLAYED_STATUS] & SF_VFOAB) { - *vfo = p->current_vfo = RIG_VFO_B; + *vfo = rig->state.current_vfo = RIG_VFO_B; } else { - *vfo = p->current_vfo = RIG_VFO_A; + *vfo = rig->state.current_vfo = RIG_VFO_A; } rig_debug(RIG_DEBUG_TRACE, "%s: vfo status = %x %x\n", __func__, @@ -1155,7 +1151,7 @@ int ft1000mp_get_rit(RIG *rig, vfo_t vfo, shortfreq_t *rit) if (vfo == RIG_VFO_CURR) { - vfo = priv->current_vfo; + vfo = rig->state.current_vfo; } if (vfo == RIG_VFO_A || vfo == RIG_VFO_B) @@ -1259,7 +1255,7 @@ int ft1000mp_get_xit(RIG *rig, vfo_t vfo, shortfreq_t *xit) if (vfo == RIG_VFO_CURR) { - vfo = priv->current_vfo; + vfo = rig->state.current_vfo; } if (vfo == RIG_VFO_A || vfo == RIG_VFO_B) @@ -1320,6 +1316,7 @@ int ft1000mp_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) unsigned char lvl_data[YAESU_CMD_LENGTH]; int m; int retval; + int retry = rig->caps->retry; rs = &rig->state; priv = (struct ft1000mp_priv_data *)rs->priv; @@ -1333,7 +1330,7 @@ int ft1000mp_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) case RIG_LEVEL_RAWSTR: if (vfo == RIG_VFO_CURR) { - vfo = priv->current_vfo; + vfo = rig->state.current_vfo; } m = vfo == RIG_VFO_B ? 0x01 : 0x00; @@ -1376,9 +1373,13 @@ int ft1000mp_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) memset(&priv->p_cmd, m, YAESU_CMD_LENGTH - 1); priv->p_cmd[4] = 0xf7; - write_block(&rs->rigport, (char *) priv->p_cmd, YAESU_CMD_LENGTH); + do + { + write_block(&rs->rigport, (char *) priv->p_cmd, YAESU_CMD_LENGTH); - retval = read_block(&rs->rigport, (char *) lvl_data, YAESU_CMD_LENGTH); + retval = read_block(&rs->rigport, (char *) lvl_data, YAESU_CMD_LENGTH); + } + while (retry-- && retval == -RIG_ETIMEOUT); if (retval != YAESU_CMD_LENGTH) { @@ -1441,6 +1442,7 @@ static int ft1000mp_get_update_data(RIG *rig, unsigned char ci, struct rig_state *rig_s; struct ft1000mp_priv_data *p; int n; /* for read_ */ + int retry = rig->caps->retry; rig_debug(RIG_DEBUG_VERBOSE, "%s: called\n", __func__); @@ -1448,10 +1450,14 @@ static int ft1000mp_get_update_data(RIG *rig, unsigned char ci, p = (struct ft1000mp_priv_data *)rig->state.priv; rig_s = &rig->state; - /* send UPDATE comand to fetch data*/ - ft1000mp_send_priv_cmd(rig, ci); + do + { + /* send UPDATE comand to fetch data*/ + ft1000mp_send_priv_cmd(rig, ci); - n = read_block(&rig_s->rigport, (char *) p->update_data, rl); + n = read_block(&rig_s->rigport, (char *) p->update_data, rl); + } + while (retry-- && n == -RIG_ETIMEOUT); return n; @@ -1489,6 +1495,7 @@ static int ft1000mp_send_priv_cmd(RIG *rig, unsigned char ci) } cmd = (unsigned char *) p->pcs[cmd_index].nseq; /* get native sequence */ + serial_flush(&rig_s->rigport); write_block(&rig_s->rigport, (char *) cmd, YAESU_CMD_LENGTH); return RIG_OK; ----------------------------------------------------------------------- Summary of changes: rigs/yaesu/ft1000mp.c | 63 ++++++++++++++++++++++++++++----------------------- 1 file changed, 35 insertions(+), 28 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2020-06-16 14:20: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 81be0ad3e85296a3e3cc19eff8bf557ceb0271e7 (commit) from 281dba1b8a304d9444b9146dfaf11d045a2df0b2 (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 81be0ad3e85296a3e3cc19eff8bf557ceb0271e7 Author: Michael Black W9MDB <mdb...@ya...> Date: Tue Jun 16 08:23:55 2020 -0500 Remove VFO_CURR checks from ft817.c https://github.com/Hamlib/Hamlib/issues/305 diff --git a/rigs/yaesu/ft817.c b/rigs/yaesu/ft817.c index b82bbf03..1f9c2388 100644 --- a/rigs/yaesu/ft817.c +++ b/rigs/yaesu/ft817.c @@ -164,7 +164,7 @@ const struct rig_caps ft817_caps = RIG_MODEL(RIG_MODEL_FT817), .model_name = "FT-817", .mfg_name = "Yaesu", - .version = "20200323.0", + .version = "20200616.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -493,11 +493,6 @@ int ft817_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) int retries = rig->state.rigport.retry + 1; // +1 because, because 2 steps are needed even in best scenario - if (vfo != RIG_VFO_CURR) - { - return -RIG_ENTARGET; - } - while ((f1 == 0 || f1 != f2) && retries-- > 0) { if (check_cache_timeout(&p->fm_status_tv)) @@ -526,11 +521,6 @@ int ft817_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) { struct ft817_priv_data *p = (struct ft817_priv_data *) rig->state.priv; - if (vfo != RIG_VFO_CURR) - { - return -RIG_ENTARGET; - } - if (check_cache_timeout(&p->fm_status_tv)) { int n; @@ -612,11 +602,6 @@ int ft817_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo) struct ft817_priv_data *p = (struct ft817_priv_data *) rig->state.priv; int n; - if (vfo != RIG_VFO_CURR) - { - return -RIG_ENTARGET; - } - if (check_cache_timeout(&p->tx_status_tv)) if ((n = ft817_get_status(rig, FT817_NATIVE_CAT_GET_TX_STATUS)) < 0) { @@ -647,11 +632,6 @@ int ft817_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt) { struct ft817_priv_data *p = (struct ft817_priv_data *) rig->state.priv; - if (vfo != RIG_VFO_CURR) - { - return -RIG_ENTARGET; - } - if (check_cache_timeout(&p->tx_status_tv)) { int n; @@ -761,11 +741,6 @@ static int ft817_get_raw_smeter_level(RIG *rig, value_t *val) int ft817_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) { - if (vfo != RIG_VFO_CURR) - { - return -RIG_ENTARGET; - } - switch (level) { @@ -793,11 +768,6 @@ int ft817_get_dcd(RIG *rig, vfo_t vfo, dcd_t *dcd) { struct ft817_priv_data *p = (struct ft817_priv_data *) rig->state.priv; - if (vfo != RIG_VFO_CURR) - { - return -RIG_ENTARGET; - } - if (check_cache_timeout(&p->rx_status_tv)) { int n; @@ -892,11 +862,6 @@ int ft817_set_freq(RIG *rig, vfo_t vfo, freq_t freq) { unsigned char data[YAESU_CMD_LENGTH - 1]; - if (vfo != RIG_VFO_CURR) - { - return -RIG_ENTARGET; - } - rig_debug(RIG_DEBUG_VERBOSE, "ft817: requested freq = %"PRIfreq" Hz\n", freq); /* fill in the frequency */ @@ -912,11 +877,6 @@ int ft817_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) { int index; /* index of sequence to send */ - if (vfo != RIG_VFO_CURR) - { - return -RIG_ENTARGET; - } - rig_debug(RIG_DEBUG_VERBOSE, "%s: generic mode = %s\n", __func__, rig_strrmode(mode)); @@ -977,11 +937,6 @@ int ft817_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) ptt_t ptt_response = -1; int retries = rig->state.rigport.retry; - if (vfo != RIG_VFO_CURR) - { - return -RIG_ENTARGET; - } - rig_debug(RIG_DEBUG_VERBOSE, "%s: called\n", __func__); switch (ptt) @@ -1039,11 +994,6 @@ int ft817_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) int ft817_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) { - if (vfo != RIG_VFO_CURR) - { - return -RIG_ENTARGET; - } - switch (func) { case RIG_FUNC_LOCK: @@ -1086,11 +1036,6 @@ int ft817_set_dcs_code(RIG *rig, vfo_t vfo, tone_t code) unsigned char data[YAESU_CMD_LENGTH - 1]; /* int n; */ - if (vfo != RIG_VFO_CURR) - { - return -RIG_ENTARGET; - } - rig_debug(RIG_DEBUG_VERBOSE, "ft817: set DCS code (%u)\n", code); if (code == 0) @@ -1118,11 +1063,6 @@ int ft817_set_dcs_sql(RIG *rig, vfo_t vfo, tone_t code) unsigned char data[YAESU_CMD_LENGTH - 1]; int n; - if (vfo != RIG_VFO_CURR) - { - return -RIG_ENTARGET; - } - rig_debug(RIG_DEBUG_VERBOSE, "ft817: set DCS sql (%u)\n", code); if (code == 0) @@ -1148,11 +1088,6 @@ int ft817_set_ctcss_tone(RIG *rig, vfo_t vfo, tone_t tone) unsigned char data[YAESU_CMD_LENGTH - 1]; int n; - if (vfo != RIG_VFO_CURR) - { - return -RIG_ENTARGET; - } - rig_debug(RIG_DEBUG_VERBOSE, "ft817: set CTCSS tone (%.1f)\n", tone / 10.0); if (tone == 0) @@ -1178,11 +1113,6 @@ int ft817_set_ctcss_sql(RIG *rig, vfo_t vfo, tone_t tone) unsigned char data[YAESU_CMD_LENGTH - 1]; int n; - if (vfo != RIG_VFO_CURR) - { - return -RIG_ENTARGET; - } - rig_debug(RIG_DEBUG_VERBOSE, "ft817: set CTCSS sql (%.1f)\n", tone / 10.0); if (tone == 0) @@ -1207,11 +1137,6 @@ int ft817_set_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t shift) /* Note: this doesn't have effect unless FT817 is in FM mode although the command is accepted in any mode. */ - if (vfo != RIG_VFO_CURR) - { - return -RIG_ENTARGET; - } - rig_debug(RIG_DEBUG_VERBOSE, "ft817: set repeter shift = %i\n", shift); switch (shift) @@ -1235,11 +1160,6 @@ int ft817_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t offs) { unsigned char data[YAESU_CMD_LENGTH - 1]; - if (vfo != RIG_VFO_CURR) - { - return -RIG_ENTARGET; - } - rig_debug(RIG_DEBUG_VERBOSE, "ft817: set repeter offs = %li\n", offs); /* fill in the offset freq */ @@ -1253,11 +1173,6 @@ int ft817_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit) unsigned char data[YAESU_CMD_LENGTH - 1]; int n; - if (vfo != RIG_VFO_CURR) - { - return -RIG_ENTARGET; - } - rig_debug(RIG_DEBUG_VERBOSE, "ft817: set rit = %li)\n", rit); /* fill in the RIT freq */ @@ -1326,9 +1241,6 @@ int ft817_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo) { int index, n; - /* if (vfo != RIG_VFO_CURR) */ - /* return -RIG_ENTARGET; */ - rig_debug(RIG_DEBUG_VERBOSE, "%s: called\n", __func__); switch (split) ----------------------------------------------------------------------- Summary of changes: rigs/yaesu/ft817.c | 90 +----------------------------------------------------- 1 file changed, 1 insertion(+), 89 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2020-06-16 03:58:26
|
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 281dba1b8a304d9444b9146dfaf11d045a2df0b2 (commit) via 779cd69287b66b5ee7dcb17297975a852836e89f (commit) from 362fa77cfd4cdc9d5490dc14c5c054464e98a6bf (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 281dba1b8a304d9444b9146dfaf11d045a2df0b2 Author: Michael Black W9MDB <mdb...@ya...> Date: Mon Jun 15 22:57:22 2020 -0500 Remove unneeded code in gs232b.c that was causing errors on Yaesu G1000 https://github.com/Hamlib/Hamlib/issues/272 diff --git a/rotators/gs232a/gs232b.c b/rotators/gs232a/gs232b.c index faa047cb..f0b21073 100644 --- a/rotators/gs232a/gs232b.c +++ b/rotators/gs232a/gs232b.c @@ -140,6 +140,8 @@ transaction_write: #endif +#if 0 + https://github.com/Hamlib/Hamlib/issues/272 // If asked for we will check for connection // we don't expect a reply...just a prompt return // Seems some GS232B's only echo the CR @@ -150,6 +152,7 @@ transaction_write: __func__, data, cmdstr); return -RIG_EPROTO; } +#endif if (data[0] == '?') { @@ -321,7 +324,7 @@ const struct rot_caps gs232b_rot_caps = ROT_MODEL(ROT_MODEL_GS232B), .model_name = "GS-232B", .mfg_name = "Yaesu", - .version = "20200531.0", + .version = "20200615.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rot_type = ROT_TYPE_OTHER, commit 779cd69287b66b5ee7dcb17297975a852836e89f Author: Michael Black W9MDB <mdb...@ya...> Date: Mon Jun 15 09:45:58 2020 -0500 Fix kenwood AG command to use vfo+level format instead of just level Some rigs say 0 is the default and need to find out if 1 causes an error If it does we need to have rig exceptions -- hopefully it's ignored https://github.com/Hamlib/Hamlib/issues/304 diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index f509c3be..deee900b 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -724,6 +724,7 @@ int kenwood_open(RIG *rig) rig_debug(RIG_DEBUG_TRACE, "%s: got PS0 so powerup\n", __func__); rig_set_powerstat(rig, 1); } + priv->poweron = 1; err = RIG_OK; // reset our err back to OK for later checks @@ -2153,8 +2154,14 @@ int kenwood_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) break; case RIG_LEVEL_AF: - snprintf(levelbuf, sizeof(levelbuf), "AG%03d", kenwood_val); - break; + { + // some rigs only recognize 0 for vfo_set + // hopefully they are asking for VFOA or Main otherwise this might not work + // https://github.com/Hamlib/Hamlib/issues/304 + int vfo_set = vfo == RIG_VFO_A || vfo == RIG_VFO_MAIN ? 0 : 1; + snprintf(levelbuf, sizeof(levelbuf), "AG%1d%03d", vfo_set, kenwood_val); + } + break; case RIG_LEVEL_RF: /* XXX check level range */ diff --git a/rigs/kenwood/kenwood.h b/rigs/kenwood/kenwood.h index 364675cd..f793068a 100644 --- a/rigs/kenwood/kenwood.h +++ b/rigs/kenwood/kenwood.h @@ -27,7 +27,7 @@ #include <string.h> #include "token.h" -#define BACKEND_VER "20200614" +#define BACKEND_VER "20200615" #define EOM_KEN ';' #define EOM_TH '\r' ----------------------------------------------------------------------- Summary of changes: rigs/kenwood/kenwood.c | 11 +++++++++-- rigs/kenwood/kenwood.h | 2 +- rotators/gs232a/gs232b.c | 5 ++++- 3 files changed, 14 insertions(+), 4 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2020-06-14 22:21:05
|
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 362fa77cfd4cdc9d5490dc14c5c054464e98a6bf (commit) from 8fd58e211d743a58c11a03771ca9800c774e6094 (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 362fa77cfd4cdc9d5490dc14c5c054464e98a6bf Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Jun 14 17:20:19 2020 -0500 Move poweron set outside of check to ensure only once whether started power off or on https://github.com/Hamlib/Hamlib/issues/297 diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index e6592ae5..f1e3ead2 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -729,8 +729,6 @@ icom_rig_open(RIG *rig) if (retval != RIG_OK && priv->poweron == 0) { - - priv->poweron = 1; // maybe we need power on? rig_debug(RIG_DEBUG_VERBOSE, "%s trying power on\n", __func__); retval = abs(rig_set_powerstat(rig, 1)); @@ -756,6 +754,7 @@ icom_rig_open(RIG *rig) return retval; } } + priv->poweron = 1; if (rig->caps->has_get_func & RIG_FUNC_SATMODE) { diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index 286e2427..f509c3be 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -721,10 +721,10 @@ int kenwood_open(RIG *rig) if (err == RIG_OK && powerstat == 0 && priv->poweron == 0) { - priv->poweron = 1; rig_debug(RIG_DEBUG_TRACE, "%s: got PS0 so powerup\n", __func__); rig_set_powerstat(rig, 1); } + priv->poweron = 1; err = RIG_OK; // reset our err back to OK for later checks } ----------------------------------------------------------------------- Summary of changes: rigs/icom/icom.c | 3 +-- rigs/kenwood/kenwood.c | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2020-06-14 22:15:41
|
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 8fd58e211d743a58c11a03771ca9800c774e6094 (commit) from 15ac0bbc99c60aa4acd714f55a501c8fdc9e315f (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 8fd58e211d743a58c11a03771ca9800c774e6094 Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Jun 14 17:14:24 2020 -0500 Rigs will only power up once if needed https://github.com/Hamlib/Hamlib/issues/297 diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 03ffe7d6..e6592ae5 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -727,9 +727,10 @@ icom_rig_open(RIG *rig) rig->caps->version); retval = icom_get_usb_echo_off(rig); - if (retval != RIG_OK) + if (retval != RIG_OK && priv->poweron == 0) { + priv->poweron = 1; // maybe we need power on? rig_debug(RIG_DEBUG_VERBOSE, "%s trying power on\n", __func__); retval = abs(rig_set_powerstat(rig, 1)); diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h index 94de2c95..506c8d6f 100644 --- a/rigs/icom/icom.h +++ b/rigs/icom/icom.h @@ -190,6 +190,7 @@ struct icom_priv_data freq_t vfob_freq; // track last setting of vfob -- used to return last freq when ptt is asserted int x25cmdfails; // This will get set if the 0x25 command fails so we try just once int x1cx03cmdfails; // This will get set if the 0x1c 0x03 command fails so we try just once + int poweron; // to prevent powering on more than once }; extern const struct ts_sc_list r8500_ts_sc_list[]; diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index 3bed53a8..286e2427 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -719,8 +719,9 @@ int kenwood_open(RIG *rig) rig_debug(RIG_DEBUG_TRACE, "%s: got ID so try PS\n", __func__); err = rig_get_powerstat(rig, &powerstat); - if (err == RIG_OK && powerstat == 0) + if (err == RIG_OK && powerstat == 0 && priv->poweron == 0) { + priv->poweron = 1; rig_debug(RIG_DEBUG_TRACE, "%s: got PS0 so powerup\n", __func__); rig_set_powerstat(rig, 1); } diff --git a/rigs/kenwood/kenwood.h b/rigs/kenwood/kenwood.h index bccf8ebb..364675cd 100644 --- a/rigs/kenwood/kenwood.h +++ b/rigs/kenwood/kenwood.h @@ -27,7 +27,7 @@ #include <string.h> #include "token.h" -#define BACKEND_VER "20200601" +#define BACKEND_VER "20200614" #define EOM_KEN ';' #define EOM_TH '\r' @@ -126,6 +126,7 @@ struct kenwood_priv_data int is_950; struct timespec cache_start; char last_if_response[KENWOOD_MAX_BUF_LEN]; + int poweron; /* to avoid powering on more than once */ }; diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index b8bd5455..68da054c 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -366,7 +366,10 @@ int newcat_open(RIG *rig) __func__, rig_s->rigport.post_write_delay); /* Ensure rig is powered on */ - rig_set_powerstat(rig, 1); + if (priv->poweron == 0) { + priv->poweron = 1; + rig_set_powerstat(rig, 1); + } /* get current AI state so it can be restored */ priv->trn_state = -1; diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h index d0e1f2a8..eebe7ca3 100644 --- a/rigs/yaesu/newcat.h +++ b/rigs/yaesu/newcat.h @@ -95,6 +95,7 @@ struct newcat_priv_data int width_frequency; /* found at startup */ struct timespec cache_start; char last_if_response[NEWCAT_DATA_LEN]; + int poweron; /* to prevent powering on more than once */ }; ----------------------------------------------------------------------- Summary of changes: rigs/icom/icom.c | 3 ++- rigs/icom/icom.h | 1 + rigs/kenwood/kenwood.c | 3 ++- rigs/kenwood/kenwood.h | 3 ++- rigs/yaesu/newcat.c | 5 ++++- rigs/yaesu/newcat.h | 1 + 6 files changed, 12 insertions(+), 4 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2020-06-14 20:53:41
|
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 15ac0bbc99c60aa4acd714f55a501c8fdc9e315f (commit) from dc07c20e96652c2d57e018abd6c615c015ab2e7a (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 15ac0bbc99c60aa4acd714f55a501c8fdc9e315f Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Jun 14 15:28:52 2020 -0500 Change newcat.c to assume split is on VFO_B Testing with FT-DX101D was return split=0 when used with WSJT-X split mode https://github.com/Hamlib/Hamlib/issues/293 diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index bdcf587b..b8bd5455 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -1521,8 +1521,8 @@ int newcat_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo) return err; } - // should this just return VFO_A/VFO_B? - if (*tx_vfo != vfo) + // we assume split is always on VFO_B + if (*tx_vfo == RIG_VFO_B) { *split = RIG_SPLIT_ON; } @@ -4855,10 +4855,12 @@ int newcat_get_tx_vfo(RIG *rig, vfo_t *tx_vfo) { case '0': *tx_vfo = RIG_VFO_A; + rig->state.cache.split = 0; break; case '1' : *tx_vfo = RIG_VFO_B; + rig->state.cache.split = 1; break; default: ----------------------------------------------------------------------- Summary of changes: rigs/yaesu/newcat.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |