hamlib-cvs-digest Mailing List for Ham Radio Control Libraries (Page 11)
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
(47) |
Sep
(38) |
Oct
(5) |
Nov
(3) |
Dec
(1) |
|
From: n0nb <n0...@us...> - 2023-05-27 00:53:29
|
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 77d9d11f9249edeaedef943766c243c595952ad8 (commit)
via 81dd39319b2a973ab7bb83b17b789a4e157a2033 (commit)
via ccd832d4cb0b01f8623bbe849513742aaf3fc501 (commit)
via 8d465a257ee9a5e0f4a472ec74c43b0c6a6b495e (commit)
via 06f5d8376f6bbc152f0342fccdff5c5a3b29aa88 (commit)
via f01a165ec774c98479543665b15074b39c831b73 (commit)
via fd68723da1fbccb922bc7eb74f580869b0105f72 (commit)
via 8730e6a0b141367a3f74b23629257b6236de50a8 (commit)
via 610bf2d90324f9f1d722923e116943192e748a17 (commit)
via b6fe91504f06534fa601320fbd7645e619d3a3b3 (commit)
via 79492d42844b4bcbe8f7e1f5b374960311b4e7c6 (commit)
via ae14af4bc1a1cf67ce25b8ee5ef3567a54c63c70 (commit)
via a7d24a99dbe9b63f813aa568dd35ffd8eb217227 (commit)
via 083669dbc8ba9610733d4af23c255093bb3d4a52 (commit)
via 657e41fd099f81a4a9a63d1f2df4883867ccd851 (commit)
via 7309b24411cb0437fb34654a9a46d4f54ab11ea3 (commit)
via dbf1cacac60197af51c8139ba96198c7dde58b56 (commit)
via 15a01889cd1cbb8eac0d394b8e04d1ef305eb93d (commit)
via 9e1adcfdb862f3b489219a49ab2f74fa4cd9da86 (commit)
via cce66d325797b014af2628f88f6f79636804b6c5 (commit)
via 52358d7922fed71d0f7136e78a34c8863ab8b052 (commit)
via 082bf83daa592d0fbef5953777257a6e4cf4c117 (commit)
via 4832cc1bb27a729fe34055ec679fe7392607e7d6 (commit)
via ece6a7ae1aa598b2dbe69beab3c411baeb89f1db (commit)
via 6eb0735c75ff2875a0a52694ece73b9092da5d85 (commit)
via 8b9a8d6649d5b17ba7047842de64ce7349a7efe2 (commit)
via 125273f7a275d185aaf755c024344c134da59ad3 (commit)
via c5f0e1e5770c2e169ecb6d016029c76fd6d47e22 (commit)
via 14dbe41e763182893dd0d5cf1ad611da8765ed9f (commit)
via e5f6b4e9d25516576cd1f2b435797b009fc66321 (commit)
via d3c2ebcc1f8aee5d3a38305ea8b9e7cccb633b01 (commit)
via d27283ceb7d2538d2457f0d6f5442ce2115661f3 (commit)
via 3029260582f4cd29972d57b787c1d089b6d461b5 (commit)
via 7a69042876133382cc864849562487641d3f7efa (commit)
via ea37ad1b215a0fad366e8d282ee11e6e275068b7 (commit)
via 05f04730d75aabfff19bc56310b088385a8aaeb4 (commit)
via 1c08cd7a64a3cd46c5b3aae875f9a38d29b94b80 (commit)
via ca62509013656b8b6de2a980ecf0b6dbb181bdce (commit)
via e2a1a00f3a1fd0266266b141b85b0938aadd52f5 (commit)
via 9528132f81a94d12f5c2f6debb03a4ce9cef88e5 (commit)
via 67344a66a7a189d503c1426fb7fa0055087c9df5 (commit)
via 04ee4ec58040daa86c87a0045f80d3acf38b5f30 (commit)
via 673ef04b0f3fc8ed087f0af4dcff08cb14a47e62 (commit)
via a9d098bab33ca7b4c42f225a0176921df7e29c52 (commit)
via 44c9f83ae0787f60ca6affadf7ca3c6dd690168d (commit)
via df53b9a92809ef06534c2df81241c79e4dad3a38 (commit)
via 0f5982272aa620bfe8873c168a184686795aea80 (commit)
via 474428082d8a0cc4e63c87e11fcde2ee60c8c49f (commit)
via 14c535a01bfb40a80243a8a428fd37cdf20abeb5 (commit)
via b60748265155f16d326d0ea0ba75deadf3692edd (commit)
via 3c93d838482b77999175e5d61d1a024b22fbd8d5 (commit)
via efc90d30de30535f7da9a5a9fbf4c36cbacbee07 (commit)
via 84187e976d35c3ef4c96fdfa827bf5bffa20971f (commit)
via 445e5070c1234ace1934767e3569df3da6e5a0e9 (commit)
via 630f5866a71f00f3bab760f89054b955d5ab2936 (commit)
via bba58dff7b7ad544d3b9aa54d607258819bc0802 (commit)
via e02c42f629dbaf3309d84b12f0533cc92d97e81d (commit)
via f43aa43671979a44a374634b66f3092763373e4a (commit)
via f691be94d959d605d055e0bb668ef15ff14f23ae (commit)
via c14d6f0fa2f612aa9bc7af7329dc141a3a321d1c (commit)
via 1ad664be4ca5b58f8d7a1d75396be4ef4ca58c83 (commit)
via 01a7eee18d1913d4ece42da24fd76880bc316dd7 (commit)
via f4a08e10bf466deb0d385c86e0a195f10fe5d292 (commit)
via 6142e98c23fcbac70e9745a164e1073e1014a90e (commit)
via 73465d16c4976ed0912bc1e47be7d4b6ebae0867 (commit)
via 58655be3557bf247f2cb130047c9c7eb71163a42 (commit)
via d3b912aadb2a8348bf02da90f40631e531f9769a (commit)
via 1265ede3844fa08b3e938318edbf482651e4a299 (commit)
via 31733cea22c5242ec29527134049b14e9db53742 (commit)
via eff6f2d5547fea910d03e291a9ddaf2c1567df05 (commit)
via 647c5b37ef76efdd5d119e88a9907dca91623381 (commit)
via 29d38332283d99009d4ef238a38aa39d8a3280e6 (commit)
via 5e8de57f54dc38524e4db8acd478bcd98f136565 (commit)
via fa9948b17d5be4df4b6e3d6623ea0d9f07b8e6cd (commit)
via a43cd80799f3806090da6d09b0b9cc28dfe8c2ac (commit)
via 176a63c72615e84521cfe841368f07a239c4335a (commit)
via 0ad834f59e9638ead955534831b9aeb0d48c04af (commit)
via 05ab130f9127b92733e72ddd9ed4845718ef5578 (commit)
via 66513450652cb77e21006b50e3a4045756f61b33 (commit)
via 10f1f3a7cd3da5a53583ad0ede45f1d2fc0c757a (commit)
via eea12aff0ab2bda40b6ac8af24db446885070109 (commit)
via 93e8a2879d0a74c60843c9942c2759178b746383 (commit)
via c75fdeb3e4a6579d9ecf841bea0c9bce9793997f (commit)
via 7c5a636a64cbef6b1a2fa3d02a73407c7ab4598e (commit)
via 09c57dd96168825bfb117d1cbcc76d615f7835c5 (commit)
via c3cfb760bb7823949915e7e58b12274d36260a86 (commit)
via 7f4665723a2188e0efd74db0fdaa452543362ad9 (commit)
via 12384c77965dfee4663138fee2e01246c762f336 (commit)
via 300c0c415a873b7735718cfa73660225883c2360 (commit)
via 006ca07b3c31caf15d6d71c6a126f897d26fddff (commit)
via 75b1b20fa285a4eeaf8bd462cc1173ccb5b54f69 (commit)
via c4d0df1f86fd32ee809f19c57c9e7ad6155f4dbf (commit)
via 14cdbcba319922803af9f53b8cd6c8041603fd0f (commit)
via c2d1f045073ae7912f2fc4e52752d84ad23fdb09 (commit)
via 8ad62b1af8c843ed90b278acc6410820afc95652 (commit)
via 99baa872bfe18760787b69629d32732e2a90f1ba (commit)
via 28e2d8f45c7e2e398b350a299ef18dea68675b40 (commit)
via 43b24caa0104a60cd007002dd9aca831e54f39e2 (commit)
via 26aa57adede2f11eab099c513ecbd5843e28565f (commit)
via fc96ec08742ee5b9cc3592744ccbe00ee5b55a43 (commit)
via e89687668d5b0ef501a0930a5977516d1c3a6983 (commit)
via c7cfc783035bdfc34b966d9ee22133314238b101 (commit)
via 1f98f0d34770fd94aabc58100295bb1b525402fc (commit)
via 92215dfd2ab7cbf7432792b63919260f24fc2f99 (commit)
via dfc5e72d02c65b18064c15396947fe0e4da99f68 (commit)
via bdecc7f73eb87f07195264434a28aebf0bd23d13 (commit)
via 5f55b0ea486fdd1f5158543bb3d5ea349a2beaf7 (commit)
via f03b03878e97990d8894694684be181c98fa9d68 (commit)
via 6285c4a6b8b2ce15fbf8214a0f6db987182ae068 (commit)
via 131f8443a3d1200c0ea7aa4b8ab27de14139516c (commit)
via e9cc1881dc83ba34ff8e165749e2637d277ce2f9 (commit)
via c80d45378a38bf228d10928e1f969a13d7cff394 (commit)
via 716637c4abfba44fdb110c35873a962c035f9330 (commit)
via 1596e125b61da4b495cc4fc7d8b6dde1d200f331 (commit)
via 4b8de5f96d548860f4cca1ab6d3db7e0d274cc15 (commit)
via 42d6cce77b7147c68736317f67745a31313a082f (commit)
via d2924c7ae70c56301def2dda7208bd4d11533651 (commit)
via 58e6ee3553cb3b371820fd0877ff5617ddd01a8a (commit)
via 322ba6901c548567df4aa87f109ad1a846560db3 (commit)
via 04e10da6e3ea11aae013c304ae5934412f1b1077 (commit)
via b67803358c40b94216b8999d37fc92b1ac387b32 (commit)
via 79852862082d78a38c74b17c859369c641b4aaec (commit)
via f97736649fff5fea479e1ca02992036385dc1ea5 (commit)
via 7835329e32b6ea24693a19dc410eb175bac0c68b (commit)
via 1d96a84b44eda31edd2dbb9cd7e10d8c6ef753d3 (commit)
via 4f0d78f1d91619b2cc67fade8c23ba88d6614371 (commit)
via 7101c699c87270e7aba7c31e7bc17b4bc90c8749 (commit)
via 46d31277c1972f980e92275ea57112a5e7150bcf (commit)
via ca763d4ff11c3d25433fe36c2c03f8e5f467ef49 (commit)
via a4c10c32063e0bff651303b8d29efd840b32245b (commit)
via f45aea8859d55b8d2112dc0429b199318b315ecd (commit)
via 247f0f72cf4b23fa9c0684ea5fb314f0480c3a3a (commit)
via dad55ef1481cb82a93bac73d7d5793b7bfe4cdf5 (commit)
via f55e7b8348e89f626d734bd0003df9d5e3e95aa5 (commit)
via 6fa16ea77fa9d1a08cf696f40fae8c07603b94d8 (commit)
via 023a6bd3fbdb4b188cb9fd79e6b79990b01600f6 (commit)
via 9fd6af9699962e5d541363755b2423534fa5dc2b (commit)
via b55a46a0f6bca06b479926aa4128863b68a2c5b1 (commit)
via e505ed37db59fb29c1d6ca16c21f6191f53b57d2 (commit)
via 62b9a12e8939e43a04324c731407ea761550b969 (commit)
via 2a758b96abd700816c85726f92ac5b63bc1e41e0 (commit)
via 6e6d192c91a2ffe3aaf17f1cfe35643e44189964 (commit)
via 5d130be05c2339b5cf6d9385a9fc45a14bf64e16 (commit)
via 5648e587a8e9f44a00d32baeb099ff710c2aaf0f (commit)
via a8d9d90025d9bfe06e794b7c65d0f1e68ed2a62d (commit)
via b0357025e671afd224831b0d67ba8fbd8a2e26e2 (commit)
via 65a3305fa8903ef296fb1cf6d6543845ab9f8f07 (commit)
via b6f1cc4bc87912b228e63acea44ef6b0d61a3e4d (commit)
via 7ab97b5e7a4ea6b7a8fa1084af8f4e4b12ed088b (commit)
via 95375a5587cad20f7616bc9cdb405ed22e333980 (commit)
via 6c6b1799f98163d6a2db56980a6af127146671d1 (commit)
via 58b01989b818b409f8e43e9ea907b703ffda7d3e (commit)
via 1022596f76b82cace87f60d27e4b42cbbe246b3d (commit)
via 60782af15a0e53eba4ca76473dbf1a17f15c2fbb (commit)
via 1b3cee99fbf1d1357f8c69b9f33404bfdb5d7363 (commit)
via e3c2a8d6caa2826710ae8ff017ebdb8f48428753 (commit)
via f94ca773990f95e0f1cf205798670115a1f12917 (commit)
via 4a8a82ffc476c39a6ba49e883324d392c61c3cfe (commit)
via 41113de9a2856d0fcd0df83ca4ce25a2d71a6cc2 (commit)
via fd4b3eb10398fff954378b4d515b9c5811008fa0 (commit)
via 1ab828f8efcb85e51fe081208ae7387686c3e7da (commit)
via d044ad998c5bf649e51ffaad12539067e8a7e0bc (commit)
via ec648509014c6f7c83bce7bc95dbcf6c771bb672 (commit)
via 5134fc5fdabb56ad66a961c3d4134875dd23f329 (commit)
via 1e9ecb079ad5c6c172116d6a0beef6a342059b0e (commit)
via 4ada2117131f85e438727d28f4606e5357304136 (commit)
via 6e1b58b9802c427294e5fc66b6e7d518485d0aad (commit)
via 40a1e7a2c4ea3cc5c0e312c6f83b1e85e185bb1d (commit)
via 5a079e03a47112f6825bd98fad0acd4b75fae094 (commit)
via 34566d433bb97cde593f8c7a3181c2a08689be6f (commit)
via 2b37e8b79b286993d9c69eb5797fe2ae70652229 (commit)
via e4acbac64745fc2297cb6ed183b344a09dc3a392 (commit)
via fdf1c3cdab6c931bf1d4ad6ad2ef4d2250997cb9 (commit)
via 3f7cf2d0b32ad6c14655aecbd665ae66059285dd (commit)
from 9318df8e7511694c5652a91029ad1245328452cc (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 77d9d11f9249edeaedef943766c243c595952ad8
Author: Mike Black W9MDB <mdb...@ya...>
Date: Fri May 26 17:11:43 2023 -0500
Remove multicast from rig_state structure as it breaks backwards compability on DLL with WSJT-X
This is due to the callbacks structure being realigned as the state structure expanded
https://github.com/Hamlib/Hamlib/issues/1299
diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h
index 424f404e0..81d5088e2 100644
--- a/include/hamlib/rig.h
+++ b/include/hamlib/rig.h
@@ -2629,7 +2629,7 @@ struct rig_state {
char client_version[32]; /*!<! Allow client to report version for compatibility checks/capability */
freq_t offset_vfoa; /*!< Offset to apply to VFOA/Main set_freq */
freq_t offset_vfob; /*!< Offset to apply to VFOB/Sub set_freq */
- struct multicast_s *multicast; /*!< Pointer to multicast server data */
+// struct multicast_s *multicast; /*!< Pointer to multicast server data */
};
//! @cond Doxygen_Suppress
diff --git a/src/multicast.c b/src/multicast.c
index de834c7e1..b4b62e2c4 100644
--- a/src/multicast.c
+++ b/src/multicast.c
@@ -13,6 +13,7 @@
#endif
#include "hamlib/rig.h"
#include "misc.h"
+#if 0
#include "multicast.h"
#define RIG_MULTICAST_ADDR "224.0.0.1"
@@ -524,3 +525,4 @@ int main(int argc, char *argv[])
return 0;
}
#endif
+#endif
diff --git a/src/rig.c b/src/rig.c
index 8fa59756c..33cbb8226 100644
--- a/src/rig.c
+++ b/src/rig.c
@@ -7599,6 +7599,7 @@ HAMLIB_EXPORT(void) sync_callback(int lock)
void rig_lock(RIG *rig, int lock)
{
#ifdef HAVE_PTHREAD
+#if 0 //MULTICAST disabled as it breaks the DLL backwards compatibility
if (rig->state.multicast == NULL) { return; } // not initialized yet
@@ -7620,6 +7621,7 @@ void rig_lock(RIG *rig, int lock)
}
#endif
+#endif
}
diff --git a/tests/rigtestmcast.c b/tests/rigtestmcast.c
index fe87a8512..0ea3d0ef6 100644
--- a/tests/rigtestmcast.c
+++ b/tests/rigtestmcast.c
@@ -31,9 +31,9 @@ int main(int argc, char *argv[])
#endif
rig->state.rigport.parm.serial.rate = 38400;
rig_open(rig);
- multicast_init(rig, "224.0.0.1", 4532);
- printf("threadid=%lld\n", (long long)rig->state.multicast->threadid);
- pthread_join(rig->state.multicast->threadid, NULL);
+// multicast_init(rig, "224.0.0.1", 4532);
+ //printf("threadid=%lld\n", (long long)rig->state.multicast->threadid);
+ //pthread_join(rig->state.multicast->threadid, NULL);
pthread_exit(NULL);
return 0;
}
commit 81dd39319b2a973ab7bb83b17b789a4e157a2033
Author: Mike Black W9MDB <mdb...@ya...>
Date: Fri May 26 12:19:50 2023 -0500
Clean up startup messages in newcat.c when power is off
diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c
index 4be778958..de96b331d 100644
--- a/rigs/yaesu/newcat.c
+++ b/rigs/yaesu/newcat.c
@@ -1579,6 +1579,11 @@ int newcat_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
{
RETURNFUNC(-RIG_ENAVAIL);
}
+ if (rig->state.powerstat == 0)
+ {
+ rig_debug(RIG_DEBUG_WARN, "%s: Cannot get from rig when power is off\n", __func__);
+ return RIG_OK; // to prevent repeats
+ }
err = newcat_set_vfo_from_alias(rig, &vfo);
@@ -10449,6 +10454,11 @@ int newcat_get_vfo_mode(RIG *rig, vfo_t vfo, rmode_t *vfo_mode)
{
RETURNFUNC(err);
}
+ if (rig->state.powerstat == 0)
+ {
+ rig_debug(RIG_DEBUG_WARN, "%s: Cannot get from rig when power is off\n", __func__);
+ return RIG_OK; // to prevent repeats
+ }
/* vfo, mem, P7 ************************** */
// e.g. FT450 has 27 byte IF response, FT991 has 28 byte if response (one more byte for P2 VFO A Freq)
@@ -10537,6 +10547,7 @@ int newcat_get_cmd(RIG *rig)
int is_power_status_cmd = strncmp(priv->cmd_str, "PS", 2) == 0;
ENTERFUNC;
+ priv->ret_data[0] = 0; // ensure zero-length ret_data by default
if (state->powerstat == 0 && !is_power_status_cmd)
{
diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h
index 05b8f2fdb..02eb111ca 100644
--- a/rigs/yaesu/newcat.h
+++ b/rigs/yaesu/newcat.h
@@ -50,7 +50,7 @@
typedef char ncboolean;
/* shared function version */
-#define NEWCAT_VER "20230517"
+#define NEWCAT_VER "20230526"
/* Hopefully large enough for future use, 128 chars plus '\0' */
#define NEWCAT_DATA_LEN 129
commit ccd832d4cb0b01f8623bbe849513742aaf3fc501
Author: Mike Black W9MDB <mdb...@ya...>
Date: Fri May 26 11:04:42 2023 -0500
Improve power on message in rig.c
diff --git a/src/rig.c b/src/rig.c
index c9359ae8d..8fa59756c 100644
--- a/src/rig.c
+++ b/src/rig.c
@@ -1295,7 +1295,7 @@ int HAMLIB_API rig_open(RIG *rig)
{
// rig_open() should succeed even if the rig is powered off, so simply log power status
rig_debug(RIG_DEBUG_ERR,
- "%s: rig power is off, use --set-conf=auto_power_on=1 if power on is wanted\n",
+ "%s: rig power is off, use --set-conf=auto_power_on=1 or set_powerstat if power on is wanted\n",
__func__);
}
commit 8d465a257ee9a5e0f4a472ec74c43b0c6a6b495e
Author: Mike Black W9MDB <mdb...@ya...>
Date: Fri May 26 10:53:32 2023 -0500
Fix a couple more debug statements
diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c
index 0585b2729..4be778958 100644
--- a/rigs/yaesu/newcat.c
+++ b/rigs/yaesu/newcat.c
@@ -2991,7 +2991,7 @@ int newcat_get_xit(RIG *rig, vfo_t vfo, shortfreq_t *xit)
if (offset == 0)
{
rig_debug(RIG_DEBUG_ERR,
- "%s: incorrect length of IF response, expected 27 or 28, got %du", __func__,
+ "%s: incorrect length of IF response, expected 27 or 28, got %du\n", __func__,
(int)strlen(priv->ret_data));
RETURNFUNC(-RIG_EPROTO);
}
@@ -10461,7 +10461,7 @@ int newcat_get_vfo_mode(RIG *rig, vfo_t vfo, rmode_t *vfo_mode)
default:
rig_debug(RIG_DEBUG_ERR,
- "%s: incorrect length of IF response, expected 27 or 28, got %d", __func__,
+ "%s: incorrect length of IF response, expected 27 or 28, got %d\n", __func__,
(int)strlen(priv->ret_data));
RETURNFUNC(-RIG_EPROTO);
}
commit 06f5d8376f6bbc152f0342fccdff5c5a3b29aa88
Author: Mike Black W9MDB <mdb...@ya...>
Date: Fri May 26 10:52:04 2023 -0500
Fix debug message eol
diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c
index 39219adeb..0585b2729 100644
--- a/rigs/yaesu/newcat.c
+++ b/rigs/yaesu/newcat.c
@@ -2875,7 +2875,7 @@ int newcat_get_rit(RIG *rig, vfo_t vfo, shortfreq_t *rit)
if (offset == 0)
{
rig_debug(RIG_DEBUG_ERR,
- "%s: incorrect length of IF response, expected 27 or 28, got %du", __func__,
+ "%s: incorrect length of IF response, expected 27 or 28, got %du\n", __func__,
(int)strlen(priv->ret_data));
RETURNFUNC(-RIG_EPROTO);
}
commit f01a165ec774c98479543665b15074b39c831b73
Merge: 610bf2d90 fd68723da
Author: Michael Black <mdb...@ya...>
Date: Fri May 26 10:47:35 2023 -0500
Merge pull request #1302 from mikaelnousiainen/power-status-bug-fixes
Power status bug fixes
commit fd68723da1fbccb922bc7eb74f580869b0105f72
Author: Mikael Nousiainen <mik...@ik...>
Date: Fri May 26 18:03:20 2023 +0300
Fix issues with power status handling in rigctl+rigctld and the Yaesu backend
diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c
index 4822c511d..39219adeb 100644
--- a/rigs/yaesu/newcat.c
+++ b/rigs/yaesu/newcat.c
@@ -10534,10 +10534,11 @@ int newcat_get_cmd(RIG *rig)
int retry_count = 0;
int rc = -RIG_EPROTO;
int is_read_cmd = 0;
+ int is_power_status_cmd = strncmp(priv->cmd_str, "PS", 2) == 0;
ENTERFUNC;
- if (state->powerstat == 0)
+ if (state->powerstat == 0 && !is_power_status_cmd)
{
rig_debug(RIG_DEBUG_WARN, "%s: Cannot get from rig when power is off\n", __func__);
return RIG_OK; // to prevent repeats
@@ -10614,14 +10615,13 @@ int newcat_get_cmd(RIG *rig)
|| strcmp(priv->cmd_str, "VT0;") == 0
|| strcmp(priv->cmd_str, "VT1;") == 0;
- if (priv->cmd_str[2] !=
- ';' && !is_read_cmd) // then we must be setting something so we'll invalidate the cache
+ if (priv->cmd_str[2] != ';' && !is_read_cmd)
{
+ // then we must be setting something so we'll invalidate the cache
rig_debug(RIG_DEBUG_TRACE, "%s: cache invalidated\n", __func__);
priv->cache_start.tv_sec = 0;
}
-
while (rc != RIG_OK && retry_count++ <= state->rigport.retry)
{
rig_flush(&state->rigport); /* discard any unsolicited data */
@@ -10630,11 +10630,8 @@ int newcat_get_cmd(RIG *rig)
/* send the command */
rig_debug(RIG_DEBUG_TRACE, "cmd_str = %s\n", priv->cmd_str);
-
- if (strncmp(priv->cmd_str,"PS",2)==0) state->rigport.timeout_retry = 0;
- if (RIG_OK != (rc = write_block(&state->rigport,
- (unsigned char *) priv->cmd_str,
- strlen(priv->cmd_str))))
+ rc = write_block(&state->rigport, (unsigned char *) priv->cmd_str, strlen(priv->cmd_str));
+ if (rc != RIG_OK)
{
RETURNFUNC(rc);
}
@@ -10646,9 +10643,10 @@ int newcat_get_cmd(RIG *rig)
&cat_term, sizeof(cat_term), 0, 1)) <= 0)
{
// if we get a timeout from PS probably means power is off
- if (strncmp(priv->cmd_str,"PS",2)==0) {
+ if (rc == -RIG_ETIMEOUT && is_power_status_cmd)
+ {
rig_debug(RIG_DEBUG_WARN, "%s: rig power is off?\n", __func__);
- return -RIG_ETIMEOUT;
+ RETURNFUNC(rc);
}
continue; /* usually a timeout - retry */
}
diff --git a/src/rig.c b/src/rig.c
index 16047ea37..c9359ae8d 100644
--- a/src/rig.c
+++ b/src/rig.c
@@ -100,7 +100,7 @@ const char *hamlib_version2 = "Hamlib " PACKAGE_VERSION " " HAMLIBDATETIME " "
ARCHBITS;
HAMLIB_EXPORT_VAR(int) cookie_use;
HAMLIB_EXPORT_VAR(int) lock_mode; // for use by rigctld
-HAMLIB_EXPORT_VAR(powerstat_t) rig_powerstat; // for use by rigctld
+HAMLIB_EXPORT_VAR(powerstat_t) rig_powerstat; // for use by both rigctld and rigctl
//! @endcond
struct rig_caps caps_test;
@@ -6167,6 +6167,12 @@ int HAMLIB_API rig_set_powerstat(RIG *rig, powerstat_t status)
HAMLIB_TRACE;
retcode = rig->caps->set_powerstat(rig, status);
+
+ if (retcode == RIG_OK)
+ {
+ rig->state.powerstat = status;
+ }
+
// if anything is queued up flush it
rig_flush_force(&rig->state.rigport, 1);
RETURNFUNC(retcode);
@@ -6214,7 +6220,11 @@ int HAMLIB_API rig_get_powerstat(RIG *rig, powerstat_t *status)
HAMLIB_TRACE;
retcode = rig->caps->get_powerstat(rig, status);
- if (retcode != RIG_OK)
+ if (retcode == RIG_OK)
+ {
+ rig->state.powerstat = *status;
+ }
+ else
{
// if failed, assume power is on
*status = RIG_POWER_ON;
diff --git a/tests/rigctl.c b/tests/rigctl.c
index b2a7a322b..22253a9de 100644
--- a/tests/rigctl.c
+++ b/tests/rigctl.c
@@ -111,6 +111,7 @@ static struct option long_options[] =
};
extern char rig_resp_sep;
+extern powerstat_t rig_powerstat;
#define MAXCONFLEN 1024
@@ -149,6 +150,7 @@ int main(int argc, char *argv[])
int i;
char rigstartup[1024];
char vbuf[1024];
+ rig_powerstat = RIG_POWER_ON; // defaults to power on
int err = setvbuf(stderr, vbuf, _IOFBF, sizeof(vbuf));
@@ -575,6 +577,12 @@ int main(int argc, char *argv[])
my_rig->caps->model_name);
}
+ if (my_rig->caps->get_powerstat)
+ {
+ rig_get_powerstat(my_rig, &rig_powerstat);
+ my_rig->state.powerstat = rig_powerstat;
+ }
+
if (my_rig->caps->rig_model == RIG_MODEL_NETRIGCTL)
{
/* We automatically detect if we need to be in vfo mode or not */
@@ -650,6 +658,21 @@ int main(int argc, char *argv[])
interactive, prompt, &vfo_opt, send_cmd_term,
&ext_resp, &rig_resp_sep, 0);
+ // If we get a timeout, the rig might be powered off
+ // Update our power status in case power gets turned off
+ if (retcode == -RIG_ETIMEOUT && my_rig->caps->get_powerstat)
+ {
+ powerstat_t powerstat;
+
+ rig_get_powerstat(my_rig, &powerstat);
+ rig_powerstat = powerstat;
+
+ if (powerstat == RIG_POWER_OFF || powerstat == RIG_POWER_STANDBY)
+ {
+ retcode = -RIG_EPOWER;
+ }
+ }
+
// if we get a hard error we try to reopen the rig again
// this should cover short dropouts that can occur
if (retcode < 0 && !RIG_IS_SOFT_ERRCODE(-retcode))
diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c
index b267e69b1..fc60828bd 100644
--- a/tests/rigctl_parse.c
+++ b/tests/rigctl_parse.c
@@ -104,7 +104,7 @@ char rigctld_password[64];
int is_passwordOK;
int is_rigctld;
extern int lock_mode; // used by rigctld
-extern int rig_powerstat;
+extern powerstat_t rig_powerstat;
@@ -4723,7 +4723,6 @@ declare_proto_rig(set_powerstat)
retval = rig_set_powerstat(rig, (powerstat_t) stat);
if (retval == RIG_OK)
{
- rig->state.powerstat = stat;
rig_powerstat = stat; // update our global so others can see powerstat
}
fflush(fin);
@@ -4752,7 +4751,6 @@ declare_proto_rig(get_powerstat)
}
fprintf(fout, "%d\n", stat);
- rig->state.powerstat = stat;
rig_powerstat = stat; // update our global so others can see powerstat
RETURNFUNC2(status);
diff --git a/tests/rigctld.c b/tests/rigctld.c
index 8b75bbca6..bd0ad1b6b 100644
--- a/tests/rigctld.c
+++ b/tests/rigctld.c
@@ -1278,9 +1278,9 @@ void *handle_socket(void *arg)
if (retcode != 0) { rig_debug(RIG_DEBUG_VERBOSE, "%s: rigctl_parse retcode=%d\n", __func__, retcode); }
- // update our power stat in case power gets turned off
- if (retcode == -RIG_ETIMEOUT
- && my_rig->caps->get_powerstat) // if we get a timeout we might be powered off
+ // If we get a timeout, the rig might be powered off
+ // Update our power status in case power gets turned off
+ if (retcode == -RIG_ETIMEOUT && my_rig->caps->get_powerstat)
{
rig_get_powerstat(my_rig, &powerstat);
rig_powerstat = powerstat;
commit 8730e6a0b141367a3f74b23629257b6236de50a8
Author: Mikael Nousiainen <mik...@ik...>
Date: Tue May 23 23:25:27 2023 +0300
IC-746 and IC-756ProII+III support AGC_TIME
diff --git a/rigs/icom/ic746.c b/rigs/icom/ic746.c
index d96309651..95787dcb9 100644
--- a/rigs/icom/ic746.c
+++ b/rigs/icom/ic746.c
@@ -54,7 +54,7 @@
#define IC746_FUNC_ALL (RIG_FUNC_NB|RIG_FUNC_COMP|RIG_FUNC_VOX|RIG_FUNC_TONE|RIG_FUNC_TSQL|RIG_FUNC_SBKIN|RIG_FUNC_FBKIN|RIG_FUNC_NR|RIG_FUNC_MON|RIG_FUNC_MN|RIG_FUNC_RF|RIG_FUNC_ANF|RIG_FUNC_APF|RIG_FUNC_RESUME|RIG_FUNC_ARO)
-#define IC746_LEVEL_ALL (RIG_LEVEL_AF|RIG_LEVEL_RF|RIG_LEVEL_PREAMP|RIG_LEVEL_ATT|RIG_LEVEL_AGC|RIG_LEVEL_COMP|RIG_LEVEL_BKINDL|RIG_LEVEL_NR|RIG_LEVEL_PBT_IN|RIG_LEVEL_PBT_OUT|RIG_LEVEL_CWPITCH|RIG_LEVEL_RFPOWER|RIG_LEVEL_MICGAIN|RIG_LEVEL_KEYSPD|RIG_LEVEL_NOTCHF_RAW|RIG_LEVEL_SQL|RIG_LEVEL_RAWSTR|RIG_LEVEL_APF)
+#define IC746_LEVEL_ALL (RIG_LEVEL_AF|RIG_LEVEL_RF|RIG_LEVEL_PREAMP|RIG_LEVEL_ATT|RIG_LEVEL_AGC|RIG_LEVEL_COMP|RIG_LEVEL_BKINDL|RIG_LEVEL_NR|RIG_LEVEL_PBT_IN|RIG_LEVEL_PBT_OUT|RIG_LEVEL_CWPITCH|RIG_LEVEL_RFPOWER|RIG_LEVEL_MICGAIN|RIG_LEVEL_KEYSPD|RIG_LEVEL_NOTCHF_RAW|RIG_LEVEL_SQL|RIG_LEVEL_RAWSTR|RIG_LEVEL_APF|RIG_LEVEL_AGC_TIME)
#define IC746_GET_PARM (RIG_PARM_BACKLIGHT|RIG_PARM_BEEP)
#define IC746_SET_PARM (RIG_PARM_BACKLIGHT|RIG_PARM_BEEP|RIG_PARM_ANN)
diff --git a/rigs/icom/ic756.c b/rigs/icom/ic756.c
index 70ce3bcaa..4dc752a9c 100644
--- a/rigs/icom/ic756.c
+++ b/rigs/icom/ic756.c
@@ -537,7 +537,7 @@ static int ic756pro2_get_ext_parm(RIG *rig, token_t token, value_t *val);
#define IC756PROII_OTHER_TX_MODES (RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|RIG_MODE_RTTY|RIG_MODE_RTTYR|RIG_MODE_FM)
#define IC756PROII_AM_TX_MODES (RIG_MODE_AM)
-#define IC756PROII_LEVEL_ALL (IC756PRO_LEVEL_ALL|RIG_LEVEL_VOXDELAY)
+#define IC756PROII_LEVEL_ALL (IC756PRO_LEVEL_ALL|RIG_LEVEL_VOXDELAY|RIG_LEVEL_AGC_TIME)
#define IC756PROII_PARMS (RIG_PARM_ANN|RIG_PARM_BEEP|RIG_PARM_BACKLIGHT|RIG_PARM_TIME)
commit 610bf2d90324f9f1d722923e116943192e748a17
Merge: 79492d428 b6fe91504
Author: Michael Black <mdb...@ya...>
Date: Tue May 23 15:05:54 2023 -0500
Merge pull request #1301 from GeoBaltz/man1
Man1
commit b6fe91504f06534fa601320fbd7645e619d3a3b3
Author: George Baltz N3GB <Geo...@gm...>
Date: Tue May 23 13:14:28 2023 -0400
Avoid NULL dereference in debug statement.
diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c
index 496494557..7e151db8b 100644
--- a/rigs/kenwood/kenwood.c
+++ b/rigs/kenwood/kenwood.c
@@ -246,7 +246,7 @@ int kenwood_transaction(RIG *rig, const char *cmdstr, char *data,
struct kenwood_priv_caps *caps = kenwood_caps(rig);
struct rig_state *rs;
- if (datasize > 0 && datasize < strlen(cmdstr)) {
+ if (datasize > 0 && datasize < (cmdstr ? strlen(cmdstr) : 0)) {
rig_debug(RIG_DEBUG_WARN, "%s called cmd=%s datasize=%d, datasize < cmd length?\n", __func__,
cmdstr ? cmdstr : "(NULL)",
(int)datasize);
commit 79492d42844b4bcbe8f7e1f5b374960311b4e7c6
Author: Mike Black W9MDB <mdb...@ya...>
Date: Tue May 23 10:11:51 2023 -0500
Put enter/leave CAT in FT767GX.c again and reduce write_delay to zero.
Hopefully speeds things up and still works but may need to tweak write_delay
https://github.com/Hamlib/Hamlib/issues/1300
diff --git a/rigs/yaesu/ft767gx.c b/rigs/yaesu/ft767gx.c
index c51318ce8..d8c60c0a2 100644
--- a/rigs/yaesu/ft767gx.c
+++ b/rigs/yaesu/ft767gx.c
@@ -259,7 +259,7 @@ const struct rig_caps ft767gx_caps =
RIG_MODEL(RIG_MODEL_FT767),
.model_name = "FT-767GX",
.mfg_name = "Yaesu",
- .version = "20230522.0",
+ .version = "20230523.0",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
@@ -468,7 +468,6 @@ int ft767_open(RIG *rig)
return retval;
}
-#if 0 // we should be able to leave CAT on and just turn off on close
retval = ft767_leave_CAT(rig);
if (retval < 0)
@@ -477,7 +476,6 @@ int ft767_open(RIG *rig)
memset(priv->update_data, 0, FT767GX_STATUS_UPDATE_DATA_LENGTH);
return retval;
}
-#endif
rig->state.vfo_list = RIG_VFO_A | RIG_VFO_B;
return RIG_OK;
@@ -514,7 +512,6 @@ int ft767_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
/* fill in first four bytes */
to_bcd(cmd, freq / 10, 8);
-#if 0
retval = ft767_enter_CAT(rig);
if (retval < 0)
@@ -522,7 +519,6 @@ int ft767_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
rig_debug(RIG_DEBUG_ERR, "%s: enter_CAT %d\n", __func__, retval);
return retval;
}
-#endif
retval = ft767_send_block_and_ack(rig, cmd, YAESU_CMD_LENGTH);
@@ -533,14 +529,12 @@ int ft767_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
return retval;
}
-#if 0
retval = ft767_leave_CAT(rig);
if (retval < 0)
{
rig_debug(RIG_DEBUG_ERR, "%s: leave_CAT %d\n", __func__, retval);
}
-#endif
return retval;
}
@@ -553,7 +547,6 @@ int ft767_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
/* fill in p1 */
cmd[3] = mode2rig(rig, mode);
-#if 0
retval = ft767_enter_CAT(rig);
if (retval < 0)
@@ -561,7 +554,6 @@ int ft767_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
rig_debug(RIG_DEBUG_ERR, "%s: enter_CAT %d\n", __func__, retval);
return retval;
}
-#endif
retval = ft767_send_block_and_ack(rig, cmd, YAESU_CMD_LENGTH);
@@ -572,14 +564,12 @@ int ft767_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
return retval;
}
-#if 0
retval = ft767_leave_CAT(rig);
if (retval < 0)
{
rig_debug(RIG_DEBUG_ERR, "%s: leave_CAT %d\n", __func__, retval);
}
-#endif
return retval;
}
@@ -690,7 +680,6 @@ int ft767_set_vfo(RIG *rig, vfo_t vfo)
priv->current_vfo = vfo;
-#if 0
retval = ft767_enter_CAT(rig);
if (retval < 0)
@@ -698,7 +687,6 @@ int ft767_set_vfo(RIG *rig, vfo_t vfo)
rig_debug(RIG_DEBUG_ERR, "%s: enter_CAT %d\n", __func__, retval);
return retval;
}
-#endif
retval = ft767_send_block_and_ack(rig, cmd, YAESU_CMD_LENGTH);
@@ -709,14 +697,12 @@ int ft767_set_vfo(RIG *rig, vfo_t vfo)
return retval;
}
-#if 0
retval = ft767_leave_CAT(rig);
if (retval < 0)
{
rig_debug(RIG_DEBUG_ERR, "%s: leave_CAT %d\n", __func__, retval);
}
-#endif
return retval;
}
@@ -781,7 +767,6 @@ int ft767_set_ctcss_tone(RIG *rig, vfo_t vfo, tone_t tone)
/* cmd[3] = tone2rig(rig, tone); */
-#if 0
retval = ft767_enter_CAT(rig);
if (retval < 0)
@@ -789,7 +774,6 @@ int ft767_set_ctcss_tone(RIG *rig, vfo_t vfo, tone_t tone)
rig_debug(RIG_DEBUG_ERR, "%s: enter_CAT %d\n", __func__, retval);
return retval;
}
-#endif
retval = ft767_send_block_and_ack(rig, cmd, YAESU_CMD_LENGTH);
@@ -800,14 +784,12 @@ int ft767_set_ctcss_tone(RIG *rig, vfo_t vfo, tone_t tone)
return retval;
}
-#if 0
retval = ft767_leave_CAT(rig);
if (retval < 0)
{
rig_debug(RIG_DEBUG_ERR, "%s: leave_CAT %d\n", __func__, retval);
}
-#endif
return retval;
}
@@ -903,7 +885,6 @@ int ft767_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq)
/* fill in first four bytes */
to_bcd(freq_cmd, tx_freq / 10, 8);
-#if 0
retval = ft767_enter_CAT(rig);
if (retval < 0)
@@ -911,7 +892,6 @@ int ft767_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq)
rig_debug(RIG_DEBUG_ERR, "%s: enter_CAT %d\n", __func__, retval);
return retval;
}
-#endif
/* change to the xmit VFO */
vfo_cmd[3] = vfo2rig(rig, change_vfo);
@@ -945,14 +925,12 @@ int ft767_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq)
return retval;
}
-#if 0
retval = ft767_leave_CAT(rig);
if (retval < 0)
{
rig_debug(RIG_DEBUG_ERR, "%s: leave_CAT %d\n", __func__, retval);
}
-#endif
return RIG_OK;
}
@@ -1070,7 +1048,6 @@ int ft767_set_split_mode(RIG *rig, vfo_t vfo, rmode_t tx_mode,
/* fill in p1 */
mode_cmd[3] = mode2rig(rig, tx_mode);
-#if 0
retval = ft767_enter_CAT(rig);
if (retval < 0)
@@ -1078,7 +1055,6 @@ int ft767_set_split_mode(RIG *rig, vfo_t vfo, rmode_t tx_mode,
rig_debug(RIG_DEBUG_ERR, "%s: enter_CAT %d\n", __func__, retval);
return retval;
}
-#endif
/* change to the xmit VFO */
vfo_cmd[3] = vfo2rig(rig, change_vfo);
@@ -1112,14 +1088,12 @@ int ft767_set_split_mode(RIG *rig, vfo_t vfo, rmode_t tx_mode,
return retval;
}
-#if 0
retval = ft767_leave_CAT(rig);
if (retval < 0)
{
rig_debug(RIG_DEBUG_ERR, "%s: leave_CAT %d\n", __func__, retval);
}
-#endif
return RIG_OK;
}
@@ -1259,7 +1233,6 @@ int ft767_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo)
rig_flush(&rig->state.rigport);
-#if 0
retval = ft767_enter_CAT(rig);
if (retval < 0)
@@ -1267,7 +1240,6 @@ int ft767_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo)
rig_debug(RIG_DEBUG_ERR, "%s: enter_CAT %d\n", __func__, retval);
return retval;
}
-#endif
/* See whether we need to toggle the split state */
curr_split = priv->update_data[STATUS_FLAGS] & STATUS_MASK_SPLIT;
@@ -1318,7 +1290,6 @@ int ft767_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo)
}
}
-#if 0
retval = ft767_leave_CAT(rig);
if (retval < 0)
@@ -1326,7 +1297,6 @@ int ft767_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo)
rig_debug(RIG_DEBUG_ERR, "%s: leave_CAT %d\n", __func__, retval);
return retval;
}
-#endif
break;
diff --git a/rigs/yaesu/ft767gx.h b/rigs/yaesu/ft767gx.h
index b9fe60c5b..a60f1eb6d 100644
--- a/rigs/yaesu/ft767gx.h
+++ b/rigs/yaesu/ft767gx.h
@@ -32,7 +32,7 @@
#define FT767GX_PACING_INTERVAL 5
#define FT767GX_PACING_DEFAULT_VALUE 0
-#define FT767GX_WRITE_DELAY 50
+#define FT767GX_WRITE_DELAY 0
/* Sequential fast writes confuse my FT767GX without this delay */
commit ae14af4bc1a1cf67ce25b8ee5ef3567a54c63c70
Author: George Baltz N3GB <Geo...@gm...>
Date: Sun May 21 05:50:42 2023 -0400
Add missing commands to man pages
diff --git a/doc/man1/rigctl.1 b/doc/man1/rigctl.1
index c7b497246..7627ada63 100644
--- a/doc/man1/rigctl.1
+++ b/doc/man1/rigctl.1
@@ -734,6 +734,11 @@ Stop sending the current morse code.
Wait for morse to finish -- only works on full break-in
.
.TP
+.BR 0x94 ", " send_voice_mem " \(aq" \fIMsgnum\fP \(aq
+Have rig transmit internal message
+.RI \(aq Msgnum \(aq
+.
+.TP
.BR 0x8b ", " get_dcd
Get
.RI \(aq DCD \(aq
diff --git a/doc/man1/rigctld.1 b/doc/man1/rigctld.1
index d701673a4..af3b6b4e0 100644
--- a/doc/man1/rigctld.1
+++ b/doc/man1/rigctld.1
@@ -726,6 +726,19 @@ Send
symbols.
.
.TP
+.BR 0xbb ", " stop_morse "
+Stop sending the current morse code.
+.
+.TP
+.BR 0xbc ", " wait_morse "
+Wait for morse to finish -- only works on full break-in
+.
+.TP
+.BR 0x94 ", " send_voice_mem " \(aq" \fIMsgnum\fP \(aq
+Have rig transmit internal message
+.RI \(aq Msgnum \(aq
+.
+.TP
.BR 0x8b ", " get_dcd
Get
.RI \(aq DCD \(aq
commit a7d24a99dbe9b63f813aa568dd35ffd8eb217227
Author: George Baltz N3GB <Geo...@gm...>
Date: Sat May 20 16:43:42 2023 -0400
Fix typos (missing '('s ) in man pages.
diff --git a/doc/man1/rigctl.1 b/doc/man1/rigctl.1
index cf3aa0821..c7b497246 100644
--- a/doc/man1/rigctl.1
+++ b/doc/man1/rigctl.1
@@ -876,9 +876,9 @@ Level is a token: \(oqPREAMP\(cq, \(oqATT\(cq, \(oqVOXDELAY\(cq, \(oqAF\(cq,
\(oqBAL\(cq, \(oqMETER\(cq, \(oqVOXGAIN\(cq, \(oqANTIVOX\(cq,
\(oqSLOPE_LOW\(cq, \(oqSLOPE_HIGH\(cq, \(oqBKIN_DLYMS\(cq, \(oqRAWSTR\(cq, \(oqSWR\(cq,
\(oqALC\(cq, \(oqSTRENGTH\(cq, \(oqRFPOWER_METER\(cq, \(oqCOMPMETER\(cq, \(oqVD_METER\(cq, \(oqID_METER\(cq,
-\(oqNOTCHF_RAW\(cq, \(oqMONITOR_GAIN\(cq, \(oqNQ\(cq, \(oqRFPOWER_METER_WATTS\cq, \(oqSPECTRUM_MODE\(cq,
-\(oqSPECTRUM_SPAN\(cq, \(oqSPECTRUM_EDGE_LOW\(cq, \(oqSPECTRUM_EDGE_HIGH\(cq, \(oqSPECTRUM_SPEED\cq,
-\(oqSPECTRUM_REF\(cq, (oqSPECTRUM_AVG\(cq, \(oqSPECTRUM_ATT\cq, \(oqTEMP_METER\cq, \(oqBAND_SELECT\(cq,
+\(oqNOTCHF_RAW\(cq, \(oqMONITOR_GAIN\(cq, \(oqNQ\(cq, \(oqRFPOWER_METER_WATTS\(cq, \(oqSPECTRUM_MODE\(cq,
+\(oqSPECTRUM_SPAN\(cq, \(oqSPECTRUM_EDGE_LOW\(cq, \(oqSPECTRUM_EDGE_HIGH\(cq, \(oqSPECTRUM_SPEED\(cq,
+\(oqSPECTRUM_REF\(cq, \(oqSPECTRUM_AVG\(cq, \(oqSPECTRUM_ATT\(cq, \(oqTEMP_METER\(cq, \(oqBAND_SELECT\(cq,
\(oqUSB_AF\(cq.
.IP
The Level Value can be a float or an integer value. For the AGC token the
diff --git a/doc/man1/rigctld.1 b/doc/man1/rigctld.1
index 6b55bf59c..d701673a4 100644
--- a/doc/man1/rigctld.1
+++ b/doc/man1/rigctld.1
@@ -868,9 +868,9 @@ evel is a token: \(oqPREAMP\(cq, \(oqATT\(cq, \(oqVOXDELAY\(cq, \(oqAF\(cq,
\(oqBAL\(cq, \(oqMETER\(cq, \(oqVOXGAIN\(cq, \(oqANTIVOX\(cq,
\(oqSLOPE_LOW\(cq, \(oqSLOPE_HIGH\(cq, \(oqBKIN_DLYMS\(cq, \(oqRAWSTR\(cq, \(oqSWR\(cq,
\(oqALC\(cq, \(oqSTRENGTH\(cq, \(oqRFPOWER_METER\(cq, \(oqCOMPMETER\(cq, \(oqVD_METER\(cq, \(oqID_METER\(cq,
-\(oqNOTCHF_RAW\(cq, \(oqMONITOR_GAIN\(cq, \(oqNQ\(cq, \(oqRFPOWER_METER_WATTS\cq, \(oqSPECTRUM_MODE\(cq,
-\(oqSPECTRUM_SPAN\(cq, \(oqSPECTRUM_EDGE_LOW\(cq, \(oqSPECTRUM_EDGE_HIGH\(cq, \(oqSPECTRUM_SPEED\cq,
-\(oqSPECTRUM_REF\(cq, (oqSPECTRUM_AVG\(cq, \(oqSPECTRUM_ATT\cq, \(oqTEMP_METER\cq, \(oqBAND_SELECT\(cq,
+\(oqNOTCHF_RAW\(cq, \(oqMONITOR_GAIN\(cq, \(oqNQ\(cq, \(oqRFPOWER_METER_WATTS\(cq, \(oqSPECTRUM_MODE\(cq,
+\(oqSPECTRUM_SPAN\(cq, \(oqSPECTRUM_EDGE_LOW\(cq, \(oqSPECTRUM_EDGE_HIGH\(cq, \(oqSPECTRUM_SPEED\(cq,
+\(oqSPECTRUM_REF\(cq, \(oqSPECTRUM_AVG\(cq, \(oqSPECTRUM_ATT\(cq, \(oqTEMP_METER\(cq, \(oqBAND_SELECT\(cq,
\(oqUSB_AF\(cq.
.IP
The Level Value can be a float or an integer value. For the AGC token the
commit 083669dbc8ba9610733d4af23c255093bb3d4a52
Author: Mike Black W9MDB <mdb...@ya...>
Date: Mon May 22 11:25:57 2023 -0500
Hopefully speed up FT767GX considerably
https://github.com/Hamlib/Hamlib/issues/1300
diff --git a/rigs/yaesu/ft767gx.c b/rigs/yaesu/ft767gx.c
index afc50a324..c51318ce8 100644
--- a/rigs/yaesu/ft767gx.c
+++ b/rigs/yaesu/ft767gx.c
@@ -259,7 +259,7 @@ const struct rig_caps ft767gx_caps =
RIG_MODEL(RIG_MODEL_FT767),
.model_name = "FT-767GX",
.mfg_name = "Yaesu",
- .version = "20210221.0",
+ .version = "20230522.0",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
@@ -468,6 +468,7 @@ int ft767_open(RIG *rig)
return retval;
}
+#if 0 // we should be able to leave CAT on and just turn off on close
retval = ft767_leave_CAT(rig);
if (retval < 0)
@@ -476,6 +477,7 @@ int ft767_open(RIG *rig)
memset(priv->update_data, 0, FT767GX_STATUS_UPDATE_DATA_LENGTH);
return retval;
}
+#endif
rig->state.vfo_list = RIG_VFO_A | RIG_VFO_B;
return RIG_OK;
@@ -488,7 +490,13 @@ int ft767_open(RIG *rig)
int ft767_close(RIG *rig)
{
- rig_flush(&rig->state.rigport);
+ int retval = ft767_leave_CAT(rig);
+
+ if (retval < 0)
+ {
+ rig_debug(RIG_DEBUG_ERR, "%s: leave_CAT %d\n", __func__, retval);
+ return retval;
+ }
return RIG_OK;
}
@@ -506,6 +514,7 @@ int ft767_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
/* fill in first four bytes */
to_bcd(cmd, freq / 10, 8);
+#if 0
retval = ft767_enter_CAT(rig);
if (retval < 0)
@@ -513,6 +522,7 @@ int ft767_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
rig_debug(RIG_DEBUG_ERR, "%s: enter_CAT %d\n", __func__, retval);
return retval;
}
+#endif
retval = ft767_send_block_and_ack(rig, cmd, YAESU_CMD_LENGTH);
@@ -523,12 +533,14 @@ int ft767_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
return retval;
}
+#if 0
retval = ft767_leave_CAT(rig);
if (retval < 0)
{
rig_debug(RIG_DEBUG_ERR, "%s: leave_CAT %d\n", __func__, retval);
}
+#endif
return retval;
}
@@ -541,6 +553,7 @@ int ft767_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
/* fill in p1 */
cmd[3] = mode2rig(rig, mode);
+#if 0
retval = ft767_enter_CAT(rig);
if (retval < 0)
@@ -548,6 +561,7 @@ int ft767_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
rig_debug(RIG_DEBUG_ERR, "%s: enter_CAT %d\n", __func__, retval);
return retval;
}
+#endif
retval = ft767_send_block_and_ack(rig, cmd, YAESU_CMD_LENGTH);
@@ -558,12 +572,14 @@ int ft767_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
return retval;
}
+#if 0
retval = ft767_leave_CAT(rig);
if (retval < 0)
{
rig_debug(RIG_DEBUG_ERR, "%s: leave_CAT %d\n", __func__, retval);
}
+#endif
return retval;
}
@@ -674,6 +690,7 @@ int ft767_set_vfo(RIG *rig, vfo_t vfo)
priv->current_vfo = vfo;
+#if 0
retval = ft767_enter_CAT(rig);
if (retval < 0)
@@ -681,6 +698,7 @@ int ft767_set_vfo(RIG *rig, vfo_t vfo)
rig_debug(RIG_DEBUG_ERR, "%s: enter_CAT %d\n", __func__, retval);
return retval;
}
+#endif
retval = ft767_send_block_and_ack(rig, cmd, YAESU_CMD_LENGTH);
@@ -691,12 +709,14 @@ int ft767_set_vfo(RIG *rig, vfo_t vfo)
return retval;
}
+#if 0
retval = ft767_leave_CAT(rig);
if (retval < 0)
{
rig_debug(RIG_DEBUG_ERR, "%s: leave_CAT %d\n", __func__, retval);
}
+#endif
return retval;
}
@@ -761,6 +781,7 @@ int ft767_set_ctcss_tone(RIG *rig, vfo_t vfo, tone_t tone)
/* cmd[3] = tone2rig(rig, tone); */
+#if 0
retval = ft767_enter_CAT(rig);
if (retval < 0)
@@ -768,6 +789,7 @@ int ft767_set_ctcss_tone(RIG *rig, vfo_t vfo, tone_t tone)
rig_debug(RIG_DEBUG_ERR, "%s: enter_CAT %d\n", __func__, retval);
return retval;
}
+#endif
retval = ft767_send_block_and_ack(rig, cmd, YAESU_CMD_LENGTH);
@@ -778,12 +800,14 @@ int ft767_set_ctcss_tone(RIG *rig, vfo_t vfo, tone_t tone)
return retval;
}
+#if 0
retval = ft767_leave_CAT(rig);
if (retval < 0)
{
rig_debug(RIG_DEBUG_ERR, "%s: leave_CAT %d\n", __func__, retval);
}
+#endif
return retval;
}
@@ -879,6 +903,7 @@ int ft767_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq)
/* fill in first four bytes */
to_bcd(freq_cmd, tx_freq / 10, 8);
+#if 0
retval = ft767_enter_CAT(rig);
if (retval < 0)
@@ -886,6 +911,7 @@ int ft767_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq)
rig_debug(RIG_DEBUG_ERR, "%s: enter_CAT %d\n", __func__, retval);
return retval;
}
+#endif
/* change to the xmit VFO */
vfo_cmd[3] = vfo2rig(rig, change_vfo);
@@ -919,12 +945,14 @@ int ft767_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq)
return retval;
}
+#if 0
retval = ft767_leave_CAT(rig);
if (retval < 0)
{
rig_debug(RIG_DEBUG_ERR, "%s: leave_CAT %d\n", __func__, retval);
}
+#endif
return RIG_OK;
}
@@ -1042,6 +1070,7 @@ int ft767_set_split_mode(RIG *rig, vfo_t vfo, rmode_t tx_mode,
/* fill in p1 */
mode_cmd[3] = mode2rig(rig, tx_mode);
+#if 0
retval = ft767_enter_CAT(rig);
if (retval < 0)
@@ -1049,6 +1078,7 @@ int ft767_set_split_mode(RIG *rig, vfo_t vfo, rmode_t tx_mode,
rig_debug(RIG_DEBUG_ERR, "%s: enter_CAT %d\n", __func__, retval);
return retval;
}
+#endif
/* change to the xmit VFO */
vfo_cmd[3] = vfo2rig(rig, change_vfo);
@@ -1082,12 +1112,14 @@ int ft767_set_split_mode(RIG *rig, vfo_t vfo, rmode_t tx_mode,
return retval;
}
+#if 0
retval = ft767_leave_CAT(rig);
if (retval < 0)
{
rig_debug(RIG_DEBUG_ERR, "%s: leave_CAT %d\n", __func__, retval);
}
+#endif
return RIG_OK;
}
@@ -1227,6 +1259,7 @@ int ft767_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo)
rig_flush(&rig->state.rigport);
+#if 0
retval = ft767_enter_CAT(rig);
if (retval < 0)
@@ -1234,6 +1267,7 @@ int ft767_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo)
rig_debug(RIG_DEBUG_ERR, "%s: enter_CAT %d\n", __func__, retval);
return retval;
}
+#endif
/* See whether we need to toggle the split state */
curr_split = priv->update_data[STATUS_FLAGS] & STATUS_MASK_SPLIT;
@@ -1284,6 +1318,7 @@ int ft767_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo)
}
}
+#if 0
retval = ft767_leave_CAT(rig);
if (retval < 0)
@@ -1291,6 +1326,7 @@ int ft767_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo)
rig_debug(RIG_DEBUG_ERR, "%s: leave_CAT %d\n", __func__, retval);
return retval;
}
+#endif
break;
commit 657e41fd099f81a4a9a63d1f2df4883867ccd851
Author: Mike Black W9MDB <mdb...@ya...>
Date: Mon May 22 09:32:04 2023 -0500
Add rig_date_strget to DLL for WSJTX use
diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h
index c5ec621fc..424f404e0 100644
--- a/include/hamlib/rig.h
+++ b/include/hamlib/rig.h
@@ -3476,6 +3476,8 @@ extern HAMLIB_EXPORT(int) rig_get_lock_mode(RIG *rig, int *lock);
extern HAMLIB_EXPORT(int) rig_is_model(RIG *rig, rig_model_t model);
+extern HAMLIB_EXPORT(char*) rig_date_strget(char *buf, int buflen, int localtime);
+
//! @endcond
diff --git a/src/misc.c b/src/misc.c
index 467198065..8a3b1c4ee 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -2723,6 +2723,11 @@ char *date_strget(char *buf, int buflen, int localtime)
return buf;
}
+char *rig_date_strget(char *buf, int buflen, int localtime)
+{
+ return date_strget(buf,buflen,localtime);
+}
+
const char *spaces()
{
static char *s = " ";
commit 7309b24411cb0437fb34654a9a46d4f54ab11ea3
Author: Mike Black W9MDB <mdb...@ya...>
Date: Mon May 22 09:31:51 2023 -0500
Add simicom7100
diff --git a/simulators/Makefile.am b/simulators/Makefile.am
index f4870bf84..78006dcf4 100644
--- a/simulators/Makefile.am
+++ b/simulators/Makefile.am
@@ -8,7 +8,7 @@ DISTCLEANFILES =
bin_PROGRAMS =
-check_PROGRAMS = simelecraft simicom simkenwood simyaesu simicom9100 simicom9700 simft991 simftdx1200 simftdx3000 simjupiter simpowersdr simid5100 simft736 simftdx5000 simtmd700 simrotorez simspid simft817 simts590 simft847 simicom7300
+check_PROGRAMS = simelecraft simicom simkenwood simyaesu simicom9100 simicom9700 simft991 simftdx1200 simftdx3000 simjupiter simpowersdr simid5100 simft736 simftdx5000 simtmd700 simrotorez simspid simft817 simts590 simft847 simicom7300 simicom7100
simelecraft_SOURCES = simelecraft.c
simicom_SOURCES = simicom.c
diff --git a/simulators/simicom7100.c b/simulators/simicom7100.c
new file mode 100644
index 000000000..f19b074c7
--- /dev/null
+++ b/simulators/simicom7100.c
@@ -0,0 +1,530 @@
+// simicom will show the pts port to use for rigctl on Unix
+// using virtual serial ports on Windows is to be developed yet
+// Needs a lot of improvement to work on all Icoms
+// gcc -g -Wall -o simicom simicom.c -lhamlib
+// On mingw in the hamlib src directory
+// gcc -static -I../include -g -Wall -o simicom simicom.c -L../../build/src/.libs -lhamlib -lwsock32 -lws2_32
+#define _XOPEN_SOURCE 700
+// since we are POSIX here we need this
+struct ip_mreq
+{
+ int dummy;
+};
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <sys/time.h>
+#include <hamlib/rig.h>
+#include "../src/misc.h"
+#include <termios.h>
+#include <unistd.h>
+
+
+#define BUFSIZE 256
+#define X25
+
+int civ_731_mode = 0;
+vfo_t current_vfo = RIG_VFO_A;
+int split = 0;
+
+// we make B different from A to ensure we see a difference at startup
+float freqA = 14074000;
+float freqB = 14074500;
+mode_t modeA = RIG_MODE_PKTUSB;
+mode_t modeB = RIG_MODE_PKTUSB;
+int datamodeA = 0;
+int datamodeB = 0;
+pbwidth_t widthA = 0;
+pbwidth_t widthB = 1;
+ant_t ant_curr = 0;
+int ant_option = 0;
+int ptt = 0;
+int satmode = 0;
+int agc_time = 1;
+int ovf_status = 0;
+int powerstat = 1;
+
+void dumphex(unsigned char *buf, int n)
+{
+ for (int i = 0; i < n; ++i) { printf("%02x ", buf[i]); }
+
+ printf("\n");
+}
+
+int
+frameGet(int fd, unsigned char *buf)
+{
+ int i = 0, n;
+ memset(buf, 0, BUFSIZE);
+ unsigned char c;
+
+again:
+
+ while (read(fd, &c, 1) > 0)
+ {
+ buf[i++] = c;
+ //printf("i=%d, c=0x%02x\n",i,c);
+
+ if (c == 0xfd)
+ {
+ char mytime[256];
+ date_strget(mytime,sizeof(mytime),1);
+ printf("%s:", mytime); dumphex(buf, i);
+ // echo
+ n = write(fd, buf, i);
+ if (n != i) printf("%s: error on write: %s\n", __func__, strerror(errno));
+ return i;
+ }
+
+ if (i > 2 && c == 0xfe)
+ {
+ printf("Turning power on due to 0xfe string\n");
+ powerstat = 1;
+ int j;
+
+ for (j = i; j < 175; ++j)
+ {
+ if (read(fd, &c, 1) < 0) { break; }
+ }
+
+ i = 0;
+ goto again;
+ }
+ }
+
+ printf("Error??? c=x%02x\n", c);
+
+ return 0;
+}
+
+void frameParse(int fd, unsigned char *frame, int len)
+{
+ double freq;
+ int n = 0;
+
+ dumphex(frame, len);
+
+ if (frame[0] != 0xfe && frame[1] != 0xfe)
+ {
+ printf("expected fe fe, got ");
+ dumphex(frame, len);
+ return;
+ }
+
+ switch (frame[4])
+ {
+ case 0x03:
+
+ //from_bcd(frameackbuf[2], (civ_731_mode ? 4 : 5) * 2);
+ if (current_vfo == RIG_VFO_A || current_vfo == RIG_VFO_MAIN)
+ {
+ printf("get_freqA\n");
+ to_bcd(&frame[5], (long long)freqA, (civ_731_mode ? 4 : 5) * 2);
+ }
+ else
+ {
+ printf("get_freqB\n");
+ to_bcd(&frame[5], (long long)freqB, (civ_731_mode ? 4 : 5) * 2);
+ }
+
+ frame[10] = 0xfd;
+
+ if (powerstat)
+ {
+ n = write(fd, frame, 11);
+ }
+
+ break;
+
+ case 0x04:
+ if (current_vfo == RIG_VFO_A || current_vfo == RIG_VFO_MAIN)
+ {
+ printf("get_modeA\n");
+ frame[5] = modeA;
+ frame[6] = widthA;
+ }
+ else
+ {
+ printf("get_modeB\n");
+ frame[5] = modeB;
+ frame[6] = widthB;
+ }
+
+ frame[7] = 0xfd;
+ n = write(fd, frame, 8);
+ break;
+
+ case 0x05:
+ freq = from_bcd(&frame[5], (civ_731_mode ? 4 : 5) * 2);
+ printf("set_freq to %.0f\n", freq);
+
+ if (current_vfo == RIG_VFO_A || current_vfo == RIG_VFO_MAIN) { freqA = freq; }
+ else { freqB = freq; }
+
+ frame[4] = 0xfb;
+ frame[5] = 0xfd;
+ n = write(fd, frame, 6);
+ break;
+
+ case 0x06:
+ if (current_vfo == RIG_VFO_A || current_vfo == RIG_VFO_MAIN) { modeA = frame[6]; }
+ else { modeB = frame[6]; }
+
+ frame[4] = 0xfb;
+ frame[5] = 0xfd;
+ n = write(fd, frame, 6);
+ break;
+
+ case 0x07:
+
+ switch (frame[5])
+ {
+ case 0x00: current_vfo = RIG_VFO_A; break;
+
+ case 0x01: current_vfo = RIG_VFO_B; break;
+
+ case 0xa0: current_vfo = freq = freqA; freqA = freqB; freqB = freq; break;
+
+ case 0xb0: current_vfo = RIG_VFO_MAIN; break;
+
+ case 0xd0: current_vfo = RIG_VFO_MAIN; break;
+
+ case 0xd1: current_vfo = RIG_VFO_SUB; break;
+ }
+
+ printf("set_vfo to %s\n", rig_strvfo(current_vfo));
+
+ frame[4] = 0xfb;
+ frame[5] = 0xfd;
+ n = write(fd, frame, 6);
+ break;
+
+ case 0x0f:
+ if (frame[5] == 0) { split = 0; }
+ else if (frame[5] == 1) { split = 1; }
+ else { frame[6] = split; }
+
+ if (frame[5] == 0xfd)
+ {
+ printf("get split %d\n", 1);
+ frame[7] = 0xfd;
+ n = write(fd, frame, 8);
+ }
+ else
+ {
+ printf("set split %d\n", 1);
+ frame[4] = 0xfb;
+ frame[5] = 0xfd;
+ n = write(fd, frame, 6);
+ }
+
+ break;
+
+ case 0x12: // we're simulating the 3-byte version -- not the 2-byte
+ if (frame[5] != 0xfd)
+ {
+ printf("Set ant %d\n", -1);
+ ant_curr = frame[5];
+ ant_option = frame[6];
+ dump_hex(frame, 8);
+ }
+ else
+ {
+ printf("Get ant\n");
+ }
+
+ frame[5] = ant_curr;
+ frame[6] = ant_option;
+ frame[7] = 0xfd;
+ printf("write 8 bytes\n");
+ dump_hex(frame, 8);
+ n = write(fd, frame, 8);
+ break;
+
+ case 0x14:
+ switch (frame[5])
+ {
+ static int power_level = 0;
+
+ case 0x07:
+ case 0x08:
+ if (frame[6] != 0xfd)
+ {
+ frame[6] = 0xfb;
+ dumphex(frame, 7);
+ n = write(fd, frame, 7);
+ printf("ACK x14 x08\n");
+ }
+ else
+ {
+ to_bcd(&frame[6], (long long)128, 2);
+ frame[8] = 0xfb;
+ dumphex(frame, 9);
+ n = write(fd, frame, 9);
+ printf("SEND x14 x08\n");
+ }
+
+ break;
+
+ case 0x0a:
+ printf("Using power level %d\n", power_level);
+ power_level += 10;
+
+ if (power_level > 250) { power_level = 0; }
+
+ to_bcd(&frame[6], (long long)power_level, 2);
+ frame[8] = 0xfd;
+ n = write(fd, frame, 9);
+ break;
+ }
+
+ break;
+
+ case 0x15:
+ switch (frame[5])
+ {
+ static int meter_level = 0;
+
+ case 0x07:
+ frame[6] = ovf_status;
+ frame[7] = 0xfd;
+ n = write(fd, frame, 8);
+ ovf_status = ovf_status == 0 ? 1 : 0;
+ break;
+
+ case 0x11:
+ printf("Using meter level %d\n", meter_level);
+ meter_level += 10;
+
+ if (meter_level > 250) { meter_level = 0; }
+
+ to_bcd(&frame[6], (long long)meter_level, 2);
+ frame[8] = 0xfd;
+ n = write(fd, frame, 9);
+ break;
+ }
+
+ case 0x16:
+ switch (frame[5])
+ {
+ case 0x5a:
+ if (frame[6] == 0xfe)
+ {
+ satmode = frame[6];
+ }
+ else
+ {
+ frame[6] = satmode;
+ frame[7] = 0xfd;
+ n = write(fd, frame, 8);
+ }
+
+ break;
+ }
+
+ break;
+
+ case 0x19: // miscellaneous things
+ frame[5] = 0x94;
+ frame[6] = 0xfd;
+ n = write(fd, frame, 7);
+ break;
+
+ case 0x1a: // miscellaneous things
+ switch (frame[5])
+ {
+ case 0x03: // width
+ if (current_vfo == RIG_VFO_A || current_vfo == RIG_VFO_MAIN) { frame[6] = widthA; }
+ else { frame[6] = widthB; }
+
+ frame[7] = 0xfd;
+ n = write(fd, frame, 8);
+ break;
+
+ case 0x04: // AGC TIME
+ printf("frame[6]==x%02x, frame[7]=0%02x\n", frame[6], frame[7]);
+
+ if (frame[6] == 0xfd) // the we are reading
+ {
+ frame[6] = agc_time;
+ frame[7] = 0xfd;
+ n = write(fd, frame, 8);
+ }
+ else
+ {
+ printf("AGC_TIME RESPONSE******************************");
+ agc_time = frame[6];
+ frame[4] = 0xfb;
+ frame[5] = 0xfd;
+ n = write(fd, frame, 6);
+ }
+
+ break;
+
+ case 0x06: // Data mode
+ if (frame[6] == 0xfd) // then we're replying with mode
+ {
+ frame[6] = datamodeA;
+ frame[7] = 0xfd;
+ n = write(fd, frame, 8);
+ }
+ else
+ {
+ datamodeA = frame[6];
+ frame[4] = 0xfb;
+ frame[5] = 0xfd;
+ n = write(fd, frame, 6);
+ }
+
+ break;
+
+ }
+
+ break;
+
+ case 0x1c:
+ switch (frame[5])
+ {
+ case 0:
+ if (frame[6] == 0xfd)
+ {
+ frame[6] = ptt;
+ frame[7] = 0xfd;
+ n = write(fd, frame, 8);
+ }
+ else
+ {
+ ptt = frame[6];
+ frame[4] = 0xfb;
+ frame[5] = 0xfd;
+ n = write(fd, frame, 6);
+ }
+
+ break;
+
+ }
+
+ break;
+
+
+ case 0x25:
+ printf("x25 send nak\n");
+ frame[4] = 0xfa;
+ frame[5] = 0xfd;
+ n = write(fd, frame, 6);
+ break;
+
+ case 0x26:
+ printf("x26 send nak\n");
+ frame[4] = 0xfa;
+ frame[5] = 0xfd;
+ n = write(fd, frame, 6);
+ break;
+
+ default: printf("cmd 0x%02x unknown\n", frame[4]);
+ }
+
+ if (n == 0) { printf("Write failed=%s\n", strerror(errno)); }
+
+// don't care about the rig type yet
+
+}
+
+#if defined(WIN32) || defined(_WIN32)
+int openPort(char *comport) // doesn't matter for using pts devices
+{
+ int fd;
+ fd = open(comport, O_RDWR);
+
+ if (fd < 0)
+ {
+ perror(comport);
+ }
+
+ return fd;
+}
+
+#else
+int openPort(char *comport) // doesn't matter for using pts devices
+{
+ int fd = posix_openpt(O_RDWR);
+ char *name = ptsname(fd);
+
+ if (name == NULL)
+ {
+ perror("pstname");
+ return -1;
+ }
+
+ printf("name=%s\n", name);
+
+ if (fd == -1 || grantpt(fd) == -1 || unlockpt(fd) == -1)
+ {
+ perror("posix_openpt");
+ return -1;
+ }
+
+ return fd;
+}
+#endif
+
+void rigStatus()
+{
+ ...
[truncated message content] |
|
From: n0nb <n0...@us...> - 2023-04-29 21:00: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, Hamlib-4.5.6 has been created
at 8832ad144a5f9e9990bc540c0b5cfc9f26e0f193 (commit)
- Log -----------------------------------------------------------------
commit 8832ad144a5f9e9990bc540c0b5cfc9f26e0f193
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sat Apr 22 12:10:56 2023 -0500
Update NEWS
diff --git a/NEWS b/NEWS
index 8b13ec30..4982e4e6 100644
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,32 @@ Copyright (C) 2000-2023 Michael Black W9MDB, and others
Please send Hamlib bug reports to ham...@li...
+Version 5.x -- future
+ * rig_get_conf deprecated and replaced by rig_get_conf2
+ * rot_get_conf deprecated and replaced by rot_get_conf2
+ * Change FT1000MP Mark V model names to align with FT1000MP
+
+Version 4.6
+ * Add saebrtrack rotor https://sites.google.com/site/marklhammond/saebrtrack
+ * Add offset_vfoa and offset_vfob applying to rig_set_freq
+ * Fix K4 to put it in K40 mode when requesting ID
+ * 2023-11-XX -- Planned for Nov 2023
+ * Fixes for M2 Rotors
+ * Add rigctlsync utility to synchronize frequency from a rig to SDR# (or others)
+ * Add SDR# rig for use with SDR#'s gpredict plugin -- can only get/set freq
+ * Add Apex Shared Loop rotator -- unidirectional only so far
+ * Add client_version to rigctld so client can report it's version for future use/compatibility/alternatives
+ * Add --set-conf=tuner_control_pathname=hamlib_tuner_control (default)
+ If file exists then it will be called with 0/1 (Off/On) argument
+ with 'U TUNER 0' or 'U TUNER 1"
+ Default path is for current directory
+ * Add MDS 4710/9710 rigs
+ * Add FLIR PTU-D48, E46, D100, D300 rotors
+ * Fix FTDX3000 rig split
+
+Version 4.5.6
+ * Fix rigctld/rigctltcp information
+
Version 4.5.5
* 2023-04-05
* Add park to rotorez.c
@@ -185,7 +211,7 @@ Version 4.3.1
- scripts: Update example in readme, since 4.0 817 is 1020
- Make testlibusb.c compatible with libusb < 1.0.23
Note: On systems with libusb < 1.0.23 a warning will be emitted
- but compliation should proceed without error.
+ but compilation should proceed without error.
- Update testlibusb.c warning to "may be" instead of "will be"
- Change kenwood to only set VFOA default on 1st rig_open call
commit 6b0530f7b7aa1cca7dd3e1ad64bd40c28b16f573
Author: Mike Black W9MDB <mdb...@ya...>
Date: Fri Apr 21 16:14:48 2023 -0500
Revert "Only allow x25cmdfails when not set"
This reverts commit a0cd186b68e2b81d0fa4e8d00f342d73c5ca76aa.
diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c
index bde2e05d..de5e1871 100644
--- a/rigs/icom/icom.c
+++ b/rigs/icom/icom.c
@@ -686,7 +686,7 @@ int icom_init(RIG *rig)
priv->rx_vfo = RIG_VFO_NONE;
rig->state.current_vfo = RIG_VFO_NONE;
priv->filter = RIG_PASSBAND_NOCHANGE;
- priv->x25cmdfails = -1;
+ priv->x25cmdfails = 0;
priv->x1cx03cmdfails = 0;
// we can add rigs here that will never use the 0x25 cmd
@@ -1656,8 +1656,7 @@ int icom_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
if (retval != RIG_OK)
{
- // only reset if not known -- means cannot change dynamically without restart
- if (priv->x25cmdfails < 0) priv->x25cmdfails = 1;
+ priv->x25cmdfails = 1;
rig_debug(RIG_DEBUG_WARN,
"%s: rig probe shows 0x25 CI-V cmd not available\n", __func__);
}
diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h
index 0661336b..efc28fa4 100644
--- a/rigs/icom/icom.h
+++ b/rigs/icom/icom.h
@@ -31,7 +31,7 @@
#include <sys/time.h>
#endif
-#define BACKEND_VER "20230421"
+#define BACKEND_VER "20230109"
#define ICOM_IS_ID31 rig_is_model(rig, RIG_MODEL_ID31)
#define ICOM_IS_ID51 rig_is_model(rig, RIG_MODEL_ID51)
commit a0cd186b68e2b81d0fa4e8d00f342d73c5ca76aa
Author: Mike Black W9MDB <mdb...@ya...>
Date: Fri Apr 21 16:12:53 2023 -0500
Only allow x25cmdfails when not set
https://github.com/Hamlib/Hamlib/issues/1277
diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c
index de5e1871..bde2e05d 100644
--- a/rigs/icom/icom.c
+++ b/rigs/icom/icom.c
@@ -686,7 +686,7 @@ int icom_init(RIG *rig)
priv->rx_vfo = RIG_VFO_NONE;
rig->state.current_vfo = RIG_VFO_NONE;
priv->filter = RIG_PASSBAND_NOCHANGE;
- priv->x25cmdfails = 0;
+ priv->x25cmdfails = -1;
priv->x1cx03cmdfails = 0;
// we can add rigs here that will never use the 0x25 cmd
@@ -1656,7 +1656,8 @@ int icom_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
if (retval != RIG_OK)
{
- priv->x25cmdfails = 1;
+ // only reset if not known -- means cannot change dynamically without restart
+ if (priv->x25cmdfails < 0) priv->x25cmdfails = 1;
rig_debug(RIG_DEBUG_WARN,
"%s: rig probe shows 0x25 CI-V cmd not available\n", __func__);
}
diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h
index efc28fa4..0661336b 100644
--- a/rigs/icom/icom.h
+++ b/rigs/icom/icom.h
@@ -31,7 +31,7 @@
#include <sys/time.h>
#endif
-#define BACKEND_VER "20230109"
+#define BACKEND_VER "20230421"
#define ICOM_IS_ID31 rig_is_model(rig, RIG_MODEL_ID31)
#define ICOM_IS_ID51 rig_is_model(rig, RIG_MODEL_ID51)
-----------------------------------------------------------------------
hooks/post-receive
--
Hamlib -- Ham radio control libraries
|
|
From: n0nb <n0...@us...> - 2023-04-29 20:57:34
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Hamlib -- Ham radio control libraries".
The branch, master has been updated
via 9318df8e7511694c5652a91029ad1245328452cc (commit)
via a349c3e07bcc40f30c43a1c465cd8b4030a1055f (commit)
via e5a6055d5727b42f03307d0c2e2489482dfc8392 (commit)
via 215aa6b92c76eab5e17e811e6c070bd68b00b48a (commit)
via e82f127965fba7f5852f59ead3abc45ebe5e1548 (commit)
via addee81f43a6ef9223f712cd30612141cc20c035 (commit)
via 07ba41d551e96fe3498ec8355d4d1e93d913a7d6 (commit)
via da94c8b77074720d64b335df28d98a75c964b6c0 (commit)
via 1db6487b8d30a2cb0d315c21d24692f31986fb3e (commit)
via 1c1b9e75116916ef11e18a78a43af4e3455608ea (commit)
via 6fadbfb1122ebc11694406303071a069d1eb43ca (commit)
via 44807be556b8264eca8fb40a6f79318336944461 (commit)
via f1533984802a9959bd357dc55dd9a562b152c126 (commit)
via 6422bc51d5197e4e2c0a302b15a77cc719b5b86b (commit)
via 4ba3a025124669776f88e29af6d84e035ac903cc (commit)
via 2af9f2c5b3355d8806ea9e7d6f34eec720b40057 (commit)
via 6c410f164e489ca30e101eab91d63d21a098003b (commit)
via 72266a677dd35c9ce789bd0cf22b8efa535f6b94 (commit)
via c02ded5b494341242a231bb1fffaa39eeed8daed (commit)
via 6eee376cbfb429b4055667b69fe3c600d8ca64c6 (commit)
via f390aa499d171e4e6f91c8f5bfaf7d7ec298c9de (commit)
via 3b66959f4e3289e343e9911d203cb5216f744a15 (commit)
via 1a59ce2ae2b42585ceb140eb713f87945531b87c (commit)
via 4551199de1756d9eaf651b7c6a106d7e52686346 (commit)
via 6f0efd59e61ebc2a6b96fcb9414cd2b240a9157e (commit)
via 6c197dbc1cba336490e10914f2af3c3b0c0594b6 (commit)
via 1c72440c5173c5f2c7e592cb6ace5ed6dd75c5a7 (commit)
via e11b4bd01c64688bdf3714470f81a7e9fddd09aa (commit)
via 905c9fff95f4dcaabfb2cfba4a821c895894051a (commit)
from 6c1d83ed8684c8b3ff806c07e8c465d41c502685 (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 9318df8e7511694c5652a91029ad1245328452cc
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sat Apr 29 12:56:00 2023 -0500
Update NEWS
diff --git a/NEWS b/NEWS
index 4982e4e6..5e39dc19 100644
--- a/NEWS
+++ b/NEWS
@@ -32,6 +32,7 @@ Version 4.6
Version 4.5.6
* Fix rigctld/rigctltcp information
+ * Fix FT817 get/set_vfo
Version 4.5.5
* 2023-04-05
commit a349c3e07bcc40f30c43a1c465cd8b4030a1055f
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sat Apr 29 07:57:07 2023 -0500
Change ft817 startup timeout to 1500ms to avoid a timeout
https://github.com/Hamlib/Hamlib/issues/1278
diff --git a/rigs/yaesu/ft817.c b/rigs/yaesu/ft817.c
index c81b6be0..19c4da6b 100644
--- a/rigs/yaesu/ft817.c
+++ b/rigs/yaesu/ft817.c
@@ -292,7 +292,7 @@ const struct rig_caps ft817_caps =
RIG_MODEL(RIG_MODEL_FT817),
.model_name = "FT-817",
.mfg_name = "Yaesu",
- .version = "20230429.0",
+ .version = "20230429.1",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
@@ -623,7 +623,7 @@ static int ft817_cleanup(RIG *rig)
static int ft817_open(RIG *rig)
{
rig_debug(RIG_DEBUG_VERBOSE, "%s: called \n", __func__);
- hl_usleep(100*1000); // rig needs a bit to allow commands to come through
+ hl_usleep(1500*1000); // rig needs a bit to allow commands to come through on startup
return RIG_OK;
}
commit e5a6055d5727b42f03307d0c2e2489482dfc8392
Author: Mike Black W9MDB <mdb...@ya...>
Date: Fri Apr 28 22:30:07 2023 -0500
Another attempt to fix ft817_get_vfo
https://github.com/Hamlib/Hamlib/issues/1278
diff --git a/rigs/yaesu/ft817.c b/rigs/yaesu/ft817.c
index 08e9583c..c81b6be0 100644
--- a/rigs/yaesu/ft817.c
+++ b/rigs/yaesu/ft817.c
@@ -292,7 +292,7 @@ const struct rig_caps ft817_caps =
RIG_MODEL(RIG_MODEL_FT817),
.model_name = "FT-817",
.mfg_name = "Yaesu",
- .version = "20230428.0",
+ .version = "20230429.0",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
@@ -696,7 +696,14 @@ static int ft817_read_eeprom(RIG *rig, unsigned short addr, unsigned char *out)
return -RIG_EIO;
}
- *out = data[addr % 2];
+ if (addr == 0x55) // for some reason VFO returns high byte
+ {
+ *out = data[0];
+ }
+ else
+ {
+ *out = data[addr % 2];
+ }
rig_debug(RIG_DEBUG_VERBOSE, "%s: data[0]=%02x, data[1]=%02x, out=%02x\n", __func__, data[0], data[1], *out);
@@ -1398,7 +1405,7 @@ static int ft817_get_vfo(RIG *rig, vfo_t *vfo)
rig_debug(RIG_DEBUG_VERBOSE, "%s: called \n", __func__);
- if (ft817_read_eeprom(rig, 0x54, &c) < 0) /* get vfo status */
+ if (ft817_read_eeprom(rig, 0x55, &c) < 0) /* get vfo status */
{
return -RIG_EPROTO;
}
commit 215aa6b92c76eab5e17e811e6c070bd68b00b48a
Author: Mike Black W9MDB <mdb...@ya...>
Date: Fri Apr 28 08:20:57 2023 -0500
Try to fix ft817 get_vfo to return the valid status bye
https://github.com/Hamlib/Hamlib/issues/1278
diff --git a/rigs/yaesu/ft817.c b/rigs/yaesu/ft817.c
index 98caf300..08e9583c 100644
--- a/rigs/yaesu/ft817.c
+++ b/rigs/yaesu/ft817.c
@@ -292,7 +292,7 @@ const struct rig_caps ft817_caps =
RIG_MODEL(RIG_MODEL_FT817),
.model_name = "FT-817",
.mfg_name = "Yaesu",
- .version = "20230424.0",
+ .version = "20230428.0",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
@@ -698,6 +698,8 @@ static int ft817_read_eeprom(RIG *rig, unsigned short addr, unsigned char *out)
*out = data[addr % 2];
+ rig_debug(RIG_DEBUG_VERBOSE, "%s: data[0]=%02x, data[1]=%02x, out=%02x\n", __func__, data[0], data[1], *out);
+
return RIG_OK;
}
@@ -1396,7 +1398,7 @@ static int ft817_get_vfo(RIG *rig, vfo_t *vfo)
rig_debug(RIG_DEBUG_VERBOSE, "%s: called \n", __func__);
- if (ft817_read_eeprom(rig, 0x55, &c) < 0) /* get vfo status */
+ if (ft817_read_eeprom(rig, 0x54, &c) < 0) /* get vfo status */
{
return -RIG_EPROTO;
}
commit e82f127965fba7f5852f59ead3abc45ebe5e1548
Author: Mike Black W9MDB <mdb...@ya...>
Date: Wed Apr 26 15:38:08 2023 -0500
Allow icom read_frame to return when bus collision occurs
https://github.com/Hamlib/Hamlib/issues/1280
diff --git a/rigs/icom/frame.c b/rigs/icom/frame.c
index 973b7047..ad644457 100644
--- a/rigs/icom/frame.c
+++ b/rigs/icom/frame.c
@@ -540,7 +540,8 @@ static int read_icom_frame_generic(hamlib_port_t *p,
&& (rxbuffer[read - 1] != COL));
// Check that we have a valid frame preamble (which might be just a single preable character)
- if (rxbuffer[0] != PR)
+ // Or an error code
+ if (rxbuffer[0] != PR && rxbuffer[0] != COL)
{
return -RIG_EPROTO;
}
diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h
index 477e2598..5aced162 100644
--- a/rigs/icom/icom.h
+++ b/rigs/icom/icom.h
@@ -35,7 +35,7 @@
#include <sys/time.h>
#endif
-#define BACKEND_VER "20230425"
+#define BACKEND_VER "20230426"
#define ICOM_IS_ID31 rig_is_model(rig, RIG_MODEL_ID31)
#define ICOM_IS_ID51 rig_is_model(rig, RIG_MODEL_ID51)
commit addee81f43a6ef9223f712cd30612141cc20c035
Author: Mike Black W9MDB <mdb...@ya...>
Date: Tue Apr 25 22:27:38 2023 -0500
Fix rigctld sending an extra space in front of send_morse string
Single space still works
https://github.com/Hamlib/Hamlib/issues/1281
diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c
index 61820ffb..9405c373 100644
--- a/tests/rigctl_parse.c
+++ b/tests/rigctl_parse.c
@@ -958,12 +958,7 @@ int rigctl_parse(RIG *my_rig, FILE *fin, FILE *fout, char *argv[], int argc,
{
*nl = '\0'; /* chomp */
}
-
- if (cmd == 'b')
- {
- p1 = arg1; /* CW must accept a space argument */
- }
- else /* skip a space arg if first arg...but why? */
+ /* skip a space arg if first arg...happens parsing rigctld commands */
{
p1 = arg1[0] == ' ' ? arg1 + 1 : arg1;
}
commit 07ba41d551e96fe3498ec8355d4d1e93d913a7d6
Author: Mike Black W9MDB <mdb...@ya...>
Date: Tue Apr 25 11:07:25 2023 -0500
Add a retry in icom frame.c in case of collision
https://github.com/Hamlib/Hamlib/issues/1280
diff --git a/rigs/icom/frame.c b/rigs/icom/frame.c
index 81cc7fe9..973b7047 100644
--- a/rigs/icom/frame.c
+++ b/rigs/icom/frame.c
@@ -138,6 +138,7 @@ int icom_one_transaction(RIG *rig, unsigned char cmd, int subcmd,
unsigned char sendbuf[MAXFRAMELEN];
int frm_len, frm_data_len, retval;
unsigned char ctrl_id;
+ int collision_retry = 0;
ENTERFUNC;
memset(buf, 0, 200);
@@ -156,6 +157,7 @@ int icom_one_transaction(RIG *rig, unsigned char cmd, int subcmd,
*/
set_transaction_active(rig);
+collision_retry:
rig_flush(&rs->rigport);
if (data_len) { *data_len = 0; }
@@ -223,6 +225,13 @@ int icom_one_transaction(RIG *rig, unsigned char cmd, int subcmd,
{
case COL:
/* Collision */
+ // IC746 for example responds 0xfc when tuning is active so we will retry
+ if (collision_retry++ < 20)
+ {
+ rig_debug(RIG_DEBUG_VERBOSE, "%s: collision retry#%d\n", __func__, collision_retry);
+ hl_usleep(500*1000); // 500ms 20 times for ~15 second max before we back out for a retry if needed
+ goto collision_retry;
+ }
set_transaction_inactive(rig);
RETURNFUNC(-RIG_BUSBUSY);
commit da94c8b77074720d64b335df28d98a75c964b6c0
Author: Mike Black W9MDB <mdb...@ya...>
Date: Tue Apr 25 08:52:42 2023 -0500
Change ft817.c to not mask the low bit on eepromp reads -- hopefully this doesn't break everything
https://github.com/Hamlib/Hamlib/issues/1278
diff --git a/rigs/yaesu/ft817.c b/rigs/yaesu/ft817.c
index efc84ea6..98caf300 100644
--- a/rigs/yaesu/ft817.c
+++ b/rigs/yaesu/ft817.c
@@ -292,7 +292,7 @@ const struct rig_caps ft817_caps =
RIG_MODEL(RIG_MODEL_FT817),
.model_name = "FT-817",
.mfg_name = "Yaesu",
- .version = "20230422.0",
+ .version = "20230424.0",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
@@ -442,7 +442,7 @@ const struct rig_caps ft818_caps =
RIG_MODEL(RIG_MODEL_FT818),
.model_name = "FT-818",
.mfg_name = "Yaesu",
- .version = "20220419.0",
+ .version = "20220424.0",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
@@ -682,7 +682,7 @@ static int ft817_read_eeprom(RIG *rig, unsigned short addr, unsigned char *out)
YAESU_CMD_LENGTH);
data[0] = addr >> 8;
- data[1] = addr & 0xfe;
+ data[1] = addr & 0xff;
write_block(&rig->state.rigport, data, YAESU_CMD_LENGTH);
@@ -1418,7 +1418,7 @@ static int ft817_set_vfo(RIG *rig, vfo_t vfo)
vfo_t curvfo;
int retval;
- rig_debug(RIG_DEBUG_VERBOSE, "%s: called \n", __func__);
+ rig_debug(RIG_DEBUG_VERBOSE, "%s: called vfo=%s\n", __func__, rig_strvfo(vfo));
retval = ft817_get_vfo(rig, &curvfo);
commit 1db6487b8d30a2cb0d315c21d24692f31986fb3e
Author: Mike Black W9MDB <mdb...@ya...>
Date: Tue Apr 25 08:26:12 2023 -0500
Add simspid.c
diff --git a/simulators/Makefile.am b/simulators/Makefile.am
index 73ca41c1..982e6a82 100644
--- a/simulators/Makefile.am
+++ b/simulators/Makefile.am
@@ -8,7 +8,7 @@ DISTCLEANFILES =
bin_PROGRAMS =
-check_PROGRAMS = simelecraft simicom simkenwood simyaesu simicom9700 simft991 simftdx1200 simftdx3000 simjupiter simpowersdr simid5100 simft736 simftdx5000 simtmd700 simrotorez
+check_PROGRAMS = simelecraft simicom simkenwood simyaesu simicom9700 simft991 simftdx1200 simftdx3000 simjupiter simpowersdr simid5100 simft736 simftdx5000 simtmd700 simrotorez simspid
simelecraft_SOURCES = simelecraft.c
simicom_SOURCES = simicom.c
diff --git a/simulators/simspid.c b/simulators/simspid.c
new file mode 100644
index 00000000..6c1d0ac1
--- /dev/null
+++ b/simulators/simspid.c
@@ -0,0 +1,116 @@
+// can run this using rigctl/rigctld and socat pty devices
+// gcc -o simspid simspid.c
+#define _XOPEN_SOURCE 600
+#include <stdio.h>
+#include <stdlib.h>
+#include <fcntl.h>
+#include <string.h>
+#include <unistd.h>
+#include "../include/hamlib/rig.h"
+
+#define BUFSIZE 256
+
+float freqA = 14074000;
+float freqB = 14074500;
+char tx_vfo = '0';
+char rx_vfo = '0';
+char modeA = '1';
+char modeB = '1';
+int width_main = 500;
+int width_sub = 700;
+
+
+int
+getmyline(int fd, unsigned char *buf)
+{
+ unsigned char c;
+ int i = 0;
+ int n = 0;
+ memset(buf, 0, BUFSIZE);
+
+ while (i < 5 && read(fd, &c, 1) > 0)
+ {
+ buf[i++] = c;
+ n++;
+ }
+
+ printf("n=%d %02x %02x %02x %02x %02x\n", n, buf[0], buf[1], buf[2], buf[3],
+ buf[4]);
+ return n;
+}
+
+#if defined(WIN32) || defined(_WIN32)
+int openPort(char *comport) // doesn't matter for using pts devices
+{
+ int fd;
+ fd = open(comport, O_RDWR);
+
+ if (fd < 0)
+ {
+ perror(comport);
+ }
+
+ return fd;
+}
+
+#else
+int openPort(char *comport) // doesn't matter for using pts devices
+{
+ int fd = posix_openpt(O_RDWR);
+ char *name = ptsname(fd);
+
+ if (name == NULL)
+ {
+ perror("pstname");
+ return -1;
+ }
+
+ printf("name=%s\n", name);
+
+ if (fd == -1 || grantpt(fd) == -1 || unlockpt(fd) == -1)
+ {
+ perror("posix_openpt");
+ return -1;
+ }
+
+ return fd;
+}
+#endif
+
+
+
+int main(int argc, char *argv[])
+{
+ unsigned char buf[256];
+
+
+again:
+ int fd = openPort(argv[1]);
+
+ while (1)
+ {
+ int bytes = getmyline(fd, buf);
+
+ if (bytes == 0)
+ {
+ close(fd);
+ goto again;
+ }
+
+ if (bytes != 5)
+ {
+ printf("Not 5 bytes? bytes=%d\n", bytes);
+ }
+
+ switch (buf[0])
+ {
+ case '?': printf("Query %c\n", buf[1]); break;
+
+ case '*': printf("Set %c\n", buf[1]); break;
+
+ default: printf("Unknown cmd=%02x\n", buf[4]);
+ }
+ }
+
+ return 0;
+}
commit 1c1b9e75116916ef11e18a78a43af4e3455608ea
Author: Mike Black W9MDB <mdb...@ya...>
Date: Tue Apr 25 08:13:03 2023 -0500
Enable async_io for IC-746 and IC-746PRO
https://github.com/Hamlib/Hamlib/issues/1280
diff --git a/rigs/icom/ic746.c b/rigs/icom/ic746.c
index b6370141..2231987b 100644
--- a/rigs/icom/ic746.c
+++ b/rigs/icom/ic746.c
@@ -181,7 +181,7 @@ const struct rig_caps ic746_caps =
RIG_MODEL(RIG_MODEL_IC746),
.model_name = "IC-746",
.mfg_name = "Icom",
- .version = BACKEND_VER ".3",
+ .version = BACKEND_VER ".4",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
@@ -286,6 +286,11 @@ const struct rig_caps ic746_caps =
},
.str_cal = IC746_STR_CAL,
+ .async_data_supported = 1,
+ .read_frame_direct = icom_read_frame_direct,
+ .is_async_frame = icom_is_async_frame,
+ .process_async_frame = icom_process_async_frame,
+
.cfgparams = icom_cfg_params,
.set_conf = icom_set_conf,
.get_conf = icom_get_conf,
@@ -413,7 +418,7 @@ const struct rig_caps ic746pro_caps =
RIG_MODEL(RIG_MODEL_IC746PRO),
.model_name = "IC-746PRO",
.mfg_name = "Icom",
- .version = BACKEND_VER ".2",
+ .version = BACKEND_VER ".3",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
@@ -532,6 +537,11 @@ const struct rig_caps ic746pro_caps =
},
.str_cal = IC746_STR_CAL,
+ .async_data_supported = 1,
+ .read_frame_direct = icom_read_frame_direct,
+ .is_async_frame = icom_is_async_frame,
+ .process_async_frame = icom_process_async_frame,
+
.cfgparams = icom_cfg_params,
.set_conf = icom_set_conf,
.get_conf = icom_get_conf,
commit 6fadbfb1122ebc11694406303071a069d1eb43ca
Author: Mike Black W9MDB <mdb...@ya...>
Date: Tue Apr 25 08:00:43 2023 -0500
Change Icom 0x25 logic to only allow one detection
https://github.com/Hamlib/Hamlib/issues/1277
diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c
index 592ba0f0..6dd9dc36 100644
--- a/rigs/icom/icom.c
+++ b/rigs/icom/icom.c
@@ -682,7 +682,7 @@ int icom_init(RIG *rig)
priv->rx_vfo = RIG_VFO_NONE;
rig->state.current_vfo = RIG_VFO_NONE;
priv->filter = RIG_PASSBAND_NOCHANGE;
- priv->x25cmdfails = 0;
+ priv->x25cmdfails = -1;
priv->x1cx03cmdfails = 0;
// we can add rigs here that will never use the 0x25 cmd
@@ -1652,7 +1652,7 @@ int icom_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
if (retval != RIG_OK)
{
- priv->x25cmdfails = 1;
+ if (priv->x25cmdfails < 0) priv->x25cmdfails = 1;
rig_debug(RIG_DEBUG_WARN,
"%s: rig probe shows 0x25 CI-V cmd not available\n", __func__);
}
@@ -5758,7 +5758,7 @@ int icom_get_split_freq(RIG *rig, vfo_t vfo, freq_t *tx_freq)
RETURNFUNC2(retval);
}
- priv->x25cmdfails = 1;
+ if (priv->x25cmdfails < 0) priv->x25cmdfails = 1;
}
}
else // we're in satmode so we try another command
diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h
index c2d970b0..477e2598 100644
--- a/rigs/icom/icom.h
+++ b/rigs/icom/icom.h
@@ -35,7 +35,7 @@
#include <sys/time.h>
#endif
-#define BACKEND_VER "20230122"
+#define BACKEND_VER "20230425"
#define ICOM_IS_ID31 rig_is_model(rig, RIG_MODEL_ID31)
#define ICOM_IS_ID51 rig_is_model(rig, RIG_MODEL_ID51)
commit 44807be556b8264eca8fb40a6f79318336944461
Author: Mike Black W9MDB <mdb...@ya...>
Date: Tue Apr 25 07:58:55 2023 -0500
Add simrotorez
diff --git a/simulators/Makefile.am b/simulators/Makefile.am
index 811db29a..73ca41c1 100644
--- a/simulators/Makefile.am
+++ b/simulators/Makefile.am
@@ -8,7 +8,7 @@ DISTCLEANFILES =
bin_PROGRAMS =
-check_PROGRAMS = simelecraft simicom simkenwood simyaesu simicom9700 simft991 simftdx1200 simftdx3000 simjupiter simpowersdr simid5100 simft736 simftdx5000 simtmd700
+check_PROGRAMS = simelecraft simicom simkenwood simyaesu simicom9700 simft991 simftdx1200 simftdx3000 simjupiter simpowersdr simid5100 simft736 simftdx5000 simtmd700 simrotorez
simelecraft_SOURCES = simelecraft.c
simicom_SOURCES = simicom.c
diff --git a/simulators/simrotorez.c b/simulators/simrotorez.c
new file mode 100644
index 00000000..2fdfa142
--- /dev/null
+++ b/simulators/simrotorez.c
@@ -0,0 +1,127 @@
+// can run this using rigctl/rigctld and socat pty devices
+// gcc -o simspid simspid.c
+#define _XOPEN_SOURCE 600
+#include <stdio.h>
+#include <stdlib.h>
+#include <fcntl.h>
+#include <string.h>
+#include <unistd.h>
+#include "../include/hamlib/rig.h"
+
+#define BUFSIZE 256
+
+float az = 0;
+float el = 0;
+
+int
+getmyline(int fd, char *buf)
+{
+ unsigned char c;
+ int i = 0;
+ int n = 0;
+ memset(buf, 0, BUFSIZE);
+
+ while (read(fd, &c, 1) > 0 && c!=';')
+ {
+ buf[i++] = c;
+ n++;
+ for(int i=0;i<strlen(buf);++i) printf("%02x ", buf[i]);
+ printf("\n");
+ }
+
+ return n;
+}
+
+#if defined(WIN32) || defined(_WIN32)
+int openPort(char *comport) // doesn't matter for using pts devices
+{
+ int fd;
+ fd = open(comport, O_RDWR);
+
+ if (fd < 0)
+ {
+ perror(comport);
+ }
+
+ return fd;
+}
+
+#else
+int openPort(char *comport) // doesn't matter for using pts devices
+{
+ int fd = posix_openpt(O_RDWR);
+ char *name = ptsname(fd);
+
+ if (name == NULL)
+ {
+ perror("pstname");
+ return -1;
+ }
+
+ printf("name=%s\n", name);
+
+ if (fd == -1 || grantpt(fd) == -1 || unlockpt(fd) == -1)
+ {
+ perror("posix_openpt");
+ return -1;
+ }
+
+ return fd;
+}
+#endif
+
+
+
+int main(int argc, char *argv[])
+{
+ char buf[256];
+ int n;
+
+again:
+ int fd = openPort(argv[1]);
+ int fd2 = openPort(argv[2]);
+ int flag = 0;
+
+ while (1)
+ {
+ int bytes;
+ if (!flag) bytes = getmyline(fd, buf);
+ else bytes = getmyline(fd2, buf);
+ flag = !flag;
+
+ if (bytes == 0)
+ {
+ //close(fd);
+ goto again;
+ }
+ printf("line=%s\n", buf);
+
+ if (strncmp(buf,"BI1",3) == 0)
+ {
+ sprintf(buf,"%3.1f;", az);
+ n = write(fd, buf, strlen(buf));
+ printf("n=%d\n", n);
+ }
+ else if (strncmp(buf,"AP1",3) == 0)
+ {
+ sscanf(buf,"AP1%f", &az);
+ }
+ else
+ {
+ printf("Unknown cmd=%s\n", buf);
+ }
+
+#if 0
+ switch (buf[0])
+ {
+ case '?': printf("Query %c\n", buf[1]); break;
+
+ case '*': printf("Set %c\n", buf[1]); break;
+
+ default: printf("Unknown cmd=%02x\n", buf[4]);
+ }
+#endif
+ }
+
+ return 0;
+}
commit f1533984802a9959bd357dc55dd9a562b152c126
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sat Apr 22 12:09:33 2023 -0500
Update NEWS
diff --git a/NEWS b/NEWS
index 1556473a..4982e4e6 100644
--- a/NEWS
+++ b/NEWS
@@ -30,6 +30,9 @@ Version 4.6
* Add FLIR PTU-D48, E46, D100, D300 rotors
* Fix FTDX3000 rig split
+Version 4.5.6
+ * Fix rigctld/rigctltcp information
+
Version 4.5.5
* 2023-04-05
* Add park to rotorez.c
commit 6422bc51d5197e4e2c0a302b15a77cc719b5b86b
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sat Apr 22 11:39:03 2023 -0500
Add version to rig_init debug info
diff --git a/src/rig.c b/src/rig.c
index 8768d9af..555a3b23 100644
--- a/src/rig.c
+++ b/src/rig.c
@@ -509,8 +509,8 @@ RIG *HAMLIB_API rig_init(rig_model_t rig_model)
return (NULL);
}
- rig_debug(RIG_DEBUG_VERBOSE, "%s: rig_model=%s %s\n", __func__, caps->mfg_name,
- caps->model_name);
+ rig_debug(RIG_DEBUG_VERBOSE, "%s: rig_model=%s %s %s\n", __func__, caps->mfg_name,
+ caps->model_name, caps->version);
if (caps->hamlib_check_rig_caps != NULL)
{
commit 4ba3a025124669776f88e29af6d84e035ac903cc
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sat Apr 22 11:22:16 2023 -0500
FT-817 add 100ms delay during ft817_open to avoid initial cmd error during startup
https://github.com/Hamlib/Hamlib/issues/1278
diff --git a/rigs/yaesu/ft817.c b/rigs/yaesu/ft817.c
index d87efa05..efc84ea6 100644
--- a/rigs/yaesu/ft817.c
+++ b/rigs/yaesu/ft817.c
@@ -292,7 +292,7 @@ const struct rig_caps ft817_caps =
RIG_MODEL(RIG_MODEL_FT817),
.model_name = "FT-817",
.mfg_name = "Yaesu",
- .version = "20230421.0",
+ .version = "20230422.0",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
@@ -623,6 +623,7 @@ static int ft817_cleanup(RIG *rig)
static int ft817_open(RIG *rig)
{
rig_debug(RIG_DEBUG_VERBOSE, "%s: called \n", __func__);
+ hl_usleep(100*1000); // rig needs a bit to allow commands to come through
return RIG_OK;
}
commit 2af9f2c5b3355d8806ea9e7d6f34eec720b40057
Author: Mike Black W9MDB <mdb...@ya...>
Date: Fri Apr 21 22:05:42 2023 -0500
For FT-817 add sleep after set_vfo to allow vfo swap to occur
https://github.com/Hamlib/Hamlib/issues/1278
diff --git a/rigs/yaesu/ft817.c b/rigs/yaesu/ft817.c
index d912535b..d87efa05 100644
--- a/rigs/yaesu/ft817.c
+++ b/rigs/yaesu/ft817.c
@@ -292,7 +292,7 @@ const struct rig_caps ft817_caps =
RIG_MODEL(RIG_MODEL_FT817),
.model_name = "FT-817",
.mfg_name = "Yaesu",
- .version = "20220419.0",
+ .version = "20230421.0",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
@@ -1432,8 +1432,10 @@ static int ft817_set_vfo(RIG *rig, vfo_t vfo)
{
return RIG_OK;
}
+ retval = ft817_send_cmd(rig, FT817_NATIVE_CAT_SET_VFOAB);
+ hl_usleep(50 * 1000); // can take a little while for vfo swap to happen -- otherwise we get errors trying to read eeprom to quickly
- return ft817_send_cmd(rig, FT817_NATIVE_CAT_SET_VFOAB);
+ return retval;
}
static int ft817_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
commit 6c410f164e489ca30e101eab91d63d21a098003b
Author: Mike Black W9MDB <mdb...@ya...>
Date: Fri Apr 21 16:04:04 2023 -0500
This did not solve the problem with Win4Yaesu
Revert "https://github.com/Hamlib/Hamlib/issues/1275"
This reverts commit c02ded5b494341242a231bb1fffaa39eeed8daed.
diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c
index db9e2b29..eb206647 100644
--- a/rigs/yaesu/newcat.c
+++ b/rigs/yaesu/newcat.c
@@ -10827,7 +10827,7 @@ int newcat_set_cmd_validate(RIG *rig)
}
else if (strncmp(priv->cmd_str, "ST", 2) == 0)
{
- strcpy(valcmd, "X;");
+ strcpy(valcmd, ";");
}
else
{
@@ -10855,7 +10855,7 @@ int newcat_set_cmd_validate(RIG *rig)
case RIG_MODEL_FT991:
case RIG_MODEL_FTDX101MP:
case RIG_MODEL_FTDX3000:
- strcpy(valcmd, "X;");
+ strcpy(valcmd, ";");
break;
// these models do not work with a single ;
case RIG_MODEL_FT897:
diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h
index 72980d2a..441914ca 100644
--- a/rigs/yaesu/newcat.h
+++ b/rigs/yaesu/newcat.h
@@ -50,7 +50,7 @@
typedef char ncboolean;
/* shared function version */
-#define NEWCAT_VER "20230419"
+#define NEWCAT_VER "20230328"
/* Hopefully large enough for future use, 128 chars plus '\0' */
#define NEWCAT_DATA_LEN 129
commit 72266a677dd35c9ce789bd0cf22b8efa535f6b94
Merge: c02ded5b 6eee376c
Author: Michael Black <mdb...@ya...>
Date: Thu Apr 20 17:19:14 2023 -0500
Merge pull request #1276 from dforsi/fix/typos
Fix name of command in --version and usage outputs
commit c02ded5b494341242a231bb1fffaa39eeed8daed
Author: Mike Black W9MDB <mdb...@ya...>
Date: Wed Apr 19 15:15:56 2023 -0500
https://github.com/Hamlib/Hamlib/issues/1275
diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c
index eb206647..db9e2b29 100644
--- a/rigs/yaesu/newcat.c
+++ b/rigs/yaesu/newcat.c
@@ -10827,7 +10827,7 @@ int newcat_set_cmd_validate(RIG *rig)
}
else if (strncmp(priv->cmd_str, "ST", 2) == 0)
{
- strcpy(valcmd, ";");
+ strcpy(valcmd, "X;");
}
else
{
@@ -10855,7 +10855,7 @@ int newcat_set_cmd_validate(RIG *rig)
case RIG_MODEL_FT991:
case RIG_MODEL_FTDX101MP:
case RIG_MODEL_FTDX3000:
- strcpy(valcmd, ";");
+ strcpy(valcmd, "X;");
break;
// these models do not work with a single ;
case RIG_MODEL_FT897:
diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h
index 441914ca..72980d2a 100644
--- a/rigs/yaesu/newcat.h
+++ b/rigs/yaesu/newcat.h
@@ -50,7 +50,7 @@
typedef char ncboolean;
/* shared function version */
-#define NEWCAT_VER "20230328"
+#define NEWCAT_VER "20230419"
/* Hopefully large enough for future use, 128 chars plus '\0' */
#define NEWCAT_DATA_LEN 129
commit 6eee376cbfb429b4055667b69fe3c600d8ca64c6
Author: Daniele Forsi IU5HKX <iu...@gm...>
Date: Wed Apr 19 21:48:32 2023 +0200
Fix name of command in the version text
diff --git a/tests/rigctld.c b/tests/rigctld.c
index b9c6dbc6..a2e32820 100644
--- a/tests/rigctld.c
+++ b/tests/rigctld.c
@@ -309,7 +309,7 @@ int main(int argc, char *argv[])
exit(0);
case 'V':
- printf("rigctl %s\n", hamlib_version2);
+ printf("rigctld %s\n", hamlib_version2);
exit(0);
case 'R':
commit f390aa499d171e4e6f91c8f5bfaf7d7ec298c9de
Author: Daniele Forsi IU5HKX <iu...@gm...>
Date: Wed Apr 19 21:34:44 2023 +0200
Fix name of command in the usage and version texts
diff --git a/tests/rigctltcp.c b/tests/rigctltcp.c
index 3ee212bc..e23cc0ea 100644
--- a/tests/rigctltcp.c
+++ b/tests/rigctltcp.c
@@ -312,7 +312,7 @@ int main(int argc, char *argv[])
exit(0);
case 'V':
- printf("rigctl %s\n", hamlib_version2);
+ printf("rigctltcp %s\n", hamlib_version2);
exit(0);
case 'R':
@@ -656,7 +656,7 @@ int main(int argc, char *argv[])
rig_debug(RIG_DEBUG_VERBOSE, "%s\n", rigstartup);
- rig_debug(RIG_DEBUG_VERBOSE, "rigctld %s\n", hamlib_version2);
+ rig_debug(RIG_DEBUG_VERBOSE, "rigctltcp %s\n", hamlib_version2);
rig_debug(RIG_DEBUG_VERBOSE, "%s",
"Report bugs to <ham...@li...>\n\n");
rig_debug(RIG_DEBUG_VERBOSE, "Max# of rigctld client services=%d\n",
@@ -1513,7 +1513,7 @@ handle_exit:
void usage(void)
{
- printf("Usage: rigctld [OPTION]...\n"
+ printf("Usage: rigctltcp [OPTION]...\n"
"Daemon serving COMMANDs to a connected radio transceiver or receiver.\n\n");
commit 3b66959f4e3289e343e9911d203cb5216f744a15
Merge: 4551199d 1a59ce2a
Author: Michael Black <mdb...@ya...>
Date: Mon Apr 17 07:21:10 2023 -0500
Merge pull request #1274 from mikaelnousiainen/ts590sg-fixes
Fix and extend TS-590(S/SG) backend
commit 1a59ce2ae2b42585ceb140eb713f87945531b87c
Author: Mikael Nousiainen <mik...@ik...>
Date: Sat Apr 15 00:25:29 2023 +0300
Fix and extend TS-590(S/SG) backend
diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h
index c691b46a..d8d5ad3f 100644
--- a/include/hamlib/rig.h
+++ b/include/hamlib/rig.h
@@ -1323,6 +1323,11 @@ typedef uint64_t rmode_t;
*/
#define RIG_MODE_SSB (RIG_MODE_USB|RIG_MODE_LSB)
+/**
+ * \brief macro for backends, not to be used by rig_set_mode et al.
+ */
+#define RIG_MODE_PKTSSB (RIG_MODE_PKTUSB|RIG_MODE_PKTLSB)
+
/**
* \brief macro for backends, not to be used by rig_set_mode et al.
*/
diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c
index 2f5b0c81..3bd3723c 100644
--- a/rigs/kenwood/kenwood.c
+++ b/rigs/kenwood/kenwood.c
@@ -322,7 +322,13 @@ transaction_write:
rig_flush(&rs->rigport);
// PS command may need to wake up serial port
- if (strncmp(cmd, "PS", 2) == 0) { write_block(&rs->rigport, (unsigned char *) ";;;;", 4); }
+ if (priv->ps_cmd_wakeup_data)
+ {
+ if (strncmp(cmd, "PS", 2) == 0)
+ {
+ write_block(&rs->rigport, (unsigned char *) ";;;;", 4);
+ }
+ }
retval = write_block(&rs->rigport, (unsigned char *) cmd, len);
@@ -484,6 +490,24 @@ transaction_read:
case '?':
+ /* The ? response is an ambiguous response, but for get commands it seems to
+ * indicate that the rig rejected the command because the state of the rig is not valid for the command
+ * or that the command parameter is invalid. Retrying the command does not fix the issue,
+ * as the error is caused by the an invalid combination of rig state.
+ *
+ * For example, the following cases have been observed:
+ * - NL (NB level) and RL (NR level) commands fail if NB / NR are not enabled on TS-590SG
+ * - SH and SL (filter width) fail in CW mode on TS-590SG
+ * - GT (AGC) fails in FM mode on TS-590SG
+ *
+ * There are more cases like these and they vary by rig model.
+ */
+ if (priv->question_mark_response_means_rejected)
+ {
+ rig_debug(RIG_DEBUG_ERR, "%s: Command rejected by the rig (get): '%s'\n", __func__,cmdstr);
+ RETURNFUNC(-RIG_ERJCTED);
+ }
+
/* Command not understood by rig or rig busy */
if (cmdstr)
{
@@ -519,8 +543,18 @@ transaction_read:
*/
if (datasize)
{
- // we ignore the special ;;;;PS; command
- if (cmdstr && strcmp(cmdstr, ";;;;PS") != 0 && (buffer[0] != cmdstr[0]
+ char *ps_cmd;
+ if (priv->ps_cmd_wakeup_data)
+ {
+ ps_cmd = ";;;;PS";
+ }
+ else
+ {
+ ps_cmd = "PS";
+ }
+
+ // we ignore the special PS command
+ if (cmdstr && strcmp(cmdstr, ps_cmd) != 0 && (buffer[0] != cmdstr[0]
|| (cmdstr[1] && buffer[1] != cmdstr[1])))
{
/*
@@ -836,6 +870,8 @@ int kenwood_open(RIG *rig)
id[0] = 0;
rig->state.rigport.retry = 0;
+ priv->question_mark_response_means_rejected = 0;
+
if (rig->state.auto_power_on)
{
// Ensure rig is on
@@ -3102,7 +3138,7 @@ static int kenwood_find_slope_filter_for_value(RIG *rig, vfo_t vfo,
int kenwood_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
{
char levelbuf[16];
- int i, kenwood_val, len;
+ int i, kenwood_val, len, result;
struct kenwood_priv_data *priv = rig->state.priv;
struct kenwood_priv_caps *caps = kenwood_caps(rig);
@@ -3311,6 +3347,7 @@ int kenwood_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
}
SNPRINTF(levelbuf, sizeof(levelbuf), "SH%02d", kenwood_val);
+ priv->question_mark_response_means_rejected = 1;
break;
case RIG_LEVEL_SLOPE_LOW:
@@ -3329,6 +3366,7 @@ int kenwood_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
}
SNPRINTF(levelbuf, sizeof(levelbuf), "SL%02d", kenwood_val);
+ priv->question_mark_response_means_rejected = 1;
break;
case RIG_LEVEL_CWPITCH:
@@ -3404,7 +3442,10 @@ int kenwood_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
RETURNFUNC(-RIG_EINVAL);
}
- RETURNFUNC(kenwood_transaction(rig, levelbuf, NULL, 0));
+ result = kenwood_transaction(rig, levelbuf, NULL, 0);
+ priv->question_mark_response_means_rejected = 0;
+
+ RETURNFUNC(result);
}
int get_kenwood_level(RIG *rig, const char *cmd, float *fval, int *ival)
@@ -3824,7 +3865,9 @@ int kenwood_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
RETURNFUNC(ret);
case RIG_LEVEL_SLOPE_LOW:
+ priv->question_mark_response_means_rejected = 1;
retval = kenwood_transaction(rig, "SL", lvlbuf, sizeof(lvlbuf));
+ priv->question_mark_response_means_rejected = 0;
if (retval != RIG_OK)
{
@@ -3852,7 +3895,9 @@ int kenwood_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
break;
case RIG_LEVEL_SLOPE_HIGH:
+ priv->question_mark_response_means_rejected = 1;
retval = kenwood_transaction(rig, "SH", lvlbuf, sizeof(lvlbuf));
+ priv->question_mark_response_means_rejected = 0;
if (retval != RIG_OK)
{
@@ -4661,6 +4706,10 @@ int kenwood_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option)
SNPRINTF(cmd, sizeof(cmd), "AN0%c%c99", c, a);
}
+ else if (RIG_IS_TS590S || RIG_IS_TS590SG)
+ {
+ SNPRINTF(cmd, sizeof(cmd), "AN%c99", a);
+ }
else
{
SNPRINTF(cmd, sizeof(cmd), "AN%c", a);
@@ -4723,6 +4772,11 @@ int kenwood_get_ant(RIG *rig, vfo_t vfo, ant_t dummy, value_t *option,
retval = kenwood_safe_transaction(rig, "AN0", ackbuf, sizeof(ackbuf), 7);
offs = 4;
}
+ else if (RIG_IS_TS590S || RIG_IS_TS590SG)
+ {
+ retval = kenwood_safe_transaction(rig, "AN", ackbuf, sizeof(ackbuf), 5);
+ offs = 2;
+ }
else
{
retval = kenwood_safe_transaction(rig, "AN", ackbuf, sizeof(ackbuf), 3);
@@ -5068,7 +5122,17 @@ int kenwood_get_powerstat(RIG *rig, powerstat_t *status)
RETURNFUNC(-RIG_EINVAL);
}
- retval = kenwood_safe_transaction(rig, ";;;;PS", pwrbuf, 6, 3);
+ char *ps_cmd;
+ if (priv->ps_cmd_wakeup_data)
+ {
+ ps_cmd = ";;;;PS";
+ }
+ else
+ {
+ ps_cmd = "PS";
+ }
+
+ retval = kenwood_safe_transaction(rig, ps_cmd, pwrbuf, 6, 3);
if (retval != RIG_OK)
{
diff --git a/rigs/kenwood/kenwood.h b/rigs/kenwood/kenwood.h
index 7604b95a..f071c8f1 100644
--- a/rigs/kenwood/kenwood.h
+++ b/rigs/kenwood/kenwood.h
@@ -28,7 +28,7 @@
#include "token.h"
#include "idx_builtin.h"
-#define BACKEND_VER "20230318"
+#define BACKEND_VER "20230414"
#define EOM_KEN ';'
#define EOM_TH '\r'
@@ -175,6 +175,8 @@ struct kenwood_priv_data
rmode_t modeB;
int datamodeA; // datamode status from get_mode or set_mode
int datamodeB; // datamode status from get_mode or set_mode
+ int ps_cmd_wakeup_data; // PS command requires wakeup characters (;)
+ int question_mark_response_means_rejected; /* the question mark response has multiple meanings */
};
diff --git a/rigs/kenwood/level_gran_kenwood.h b/rigs/kenwood/level_gran_kenwood.h
index 44b668f9..826499f6 100644
--- a/rigs/kenwood/level_gran_kenwood.h
+++ b/rigs/kenwood/level_gran_kenwood.h
@@ -7,7 +7,6 @@
[LVL_PREAMP] = { .min = { .i = 10 }, .max = { .i = 20 }, .step = { .i = 10 } },
[LVL_ATT] = { .min = { .i = 0 }, .max = { .i = 12 }, .step = { .i = 0 } },
[LVL_STRENGTH] = { .min = { .i = 0 }, .max = { .i = 60 }, .step = { .i = 0 } },
- [LVL_NB] = { .min = { .f = 0 }, .max = { .f = 10 }, .step = { .f = 1 } },
/* levels with WPM units */
[LVL_KEYSPD] = { .min = { .i = 4 }, .max = { .i = 60 }, .step = { .i = 1 } },
/* levels with Hz units */
@@ -25,6 +24,7 @@
[LVL_BAND_SELECT] = { .min = { .i = 0 }, .max = { .i = 16 }, .step = { .i = 1 } },
/* levels with 0-1 values -- increment based on rig's range */
[LVL_NR] = { .min = { .f = 0 }, .max = { .f = 1 }, .step = { .f = 1.0f/10.0f } },
+ [LVL_NB] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/10.0f } },
[LVL_AF] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/255.0f } },
[LVL_RF] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/255.0f } },
[LVL_RFPOWER] = { .min = { .f = .05 }, .max = { .f = 1 }, .step = { .f = 1.0f/100.0f } },
diff --git a/rigs/kenwood/ts480.c b/rigs/kenwood/ts480.c
index 781434d7..9fc5247d 100644
--- a/rigs/kenwood/ts480.c
+++ b/rigs/kenwood/ts480.c
@@ -42,7 +42,7 @@
#define TS480_LEVEL_GET (RIG_LEVEL_RFPOWER|RIG_LEVEL_AF|RIG_LEVEL_RF|RIG_LEVEL_SQL|RIG_LEVEL_AGC|RIG_LEVEL_MICGAIN|RIG_LEVEL_STRENGTH|RIG_LEVEL_KEYSPD|RIG_LEVEL_CWPITCH| \
RIG_LEVEL_MONITOR_GAIN|RIG_LEVEL_NB|RIG_LEVEL_NR|RIG_LEVEL_PREAMP|RIG_LEVEL_COMP|RIG_LEVEL_ATT|RIG_LEVEL_VOXDELAY|RIG_LEVEL_VOXGAIN|RIG_LEVEL_BKIN_DLYMS| \
- RIG_LEVEL_METER|RIG_LEVEL_SWR|RIG_LEVEL_COMP_METER|RIG_LEVEL_ALC|RIG_LEVEL_RFPOWER_METER|RIG_LEVEL_SLOPE_HIGH|RIG_LEVEL_SLOPE_LOW)
+ RIG_LEVEL_SWR|RIG_LEVEL_COMP_METER|RIG_LEVEL_ALC|RIG_LEVEL_RFPOWER_METER|RIG_LEVEL_SLOPE_HIGH|RIG_LEVEL_SLOPE_LOW)
#define TS480_LEVEL_SET (RIG_LEVEL_RFPOWER|RIG_LEVEL_AF|RIG_LEVEL_RF|RIG_LEVEL_SQL|RIG_LEVEL_AGC|RIG_LEVEL_MICGAIN|RIG_LEVEL_KEYSPD|RIG_LEVEL_CWPITCH| \
RIG_LEVEL_MONITOR_GAIN|RIG_LEVEL_NB|RIG_LEVEL_NR|RIG_LEVEL_PREAMP|RIG_LEVEL_COMP|RIG_LEVEL_ATT|RIG_LEVEL_VOXDELAY|RIG_LEVEL_VOXGAIN|RIG_LEVEL_BKIN_DLYMS| \
@@ -658,42 +658,6 @@ kenwood_ts480_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
val->i = ackbuf[3] == '1' ? 12 : 0;
break;
- case RIG_LEVEL_METER:
- {
- int raw_value;
-
- // TODO: Read all meters at the same time: RM10000;RM20000;RM30000;
-
- retval = kenwood_safe_transaction(rig, "RM", ackbuf, sizeof(ackbuf), 7);
-
- if (retval != RIG_OK)
- {
- RETURNFUNC(retval);
- }
-
- sscanf(ackbuf, "RM%1d", &raw_value);
-
- switch (raw_value)
- {
- case 1:
- val->i = RIG_METER_SWR;
- break;
-
- case 2:
- val->i = RIG_METER_COMP;
- break;
-
- case 3:
- val->i = RIG_METER_ALC;
- break;
-
- default:
- val->i = RIG_METER_NONE;
- }
-
- break;
- }
-
case RIG_LEVEL_SWR:
case RIG_LEVEL_COMP_METER:
case RIG_LEVEL_ALC:
@@ -1205,7 +1169,7 @@ static struct kenwood_slope_filter ts480_slope_filter_low[] =
{ RIG_MODE_SSB | RIG_MODE_FM | RIG_MODE_RTTY | RIG_MODE_RTTYR, 0, 8, 700 },
{ RIG_MODE_SSB | RIG_MODE_FM | RIG_MODE_RTTY | RIG_MODE_RTTYR, 0, 9, 800 },
{ RIG_MODE_SSB | RIG_MODE_FM | RIG_MODE_RTTY | RIG_MODE_RTTYR, 0, 10, 900 },
- { RIG_MODE_SSB | RIG_MODE_FM | RIG_MODE_RTTY | RIG_MODE_RTTYR, 10, 1, 1000 },
+ { RIG_MODE_SSB | RIG_MODE_FM | RIG_MODE_RTTY | RIG_MODE_RTTYR, 0, 11, 1000 },
{ RIG_MODE_AM, 0, 0, 0 },
{ RIG_MODE_AM, 0, 1, 100 },
{ RIG_MODE_AM, 0, 2, 200 },
@@ -1247,6 +1211,7 @@ int ts480_init(RIG *rig)
priv->ag_format = 2;
priv->micgain_min = 0;
priv->micgain_max = 100;
+ priv->ps_cmd_wakeup_data = 1;
RETURNFUNC(RIG_OK);
}
diff --git a/rigs/kenwood/ts590.c b/rigs/kenwood/ts590.c
index 285b8d11..e37bb2a1 100644
--- a/rigs/kenwood/ts590.c
+++ b/rigs/kenwood/ts590.c
@@ -1,7 +1,7 @@
/*
- * Hamlib Kenwood backend - TS590 description
+ * Hamlib Kenwood backend - TS-590(S/SG) description
* Copyright (c) 2010 by Stephane Fillod
- *
+ * Copyright (c) 2023 by Mikael Nousiainen OH3BHX
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -21,74 +21,1389 @@
#include <stdio.h>
#include <string.h>
+#include <stdlib.h>
+
+#include "hamlib/rig.h"
+#include "kenwood.h"
+#include "misc.h"
+#include "cal.h"
+#include "iofunc.h"
+
+#define TS590_ALL_MODES (RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|RIG_MODE_FM|RIG_MODE_RTTY|RIG_MODE_RTTYR|RIG_MODE_PKTFM|RIG_MODE_PKTUSB|RIG_MODE_PKTLSB|RIG_MODE_PKTAM)
+#define TS590_OTHER_TX_MODES (RIG_MODE_CW|RIG_MODE_SSB|RIG_MODE_FM|RIG_MODE_RTTY)
+#define TS590_AM_TX_MODES (RIG_MODE_AM|RIG_MODE_PKTAM)
+#define TS590_VFO (RIG_VFO_A|RIG_VFO_B|RIG_VFO_MEM)
+
+#define TS590_LEVEL_GET (RIG_LEVEL_RFPOWER|RIG_LEVEL_AF|RIG_LEVEL_RF|RIG_LEVEL_SQL|RIG_LEVEL_AGC|RIG_LEVEL_MICGAIN|RIG_LEVEL_STRENGTH|RIG_LEVEL_KEYSPD|RIG_LEVEL_CWPITCH| \
+ RIG_LEVEL_MONITOR_GAIN|RIG_LEVEL_NB|RIG_LEVEL_NR|RIG_LEVEL_PREAMP|RIG_LEVEL_COMP|RIG_LEVEL_ATT|RIG_LEVEL_VOXDELAY|RIG_LEVEL_VOXGAIN|RIG_LEVEL_BKIN_DLYMS| \
+ RIG_LEVEL_SWR|RIG_LEVEL_COMP_METER|RIG_LEVEL_ALC|RIG_LEVEL_RFPOWER_METER|RIG_LEVEL_SLOPE_HIGH|RIG_LEVEL_SLOPE_LOW)
+
+#define TS590_LEVEL_SET (RIG_LEVEL_RFPOWER|RIG_LEVEL_AF|RIG_LEVEL_RF|RIG_LEVEL_SQL|RIG_LEVEL_AGC|RIG_LEVEL_MICGAIN|RIG_LEVEL_KEYSPD|RIG_LEVEL_CWPITCH| \
+ RIG_LEVEL_MONITOR_GAIN|RIG_LEVEL_NB|RIG_LEVEL_NR|RIG_LEVEL_PREAMP|RIG_LEVEL_COMP|RIG_LEVEL_ATT|RIG_LEVEL_VOXDELAY|RIG_LEVEL_VOXGAIN|RIG_LEVEL_BKIN_DLYMS| \
+ RIG_LEVEL_METER|RIG_LEVEL_SLOPE_HIGH|RIG_LEVEL_SLOPE_LOW)
+
+#define TS590_FUNC_ALL (RIG_FUNC_NB|RIG_FUNC_COMP|RIG_FUNC_VOX|RIG_FUNC_NR|RIG_FUNC_NR|RIG_FUNC_BC|RIG_FUNC_BC2|RIG_FUNC_RIT|RIG_FUNC_XIT| \
+ RIG_FUNC_TUNER|RIG_FUNC_MON|RIG_FUNC_FBKIN|RIG_FUNC_LOCK)
+
+#define TS590_VFO_OPS (RIG_OP_UP|RIG_OP_DOWN|RIG_OP_CPY|RIG_OP_TUNE)
+
+#define TS590_SCAN_OPS (RIG_SCAN_VFO)
+
+#define TS590_ANTS (RIG_ANT_1|RIG_ANT_2)
+
+#define TS590_CHANNEL_CAPS { \
+ .freq=1,\
+ .mode=1,\
+ .tx_freq=1,\
+ .tx_mode=1,\
+ .split=1,\
+ .funcs=RIG_FUNC_TONE, \
+ .flags=RIG_CHFLAG_SKIP \
+ }
+
+#define TS590_STR_CAL {9, {\
+ { 0, -60},\
+ { 3, -48},\
+ { 6, -36},\
+ { 9, -24},\
+ {12, -12},\
+ {15, 0},\
+ {20, 20},\
+ {25, 40},\
+ {30, 60}}\
+ }
+
+#define TS590_SWR_CAL { 5, \
+ { \
+ { 0, 1.0f }, \
+ { 6, 1.5f }, \
+ { 12, 2.0f }, \
+ { 18, 3.0f }, \
+ { 30, 10.0f } \
+ } }
+
+#define TOK_FUNC_NOISE_REDUCTION_2 TOKEN_BACKEND(102)
+#define TOK_LEVEL_DSP_RX_EQUALIZER TOKEN_BACKEND(104)
+#define TOK_LEVEL_DSP_TX_EQUALIZER TOKEN_BACKEND(105)
+#define TOK_LEVEL_BEEP_VOLUME TOKEN_BACKEND(107)
+#define TOK_LEVEL_TX_SIDETONE_VOLUME TOKEN_BACKEND(108)
+#define TOK_LEVEL_ACC2_AUDIO_INPUT_LEVEL TOKEN_BACKEND(109)
+#define TOK_LEVEL_ACC2_AUDIO_OUTPUT_LEVEL TOKEN_BACKEND(110)
+#define TOK_LEVEL_USB_AUDIO_INPUT_LEVEL TOKEN_BACKEND(113)
+#define TOK_LEVEL_USB_AUDIO_OUTPUT_LEVEL TOKEN_BACKEND(114)
+#define TOK_LEVEL_DSP_TX_SSB_AM_LOW_CUT_FILTER TOKEN_BACKEND(115)
+#define TOK_LEVEL_DSP_TX_SSB_AM_HIGH_CUT_FILTER TOKEN_BACKEND(116)
+#define TOK_LEVEL_DSP_TX_SSB_DATA_LOW_CUT_FILTER TOKEN_BACKEND(117)
+#define TOK_LEVEL_DSP_TX_SSB_DATA_HIGH_CUT_FILTER TOKEN_BACKEND(118)
+
+int ts590_ext_tokens[] =
+{
+ TOK_FUNC_NOISE_REDUCTION_2,
+ TOK_LEVEL_DSP_RX_EQUALIZER, TOK_LEVEL_DSP_TX_EQUALIZER,
+ TOK_LEVEL_BEEP_VOLUME, TOK_LEVEL_TX_SIDETONE_VOLUME,
+ TOK_LEVEL_ACC2_AUDIO_INPUT_LEVEL, TOK_LEVEL_ACC2_AUDIO_OUTPUT_LEVEL,
+ TOK_LEVEL_USB_AUDIO_INPUT_LEVEL, TOK_LEVEL_USB_AUDIO_OUTPUT_LEVEL,
+ TOK_LEVEL_DSP_TX_SSB_AM_LOW_CUT_FILTER, TOK_LEVEL_DSP_TX_SSB_AM_HIGH_CUT_FILTER,
+ TOK_LEVEL_DSP_TX_SSB_DATA_LOW_CUT_FILTER, TOK_LEVEL_DSP_TX_SSB_DATA_HIGH_CUT_FILTER,
+
+ TOK_BACKEND_NONE,
+};
+
+const struct confparams ts590_ext_funcs[] =
+{
+ {
+ TOK_FUNC_NOISE_REDUCTION_2, "NR2", "Noise reduction 2", "Noise reduction 2",
+ NULL, RIG_CONF_CHECKBUTTON,
+ },
+ { RIG_CONF_END, NULL, }
+};
+
+const struct confparams ts590_ext_levels[] =
+{
+ {
+ TOK_LEVEL_DSP_RX_EQUALIZER, "DSP_RX_EQUALIZER", "DSP RX equalizer", "DSP RX equalizer type",
+ NULL, RIG_CONF_COMBO, { .c = { .combostr = { "OFF", "Hb1", "Hb2", "FP", "bb1", "bb2", "c", "U", NULL } } }
+ },
+ {
+ TOK_LEVEL_DSP_TX_EQUALIZER, "DSP_TX_EQUALIZER", "DSP TX equalizer", "DSP TX equalizer type",
+ NULL, RIG_CONF_COMBO, { .c = { .combostr = { "OFF", "Hb1", "Hb2", "FP", "bb1", "bb2", "flat", "U", NULL } } }
+ },
+ {
+ TOK_LEVEL_BEEP_VOLUME, "BEEP_VOLUME", "Beep volume", "Beep volume",
+ NULL, RIG_CONF_NUMERIC, { .n = { .min = 0, .max = 20, .step = 1 } }
+ },
+ {
+ TOK_LEVEL_TX_SIDETONE_VOLUME, "TX_SIDETONE_VOLUME", "TX sidetone volume", "TX sidetone volume",
+ NULL, RIG_CONF_NUMERIC, { .n = { .min = 0, .max = 20, .step = 1 } }
+ },
+ {
+ TOK_LEVEL_ACC2_AUDIO_INPUT_LEVEL, "ACC2_AUDIO_INPUT_LEVEL", "ACC2 audio input level", "ACC2 audio input level",
+ NULL, RIG_CONF_NUMERIC, { .n = { .min = 0, .max = 9, .step = 1 } }
+ },
+ {
+ TOK_LEVEL_ACC2_AUDIO_OUTPUT_LEVEL, "ACC2_AUDIO_OUTPUT_LEVEL", "ACC2 audio output level", "ACC2 audio output level",
+ NULL, RIG_CONF_NUMERIC, { .n = { .min = 0, .max = 9, .step = 1 } }
+ },
+ {
+ TOK_LEVEL_USB_AUDIO_INPUT_LEVEL, "USB_AUDIO_INPUT_LEVEL", "USB audio input level", "USB audio input level",
+ NULL, RIG_CONF_NUMERIC, { .n = { .min = 0, .max = 9, .step = 1 } }
+ },
+ {
+ TOK_LEVEL_USB_AUDIO_OUTPUT_LEVEL, "USB_AUDIO_OUTPUT_LEVEL", "USB audio output level", "USB audio output level",
+ NULL, RIG_CONF_NUMERIC, { .n = { .min = 0, .max = 9, .step = 1 } }
+ },
+ {
+ TOK_LEVEL_DSP_TX_SSB_AM_LOW_CUT_FILTER, "DSP_TX_SSB_AM_LOW_CUT_FILTER", "DSP TX SSB/AM low-cut", "DSP TX low-cut filter for SSB and AM",
+ NULL, RIG_CONF_COMBO, { .c = { .combostr = { "10 Hz", "100 Hz", "200 Hz", "300 Hz", "400 Hz", "500 Hz", NULL } } }
+ },
+ {
+ TOK_LEVEL_DSP_TX_SSB_AM_HIGH_CUT_FILTER, "DSP_TX_SSB_AM_HIGH_CUT_FILTER", "DSP TX SSB/AM high-cut", "DSP TX high-cut filter for SSB and AM",
+ NULL, RIG_CONF_COMBO, { .c = { .combostr = { "2500 Hz", "2600 Hz", "2700 Hz", "2800 Hz", "2900 Hz", "3000 Hz", NULL } } }
+ },
+ {
+ TOK_LEVEL_DSP_TX_SSB_DATA_LOW_CUT_FILTER, "DSP_TX_SSB_DATA_LOW_CUT_FILTER", "DSP TX SSB data low-cut", "DSP TX low-cut filter for SSB data",
+ NULL, RIG_CONF_COMBO, { .c = { .combostr = { "10 Hz", "100 Hz", "200 Hz", "300 Hz", "400 Hz", "500 Hz", NULL } } }
+ },
+ {
+ TOK_LEVEL_DSP_TX_SSB_DATA_HIGH_CUT_FILTER, "DSP_TX_SSB_DATA_HIGH_CUT_FILTER", "DSP TX SSB data high-cut", "DSP TX high-cut filter for SSB data",
+ NULL, RIG_CONF_COMBO, { .c = { .combostr = { "2500 Hz", "2600 Hz", "2700 Hz", "2800 Hz", "2900 Hz", "3000 Hz", NULL } } }
+ },
+ { RIG_CONF_END, NULL, }
+};
+
+
+/*
+ * ts590_get_info
+ * This is not documented in the manual as of 3/11/15 but confirmed from Kenwood
+ * "TY" produces "TYK 00" for example
+ */
+const char *ts590_get_info(RIG *rig)
+{
+ char firmbuf[10];
+ int retval;
+
+ rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
+
+ retval = kenwood_safe_transaction(rig, "TY", firmbuf, 10, 6);
+
+ if (retval != RIG_OK)
+ {
+ return NULL;
+ }
+
+ switch (firmbuf[2])
+ {
+ case 'K': return "Firmware: USA version";
+
+ case 'E': return "Firmware: European version";
+
+ default: return "Firmware: unknown";
+ }
+}
+
+static int ts590_set_ex_menu(RIG *rig, int number, int value_len, int value)
+{
+ char buf[20];
+
+ ENTERFUNC;
+
+ SNPRINTF(buf, sizeof(buf), "EX%03d0000%0*d", number, value_len, value);
+
+ RETURNFUNC(kenwood_transaction(rig, buf, NULL, 0));
+}
+
+static int ts590_get_ex_menu(RIG *rig, int number, int value_len, int *value)
+{
+ int retval;
+ char buf[20];
+ char ackbuf[20];
+
+ rig_debug(RIG_DEBUG_TRACE, "%s called\n", __func__);
+
+ SNPRINTF(buf, sizeof(buf), "EX%03d0000", number);
+
+ retval = kenwood_safe_transaction(rig, buf, ackbuf, sizeof(ackbuf),
+ 9 + value_len);
+
+ if (retval != RIG_OK)
+ {
+ RETURNFUNC2(retval);
+ }
+
+ sscanf(ackbuf + 9, "%d", value);
+
+ RETURNFUNC2(RIG_OK);
+}
+
+static int ts590_set_func(RIG *rig, vfo_t vfo, setting_t func, int status)
+{
+ char buf[20];
+
+ rig_debug(RIG_DEBUG_TRACE, "%s called\n", __func__);
+
+ switch (func)
+ {
+ case RIG_FUNC_MON:
+ SNPRINTF(buf, sizeof(buf), "ML00%c", (status == 0) ? '0' : '1');
+ RETURNFUNC(kenwood_transaction(rig, buf, NULL, 0));
+
+ case RIG_FUNC_LOCK:
+ SNPRINTF(buf, sizeof(buf), "LK%c0", (status == 0) ? '0' : '1');
+ RETURNFUNC(kenwood_transaction(rig, buf, NULL, 0));
+
+ case RIG_FUNC_TUNER:
+ SNPRINTF(buf, sizeof(buf), "AC%c%c0", (status == 0) ? '0' : '1', (status == 0) ? '0' : '1');
+ RETURNFUNC(kenwood_transaction(rig, buf, NULL, 0));
+
+ default:
+ return kenwood_set_func(rig, vfo, func, status);
+ }
+}
+
+static int ts590_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status)
+{
+ char buf[20];
+ int retval;
+
+ ENTERFUNC;
+
+ switch (func)
+ {
+ case RIG_FUNC_MON:
+ {
+ int raw_value;
+ retval = kenwood_safe_transaction(rig, "ML", buf, sizeof(buf), 5);
+
+ if (retval != RIG_OK)
+ {
+ RETURNFUNC(retval);
+ }
+
+ sscanf(buf, "ML%d", &raw_value);
+
+ *status = (raw_value > 0);
+ break;
+ }
+
+ case RIG_FUNC_LOCK:
+ retval = kenwood_safe_transaction(rig, "LK", buf, sizeof(buf), 4);
+
+ if (retval != RIG_OK)
+ {
+ RETURNFUNC(retval);
+ }
+
+ *status = buf[2] != '0';
+ break;
+
+ case RIG_FUNC_TUNER:
+ retval = kenwood_safe_transaction(rig, "AC", buf, sizeof(buf), 5);
+
+ if (retval != RIG_OK)
+ {
+ RETURNFUNC(retval);
+ }
+
+ *status = buf[3] != '0' ? 1 : 0;
+ RETURNFUNC(RIG_OK);
+
+ default:
+ return kenwood_get_func(rig, vfo, func, status);
+ }
+
+ RETURNFUNC(RIG_OK);
+}
+
+static int ts590_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
+{
+ struct kenwood_priv_data *priv = rig->state.priv;
+ char levelbuf[16];
+ int kenwood_val;
+ int result;
+
+ rig_debug(RIG_DEBUG_TRACE, "%s called\n", __func__);
+
+ switch (level)
+ {
+ case RIG_LEVEL_RF:
+ kenwood_val = val.f * 255;
+ SNPRINTF(levelbuf, sizeof(levelbuf), "RG%03d", kenwood_val);
+ break;
+
+ case RIG_LEVEL_AF:
+ return kenwood_set_level(rig, vfo, level, val);
+
+ case RIG_LEVEL_SQL:
+ kenwood_val = val.f * 255;
+ SNPRINTF(levelbuf, sizeof(levelbuf), "SQ0%03d", kenwood_val);
+ break;
+
+ case RIG_LEVEL_AGC:
+ /* Possible values for TS-2000 are 0(=off)-020(=slow) */
+
+ switch (val.i)
+ {
+ case RIG_AGC_OFF:
+ kenwood_val = 0;
+ break;
+
+ case RIG_AGC_SUPERFAST:
+ kenwood_val = 1;
+ break;
+
+ case RIG_AGC_FAST:
+ kenwood_val = 5;
+ break;
+
+ case RIG_AGC_MEDIUM:
+ kenwood_val = 10;
+ break;
+
+ case RIG_AGC_SLOW:
+ kenwood_val = 20;
+ break;
+
+ default:
+ rig_debug(RIG_DEBUG_ERR, "%s: unsupported agc value", __func__);
+ return -RIG_EINVAL;
+ }
+
+ SNPRINTF(levelbuf, sizeof(levelbuf), "GT%02d", kenwood_val);
+ break;
+
+ case RIG_LEVEL_MONITOR_GAIN:
+ if (rig->caps->rig_model == RIG_MODEL_TS590S)
+ {
+ kenwood_val = val.f * 9.0f;
+ }
+ else
+ {
+ kenwood_val = val.f * 20.0f;
+ }
+ SNPRINTF(levelbuf, sizeof(levelbuf), "ML%03d", kenwood_val);
+ break;
+
+ case RIG_LEVEL_NB:
+ priv->question_mark_response_means_rejected = 1;
+ kenwood_val = val.f * 10.0;
+ SNPRINTF(levelbuf, sizeof(levelbuf), "NL%03d", kenwood_val);
+ break;
+
+ case RIG_LEVEL_NR:
+ priv->question_mark_response_means_rejected = 1;
+ kenwood_val = val.f * 9.0;
+ SNPRINTF(levelbuf, sizeof(levelbuf), "RL%02d", kenwood_val);
+ break;
+
+ case RIG_LEVEL_PREAMP:
+ if (val.i != 12 && val.i != 0)
+ {
+ RETURNFUNC(-RIG_EINVAL);
+ }
+
+ SNPRINTF(levelbuf, sizeof(levelbuf), "PA%c", (val.i == 12) ? '1' : '0');
+ break;
+
+ case RIG_LEVEL_ATT:
+ if (val.i != 12 && val.i != 0)
+ {
+ RETURNFUNC(-RIG_EINVAL);
+ }
+
+ SNPRINTF(levelbuf, sizeof(levelbuf), "RA%02d", (val.i == 12) ? 1 : 0);
+ break;
+
+ case RIG_LEVEL_METER:
+ switch (val.i)
+ {
+ case RIG_METER_SWR:
+ kenwood_val = 1;
+ break;
+
+ case RIG_METER_COMP:
+ kenwood_val = 2;
+ break;
+
+ case RIG_METER_ALC:
+ kenwood_val = 3;
+ break;
+
+ default:
+ RETURNFUNC(-RIG_EINVAL);
+ }
+
+ SNPRINTF(levelbuf, sizeof(levelbuf), "RM%d", kenwood_val);
+ break;
+
+ case RIG_LEVEL_CWPITCH:
+ if (val.i > 1000 || val.i < 300)
+ {
+ RETURNFUNC(-RIG_EINVAL);
+ }
+
+ RETURNFUNC(ts590_set_ex_menu(rig, 40, 2, (val.i - 300) / 50));
+
+ default:
+ RETURNFUNC(kenwood_set_level(rig, vfo, level, val));
+ }
+
+ result = kenwood_transaction(rig, levelbuf, NULL, 0);
+ priv->question_mark_response_means_rejected = 0;
+
+ RETURNFUNC(result);
+}
+
+static int ts590_read_meters(RIG *rig, int *swr, int *comp, int *alc)
+{
+ int retval;
+ char *cmd = "RM;";
+ struct rig_state *rs = &rig->state;
+ char ackbuf[32];
+ int expected_len = 24;
+
+ ENTERFUNC;
+
+ retval = write_block(&rs->rigport, (unsigned char *) cmd, strlen(cmd));
+
+ rig_debug(RIG_DEBUG_TRACE, "%s: write_block retval=%d\n", __func__, retval);
+
+ if (retval != RIG_OK)
+ {
+ RETURNFUNC(retval);
+ }
+
+ // TS-590 returns values for all meters at the same time, for example: RM10000;RM20000;RM30000;
+
+ retval = read_string(&rs->rigport, (unsigned char *) ackbuf, expected_len + 1,
+ NULL, 0, 0, 1);
+
+ rig_debug(RIG_DEBUG_TRACE, "%s: read_string retval=%d\n", __func__, retval);
+
+ if (retval < 0)
+ {
+ rig_debug(RIG_DEBUG_ERR, "%s: failed to read rig response\n", __func__);
+ RETURNFUNC(retval);
+ }
+
+ if (retval != expected_len)
+ {
+ rig_debug(RIG_DEBUG_ERR, "%s: expected %d bytes, got %d in '%s'\n", __func__,
+ expected_len, retval, ackbuf);
+ RETURNFUNC(-RIG_EPROTO);
+ }
+
+ retval = sscanf(ackbuf, "RM1%d;RM2%d;RM3%d;", swr, comp, alc);
+
+ if (retval != 3)
+ {
+ rig_debug(RIG_DEBUG_ERR,
+ "%s: expected 3 meter values to parse, got %d in '%s'\n", __func__, retval,
+ ackbuf);
+ RETURNFUNC(-RIG_EPROTO);
+ }
+
+ RETURNFUNC(RIG_OK);
+}
+
+static int ts590_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
+{
+ struct kenwood_priv_data *priv = rig->state.priv;
+ char ackbuf[50];
+ size_t ack_len, ack_len_expected;
+ int levelint;
+ int retval;
+
+ ENTERFUNC;
+
+ switch (level)
+ {
+ case RIG_LEVEL_AF:
+ return kenwood_get_level(rig, vfo, level, val);
+
+ case RIG_LEVEL_RF:
+ retval = kenwood_transaction(rig, "RG", ackbuf, sizeof(ackbuf));
+
+ if (RIG_OK != retval)
+ {
+ return retval;
+ }
+
+ ack_len = strlen(ackbuf);
+
+ if (5 != ack_len)
+ {
+ return -RIG_EPROTO;
+ }
+
+ if (1 != sscanf(&ackbuf[2], "%d", &levelint))
+ {
+ return -RIG_EPROTO;
+ }
+
+ val->f = levelint / (float) 255;
+ return RIG_OK;
+
+ case RIG_LEVEL_SQL:
+ retval = kenwood_transaction(rig, "SQ0", ackbuf, sizeof(ackbuf));
+ ack_len_expected = 6;
+
+ if (RIG_OK != retval)
+ {
+ return retval;
+ }
+
+ ack_len = strlen(ackbuf);
+
+ if (ack_len != ack_len_expected)
+ {
+ return -RIG_EPROTO;
+ }
+
+ if (1 != sscanf(&ackbuf[ack_len_expected - 3], "%d", &levelint))
+ {
+ return -RIG_EPROTO;
+ }
+
+ val->f = (float) levelint / 255.;
+ return RIG_OK;
+
+ case RIG_LEVEL_AGC:
+ priv->question_mark_response_means_rejected = 1;
+ retval = kenwood_transaction(rig, "GT", ackbuf, sizeof(ackbuf));
+ priv->question_mark_response_means_rejected = 0;
+ ack_len_expected = 4;
+
+ if (RIG_OK != retval)
+ {
+ return retval;
+ }
+
+ ack_len = strlen(ackbuf);
+
+ if (ack_len != ack_len_expected)
+ {
+ return -RIG_EPROTO;
+ }
+
+ if (1 != sscanf(&ackbuf[ack_len_expected - 2], "%d", &levelint))
+ {
+ return -RIG_EPROTO;
+ }
+
+ if (levelint == 0)
+ {
+ val->i = RIG_AGC_OFF;
+ }
+ else if (levelint <= 1)
+ {
+ val->i = RIG_AGC_SUPERFAST;
+ }
+ else if (levelint <= 5)
+ {
+ val->i = RIG_AGC_FAST;
+ }
+ else if (levelint <= 10)
+ {
+ val->i = RIG_AGC_MEDIUM;
+ }
+ else
+ {
+ val->i = RIG_AGC_SLOW;
+ }
+
+ return RIG_OK;
+
+ case RIG_LEVEL_STRENGTH:
+ if (rig->state.cache.ptt != RIG_PTT_OFF)
+ {
+ val->i = -9 * 6;
+ break;
...
[truncated message content] |
|
From: n0nb <n0...@us...> - 2023-04-10 12:58:21
|
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 6c1d83ed8684c8b3ff806c07e8c465d41c502685 (commit)
via cf77666cc1ca7a8eae96d5700deafc1adc660cc4 (commit)
via c3d06fd043aeab69c4ade5fce1e739f8288a505f (commit)
via 96bb604b1216547e599d06b61f73cb39ae797c17 (commit)
via dd874dbf7f53b09d455afa921af0938ed914bbe8 (commit)
via e5a00cddb9fcbebcf8a41de96a6380f03618d230 (commit)
via 2c283ab47ae99fd404ee1950434465385f00a734 (commit)
from 748b45b91f8216744d9bd38baf882a592c1f804b (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 6c1d83ed8684c8b3ff806c07e8c465d41c502685
Merge: cf77666c 2c283ab4
Author: Michael Black <mdb...@ya...>
Date: Sun Apr 9 22:14:00 2023 -0500
Merge pull request #1269 from ncw/fix-qcx-cw-sending
Fix QRP Labs QCX Morse Sending
commit cf77666cc1ca7a8eae96d5700deafc1adc660cc4
Merge: dd874dbf c3d06fd0
Author: Michael Black <mdb...@ya...>
Date: Sun Apr 9 22:13:42 2023 -0500
Merge pull request #1268 from dforsi/fix/doxygen
Add/fix Doxygen comments
commit c3d06fd043aeab69c4ade5fce1e739f8288a505f
Author: Daniele Forsi IU5HKX <iu...@gm...>
Date: Sat Apr 8 20:31:40 2023 +0200
Add/fix Doxygen comments
diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h
index b263bbfe..c691b46a 100644
--- a/include/hamlib/rig.h
+++ b/include/hamlib/rig.h
@@ -537,7 +537,7 @@ typedef unsigned int vfo_t;
/** \brief \c Macro to tell you if VFO can transmit */
#define RIG_VFO_TX_VFO(v) ((v)|RIG_VFO_TX_FLAG)
-/** \brief \c TX -- alias for split tx or uplink, of VFO_CURR */
+/** \brief \c TX -- alias for split tx or uplink, of VFO_CURR */
#define RIG_VFO_TX RIG_VFO_TX_VFO(RIG_VFO_CURR)
/** \brief \c RX -- alias for split rx or downlink */
diff --git a/include/hamlib/riglist.h b/include/hamlib/riglist.h
index 3c641856..f73e639f 100644
--- a/include/hamlib/riglist.h
+++ b/include/hamlib/riglist.h
@@ -33,6 +33,8 @@
#define RIG_MAKE_MODEL(a,b) ((a)*MAX_MODELS_PER_BACKEND+(b))
#define RIG_BACKEND_NUM(a) ((a)/MAX_MODELS_PER_BACKEND)
+//! @endcond
+
/*! \file riglist.h
* \brief Hamlib rig(radio) model definitions.
*
@@ -49,6 +51,13 @@
* whishes to use. It is done with the rig_init() API call.
*/
+/**
+ * \def RIG_MODEL_NONE
+ * \brief A macro that returns the model number for an unknown model.
+ *
+ * The none backend, as the name suggests, does nothing. It is mainly for
+ * internal use.
+ */
#define RIG_MODEL_NONE 0
/*! \def RIG_MODEL_DUMMY
@@ -62,9 +71,12 @@
* It has also been expanded to provide support to "virtual" type of rigs
* such as the network rig control backend and W1HKJ's Flrig application.
*/
+//! @cond Doxygen_Suppress
#define RIG_DUMMY 0
#define RIG_BACKEND_DUMMY "dummy"
+//! @endcond
#define RIG_MODEL_DUMMY RIG_MAKE_MODEL(RIG_DUMMY, 1)
+//! @cond Doxygen_Suppress
#define RIG_MODEL_NETRIGCTL RIG_MAKE_MODEL(RIG_DUMMY, 2)
#define RIG_MODEL_ARMSTRONG RIG_MAKE_MODEL(RIG_DUMMY, 3)
#define RIG_MODEL_FLRIG RIG_MAKE_MODEL(RIG_DUMMY, 4)
@@ -629,7 +641,6 @@
#define RIG_GOMSPACE 35
#define RIG_BACKEND_GOMSPACE "gomspace"
#define RIG_MODEL_GS100 RIG_MAKE_MODEL(RIG_GOMSPACE, 1)
-//! @endcond
/*
* MDS Microwave Data Systems https://en.wikipedia.org/wiki/Microwave_Data_Systems
@@ -645,6 +656,7 @@
etc.
*/
+//! @endcond
/*! \typedef typedef int rig_model_t
\brief Convenience type definition for rig model.
diff --git a/src/cache.c b/src/cache.c
index cdab9aba..c29fd7b9 100644
--- a/src/cache.c
+++ b/src/cache.c
@@ -26,6 +26,7 @@
#define CHECK_RIG_ARG(r) (!(r) || !(r)->caps || !(r)->state.comm_state)
/**
+ * \file cache.c
* \addtogroup rig
* @{
*/
diff --git a/src/rig.c b/src/rig.c
index 13aeb5fe..8768d9af 100644
--- a/src/rig.c
+++ b/src/rig.c
@@ -5708,7 +5708,7 @@ int HAMLIB_API rig_get_ts(RIG *rig, vfo_t vfo, shortfreq_t *ts)
* \brief set the antenna
* \param rig The rig handle
* \param vfo The target VFO
- * \param ant The anntena to select
+ * \param ant The antenna to select
* \param option An option that the ant command for the rig recognizes
*
* Select the antenna connector.
diff --git a/src/token.h b/src/token.h
index 41bd7ab2..703dc58c 100644
--- a/src/token.h
+++ b/src/token.h
@@ -71,7 +71,7 @@
#define TOK_STOP_BITS TOKEN_FRONTEND(22)
/** \brief Serial parity (format?) */
#define TOK_PARITY TOKEN_FRONTEND(23)
-/** \brief Serial Handshake (format?) */
+/** \brief Serial Handshake (format?) */
#define TOK_HANDSHAKE TOKEN_FRONTEND(24)
/** \brief Serial Req. To Send status */
#define TOK_RTS_STATE TOKEN_FRONTEND(25)
@@ -89,7 +89,7 @@
#define TOK_PTT_BITNUM TOKEN_FRONTEND(34)
/** \brief PTT share with other applications */
#define TOK_PTT_SHARE TOKEN_FRONTEND(35)
-/** \brief PTT share with other applications */
+/** \brief Flush with read instead of TCFLUSH */
#define TOK_FLUSHX TOKEN_FRONTEND(36)
/** \brief Asynchronous data transfer support */
#define TOK_ASYNC TOKEN_FRONTEND(37)
@@ -101,7 +101,7 @@
*/
/* rx_range_list/tx_range_list, filters, announces, has(func,lvl,..) */
-/** \brief rig: ?? */
+/** \brief rig: VFO compensation in ppm */
#define TOK_VFO_COMP TOKEN_FRONTEND(110)
/** \brief rig: Rig state poll interval in milliseconds */
#define TOK_POLL_INTERVAL TOKEN_FRONTEND(111)
@@ -121,11 +121,13 @@
#define TOK_AUTO_DISABLE_SCREENSAVER TOKEN_FRONTEND(126)
/** \brief rig: Disable Yaesu band select logic */
#define TOK_DISABLE_YAESU_BANDSELECT TOKEN_FRONTEND(127)
-/** \brief rig: Supporess get_freq on VFOB for satellite RIT tuning */
+/** \brief rig: Suppress get_freq on VFOB for satellite RIT tuning */
#define TOK_TWIDDLE_TIMEOUT TOKEN_FRONTEND(128)
-/** \brief rig: Supporess get_freq on VFOB for satellite RIT tuning */
+/** \brief rig: Suppress get_freq on VFOB for satellite RIT tuning */
#define TOK_TWIDDLE_RIT TOKEN_FRONTEND(129)
+/** \brief rig: Add Hz to VFOA/Main frequency set */
#define TOK_OFFSET_VFOA TOKEN_FRONTEND(130)
+/** \brief rig: Add Hz to VFOB/Sub frequency set */
#define TOK_OFFSET_VFOB TOKEN_FRONTEND(131)
/*
* rotator specific tokens
commit 96bb604b1216547e599d06b61f73cb39ae797c17
Author: Daniele Forsi IU5HKX <iu...@gm...>
Date: Thu Apr 6 21:21:04 2023 +0200
Fix typos
diff --git a/NEWS b/NEWS
index 1d1c95e3..1556473a 100644
--- a/NEWS
+++ b/NEWS
@@ -21,7 +21,7 @@ Version 4.6
* Add rigctlsync utility to synchronize frequency from a rig to SDR# (or others)
* Add SDR# rig for use with SDR#'s gpredict plugin -- can only get/set freq
* Add Apex Shared Loop rotator -- unidirectional only so far
- * Add client_version to rigctld so client can report it's version for future use/compatility/alternatives
+ * Add client_version to rigctld so client can report it's version for future use/compatibility/alternatives
* Add --set-conf=tuner_control_pathname=hamlib_tuner_control (default)
If file exists then it will be called with 0/1 (Off/On) argument
with 'U TUNER 0' or 'U TUNER 1"
diff --git a/doc/README.man-pages b/doc/README.man-pages
index fe1c62d4..bac868bb 100644
--- a/doc/README.man-pages
+++ b/doc/README.man-pages
@@ -159,7 +159,7 @@ PDF as blocks of constant width text and should be verbatim input or output
in the shell, programs, or blocks of source code.
Text intended to be typed at a shell or program prompt should be in bold and
-program orshell output in normal weight. In some cases it will be necessary
+program or shell output in normal weight. In some cases it will be necessary
to use the "\fB...\fP" font formatting calls especially where backslash
escapes ("\\") are required.
diff --git a/doc/hamlib.cfg.in b/doc/hamlib.cfg.in
index 569c6c14..df115717 100644
--- a/doc/hamlib.cfg.in
+++ b/doc/hamlib.cfg.in
@@ -17,7 +17,7 @@ MAN_EXTENSION = .3
# Set GENERATE_LATEX to YES to generate the needed files for the PDF manual
# and run 'make doc'. Then 'cd latex ; make' to generate the PDF manual.
#
-# See section 1.3.1.2 in @top_srcdir@/README.developer for the needed LaTEX
+# See section 1.3.1.2 in @top_srcdir@/README.developer for the needed LaTeX
# packages.
USE_PDFLATEX = YES
PDF_HYPERLINKS = YES
diff --git a/extra/kylix/README.kylix b/extra/kylix/README.kylix
index 861faef1..926ab389 100644
--- a/extra/kylix/README.kylix
+++ b/extra/kylix/README.kylix
@@ -16,13 +16,13 @@ hamlib_rotapi.pas
HamlibComponents.pas
This file contain two components that encapsulate the rig and rotator
- frontends. It is very simular to the C++ class.
+ frontends. It is very similar to the C++ class.
A simple test program is included in the tests/ directory. It implements
a selection dialog and a very simple Radio Control dialog.
-This binding was develop with Borland Kylix Open Edition Ver 2.0. Open Edition
+This binding was developed with Borland Kylix Open Edition Ver 2.0. Open Edition
is freely downloadable from Borland's website for use with GPL projects.
http://www.borland.com/kylix/
diff --git a/extra/kylix/hamlib_rigapi.pas b/extra/kylix/hamlib_rigapi.pas
index 5d32d7dc..b9cec3ee 100644
--- a/extra/kylix/hamlib_rigapi.pas
+++ b/extra/kylix/hamlib_rigapi.pas
@@ -327,7 +327,7 @@ const
//#define RIG_IS_TOKEN_FRONTEND(t) ((t)&(1<<30))
{*
- * strongly inspired from soundmedem. Thanks Thomas!
+ * strongly inspired from soundmodem. Thanks Thomas!
*}
RIG_CONF_STRING = 0;
RIG_CONF_COMBO = 1;
@@ -472,7 +472,7 @@ type
const
{*
- * tranceive mode, ie. the rig notify the host of any event,
+ * transceive mode, ie. the rig notify the host of any event,
* like freq changed, mode changed, etc.
*}
RIG_TRN_OFF = 0;
diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h
index 842da28d..b263bbfe 100644
--- a/include/hamlib/rig.h
+++ b/include/hamlib/rig.h
@@ -565,7 +565,7 @@ typedef unsigned int vfo_t;
#define RIG_TARGETABLE_ANT (1<<10)
#define RIG_TARGETABLE_ROOFING (1<<11) // roofing filter targetable by VFO
#define RIG_TARGETABLE_SPECTRUM (1<<12) // spectrum scope targetable by VFO
-#define RIG_TARGETABLE_BAND (1<<13) // Band select -- e.g. Yaeus BS command
+#define RIG_TARGETABLE_BAND (1<<13) // Band select -- e.g. Yaesu BS command
#define RIG_TARGETABLE_COMMON (RIG_TARGETABLE_RITXIT | RIG_TARGETABLE_PTT | RIG_TARGETABLE_MEM | RIG_TARGETABLE_BANK)
#define RIG_TARGETABLE_ALL 0x7fffffff
//! @endcond
@@ -779,7 +779,7 @@ typedef long token_t;
*
* Current internal implementation
* NUMERIC: val.f or val.i
- * COMBO: val.i, starting from 0. Points to a table of strings or asci stored values.
+ * COMBO: val.i, starting from 0. Points to a table of strings or ASCII stored values.
* STRING: val.s or val.cs
* CHECKBUTTON: val.i 0/1
* BINARY: val.b
@@ -2586,7 +2586,7 @@ struct rig_state {
int lock_mode; /*!< flag that prevents mode changes if ~= 0 -- see set/get_lock_mode */
powerstat_t powerstat; /*!< power status */
char *tuner_control_pathname; /*!< Path to external tuner control program that get 0/1 (Off/On) argument */
- char client_version[32]; /*!<! Allow client to report version for compatility checks/capability */
+ char client_version[32]; /*!<! Allow client to report version for compatibility checks/capability */
freq_t offset_vfoa; /*!< Offset to apply to VFOA/Main set_freq */
freq_t offset_vfob; /*!< Offset to apply to VFOB/Sub set_freq */
};
diff --git a/rigs/jrc/jst145.c b/rigs/jrc/jst145.c
index 49874da2..95eaeca8 100644
--- a/rigs/jrc/jst145.c
+++ b/rigs/jrc/jst145.c
@@ -506,7 +506,7 @@ static int jst145_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
if (retval != RIG_OK)
{
- rig_debug(RIG_DEBUG_ERR, "%s: jrc_transcation failed: %s\n", __func__,
+ rig_debug(RIG_DEBUG_ERR, "%s: jrc_transaction failed: %s\n", __func__,
rigerror(retval));
}
diff --git a/rigs/uniden/uniden_digital.c b/rigs/uniden/uniden_digital.c
index d72d0293..a9d752c2 100644
--- a/rigs/uniden/uniden_digital.c
+++ b/rigs/uniden/uniden_digital.c
@@ -46,7 +46,7 @@
* use the address returned from one of the commands. If you decide
* the latter method, the order is slightly confusing but, I have it
* well documented within DSctl. The latter method is also as much
- * as 30% faster then using the Uniden software or "Get Next
+ * as 30% faster than using the Uniden software or "Get Next
* Location" command.
*/
diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c
index 601db0c6..eb206647 100644
--- a/rigs/yaesu/newcat.c
+++ b/rigs/yaesu/newcat.c
@@ -3536,7 +3536,7 @@ int newcat_set_powerstat(RIG *rig, powerstat_t status)
ENTERFUNC;
-#if 0 // all Yaeus rigs have PS and calling this here interferes with power on
+#if 0 // all Yaesu rigs have PS and calling this here interferes with power on
if (!newcat_valid_command(rig, "PS"))
{
@@ -7809,7 +7809,7 @@ int newcat_set_tx_vfo(RIG *rig, vfo_t tx_vfo)
if (is_ftdx101d || is_ftdx101mp)
{
- // what other Yaeus rigs should be using this?
+ // what other Yaesu rigs should be using this?
// The DX101D returns FT0 when in split and not transmitting
command = "ST";
}
@@ -7840,7 +7840,7 @@ int newcat_get_tx_vfo(RIG *rig, vfo_t *tx_vfo)
if (is_ftdx101d || is_ftdx101mp)
{
- // what other Yaeus rigs should be using this?
+ // what other Yaesu rigs should be using this?
// The DX101D returns FT0 when in split and not transmitting
command = "ST";
}
@@ -10897,7 +10897,7 @@ int newcat_set_cmd_validate(RIG *rig)
{
// for the BS command we can only run it once
// so we'll assume it worked
- // maybe Yaeus will make this command more intelligent
+ // maybe Yaesu will make this command more intelligent
if (strstr(priv->cmd_str, "BS")) { RETURNFUNC(RIG_OK); }
// if the first two chars match we are validated
diff --git a/src/amplifier.c b/src/amplifier.c
index 0dccadb3..c0f16494 100644
--- a/src/amplifier.c
+++ b/src/amplifier.c
@@ -132,7 +132,7 @@ static int remove_opened_amp(const AMP *amp)
#ifdef XXREMOVEDXX
/**
- * \brief Executess cfunc() on each #AMP handle.
+ * \brief Executes cfunc() on each #AMP handle.
*
* \param cfunc The function to be executed on each #AMP handle.
* \param data Data pointer to be passed to cfunc()
diff --git a/src/rig.c b/src/rig.c
index d08616e4..13aeb5fe 100644
--- a/src/rig.c
+++ b/src/rig.c
@@ -843,7 +843,7 @@ int HAMLIB_API rig_open(RIG *rig)
RETURNFUNC(-RIG_EINVAL);
}
- // rigctl/rigctld may have deprecated values -- backwards compatility
+ // rigctl/rigctld may have deprecated values -- backwards compatibility
if (rs->rigport_deprecated.pathname[0] != 0)
{
strcpy(rs->rigport.pathname, rs->rigport_deprecated.pathname);
@@ -4540,10 +4540,10 @@ int HAMLIB_API rig_set_split_mode(RIG *rig,
__LINE__, rig_strvfo(tx_vfo), rig_strrmode(tx_mode));
}
- // code below here should be dead code now -- but maybe we have VFO situatiuon we need to handle
+ // code below here should be dead code now -- but maybe we have VFO situation we need to handle
if (caps->rig_model == RIG_MODEL_NETRIGCTL)
{
- // special handlingt for netrigctl to avoid set_vfo
+ // special handling for netrigctl to avoid set_vfo
retcode = caps->set_split_mode(rig, vfo, tx_mode, tx_width);
ELAPSED2;
RETURNFUNC(retcode);
@@ -4830,7 +4830,7 @@ int HAMLIB_API rig_set_split_freq_mode(RIG *rig,
HAMLIB_TRACE;
retcode = caps->set_split_freq_mode(rig, vfo, tx_freq, tx_mode, tx_width);
-#if 0 // this verification seems to be causing bad behavior on some reigs
+#if 0 // this verification seems to be causing bad behavior on some rigs
// we query freq after set to ensure it really gets done
do
@@ -7456,7 +7456,7 @@ int HAMLIB_API rig_cookie(RIG *rig, enum cookie_e cookie_cmd, char *cookie,
date_strget(cookie, cookie_len, 0);
size_t len = strlen(cookie);
// add on our random number to ensure uniqueness
- // The cookie should never be longer then HAMLIB_COOKIE_SIZE
+ // The cookie should never be longer than HAMLIB_COOKIE_SIZE
SNPRINTF(cookie + len, HAMLIB_COOKIE_SIZE - len, " %d\n", rand());
strcpy(cookie_save, cookie);
time_last_used = time_curr;
diff --git a/tests/ampctl_parse.c b/tests/ampctl_parse.c
index 73ae8023..55d2137a 100644
--- a/tests/ampctl_parse.c
+++ b/tests/ampctl_parse.c
@@ -868,7 +868,7 @@ int ampctl_parse(AMP *my_amp, FILE *fin, FILE *fout, char *argv[], int argc)
rp_getline("\nAmplifier command: ");
- /* EOF (Ctl-D) received on empty input line, bail out gracefully. */
+ /* EOF (Ctrl-D) received on empty input line, bail out gracefully. */
if (!input_line)
{
fprintf_flush(fout, "\n");
@@ -952,7 +952,7 @@ int ampctl_parse(AMP *my_amp, FILE *fin, FILE *fout, char *argv[], int argc)
char cmd_name[MAXNAMSIZ];
/* if there is no terminating '\0' character in the source string,
- * srncpy() doesn't add one even if the supplied length is less
+ * strncpy() doesn't add one even if the supplied length is less
* than the destination array. Truncate the source string here.
*/
if (strlen(parsed_input[0] + 1) >= MAXNAMSIZ)
diff --git a/tests/testcookie.c b/tests/testcookie.c
index 5108e179..10625480 100644
--- a/tests/testcookie.c
+++ b/tests/testcookie.c
@@ -28,9 +28,9 @@ static int test1()
else {printf("Test#1c Failed\n"); return 1;}
#if 0
- // after 1 second we should be able to get a coookie
+ // after 1 second we should be able to get a cookie
// this means the cookie holder did not renew within 1 second
- hl_usleep(1500 * 1000); // after 1 second we should be able to get a coookie
+ hl_usleep(1500 * 1000); // after 1 second we should be able to get a cookie
retcode = rig_cookie(NULL, RIG_COOKIE_GET, cookie2, sizeof(cookie2));
@@ -91,7 +91,7 @@ static int test3_invalid_input()
char cookie[HAMLIB_COOKIE_SIZE];
int n = 0;
- /* Make sure any value smaller then HAMLIB_COOKIE_SIZE is rejected */
+ /* Make sure any value smaller than HAMLIB_COOKIE_SIZE is rejected */
for (unsigned int i = 0; i < HAMLIB_COOKIE_SIZE; i++)
{
retcode = rig_cookie(NULL, RIG_COOKIE_GET, cookie, i);
commit dd874dbf7f53b09d455afa921af0938ed914bbe8
Merge: e5a00cdd 748b45b9
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sun Apr 9 08:30:44 2023 -0500
Merge branch 'master' of https://github.com/Hamlib/Hamlib
commit e5a00cddb9fcbebcf8a41de96a6380f03618d230
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sun Apr 9 08:29:48 2023 -0500
Fix case where netrigctl gets a 0 answer to chk_vfo
https://github.com/Hamlib/Hamlib/issues/1266
diff --git a/rigs/dummy/netrigctl.c b/rigs/dummy/netrigctl.c
index 8e7613ae..da181e8f 100644
--- a/rigs/dummy/netrigctl.c
+++ b/rigs/dummy/netrigctl.c
@@ -265,7 +265,7 @@ static int netrigctl_open(RIG *rig)
if (sscanf(buf, "CHKVFO %d", &priv->rigctld_vfo_mode) == 1)
{
- rig->state.vfo_opt = 1;
+ rig->state.vfo_opt = priv->rigctld_vfo_mode;
rig_debug(RIG_DEBUG_TRACE, "%s: chkvfo=%d\n", __func__, priv->rigctld_vfo_mode);
}
else if (ret == 2)
@@ -2732,7 +2732,7 @@ struct rig_caps netrigctl_caps =
RIG_MODEL(RIG_MODEL_NETRIGCTL),
.model_name = "NET rigctl",
.mfg_name = "Hamlib",
- .version = "20230328.0",
+ .version = "20204009.0",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_OTHER,
commit 2c283ab47ae99fd404ee1950434465385f00a734
Author: Nick Craig-Wood <ni...@cr...>
Date: Sun Apr 9 14:00:25 2023 +0100
Fix QRP Labs QCX Morse Sending
Before this fix, hamlib used the TS480 protocol for sending morse
which adds a lot of spaces on the end.
The QCX actually uses the Elecraft morse sending protocol so switch it
over to using that.
Tested with QCX Mini firmware v1.09a
diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c
index 8cc758f8..2f5b0c81 100644
--- a/rigs/kenwood/kenwood.c
+++ b/rigs/kenwood/kenwood.c
@@ -5196,6 +5196,7 @@ int kenwood_send_morse(RIG *rig, vfo_t vfo, const char *msg)
case RIG_MODEL_K3S:
case RIG_MODEL_KX2:
case RIG_MODEL_KX3:
+ case RIG_MODEL_QRPLABS:
SNPRINTF(morsebuf, sizeof(morsebuf), "KY %s", m2);
break;
-----------------------------------------------------------------------
Summary of changes:
NEWS | 2 +-
doc/README.man-pages | 2 +-
doc/hamlib.cfg.in | 2 +-
extra/kylix/README.kylix | 4 ++--
extra/kylix/hamlib_rigapi.pas | 4 ++--
include/hamlib/rig.h | 8 ++++----
include/hamlib/riglist.h | 14 +++++++++++++-
rigs/dummy/netrigctl.c | 4 ++--
rigs/jrc/jst145.c | 2 +-
rigs/kenwood/kenwood.c | 1 +
rigs/uniden/uniden_digital.c | 2 +-
rigs/yaesu/newcat.c | 8 ++++----
src/amplifier.c | 2 +-
src/cache.c | 1 +
src/rig.c | 12 ++++++------
src/token.h | 12 +++++++-----
tests/ampctl_parse.c | 4 ++--
tests/testcookie.c | 6 +++---
18 files changed, 53 insertions(+), 37 deletions(-)
hooks/post-receive
--
Hamlib -- Ham radio control libraries
|
|
From: n0nb <n0...@us...> - 2023-04-05 21:53:38
|
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 748b45b91f8216744d9bd38baf882a592c1f804b (commit)
via 22970f16de01a30792ecd3041e55ce34bc164d5d (commit)
from 99170c10259dbe0b4903ce6ce3d47bac623769de (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 748b45b91f8216744d9bd38baf882a592c1f804b
Author: Nate Bargmann <n0...@n0...>
Date: Wed Apr 5 16:52:56 2023 -0500
Update recent dates in NEWS
diff --git a/NEWS b/NEWS
index d407df76..1d1c95e3 100644
--- a/NEWS
+++ b/NEWS
@@ -1,8 +1,8 @@
Hamlib -- History of visible changes.
Copyright (C) 2000-2003 Frank Singleton
-Copyright (C) 2000-2021 Stephane Fillod, and others
-Copyright (C) 2000-2021 Michael Black W9MDB, and others
+Copyright (C) 2000-2023 Stephane Fillod, and others
+Copyright (C) 2000-2023 Michael Black W9MDB, and others
Please send Hamlib bug reports to ham...@li...
@@ -31,6 +31,7 @@ Version 4.6
* Fix FTDX3000 rig split
Version 4.5.5
+ * 2023-04-05
* Add park to rotorez.c
* Fix rig power on/off from rigctl cmd line and rigctld
* Enable async mode by default to prevent WSJT-X crash on IC9700 with transceive on
@@ -66,7 +67,7 @@ Version 4.5.5
* Fix power on/off/on for Icom rigs with rigctld power_on=0
Version 4.5.4
- * 2023-XX-XX
+ * 2023-01-10
* Fix CM108 ptt setting for non-default usage
* Fix power on/off for Icom rigs with rigctld power_on=0
* Fix get_powerstat status return for non-PS kenwood rigs
commit 22970f16de01a30792ecd3041e55ce34bc164d5d
Author: Mike Black W9MDB <mdb...@ya...>
Date: Wed Apr 5 10:30:20 2023 -0500
Fix Serial speed information in dumpcaps
diff --git a/tests/dumpcaps.c b/tests/dumpcaps.c
index 32d26514..ae687443 100644
--- a/tests/dumpcaps.c
+++ b/tests/dumpcaps.c
@@ -191,7 +191,7 @@ int dumpcaps(RIG *rig, FILE *fout)
case RIG_PORT_SERIAL:
fprintf(fout, "RS-232\n");
fprintf(fout,
- "Serial speed: %d..%d bauds, %d%c%d %s\n",
+ "Serial speed: %d..%d baud, %d%c%d, ctrl=%s\n",
caps->serial_rate_min,
caps->serial_rate_max,
caps->serial_data_bits,
@@ -200,7 +200,7 @@ int dumpcaps(RIG *rig, FILE *fout)
caps->serial_parity == RIG_PARITY_EVEN ? 'E' :
caps->serial_parity == RIG_PARITY_MARK ? 'M' : 'S',
caps->serial_stop_bits,
- caps->serial_handshake == RIG_HANDSHAKE_NONE ? "" :
+ caps->serial_handshake == RIG_HANDSHAKE_NONE ? "NONE" :
(caps->serial_handshake == RIG_HANDSHAKE_XONXOFF ? "XONXOFF" : "CTS/RTS")
);
break;
diff --git a/tests/dumpcaps_amp.c b/tests/dumpcaps_amp.c
index 8a45e998..39d16f9b 100644
--- a/tests/dumpcaps_amp.c
+++ b/tests/dumpcaps_amp.c
@@ -70,7 +70,7 @@ int dumpcaps_amp(AMP *amp, FILE *fout)
case RIG_PORT_SERIAL:
fprintf(fout, "RS-232\n");
fprintf(fout,
- "Serial speed:\t\t%d..%d bauds, %d%c%d%s\n",
+ "Serial speed:\t\t%d..%d baud, %d%c%d, ctrl=%s\n",
caps->serial_rate_min,
caps->serial_rate_max,
caps->serial_data_bits,
@@ -79,8 +79,8 @@ int dumpcaps_amp(AMP *amp, FILE *fout)
caps->serial_parity == RIG_PARITY_EVEN ? 'E' :
caps->serial_parity == RIG_PARITY_MARK ? 'M' : 'S',
caps->serial_stop_bits,
- caps->serial_handshake == RIG_HANDSHAKE_NONE ? "" :
- (caps->serial_handshake == RIG_HANDSHAKE_XONXOFF ? " XONXOFF" : " CTS/RTS")
+ caps->serial_handshake == RIG_HANDSHAKE_NONE ? "NONE" :
+ (caps->serial_handshake == RIG_HANDSHAKE_XONXOFF ? "XONXOFF" : "CTS/RTS")
);
break;
diff --git a/tests/dumpcaps_rot.c b/tests/dumpcaps_rot.c
index 5868d3c5..8f4e0db9 100644
--- a/tests/dumpcaps_rot.c
+++ b/tests/dumpcaps_rot.c
@@ -88,7 +88,7 @@ int dumpcaps_rot(ROT *rot, FILE *fout)
case RIG_PORT_SERIAL:
fprintf(fout, "RS-232\n");
fprintf(fout,
- "Serial speed:\t\t%d..%d bauds, %d%c%d%s\n",
+ "Serial speed:\t\t%d..%d bauds, %d%c%d, ctrl=%s\n",
caps->serial_rate_min,
caps->serial_rate_max,
caps->serial_data_bits,
@@ -97,8 +97,8 @@ int dumpcaps_rot(ROT *rot, FILE *fout)
caps->serial_parity == RIG_PARITY_EVEN ? 'E' :
caps->serial_parity == RIG_PARITY_MARK ? 'M' : 'S',
caps->serial_stop_bits,
- caps->serial_handshake == RIG_HANDSHAKE_NONE ? "" :
- (caps->serial_handshake == RIG_HANDSHAKE_XONXOFF ? " XONXOFF" : " CTS/RTS")
+ caps->serial_handshake == RIG_HANDSHAKE_NONE ? "NONE" :
+ (caps->serial_handshake == RIG_HANDSHAKE_XONXOFF ? "XONXOFF" : "CTS/RTS")
);
break;
-----------------------------------------------------------------------
Summary of changes:
NEWS | 7 ++++---
tests/dumpcaps.c | 4 ++--
tests/dumpcaps_amp.c | 6 +++---
tests/dumpcaps_rot.c | 6 +++---
4 files changed, 12 insertions(+), 11 deletions(-)
hooks/post-receive
--
Hamlib -- Ham radio control libraries
|
|
From: n0nb <n0...@us...> - 2023-04-05 11:56:23
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Hamlib -- Ham radio control libraries".
The annotated tag, 4.5.5 has been created
at 413be5a4cfd32455eefe6a6ad2a2b150e6926e9f (tag)
tagging 6eecd3d0160278373875e16b77299881ff656068 (commit)
replaces 4.5.4
tagged by Nate Bargmann
on Wed Apr 5 06:53:51 2023 -0500
- Log -----------------------------------------------------------------
Hamlib 4.5.5 release
-----BEGIN PGP SIGNATURE-----
iF0EABECAB0WIQSC1k9rDmfNQfaJu6b7LFEw1VqIGQUCZC1haQAKCRD7LFEw1VqI
GWzyAJ9nca17n8EFSA/MEAx5bfNE+sEbFQCfal/fLkRcBHcl2z6coiP3Ct/emG0=
=Zk0N
-----END PGP SIGNATURE-----
Michael Black (2):
Merge pull request #1245 from mikaelnousiainen/icom-async-fixes
Merge pull request #1244 from mikaelnousiainen/ts2000-fixes
Mikael Nousiainen (1):
Disable rig port flushing when async I/O is enabled. Improve validation of Icom frames.
Mike Black W9MDB (62):
Fix BSD build include path https://github.com/Hamlib/Hamlib/issues/1208
Fix get_powerstat call when get_powerstat is not defined https://github.com/Hamlib/Hamlib/issues/1217
Add FT991 to 60M exception
Update NEWS
Add TS-2000 to has_ps exceptions https://github.com/Hamlib/Hamlib/issues/1213
Change FTDX10 handshake to None instead of Hardware
Update NEWS
Fix AGC level display in rigctld https://github.com/Hamlib/Hamlib/issues/1155
Show AGC Level None when there are no AGC settings for rig https://github.com/Hamlib/Hamlib/issues/1155
Improve powerstat on/off behavior for Icom rigs https://github.com/Hamlib/Hamlib/issues/1212
Make auto_power_on a bit more robust for RigPI which seems slow to get going https://github.com/Hamlib/Hamlib/issues/1212
Remove one sleep from set_powerstat loop https://github.com/Hamlib/Hamlib/issues/1212
Allow get_powerstat when rig is powered off https://github.com/Hamlib/Hamlib/issues/1220
Fix icom.h
Fix K3/K3S VFOB mode/bandwidth setting https://github.com/Hamlib/Hamlib/issues/1224
Update NEWS
ERemove EX103 get/set for FTDX5000
Update NEWS
Change QRP QRDX PTT to use TQ instead TX...more incompability with TS-480 standard
Update NEWS
Some updates to fix rc2800 operations https://github.com/Hamlib/Hamlib/commit/be72027f9a3c54b2ac086d3aca456edd503d7ecf
Update NEWS
Ensure K4 is in K40 mode when requesting ID
Update NEWS
Change TM-D700 and TM-D710 to hardware flow control https://github.com/Hamlib/Hamlib/issues/1228
Fix VFO A/B swapping for gpredict -- hopefully better behavior for VFO swapping rigs Should avoid setting RX freq while TX and avoid TX freq while RX https://github.com/Hamlib/Hamlib/issues/1230
Fix FT-450D detection
Fix AF level control for FTDX10 and FT710 https://github.com/Hamlib/Hamlib/issues/1231
Allo FT-857 to return cached vfo when set_vfo is called and EEPROM read error occurs https://github.com/Hamlib/Hamlib/issues/1232
Improve FT-857 get_vfo response when error occurs This could be FT-857 EEPROM burnout https://github.com/Hamlib/Hamlib/issues/1232
Add fix for TMD700 https://github.com/Hamlib/Hamlib/issues/1230
Some fixes for th.c operation https://github.com/Hamlib/Hamlib/issues/1230
Add attenuator level control for TS890 Update SMeter/SWR tables for TS890 Thanks to N3GB George Baltz
Increase post_write to 20ms for FT710 https://github.com/Hamlib/Hamlib/issues/1235
Separate the validation cmd in newcat.c to allow rig post_write_delay to be in effect https://github.com/Hamlib/Hamlib/issues/1219
Update NEWS
Win4Yaesu is not recognizing EX commands so we ignore errors on the EX command for some Yaeus rigs
Update NEWS
Move semicolon removal after complete string is read. xg3 was expecting single ; response and old way was causing timeouts
Add tcflush back into flush routine https://github.com/Hamlib/Hamlib/issues/1241
Fix xg3 set_freq
Align xg3 with kenwood_priv and remove set/get mem for xg3 for now
Re-enable set/get mem for xg3
Fix set_freq in jst145.c
Fix set_vfo in jst145.c
Update NEWS
Update NEWS
Fix spelling error in rotctl.c help and add offset settings to rotctl.1
Fix Gemini DX1200 gemini_set_level function
Update NEWS
For K3 prevent ID; command from K22; command Remote ops was having a problem with K22; https://github.com/Hamlib/Hamlib/issues/1254
Update NEWS
Fix IC-7160 get_powerstat to disable it...cannot read power status from 7610
Update NEWS
Enable async by default -- this prevents WSJT-X from crashing when transceive mode is on for the IC9700 https://github.com/Hamlib/Hamlib/issues/1264
Fix rigctld get_powerstat https://github.com/Hamlib/Hamlib/issues/1220
Fix PS0; command in newcat.c https://github.com/Hamlib/Hamlib/issues/1220
Fix auto_power_on from rigctl invocation with --set-conf=auto_power_on=1 https://github.com/Hamlib/Hamlib/issues/1220
Update NEWS
Add error message when rig is not turned on that mentions auto_power_on
Add simid5100.c
Fix bootstrap problems
Nate Bargmann (1):
Update NEWS for 4.5.5 release
-----------------------------------------------------------------------
hooks/post-receive
--
Hamlib -- Ham radio control libraries
|
|
From: n0nb <n0...@us...> - 2023-04-05 11:53:20
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Hamlib -- Ham radio control libraries".
The annotated tag, 4.5.5 has been deleted
was abb1914db02e2702da020c0ea0b4bb1163b87193
- Log -----------------------------------------------------------------
6eecd3d0160278373875e16b77299881ff656068 Update NEWS for 4.5.5 release
-----------------------------------------------------------------------
hooks/post-receive
--
Hamlib -- Ham radio control libraries
|
|
From: n0nb <n0...@us...> - 2023-04-05 11:48:07
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Hamlib -- Ham radio control libraries".
The annotated tag, 4.5.5 has been created
at abb1914db02e2702da020c0ea0b4bb1163b87193 (tag)
tagging 6eecd3d0160278373875e16b77299881ff656068 (commit)
replaces 4.5.4
tagged by Nate Bargmann
on Wed Apr 5 06:45:48 2023 -0500
- Log -----------------------------------------------------------------
4.5.5
Hamlib 4.5.5 release
-----BEGIN PGP SIGNATURE-----
iF0EABECAB0WIQSC1k9rDmfNQfaJu6b7LFEw1VqIGQUCZC1fxgAKCRD7LFEw1VqI
GVWWAJ9n9zKFPUYB/CJXIEZTcwPh59weYQCgpywExdwdzylFukHEDwW7NLrtbuI=
=nABw
-----END PGP SIGNATURE-----
Michael Black (2):
Merge pull request #1245 from mikaelnousiainen/icom-async-fixes
Merge pull request #1244 from mikaelnousiainen/ts2000-fixes
Mikael Nousiainen (1):
Disable rig port flushing when async I/O is enabled. Improve validation of Icom frames.
Mike Black W9MDB (62):
Fix BSD build include path https://github.com/Hamlib/Hamlib/issues/1208
Fix get_powerstat call when get_powerstat is not defined https://github.com/Hamlib/Hamlib/issues/1217
Add FT991 to 60M exception
Update NEWS
Add TS-2000 to has_ps exceptions https://github.com/Hamlib/Hamlib/issues/1213
Change FTDX10 handshake to None instead of Hardware
Update NEWS
Fix AGC level display in rigctld https://github.com/Hamlib/Hamlib/issues/1155
Show AGC Level None when there are no AGC settings for rig https://github.com/Hamlib/Hamlib/issues/1155
Improve powerstat on/off behavior for Icom rigs https://github.com/Hamlib/Hamlib/issues/1212
Make auto_power_on a bit more robust for RigPI which seems slow to get going https://github.com/Hamlib/Hamlib/issues/1212
Remove one sleep from set_powerstat loop https://github.com/Hamlib/Hamlib/issues/1212
Allow get_powerstat when rig is powered off https://github.com/Hamlib/Hamlib/issues/1220
Fix icom.h
Fix K3/K3S VFOB mode/bandwidth setting https://github.com/Hamlib/Hamlib/issues/1224
Update NEWS
ERemove EX103 get/set for FTDX5000
Update NEWS
Change QRP QRDX PTT to use TQ instead TX...more incompability with TS-480 standard
Update NEWS
Some updates to fix rc2800 operations https://github.com/Hamlib/Hamlib/commit/be72027f9a3c54b2ac086d3aca456edd503d7ecf
Update NEWS
Ensure K4 is in K40 mode when requesting ID
Update NEWS
Change TM-D700 and TM-D710 to hardware flow control https://github.com/Hamlib/Hamlib/issues/1228
Fix VFO A/B swapping for gpredict -- hopefully better behavior for VFO swapping rigs Should avoid setting RX freq while TX and avoid TX freq while RX https://github.com/Hamlib/Hamlib/issues/1230
Fix FT-450D detection
Fix AF level control for FTDX10 and FT710 https://github.com/Hamlib/Hamlib/issues/1231
Allo FT-857 to return cached vfo when set_vfo is called and EEPROM read error occurs https://github.com/Hamlib/Hamlib/issues/1232
Improve FT-857 get_vfo response when error occurs This could be FT-857 EEPROM burnout https://github.com/Hamlib/Hamlib/issues/1232
Add fix for TMD700 https://github.com/Hamlib/Hamlib/issues/1230
Some fixes for th.c operation https://github.com/Hamlib/Hamlib/issues/1230
Add attenuator level control for TS890 Update SMeter/SWR tables for TS890 Thanks to N3GB George Baltz
Increase post_write to 20ms for FT710 https://github.com/Hamlib/Hamlib/issues/1235
Separate the validation cmd in newcat.c to allow rig post_write_delay to be in effect https://github.com/Hamlib/Hamlib/issues/1219
Update NEWS
Win4Yaesu is not recognizing EX commands so we ignore errors on the EX command for some Yaeus rigs
Update NEWS
Move semicolon removal after complete string is read. xg3 was expecting single ; response and old way was causing timeouts
Add tcflush back into flush routine https://github.com/Hamlib/Hamlib/issues/1241
Fix xg3 set_freq
Align xg3 with kenwood_priv and remove set/get mem for xg3 for now
Re-enable set/get mem for xg3
Fix set_freq in jst145.c
Fix set_vfo in jst145.c
Update NEWS
Update NEWS
Fix spelling error in rotctl.c help and add offset settings to rotctl.1
Fix Gemini DX1200 gemini_set_level function
Update NEWS
For K3 prevent ID; command from K22; command Remote ops was having a problem with K22; https://github.com/Hamlib/Hamlib/issues/1254
Update NEWS
Fix IC-7160 get_powerstat to disable it...cannot read power status from 7610
Update NEWS
Enable async by default -- this prevents WSJT-X from crashing when transceive mode is on for the IC9700 https://github.com/Hamlib/Hamlib/issues/1264
Fix rigctld get_powerstat https://github.com/Hamlib/Hamlib/issues/1220
Fix PS0; command in newcat.c https://github.com/Hamlib/Hamlib/issues/1220
Fix auto_power_on from rigctl invocation with --set-conf=auto_power_on=1 https://github.com/Hamlib/Hamlib/issues/1220
Update NEWS
Add error message when rig is not turned on that mentions auto_power_on
Add simid5100.c
Fix bootstrap problems
Nate Bargmann (1):
Update NEWS for 4.5.5 release
-----------------------------------------------------------------------
hooks/post-receive
--
Hamlib -- Ham radio control libraries
|
|
From: n0nb <n0...@us...> - 2023-04-05 11:44:34
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Hamlib -- Ham radio control libraries".
The branch, Hamlib-4.5.5 has been updated
via 6eecd3d0160278373875e16b77299881ff656068 (commit)
via e5210bec1545472ef924c8fb8f21a550c6b6be3d (commit)
via ad140cbac217ea346ebbe8042ecf67b1bbca08d7 (commit)
from 9bf8066b836399507e0ae5cbed3f6c07a16de938 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 6eecd3d0160278373875e16b77299881ff656068
Author: Nate Bargmann <n0...@n0...>
Date: Wed Apr 5 06:43:08 2023 -0500
Update NEWS for 4.5.5 release
diff --git a/NEWS b/NEWS
index 73af32a6..8b13ec30 100644
--- a/NEWS
+++ b/NEWS
@@ -1,36 +1,14 @@
Hamlib -- History of visible changes.
Copyright (C) 2000-2003 Frank Singleton
-Copyright (C) 2000-2021 Stephane Fillod, and others
-Copyright (C) 2000-2021 Michael Black W9MDB, and others
+Copyright (C) 2000-2023 Stephane Fillod, and others
+Copyright (C) 2000-2023 Michael Black W9MDB, and others
Please send Hamlib bug reports to ham...@li...
-Version 5.x -- future
- * rig_get_conf deprecated and replaced by rig_get_conf2
- * rot_get_conf deprecated and replaced by rot_get_conf2
- * Change FT1000MP Mark V model names to align with FT1000MP
-
-Version 4.6
- * Add saebrtrack rotor https://sites.google.com/site/marklhammond/saebrtrack
- * Add offset_vfoa and offset_vfob applying to rig_set_freq
- * Fix K4 to put it in K40 mode when requesting ID
- * 2023-11-XX -- Planned for Nov 2023
- * Fixes for M2 Rotors
- * Add rigctlsync utility to synchronize frequency from a rig to SDR# (or others)
- * Add SDR# rig for use with SDR#'s gpredict plugin -- can only get/set freq
- * Add Apex Shared Loop rotator -- unidirectional only so far
- * Add client_version to rigctld so client can report it's version for future use/compatility/alternatives
- * Add --set-conf=tuner_control_pathname=hamlib_tuner_control (default)
- If file exists then it will be called with 0/1 (Off/On) argument
- with 'U TUNER 0' or 'U TUNER 1"
- Default path is for current directory
- * Add MDS 4710/9710 rigs
- * Add FLIR PTU-D48, E46, D100, D300 rotors
- * Fix FTDX3000 rig split
-
Version 4.5.5
+ * 2023-04-05
* Add park to rotorez.c
* Fix rig power on/off from rigctl cmd line and rigctld
* Enable async mode by default to prevent WSJT-X crash on IC9700 with transceive on
@@ -66,7 +44,7 @@ Version 4.5.5
* Fix power on/off/on for Icom rigs with rigctld power_on=0
Version 4.5.4
- * 2023-XX-XX
+ * 2023-01-10
* Fix CM108 ptt setting for non-default usage
* Fix power on/off for Icom rigs with rigctld power_on=0
* Fix get_powerstat status return for non-PS kenwood rigs
commit e5210bec1545472ef924c8fb8f21a550c6b6be3d
Author: Mike Black W9MDB <mdb...@ya...>
Date: Tue Apr 4 22:13:16 2023 -0500
Fix bootstrap problems
diff --git a/simulators/Makefile.am b/simulators/Makefile.am
index eebddedd..3e2d7c04 100644
--- a/simulators/Makefile.am
+++ b/simulators/Makefile.am
@@ -8,7 +8,7 @@ DISTCLEANFILES =
bin_PROGRAMS =
-check_PROGRAMS = simelecraft simicom simkenwood simyaesu simicom9700 simft991 simftdx1200 simftdx3000 simjupiter simpowersdr
+check_PROGRAMS = simelecraft simicom simkenwood simyaesu simicom9700 simft991 simftdx1200 simftdx3000 simjupiter simpowersdr simid5100
simelecraft_SOURCES = simelecraft.c
simicom_SOURCES = simicom.c
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 828f5efc..69cd60be 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -26,7 +26,6 @@ AMPCOMMONSRC = ampctl_parse.c ampctl_parse.h dumpcaps_amp.c uthash.h
rigctl_SOURCES = rigctl.c $(RIGCOMMONSRC)
rigctld_SOURCES = rigctld.c $(RIGCOMMONSRC)
rigctlcom_SOURCES = rigctlcom.c $(RIGCOMMONSRC)
-rigctltcp_SOURCES = rigctltcp.c $(RIGCOMMONSRC)
rotctl_SOURCES = rotctl.c $(ROTCOMMONSRC)
rotctld_SOURCES = rotctld.c $(ROTCOMMONSRC)
ampctl_SOURCES = ampctl.c $(AMPCOMMONSRC)
@@ -51,7 +50,6 @@ rotctld_CFLAGS = $(AM_CFLAGS) $(PTHREAD_CFLAGS) -I$(top_builddir)/src
ampctl_CFLAGS = $(AM_CFLAGS) $(PTHREAD_CFLAGS) -I$(top_builddir)/src
ampctld_CFLAGS = $(AM_CFLAGS) $(PTHREAD_CFLAGS) -I$(top_builddir)/src
rigctlcom_CFLAGS = $(AM_CFLAGS) $(PTHREAD_CFLAGS) -I$(top_builddir)/security
-rigctltcp_CFLAGS = $(AM_CFLAGS) $(PTHREAD_CFLAGS) -I$(top_builddir)/security
if HAVE_LIBUSB
rigtestlibusb_CFLAGS = $(AM_CFLAGS) $(PTHREAD_CFLAGS) $(LIBUSB_CFLAGS)
endif
@@ -65,7 +63,6 @@ ampctl_LDADD = $(PTHREAD_LIBS) $(LDADD) $(READLINE_LIBS)
ampctld_LDADD = $(NET_LIBS) $(PTHREAD_LIBS) $(LDADD) $(READLINE_LIBS)
rigmem_LDADD = $(LIBXML2_LIBS) $(LDADD)
rigctlcom_LDADD = $(NET_LIBS) $(PTHREAD_LIBS) $(LDADD) $(READLINE_LIBS)
-rigctltcp_LDADD = $(NET_LIBS) $(PTHREAD_LIBS) $(LDADD) $(READLINE_LIBS)
if HAVE_LIBUSB
rigtestlibusb_LDADD = $(LIBUSB_LIBS)
endif
@@ -81,7 +78,6 @@ rigctld_LDFLAGS = $(WINEXELDFLAGS)
rotctld_LDFLAGS = $(WINEXELDFLAGS)
ampctld_LDFLAGS = $(WINEXELDFLAGS)
rigctlcom_LDFLAGS = $(WINEXELDFLAGS)
-rigctltcp_LDFLAGS = $(WINEXELDFLAGS)
if HAVE_LIBUSB
rigtestlibusb_LDFLAGS = $(WINEXELDFLAGS)
endif
commit ad140cbac217ea346ebbe8042ecf67b1bbca08d7
Author: Mike Black W9MDB <mdb...@ya...>
Date: Wed Jan 4 17:33:55 2023 -0600
Add simid5100.c
diff --git a/simulators/simid5100.c b/simulators/simid5100.c
new file mode 100644
index 00000000..3db0a01f
--- /dev/null
+++ b/simulators/simid5100.c
@@ -0,0 +1,476 @@
+// simicom will show the pts port to use for rigctl on Unix
+// using virtual serial ports on Windows is to be developed yet
+// Needs a lot of improvement to work on all Icoms
+// gcc -g -Wall -o simicom simicom.c -lhamlib
+// On mingw in the hamlib src directory
+// gcc -static -I../include -g -Wall -o simicom simicom.c -L../../build/src/.libs -lhamlib -lwsock32 -lws2_32
+#define _XOPEN_SOURCE 600
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <sys/time.h>
+#include <hamlib/rig.h>
+#include "../src/misc.h"
+#include <termios.h>
+#include <unistd.h>
+
+
+#define BUFSIZE 256
+
+int civ_731_mode = 0;
+vfo_t current_vfo = RIG_VFO_A;
+int split = 0;
+
+// we make B different from A to ensure we see a difference at startup
+float freqA = 145000000;
+float freqB = 14074500;
+mode_t modeA = RIG_MODE_PKTUSB;
+mode_t modeB = RIG_MODE_PKTUSB;
+int datamodeA = 0;
+int datamodeB = 0;
+int filterA = 0;
+ant_t ant_curr = 0;
+int ant_option = 0;
+int ptt = 0;
+int satmode = 0;
+int agc_time = 1;
+int ovf_status = 0;
+int powerstat = 1;
+
+void dumphex(unsigned char *buf, int n)
+{
+ for (int i = 0; i < n; ++i) { printf("%02x ", buf[i]); }
+
+ printf("\n");
+}
+
+int
+frameGet(int fd, unsigned char *buf)
+{
+ int i = 0;
+ memset(buf, 0, BUFSIZE);
+ unsigned char c;
+
+again:
+
+ while (read(fd, &c, 1) > 0)
+ {
+ buf[i++] = c;
+ //printf("i=%d, c=0x%02x\n",i,c);
+
+ if (c == 0xfd)
+ {
+ dumphex(buf, i);
+ return i;
+ }
+
+ if (i > 2 && c == 0xfe)
+ {
+ printf("Turning power on due to 0xfe string\n");
+ powerstat = 1;
+ int j;
+
+ for (j = i; j < 175; ++j)
+ {
+ if (read(fd, &c, 1) < 0) { break; }
+ }
+
+ i = 0;
+ goto again;
+ }
+ }
+
+ printf("Error???\n");
+
+ return 0;
+}
+
+void frameParse(int fd, unsigned char *frame, int len)
+{
+ double freq;
+ int n = 0;
+
+ dumphex(frame, len);
+
+ if (frame[0] != 0xfe && frame[1] != 0xfe)
+ {
+ printf("expected fe fe, got ");
+ dumphex(frame, len);
+ return;
+ }
+
+ switch (frame[4])
+ {
+ case 0x00:
+ freq = from_bcd(&frame[5], 5 * 2);
+ freqA = freq;
+ printf("freq=%lf\n", freqA);
+ break;
+ case 0x03:
+
+ //from_bcd(frameackbuf[2], (civ_731_mode ? 4 : 5) * 2);
+ if (current_vfo == RIG_VFO_A || current_vfo == RIG_VFO_MAIN)
+ {
+ printf("get_freqA\n");
+ to_bcd(&frame[5], (long long)freqA/10000, 3 * 2);
+ dump_hex(frame,11);
+ }
+ else
+ {
+ printf("get_freqB\n");
+ to_bcd(&frame[5], (long long)freqB/10000, 3 * 2);
+ }
+
+ frame[8] = 0xfd;
+ dump_hex(frame,9);
+
+ n = write(fd, frame, 9);
+
+ break;
+
+ case 0x04:
+ if (current_vfo == RIG_VFO_A || current_vfo == RIG_VFO_MAIN)
+ {
+ printf("get_modeA\n");
+ frame[5] = modeA;
+ frame[6] = filterA;
+ }
+ else
+ {
+ printf("get_modeB\n");
+ frame[5] = modeB;
+ frame[6] = filterA;
+ }
+
+ frame[7] = 0xfd;
+ n = write(fd, frame, 8);
+ break;
+
+ case 0x05:
+ freq = from_bcd(&frame[5], (civ_731_mode ? 4 : 5) * 2);
+ printf("set_freq to %.0f\n", freq);
+
+ if (current_vfo == RIG_VFO_A || current_vfo == RIG_VFO_MAIN) { freqA = freq; }
+ else { freqB = freq; }
+
+ frame[4] = 0xfb;
+ frame[5] = 0xfd;
+ n = write(fd, frame, 6);
+ break;
+
+ case 0x06:
+ if (current_vfo == RIG_VFO_A || current_vfo == RIG_VFO_MAIN) { modeA = frame[6]; }
+ else { modeB = frame[6]; }
+
+ frame[4] = 0xfb;
+ frame[5] = 0xfd;
+ n = write(fd, frame, 6);
+ break;
+
+ case 0x07:
+
+ switch (frame[5])
+ {
+ case 0x00: current_vfo = RIG_VFO_A; break;
+
+ case 0x01: current_vfo = RIG_VFO_B; break;
+
+ case 0xd0: current_vfo = RIG_VFO_MAIN; break;
+
+ case 0xd1: current_vfo = RIG_VFO_SUB; break;
+ }
+
+ printf("set_vfo to %s\n", rig_strvfo(current_vfo));
+
+ frame[4] = 0xfb;
+ frame[5] = 0xfd;
+ n = write(fd, frame, 6);
+ break;
+
+ case 0x0f:
+ if (frame[5] == 0) { split = 0; }
+ else if (frame[5] == 1) { split = 1; }
+ else { frame[6] = split; }
+
+ if (frame[5] == 0xfd)
+ {
+ printf("get split %d\n", 1);
+ frame[7] = 0xfd;
+ n = write(fd, frame, 8);
+ }
+ else
+ {
+ printf("set split %d\n", 1);
+ frame[4] = 0xfb;
+ frame[5] = 0xfd;
+ n = write(fd, frame, 6);
+ }
+
+ break;
+
+ case 0x12: // we're simulating the 3-byte version -- not the 2-byte
+ if (frame[5] != 0xfd)
+ {
+ printf("Set ant %d\n", -1);
+ ant_curr = frame[5];
+ ant_option = frame[6];
+ dump_hex(frame, 8);
+ }
+ else
+ {
+ printf("Get ant\n");
+ }
+
+ frame[5] = ant_curr;
+ frame[6] = ant_option;
+ frame[7] = 0xfd;
+ printf("write 8 bytes\n");
+ dump_hex(frame, 8);
+ n = write(fd, frame, 8);
+ break;
+
+ case 0x14:
+ switch (frame[5])
+ {
+ static int power_level = 0;
+
+ case 0x0a:
+ printf("Using power level %d\n", power_level);
+ power_level += 10;
+
+ if (power_level > 250) { power_level = 0; }
+
+ to_bcd(&frame[6], (long long)power_level, 2);
+ frame[8] = 0xfd;
+ n = write(fd, frame, 9);
+ break;
+ }
+
+ break;
+
+ case 0x15:
+ switch (frame[5])
+ {
+ static int meter_level = 0;
+
+ case 0x07:
+ frame[6] = ovf_status;
+ frame[7] = 0xfd;
+ n = write(fd, frame, 8);
+ ovf_status = ovf_status == 0 ? 1 : 0;
+ break;
+
+ case 0x11:
+ printf("Using meter level %d\n", meter_level);
+ meter_level += 10;
+
+ if (meter_level > 250) { meter_level = 0; }
+
+ to_bcd(&frame[6], (long long)meter_level, 2);
+ frame[8] = 0xfd;
+ n = write(fd, frame, 9);
+ break;
+ }
+
+ case 0x16:
+ switch (frame[5])
+ {
+ case 0x5a:
+ if (frame[6] == 0xfe)
+ {
+ satmode = frame[6];
+ }
+ else
+ {
+ frame[6] = satmode;
+ frame[7] = 0xfd;
+ n = write(fd, frame, 8);
+ }
+
+ break;
+ }
+
+ break;
+
+ case 0x18: // miscellaneous things
+ frame[5] = 1;
+ frame[6] = 0xfd;
+ n = write(fd, frame, 7);
+ break;
+
+ case 0x1a: // miscellaneous things
+ switch (frame[5])
+ {
+ case 0x03: // width
+ if (current_vfo == RIG_VFO_A || current_vfo == RIG_VFO_MAIN) { frame[6] = filterA; }
+
+ frame[7] = 0xfd;
+ n = write(fd, frame, 8);
+ break;
+
+ case 0x04: // AGC TIME
+ printf("frame[6]==x%02x, frame[7]=0%02x\n", frame[6], frame[7]);
+
+ if (frame[6] == 0xfd) // the we are reading
+ {
+ frame[6] = agc_time;
+ frame[7] = 0xfd;
+ n = write(fd, frame, 8);
+ }
+ else
+ {
+ printf("AGC_TIME RESPONSE******************************");
+ agc_time = frame[6];
+ frame[4] = 0xfb;
+ frame[5] = 0xfd;
+ n = write(fd, frame, 6);
+ }
+
+ break;
+
+ case 0x07: // satmode
+ frame[4] = 0;
+ frame[7] = 0xfd;
+ n = write(fd, frame, 8);
+ break;
+
+ }
+
+ break;
+
+ case 0x1c:
+ switch (frame[5])
+ {
+ case 0:
+ if (frame[6] == 0xfd)
+ {
+ frame[6] = ptt;
+ frame[7] = 0xfd;
+ n = write(fd, frame, 8);
+ }
+ else
+ {
+ ptt = frame[6];
+ frame[7] = 0xfb;
+ frame[8] = 0xfd;
+ n = write(fd, frame, 9);
+ }
+
+ break;
+
+ }
+
+ break;
+
+ case 0x25:
+ frame[4] = 0xfa;
+ frame[5] = 0xfd;
+ break;
+
+ case 0x26:
+ frame[4] = 0xfa;
+ frame[5] = 0xfd;
+ break;
+
+ default: printf("cmd 0x%02x unknown\n", frame[4]);
+ }
+
+ if (n == 0) { printf("Write failed?\n"); }
+
+// don't care about the rig type yet
+
+}
+
+#if defined(WIN32) || defined(_WIN32)
+int openPort(char *comport) // doesn't matter for using pts devices
+{
+ int fd;
+ fd = open(comport, O_RDWR);
+
+ if (fd < 0)
+ {
+ perror(comport);
+ }
+
+ return fd;
+}
+
+#else
+int openPort(char *comport) // doesn't matter for using pts devices
+{
+ int fd = posix_openpt(O_RDWR);
+ char *name = ptsname(fd);
+
+ if (name == NULL)
+ {
+ perror("pstname");
+ return -1;
+ }
+
+ printf("name=%s\n", name);
+
+ if (fd == -1 || grantpt(fd) == -1 || unlockpt(fd) == -1)
+ {
+ perror("posix_openpt");
+ return -1;
+ }
+
+ return fd;
+}
+#endif
+
+void rigStatus()
+{
+ char vfoa = current_vfo == RIG_VFO_A ? '*' : ' ';
+ char vfob = current_vfo == RIG_VFO_B ? '*' : ' ';
+ printf("%cVFOA: mode=%d filter=%d freq=%.0f\n", vfoa, modeA,
+ filterA,
+ freqA);
+ printf("%cVFOB: mode=%d filter=%d freq=%.0f\n", vfob, modeB,
+ filterA,
+ freqB);
+}
+
+int main(int argc, char **argv)
+{
+ unsigned char buf[256];
+ int fd = openPort(argv[1]);
+
+ printf("%s: %s\n", argv[0], rig_version());
+#if defined(WIN32) || defined(_WIN32)
+
+ if (argc != 2)
+ {
+ printf("Missing comport argument\n");
+ printf("%s [comport]\n", argv[0]);
+ exit(1);
+ }
+
+#endif
+
+ while (1)
+ {
+ int len = frameGet(fd, buf);
+
+ if (len <= 0)
+ {
+ close(fd);
+ fd = openPort(argv[1]);
+ }
+
+ if (powerstat)
+ {
+ frameParse(fd, buf, len);
+ }
+ else
+ {
+ usleep(1000 * 1000);
+ }
+
+ rigStatus();
+ }
+
+ return 0;
+}
-----------------------------------------------------------------------
Summary of changes:
NEWS | 30 +------
simulators/Makefile.am | 2 +-
simulators/{simicom9700.c => simid5100.c} | 144 +++++-------------------------
tests/Makefile.am | 4 -
4 files changed, 25 insertions(+), 155 deletions(-)
copy simulators/{simicom9700.c => simid5100.c} (73%)
hooks/post-receive
--
Hamlib -- Ham radio control libraries
|
|
From: n0nb <n0...@us...> - 2023-04-05 01:57:34
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Hamlib -- Ham radio control libraries".
The branch, Hamlib-4.5.5 has been updated
via 9bf8066b836399507e0ae5cbed3f6c07a16de938 (commit)
via 4ab3aaf3588d92c9d1d116cfa48f747737c834f4 (commit)
via ddf11623148650e91c88eee0f29dad116c53d50d (commit)
via ceb51534c59a1da24c8720ebd3b4e14b5fc20f73 (commit)
via bab6dbe548ac9f6f91c4367a260749ef9cb49873 (commit)
via df70d0f9dac6f9e58c5e4fbfcf25d0268962e2d1 (commit)
via 6595a2587c4403cfe736d11c0521bd019cafefd5 (commit)
via c240bd1cd095a0fc5f2eed66481404cf30435b16 (commit)
via ee987bc88e9712ade2bf4353e9bd50bccba50d54 (commit)
via 7fa8b6889b1612e992f8d42a3293e63dd2e83f90 (commit)
via e0af8c0a7a4c3a4d1d266705af46ced5f910ae2b (commit)
via 3fa423c63dd19a47bd48cc60eac9b08f4a48caca (commit)
via 9fc5ec5035921c174061bafcfb610cbf1f73ea46 (commit)
via fe2ebcb06f83991f6c5f3057fb49adef59bf4ad3 (commit)
via 4a08058186220b74f72d8e4beca3848dfe414ba5 (commit)
via a73f8ae4825236b1e7160b7c2f1e7c39808a892a (commit)
via a1abda197ed2a691d9834fb88331b30af72edd15 (commit)
via 471a247a99bc2982211b935758ef54651fe14277 (commit)
via fd05de48aac1bcd58bcc4a38b10cf50cf0dfd2c9 (commit)
via c67f53ee7987cef3d0d1d0f3475849a62ece3e22 (commit)
via d03cdcef83ce9ced5752e109513b59453fa4a53c (commit)
via 38502218e1ca66b44dcfb235dba167378adbfdcb (commit)
via e05f154a8db6c000674afd2dc03c1e0a47ccccff (commit)
via d946b80a4dcb7bc99fda25eee1716a9ae15772a5 (commit)
via 165b5514cd0ae2f0bf0511e56f909c57c0959117 (commit)
via d47a0279c9204ecd73edb63485f192f4fc3ba498 (commit)
via a3a1b4c6be38cffaa502c558fafdfb62678ee1b4 (commit)
via 41c90b759e00b80431d45d0786d4421036be164e (commit)
via c11955154573160e90d466a87425891650763332 (commit)
via 252a0c2bd73daf1a1b75f2f1d205b237f1b10f3e (commit)
via afb909271524c638b60c66b8906aeb8f198617cc (commit)
via 1b7649d49e6bf33bc5a177711cdd1fea3cbbe0b8 (commit)
via ccb879df9492d382a0bb87aebd6102f528c42eae (commit)
via 9b3ee663fba2c25442811897a3fb73ec25416776 (commit)
via 9ee5afbcf6a1326610114341f90c2c566950d203 (commit)
via 1f25aab7858b4e7d8a681781accc93906e197448 (commit)
via 5c21f0e790a1948e9a9a7c6cb465af1bac543272 (commit)
via 73bbb072c14f62c629096e15a474d21393ad016e (commit)
via de0c60563c7feafbd9d6a493bef770dadf5374ec (commit)
via 8217088293483bb1f9966b35a91c1dc67bfa8187 (commit)
via d82d2d35257d0bbdecd599dbb80d27bde8a0ac4a (commit)
via 5b8621606f1af28f18180e03a962ed97742ef1e1 (commit)
via 2a0145d77b87813274ec5609404a69b4914c891f (commit)
from 88f6eb29a8d29900f8486f550566f6628a64c12b (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 9bf8066b836399507e0ae5cbed3f6c07a16de938
Author: Mike Black W9MDB <mdb...@ya...>
Date: Thu Mar 30 22:28:09 2023 -0500
Add error message when rig is not turned on that mentions auto_power_on
diff --git a/src/rig.c b/src/rig.c
index efe2811c..c5352418 100644
--- a/src/rig.c
+++ b/src/rig.c
@@ -1266,7 +1266,12 @@ int HAMLIB_API rig_open(RIG *rig)
powerstat_t powerflag;
status = rig_get_powerstat(rig, &powerflag);
- if (status == RIG_OK && powerflag == RIG_POWER_OFF && rig->state.auto_power_on == 0) { return (-RIG_EPOWER); }
+ if (status == RIG_OK && powerflag == RIG_POWER_OFF && rig->state.auto_power_on == 0)
+ {
+ rig_debug(RIG_DEBUG_ERR, "%s: rig power is off, use --set-conf=auto_power_on if power on is wanted\n", __func__);
+
+ return (-RIG_EPOWER);
+ }
// don't need auto_power_on if power is already on
if (status == RIG_OK && powerflag == RIG_POWER_ON) { rig->state.auto_power_on = 0; }
commit 4ab3aaf3588d92c9d1d116cfa48f747737c834f4
Author: Mike Black W9MDB <mdb...@ya...>
Date: Wed Mar 29 08:46:05 2023 -0500
Update NEWS
diff --git a/NEWS b/NEWS
index 562c1a21..73af32a6 100644
--- a/NEWS
+++ b/NEWS
@@ -31,6 +31,8 @@ Version 4.6
* Fix FTDX3000 rig split
Version 4.5.5
+ * Add park to rotorez.c
+ * Fix rig power on/off from rigctl cmd line and rigctld
* Enable async mode by default to prevent WSJT-X crash on IC9700 with transceive on
* Fix IC7610 get_powerstat to disable it -- cannot read power status
* Fix K3 K22 command error for remote operations
@@ -47,7 +49,7 @@ Version 4.5.5
* Add fix for TMD700
* Improve FT-857 get_vfo response when error occurs
* Allow FT-857 to use cached vfo on get_vfo when error occurs reading EEPROM
- * Fix FTDX10 FT710 set_level AFy
+ * Fix FTDX10 FT710 set_level AF
* Fix FT-450D detection
* Fix VFO A/B swapping for gpredict -- hopefully better behavior for VFO swapping rigs
Should avoid setting RX freq while TX and avoid TX freq while RX
commit ddf11623148650e91c88eee0f29dad116c53d50d
Author: Mike Black W9MDB <mdb...@ya...>
Date: Tue Mar 28 10:43:07 2023 -0500
Fix auto_power_on from rigctl invocation with --set-conf=auto_power_on=1
https://github.com/Hamlib/Hamlib/issues/1220
diff --git a/src/rig.c b/src/rig.c
index e4886f17..efe2811c 100644
--- a/src/rig.c
+++ b/src/rig.c
@@ -1266,7 +1266,7 @@ int HAMLIB_API rig_open(RIG *rig)
powerstat_t powerflag;
status = rig_get_powerstat(rig, &powerflag);
- if (status == RIG_OK && powerflag == RIG_POWER_OFF) { return (-RIG_EPOWER); }
+ if (status == RIG_OK && powerflag == RIG_POWER_OFF && rig->state.auto_power_on == 0) { return (-RIG_EPOWER); }
// don't need auto_power_on if power is already on
if (status == RIG_OK && powerflag == RIG_POWER_ON) { rig->state.auto_power_on = 0; }
commit ceb51534c59a1da24c8720ebd3b4e14b5fc20f73
Author: Mike Black W9MDB <mdb...@ya...>
Date: Tue Mar 28 10:24:31 2023 -0500
Fix PS0; command in newcat.c
https://github.com/Hamlib/Hamlib/issues/1220
diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c
index 4250bff4..b1090abb 100644
--- a/rigs/yaesu/newcat.c
+++ b/rigs/yaesu/newcat.c
@@ -3560,9 +3560,8 @@ int newcat_set_powerstat(RIG *rig, powerstat_t status)
case RIG_POWER_OFF:
case RIG_POWER_STANDBY:
- ps = '0';
- write_block(&state->rigport, (unsigned char *) "PS0;", 4);
- break;
+ retval = write_block(&state->rigport, (unsigned char *) "PS0;", 4);
+ RETURNFUNC(retval);
default:
RETURNFUNC(-RIG_ENAVAIL);
diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h
index 1844e9c9..441914ca 100644
--- a/rigs/yaesu/newcat.h
+++ b/rigs/yaesu/newcat.h
@@ -50,7 +50,7 @@
typedef char ncboolean;
/* shared function version */
-#define NEWCAT_VER "20230228"
+#define NEWCAT_VER "20230328"
/* Hopefully large enough for future use, 128 chars plus '\0' */
#define NEWCAT_DATA_LEN 129
commit bab6dbe548ac9f6f91c4367a260749ef9cb49873
Author: Mike Black W9MDB <mdb...@ya...>
Date: Tue Mar 28 09:43:26 2023 -0500
Fix rigctld get_powerstat
https://github.com/Hamlib/Hamlib/issues/1220
diff --git a/rigs/dummy/netrigctl.c b/rigs/dummy/netrigctl.c
index ad90419e..1f9ec6fd 100644
--- a/rigs/dummy/netrigctl.c
+++ b/rigs/dummy/netrigctl.c
@@ -2054,7 +2054,7 @@ static int netrigctl_get_powerstat(RIG *rig, powerstat_t *status)
ret = netrigctl_transaction(rig, cmd, strlen(cmd), buf);
- if (ret == 0)
+ if (ret > 0)
{
*status = atoi(buf);
}
@@ -2736,7 +2736,7 @@ struct rig_caps netrigctl_caps =
RIG_MODEL(RIG_MODEL_NETRIGCTL),
.model_name = "NET rigctl",
.mfg_name = "Hamlib",
- .version = "20230117.0",
+ .version = "20230328.0",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_OTHER,
commit df70d0f9dac6f9e58c5e4fbfcf25d0268962e2d1
Author: Mike Black W9MDB <mdb...@ya...>
Date: Mon Mar 27 10:04:59 2023 -0500
Enable async by default -- this prevents WSJT-X from crashing when transceive mode is on for the IC9700
https://github.com/Hamlib/Hamlib/issues/1264
diff --git a/NEWS b/NEWS
index 40fb1a52..562c1a21 100644
--- a/NEWS
+++ b/NEWS
@@ -31,6 +31,7 @@ Version 4.6
* Fix FTDX3000 rig split
Version 4.5.5
+ * Enable async mode by default to prevent WSJT-X crash on IC9700 with transceive on
* Fix IC7610 get_powerstat to disable it -- cannot read power status
* Fix K3 K22 command error for remote operations
* Fix Gemini DX1200 gemini_set_level
diff --git a/src/rig.c b/src/rig.c
index da0198e2..e4886f17 100644
--- a/src/rig.c
+++ b/src/rig.c
@@ -552,7 +552,7 @@ RIG *HAMLIB_API rig_init(rig_model_t rig_model)
#endif
rs->priv = NULL;
- rs->async_data_enabled = 0;
+ rs->async_data_enabled = 1;
rs->rigport.fd = -1;
rs->pttport.fd = -1;
rs->comm_state = 0;
commit 6595a2587c4403cfe736d11c0521bd019cafefd5
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sat Mar 25 12:38:24 2023 -0500
Update NEWS
diff --git a/NEWS b/NEWS
index 97d1c51b..40fb1a52 100644
--- a/NEWS
+++ b/NEWS
@@ -31,6 +31,7 @@ Version 4.6
* Fix FTDX3000 rig split
Version 4.5.5
+ * Fix IC7610 get_powerstat to disable it -- cannot read power status
* Fix K3 K22 command error for remote operations
* Fix Gemini DX1200 gemini_set_level
* Fix async I/O to not call flush
commit c240bd1cd095a0fc5f2eed66481404cf30435b16
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sat Mar 25 11:20:52 2023 -0500
Fix IC-7160 get_powerstat to disable it...cannot read power status from 7610
diff --git a/rigs/icom/ic7610.c b/rigs/icom/ic7610.c
index c0322780..742e945b 100644
--- a/rigs/icom/ic7610.c
+++ b/rigs/icom/ic7610.c
@@ -350,7 +350,7 @@ const struct rig_caps ic7610_caps =
RIG_MODEL(RIG_MODEL_IC7610),
.model_name = "IC-7610",
.mfg_name = "Icom",
- .version = BACKEND_VER ".9",
+ .version = BACKEND_VER ".11",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
@@ -582,7 +582,8 @@ const struct rig_caps ic7610_caps =
.set_split_vfo = icom_set_split_vfo,
.get_split_vfo = icom_get_split_vfo,
.set_powerstat = icom_set_powerstat,
- .get_powerstat = icom_get_powerstat,
+ // 7610 cannot read power status apparently
+// .get_powerstat = icom_get_powerstat,
.send_morse = icom_send_morse,
.stop_morse = icom_stop_morse,
.wait_morse = rig_wait_morse,
commit ee987bc88e9712ade2bf4353e9bd50bccba50d54
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sat Mar 18 23:43:36 2023 -0500
Update NEWS
diff --git a/NEWS b/NEWS
index dd593da1..97d1c51b 100644
--- a/NEWS
+++ b/NEWS
@@ -31,6 +31,7 @@ Version 4.6
* Fix FTDX3000 rig split
Version 4.5.5
+ * Fix K3 K22 command error for remote operations
* Fix Gemini DX1200 gemini_set_level
* Fix async I/O to not call flush
* Change EX startup commands for Yaesu rigs to allow errors...Win4Yaesu not recognizing EX commands
commit 7fa8b6889b1612e992f8d42a3293e63dd2e83f90
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sat Mar 18 23:40:45 2023 -0500
For K3 prevent ID; command from K22; command
Remote ops was having a problem with K22;
https://github.com/Hamlib/Hamlib/issues/1254
diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c
index 8188c1ac..b3f9398b 100644
--- a/rigs/kenwood/kenwood.c
+++ b/rigs/kenwood/kenwood.c
@@ -342,9 +342,13 @@ transaction_write:
skip |= strncmp(cmdstr, "RU", 2) == 0;
skip |= strncmp(cmdstr, "RD", 2) == 0;
skip |= strncmp(cmdstr, "KYW", 3) == 0;
+ skip |= strncmp(cmdstr, "PS1", 3) == 0;
+ skip |= strncmp(cmdstr, "PS0", 3) == 0;
+ skip |= strncmp(cmdstr, "K22", 3) == 0;
if (skip)
{
+ hl_usleep(200*1000); // give little settle time for these commands
goto transaction_quit;
}
}
diff --git a/rigs/kenwood/kenwood.h b/rigs/kenwood/kenwood.h
index 66e64f12..1c97ddc5 100644
--- a/rigs/kenwood/kenwood.h
+++ b/rigs/kenwood/kenwood.h
@@ -29,7 +29,7 @@
#include "misc.h"
#include "idx_builtin.h"
-#define BACKEND_VER "20230208"
+#define BACKEND_VER "20230318"
#define EOM_KEN ';'
#define EOM_TH '\r'
commit e0af8c0a7a4c3a4d1d266705af46ced5f910ae2b
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sat Mar 18 22:21:07 2023 -0500
Update NEWS
diff --git a/NEWS b/NEWS
index ac260aa3..dd593da1 100644
--- a/NEWS
+++ b/NEWS
@@ -13,6 +13,7 @@ Version 5.x -- future
* Change FT1000MP Mark V model names to align with FT1000MP
Version 4.6
+ * Add saebrtrack rotor https://sites.google.com/site/marklhammond/saebrtrack
* Add offset_vfoa and offset_vfob applying to rig_set_freq
* Fix K4 to put it in K40 mode when requesting ID
* 2023-11-XX -- Planned for Nov 2023
@@ -30,6 +31,8 @@ Version 4.6
* Fix FTDX3000 rig split
Version 4.5.5
+ * Fix Gemini DX1200 gemini_set_level
+ * Fix async I/O to not call flush
* Change EX startup commands for Yaesu rigs to allow errors...Win4Yaesu not recognizing EX commands
* Fix jst145 set_freq and get_freq
* Restore tcflush as some odd behavior was seen that tclush fixes
commit 3fa423c63dd19a47bd48cc60eac9b08f4a48caca
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sat Mar 18 22:18:50 2023 -0500
Fix Gemini DX1200 gemini_set_level function
diff --git a/amplifiers/gemini/dx1200.c b/amplifiers/gemini/dx1200.c
index ed9786e7..e0a23cc0 100644
--- a/amplifiers/gemini/dx1200.c
+++ b/amplifiers/gemini/dx1200.c
@@ -61,9 +61,9 @@ const struct amp_caps gemini_amp_caps =
AMP_MODEL(AMP_MODEL_GEMINI_DX1200),
.model_name = "DX1200/HF-1K",
.mfg_name = "Gemini",
- .version = "20220710.0",
+ .version = "20230318.0",
.copyright = "LGPL",
- .status = RIG_STATUS_ALPHA,
+ .status = RIG_STATUS_BETA,
.amp_type = AMP_TYPE_OTHER,
.port_type = RIG_PORT_NETWORK,
.write_delay = 0,
diff --git a/amplifiers/gemini/gemini.c b/amplifiers/gemini/gemini.c
index b105cdcd..7d3f1e4a 100644
--- a/amplifiers/gemini/gemini.c
+++ b/amplifiers/gemini/gemini.c
@@ -282,13 +282,12 @@ int gemini_set_level(AMP *amp, setting_t level, value_t val)
if (val.f < .67) { cmd = "PM\n"; }
- return RIG_OK;
break;
}
retval = gemini_transaction(amp, cmd, NULL, 0);
- if (retval != RIG_OK) { return retval; }
+ if (retval == RIG_OK) { return retval; }
rig_debug(RIG_DEBUG_ERR, "%s: Unknown level=%s\n", __func__,
rig_strlevel(level));
commit 9fc5ec5035921c174061bafcfb610cbf1f73ea46
Author: Mike Black W9MDB <mdb...@ya...>
Date: Thu Mar 16 16:41:35 2023 -0500
Fix spelling error in rotctl.c help and add offset settings to rotctl.1
diff --git a/doc/man1/rotctl.1 b/doc/man1/rotctl.1
index a85d8e1a..f947223a 100644
--- a/doc/man1/rotctl.1
+++ b/doc/man1/rotctl.1
@@ -23,6 +23,8 @@ rotctl \- control antenna rotators
.OP \-s baud
.OP \-t char
.OP \-C parm=val
+.OP \-o azoffset
+.OP \-O eloffset
.RB [ \-v [ \-Z ]]
.RB [ command | \- ]
.YS
@@ -131,6 +133,15 @@ The semicolon (\(oq;\(cq) is a common terminator for rotators that accept
ASCII character strings.
.
.TP
+.BR \-o ", " \-\-set\-azoffset
+Azimuth correction floating point -- during set value is added, during get value is subtracted.
+.
+.TP
+.BR \-O ", " \-\-set\-eloffset
+Elevation correction floating point -- during set value is added, during get value is subtracted.
+.
+.
+.TP
.BR \-L ", " \-\-show\-conf
List all configuration parameters for the rotator defined with
.B \-m
diff --git a/tests/rotctl.c b/tests/rotctl.c
index f8dd99aa..50a1c621 100644
--- a/tests/rotctl.c
+++ b/tests/rotctl.c
@@ -509,8 +509,8 @@ void usage()
" -s, --serial-speed=BAUD set serial speed of the serial port\n"
" -t, --send-cmd-term=CHAR set send_cmd command termination char\n"
" -C, --set-conf=PARM=VAL set config parameters\n"
- " -o, --set-azoffset==VAL set offset for azimuth\n"
- " -O, --set-eloffset==VAL set offset for elevation\n"
+ " -o, --set-azoffset=VAL set offset for azimuth\n"
+ " -O, --set-eloffset=VAL set offset for elevation\n"
" -L, --show-conf list all config parameters\n"
" -l, --list list all model numbers and exit\n"
" -u, --dump-caps dump capabilities and exit\n"
commit fe2ebcb06f83991f6c5f3057fb49adef59bf4ad3
Author: Michael Black <mdb...@ya...>
Date: Wed Mar 8 15:31:58 2023 -0600
Merge pull request #1244 from mikaelnousiainen/ts2000-fixes
Improve Kenwood TS-2000 backend
diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c
index c2b71dc6..8188c1ac 100644
--- a/rigs/kenwood/kenwood.c
+++ b/rigs/kenwood/kenwood.c
@@ -3133,7 +3133,15 @@ int kenwood_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
case RIG_LEVEL_AF:
{
- int vfo_set = vfo == RIG_VFO_A || vfo == RIG_VFO_MAIN ? 0 : 1;
+ int vfo_num;
+ if (RIG_IS_TS2000)
+ {
+ vfo_num = (vfo == RIG_VFO_C) ? 1 : 0;
+ }
+ else
+ {
+ vfo_num = (vfo == RIG_VFO_A || vfo == RIG_VFO_MAIN) ? 0 : 1;
+ }
// some rigs only recognize 0 for vfo_set
// https://github.com/Hamlib/Hamlib/issues/304
@@ -3151,7 +3159,7 @@ int kenwood_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
break;
case 3:
- SNPRINTF(levelbuf, sizeof(levelbuf), "AG%d%03d", vfo_set, kenwood_val);
+ SNPRINTF(levelbuf, sizeof(levelbuf), "AG%d%03d", vfo_num, kenwood_val);
break;
default:
@@ -3192,10 +3200,21 @@ int kenwood_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
SNPRINTF(levelbuf, sizeof(levelbuf), "RG%03d", kenwood_val);
break;
- case RIG_LEVEL_SQL:
- /* Default to RX#0 */
- SNPRINTF(levelbuf, sizeof(levelbuf), "SQ0%03d", kenwood_val);
+ case RIG_LEVEL_SQL: {
+ int vfo_num;
+ if (RIG_IS_TS2000)
+ {
+ vfo_num = (vfo == RIG_VFO_C) ? 1 : 0;
+ }
+ else
+ {
+ /* Default to RX#0 */
+ vfo_num = 0;
+ }
+
+ SNPRINTF(levelbuf, sizeof(levelbuf), "SQ%d%03d", vfo_num, kenwood_val);
break;
+ }
case RIG_LEVEL_AGC:
SNPRINTF(levelbuf, sizeof(levelbuf), "GT%03d", 84 * kenwood_val);
@@ -3397,6 +3416,7 @@ int get_kenwood_level(RIG *rig, const char *cmd, float *fval, int *ival)
*/
int kenwood_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
{
+ char cmdbuf[8];
char lvlbuf[KENWOOD_MAX_BUF_LEN];
char *cmd;
int retval;
@@ -3423,6 +3443,18 @@ int kenwood_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
cmd = "SM0";
len = 3;
}
+ else if (RIG_IS_TS2000)
+ {
+ len = 3;
+ if (vfo == RIG_VFO_C)
+ {
+ cmd = "SM1";
+ }
+ else
+ {
+ cmd = "SM0";
+ }
+ }
else
{
cmd = "SM";
@@ -3436,16 +3468,31 @@ int kenwood_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
RETURNFUNC(retval);
}
- /* XXX atoi ? */
- sscanf(lvlbuf + len, "%d", &val->i); /* rawstr */
+ sscanf(lvlbuf + len, "%d", &val->i);
break;
- case RIG_LEVEL_STRENGTH:
+ case RIG_LEVEL_STRENGTH: {
+ int multiplier = 1;
+
if (RIG_IS_TS590S || RIG_IS_TS590SG || RIG_IS_TS480)
{
cmd = "SM0";
len = 3;
}
+ else if (RIG_IS_TS2000)
+ {
+ len = 3;
+ if (vfo == RIG_VFO_C)
+ {
+ cmd = "SM1";
+ // TS-2000 sub-transceiver S-meter range is half of the main one
+ multiplier = 2;
+ }
+ else
+ {
+ cmd = "SM0";
+ }
+ }
else
{
cmd = "SM";
@@ -3459,7 +3506,8 @@ int kenwood_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
RETURNFUNC(retval);
}
- sscanf(lvlbuf + len, "%d", &val->i); /* rawstr */
+ sscanf(lvlbuf + len, "%d", &val->i);
+ val->i *= multiplier;
if (rig->caps->str_cal.size)
{
@@ -3469,8 +3517,47 @@ int kenwood_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
{
val->i = (val->i * 4) - 54;
}
-
break;
+ }
+
+ case RIG_LEVEL_SQL: {
+ int ack_len;
+ int vfo_num;
+
+ if (RIG_IS_TS2000)
+ {
+ vfo_num = (vfo == RIG_VFO_C) ? 1 : 0;
+ }
+ else
+ {
+ /* Default to RX#0 */
+ vfo_num = 0;
+ }
+
+ SNPRINTF(cmdbuf, sizeof(cmdbuf), "SQ%c", vfo_num);
+ retval = kenwood_transaction(rig, cmdbuf, lvlbuf, sizeof(lvlbuf));
+ len = 6;
+
+ if (retval != RIG_OK)
+ {
+ return retval;
+ }
+
+ ack_len = strlen(lvlbuf);
+
+ if (ack_len != len)
+ {
+ return -RIG_EPROTO;
+ }
+
+ if (sscanf(&lvlbuf[len - 3], "%d", &lvl) != 1)
+ {
+ return -RIG_EPROTO;
+ }
+
+ val->f = (float) lvl / 255.f;
+ return RIG_OK;
+ }
case RIG_LEVEL_ATT:
len = RIG_IS_TS890S ? 3 : 6;
@@ -3564,8 +3651,8 @@ int kenwood_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
val->f = (power_now - power_min) / (float)(power_max - power_min);
RETURNFUNC(RIG_OK);
- case RIG_LEVEL_AF:
-
+ case RIG_LEVEL_AF: {
+ int vfo_num;
// first time through we'll determine the AG format
// Can be "AG" "AG0" or "AG0/1"
// This could be done by rig but easy enough to make it automagic
@@ -3622,6 +3709,15 @@ int kenwood_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
RETURNFUNC(RIG_OK); // this is non-fatal for no))w
}
+ if (RIG_IS_TS2000)
+ {
+ vfo_num = (vfo == RIG_VFO_C) ? 1 : 0;
+ }
+ else
+ {
+ vfo_num = (vfo == RIG_VFO_A || vfo == RIG_VFO_MAIN) ? 0 : 1;
+ }
+
switch (priv->ag_format)
{
case 0:
@@ -3630,16 +3726,16 @@ int kenwood_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
break;
case 1:
- RETURNFUNC(get_kenwood_level(rig, "AG", &val->f, NULL));
+ retval = get_kenwood_level(rig, "AG", &val->f, NULL);
break;
case 2:
- RETURNFUNC(get_kenwood_level(rig, "AG0", &val->f, NULL));
+ retval = get_kenwood_level(rig, "AG0", &val->f, NULL);
break;
case 3:
- RETURNFUNC(get_kenwood_level(rig, vfo == RIG_VFO_MAIN ? "AG0" : "AG1", &val->f,
- NULL));
+ SNPRINTF(cmdbuf, sizeof(cmdbuf), "AG%d", vfo_num);
+ retval = get_kenwood_level(rig, cmdbuf, &val->f,NULL);
break;
default:
@@ -3648,11 +3744,12 @@ int kenwood_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
RETURNFUNC(-RIG_EPROTO);
}
+ RETURNFUNC(retval);
+ }
+
case RIG_LEVEL_RF:
RETURNFUNC(get_kenwood_level(rig, "RG", &val->f, NULL));
-
-
case RIG_LEVEL_MICGAIN:
{
int micgain_now;
@@ -4452,7 +4549,7 @@ int kenwood_get_ctcss_sql(RIG *rig, vfo_t vfo, tone_t *tone)
}
else
{
- SNPRINTF(cmd, sizeof(cmd), "CT");
+ SNPRINTF(cmd, sizeof(cmd), "CN");
offs = 2;
}
@@ -4588,6 +4685,7 @@ int kenwood_get_ant(RIG *rig, vfo_t vfo, ant_t dummy, value_t *option,
char ackbuf[8];
int offs;
int retval;
+ char antenna;
ENTERFUNC;
@@ -4612,12 +4710,22 @@ int kenwood_get_ant(RIG *rig, vfo_t vfo, ant_t dummy, value_t *option,
RETURNFUNC(retval);
}
- if (ackbuf[offs] < '1' || ackbuf[offs] > '9')
+ antenna = ackbuf[offs];
+
+ if (antenna < '0' || antenna > '9')
{
RETURNFUNC(-RIG_EPROTO);
}
- *ant_curr = RIG_ANT_N(ackbuf[offs] - '1');
+ if (antenna == '0')
+ {
+ // At least TS-2000 return AN0 on VHF/UHF bands
+ *ant_curr = RIG_ANT_1;
+ }
+ else
+ {
+ *ant_curr = RIG_ANT_N(ackbuf[offs] - '1');
+ }
/* XXX check that the returned antenna is valid for the current rig */
@@ -4658,17 +4766,41 @@ int kenwood_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt)
ENTERFUNC;
rig_debug(RIG_DEBUG_VERBOSE, "%s: ptt=%d\n", __func__, ptt);
- switch (ptt)
+ if (RIG_IS_TS2000)
{
- case RIG_PTT_ON: ptt_cmd = "TX"; break;
-
- case RIG_PTT_ON_MIC: ptt_cmd = "TX0"; break;
-
- case RIG_PTT_ON_DATA: ptt_cmd = "TX1"; break;
-
- case RIG_PTT_OFF: ptt_cmd = "RX"; break;
-
- default: RETURNFUNC(-RIG_EINVAL);
+ switch (ptt)
+ {
+ case RIG_PTT_ON:
+ case RIG_PTT_ON_MIC:
+ case RIG_PTT_ON_DATA:
+ ptt_cmd = (vfo == RIG_VFO_C) ? "TX1" : "TX0";
+ break;
+ case RIG_PTT_OFF:
+ ptt_cmd = "RX";
+ break;
+ default:
+ RETURNFUNC(-RIG_EINVAL);
+ }
+ }
+ else
+ {
+ switch (ptt)
+ {
+ case RIG_PTT_ON:
+ ptt_cmd = "TX";
+ break;
+ case RIG_PTT_ON_MIC:
+ ptt_cmd = "TX0";
+ break;
+ case RIG_PTT_ON_DATA:
+ ptt_cmd = "TX1";
+ break;
+ case RIG_PTT_OFF:
+ ptt_cmd = "RX";
+ break;
+ default:
+ RETURNFUNC(-RIG_EINVAL);
+ }
}
int retval = kenwood_transaction(rig, ptt_cmd, NULL, 0);
@@ -4736,8 +4868,8 @@ int kenwood_get_dcd(RIG *rig, vfo_t vfo, dcd_t *dcd)
RETURNFUNC(retval);
}
- if ((RIG_IS_TS990S && RIG_VFO_SUB == vfo) || (RIG_IS_TS2000
- && RIG_VFO_SUB == vfo))
+ if ((RIG_IS_TS990S && RIG_VFO_SUB == vfo) ||
+ (RIG_IS_TS2000 && RIG_VFO_C == vfo))
{
offs = 3;
}
diff --git a/rigs/kenwood/ts2000.c b/rigs/kenwood/ts2000.c
index 6e70c567..6b0410b4 100644
--- a/rigs/kenwood/ts2000.c
+++ b/rigs/kenwood/ts2000.c
@@ -1,7 +1,7 @@
/*
* Hamlib Kenwood backend - TS2000 description
* Copyright (c) 2000-2011 by Stephane Fillod
- *
+ * Copyright (c) 2023 by Mikael Nousiainen
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -26,19 +26,31 @@
#include <hamlib/rig.h>
#include "kenwood.h"
+#include "token.h"
+#include "misc.h"
+#include "iofunc.h"
+#include "cal.h"
-#define TS2000_ALL_MODES (RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_SSB|RIG_MODE_FM|RIG_MODE_RTTY)
+#define TS2000_ALL_MODES (RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|RIG_MODE_FM|RIG_MODE_RTTY|RIG_MODE_RTTYR)
#define TS2000_OTHER_TX_MODES (RIG_MODE_CW|RIG_MODE_SSB|RIG_MODE_FM|RIG_MODE_RTTY)
#define TS2000_AM_TX_MODES RIG_MODE_AM
-#define TS2000_FUNC_ALL (RIG_FUNC_TONE|RIG_FUNC_TSQL|RIG_FUNC_BC|RIG_FUNC_NB|RIG_FUNC_NR|RIG_FUNC_ANF|RIG_FUNC_COMP|RIG_FUNC_RIT|RIG_FUNC_XIT)
+#define TS2000_LEVEL_GET (RIG_LEVEL_RFPOWER|RIG_LEVEL_AF|RIG_LEVEL_RF|RIG_LEVEL_SQL|RIG_LEVEL_AGC|RIG_LEVEL_MICGAIN|RIG_LEVEL_STRENGTH|RIG_LEVEL_KEYSPD|RIG_LEVEL_CWPITCH| \
+ RIG_LEVEL_MONITOR_GAIN|RIG_LEVEL_NB|RIG_LEVEL_NR|RIG_LEVEL_PREAMP|RIG_LEVEL_COMP|RIG_LEVEL_ATT|RIG_LEVEL_VOXDELAY|RIG_LEVEL_VOXGAIN|RIG_LEVEL_BKIN_DLYMS| \
+ RIG_LEVEL_METER|RIG_LEVEL_SWR|RIG_LEVEL_COMP_METER|RIG_LEVEL_ALC|RIG_LEVEL_RFPOWER_METER|RIG_LEVEL_SLOPE_HIGH|RIG_LEVEL_SLOPE_LOW)
+
+#define TS2000_LEVEL_SET (RIG_LEVEL_RFPOWER|RIG_LEVEL_AF|RIG_LEVEL_RF|RIG_LEVEL_SQL|RIG_LEVEL_AGC|RIG_LEVEL_MICGAIN|RIG_LEVEL_KEYSPD|RIG_LEVEL_CWPITCH| \
+ RIG_LEVEL_MONITOR_GAIN|RIG_LEVEL_NB|RIG_LEVEL_NR|RIG_LEVEL_PREAMP|RIG_LEVEL_COMP|RIG_LEVEL_ATT|RIG_LEVEL_VOXDELAY|RIG_LEVEL_VOXGAIN|RIG_LEVEL_BKIN_DLYMS| \
+ RIG_LEVEL_METER|RIG_LEVEL_SLOPE_HIGH|RIG_LEVEL_SLOPE_LOW)
-#define TS2000_LEVEL_ALL (RIG_LEVEL_PREAMP|RIG_LEVEL_ATT|RIG_LEVEL_VOXDELAY|RIG_LEVEL_AF|RIG_LEVEL_RF|RIG_LEVEL_SQL|RIG_LEVEL_CWPITCH|RIG_LEVEL_RFPOWER|RIG_LEVEL_MICGAIN|RIG_LEVEL_KEYSPD|RIG_LEVEL_COMP|RIG_LEVEL_AGC|RIG_LEVEL_BKINDL|RIG_LEVEL_METER|RIG_LEVEL_VOXGAIN|RIG_LEVEL_ANTIVOX|RIG_LEVEL_RAWSTR|RIG_LEVEL_STRENGTH)
+#define TS2000_FUNC_ALL (RIG_FUNC_NB|RIG_FUNC_COMP|RIG_FUNC_VOX|RIG_FUNC_NR|RIG_FUNC_NR|RIG_FUNC_BC|RIG_FUNC_BC2|RIG_FUNC_RIT|RIG_FUNC_XIT| \
+ RIG_FUNC_TUNER|RIG_FUNC_MON|RIG_FUNC_FBKIN|RIG_FUNC_LOCK|RIG_FUNC_TONE|RIG_FUNC_TSQL|RIG_FUNC_ANF)
#define TS2000_MAINVFO (RIG_VFO_A|RIG_VFO_B)
#define TS2000_SUBVFO (RIG_VFO_C)
-#define TS2000_VFO_OP (RIG_OP_UP|RIG_OP_DOWN|RIG_OP_BAND_UP|RIG_OP_BAND_DOWN)
+#define TS2000_VFO_OPS (RIG_OP_UP|RIG_OP_DOWN|RIG_OP_BAND_UP|RIG_OP_BAND_DOWN|RIG_OP_CPY|RIG_OP_TUNE)
+
#define TS2000_SCAN_OP (RIG_SCAN_VFO)
#define TS2000_ANTS (RIG_ANT_1|RIG_ANT_2)
@@ -54,11 +66,21 @@
{0x1E, 60}}\
}
-/* prototypes */
-static int ts2000_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val);
-static int ts2000_get_channel(RIG *rig, vfo_t vfo, channel_t *chan,
- int read_only);
-static int ts2000_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan);
+#define TS2000_SWR_CAL { 5, \
+ { \
+ { 0, 1.0f }, \
+ { 4, 1.5f }, \
+ { 8, 2.0f }, \
+ { 12, 3.0f }, \
+ { 20, 10.0f } \
+ } }
+
+#define TOK_FUNC_NOISE_REDUCTION_2 TOKEN_BACKEND(102)
+#define TOK_LEVEL_DSP_RX_EQUALIZER TOKEN_BACKEND(104)
+#define TOK_LEVEL_DSP_TX_EQUALIZER TOKEN_BACKEND(105)
+#define TOK_LEVEL_DSP_TX_BANDWIDTH TOKEN_BACKEND(106)
+#define TOK_LEVEL_BEEP_VOLUME TOKEN_BACKEND(107)
+#define TOK_LEVEL_TX_SIDETONE_VOLUME TOKEN_BACKEND(108)
/*
* 38 CTCSS sub-audible tones + 1750 tone
@@ -72,8 +94,6 @@ tone_t ts2000_ctcss_list[] =
0,
};
-
-
/*
* 103 available DCS codes
*/
@@ -91,9 +111,128 @@ tone_t ts2000_dcs_list[] =
0,
};
+int ts2000_ext_tokens[] =
+{
+ TOK_FUNC_NOISE_REDUCTION_2, TOK_FUNC_FILTER_WIDTH_DATA,
+ TOK_LEVEL_DSP_RX_EQUALIZER, TOK_LEVEL_DSP_TX_EQUALIZER, TOK_LEVEL_DSP_TX_BANDWIDTH,
+ TOK_LEVEL_BEEP_VOLUME, TOK_LEVEL_TX_SIDETONE_VOLUME,
+ TOK_BACKEND_NONE,
+};
+
+const struct confparams ts2000_ext_funcs[] =
+{
+ {
+ TOK_FUNC_NOISE_REDUCTION_2, "NR2", "Noise reduction 2", "Noise reduction 2",
+ NULL, RIG_CONF_CHECKBUTTON,
+ },
+ { RIG_CONF_END, NULL, }
+};
+
+const struct confparams ts2000_ext_levels[] =
+{
+ {
+ TOK_LEVEL_DSP_RX_EQUALIZER, "DSP_RX_EQUALIZER", "DSP RX equalizer", "DSP RX equalizer type",
+ NULL, RIG_CONF_COMBO, { .c = { .combostr = { "OFF", "H BOOST", "F PASS", "B BOOST", "CONV-EN", "USER", NULL } } }
+ },
+ {
+ TOK_LEVEL_DSP_TX_EQUALIZER, "DSP_TX_EQUALIZER", "DSP TX equalizer", "DSP TX equalizer type",
+ NULL, RIG_CONF_COMBO, { .c = { .combostr = { "OFF", "H BOOST", "F PASS", "B BOOST", "CONV-EN", "USER", NULL } } }
+ },
+ {
+ TOK_LEVEL_DSP_TX_BANDWIDTH, "DSP_TX_BANDWIDTH", "DSP TX bandwidth", "DSP TX bandwidth for SSB and AM",
+ NULL, RIG_CONF_COMBO, { .c = { .combostr = { "2.0 kHz", "2.2 kHz", "2.4 kHz", "2.6 kHz", "2.8 kHz", "3.0 kHz", NULL } } }
+ },
+ {
+ TOK_LEVEL_BEEP_VOLUME, "BEEP_VOLUME", "Beep volume", "Beep volume",
+ NULL, RIG_CONF_NUMERIC, { .n = { .min = 0, .max = 9, .step = 1 } }
+ },
+ {
+ TOK_LEVEL_TX_SIDETONE_VOLUME, "TX_SIDETONE_VOLUME", "TX sidetone volume", "TX sidetone volume",
+ NULL, RIG_CONF_NUMERIC, { .n = { .min = 0, .max = 9, .step = 1 } }
+ },
+ { RIG_CONF_END, NULL, }
+};
+
+static struct kenwood_filter_width ts2000_filter_width[] =
+{
+ { RIG_MODE_CW | RIG_MODE_CWR, 50, 50 },
+ { RIG_MODE_CW | RIG_MODE_CWR, 80, 80 },
+ { RIG_MODE_CW | RIG_MODE_CWR, 100, 100 },
+ { RIG_MODE_CW | RIG_MODE_CWR, 150, 150 },
+ { RIG_MODE_CW | RIG_MODE_CWR, 200, 200 },
+ { RIG_MODE_CW | RIG_MODE_CWR, 300, 300 },
+ { RIG_MODE_CW | RIG_MODE_CWR, 400, 400 },
+ { RIG_MODE_CW | RIG_MODE_CWR, 500, 500 },
+ { RIG_MODE_CW | RIG_MODE_CWR, 600, 600 },
+ { RIG_MODE_CW | RIG_MODE_CWR, 1000, 1000 },
+ { RIG_MODE_CW | RIG_MODE_CWR, 2000, 2000 },
+ { RIG_MODE_RTTY | RIG_MODE_RTTYR, 250, 250 },
+ { RIG_MODE_RTTY | RIG_MODE_RTTYR, 500, 500 },
+ { RIG_MODE_RTTY | RIG_MODE_RTTYR, 1000, 1000 },
+ { RIG_MODE_RTTY | RIG_MODE_RTTYR, 1500, 1500 },
+ { RIG_MODE_SSB, 0, 2400 },
+ { RIG_MODE_SSB, 1, 500 }, // NAR1 optional filter
+ { RIG_MODE_SSB, 2, 270 }, // NAR2 optional filter
+ { RIG_MODE_FM, 0, 6000 },
+ { RIG_MODE_FM, 1, 12000 },
+ { RIG_MODE_AM, 0, 2400 },
+ { RIG_MODE_AM, 1, 6000 }, // NAR1 optional filter (?)
+ { RIG_MODE_NONE, -1, -1 },
+};
+
+static struct kenwood_slope_filter ts2000_slope_filter_high[] =
+{
+ { RIG_MODE_SSB | RIG_MODE_FM | RIG_MODE_RTTY | RIG_MODE_RTTYR, 0, 0, 1400 },
+ { RIG_MODE_SSB | RIG_MODE_FM | RIG_MODE_RTTY | RIG_MODE_RTTYR, 0, 1, 1600 },
+ { RIG_MODE_SSB | RIG_MODE_FM | RIG_MODE_RTTY | RIG_MODE_RTTYR, 0, 2, 1800 },
+ { RIG_MODE_SSB | RIG_MODE_FM | RIG_MODE_RTTY | RIG_MODE_RTTYR, 0, 3, 2000 },
+ { RIG_MODE_SSB | RIG_MODE_FM | RIG_MODE_RTTY | RIG_MODE_RTTYR, 0, 4, 2200 },
+ { RIG_MODE_SSB | RIG_MODE_FM | RIG_MODE_RTTY | RIG_MODE_RTTYR, 0, 5, 2400 },
+ { RIG_MODE_SSB | RIG_MODE_FM | RIG_MODE_RTTY | RIG_MODE_RTTYR, 0, 6, 2600 },
+ { RIG_MODE_SSB | RIG_MODE_FM | RIG_MODE_RTTY | RIG_MODE_RTTYR, 0, 7, 2800 },
+ { RIG_MODE_SSB | RIG_MODE_FM | RIG_MODE_RTTY | RIG_MODE_RTTYR, 0, 8, 3000 },
+ { RIG_MODE_SSB | RIG_MODE_FM | RIG_MODE_RTTY | RIG_MODE_RTTYR, 0, 9, 3400 },
+ { RIG_MODE_SSB | RIG_MODE_FM | RIG_MODE_RTTY | RIG_MODE_RTTYR, 0, 10, 4000 },
+ { RIG_MODE_SSB | RIG_MODE_FM | RIG_MODE_RTTY | RIG_MODE_RTTYR, 0, 11, 5000 },
+ { RIG_MODE_AM, 0, 0, 2500 },
+ { RIG_MODE_AM, 0, 1, 3000 },
+ { RIG_MODE_AM, 0, 2, 4000 },
+ { RIG_MODE_AM, 0, 3, 5000 },
+ { RIG_MODE_SSB | RIG_MODE_RTTY | RIG_MODE_RTTYR | RIG_MODE_FM | RIG_MODE_AM, 1, 0, 170 },
+ { RIG_MODE_SSB | RIG_MODE_RTTY | RIG_MODE_RTTYR | RIG_MODE_FM | RIG_MODE_AM, 1, 1, 1930 },
+ { RIG_MODE_SSB | RIG_MODE_RTTY | RIG_MODE_RTTYR | RIG_MODE_FM | RIG_MODE_AM, 1, 2, 2160 },
+ { RIG_MODE_NONE, 0, -1, -1 },
+};
+
+static struct kenwood_slope_filter ts2000_slope_filter_low[] =
+{
+ { RIG_MODE_SSB | RIG_MODE_FM | RIG_MODE_RTTY | RIG_MODE_RTTYR, 0, 0, 0 },
+ { RIG_MODE_SSB | RIG_MODE_FM | RIG_MODE_RTTY | RIG_MODE_RTTYR, 0, 1, 50 },
+ { RIG_MODE_SSB | RIG_MODE_FM | RIG_MODE_RTTY | RIG_MODE_RTTYR, 0, 2, 100 },
+ { RIG_MODE_SSB | RIG_MODE_FM | RIG_MODE_RTTY | RIG_MODE_RTTYR, 0, 3, 200 },
+ { RIG_MODE_SSB | RIG_MODE_FM | RIG_MODE_RTTY | RIG_MODE_RTTYR, 0, 4, 300 },
+ { RIG_MODE_SSB | RIG_MODE_FM | RIG_MODE_RTTY | RIG_MODE_RTTYR, 0, 5, 400 },
+ { RIG_MODE_SSB | RIG_MODE_FM | RIG_MODE_RTTY | RIG_MODE_RTTYR, 0, 6, 500 },
+ { RIG_MODE_SSB | RIG_MODE_FM | RIG_MODE_RTTY | RIG_MODE_RTTYR, 0, 7, 600 },
+ { RIG_MODE_SSB | RIG_MODE_FM | RIG_MODE_RTTY | RIG_MODE_RTTYR, 0, 8, 700 },
+ { RIG_MODE_SSB | RIG_MODE_FM | RIG_MODE_RTTY | RIG_MODE_RTTYR, 0, 9, 800 },
+ { RIG_MODE_SSB | RIG_MODE_FM | RIG_MODE_RTTY | RIG_MODE_RTTYR, 0, 10, 900 },
+ { RIG_MODE_SSB | RIG_MODE_FM | RIG_MODE_RTTY | RIG_MODE_RTTYR, 10, 1, 1000 },
+ { RIG_MODE_AM, 0, 0, 0 },
+ { RIG_MODE_AM, 0, 1, 100 },
+ { RIG_MODE_AM, 0, 2, 200 },
+ { RIG_MODE_AM, 0, 3, 500 },
+ { RIG_MODE_SSB | RIG_MODE_RTTY | RIG_MODE_RTTYR | RIG_MODE_FM | RIG_MODE_AM, 1, 0, 2500 },
+ { RIG_MODE_SSB | RIG_MODE_RTTY | RIG_MODE_RTTYR | RIG_MODE_FM | RIG_MODE_AM, 1, 1, 1000 },
+ { RIG_MODE_NONE, 0, -1, -1 },
+};
+
static struct kenwood_priv_caps ts2000_priv_caps =
{
.cmdtrm = EOM_KEN,
+ .filter_width = ts2000_filter_width,
+ .slope_filter_high = ts2000_slope_filter_high,
+ .slope_filter_low = ts2000_slope_filter_low,
};
/* memory capabilities */
@@ -118,1059 +257,1650 @@ static struct kenwood_priv_caps ts2000_priv_caps =
/*
- * ts2000 rig capabilities.
- *
- * part of infos comes from http://www.kenwood.net/
+ * Function definitions below
*/
-const struct rig_caps ts2000_caps =
+
+int ts2000_init(RIG *rig)
{
- RIG_MODEL(RIG_MODEL_TS2000),
- .model_name = "TS-2000",
- .mfg_name = "Kenwood",
- .version = BACKEND_VER ".0",
- .copyright = "LGPL",
- .status = RIG_STATUS_STABLE,
- .rig_type = RIG_TYPE_TRANSCEIVER,
- .ptt_type = RIG_PTT_RIG,
- .dcd_type = RIG_DCD_RIG,
- .port_type = RIG_PORT_SERIAL,
- .serial_rate_min = 1200,
- .serial_rate_max = 57600,
- .serial_data_bits = 8,
- .serial_stop_bits = 1,
- .serial_parity = RIG_PARITY_NONE,
- .serial_handshake = RIG_HANDSHAKE_NONE,
- .write_delay = 0,
- .post_write_delay = 0, /* ms */
- .timeout = 200,
- .retry = 10,
+ struct kenwood_priv_data *priv;
+ int retval;
- .has_get_func = TS2000_FUNC_ALL,
- .has_set_func = TS2000_FUNC_ALL,
- .has_get_level = TS2000_LEVEL_ALL,
- .has_set_level = RIG_LEVEL_SET(TS2000_LEVEL_ALL),
- .has_get_parm = RIG_PARM_NONE,
- .has_set_parm = RIG_PARM_NONE, /* FIXME: parms */
- .level_gran =
+ ENTERFUNC;
+
+ retval = kenwood_init(rig);
+
+ if (retval != RIG_OK)
{
-#include "level_gran_kenwood.h"
- },
- .parm_gran = {},
- .vfo_ops = TS2000_VFO_OP,
- .scan_ops = TS2000_SCAN_OP,
- .ctcss_list = ts2000_ctcss_list,
- .dcs_list = ts2000_dcs_list,
- .preamp = { 20, RIG_DBLST_END, }, /* FIXME: real preamp? */
- .attenuator = { 20, RIG_DBLST_END, },
- .max_rit = kHz(20),
- .max_xit = kHz(20),
- .max_ifshift = kHz(1),
- .targetable_vfo = RIG_TARGETABLE_FREQ,
- .transceive = RIG_TRN_RIG,
- .agc_level_count = 5,
- .agc_levels = { RIG_AGC_OFF, RIG_AGC_SLOW, RIG_AGC_MEDIUM, RIG_AGC_FAST, RIG_AGC_ON },
- .bank_qty = 0,
- .chan_desc_sz = 7,
+ return retval;
+ }
- .chan_list = {
- { 0, 299, RIG_MTYPE_MEM, TS2000_MEM_CAP },
- RIG_CHAN_END,
- },
+ priv = (struct kenwood_priv_data *) rig->state.priv;
- .rx_range_list1 = {
- {kHz(300), MHz(60), TS2000_ALL_MODES, -1, -1, TS2000_MAINVFO, TS2000_ANTS},
- {MHz(144), MHz(146), TS2000_ALL_MODES, -1, -1, TS2000_MAINVFO},
- {MHz(430), MHz(440), TS2000_ALL_MODES, -1, -1, TS2000_MAINVFO},
- {MHz(144), MHz(146), TS2000_ALL_MODES, -1, -1, TS2000_SUBVFO},
- {MHz(430), MHz(440), TS2000_ALL_MODES, -1, -1, TS2000_SUBVFO},
- RIG_FRNG_END,
- }, /* rx range */
- .tx_range_list1 = {
- {kHz(1830), kHz(1850), TS2000_OTHER_TX_MODES, W(5), W(100), TS2000_MAINVFO, TS2000_ANTS},
- {kHz(1830), kHz(1850), TS2000_AM_TX_MODES, 2000, 25000, TS2000_MAINVFO, TS2000_ANTS},
- {kHz(3500), kHz(3800), TS2000_OTHER_TX_MODES, W(5), W(100), TS2000_MAINVFO, TS2000_ANTS},
- {kHz(3500), kHz(3800), TS2000_AM_TX_MODES, W(5), W(25), TS2000_MAINVFO, TS2000_ANTS},
- {MHz(7), kHz(7100), TS2000_OTHER_TX_MODES, W(5), W(100), TS2000_MAINVFO, TS2000_ANTS},
- {MHz(7), kHz(7100), TS2000_AM_TX_MODES, W(5), W(25), TS2000_MAINVFO, TS2000_ANTS},
- {MHz(10.1), MHz(10.15), TS2000_OTHER_TX_MODES, W(5), W(100), TS2000_MAINVFO, TS2000_ANTS},
- {MHz(10.1), MHz(10.15), TS2000_AM_TX_MODES, W(5), W(25), TS2000_MAINVFO, TS2000_ANTS},
- {MHz(14), kHz(14350), TS2000_OTHER_TX_MODES, W(5), W(100), TS2000_MAINVFO, TS2000_ANTS},
- {MHz(14), kHz(14350), TS2000_AM_TX_MODES, W(5), W(25), TS2000_MAINVFO, TS2000_ANTS},
- {kHz(18068), kHz(18168), TS2000_OTHER_TX_MODES, W(5), W(100), TS2000_MAINVFO, TS2000_ANTS},
- {kHz(18068), kHz(18168), TS2000_AM_TX_MODES, W(5), W(25), TS2000_MAINVFO, TS2000_ANTS},
- {MHz(21), kHz(21450), TS2000_OTHER_TX_MODES, W(5), W(100), TS2000_MAINVFO, TS2000_ANTS},
- {MHz(21), kHz(21450), TS2000_AM_TX_MODES, W(5), W(25), TS2000_MAINVFO, TS2000_ANTS},
- {kHz(24890), kHz(24990), TS2000_OTHER_TX_MODES, W(5), W(100), TS2000_MAINVFO, TS2000_ANTS},
- {kHz(24890), kHz(24990), TS2000_AM_TX_MODES, W(5), W(25), TS2000_MAINVFO, TS2000_ANTS},
- {MHz(28), kHz(29700), TS2000_OTHER_TX_MODES, W(5), W(100), TS2000_MAINVFO, TS2000_ANTS},
- {MHz(28), kHz(29700), TS2000_AM_TX_MODES, W(5), W(25), TS2000_MAINVFO, TS2000_ANTS},
- {MHz(50), MHz(50.2), TS2000_OTHER_TX_MODES, W(5), W(100), TS2000_MAINVFO, TS2000_ANTS},
- {MHz(50), MHz(50.2), TS2000_AM_TX_MODES, W(5), W(25), TS2000_MAINVFO, TS2000_ANTS},
- {MHz(144), MHz(146), TS2000_OTHER_TX_MODES, W(5), W(100), TS2000_MAINVFO},
- {MHz(144), MHz(146), TS2000_AM_TX_MODES, W(5), W(25), TS2000_MAINVFO},
- {MHz(430), MHz(440), TS2000_OTHER_TX_MODES, W(5), W(50), TS2000_MAINVFO},
- {MHz(430), MHz(440), TS2000_AM_TX_MODES, W(5), W(12.5), TS2000_MAINVFO},
- RIG_FRNG_END,
- }, /* tx range */
+ priv->ag_format = 3;
+ priv->micgain_min = 0;
+ priv->micgain_max = 100;
- .rx_range_list2 = {
- {kHz(300), MHz(60), TS2000_ALL_MODES, -1, -1, TS2000_MAINVFO, TS2000_ANTS},
- {MHz(142), MHz(152), TS2000_ALL_MODES, -1, -1, TS2000_MAINVFO},
- {MHz(420), MHz(450), TS2000_ALL_MODES, -1, -1, TS2000_MAINVFO},
- {MHz(118), MHz(174), TS2000_ALL_MODES, -1, -1, TS2000_SUBVFO},
- {MHz(220), MHz(512), TS2000_ALL_MODES, -1, -1, TS2000_SUBVFO},
- RIG_FRNG_END,
- }, /* rx range */
- .tx_range_list2 = {
- {kHz(1800), MHz(2), TS2000_OTHER_TX_MODES, W(5), W(100), TS2000_MAINVFO, TS2000_ANTS},
- {kHz(1800), MHz(2), TS2000_AM_TX_MODES, 2000, 25000, TS2000_MAINVFO, TS2000_ANTS},
- {kHz(3500), MHz(4), TS2000_OTHER_TX_MODES, W(5), W(100), TS2000_MAINVFO, TS2000_ANTS},
- {kHz(3500), MHz(4), TS2000_AM_TX_MODES, W(5), W(25), TS2000_MAINVFO, TS2000_ANTS},
- {MHz(7), kHz(7300), TS2000_OTHER_TX_MODES, W(5), W(100), TS2000_MAINVFO, TS2000_ANTS},
- {MHz(7), kHz(7300), TS2000_AM_TX_MODES, W(5), W(25), TS2000_MAINVFO, TS2000_ANTS},
- {MHz(10.1), MHz(10.15), TS2000_OTHER_TX_MODES, W(5), W(100), TS2000_MAINVFO, TS2000_ANTS},
- {MHz(10.1), MHz(10.15), TS2000_AM_TX_MODES, W(5), W(25), TS2000_MAINVFO, TS2000_ANTS},
- {MHz(14), kHz(14350), TS2000_OTHER_TX_MODES, W(5), W(100), TS2000_MAINVFO, TS2000_ANTS},
- {MHz(14), kHz(14350), TS2000_AM_TX_MODES, W(5), W(25), TS2000_MAINVFO, TS2000_ANTS},
- {kHz(18068), kHz(18168), TS2000_OTHER_TX_MODES, W(5), W(100), TS2000_MAINVFO, TS2000_ANTS},
- {kHz(18068), kHz(18168), TS2000_AM_TX_MODES, W(5), W(25), TS2000_MAINVFO, TS2000_ANTS},
- {MHz(21), kHz(21450), TS2000_OTHER_TX_MODES, W(5), W(100), TS2000_MAINVFO, TS2000_ANTS},
- {MHz(21), kHz(21450), TS2000_AM_TX_MODES, W(5), W(25), TS2000_MAINVFO, TS2000_ANTS},
- {kHz(24890), kHz(24990), TS2000_OTHER_TX_MODES, W(5), W(100), TS2000_MAINVFO, TS2000_ANTS},
- {kHz(24890), kHz(24990), TS2000_AM_TX_MODES, W(5), W(25), TS2000_MAINVFO, TS2000_ANTS},
- {MHz(28), kHz(29700), TS2000_OTHER_TX_MODES, W(5), W(100), TS2000_MAINVFO, TS2000_ANTS},
- {MHz(28), kHz(29700), TS2000_AM_TX_MODES, W(5), W(25), TS2000_MAINVFO, TS2000_ANTS},
- {MHz(50), MHz(54), TS2000_OTHER_TX_MODES, W(5), W(100), TS2000_MAINVFO, TS2000_ANTS},
- {MHz(50), MHz(54), TS2000_AM_TX_MODES, W(5), W(25), TS2000_MAINVFO, TS2000_ANTS},
- {MHz(144), MHz(148), TS2000_OTHER_TX_MODES, W(5), W(100), TS2000_MAINVFO},
- {MHz(144), MHz(148), TS2000_AM_TX_MODES, W(5), W(25), TS2000_MAINVFO},
- {MHz(430), MHz(450), TS2000_OTHER_TX_MODES, W(5), W(50), TS2000_MAINVFO},
- {MHz(430), MHz(450), TS2000_AM_TX_MODES, W(5), W(12.5), TS2000_MAINVFO},
- RIG_FRNG_END,
- }, /* tx range */
- .tuning_steps = {
- {RIG_MODE_SSB | RIG_MODE_CW | RIG_MODE_RTTY, 1},
- {TS2000_ALL_MODES, 10},
- {TS2000_ALL_MODES, 100},
- {TS2000_ALL_MODES, kHz(1)},
- {TS2000_ALL_MODES, kHz(2.5)},
- {TS2000_ALL_MODES, kHz(5)},
- {RIG_MODE_AM | RIG_MODE_FM, kHz(6.25)},
- {TS2000_ALL_MODES, kHz(10)},
- {RIG_MODE_AM | RIG_MODE_FM, kHz(12.5)},
- {RIG_MODE_AM | RIG_MODE_FM, kHz(12.5)},
- {RIG_MODE_AM | RIG_MODE_FM, kHz(15)},
- {RIG_MODE_AM | RIG_MODE_FM, kHz(20)},
- {RIG_MODE_AM | RIG_MODE_FM, kHz(25)},
- {RIG_MODE_AM | RIG_MODE_FM, kHz(30)},
- {RIG_MODE_AM | RIG_MODE_FM, kHz(50)},
- {RIG_MODE_AM | RIG_MODE_FM, kHz(100)},
- {TS2000_ALL_MODES, MHz(1)},
- {TS2000_ALL_MODES, 0}, /* any tuning step */
- RIG_TS_END,
- },
+ RETURNFUNC(RIG_OK);
+}
- /* mode/filter list, remember: order matters! */
- .filters = {
- {RIG_MODE_SSB, kHz(2.2)},
- {RIG_MODE_CW, Hz(600)},
- {RIG_MODE_RTTY, Hz(1500)},
- {RIG_MODE_AM, kHz(6)},
- {RIG_MODE_FM | RIG_MODE_AM, kHz(12)},
- RIG_FLT_END,
- },
+static int ts2000_set_ex_menu(RIG *rig, int number, int value_len, int value)
+{
+ char buf[20];
- .str_cal = TS2000_STR_CAL,
+ ENTERFUNC;
- .priv = (void *)& ts2000_priv_caps,
+ SNPRINTF(buf, sizeof(buf), "EX%03d0000%0*d", number, value_len, value);
- .rig_init = kenwood_init,
- .rig_open = kenwood_open,
- .rig_close = kenwood_close,
- .rig_cleanup = kenwood_cleanup,
- .set_freq = kenwood_set_freq,
- .get_freq = kenwood_get_freq,
- .set_rit = kenwood_set_rit,
- .get_rit = kenwood_get_rit,
- .set_xit = kenwood_set_xit,
- .get_xit = kenwood_get_xit,
- .set_mode = kenwood_set_mode,
- .get_mode = kenwood_get_mode,
- .set_vfo = kenwood_set_vfo,
- .get_vfo = kenwood_get_vfo_if,
- .set_split_vfo = kenwood_set_split_vfo,
- .get_split_vfo = kenwood_get_split_vfo_if,
- .set_ctcss_tone = kenwood_set_ctcss_tone_tn,
- .get_ctcss_tone = kenwood_get_ctcss_tone,
- .set_ctcss_sql = kenwood_set_ctcss_sql,
- .get_ctcss_sql = kenwood_get_ctcss_sql,
- .get_ptt = kenwood_get_ptt,
- .set_ptt = kenwood_set_ptt,
- .get_dcd = kenwood_get_dcd,
- .set_func = kenwood_set_func,
- .get_func = kenwood_get_func,
- .set_level = kenwood_set_level,
- .get_level = ts2000_get_level,
- .set_ant = kenwood_set_ant,
- .get_ant = kenwood_get_ant,
- .send_morse = kenwood_send_morse,
- .wait_morse = rig_wait_morse,
- .vfo_op = kenwood_vfo_op,
- .scan = kenwood_scan,
- .set_mem = kenwood_set_mem,
- .get_mem = kenwood_get_mem,
- .get_channel = ts2000_get_channel,
- .set_channel = ts2000_set_channel,
- .set_trn = kenwood_set_trn,
- .get_trn = kenwood_get_trn,
- .set_powerstat = kenwood_set_powerstat,
- .get_powerstat = kenwood_get_powerstat,
- .get_info = kenwood_get_info,
- .reset = kenwood_reset,
+ RETURNFUNC(kenwood_transaction(rig, buf, NULL, 0));
+}
- .hamlib_check_rig_caps = HAMLIB_CHECK_RIG_CAPS
-};
+static int ts2000_get_ex_menu(RIG *rig, int number, int value_len, int *value)
+{
+ int retval;
+ char buf[20];
+ char ackbuf[20];
-/*
- * Function definitions below
- */
+ rig_debug(RIG_DEBUG_TRACE, "%s called\n", __func__);
-/*
- * ts2000_get_channel
- * Read command format:
- M|R|P1|P2|P3|P3|;|
- * P1: 0 - RX frequency, 1 - TX frequency
- Memory channel 290 ~ 299: P1=0 (start frequency), P1=1 (end frequency)
- P2 - bank number
- allowed values: <space>, 0, 1 or 2
- P3 - channel number 00-99
+ SNPRINTF(buf, sizeof(buf), "EX%03d0000", number);
- Returned value:
- M | R |P1 |P2 |P3 |P3 |P4 |P4 |P4 |P4 |
- P4 |P4 |P4 |P4 |P4 |P4 |P4 |P5 |P6 |P7 |
- P8 |P8 |P9 |P9 |P10|P10|P10|P11|P12|P13|
- P13|P13|P13|P13|P13|P13|P13|P13|P14|P14|
- P15|P16|P16|P16|P16|P16|P16|P16|P16| ; |
- P1 - P3 described above
- P4: Frequency in Hz (11-digit).
- P5: Mode. 1: LSB, 2: USB, 3: CW, 4: FM, 5: AM, 6: FSK, 7: CR-R, 8: Reserved, 9: FSK-R
- P6: Lockout status. 0: Lockout OFF, 1: Lockout ON.
- P7: 0: OFF, 1: TONE, 2: CTCSS, 3: DCS.
- P8: Tone Number. Allowed values 01 (67Hz) - 38 (250.3Hz)
- P9: CTCSS tone number. Allowed values 01 (67Hz) - 38 (250.3Hz)
- P10: DCS code. Allowed values 000 (023 DCS code) to 103 (754 DCS code).
- P11: REVERSE status.
- P12: SHIFT status. 0: Simplex, 1: +, 2: –, 3: = (All E-types)
- P13: Offset frequency in Hz (9-digit).
- Allowed values 000000000 - 059950000 in steps of 50000. Unused digits must be 0.
- P14: Step size. Allowed values:
- for SSB, CW, FSK mode: 00 - 03
- 00: 1 kHz, 01: 2.5 kHz, 02: 5 kHz, 03: 10 kHz
- for AM, FM mode: 00 - 09
- 00: 5 kHz, 01: 6.25 kHz, 02: 10 kHz, 03: 12.5 kHz, 04: 15 kHz,
- 05: 20 kHz, 06: 25 kHz, 07: 30 kHz, 08: 50 kHz, 09: 100 kHz
- P15: Memory Group number (0 ~ 9).
- P16: Memory name. A maximum of 8 characters.
-
- */
-
-int ts2000_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only)
-{
- int err;
- int tmp;
- size_t length;
- char buf[52];
- char cmd[8];
- struct kenwood_priv_caps *caps = kenwood_caps(rig);
-
- rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
+ retval = kenwood_safe_transaction(rig, buf, ackbuf, sizeof(ackbuf),
+ 9 + value_len);
- if (!chan || chan->vfo != RIG_VFO_MEM)
+ if (retval != RIG_OK)
{
- return -RIG_EINVAL;
+ RETURNFUNC2(retval);
}
- /* put channel num in the command string */
- SNPRINTF(cmd, sizeof(cmd), "MR0%03d;", chan->channel_num);
+ sscanf(ackbuf + 9, "%d", value);
- err = kenwood_transaction(rig, cmd, buf, sizeof(buf));
+ RETURNFUNC2(RIG_OK);
+}
- if (err != RIG_OK)
- {
- return err;
- }
+static int ts2000_set_func(RIG *rig, vfo_t vfo, setting_t func, int status)
+{
+ char buf[20];
- length = strlen(buf);
- memset(chan, 0x00, sizeof(channel_t));
+ rig_debug(RIG_DEBUG_TRACE, "%s called\n", __func__);
- chan->vfo = RIG_VFO_MEM;
+ switch (func)
+ {
+ case RIG_FUNC_MON:
+ SNPRINTF(buf, sizeof(buf), "ML00%c", (status == 0) ? '0' : '1');
+ RETURNFUNC(kenwood_transaction(rig, buf, NULL, 0));
- /* parse from right to left */
+ case RIG_FUNC_LOCK:
+ SNPRINTF(buf, sizeof(buf), "LK%c%c", (status == 0) ? '0' : '1',
+ (status == 0) ? '0' : '1');
+ RETURNFUNC(kenwood_transaction(rig, buf, NULL, 0));
- /* XXX based on the available documentation, there is no command
- * to read out the filters of a given memory channel. The rig, however,
- * stores this information.
- */
- /* First check if a name is assigned.
- Name is returned at positions 41-48 (counting from 0) */
- if (length > 41)
- {
-// rig_debug(RIG_DEBUG_VERBOSE, "Copying channel description: %s\n", &buf[ 41 ] );
- strcpy(chan->channel_desc, &buf[ 41 ]);
+ default:
+ return kenwood_set_func(rig, vfo, func, status);
}
+}
- /* Memory group no */
- chan->scan_group = buf[ 40 ] - '0';
- /* Fields 38-39 contain tuning step as a number 00 - 09.
- Tuning step depends on this number and the mode,
- just save it for now */
- buf[ 40 ] = '\0';
- tmp = atoi(&buf[ 38]);
- /* Offset frequency */
- buf[ 38 ] = '\0';
- chan->rptr_offs = atoi(&buf[ 29 ]);
+static int ts2000_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status)
+{
+ char buf[20];
+ int retval;
- /* Shift type
- WARNING: '=' shift type not programmed */
- if (buf[ 28 ] == '1')
+ ENTERFUNC;
+
+ switch (func)
{
- chan->rptr_shift = RIG_RPT_SHIFT_PLUS;
- }
- else
+ case RIG_FUNC_MON:
{
- if (buf[ 28 ] == '2')
- {
- chan->rptr_shift = RIG_RPT_SHIFT_MINUS;
- }
- else
+ int raw_value;
+ retval = kenwood_safe_transaction(rig, "ML", buf, sizeof(buf), 5);
+
+ if (retval != RIG_OK)
{
- chan->rptr_shift = RIG_RPT_SHIFT_NONE;
+ RETURNFUNC(retval);
}
- }
- /* Reverse status */
- if (buf[27] == '1')
- {
- chan->funcs |= RIG_FUNC_REV;
- }
+ sscanf(buf, "ML%d", &raw_value);
- /* Check for tone, CTCSS and DCS */
- /* DCS code first */
- if (buf[ 19 ] == '3')
- {
- if (rig->caps->dcs_list)
- {
- buf[ 27 ] = '\0';
- chan->dcs_code = rig->caps->dcs_list[ atoi(&buf[ 24 ]) ];
- chan->dcs_sql = chan->dcs_code;
- chan->ctcss_tone = 0;
- chan->ctcss_sql = 0;
- }
+ *status = (raw_value > 0);
+ break;
}
- else
- {
- chan->dcs_code = 0;
- chan->dcs_sql = 0;
- /* CTCSS code
- Caution, CTCSS codes, unlike DCS codes, are numbered from 1! */
- buf[ 24 ] = '\0';
- if (buf[ 19 ] == '2')
- {
- chan->funcs |= RIG_FUNC_TSQL;
+ case RIG_FUNC_LOCK:
+ retval = kenwood_safe_transaction(rig, "LK", buf, sizeof(buf), 4);
- if (rig->caps->ctcss_list)
- {
- chan->ctcss_sql = rig->caps->ctcss_list[ atoi(&buf[22]) - 1 ];
- chan->ctcss_tone = 0;
- }
- }
- else
+ if (retval != RIG_OK)
{
- chan->ctcss_sql = 0;
+ RETURNFUNC(retval);
+ }
- /* CTCSS tone */
- if (buf[ 19 ] == '1')
- {
- chan->funcs |= RIG_FUNC_TONE;
- buf[ 22 ] = '\0';
+ *status = buf[2] != '0' || buf[3] != '0';
+ break;
- if (rig->caps->ctcss_list)
- {
- chan->ctcss_tone = rig->caps->ctcss_list[ atoi(&buf[20]) - 1 ];
- }
- }
- else
- {
- chan->ctcss_tone = 0;
- }
- }
+ default:
+ return kenwood_get_func(rig, vfo, func, status);
}
+ RETURNFUNC(RIG_OK);
+}
+
+/*
+ * WARNING: The commands differ slightly from the general versions in kenwood.c
+ * e.g.: "SQ"=>"SQ0" , "AG"=>"AG0"
+ */
+static int ts2000_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
+{
+ char levelbuf[16];
+ int kenwood_val;
+ char vfo_num = (vfo == RIG_VFO_C) ? '1' : '0';
+
+ rig_debug(RIG_DEBUG_TRACE, "%s called\n", __func__);
- /* memory lockout */
- if (buf[18] == '1')
+ switch (level)
{
- chan->flags |= RIG_CHFLAG_SKIP;
- }
+ case RIG_LEVEL_RF:
+ kenwood_val = val.f * 255;
+ SNPRINTF(levelbuf, sizeof(levelbuf), "RG%03d", kenwood_val);
+ break;
- /* mode */
- chan->mode = kenwood2rmode(buf[17] - '0', caps->mode_table);
+ case RIG_LEVEL_AF:
+ return kenwood_set_level(rig, vfo, level, val);
- /* Now we have the mode, let's finish the tuning step */
- if ((chan->mode == RIG_MODE_AM) || (chan->mode == RIG_MODE_FM))
- {
- switch (tmp)
+ case RIG_LEVEL_SQL:
+ kenwood_val = val.f * 255;
+ SNPRINTF(levelbuf, sizeof(levelbuf), "SQ%c%03d", vfo_num, kenwood_val);
+ break;
+
+ case RIG_LEVEL_AGC:
+ /* Possible values for TS-2000 are 0(=off)-020(=slow) */
+
+ switch (val.i)
{
- case 0: chan->tuning_step = kHz(5); break;
+ case RIG_AGC_OFF:
+ kenwood_val = 0;
+ break;
- case 1: chan->tuning_step = kHz(6.25); break;
+ case RIG_AGC_SUPERFAST:
+ kenwood_val = 1;
+ break;
- case 2: chan->tuning_step = kHz(10); break;
+ case RIG_AGC_FAST:
+ kenwood_val = 5;
+ break;
- case 3: chan->tuning_step = kHz(12.5); break;
+ case RIG_AGC_MEDIUM:
+ kenwood_val = 10;
+ break;
- case 4: chan->tuning_step = kHz(15); break;
+ case RIG_AGC_SLOW:
+ kenwood_val = 20;
+ break;
- case 5: chan->tuning_step = kHz(20); break;
+ default:
+ rig_debug(RIG_DEBUG_ERR, "%s: unsupported agc value", __func__);
+ return -RIG_EINVAL;
+ }
- case 6: chan->tuning_step = kHz(25); break;
+ SNPRINTF(levelbuf, sizeof(levelbuf), "GT%03d", kenwood_val);
+ break;
- case 7: chan->tuning_step = kHz(30); break;
+ case RIG_LEVEL_MONITOR_GAIN:
+ kenwood_val = val.f * 9.0;
+ SNPRINTF(levelbuf, sizeof(levelbuf), "ML%03d", kenwood_val);
+ break;
- case 8: chan->tuning_step = kHz(50); break;
+ case RIG_LEVEL_NB:
+ kenwood_val = val.f * 10.0;
+ SNPRINTF(levelbuf, sizeof(levelbuf), "NL%03d", kenwood_val);
+ break;
- case 9: chan->tuning_step = kHz(100); break;
+ case RIG_LEVEL_NR:
+ kenwood_val = val.f * 9.0;
+ SNPRINTF(levelbuf, sizeof(levelbuf), "RL%02d", kenwood_val);
+ break;
- default: chan->tuning_step = 0;
+ case RIG_LEVEL_PREAMP:
+ if (val.i != 12 && val.i != 0)
+ {
+ RETURNFUNC(-RIG_EINVAL);
}
- }
- else
- {
- switch (tmp)
+
+ SNPRINTF(levelbuf, sizeof(levelbuf), "PA%c", (val.i == 12) ? '1' : '0');
+ break;
+
+ case RIG_LEVEL_ATT:
+ if (val.i != 12 && val.i != 0)
{
- case 0: chan->tuning_step = kHz(1); break;
+ RETURNFUNC(-RIG_EINVAL);
+ }
- case 1: chan->tuning_step = kHz(2.5); break;
+ SNPRINTF(levelbuf, sizeof(levelbuf), "RA%02d", (val.i == 12) ? 1 : 0);
+ break;
- case 2: chan->tuning_step = kHz(5); break;
+ case RIG_LEVEL_METER:
+ switch (val.i)
+ {
+ case RIG_METER_SWR:
+ kenwood_val = 1;
+ break;
- case 3: chan->tuning_step = kHz(10); break;
+ case RIG_METER_COMP:
+ kenwood_val = 2;
+ break;
- default: chan->tuning_step = 0;
+ case RIG_METER_ALC:
+ kenwood_val = 3;
+ break;
+
+ default:
+ RETURNFUNC(-RIG_EINVAL);
}
- }
- /* Frequency */
- buf[17] = '\0';
- chan->freq = atoi(&buf[6]);
+ SNPRINTF(levelbuf, sizeof(levelbuf), "RM%d", kenwood_val);
+ break;
- if (chan->freq == RIG_FREQ_NONE)
- {
- return -RIG_ENAVAIL;
+ case RIG_LEVEL_CWPITCH:
+ if (val.i > 1000 || val.i < 400)
+ {
+ RETURNFUNC(-RIG_EINVAL);
+ }
+
+ RETURNFUNC(ts2000_set_ex_menu(rig, 31, 2, (val.i - 400) / 50));
+
+ default:
+ return kenwood_set_level(rig, vfo, level, val);
}
- buf[6] = '\0';
- chan->channel_num = atoi(&buf[3]);
+ return kenwood_transaction(rig, levelbuf, NULL, 0);
+}
+// TS-2000 can only read one meter at a time and the user must select
+// the meter using RIG_LEVEL_METER. This function returns the meter value if
+// the selected meter matches the expected meter.
+static int ts2000_read_meter(RIG *rig, int expected_meter, int *value)
+{
+ int retval;
+ char cmdbuf[8];
+ struct rig_state *rs = &rig->state;
+ char ackbuf[32];
+ int expected_len = 8;
+ int read_meter;
+ int read_value;
- /* Check split freq */
- cmd[2] = '1';
- err = kenwood_transaction(rig, cmd, buf, sizeof(buf));
+ ENTERFUNC;
- if (err != RIG_OK)
+ SNPRINTF(cmdbuf, sizeof(cmdbuf), "RM;");
+
+ retval = write_block(&rs->rigport, (unsigned char *) cmdbuf, strlen(cmdbuf));
+
+ rig_debug(RIG_DEBUG_TRACE, "%s: write_block retval=%d\n", __func__, retval);
+
+ if (retval != RIG_OK)
{
- return err;
+ RETURNFUNC(retval);
}
- chan->tx_mode = kenwood2rmode(buf[17] - '0', caps->mode_table);
+ // TS-2000 returns values for a single meter at the same ti...
[truncated message content] |
|
From: n0nb <n0...@us...> - 2023-04-05 01:53:27
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Hamlib -- Ham radio control libraries".
The branch, master has been updated
via 99170c10259dbe0b4903ce6ce3d47bac623769de (commit)
via 3053263c5203d4c1a6c9e3fef59dcc80423a4647 (commit)
via 38d685869827a0cdad53a726bc2a51a2015356a7 (commit)
via 1ec7dc07ec96aee27ed8c24ea5f72b75cec59646 (commit)
via 7236942d89d6f6dca2b163f9073c48c09fd3a7c2 (commit)
via c331899d94424bffd4ad4d5b214ad7249f55b08a (commit)
via 9d7ac000e5e315b25d484d5bdd109cc026af801d (commit)
via 8d407320648445a50b98119aae53ed5081a617b5 (commit)
via f11db5c94955b87e7f2f0ce4b935d3d2f851ebed (commit)
via bbda209fc0ab7bf1e139b253d165900729e7f4d6 (commit)
via 7395ef0e3f1e34ae43f01a4938f021cd3f2c0fde (commit)
via 403ec07b6b5c7d68d1382bbf99ed960524e136c3 (commit)
via 79db09c201ea25abb07f0c363819f7c4eaab4161 (commit)
via 224820fb44c262c9c966becc9afa795c165808cc (commit)
via 5aab96beff06f89feacef864eb1d0d107d0a06eb (commit)
via d34983f495520e2136f150dd93000f729f3d9d57 (commit)
via d522967b320a93bc01529bd0ebb0b3a97f6acc6f (commit)
via 692deca638a548d464ba102cc50910531f19bb23 (commit)
via 30b2087f5d3b80ce8badf7d860d98908df5a5d59 (commit)
via 2db37fe7dbca630a95c2437cd4de8500cd80b838 (commit)
via dd75f55b1fcb3ef1e3e9049dfe8af5a4f1e3af67 (commit)
via ac197389a2fdd958c6566a3a235fa2aaf4172594 (commit)
via 8cce59b048158e92a32a455d1f30b82a968e57fb (commit)
via 8cdb21b6f385e36cd3c5381817108cc0435f0b32 (commit)
via 7914842c2dfeef3b9cd4e752c404b71b5ce53935 (commit)
via 9f960fa5317aa98942d89243e6ecc2c69b92b4ac (commit)
via 2712c57058b05723cb5b3ee523755052391c9eab (commit)
via d893de407ebac2529709d244b2a1c129790e6691 (commit)
via 56907442abd2e86940a0659a2d22e1cd9f01baa0 (commit)
via cf956daf17ee0099b9151002ece37ce1d268f911 (commit)
via 3254ac70a1583f04b6b165a8d526e930a97c4d93 (commit)
via 0f0bbeb612b322f8929385e821c8f6d5689627e7 (commit)
via 558747fab36994493aaa12c0fcfa1011aa0cdcb4 (commit)
via 4004046d49a6880a0a11a8bcc5e25142c17d25ae (commit)
via 26d3e79cf5dc3fbca64a6fd6c68ed58fdcfbaa3c (commit)
via 8e24746a3e14d0e3ed78e42d37a5132b99573b1e (commit)
via 3c94527fb6a33db6a1f70955bc56e86da6be95d2 (commit)
via 38cc75c5681b932809634724ef1adfefb467461d (commit)
via 6de5aa78386a493a64eec12bfcc8814c8e9f8dc7 (commit)
via 389ee47f76eb83b0b722f4d1a68caa786870b977 (commit)
via 113cad3ee179f1260e234c8f3d5d5711295542cc (commit)
via 2adf0490842e14c2f10921235e2288ceb75f29e0 (commit)
via 0f7908be22cd238921be2a66fc6389b880514e00 (commit)
via 5e00bed9cbbaee517260389bb75be114403973a7 (commit)
via fd473062d1813a6fc8660a4cd5e305621a7e52c2 (commit)
via 18c4eb46315ef44bdf22f5ac7774ba017e186564 (commit)
via e022ff2314016d1ec62b00068f28dea22800a25a (commit)
via 01a2dd23ed256eeeb190bbf813232a658b28ffc7 (commit)
via 51c88e0a6d0d6e3a3d3b73f4217f7adcee6939c6 (commit)
via c3e7021c61fbdad5b83360c0bcdfc26945c825fc (commit)
via e9979846623935c217c023b26f2057838b3a153d (commit)
via b02ff9daa13a578879d5c41ff0e78e88795a7a02 (commit)
via c9e2c5f6972cfbd058ba7d03a405c867c72bdf13 (commit)
via c3265dc905058ac7133897121d77f634b6d05853 (commit)
via 52d41236a72512fc25a2aad289b87691bafb9788 (commit)
via 57b7cd1860ce5bb8c46ab686260a5176a5bced7f (commit)
via 24a4a094843c5c149be76277a9ab3704b8b097b7 (commit)
via e05eb7743b40acaf3bd942ceb1feb86fc2cc985b (commit)
via dff890a143c78e2c7e166cad9b826434a07fee36 (commit)
via 9823a41f48ba6ff2d622e88afaa160c7ea9a550a (commit)
via 8e08385d2dd31912d1face09eb69772d7b7daaa5 (commit)
via a64bb4fc7dc4f6f7c0d65e64cab0ec9cbbd3affb (commit)
via 631a7a5faa3327cc14df79934788709f8f41a2fc (commit)
via 16f03dcdfb80583fcdac0167f4d03cadae71cdcb (commit)
via f5c26bf235c24aa7c1f1f02bf11f06a4c96e2dd3 (commit)
via 19b2c33e62a5ee71568ad911dd2b33cd97859153 (commit)
via 09a6bbf7c7e97d156cef60db9ecf8c3f51426739 (commit)
via 77dd85289c6c9e83546d16ad585167b09b031474 (commit)
via 94b8e53be97ddbd05ee2df2186846817f494058f (commit)
via f17f6f0f42ce99c130618fa02b4e3955a461b622 (commit)
via 0e6fd996bc37a3ec1b14f4896569a88ba7601833 (commit)
via 6cf65cc0993054d13d41ac750b7102ae23f20a2a (commit)
via 2f68033840def43482389a043fc42ead934cd1d8 (commit)
via 95196ca96ca9db98f0cf42f2eba9a8a5d819194e (commit)
via ec0645780cfc20a252b31ad84429e77e2e1ebe8f (commit)
via 0591aee8e6062bf42e088495abcbdd2b58f5c2fb (commit)
via edc18103f005f05c0ad5458970b9da7b96c516a1 (commit)
via a8aba7c13b523915cfa554f63de0d8140e3a9cdb (commit)
via 2622113d2f7069c93546fd81359a29c9bc7d0604 (commit)
via 3d4fe8fead62d864f98ba893108cceb0bafee62a (commit)
via d06244c47f4dffdf9f47172385c8dfac738c24e2 (commit)
via eb5767c0ca2590d51beb92dd73ecaed35c32df51 (commit)
via e428d824cdf238dc028ad13f773f22dbd8a96385 (commit)
via 126e7dfefd66e06a7b89fbe6c0944d780d9242af (commit)
via 9ad9f23fe170b0277a5045fc7510dd645063bea6 (commit)
via decc056662ea892cba32cc35a4a3476b7d383124 (commit)
via fe1eabf531f23f9057270a68cc18905567c91c05 (commit)
via ee7ecc71a1d2a0945e3629e74b40f1fe60da7ddf (commit)
via 07fc69f3e8aa34f463f22dd27e8e25aa5573ec3c (commit)
via a9b9154a2d721948f124553b1d952a703f1c268a (commit)
via 14aa095362c082ab56d4823fc350a37f2f70dc04 (commit)
via 00e2797c6fe44ca1941f374d85aae0095da972e4 (commit)
via bc476a1c948a85f8b29554c24e1e9fd349afeb79 (commit)
via f161ae7b3507e4417ca05f809ae26d7d4199730f (commit)
via f5a1dabd06fd43ddcc3cbf1a3965e36e5d9b5b28 (commit)
via a9cb12158471a6235f34658ae6fb7ae754e78809 (commit)
via 717dae50272e06b66a447ca80c83df93f4f5c349 (commit)
via fb12668f066f837f6ded07398e5c49437d8afd4e (commit)
via 514d87dcc9b7bf99225336f0885d68b19667657e (commit)
via c0030fa01de4aa20e47425b972bf7bff1206a24b (commit)
via 10ac497c0b45757ac7da7bbc84381d551380325c (commit)
via fef9737a47d0164399987960432803bfad757f1c (commit)
via dbd9ff45fa74df614d5402ab2c1d6a315c7af192 (commit)
via 3d38f8b214c9f4398f9623a38eb60ee679244baa (commit)
via 1edb21a38dd587f665131367e1df7b9daefd910b (commit)
via 51712b9a663b45e7d4c19c41a70bf7a977399b03 (commit)
via 51d95bb8f794468e2dc5aa1dff4df11a72968729 (commit)
via 3f900869917d618c9433f3cf2030c4db737a1f55 (commit)
via cdb3a60f023f4164ff070fc7db877869cf3c3724 (commit)
via 52be0797d82da0e2c957b100f9fa8f1e31718bab (commit)
via 7673abc59b2b3632d58252818a0486bb62d22f98 (commit)
via 420125b8bc5bec3e1d6d3cb1dbdab4fe3c156793 (commit)
via 72117308663f97bc7ae396a108f6c5ffd51b2258 (commit)
via 72e94b6069a2b1d4ca1e16e37c1e869e137761b8 (commit)
via 561f65a56dc7f12d879265dc24298389c39fabb7 (commit)
via 1213d874480707d6bb78ad2ff3d1ab6fc74c8592 (commit)
via d09c048161d42e237e46f2af23d43a48de044dd7 (commit)
via b6fe95ae801084f77d53800ba266b04c06ad203b (commit)
via b6ec70fcb2c27f747257dc5626463f8963f2e708 (commit)
via a04abe6e04d91dc9c3b1c2ffcee76d5c7b1d617c (commit)
via 5c170542957f7584ae2be6c5885f21d87e818a2d (commit)
via 2e894dd9cc5a3ee91dbeb27607a624ad189b3561 (commit)
via 9dbe4ef79a46a9dedc62e5362ce4acf33608d2df (commit)
via 58700c6e9f2526ef6f1f0365f76904887542e2be (commit)
via 4078fa9248a1080862c7750bee1e9cfe92576fd2 (commit)
via 111627533f3c811d4aa8e282271c8019f635f747 (commit)
via f9adf5de0a8ab7908bf295f05a3a1ac1ae6a481d (commit)
via cbd5f9ad3ea68952fec121705ce43a79723fa63a (commit)
via 1e1abaccbc32e1b2c9e7132b17b168cdea13b4d2 (commit)
via 907a178aa670d862bc7d158f2b72527e57f8876c (commit)
via 73fc563ceb69b842d7e2ceefb856c7a96a8fac45 (commit)
via e9724a905823e09627acd2054836ecd2206ce67f (commit)
via 321c3660455e718d8b2abe64b5bfb64879e1d4d9 (commit)
via cc7c335dc5b3939b6c28c19f3fa8fdf946d47be7 (commit)
via c903c09cd1d4942ba413e787fd141af22c36b196 (commit)
via b037c72c50422c3b644efdb46569065375814e94 (commit)
via 44e8389e0030606d9b786c110e7dffa60f2af9bc (commit)
via 0e9bdc5d043906cb07480191209aef5d5c11f166 (commit)
via 1efff461e384ff366df35b438e5295531eae0536 (commit)
via c055817c27f58fd98d0bdc6b918c9574ad565290 (commit)
via 8c0bb2034d34a2cac7187422688d0b349ebfb1f1 (commit)
via fa503c5b3bc7f021e938312e9f0893a3d951bf8d (commit)
via 61e4e8d6764e04fb0277fda33f414722530f2b16 (commit)
via d645bae2074eca68900c1e7917a8322b8fccf5f6 (commit)
from fa4a96e6a6c8e2ad4fcb016d6034ebfc91375a1c (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 99170c10259dbe0b4903ce6ce3d47bac623769de
Author: Mike Black W9MDB <mdb...@ya...>
Date: Thu Mar 30 22:28:09 2023 -0500
Add error message when rig is not turned on that mentions auto_power_on
diff --git a/src/rig.c b/src/rig.c
index bb0d1ee2..d08616e4 100644
--- a/src/rig.c
+++ b/src/rig.c
@@ -1280,7 +1280,12 @@ int HAMLIB_API rig_open(RIG *rig)
powerstat_t powerflag;
status = rig_get_powerstat(rig, &powerflag);
- if (status == RIG_OK && powerflag == RIG_POWER_OFF && rig->state.auto_power_on == 0) { return (-RIG_EPOWER); }
+ if (status == RIG_OK && powerflag == RIG_POWER_OFF && rig->state.auto_power_on == 0)
+ {
+ rig_debug(RIG_DEBUG_ERR, "%s: rig power is off, use --set-conf=auto_power_on if power on is wanted\n", __func__);
+
+ return (-RIG_EPOWER);
+ }
// don't need auto_power_on if power is already on
if (status == RIG_OK && powerflag == RIG_POWER_ON) { rig->state.auto_power_on = 0; }
commit 3053263c5203d4c1a6c9e3fef59dcc80423a4647
Author: Mike Black W9MDB <mdb...@ya...>
Date: Wed Mar 29 08:46:05 2023 -0500
Update NEWS
diff --git a/NEWS b/NEWS
index 25e5eeb6..d407df76 100644
--- a/NEWS
+++ b/NEWS
@@ -31,6 +31,8 @@ Version 4.6
* Fix FTDX3000 rig split
Version 4.5.5
+ * Add park to rotorez.c
+ * Fix rig power on/off from rigctl cmd line and rigctld
* Enable async mode by default to prevent WSJT-X crash on IC9700 with transceive on
* Fix IC7610 get_powerstat to disable it -- cannot read power status
* Fix K3 K22 command error for remote operations
@@ -47,7 +49,7 @@ Version 4.5.5
* Add fix for TMD700
* Improve FT-857 get_vfo response when error occurs
* Allow FT-857 to use cached vfo on get_vfo when error occurs reading EEPROM
- * Fix FTDX10 FT710 set_level AFy
+ * Fix FTDX10 FT710 set_level AF
* Fix FT-450D detection
* Fix VFO A/B swapping for gpredict -- hopefully better behavior for VFO swapping rigs
Should avoid setting RX freq while TX and avoid TX freq while RX
commit 38d685869827a0cdad53a726bc2a51a2015356a7
Author: Mike Black W9MDB <mdb...@ya...>
Date: Tue Mar 28 17:23:54 2023 -0500
Progress on Expert ampctl
diff --git a/amplifiers/expert/expert.c b/amplifiers/expert/expert.c
index 913ac6db..2be064a9 100644
--- a/amplifiers/expert/expert.c
+++ b/amplifiers/expert/expert.c
@@ -111,7 +111,7 @@ int expert_transaction(AMP *amp, const unsigned char *cmd, int cmd_len, unsigned
int loop;
char cmdbuf[64];
int checksum=0;
- int bytes;
+ int bytes = 0;
rig_debug(RIG_DEBUG_VERBOSE, "%s called, cmd=%s\n", __func__, cmd);
@@ -626,9 +626,6 @@ struct expert_priv_data *expert_priv;
* Private helper function prototypes
*/
-//static int kpa1500_send_priv_cmd(AMP *amp, const char *cmd);
-//static int kpa1500_flush_buffer(AMP *amp);
-
/* *************************************
*
* Separate model capabilities
@@ -643,7 +640,7 @@ struct expert_priv_data *expert_priv;
const struct amp_caps expert_amp_caps =
{
- AMP_MODEL(AMP_MODEL_ELECRAFT_KPA1500),
+ AMP_MODEL(AMP_MODEL_EXPERT_FA),
.model_name = "1.3K-FA/1.5K-FA/2K-FA",
.mfg_name = "Expert",
.version = "20230320.0",
@@ -693,7 +690,7 @@ const struct amp_caps expert_amp_caps =
* Send command string to amplifier
*/
-static int kpa1500_send_priv_cmd(AMP *amp, const char *cmdstr)
+static int expert_send_priv_cmd(AMP *amp, const char *cmdstr)
{
struct amp_state *rs;
int err;
diff --git a/src/amp_reg.c b/src/amp_reg.c
index 98892790..95187c4a 100644
--- a/src/amp_reg.c
+++ b/src/amp_reg.c
@@ -89,6 +89,7 @@ static struct
{ AMP_DUMMY, AMP_BACKEND_DUMMY, AMP_FUNCNAMA(dummy) },
{ AMP_ELECRAFT, AMP_BACKEND_ELECRAFT, AMP_FUNCNAMA(kpa1500) },
{ AMP_GEMINI, AMP_BACKEND_GEMINI, AMP_FUNCNAMA(gemini) },
+ { AMP_EXPERT, AMP_BACKEND_EXPERT, AMP_FUNCNAMA(expert) },
{ 0, NULL }, /* end */
};
commit 1ec7dc07ec96aee27ed8c24ea5f72b75cec59646
Author: Mike Black W9MDB <mdb...@ya...>
Date: Tue Mar 28 17:14:59 2023 -0500
Fix expert_amp_caps
diff --git a/amplifiers/expert/expert.c b/amplifiers/expert/expert.c
index 212f447a..913ac6db 100644
--- a/amplifiers/expert/expert.c
+++ b/amplifiers/expert/expert.c
@@ -641,7 +641,7 @@ struct expert_priv_data *expert_priv;
* Expert 1.3K-FA, 1.5K-FA, and 2K-FA
*/
-const struct amp_caps kpa1500_amp_caps =
+const struct amp_caps expert_amp_caps =
{
AMP_MODEL(AMP_MODEL_ELECRAFT_KPA1500),
.model_name = "1.3K-FA/1.5K-FA/2K-FA",
commit 7236942d89d6f6dca2b163f9073c48c09fd3a7c2
Author: Mike Black W9MDB <mdb...@ya...>
Date: Tue Mar 28 17:08:40 2023 -0500
Adding Expert Linear amplifier
diff --git a/amplifiers/expert/expert.c b/amplifiers/expert/expert.c
index f66256d4..212f447a 100644
--- a/amplifiers/expert/expert.c
+++ b/amplifiers/expert/expert.c
@@ -23,6 +23,7 @@
#include <string.h>
#include "expert.h"
#include "register.h"
+#include "misc.h"
struct fault_list
{
@@ -102,12 +103,15 @@ int expert_flushbuffer(AMP *amp)
return rig_flush(&rs->ampport);
}
-int expert_transaction(AMP *amp, const char *cmd, char *response, int response_len)
+int expert_transaction(AMP *amp, const unsigned char *cmd, int cmd_len, unsigned char *response, int response_len)
{
struct amp_state *rs;
int err;
int len = 0;
int loop;
+ char cmdbuf[64];
+ int checksum=0;
+ int bytes;
rig_debug(RIG_DEBUG_VERBOSE, "%s called, cmd=%s\n", __func__, cmd);
@@ -117,43 +121,35 @@ int expert_transaction(AMP *amp, const char *cmd, char *response, int response_l
rs = &->state;
- loop = 3;
-
- do // wake up the amp by sending ; until we receive ;
- {
- char c = ';';
- rig_debug(RIG_DEBUG_VERBOSE, "%s waiting for ;\n", __func__);
- err = write_block(&rs->ampport, (unsigned char *) &c, 1);
-
- if (err != RIG_OK) { return err; }
-
- len = read_string(&rs->ampport, (unsigned char *) response, response_len, ";",
- 1, 0, 1);
-
- if (len < 0) { return len; }
- }
- while (--loop > 0 && (len != 1 || response[0] != ';'));
+ cmdbuf[0] = cmdbuf[1] = cmdbuf[2] = 0x55;
+ memcpy(&cmdbuf,cmd,cmd_len);
+ for(int i=0;i<cmd_len;++i) checksum += cmd[i];
+ checksum = checksum % 256;
+ cmdbuf[3] = cmd_len;
+ cmdbuf[3+cmd_len+1] = checksum;
// Now send our command
- err = write_block(&rs->ampport, (unsigned char *) cmd, strlen(cmd));
+ err = write_block(&rs->ampport, (unsigned char *) cmdbuf, 3+cmd_len+2);
if (err != RIG_OK) { return err; }
if (response) // if response expected get it
{
response[0] = 0;
- len = read_string(&rs->ampport, (unsigned char *) response, response_len, ";",
- 1, 0, 1);
+ // read the 4-byte header x55x55x55xXX where XX is the hex # of bytes
+ len = read_block_direct(&rs->ampport, (unsigned char *) response, 4);
+ rig_debug(RIG_DEBUG_ERR, "%s: len=%d, bytes=%02x\n", __func__, len, response[3]);
if (len < 0)
{
- rig_debug(RIG_DEBUG_VERBOSE, "%s called, error=%s\n", __func__,
+ rig_debug(RIG_DEBUG_VERBOSE, "%s: error=%s\n", __func__,
rigerror(len));
return len;
}
-
- rig_debug(RIG_DEBUG_VERBOSE, "%s called, response='%s'\n", __func__,
- response);
+ if (len == 4) bytes = response[3];
+ rig_debug(RIG_DEBUG_ERR, "%s: bytes=%d\n", __func__, bytes);
+ len = read_block_direct(&rs->ampport, (unsigned char *) response, bytes-3 );
+ dump_hex(response,len);
}
else // if no response expected try to get one
{
@@ -208,7 +204,7 @@ int expert_get_freq(AMP *amp, freq_t *freq)
if (!amp) { return -RIG_EINVAL; }
- retval = expert_transaction(amp, "^FR;", responsebuf, sizeof(responsebuf));
+ retval = expert_transaction(amp, NULL,0, NULL, sizeof(responsebuf));
if (retval != RIG_OK) { return retval; }
@@ -231,14 +227,14 @@ int expert_set_freq(AMP *amp, freq_t freq)
int retval;
unsigned long tfreq;
int nargs;
- char cmd[KPABUFSZ];
+ unsigned char cmd[KPABUFSZ];
rig_debug(RIG_DEBUG_VERBOSE, "%s called, freq=%"PRIfreq"\n", __func__, freq);
if (!amp) { return -RIG_EINVAL; }
- SNPRINTF(cmd, sizeof(cmd), "^FR%05ld;", (long)freq / 1000);
- retval = expert_transaction(amp, cmd, NULL, 0);
+// SNPRINTF(cmd, sizeof(cmd), "^FR%05ld;", (long)freq / 1000);
+ retval = expert_transaction(amp, cmd, 0, NULL, 0);
if (retval != RIG_OK) { return retval; }
@@ -265,7 +261,7 @@ int expert_set_freq(AMP *amp, freq_t freq)
int expert_get_level(AMP *amp, setting_t level, value_t *val)
{
char responsebuf[KPABUFSZ];
- char *cmd;
+ unsigned char cmd[8];
int retval;
int fault;
int i;
@@ -284,8 +280,8 @@ int expert_get_level(AMP *amp, setting_t level, value_t *val)
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
// get the current antenna selected
- cmd = "^AE;";
- retval = expert_transaction(amp, cmd, responsebuf, sizeof(responsebuf));
+ cmd[0] = 0x00;
+ retval = expert_transaction(amp, cmd, 0, NULL, sizeof(responsebuf));
if (retval != RIG_OK) { return retval; }
@@ -305,46 +301,46 @@ int expert_get_level(AMP *amp, setting_t level, value_t *val)
switch (level)
{
case AMP_LEVEL_SWR:
- cmd = "^SW;";
+ cmd[0] = 0x00;
break;
case AMP_LEVEL_NH:
- cmd = "^DF;";
+ cmd[0] = 0x00;
break;
case AMP_LEVEL_PF:
- cmd = "^DF;";
+ cmd[0] = 0x00;
break;
case AMP_LEVEL_PWR_INPUT:
- cmd = "^PWI;";
+ cmd[0] = 0x00;
break;
case AMP_LEVEL_PWR_FWD:
- cmd = "^PWF;";
+ cmd[0] = 0x00;
break;
case AMP_LEVEL_PWR_REFLECTED:
- cmd = "^PWR;";
+ cmd[0] = 0x00;
break;
case AMP_LEVEL_PWR_PEAK:
- cmd = "^PWK;";
+ cmd[0] = 0x00;
break;
case AMP_LEVEL_FAULT:
- cmd = "^SF;";
+ cmd[0] = 0x00;
break;
}
- retval = expert_transaction(amp, cmd, responsebuf, sizeof(responsebuf));
+ retval = expert_transaction(amp, cmd, 0, NULL, sizeof(responsebuf));
if (retval != RIG_OK) { return retval; }
switch (level)
{
case AMP_LEVEL_SWR:
- nargs = sscanf(responsebuf, "^SW%f", &float_value);
+ //nargs = sscanf(responsebuf, "^SW%f", &float_value);
if (nargs != 1)
{
@@ -358,7 +354,7 @@ int expert_get_level(AMP *amp, setting_t level, value_t *val)
case AMP_LEVEL_NH:
case AMP_LEVEL_PF:
- nargs = sscanf(responsebuf, "^DF%d,%d", &int_value, &int_value2);
+ //nargs = sscanf(responsebuf, "^DF%d,%d", &int_value, &int_value2);
if (nargs != 2)
{
@@ -407,7 +403,7 @@ int expert_get_level(AMP *amp, setting_t level, value_t *val)
case AMP_LEVEL_PWR_INPUT:
- cmd = "^PWI;";
+ cmd[0] = 0x00;
nargs = sscanf(responsebuf, "^SW%d", &pwrinput);
if (nargs != 1)
@@ -423,7 +419,7 @@ int expert_get_level(AMP *amp, setting_t level, value_t *val)
break;
case AMP_LEVEL_PWR_FWD:
- cmd = "^PWF;";
+ cmd[0] = 0x00;
nargs = sscanf(responsebuf, "^SW%d", &pwrfwd);
if (nargs != 1)
@@ -439,7 +435,7 @@ int expert_get_level(AMP *amp, setting_t level, value_t *val)
break;
case AMP_LEVEL_PWR_REFLECTED:
- cmd = "^PWR;";
+ cmd[0] = 0x00;
nargs = sscanf(responsebuf, "^SW%d", &pwrref);
if (nargs != 1)
@@ -455,7 +451,7 @@ int expert_get_level(AMP *amp, setting_t level, value_t *val)
break;
case AMP_LEVEL_PWR_PEAK:
- cmd = "^PWK;";
+ cmd[0] = 0x00;
nargs = sscanf(responsebuf, "^SW%d", &pwrpeak);
if (nargs != 1)
@@ -471,7 +467,7 @@ int expert_get_level(AMP *amp, setting_t level, value_t *val)
break;
case AMP_LEVEL_FAULT:
- cmd = "^SF;";
+ cmd[0] = 0x00;
nargs = sscanf(responsebuf, "^SW%d", &fault);
if (nargs != 1)
@@ -509,11 +505,11 @@ int expert_get_level(AMP *amp, setting_t level, value_t *val)
int expert_get_powerstat(AMP *amp, powerstat_t *status)
{
- char responsebuf[KPABUFSZ];
+ unsigned char responsebuf[KPABUFSZ];
int retval;
- int operate;
- int ampon;
- int nargs;
+ int operate = 0;
+ int ampon = 0;
+ int nargs = 0;
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
@@ -522,11 +518,11 @@ int expert_get_powerstat(AMP *amp, powerstat_t *status)
if (!amp) { return -RIG_EINVAL; }
- retval = expert_transaction(amp, "^ON;", responsebuf, sizeof(responsebuf));
+ retval = expert_transaction(amp, NULL, 0, responsebuf, sizeof(responsebuf));
if (retval != RIG_OK) { return retval; }
- nargs = sscanf(responsebuf, "^ON%d", &on);
+ //nargs = sscanf(responsebuf, "^ON%d", &on);
if (nargs != 1)
{
@@ -547,11 +543,11 @@ int expert_get_powerstat(AMP *amp, powerstat_t *status)
return -RIG_EPROTO;
}
- retval = expert_transaction(amp, "^OP;", responsebuf, sizeof(responsebuf));
+ retval = expert_transaction(amp, NULL, 0, responsebuf, sizeof(responsebuf));
if (retval != RIG_OK) { return retval; }
- nargs = sscanf(responsebuf, "^ON%d", &operate);
+ //nargs = sscanf(responsebuf, "^ON%d", &operate);
if (nargs != 1)
{
@@ -568,7 +564,8 @@ int expert_get_powerstat(AMP *amp, powerstat_t *status)
int expert_set_powerstat(AMP *amp, powerstat_t status)
{
int retval;
- char *cmd = NULL;
+ unsigned char cmd[8];
+ int cmd_len = 1;
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
@@ -578,13 +575,13 @@ int expert_set_powerstat(AMP *amp, powerstat_t status)
{
case RIG_POWER_UNKNOWN: break;
- case RIG_POWER_OFF: cmd = "^ON0;"; break;
+ case RIG_POWER_OFF: cmd[0] = 0x0a; break;
- case RIG_POWER_ON: cmd = "^ON1;"; break;
+ case RIG_POWER_ON: cmd[0] = 0x0b; break;
- case RIG_POWER_OPERATE: cmd = "^OS1;"; break;
+ case RIG_POWER_OPERATE: cmd[0] = 0x0d; break;
- case RIG_POWER_STANDBY: cmd = "^OS0;"; break;
+ case RIG_POWER_STANDBY: cmd[0] = 0x0a; break;
default:
@@ -592,7 +589,7 @@ int expert_set_powerstat(AMP *amp, powerstat_t status)
}
- retval = expert_transaction(amp, cmd, NULL, 0);
+ retval = expert_transaction(amp, cmd, cmd_len, NULL, 0);
if (retval != RIG_OK) { return retval; }
diff --git a/amplifiers/expert/expert.h b/amplifiers/expert/expert.h
index f8ef1de8..d2fdb4f3 100644
--- a/amplifiers/expert/expert.h
+++ b/amplifiers/expert/expert.h
@@ -48,7 +48,7 @@ int expert_init(AMP *amp);
int expert_close(AMP *amp);
int expert_reset(AMP *amp, amp_reset_t reset);
int expert_flush_buffer(AMP *amp);
-int expert_transaction(AMP *amp, const char *cmd, char *response,
+int expert_transaction(AMP *amp, const unsigned char *cmd, int cmd_len, unsigned char *response,
int response_len);
const char *expert_get_info(AMP *amp);
int expert_get_freq(AMP *amp, freq_t *freq);
diff --git a/configure.ac b/configure.ac
index 92ce17f8..e07bc085 100644
--- a/configure.ac
+++ b/configure.ac
@@ -52,7 +52,7 @@ dnl here but will be added later, e.g. "winradio".
RIG_BACKEND_LIST="rigs/adat rigs/alinco rigs/aor rigs/barrett rigs/codan rigs/dorji rigs/drake rigs/dummy rigs/elad rigs/flexradio rigs/icom rigs/icmarine rigs/jrc rigs/kachina rigs/kenwood rigs/kit rigs/lowe rigs/pcr rigs/prm80 rigs/racal rigs/rft rigs/rs rigs/skanti rigs/tapr rigs/tentec rigs/tuner rigs/uniden rigs/winradio rigs/wj rigs/yaesu rigs/gomspace rigs/mds"
ROT_BACKEND_LIST="rotators/amsat rotators/apex rotators/ars rotators/celestron rotators/cnctrk rotators/grbltrk rotators/easycomm rotators/ether6 rotators/flir rotators/fodtrack rotators/gs232a rotators/heathkit rotators/m2 rotators/meade rotators/rotorez rotators/sartek rotators/saebrtrack rotators/spid rotators/ts7400 rotators/prosistel rotators/ioptron rotators/satel rotators/radant"
# Amplifiers are all in the amplifiers directory
-AMP_BACKEND_LIST="amplifiers/elecraft amplifiers/gemini"
+AMP_BACKEND_LIST="amplifiers/elecraft amplifiers/gemini amplifiers/expert"
dnl See README.release on setting these values
# Values given to -version-info when linking. See libtool documentation.
@@ -907,6 +907,7 @@ scripts/Makefile
android/Makefile
amplifiers/elecraft/Makefile
amplifiers/gemini/Makefile
+amplifiers/expert/Makefile
simulators/Makefile
hamlib.pc
])
diff --git a/include/hamlib/amplist.h b/include/hamlib/amplist.h
index 3e954c86..4122062c 100644
--- a/include/hamlib/amplist.h
+++ b/include/hamlib/amplist.h
@@ -106,10 +106,15 @@
//! @endcond
#define AMP_MODEL_ELECRAFT_KPA1500 AMP_MAKE_MODEL(AMP_ELECRAFT, 1)
//#define AMP_MODEL_ELECRAFT_KPA500 AMP_MAKE_MODEL(AMP_ELECRAFT, 2)
+
#define AMP_GEMINI 3
#define AMP_BACKEND_GEMINI "gemini"
#define AMP_MODEL_GEMINI_DX1200 AMP_MAKE_MODEL(AMP_GEMINI, 1)
+#define AMP_EXPERT 4
+#define AMP_BACKEND_EXPERT "expert"
+#define AMP_MODEL_EXPERT_FA AMP_MAKE_MODEL(AMP_EXPERT, 1)
+
/**
* \brief Convenience type definition for an amplifier model.
diff --git a/src/amp_reg.c b/src/amp_reg.c
index 998a58ff..98892790 100644
--- a/src/amp_reg.c
+++ b/src/amp_reg.c
@@ -65,6 +65,7 @@
DEFINE_INITAMP_BACKEND(dummy);
DEFINE_INITAMP_BACKEND(kpa1500);
DEFINE_INITAMP_BACKEND(gemini);
+DEFINE_INITAMP_BACKEND(expert);
//! @endcond
/**
commit c331899d94424bffd4ad4d5b214ad7249f55b08a
Author: Mike Black W9MDB <mdb...@ya...>
Date: Tue Mar 28 15:57:24 2023 -0500
Fix expert in rotators/Android.mk
diff --git a/amplifiers/expert/Android.mk b/amplifiers/expert/Android.mk
index 57d2dd17..502f300f 100644
--- a/amplifiers/expert/Android.mk
+++ b/amplifiers/expert/Android.mk
@@ -3,7 +3,7 @@ LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_SRC_FILES := expert.c
-LOCAL_MODULE := expoert
+LOCAL_MODULE := expert
LOCAL_CFLAGS :=
LOCAL_C_INCLUDES := android include src
commit 9d7ac000e5e315b25d484d5bdd109cc026af801d
Merge: f11db5c9 8d407320
Author: Michael Black <mdb...@ya...>
Date: Tue Mar 28 14:25:11 2023 -0500
Merge pull request #1265 from dforsi/fix/duplicated-initializers
Fix initializer-overrides warnings by clang
commit 8d407320648445a50b98119aae53ed5081a617b5
Author: Daniele Forsi IU5HKX <iu...@gm...>
Date: Tue Mar 28 19:49:01 2023 +0200
Fix initializer-overrides warnings by clang
Fixes:
dx77.c:225:5: warning: initializer overrides prior initialization of this subobject [-Winitializer-overrides]
{
^
dx77.c:217:23: note: previous initialization is here
.tx_range_list2 = {RIG_FRNG_END,},
^~~~~~~~~~~~~~~
ft991.c:356:27: warning: initializer overrides prior initialization of this subobject [-Winitializer-overrides]
.scan = newcat_scan,
^~~~~~~~~~~
ft991.c:352:27: note: previous initialization is here
.scan = newcat_scan,
^~~~~~~~~~~
diff --git a/rigs/alinco/dx77.c b/rigs/alinco/dx77.c
index baa5a448..870bc83b 100644
--- a/rigs/alinco/dx77.c
+++ b/rigs/alinco/dx77.c
@@ -214,7 +214,6 @@ const struct rig_caps dx77_caps =
RIG_FRNG_END,
},
.tx_range_list1 = {RIG_FRNG_END,},
- .tx_range_list2 = {RIG_FRNG_END,},
.rx_range_list2 =
{
diff --git a/rigs/yaesu/ft991.c b/rigs/yaesu/ft991.c
index 2191d59b..69206e60 100644
--- a/rigs/yaesu/ft991.c
+++ b/rigs/yaesu/ft991.c
@@ -353,7 +353,6 @@ const struct rig_caps ft991_caps =
.send_voice_mem = newcat_send_voice_mem,
.set_clock = newcat_set_clock,
.get_clock = newcat_get_clock,
- .scan = newcat_scan,
.hamlib_check_rig_caps = HAMLIB_CHECK_RIG_CAPS
};
commit f11db5c94955b87e7f2f0ce4b935d3d2f851ebed
Merge: bbda209f 7395ef0e
Author: Mike Black W9MDB <mdb...@ya...>
Date: Tue Mar 28 11:53:30 2023 -0500
Merge branch 'master' of https://github.com/Hamlib/Hamlib
commit bbda209fc0ab7bf1e139b253d165900729e7f4d6
Author: Mike Black W9MDB <mdb...@ya...>
Date: Tue Mar 28 11:52:26 2023 -0500
Add park to rotorez
https://github.com/Hamlib/Hamlib/issues/1257
diff --git a/amplifiers/expert/Android.mk b/amplifiers/expert/Android.mk
new file mode 100644
index 00000000..57d2dd17
--- /dev/null
+++ b/amplifiers/expert/Android.mk
@@ -0,0 +1,12 @@
+LOCAL_PATH:= $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := expert.c
+LOCAL_MODULE := expoert
+
+LOCAL_CFLAGS :=
+LOCAL_C_INCLUDES := android include src
+LOCAL_LDLIBS := -lhamlib
+
+include $(BUILD_STATIC_LIBRARY)
diff --git a/amplifiers/expert/Makefile.am b/amplifiers/expert/Makefile.am
new file mode 100644
index 00000000..2733ef26
--- /dev/null
+++ b/amplifiers/expert/Makefile.am
@@ -0,0 +1,8 @@
+SRC = expert.c
+
+EXPERTSRC = expert.h
+
+noinst_LTLIBRARIES = libhamlib-expert.la
+libhamlib_expert_la_SOURCES = $(SRC) $(EXPERTSRC)
+
+EXTRA_DIST = README.expert Android.mk
diff --git a/amplifiers/expert/README.expert b/amplifiers/expert/README.expert
new file mode 100644
index 00000000..331bc178
--- /dev/null
+++ b/amplifiers/expert/README.expert
@@ -0,0 +1,7 @@
+hamlib - Copyright (C) 2023 The Hamlib Group
+
+File: README.expert
+
+Notes on Expert backends
+
+2023-03-20 Initial prototype for Expert amplifiers
diff --git a/amplifiers/expert/expert.c b/amplifiers/expert/expert.c
new file mode 100644
index 00000000..f66256d4
--- /dev/null
+++ b/amplifiers/expert/expert.c
@@ -0,0 +1,734 @@
+/*
+ * Hamlib Expert amplifier backend - low level communication routines
+ * Copyright (c) 2023 by Michael Black W9MDB
+ *
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+#include <stdlib.h>
+#include <string.h>
+#include "expert.h"
+#include "register.h"
+
+struct fault_list
+{
+ int code;
+ char *errmsg;
+};
+const struct fault_list expert_fault_list [] =
+{
+ {0, "No fault condition"},
+ {0x10, "Watchdog Timer was reset"},
+ {0x20, "PA Current is too high"},
+ {0x40, "Temperature is too high"},
+ {0x60, "Input power is too high"},
+ {0x61, "Gain is too low"},
+ {0x70, "Invalid frequency"},
+ {0x80, "50V supply voltage too low or too high"},
+ {0x81, "5V supply voltage too low or too high"},
+ {0x82, "10V supply voltage too low or too high"},
+ {0x83, "12V supply voltage too low or too high"},
+ {0x84, "-12V supply voltage too low or too high"},
+ {0x85, "5V or 400V LPF board supply voltages not detected"},
+ {0x90, "Reflected power is too high"},
+ {0x91, "SWR very high"},
+ {0x92, "ATU no match"},
+ {0xB0, "Dissipated power too high"},
+ {0xC0, "Forward power too high"},
+ {0xE0, "Forward power too high for current setting"},
+ {0xF0, "Gain is too high"},
+ {0, NULL}
+};
+
+/*
+ * Initialize data structures
+ */
+
+int expert_init(AMP *amp)
+{
+ rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
+
+ if (!amp)
+ {
+ return -RIG_EINVAL;
+ }
+
+ amp->state.priv = (struct expert_priv_data *)
+ calloc(1, sizeof(struct expert_priv_data));
+
+ if (!amp->state.priv)
+ {
+ return -RIG_ENOMEM;
+ }
+
+ amp->state.ampport.type.rig = RIG_PORT_SERIAL;
+
+ return RIG_OK;
+}
+
+int expert_close(AMP *amp)
+{
+ rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
+
+ if (amp->state.priv) { free(amp->state.priv); }
+
+ amp->state.priv = NULL;
+
+ return RIG_OK;
+}
+
+int expert_flushbuffer(AMP *amp)
+{
+ struct amp_state *rs;
+
+ rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
+
+ rs = &->state;
+
+ return rig_flush(&rs->ampport);
+}
+
+int expert_transaction(AMP *amp, const char *cmd, char *response, int response_len)
+{
+ struct amp_state *rs;
+ int err;
+ int len = 0;
+ int loop;
+
+ rig_debug(RIG_DEBUG_VERBOSE, "%s called, cmd=%s\n", __func__, cmd);
+
+ if (!amp) { return -RIG_EINVAL; }
+
+ expert_flushbuffer(amp);
+
+ rs = &->state;
+
+ loop = 3;
+
+ do // wake up the amp by sending ; until we receive ;
+ {
+ char c = ';';
+ rig_debug(RIG_DEBUG_VERBOSE, "%s waiting for ;\n", __func__);
+ err = write_block(&rs->ampport, (unsigned char *) &c, 1);
+
+ if (err != RIG_OK) { return err; }
+
+ len = read_string(&rs->ampport, (unsigned char *) response, response_len, ";",
+ 1, 0, 1);
+
+ if (len < 0) { return len; }
+ }
+ while (--loop > 0 && (len != 1 || response[0] != ';'));
+
+ // Now send our command
+ err = write_block(&rs->ampport, (unsigned char *) cmd, strlen(cmd));
+
+ if (err != RIG_OK) { return err; }
+
+ if (response) // if response expected get it
+ {
+ response[0] = 0;
+ len = read_string(&rs->ampport, (unsigned char *) response, response_len, ";",
+ 1, 0, 1);
+
+ if (len < 0)
+ {
+ rig_debug(RIG_DEBUG_VERBOSE, "%s called, error=%s\n", __func__,
+ rigerror(len));
+ return len;
+ }
+
+ rig_debug(RIG_DEBUG_VERBOSE, "%s called, response='%s'\n", __func__,
+ response);
+ }
+ else // if no response expected try to get one
+ {
+ char responsebuf[KPABUFSZ];
+ responsebuf[0] = 0;
+ loop = 3;
+
+ do
+ {
+ char c = ';';
+ rig_debug(RIG_DEBUG_VERBOSE, "%s waiting for ;\n", __func__);
+ err = write_block(&rs->ampport, (unsigned char *) &c, 1);
+
+ if (err != RIG_OK) { return err; }
+
+ len = read_string(&rs->ampport, (unsigned char *) responsebuf, KPABUFSZ, ";", 1,
+ 0, 1);
+
+ if (len < 0) { return len; }
+ }
+ while (--loop > 0 && (len != 1 || responsebuf[0] != ';'));
+ }
+
+ return RIG_OK;
+}
+
+/*
+ * Get Info
+ * returns the model name string
+ */
+const char *expert_get_info(AMP *amp)
+{
+ const struct amp_caps *rc;
+
+ rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
+
+ if (!amp) { return (const char *) - RIG_EINVAL; }
+
+ rc = amp->caps;
+
+ return rc->model_name;
+}
+
+int expert_get_freq(AMP *amp, freq_t *freq)
+{
+ char responsebuf[KPABUFSZ];
+ int retval;
+ unsigned long tfreq;
+ int nargs;
+
+ rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
+
+ if (!amp) { return -RIG_EINVAL; }
+
+ retval = expert_transaction(amp, "^FR;", responsebuf, sizeof(responsebuf));
+
+ if (retval != RIG_OK) { return retval; }
+
+ nargs = sscanf(responsebuf, "^FR%lu", &tfreq);
+
+ if (nargs != 1)
+ {
+ rig_debug(RIG_DEBUG_VERBOSE, "%s Error: ^FR response='%s'\n", __func__,
+ responsebuf);
+ return -RIG_EPROTO;
+ }
+
+ *freq = tfreq * 1000;
+ return RIG_OK;
+}
+
+int expert_set_freq(AMP *amp, freq_t freq)
+{
+ char responsebuf[KPABUFSZ];
+ int retval;
+ unsigned long tfreq;
+ int nargs;
+ char cmd[KPABUFSZ];
+
+ rig_debug(RIG_DEBUG_VERBOSE, "%s called, freq=%"PRIfreq"\n", __func__, freq);
+
+ if (!amp) { return -RIG_EINVAL; }
+
+ SNPRINTF(cmd, sizeof(cmd), "^FR%05ld;", (long)freq / 1000);
+ retval = expert_transaction(amp, cmd, NULL, 0);
+
+ if (retval != RIG_OK) { return retval; }
+
+ nargs = sscanf(responsebuf, "^FR%lu", &tfreq);
+
+ if (nargs != 1)
+ {
+ rig_debug(RIG_DEBUG_ERR, "%s Error: ^FR response='%s'\n", __func__,
+ responsebuf);
+ return -RIG_EPROTO;
+ }
+
+ if (tfreq * 1000 != freq)
+ {
+ rig_debug(RIG_DEBUG_ERR,
+ "%s Error setting freq: ^FR freq!=freq2, %f=%lu '%s'\n", __func__,
+ freq, tfreq * 1000, responsebuf);
+ return -RIG_EPROTO;
+ }
+
+ return RIG_OK;
+}
+
+int expert_get_level(AMP *amp, setting_t level, value_t *val)
+{
+ char responsebuf[KPABUFSZ];
+ char *cmd;
+ int retval;
+ int fault;
+ int i;
+ int nargs;
+ int antenna;
+ int pwrpeak;
+ int pwrref;
+ int pwrfwd;
+ int pwrinput;
+ float float_value = 0;
+ int int_value = 0, int_value2 = 0;
+ struct amp_state *rs = &->state;
+ struct expert_priv_data *priv = amp->state.priv;
+
+
+ rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
+
+ // get the current antenna selected
+ cmd = "^AE;";
+ retval = expert_transaction(amp, cmd, responsebuf, sizeof(responsebuf));
+
+ if (retval != RIG_OK) { return retval; }
+
+ antenna = 0;
+ nargs = sscanf(responsebuf, "^AE%d", &antenna);
+
+ if (nargs != 1)
+ {
+ rig_debug(RIG_DEBUG_ERR, "%s: invalid value %s='%s'\n", __func__, cmd,
+ responsebuf);
+ return -RIG_EPROTO;
+ }
+
+ rig_debug(RIG_DEBUG_VERBOSE, "%s: cmd=%s, antenna=%d\n", __func__, cmd,
+ antenna);
+
+ switch (level)
+ {
+ case AMP_LEVEL_SWR:
+ cmd = "^SW;";
+ break;
+
+ case AMP_LEVEL_NH:
+ cmd = "^DF;";
+ break;
+
+ case AMP_LEVEL_PF:
+ cmd = "^DF;";
+ break;
+
+ case AMP_LEVEL_PWR_INPUT:
+ cmd = "^PWI;";
+ break;
+
+ case AMP_LEVEL_PWR_FWD:
+ cmd = "^PWF;";
+ break;
+
+ case AMP_LEVEL_PWR_REFLECTED:
+ cmd = "^PWR;";
+ break;
+
+ case AMP_LEVEL_PWR_PEAK:
+ cmd = "^PWK;";
+ break;
+
+ case AMP_LEVEL_FAULT:
+ cmd = "^SF;";
+ break;
+ }
+
+ retval = expert_transaction(amp, cmd, responsebuf, sizeof(responsebuf));
+
+ if (retval != RIG_OK) { return retval; }
+
+ switch (level)
+ {
+ case AMP_LEVEL_SWR:
+ nargs = sscanf(responsebuf, "^SW%f", &float_value);
+
+ if (nargs != 1)
+ {
+ rig_debug(RIG_DEBUG_ERR, "%s invalid value %s='%s'\n", __func__, cmd,
+ responsebuf);
+ return -RIG_EPROTO;
+ }
+
+ val->f = float_value / 10.0f;
+ return RIG_OK;
+
+ case AMP_LEVEL_NH:
+ case AMP_LEVEL_PF:
+ nargs = sscanf(responsebuf, "^DF%d,%d", &int_value, &int_value2);
+
+ if (nargs != 2)
+ {
+ rig_debug(RIG_DEBUG_ERR, "%s invalid value %s='%s'\n", __func__, cmd,
+ responsebuf);
+ return -RIG_EPROTO;
+ }
+
+ rig_debug(RIG_DEBUG_VERBOSE, "%s freq range=%dKHz,%dKHz\n", __func__,
+ int_value, int_value2);
+
+ //
+ do
+ {
+ retval = read_string(&rs->ampport, (unsigned char *) responsebuf,
+ sizeof(responsebuf), ";", 1, 0,
+ 1);
+
+ if (retval != RIG_OK) { return retval; }
+
+ if (strstr(responsebuf, "BYPASS") != 0)
+ {
+ int antenna2 = 0;
+ nargs = sscanf(responsebuf, "AN%d Side TX %d %*s %*s %d", &antenna2, &int_value,
+ &int_value2);
+ rig_debug(RIG_DEBUG_VERBOSE, "%s response='%s'\n", __func__, responsebuf);
+
+ if (nargs != 3)
+ {
+ rig_debug(RIG_DEBUG_ERR, "%s invalid value %s='%s'\n", __func__, cmd,
+ responsebuf);
+ return -RIG_EPROTO;
+ }
+
+ rig_debug(RIG_DEBUG_VERBOSE, "%s antenna=%d,nH=%d\n", __func__, antenna2,
+ int_value);
+
+ val->i = level == AMP_LEVEL_NH ? int_value : int_value2;
+ return RIG_OK;
+ }
+ }
+ while (strstr(responsebuf, "BYPASS"));
+
+
+ break;
+
+
+ case AMP_LEVEL_PWR_INPUT:
+ cmd = "^PWI;";
+ nargs = sscanf(responsebuf, "^SW%d", &pwrinput);
+
+ if (nargs != 1)
+ {
+ rig_debug(RIG_DEBUG_ERR, "%s invalid value %s='%s'\n", __func__, cmd,
+ responsebuf);
+ return -RIG_EPROTO;
+ }
+
+ val->i = pwrinput;
+ return RIG_OK;
+
+ break;
+
+ case AMP_LEVEL_PWR_FWD:
+ cmd = "^PWF;";
+ nargs = sscanf(responsebuf, "^SW%d", &pwrfwd);
+
+ if (nargs != 1)
+ {
+ rig_debug(RIG_DEBUG_ERR, "%s invalid value %s='%s'\n", __func__, cmd,
+ responsebuf);
+ return -RIG_EPROTO;
+ }
+
+ val->i = pwrfwd;
+ return RIG_OK;
+
+ break;
+
+ case AMP_LEVEL_PWR_REFLECTED:
+ cmd = "^PWR;";
+ nargs = sscanf(responsebuf, "^SW%d", &pwrref);
+
+ if (nargs != 1)
+ {
+ rig_debug(RIG_DEBUG_ERR, "%s invalid value %s='%s'\n", __func__, cmd,
+ responsebuf);
+ return -RIG_EPROTO;
+ }
+
+ val->i = pwrref;
+ return RIG_OK;
+
+ break;
+
+ case AMP_LEVEL_PWR_PEAK:
+ cmd = "^PWK;";
+ nargs = sscanf(responsebuf, "^SW%d", &pwrpeak);
+
+ if (nargs != 1)
+ {
+ rig_debug(RIG_DEBUG_ERR, "%s invalid value %s='%s'\n", __func__, cmd,
+ responsebuf);
+ return -RIG_EPROTO;
+ }
+
+ val->i = pwrpeak;
+ return RIG_OK;
+
+ break;
+
+ case AMP_LEVEL_FAULT:
+ cmd = "^SF;";
+ nargs = sscanf(responsebuf, "^SW%d", &fault);
+
+ if (nargs != 1)
+ {
+ rig_debug(RIG_DEBUG_ERR, "%s invalid value %s='%s'\n", __func__, cmd,
+ responsebuf);
+ return -RIG_EPROTO;
+ }
+
+ for (i = 0; expert_fault_list[i].errmsg != NULL; ++i)
+ {
+ if (expert_fault_list[i].code == fault)
+ {
+ val->s = expert_fault_list[i].errmsg;
+ return RIG_OK;
+ }
+ }
+
+ rig_debug(RIG_DEBUG_ERR, "%s unknown fault from %s\n", __func__, responsebuf);
+ SNPRINTF(priv->tmpbuf, sizeof(priv->tmpbuf), "Unknown fault code=0x%02x",
+ fault);
+ val->s = priv->tmpbuf;
+ return RIG_OK;
+
+ break;
+
+ default:
+ rig_debug(RIG_DEBUG_ERR, "%s unknown level=%s\n", __func__,
+ rig_strlevel(level));
+
+ }
+
+ return -RIG_EINVAL;
+}
+
+int expert_get_powerstat(AMP *amp, powerstat_t *status)
+{
+ char responsebuf[KPABUFSZ];
+ int retval;
+ int operate;
+ int ampon;
+ int nargs;
+
+
+ rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
+
+ *status = RIG_POWER_UNKNOWN;
+
+ if (!amp) { return -RIG_EINVAL; }
+
+ retval = expert_transaction(amp, "^ON;", responsebuf, sizeof(responsebuf));
+
+ if (retval != RIG_OK) { return retval; }
+
+ nargs = sscanf(responsebuf, "^ON%d", &on);
+
+ if (nargs != 1)
+ {
+ rig_debug(RIG_DEBUG_VERBOSE, "%s Error: ^ON response='%s'\n", __func__,
+ responsebuf);
+ return -RIG_EPROTO;
+ }
+
+ switch (ampon)
+ {
+ case 0: *status = RIG_POWER_OFF; return RIG_OK;
+
+ case 1: *status = RIG_POWER_ON; break;
+
+ default:
+ rig_debug(RIG_DEBUG_VERBOSE, "%s Error: ^ON unknown response='%s'\n", __func__,
+ responsebuf);
+ return -RIG_EPROTO;
+ }
+
+ retval = expert_transaction(amp, "^OP;", responsebuf, sizeof(responsebuf));
+
+ if (retval != RIG_OK) { return retval; }
+
+ nargs = sscanf(responsebuf, "^ON%d", &operate);
+
+ if (nargs != 1)
+ {
+ rig_debug(RIG_DEBUG_VERBOSE, "%s Error: ^ON response='%s'\n", __func__,
+ responsebuf);
+ return -RIG_EPROTO;
+ }
+
+ *status = operate == 1 ? RIG_POWER_OPERATE : RIG_POWER_STANDBY;
+
+ return RIG_OK;
+}
+
+int expert_set_powerstat(AMP *amp, powerstat_t status)
+{
+ int retval;
+ char *cmd = NULL;
+
+ rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
+
+ if (!amp) { return -RIG_EINVAL; }
+
+ switch (status)
+ {
+ case RIG_POWER_UNKNOWN: break;
+
+ case RIG_POWER_OFF: cmd = "^ON0;"; break;
+
+ case RIG_POWER_ON: cmd = "^ON1;"; break;
+
+ case RIG_POWER_OPERATE: cmd = "^OS1;"; break;
+
+ case RIG_POWER_STANDBY: cmd = "^OS0;"; break;
+
+
+ default:
+ rig_debug(RIG_DEBUG_ERR, "%s invalid status=%d\n", __func__, status);
+
+ }
+
+ retval = expert_transaction(amp, cmd, NULL, 0);
+
+ if (retval != RIG_OK) { return retval; }
+
+ return RIG_OK;
+}
+
+int expert_reset(AMP *amp, amp_reset_t reset)
+{
+ int retval;
+
+ rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
+
+ // toggling from standby to operate supposed to reset
+ retval = expert_set_powerstat(amp, RIG_POWER_STANDBY);
+
+ if (retval != RIG_OK)
+ {
+ rig_debug(RIG_DEBUG_ERR, "%s: error setting RIG_POWER_STANDBY '%s'\n", __func__,
+ strerror(retval));
+
+ }
+
+ return expert_set_powerstat(amp, RIG_POWER_OPERATE);
+}
+
+
+struct expert_priv_data *expert_priv;
+/*
+ * API local implementation
+ *
+ */
+
+/*
+ * Private helper function prototypes
+ */
+
+//static int kpa1500_send_priv_cmd(AMP *amp, const char *cmd);
+//static int kpa1500_flush_buffer(AMP *amp);
+
+/* *************************************
+ *
+ * Separate model capabilities
+ *
+ * *************************************
+ */
+
+
+/*
+ * Expert 1.3K-FA, 1.5K-FA, and 2K-FA
+ */
+
+const struct amp_caps kpa1500_amp_caps =
+{
+ AMP_MODEL(AMP_MODEL_ELECRAFT_KPA1500),
+ .model_name = "1.3K-FA/1.5K-FA/2K-FA",
+ .mfg_name = "Expert",
+ .version = "20230320.0",
+ .copyright = "LGPL",
+ .status = RIG_STATUS_ALPHA,
+ .amp_type = AMP_TYPE_OTHER,
+ .port_type = RIG_PORT_SERIAL,
+ .serial_rate_min = 9600,
+ .serial_rate_max = 115200,
+ .serial_data_bits = 8,
+ .serial_stop_bits = 1,
+ .serial_parity = RIG_PARITY_NONE,
+ .serial_handshake = RIG_HANDSHAKE_NONE,
+ .write_delay = 0,
+ .post_write_delay = 0,
+ .timeout = 2000,
+ .retry = 2,
+ .has_get_level = AMP_LEVEL_SWR | AMP_LEVEL_NH | AMP_LEVEL_PF | AMP_LEVEL_PWR_INPUT | AMP_LEVEL_PWR_FWD | AMP_LEVEL_PWR_REFLECTED | AMP_LEVEL_FAULT,
+ .has_set_level = 0,
+
+ .amp_open = NULL,
+ .amp_init = expert_init,
+ .amp_close = expert_close,
+ .reset = expert_reset,
+ .get_info = expert_get_info,
+ .get_powerstat = expert_get_powerstat,
+ .set_powerstat = expert_set_powerstat,
+ .set_freq = expert_set_freq,
+ .get_freq = expert_get_freq,
+ .get_level = expert_get_level,
+};
+
+
+/* ************************************
+ *
+ * API functions
+ *
+ * ************************************
+ */
+
+/*
+ *
+ */
+
+#if 0 // not implemented yet
+/*
+ * Send command string to amplifier
+ */
+
+static int kpa1500_send_priv_cmd(AMP *amp, const char *cmdstr)
+{
+ struct amp_state *rs;
+ int err;
+
+ rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
+
+ if (!amp)
+ {
+ return -RIG_EINVAL;
+ }
+
+ rs = &->state;
+ err = write_block(&rs->ampport, cmdstr, strlen(cmdstr));
+
+ if (err != RIG_OK)
+ {
+ return err;
+ }
+
+ return RIG_OK;
+}
+#endif
+
+/*
+ * Initialize backend
+ */
+
+DECLARE_INITAMP_BACKEND(expert)
+{
+ rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
+
+ amp_register(&expert_amp_caps);
+
+ return RIG_OK;
+}
diff --git a/amplifiers/expert/expert.h b/amplifiers/expert/expert.h
new file mode 100644
index 00000000..f8ef1de8
--- /dev/null
+++ b/amplifiers/expert/expert.h
@@ -0,0 +1,62 @@
+/*
+ * Hamlib backend library for the Expert amplifier set.
+ *
+ * expert.h - (C) Michael Black W9MDB 2023
+ *
+ * This shared library provides an API for communicating
+ * via serial interface to Expert amplifiers.
+ *
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+#ifndef _AMP_EXPERT_H
+#define _AMP_EXPERT_H 1
+
+#include <hamlib/amplifier.h>
+#include <iofunc.h>
+#include <serial.h>
+
+// Is this big enough?
+#define KPABUFSZ 100
+
+extern const struct amp_caps expert_amp_caps;
+
+/*
+ * Private data structure
+ */
+struct expert_priv_data
+{
+ char tmpbuf[256]; // for unknown error msg
+};
+
+
+int expert_init(AMP *amp);
+int expert_close(AMP *amp);
+int expert_reset(AMP *amp, amp_reset_t reset);
+int expert_flush_buffer(AMP *amp);
+int expert_transaction(AMP *amp, const char *cmd, char *response,
+ int response_len);
+const char *expert_get_info(AMP *amp);
+int expert_get_freq(AMP *amp, freq_t *freq);
+int expert_set_freq(AMP *amp, freq_t freq);
+
+int expert_get_level(AMP *amp, setting_t level, value_t *val);
+int expert_get_powerstat(AMP *amp, powerstat_t *status);
+int expert_set_powerstat(AMP *amp, powerstat_t status);
+
+#endif /* _AMP_EXPERT_H */
+
diff --git a/rotators/rotorez/rotorez.c b/rotators/rotorez/rotorez.c
index 6867acea..6411a3ad 100644
--- a/rotators/rotorez/rotorez.c
+++ b/rotators/rotorez/rotorez.c
@@ -55,6 +55,7 @@ static int rotorez_rot_set_position(ROT *rot, azimuth_t azimuth,
elevation_t elevation);
static int rotorez_rot_get_position(ROT *rot, azimuth_t *azimuth,
elevation_t *elevation);
+static int rotorez_park(ROT *rot);
static int erc_rot_get_position(ROT *rot, azimuth_t *azimuth,
elevation_t *elevation);
static int rt21_rot_get_position(ROT *rot, azimuth_t *azimuth,
@@ -129,7 +130,7 @@ const struct rot_caps rotorez_rot_caps =
ROT_MODEL(ROT_MODEL_ROTOREZ),
.model_name = "Rotor-EZ",
.mfg_name = "Idiom Press",
- .version = "20220109.0",
+ .version = "20230328.0",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rot_type = ROT_TYPE_OTHER,
@@ -157,6 +158,7 @@ const struct rot_caps rotorez_rot_caps =
.rot_cleanup = rotorez_rot_cleanup,
.set_position = rotorez_rot_set_position,
.get_position = rotorez_rot_get_position,
+ .park = rotorez_park,
.stop = rotorez_rot_stop,
.set_conf = rotorez_rot_set_conf,
.get_info = rotorez_rot_get_info,
@@ -174,7 +176,7 @@ const struct rot_caps rotorcard_rot_caps =
ROT_MODEL(ROT_MODEL_ROTORCARD),
.model_name = "RotorCard",
.mfg_name = "Idiom Press",
- .version = "20100214.0",
+ .version = "20230328.0",
.copyright = "LGPL",
.status = RIG_STATUS_BETA,
.rot_type = ROT_TYPE_OTHER,
@@ -202,6 +204,7 @@ const struct rot_caps rotorcard_rot_caps =
.rot_cleanup = rotorez_rot_cleanup,
.set_position = rotorez_rot_set_position,
.get_position = rotorez_rot_get_position,
+ .park = rotorez_park,
.stop = rotorez_rot_stop,
.set_conf = rotorez_rot_set_conf,
.get_info = rotorez_rot_get_info,
@@ -218,7 +221,7 @@ const struct rot_caps dcu_rot_caps =
ROT_MODEL(ROT_MODEL_DCU),
.model_name = "DCU-1/DCU-1X",
.mfg_name = "Hy-Gain",
- .version = "20100823.0",
+ .version = "20230328.0",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rot_type = ROT_TYPE_OTHER,
@@ -262,7 +265,7 @@ const struct rot_caps erc_rot_caps =
ROT_MODEL(ROT_MODEL_ERC),
.model_name = "ERC",
.mfg_name = "DF9GR",
- .version = "20100823.2", /* second revision on 23 Aug 2010 */
+ .version = "20230328.2", /* second revision on 23 Aug 2010 */
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rot_type = ROT_TYPE_OTHER,
@@ -290,6 +293,7 @@ const struct rot_caps erc_rot_caps =
.rot_cleanup = rotorez_rot_cleanup,
.set_position = rotorez_rot_set_position,
.get_position = erc_rot_get_position,
+ .park = rotorez_park,
.stop = dcu1_rot_stop,
.reset = rotorez_rot_reset,
// .stop = rotorez_rot_stop,
@@ -309,7 +313,7 @@ const struct rot_caps yrc1_rot_caps =
ROT_MODEL(ROT_MODEL_YRC1),
.model_name = "DCU2/DCU3/YRC-1",
.mfg_name = "Hy-Gain",
- .version = "20100823.2",
+ .version = "20230328.2",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rot_type = ROT_TYPE_OTHER,
@@ -337,6 +341,7 @@ const struct rot_caps yrc1_rot_caps =
.rot_cleanup = rotorez_rot_cleanup,
.set_position = rotorez_rot_set_position,
.get_position = erc_rot_get_position,
+ .park = rotorez_park,
.stop = dcu1_rot_stop,
.reset = rotorez_rot_reset,
// .stop = rotorez_rot_stop,
@@ -351,7 +356,7 @@ const struct rot_caps rt21_rot_caps =
ROT_MODEL(ROT_MODEL_RT21),
.model_name = "RT-21",
.mfg_name = "Green Heron",
- .version = "20220104.0",
+ .version = "20230328.0",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rot_type = ROT_TYPE_OTHER,
@@ -379,6 +384,7 @@ const struct rot_caps rt21_rot_caps =
.rot_cleanup = rotorez_rot_cleanup,
.set_position = rt21_rot_set_position,
.get_position = rt21_rot_get_position,
+ .park = rotorez_park,
.stop = rotorez_rot_stop,
// .set_conf = rotorez_rot_set_conf,
// .get_info = rotorez_rot_get_info,
@@ -1128,6 +1134,20 @@ static int rotorez_flush_buffer(ROT *rot)
return RIG_OK;
}
+/*
+ * Moves to Home Position
+ */
+static int rotorez_park(ROT *rot)
+{
+ rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
+
+ /* Assume home is 0,0 */
+ rotorez_rot_set_position(rot, 0, 0);
+
+ return RIG_OK;
+}
+
+
/*
* Initialize backend
commit 7395ef0e3f1e34ae43f01a4938f021cd3f2c0fde
Author: Mike Black W9MDB <mdb...@ya...>
Date: Tue Mar 28 11:52:26 2023 -0500
Add park to rotorez
diff --git a/rotators/rotorez/rotorez.c b/rotators/rotorez/rotorez.c
index 6867acea..6411a3ad 100644
--- a/rotators/rotorez/rotorez.c
+++ b/rotators/rotorez/rotorez.c
@@ -55,6 +55,7 @@ static int rotorez_rot_set_position(ROT *rot, azimuth_t azimuth,
elevation_t elevation);
static int rotorez_rot_get_position(ROT *rot, azimuth_t *azimuth,
elevation_t *elevation);
+static int rotorez_park(ROT *rot);
static int erc_rot_get_position(ROT *rot, azimuth_t *azimuth,
elevation_t *elevation);
static int rt21_rot_get_position(ROT *rot, azimuth_t *azimuth,
@@ -129,7 +130,7 @@ const struct rot_caps rotorez_rot_caps =
ROT_MODEL(ROT_MODEL_ROTOREZ),
.model_name = "Rotor-EZ",
.mfg_name = "Idiom Press",
- .version = "20220109.0",
+ .version = "20230328.0",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rot_type = ROT_TYPE_OTHER,
@@ -157,6 +158,7 @@ const struct rot_caps rotorez_rot_caps =
.rot_cleanup = rotorez_rot_cleanup,
.set_position = rotorez_rot_set_position,
.get_position = rotorez_rot_get_position,
+ .park = rotorez_park,
.stop = rotorez_rot_stop,
.set_conf = rotorez_rot_set_conf,
.get_info = rotorez_rot_get_info,
@@ -174,7 +176,7 @@ const struct rot_caps rotorcard_rot_caps =
ROT_MODEL(ROT_MODEL_ROTORCARD),
.model_name = "RotorCard",
.mfg_name = "Idiom Press",
- .version = "20100214.0",
+ .version = "20230328.0",
.copyright = "LGPL",
.status = RIG_STATUS_BETA,
.rot_type = ROT_TYPE_OTHER,
@@ -202,6 +204,7 @@ const struct rot_caps rotorcard_rot_caps =
.rot_cleanup = rotorez_rot_cleanup,
.set_position = rotorez_rot_set_position,
.get_position = rotorez_rot_get_position,
+ .park = rotorez_park,
.stop = rotorez_rot_stop,
.set_conf = rotorez_rot_set_conf,
.get_info = rotorez_rot_get_info,
@@ -218,7 +221,7 @@ const struct rot_caps dcu_rot_caps =
ROT_MODEL(ROT_MODEL_DCU),
.model_name = "DCU-1/DCU-1X",
.mfg_name = "Hy-Gain",
- .version = "20100823.0",
+ .version = "20230328.0",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rot_type = ROT_TYPE_OTHER,
@@ -262,7 +265,7 @@ const struct rot_caps erc_rot_caps =
ROT_MODEL(ROT_MODEL_ERC),
.model_name = "ERC",
.mfg_name = "DF9GR",
- .version = "20100823.2", /* second revision on 23 Aug 2010 */
+ .version = "20230328.2", /* second revision on 23 Aug 2010 */
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rot_type = ROT_TYPE_OTHER,
@@ -290,6 +293,7 @@ const struct rot_caps erc_rot_caps =
.rot_cleanup = rotorez_rot_cleanup,
.set_position = rotorez_rot_set_position,
.get_position = erc_rot_get_position,
+ .park = rotorez_park,
.stop = dcu1_rot_stop,
.reset = rotorez_rot_reset,
// .stop = rotorez_rot_stop,
@@ -309,7 +313,7 @@ const struct rot_caps yrc1_rot_caps =
ROT_MODEL(ROT_MODEL_YRC1),
.model_n...
[truncated message content] |
|
From: n0nb <n0...@us...> - 2023-01-31 13:31:49
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Hamlib -- Ham radio control libraries".
The branch, master has been updated
via fa4a96e6a6c8e2ad4fcb016d6034ebfc91375a1c (commit)
via 6fbb0986121b8865eaf2c1bcd36082dfeb4290f3 (commit)
via 29ad027b6359fda2322215bcea24150b2954b1da (commit)
via 33b8c1c88db6bb87968777f6cb5bbc3f6ae5a719 (commit)
via 14016be81769a4d0c8bca813f493ff5845a97cd6 (commit)
via 2cec9e6d5725e73637d658648180413e9fc15137 (commit)
via 9bc5c4a883ce00c419e629700c4cb247dee74398 (commit)
via 8a25a3be90108e351191fcbca1d4adce91859dd0 (commit)
via ff64d86fd9b7b35c37fb89dbd7ecd5bb6ed6b033 (commit)
via 5c36bef6c2e94a516202555507c85246b1667c1c (commit)
via 41a8a50e65a6cc85ea01b2f5e64e729f1f3cba44 (commit)
via 0177d85a5d9984932c261730e3865810c511283c (commit)
via 1e353191bcb9f5eb7c8b33aa2c168ffb17f8aa41 (commit)
via eb049ab92dad8f79516939672bb9e78d0056da5d (commit)
from 8d1eacc9cb1aa6c18f44533c292022280f02b897 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit fa4a96e6a6c8e2ad4fcb016d6034ebfc91375a1c
Author: Mike Black W9MDB <mdb...@ya...>
Date: Mon Jan 30 07:54:43 2023 -0600
Add rigctlsync to doc/Makefile.am
diff --git a/doc/Makefile.am b/doc/Makefile.am
index 7cdda5c9..85a956fa 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -2,7 +2,7 @@ EXTRA_DIST = hamlib.cfg index.doxygen hamlib.css footer.html hamlib.png
dist_man_MANS = man1/ampctl.1 man1/ampctld.1 \
man1/rigctl.1 man1/rigctld.1 man1/rigmem.1 man1/rigsmtr.1 \
- man1/rigswr.1 man1/rotctl.1 man1/rotctld.1 man1/rigctlcom.1 \
+ man1/rigswr.1 man1/rotctl.1 man1/rotctld.1 man1/rigctlcom.1 man1/rigctlsync.1 \
man7/hamlib.7 man7/hamlib-primer.7 man7/hamlib-utilities.7
SRCDOCLST = \
commit 6fbb0986121b8865eaf2c1bcd36082dfeb4290f3
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sun Jan 29 15:50:27 2023 -0600
Fix segfault using python Hamlib.rig_parse_mode(None)
Argument really needed to be 'None' but now prints out better error message
https://github.com/Hamlib/Hamlib/issues/1227
diff --git a/Segfault-award b/Segfault-award
index e09c6749..4bf3b4be 100644
--- a/Segfault-award
+++ b/Segfault-award
@@ -7,6 +7,8 @@ A developer cannot apply for HSHR for segfaults on his/her own code.
Here is the list of the brave fellows:
+* Christoph Berg DF7CB python with Hamlib.rig_parse(None)
+
* Saku Nyland OH1KH v4.5.1, 10/2022, rigctld.c using ptt_type=RTS
* David Kjellquist WB5NHL, v1.1.3, 09/2002, kenwood/ts570.c
diff --git a/src/misc.c b/src/misc.c
index a82a2360..439f8382 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -496,7 +496,8 @@ static const struct
{ RIG_MODE_IQ, "IQ"},
{ RIG_MODE_ISBUSB, "ISBUSB"},
{ RIG_MODE_ISBLSB, "ISBLSB"},
- { RIG_MODE_NONE, "" },
+ { RIG_MODE_NONE, "None" }, // so we can reutnr None when NONE is requested
+ { -1, "" }, // need to end list
};
@@ -513,7 +514,7 @@ rmode_t HAMLIB_API rig_parse_mode(const char *s)
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
- for (i = 0 ; mode_str[i].str[0] != '\0'; i++)
+ for (i = 0 ; (s != NULL) && (mode_str[i].str[0] != '\0'); i++)
{
if (!strcmp(s, mode_str[i].str))
{
@@ -521,7 +522,7 @@ rmode_t HAMLIB_API rig_parse_mode(const char *s)
}
}
- rig_debug(RIG_DEBUG_WARN, "%s: mode '%s' not found\n", __func__, s);
+ rig_debug(RIG_DEBUG_WARN, "%s: mode '%s' not found...returning RIG_MODE_NONE\n", __func__, s);
return RIG_MODE_NONE;
}
@@ -1915,7 +1916,9 @@ vfo_t HAMLIB_API vfo_fixup(RIG *rig, vfo_t vfo, split_t split)
if (VFO_HAS_MAIN_SUB_ONLY) { vfo = RIG_VFO_MAIN; }
- if (VFO_HAS_MAIN_SUB_A_B_ONLY) { vfo = RIG_VFO_MAIN; }
+ //in this case we don't change it as either VFOA/B or Main/Sub makes a difference
+ //ID5100 for example has to turn on dual watch mode for Main/Sub
+ //if (VFO_HAS_MAIN_SUB_A_B_ONLY) { vfo = RIG_VFO_MAIN; }
}
else if (vfo == RIG_VFO_TX)
{
@@ -1963,7 +1966,7 @@ vfo_t HAMLIB_API vfo_fixup(RIG *rig, vfo_t vfo, split_t split)
if (VFO_HAS_MAIN_SUB_ONLY) { vfo = RIG_VFO_SUB; }
- if (VFO_HAS_MAIN_SUB_A_B_ONLY) { vfo = RIG_VFO_SUB; }
+ //if (VFO_HAS_MAIN_SUB_A_B_ONLY) { vfo = RIG_VFO_SUB; }
rig_debug(RIG_DEBUG_TRACE, "%s: final vfo=%s\n", __func__, rig_strvfo(vfo));
}
commit 29ad027b6359fda2322215bcea24150b2954b1da
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sun Jan 29 12:46:48 2023 -0600
Update simicom9700.c
diff --git a/simulators/simicom9700.c b/simulators/simicom9700.c
index 25f8996b..5da7d709 100644
--- a/simulators/simicom9700.c
+++ b/simulators/simicom9700.c
@@ -10,6 +10,7 @@
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
+#include <errno.h>
#include <sys/time.h>
#include <hamlib/rig.h>
#include "../src/misc.h"
@@ -84,7 +85,7 @@ again:
}
}
- printf("Error???\n");
+ printf("Error??? c=x%02x\n", c);
return 0;
}
@@ -234,6 +235,26 @@ void frameParse(int fd, unsigned char *frame, int len)
{
static int power_level = 0;
+ case 0x07:
+ case 0x08:
+ if (frame[6] != 0xfd)
+ {
+ frame[6] = 0xfb;
+ dumphex(frame,7);
+ n = write(fd, frame, 7);
+ printf("ACK x14 x08\n");
+ }
+ else
+ {
+ to_bcd(&frame[6], (long long)128, 2);
+ frame[8] = 0xfb;
+ dumphex(frame,9);
+ n = write(fd, frame, 9);
+ printf("SEND x14 x08\n");
+ }
+
+ break;
+
case 0x0a:
printf("Using power level %d\n", power_level);
power_level += 10;
@@ -298,6 +319,12 @@ void frameParse(int fd, unsigned char *frame, int len)
n = write(fd, frame, 7);
break;
+ case 0x19: // miscellaneous things
+ frame[5] = 0x94;
+ frame[6] = 0xfd;
+ n = write(fd, frame, 7);
+ break;
+
case 0x1a: // miscellaneous things
switch (frame[5])
{
@@ -474,7 +501,7 @@ void frameParse(int fd, unsigned char *frame, int len)
default: printf("cmd 0x%02x unknown\n", frame[4]);
}
- if (n == 0) { printf("Write failed?\n"); }
+ if (n == 0) { printf("Write failed=%s\n", strerror(errno)); }
// don't care about the rig type yet
commit 33b8c1c88db6bb87968777f6cb5bbc3f6ae5a719
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sat Jan 28 12:48:04 2023 -0600
Update NEWS
diff --git a/NEWS b/NEWS
index 4bc8c95c..767da306 100644
--- a/NEWS
+++ b/NEWS
@@ -14,6 +14,7 @@ Version 5.x -- future
Version 4.6
* 2023-11-XX -- Planned for Nov 2023
+ * Fixes for M2 Rotors
* Add rigctlsync utility to synchronize frequency from a rig to SDR# (or others)
* Add SDR# rig for use with SDR#'s gpredict plugin -- can only get/set freq
* Add Apex Shared Loop rotator -- unidirectional only so far
commit 14016be81769a4d0c8bca813f493ff5845a97cd6
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sat Jan 28 12:42:14 2023 -0600
Some updates to fix rc2800 operations
https://github.com/Hamlib/Hamlib/commit/be72027f9a3c54b2ac086d3aca456edd503d7ecf
diff --git a/rotators/m2/rc2800.c b/rotators/m2/rc2800.c
index ccea70ad..f615d679 100644
--- a/rotators/m2/rc2800.c
+++ b/rotators/m2/rc2800.c
@@ -199,15 +199,24 @@ transaction_write:
/* then comes the answer */
memset(data, 0, data_len);
- retval = read_string(&rs->rotport, (unsigned char *) data, data_len, CR,
- strlen(CR), 0, 1);
+ retval = read_string(&rs->rotport, (unsigned char *) data, data_len, CR LF,
+ strlen(CR LF), 0, 1);
// some models seem to echo -- so we'll check and read again if echoed
- if (cmdstr && strcmp(data, cmdstr) == 0)
+ // skip last char in case the reply is terminated with LF instead of CR
+ if (cmdstr && strncmp(data, cmdstr, strlen(data) - 1) == 0)
{
memset(data, 0, data_len);
- retval = read_string(&rs->rotport, (unsigned char *) data, data_len, CR,
- strlen(CR), 0, 1);
+ retval = read_string(&rs->rotport, (unsigned char *) data, data_len, CR LF,
+ strlen(CR LF), 0, 1);
+ }
+
+ // some models uses both CR + LF -- so we'll check and discard the additional one
+ if (strlen(data) == 1)
+ {
+ memset(data, 0, data_len);
+ retval = read_string(&rs->rotport, (unsigned char *) data, data_len, CR LF,
+ strlen(CR LF), 0, 1);
}
if (retval < 0)
@@ -234,19 +243,18 @@ rc2800_rot_set_position(ROT *rot, azimuth_t az, elevation_t el)
rig_debug(RIG_DEBUG_TRACE, "%s called: %f %f\n", __func__, az, el);
- if (rot->caps->rot_model == ROT_MODEL_RC2800_EARLY_AZ)
+ if (rot->caps->rot_model == ROT_MODEL_RC2800) // new protocol
+ {
+ // does the new protocol use decimal points?
+ // we'll assume no for now
+ num_sprintf(cmdstr, "A%.0f"CR, az);
+ }
+ else // old protocol (both AZ and AZEL)
{
- // we only do azimuth and this is the old protocol
// we have to switch modes and then send azimuth
// an extra CR gives us a response to expect
num_sprintf(cmdstr, "A\r%.0f\r\r", az);
}
- else
- {
- // does the new protocol use decimal points?
- // we'll assume no for now
- num_sprintf(cmdstr, "A%0f"CR, az);
- }
retval1 = rc2800_transaction(rot, cmdstr, NULL, 0);
@@ -258,17 +266,16 @@ rc2800_rot_set_position(ROT *rot, azimuth_t az, elevation_t el)
/* do not overwhelm the MCU? */
hl_usleep(200 * 1000);
- if (rot->caps->rot_model == ROT_MODEL_RC2800_EARLY_AZEL)
+ if (rot->caps->rot_model == ROT_MODEL_RC2800) // new protocol
+ {
+ num_sprintf(cmdstr, "E%.0f"CR, el);
+ }
+ else // old protocol (both AZ and AZEL)
{
- // this is the old protocol
// we have to switch modes and then send azimuth
// an extra CR gives us a response to expect
num_sprintf(cmdstr, "E\r%.0f\r\r", el);
}
- else
- {
- num_sprintf(cmdstr, "E%.0f"CR, el);
- }
retval2 = rc2800_transaction(rot, cmdstr, NULL, 0);
@@ -311,36 +318,37 @@ rc2800_rot_get_position(ROT *rot, azimuth_t *az, elevation_t *el)
}
}
- if (rot->caps->rot_model == ROT_MODEL_RC2800)
+ if (rot->caps->rot_type == ROT_TYPE_AZIMUTH)
+ {
+ rig_debug(RIG_DEBUG_TRACE, "%s: (az) = (%.1f)\n",
+ __func__, *az);
+ return RIG_OK;
+ }
+
+ /* do not overwhelm the MCU? */
+ hl_usleep(200 * 1000);
+
+ retval = rc2800_transaction(rot, "E" CR, posbuf, sizeof(posbuf));
+
+ if (retval != RIG_OK || strlen(posbuf) < 5)
{
- retval = rc2800_transaction(rot, "E" CR, posbuf, sizeof(posbuf));
+ return retval < 0 ? retval : -RIG_EPROTO;
+ }
- if (retval != RIG_OK || strlen(posbuf) < 5)
+ if (rc2800_parse(posbuf, &device, &value) == RIG_OK)
+ {
+ if (device == 'E')
{
- return retval < 0 ? retval : -RIG_EPROTO;
+ *el = (elevation_t) value;
}
-
- if (rc2800_parse(posbuf, &device, &value) == RIG_OK)
+ else
{
- if (device == 'E')
- {
- *el = (elevation_t) value;
- }
- else
- {
- return -RIG_EPROTO;
- }
+ return -RIG_EPROTO;
}
-
- rig_debug(RIG_DEBUG_TRACE, "%s: (az, el) = (%.1f, %.1f)\n",
- __func__, *az, *el);
- }
- else
- {
- rig_debug(RIG_DEBUG_TRACE, "%s: (az) = (%.1f)\n",
- __func__, *az);
}
+ rig_debug(RIG_DEBUG_TRACE, "%s: (az, el) = (%.1f, %.1f)\n",
+ __func__, *az, *el);
return RIG_OK;
}
@@ -400,7 +408,7 @@ const struct rot_caps rc2800_rot_caps =
ROT_MODEL(ROT_MODEL_RC2800),
.model_name = "RC2800",
.mfg_name = "M2",
- .version = "20210129",
+ .version = "20230123",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rot_type = ROT_TYPE_AZEL,
@@ -432,7 +440,7 @@ const struct rot_caps rc2800az_rot_caps =
ROT_MODEL(ROT_MODEL_RC2800_EARLY_AZ),
.model_name = "RC2800_EARLY_AZ",
.mfg_name = "M2",
- .version = "20201130",
+ .version = "20230123",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rot_type = ROT_TYPE_AZIMUTH,
@@ -463,7 +471,7 @@ const struct rot_caps rc2800azel_rot_caps =
ROT_MODEL(ROT_MODEL_RC2800_EARLY_AZEL),
.model_name = "RC2800_EARLY_AZEL",
.mfg_name = "M2",
- .version = "20201130",
+ .version = "20230123",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rot_type = ROT_TYPE_AZEL,
commit 2cec9e6d5725e73637d658648180413e9fc15137
Author: Mike Black W9MDB <mdb...@ya...>
Date: Fri Jan 27 23:49:47 2023 -0600
Update rigctlsync
diff --git a/doc/man1/rigctlsync.1 b/doc/man1/rigctlsync.1
index 9a9f619e..369950ad 100644
--- a/doc/man1/rigctlsync.1
+++ b/doc/man1/rigctlsync.1
@@ -264,7 +264,7 @@ with FLRig as the Hamlib model
.PP
.in +4n
.EX
-.RB $ " rigctlsync -m 4 -M 9"
+.RB $ " rigctlsync -m 4 -M 9 -R 192.168.1.1:4532"
.EE
.in
.
diff --git a/tests/rigctlsync.c b/tests/rigctlsync.c
index 63aa7c3c..0499d2fb 100644
--- a/tests/rigctlsync.c
+++ b/tests/rigctlsync.c
@@ -211,7 +211,7 @@ int main(int argc, char *argv[])
int show_conf = 0;
int dump_caps_opt = 0;
- const char *rig_file = NULL, *rig_file2 = NULL;
+ const char *rig_file = NULL, *rig_file2 = "127.0.0.1:4532";
//const char **ptt_file = NULL, *dcd_file = NULL;
//ptt_type_t ptt_type = RIG_PTT_NONE;
//dcd_type_t dcd_type = RIG_DCD_NONE;
@@ -220,7 +220,7 @@ int main(int argc, char *argv[])
char *civaddr = NULL; /* NULL means no need to set conf */
char conf_parms[MAXCONFLEN] = "";
- printf("rigctlcom Version 1.4\n");
+ printf("rigctlsync Version 1.0\n");
if (argc < 3)
{
@@ -494,7 +494,7 @@ int main(int argc, char *argv[])
rig_set_debug(verbose);
- rig_debug(RIG_DEBUG_VERBOSE, "%s, %s\n", "rigctlcom", hamlib_version2);
+ rig_debug(RIG_DEBUG_VERBOSE, "%s, %s\n", "rigctlsync", hamlib_version2);
rig_debug(RIG_DEBUG_VERBOSE, "%s",
"Report bugs to <ham...@li...>\n\n");
@@ -550,12 +550,7 @@ int main(int argc, char *argv[])
strncpy(my_rig->state.rigport.pathname, rig_file, HAMLIB_FILPATHLEN - 1);
}
- if (!rig_file2)
- {
- fprintf(stderr, "-R com port not provided\n");
- exit(2);
- }
-
+ fprintf(stderr, "rig to send frequency to: %s\n", rig_file2);
strncpy(my_rig_sync->state.rigport.pathname, rig_file2, HAMLIB_FILPATHLEN - 1);
#if 0
@@ -691,7 +686,7 @@ void usage()
name);
printf("Example: Sync freq from rigctld to SDR#\n");
- printf("\t%s -m 2 -M 9 127.0.0.1:4532\n\n", name);
+ printf("\t%s -m 2 -M 9 -R 127.0.0.1:4532\n\n", name);
printf("See the %s.1 manual page for complete details.\n\n", name);
printf(
commit 9bc5c4a883ce00c419e629700c4cb247dee74398
Author: Mike Black W9MDB <mdb...@ya...>
Date: Fri Jan 27 23:35:31 2023 -0600
Add rigctlsync utility to allow synchornizing a rig to SDR#
diff --git a/NEWS b/NEWS
index 429aca2a..4bc8c95c 100644
--- a/NEWS
+++ b/NEWS
@@ -14,6 +14,7 @@ Version 5.x -- future
Version 4.6
* 2023-11-XX -- Planned for Nov 2023
+ * Add rigctlsync utility to synchronize frequency from a rig to SDR# (or others)
* Add SDR# rig for use with SDR#'s gpredict plugin -- can only get/set freq
* Add Apex Shared Loop rotator -- unidirectional only so far
* Add client_version to rigctld so client can report it's version for future use/compatility/alternatives
diff --git a/doc/man1/rigctlsync.1 b/doc/man1/rigctlsync.1
new file mode 100644
index 00000000..9a9f619e
--- /dev/null
+++ b/doc/man1/rigctlsync.1
@@ -0,0 +1,329 @@
+.\" Hey, EMACS: -*- nroff -*-
+.\"
+.\" For layout and available macros, see man(7), man-pages(7), groff_man(7)
+.\" Please adjust the date whenever revising the manpage.
+.\"
+.\" Note: Please keep this page in sync with the source, rigctlsync.c
+.\"
+.TH RIGCTLSYNC "1" "2023-01-27" "Hamlib" "Hamlib Utilities"
+.
+.
+.SH NAME
+.
+rigctlsync \- synchronize a rig to SDR# (or other rig)
+.
+.SH SYNOPSIS
+.
+.
+.SY rigctlsync
+.OP \-hlLuV
+.OP \-m id
+.OP \-r device
+.OP \-R device
+.OP \-s baud
+.OP \-S baud
+.OP \-c id
+.OP \-C parm=val
+.OP \-B
+.RB [ \-v [ \-Z ]]
+.YS
+.
+.SH DESCRIPTION
+Allows you to synchornize frequence from a rig to SDR#.
+Best when used with rigctld, FlRig, or a multiport radio.
+.
+.PP
+Please report bugs and provide feedback at the e-mail address given in the
+.B BUGS
+section below. Patches and code enhancements sent to the same address are
+welcome.
+.
+.
+.SH OPTIONS
+.
+This program follows the usual GNU command line syntax. Short options that
+take an argument may have the value follow immediately or be separated by a
+space. Long options starting with two dashes (\(oq\-\(cq) require an
+\(oq=\(cq between the option and any argument.
+.
+.PP
+Here is a summary of the supported options:
+.
+.TP
+.BR \-m ", " \-\-model = \fIid\fP
+Select radio model number.
+.IP
+See model list (use \(lqrigctlsync -l\(rq).
+.IP
+.BR Note :
+.B rigctlsync
+(or third party software using the C API) will use radio model 2 for
+.B NET rigctl
+(communicating with
+.BR rigctld ).
+.
+.TP
+.BR \-r ", " \-\-rig\-file = \fIdevice\fP
+Use
+.I device
+as the file name of the port connected to the radio.
+.IP
+Often a serial port, but could be a USB to serial adapter. Typically
+.IR /dev/ttyS0 ", " /dev/ttyS1 ", " /dev/ttyUSB0 ,
+etc. on Linux,
+.IR COM1 ", " COM2 ,
+etc. on MS Windows. The BSD flavors and Mac OS/X have their own designations.
+See your system's documentation.
+.IP
+The special string \(lquh\-rig\(rq may be given to enable micro-ham device
+support.
+.
+.TP
+.BR \-R ", " \-\-rig\-file2 = \fIdevice\fP
+Use
+.I device
+as the file name of one of the virtual com ports -- your program will connect
+to the other com port of the virtual pair.
+.
+.TP
+.BR \-s ", " \-\-serial\-speed = \fIbaud\fP
+Set serial speed to
+.I baud
+rate.
+.IP
+Uses maximum serial speed from radio backend capabilities (set by
+.B -m
+above) as the default.
+.
+.TP
+.BR \-S ", " \-\-serial\-speed2 = \fIbaud\fP
+Set serial speed to
+.I baud
+rate for virtual com port (see
+.BR -R ).
+.
+.IP
+Uses maximum serial speed from radio backend capabilities (set by
+.B -m
+above) as the default.
+.
+.TP
+.BR \-c ", " \-\-civaddr = \fIid\fP
+Use
+.I id
+as the CI-V address to communicate with the rig.
+.IP
+Only useful for Icom and some Ten-Tec rigs.
+.IP
+.BR Note :
+The
+.I id
+is in decimal notation, unless prefixed by
+.IR 0x ,
+in which case it is hexadecimal.
+.
+.TP
+.BR \-L ", " \-\-show\-conf
+List all config parameters for the radio defined with
+.B \-m
+above.
+.
+.TP
+.BR \-C ", " \-\-set\-conf = \fIparm=val\fP [ \fI,parm=val\fP ]
+Set radio configuration parameter(s), e.g.
+.IR stop_bits=2 .
+.IP
+Use the
+.B -L
+option above for a list of configuration parameters for a given model number.
+.
+.TP
+.BR \-u ", " \-\-dump\-caps
+Dump capabilities for the radio defined with
+.B -m
+above and exit.
+.
+.TP
+.BR \-l ", " \-\-list
+List all model numbers defined in
+.B Hamlib
+and exit.
+.IP
+The list is sorted by model number.
+.IP
+.BR Note :
+In Linux the list can be scrolled back using
+.BR Shift-PageUp / Shift-PageDown ,
+or using the scrollbars of a virtual terminal in X or the cmd window in
+Windows. The output can be piped to
+.BR more (1)
+or
+.BR less (1),
+e.g. \(lqrigctl -l | more\(rq.
+.
+.TP
+.BR \-n ", " \-\-no\-restore\-ai
+.B rigctl
+restores the state of auto information (AI) on the controlled rig.
+.IP
+If this is not desired, for example if you are using
+.B rigctl
+to turn AI mode on or off, pass this option.
+.
+.TP
+.BR \-B ", " \-\-mapa2b
+Maps set_freq on VFOA to VFOB instead.
+This allows using CW skimmer with the rig in split mode and clicking on a frequency in CW skimmer
+will set VFOB to the transmit frequency.
+.
+.TP
+.BR \-v ", " \-\-verbose
+Set verbose mode, cumulative (see
+.B DIAGNOSTICS
+below).
+.
+.TP
+.BR \-Z ", " \-\-debug\-time\-stamps
+Enable time stamps for the debug messages.
+.IP
+Use only in combination with the
+.B -v
+option as it generates no output on its own.
+.
+.TP
+.BR \-h ", " \-\-help
+Show a summary of these options and exit.
+.
+.TP
+.BR \-V ", " \-\-version
+Show version of
+.B rigctl
+and exit.
+.
+.PP
+.BR Note :
+Some options may not be implemented by a given backend and will return an
+error. This is most likely to occur with the
+.B \-\-set\-conf
+and
+.B \-\-show\-conf
+options.
+.
+.
+.SH DIAGNOSTICS
+.
+The
+.BR \-v ,
+.B \-\-verbose
+option allows different levels of diagnostics
+to be output to
+.B stderr
+and correspond to \-v for
+.BR BUG ,
+\-vv for
+.BR ERR ,
+\-vvv for
+.BR WARN ,
+\-vvvv for
+.BR VERBOSE ,
+or \-vvvvv for
+.BR TRACE .
+.
+.PP
+A given verbose level is useful for providing needed debugging information to
+the email address below. For example, TRACE output shows all of the values
+sent to and received from the radio which is very useful for radio backend
+library development and may be requested by the developers.
+.
+.
+.SH EXIT STATUS
+.B rigctlsync
+exits with:
+.
+.TP
+.B 0
+if all operations completed normally;
+.
+.TP
+.B 1
+if there was an invalid command line option or argument;
+.
+.TP
+.B 2
+if an error was returned by
+.BR Hamlib .
+.
+.
+.SH EXAMPLE
+.
+Start
+.B rigctlsync
+with FLRig as the Hamlib model
+.UE
+.
+.PP
+.in +4n
+.EX
+.RB $ " rigctlsync -m 4 -M 9"
+.EE
+.in
+.
+.PP
+The following diagram shows the communications flow that allows N1MM Logger+
+to communicate with a radio connected to Flrig:
+.
+.PP
+.in +4n
+.EE
+.in
+.
+.
+.SH BUGS
+.
+.PP
+Report bugs to:
+.IP
+.nf
+.MT hamlib\-dev...@li...
+Hamlib Developer mailing list
+.ME
+.fi
+.
+.
+.SH COPYING
+.
+This file is part of Hamlib, a project to develop a library that simplifies
+radio, rotator, and amplifier control functions for developers of software
+primarily of interest to radio amateurs and those interested in radio
+communications.
+.
+.PP
+Copyright \(co 2000-2011 Stephane Fillod
+.br
+Copyright \(co 2000-2018 the Hamlib Group (various contributors)
+.br
+Copyright \(co 2010-2020 Nate Bargmann
+.br
+Copyright \(co 2019 Michael Black W9MDB
+.
+.PP
+This is free software; see the file COPYING for copying conditions. There is
+NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+.
+.
+.SH SEE ALSO
+.
+.BR rigctld (1),
+.BR rigctl (1),
+.BR socat (1),
+.BR hamlib (7)
+.
+.
+.SH COLOPHON
+.
+Links to the Hamlib Wiki, Git repository, release archives, and daily snapshot
+archives are available via
+.
+.UR http://www.hamlib.org
+hamlib.org
+.UE .
diff --git a/tests/Makefile.am b/tests/Makefile.am
index a9c5d7b1..f80b7111 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -14,7 +14,7 @@ endif
DISTCLEANFILES = rigctl.log rigctl.sum testbcd.log testbcd.sum
-bin_PROGRAMS = rigctl rigctld rigmem rigsmtr rigswr rotctl rotctld rigctlcom rigctltcp ampctl ampctld $(TESTLIBUSB)
+bin_PROGRAMS = rigctl rigctld rigmem rigsmtr rigswr rotctl rotctld rigctlcom rigctltcp rigctlsync ampctl ampctld $(TESTLIBUSB)
#check_PROGRAMS = dumpmem testrig testrigopen testrigcaps testtrn testbcd testfreq listrigs testloc rig_bench testcache cachetest cachetest2 testcookie testgrid testsecurity
check_PROGRAMS = dumpmem testrig testrigopen testrigcaps testtrn testbcd testfreq listrigs testloc rig_bench testcache cachetest cachetest2 testcookie testgrid hamlibmodels
@@ -27,6 +27,7 @@ rigctl_SOURCES = rigctl.c $(RIGCOMMONSRC)
rigctld_SOURCES = rigctld.c $(RIGCOMMONSRC)
rigctlcom_SOURCES = rigctlcom.c $(RIGCOMMONSRC)
rigctltcp_SOURCES = rigctltcp.c $(RIGCOMMONSRC)
+rigctlsync_SOURCES = rigctlsync.c $(RIGCOMMONSRC)
rotctl_SOURCES = rotctl.c $(ROTCOMMONSRC)
rotctld_SOURCES = rotctld.c $(ROTCOMMONSRC)
ampctl_SOURCES = ampctl.c $(AMPCOMMONSRC)
@@ -52,6 +53,7 @@ ampctl_CFLAGS = $(AM_CFLAGS) $(PTHREAD_CFLAGS) -I$(top_builddir)/src
ampctld_CFLAGS = $(AM_CFLAGS) $(PTHREAD_CFLAGS) -I$(top_builddir)/src
rigctlcom_CFLAGS = $(AM_CFLAGS) $(PTHREAD_CFLAGS) -I$(top_builddir)/security
rigctltcp_CFLAGS = $(AM_CFLAGS) $(PTHREAD_CFLAGS) -I$(top_builddir)/security
+rigctlsync_CFLAGS = $(AM_CFLAGS) $(PTHREAD_CFLAGS) -I$(top_builddir)/security
if HAVE_LIBUSB
rigtestlibusb_CFLAGS = $(AM_CFLAGS) $(PTHREAD_CFLAGS) $(LIBUSB_CFLAGS)
endif
@@ -66,6 +68,7 @@ ampctld_LDADD = $(NET_LIBS) $(PTHREAD_LIBS) $(LDADD) $(READLINE_LIBS)
rigmem_LDADD = $(LIBXML2_LIBS) $(LDADD)
rigctlcom_LDADD = $(NET_LIBS) $(PTHREAD_LIBS) $(LDADD) $(READLINE_LIBS)
rigctltcp_LDADD = $(NET_LIBS) $(PTHREAD_LIBS) $(LDADD) $(READLINE_LIBS)
+rigctlsync_LDADD = $(NET_LIBS) $(PTHREAD_LIBS) $(LDADD) $(READLINE_LIBS)
if HAVE_LIBUSB
rigtestlibusb_LDADD = $(LIBUSB_LIBS)
endif
@@ -82,6 +85,7 @@ rotctld_LDFLAGS = $(WINEXELDFLAGS)
ampctld_LDFLAGS = $(WINEXELDFLAGS)
rigctlcom_LDFLAGS = $(WINEXELDFLAGS)
rigctltcp_LDFLAGS = $(WINEXELDFLAGS)
+rigctlsync_LDFLAGS = $(WINEXELDFLAGS)
if HAVE_LIBUSB
rigtestlibusb_LDFLAGS = $(WINEXELDFLAGS)
endif
diff --git a/tests/rigctlsync.c b/tests/rigctlsync.c
new file mode 100644
index 00000000..63aa7c3c
--- /dev/null
+++ b/tests/rigctlsync.c
@@ -0,0 +1,716 @@
+/*
+ * rigctlsync.c - (C) Stephane Fillod 2000-2011
+ * (C) The Hamlib Group 2012
+ * (C) Nate Bargmann 2008,2010,2011,2012,2013
+ * (C) Michael Black W9MDB 2023 - derived from rigctlcom.c
+ *
+ * This program will synchronize frequency from one rig to another
+ * Implemented for AirSpy SDR# to keep freq synced with a real rig
+ * It simply polls the real rig and when freq changes sends it to SDR# (or whatever rig is hooked up)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ */
+
+#include <hamlib/config.h>
+
+#ifdef WIN32
+#define WIN32_LEAN_AND_MEAN
+// cppcheck-suppress *
+#include <windows.h>
+#endif
+
+// cppcheck-suppress *
+#include <stdio.h>
+// cppcheck-suppress *
+#include <stdlib.h>
+// cppcheck-suppress *
+#include <string.h>
+// cppcheck-suppress *
+// cppcheck-suppress *
+#include <ctype.h>
+// cppcheck-suppress *
+#include <errno.h>
+// cppcheck-suppress *
+#include <signal.h>
+
+// cppcheck-suppress *
+#include <getopt.h>
+
+// cppcheck-suppress *
+#include <sys/types.h>
+
+#ifdef HAVE_NETINET_IN_H
+// cppcheck-suppress *
+# include <netinet/in.h>
+#endif
+
+#ifdef HAVE_ARPA_INET_H
+// cppcheck-suppress *
+# include <arpa/inet.h>
+#endif
+
+#ifdef HAVE_SYS_SOCKET_H
+// cppcheck-suppress *
+# include <sys/socket.h>
+#elif HAVE_WS2TCPIP_H
+# include <ws2tcpip.h>
+# include <fcntl.h>
+# if defined(HAVE_WSPIAPI_H)
+# include <wspiapi.h>
+# endif
+#endif
+
+#include <hamlib/rig.h>
+#include "misc.h"
+#include "iofunc.h"
+#include "serial.h"
+#include "sprintflst.h"
+#include "rigctl_parse.h"
+#include "sleep.h"
+
+/*
+ * Reminder: when adding long options,
+ * keep up to date SHORT_OPTIONS, usage()'s output and man page. thanks.
+ * NB: do NOT use -W since it's reserved by POSIX.
+ * TODO: add an option to read from a file
+ */
+#define SHORT_OPTIONS "B:m:M:r:R:p:d:P:D:s:S:c:C:lLuvhVZ"
+static struct option long_options[] =
+{
+ {"mapa2b", 0, 0, 'B'},
+ {"model", 1, 0, 'm'},
+ {"rig-file", 1, 0, 'r'},
+ {"rig-file2", 1, 0, 'R'},
+ {"ptt-file", 1, 0, 'p'},
+ {"dcd-file", 1, 0, 'd'},
+ {"ptt-type", 1, 0, 'P'},
+ {"dcd-type", 1, 0, 'D'},
+ {"serial-speed", 1, 0, 's'},
+ {"serial-speed2", 1, 0, 'S'},
+ {"civaddr", 1, 0, 'c'},
+ {"set-conf", 1, 0, 'C'},
+ {"list", 0, 0, 'l'},
+ {"show-conf", 0, 0, 'L'},
+ {"dump-caps", 0, 0, 'u'},
+ {"verbose", 0, 0, 'v'},
+ {"help", 0, 0, 'h'},
+ {"version", 0, 0, 'V'},
+ {"debug-time-stamps", 0, 0, 'Z'},
+ {0, 0, 0, 0}
+};
+
+void usage();
+static RIG *my_rig; /* handle to rig */
+static RIG
+*my_rig_sync; /* rig the gets synchronized -- freq only for now */
+static int verbose;
+/* CW Skimmer can only set VFOA */
+/* IC7300 for example can run VFOA on FM and VFOB on CW */
+/* So -A/--mapa2b changes set_freq on VFOA to VFOB */
+/* This allows working CW Skimmer in split mode and transmit on VFOB */
+static int mapa2b; /* maps set_freq on VFOA to VFOB instead */
+
+#ifdef HAVE_SIG_ATOMIC_T
+static sig_atomic_t volatile ctrl_c;
+#else
+static int volatile ctrl_c;
+#endif
+
+#define MAXCONFLEN 1024
+
+#if 0
+# ifdef WIN32
+static BOOL WINAPI CtrlHandler(DWORD fdwCtrlType)
+{
+ rig_debug(RIG_DEBUG_VERBOSE, "CtrlHandler called\n");
+
+ switch (fdwCtrlType)
+ {
+ case CTRL_C_EVENT:
+ case CTRL_CLOSE_EVENT:
+ ctrl_c = 1;
+ return TRUE;
+
+ default:
+ return FALSE;
+ }
+}
+# else
+static void signal_handler(int sig)
+{
+ switch (sig)
+ {
+ case SIGINT:
+ ctrl_c = 1;
+ break;
+
+ default:
+ /* do nothing */
+ break;
+ }
+}
+# endif /* ifdef WIN32 */
+#endif /* if 0 */
+
+#if 0
+static void handle_error(enum rig_debug_level_e lvl, const char *msg)
+{
+ int e;
+# ifdef __MINGW32__
+ LPVOID lpMsgBuf;
+
+ lpMsgBuf = (LPVOID)"Unknown error";
+ e = WSAGetLastError();
+
+ if (FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER
+ | FORMAT_MESSAGE_FROM_SYSTEM
+ | FORMAT_MESSAGE_IGNORE_INSERTS,
+ NULL,
+ e,
+ MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
+ // Default language
+ (LPTSTR)&lpMsgBuf,
+ 0,
+ NULL))
+ {
+
+ rig_debug(lvl, "%s: Network error %d: %s\n", msg, e, lpMsgBuf);
+ LocalFree(lpMsgBuf);
+ }
+ else
+ {
+ rig_debug(lvl, "%s: Network error %d\n", msg, e);
+ }
+
+# else
+ e = errno;
+ rig_debug(lvl, "%s: Network error %d: %s\n", msg, e, strerror(e));
+# endif /* ifdef __MINGW32__ */
+}
+#endif /* if 0 */
+
+
+int main(int argc, char *argv[])
+{
+ rig_model_t my_model[] = { RIG_MODEL_DUMMY, RIG_MODEL_SDRSHARP };
+
+ int retcode; /* generic return code from functions */
+
+ int show_conf = 0;
+ int dump_caps_opt = 0;
+ const char *rig_file = NULL, *rig_file2 = NULL;
+ //const char **ptt_file = NULL, *dcd_file = NULL;
+ //ptt_type_t ptt_type = RIG_PTT_NONE;
+ //dcd_type_t dcd_type = RIG_DCD_NONE;
+ int serial_rate = 0;
+ int serial_rate2 = 0; /* virtual com port default speed */
+ char *civaddr = NULL; /* NULL means no need to set conf */
+ char conf_parms[MAXCONFLEN] = "";
+
+ printf("rigctlcom Version 1.4\n");
+
+ if (argc < 3)
+ {
+ usage();
+ return 1;
+ }
+
+ while (1)
+ {
+ int c;
+ int option_index = 0;
+ char dummy[2];
+
+ c = getopt_long(argc,
+ argv,
+ SHORT_OPTIONS,
+ long_options,
+ &option_index);
+
+ if (c == -1)
+ {
+ break;
+ }
+
+ switch (c)
+ {
+ case 'h':
+ usage();
+ exit(0);
+
+ case 'V':
+ version();
+ exit(0);
+
+ case 'B':
+ mapa2b = 1;
+ break;
+
+ case 'm':
+ case 'M':
+ if (!optarg)
+ {
+ usage(); /* wrong arg count */
+ exit(1);
+ }
+
+ if (c == 'm')
+ {
+ my_model[0] = atoi(optarg);
+ }
+ else
+ {
+ my_model[1] = atoi(optarg);
+ }
+
+ break;
+
+ case 'r':
+ if (!optarg)
+ {
+ usage(); /* wrong arg count */
+ exit(1);
+ }
+
+ rig_file = optarg;
+ break;
+
+ case 'R':
+ if (!optarg)
+ {
+ usage(); /* wrong arg count */
+ exit(1);
+ }
+
+ rig_file2 = optarg;
+ break;
+
+
+#if 0
+
+ case 'p':
+ if (!optarg)
+ {
+ usage(); /* wrong arg count */
+ exit(1);
+ }
+
+ ptt_file = optarg;
+ break;
+#endif
+
+#if 0
+
+ case 'd':
+ if (!optarg)
+ {
+ usage(); /* wrong arg count */
+ exit(1);
+ }
+
+ dcd_file = optarg;
+ break;
+#endif
+
+#if 0
+
+ case 'P':
+ if (!optarg)
+ {
+ usage(); /* wrong arg count */
+ exit(1);
+ }
+
+ if (!strcmp(optarg, "RIG"))
+ {
+ ptt_type = RIG_PTT_RIG;
+ }
+ else if (!strcmp(optarg, "DTR"))
+ {
+ ptt_type = RIG_PTT_SERIAL_DTR;
+ }
+ else if (!strcmp(optarg, "RTS"))
+ {
+ ptt_type = RIG_PTT_SERIAL_RTS;
+ }
+ else if (!strcmp(optarg, "PARALLEL"))
+ {
+ ptt_type = RIG_PTT_PARALLEL;
+ }
+ else if (!strcmp(optarg, "CM108"))
+ {
+ ptt_type = RIG_PTT_CM108;
+ }
+ else if (!strcmp(optarg, "NONE"))
+ {
+ ptt_type = RIG_PTT_NONE;
+ }
+ else
+ {
+ ptt_type = atoi(optarg);
+ }
+
+ break;
+#endif
+
+#if 0
+
+ case 'D':
+ if (!optarg)
+ {
+ usage(); /* wrong arg count */
+ exit(1);
+ }
+
+ if (!strcmp(optarg, "RIG"))
+ {
+ dcd_type = RIG_DCD_RIG;
+ }
+ else if (!strcmp(optarg, "DSR"))
+ {
+ dcd_type = RIG_DCD_SERIAL_DSR;
+ }
+ else if (!strcmp(optarg, "CTS"))
+ {
+ dcd_type = RIG_DCD_SERIAL_CTS;
+ }
+ else if (!strcmp(optarg, "CD"))
+ {
+ dcd_type = RIG_DCD_SERIAL_CAR;
+ }
+ else if (!strcmp(optarg, "PARALLEL"))
+ {
+ dcd_type = RIG_DCD_PARALLEL;
+ }
+ else if (!strcmp(optarg, "NONE"))
+ {
+ dcd_type = RIG_DCD_NONE;
+ }
+ else
+ {
+ dcd_type = atoi(optarg);
+ }
+
+ break;
+#endif
+
+ case 'c':
+ if (!optarg)
+ {
+ usage(); /* wrong arg count */
+ exit(1);
+ }
+
+ civaddr = optarg;
+ break;
+
+ case 's':
+ if (!optarg)
+ {
+ usage(); /* wrong arg count */
+ exit(1);
+ }
+
+ if (sscanf(optarg, "%d%1s", &serial_rate, dummy) != 1)
+ {
+ fprintf(stderr, "Invalid baud rate of %s\n", optarg);
+ exit(1);
+ }
+
+ break;
+
+ case 'S':
+ if (!optarg)
+ {
+ usage(); /* wrong arg count */
+ exit(1);
+ }
+
+ serial_rate2 = atoi(optarg);
+ break;
+
+
+ case 'C':
+ if (!optarg)
+ {
+ usage(); /* wrong arg count */
+ exit(1);
+ }
+
+ if (*conf_parms != '\0')
+ {
+ strcat(conf_parms, ",");
+ }
+
+ if (strlen(conf_parms) + strlen(optarg) > MAXCONFLEN - 24)
+ {
+ printf("Length of conf_parms exceeds internal maximum of %d\n",
+ MAXCONFLEN - 24);
+ return 1;
+ }
+
+ strncat(conf_parms, optarg, MAXCONFLEN - strlen(conf_parms));
+ break;
+
+ case 'v':
+ verbose++;
+ break;
+
+ case 'L':
+ show_conf++;
+ break;
+
+ case 'l':
+ rig_set_debug(verbose);
+ list_models();
+ exit(0);
+
+ case 'u':
+ dump_caps_opt++;
+ break;
+
+ case 'Z':
+ rig_set_debug_time_stamp(1);
+ break;
+
+ default:
+ usage(); /* unknown option? */
+ exit(1);
+ }
+ }
+
+ rig_set_debug(verbose);
+
+ rig_debug(RIG_DEBUG_VERBOSE, "%s, %s\n", "rigctlcom", hamlib_version2);
+ rig_debug(RIG_DEBUG_VERBOSE, "%s",
+ "Report bugs to <ham...@li...>\n\n");
+
+ if (argc == 1)
+ {
+ usage();
+ exit(2);
+ }
+
+ my_rig = rig_init(my_model[0]);
+
+ if (!my_rig)
+ {
+ fprintf(stderr,
+ "Unknown rig num %d, or initialization error.\n",
+ my_model[0]);
+
+ fprintf(stderr, "Please check with --list option.\n");
+ exit(2);
+ }
+
+ my_rig_sync = rig_init(my_model[1]);
+
+ if (!my_rig_sync)
+ {
+ fprintf(stderr,
+ "Unknown rig num %d, or initialization error.\n",
+ my_model[1]);
+
+ fprintf(stderr, "Please check with --list option.\n");
+ exit(2);
+ }
+
+#if 0
+ retcode = set_conf(my_rig, conf_parms);
+
+ if (retcode != RIG_OK)
+ {
+ fprintf(stderr, "Config parameter error: %s\n", rigerror(retcode));
+ exit(2);
+ }
+
+#endif
+
+ if (my_model[0] > 5 && !rig_file)
+ {
+ fprintf(stderr, "-r rig com port not provided\n");
+ exit(2);
+ }
+
+ if (rig_file)
+ {
+ strncpy(my_rig->state.rigport.pathname, rig_file, HAMLIB_FILPATHLEN - 1);
+ }
+
+ if (!rig_file2)
+ {
+ fprintf(stderr, "-R com port not provided\n");
+ exit(2);
+ }
+
+ strncpy(my_rig_sync->state.rigport.pathname, rig_file2, HAMLIB_FILPATHLEN - 1);
+
+#if 0
+
+ /*
+ * ex: RIG_PTT_PARALLEL and /dev/parport0
+ */
+ if (ptt_type != RIG_PTT_NONE)
+ {
+ my_rig->state.pttport.type.ptt = ptt_type;
+ }
+
+ if (dcd_type != RIG_DCD_NONE)
+ {
+ my_rig->state.dcdport.type.dcd = dcd_type;
+ }
+
+ if (ptt_file)
+ {
+ strncpy(my_rig->state.pttport.pathname, ptt_file, HAMLIB_FILPATHLEN - 1);
+ }
+
+ if (dcd_file)
+ {
+ strncpy(my_rig->state.dcdport.pathname, dcd_file, HAMLIB_FILPATHLEN - 1);
+ }
+
+#endif
+
+ /* FIXME: bound checking and port type == serial */
+ if (serial_rate != 0)
+ {
+ my_rig->state.rigport.parm.serial.rate = serial_rate;
+ }
+
+ if (serial_rate2 != 0)
+ {
+ my_rig_sync->state.rigport.parm.serial.rate = serial_rate2;
+ }
+
+
+ if (civaddr)
+ {
+ rig_set_conf(my_rig, rig_token_lookup(my_rig, "civaddr"), civaddr);
+ }
+
+ /*
+ * print out conf parameters
+ */
+ if (show_conf)
+ {
+ rig_token_foreach(my_rig, print_conf_list, (rig_ptr_t)my_rig);
+ }
+
+ /*
+ * print out conf parameters, and exits immediately
+ * We may be interested only in only caps, and rig_open may fail.
+ */
+ if (dump_caps_opt)
+ {
+ dumpcaps(my_rig, stdout);
+ rig_cleanup(my_rig); /* if you care about memory */
+ exit(0);
+ }
+
+ /* open and close rig connection to check early for issues */
+ retcode = rig_open(my_rig);
+
+ if (retcode != RIG_OK)
+ {
+ fprintf(stderr, "rig_open: error = %s \n", rigerror(retcode));
+ exit(2);
+ }
+
+
+ retcode = rig_open(my_rig_sync);
+
+ if (retcode != RIG_OK)
+ {
+ fprintf(stderr, "rig_open sync: error = %s \n", rigerror(retcode));
+ exit(2);
+ }
+
+
+ if (verbose > 0)
+ {
+ printf("Opened rig model %d, '%s'\n",
+ my_rig->caps->rig_model,
+ my_rig->caps->model_name);
+ }
+
+ rig_debug(RIG_DEBUG_VERBOSE, "Backend version: %s, Status: %s\n",
+ my_rig->caps->version, rig_strstatus(my_rig->caps->status));
+
+ /*
+ * main loop
+ */
+ do
+ {
+ freq_t freq;
+ int retval = rig_get_freq(my_rig, RIG_VFO_CURR, &freq);
+
+ if (retval != RIG_OK)
+ {
+ rig_debug(RIG_DEBUG_ERR, "%s: Error in rig_get_freq: %s\n", __func__,
+ rigerror(retval));
+ }
+
+ if (retval != RIG_OK)
+ {
+ rig_debug(RIG_DEBUG_ERR, "%s: Error in rig_set_freq: %s\n", __func__,
+ rigerror(retval));
+ }
+
+ retval = rig_set_freq(my_rig_sync, RIG_VFO_CURR, freq);
+
+ hl_usleep(400 * 1000); // fairly fast to keep up
+ }
+ while (retcode == 0 && !ctrl_c);
+
+ rig_close(my_rig); /* close port */
+ rig_cleanup(my_rig); /* if you care about memory */
+
+ return 0;
+}
+
+void usage()
+{
+ char *name = "rigctlsync";
+ printf("Usage: %s -m rignumber -r comport -s baud -M rignumber -R comport [OPTIONS]...\n\n"
+ "Will copy frequency from -m rig to -M rig\n"
+ "e.g. will keep SDR# synchronized to a rig.\n\n",
+ name);
+
+ printf("Example: Sync freq from rigctld to SDR#\n");
+ printf("\t%s -m 2 -M 9 127.0.0.1:4532\n\n", name);
+ printf("See the %s.1 manual page for complete details.\n\n", name);
+
+ printf(
+ " -m, --model=ID select radio model number. See model list (-l)\n"
+ " -r, --rig-file=DEVICE set device of the radio to operate on\n"
+ " -R, --rig-file2=DEVICE set device of the virtual com port to operate on\n"
+ " -s, --serial-speed=BAUD set serial speed of the serial port\n"
+ " -S, --serial-speed2=BAUD set serial speed of the virtual com port [default=115200]\n"
+ " -c, --civaddr=ID set CI-V address, decimal (for Icom rigs only)\n"
+ " -C, --set-conf=PARM=VAL set config parameters\n"
+ " -L, --show-conf list all config parameters\n"
+ " -l, --list list all model numbers and exit\n"
+ " -u, --dump-caps dump capabilities and exit\n"
+ " -v, --verbose set verbose mode, cumulative (-v to -vvvvv)\n"
+ " -Z, --debug-time-stamps enable time stamps for debug messages\n"
+ " -h, --help display this help and exit\n"
+ " -V, --version output version information and exit\n\n"
+ );
+
+ printf("\nReport bugs to <ham...@li...>.\n");
+
+}
commit 8a25a3be90108e351191fcbca1d4adce91859dd0
Author: Mike Black W9MDB <mdb...@ya...>
Date: Fri Jan 27 17:46:46 2023 -0600
Fix sdrsharp model name to show gpredict
diff --git a/rigs/dummy/sdrsharp.c b/rigs/dummy/sdrsharp.c
index 7b61b0e7..2eb45cdf 100644
--- a/rigs/dummy/sdrsharp.c
+++ b/rigs/dummy/sdrsharp.c
@@ -525,7 +525,7 @@ static int sdrsharp_get_vfo(RIG *rig, vfo_t *vfo)
const struct rig_caps sdrsharp_caps =
{
RIG_MODEL(RIG_MODEL_SDRSHARP),
- .model_name = "SDR#",
+ .model_name = "SDR#/gpredict",
.mfg_name = "Airspy",
.version = "20230127.0",
.copyright = "LGPL",
commit ff64d86fd9b7b35c37fb89dbd7ecd5bb6ed6b033
Author: Mike Black W9MDB <mdb...@ya...>
Date: Fri Jan 27 17:44:08 2023 -0600
Fix sdrsharp manufacturer name
diff --git a/rigs/dummy/sdrsharp.c b/rigs/dummy/sdrsharp.c
index e8b5dace..7b61b0e7 100644
--- a/rigs/dummy/sdrsharp.c
+++ b/rigs/dummy/sdrsharp.c
@@ -526,7 +526,7 @@ const struct rig_caps sdrsharp_caps =
{
RIG_MODEL(RIG_MODEL_SDRSHARP),
.model_name = "SDR#",
- .mfg_name = "Hamlib",
+ .mfg_name = "Airspy",
.version = "20230127.0",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
commit 5c36bef6c2e94a516202555507c85246b1667c1c
Author: Mike Black W9MDB <mdb...@ya...>
Date: Fri Jan 27 17:39:14 2023 -0600
Fix compile warning in sdrsharp.c
diff --git a/rigs/dummy/sdrsharp.c b/rigs/dummy/sdrsharp.c
index 0f95cdce..e8b5dace 100644
--- a/rigs/dummy/sdrsharp.c
+++ b/rigs/dummy/sdrsharp.c
@@ -39,8 +39,8 @@
#define FALSE 0
-#define MAXCMDLEN 8192
-#define MAXXMLLEN 8192
+#define MAXCMDLEN 128
+#define MAXXMLLEN 128
#define MAXARGLEN 128
#define MAXBANDWIDTHLEN 4096
commit 41a8a50e65a6cc85ea01b2f5e64e729f1f3cba44
Author: Mike Black W9MDB <mdb...@ya...>
Date: Fri Jan 27 17:31:24 2023 -0600
Add SDR# rig for use with SDR#'s gpredict pluigin -- can only get/set freq
diff --git a/NEWS b/NEWS
index 8662ce99..429aca2a 100644
--- a/NEWS
+++ b/NEWS
@@ -14,6 +14,7 @@ Version 5.x -- future
Version 4.6
* 2023-11-XX -- Planned for Nov 2023
+ * Add SDR# rig for use with SDR#'s gpredict plugin -- can only get/set freq
* Add Apex Shared Loop rotator -- unidirectional only so far
* Add client_version to rigctld so client can report it's version for future use/compatility/alternatives
* Add --set-conf=tuner_control_pathname=hamlib_tuner_control (default)
diff --git a/include/hamlib/riglist.h b/include/hamlib/riglist.h
index 6d730595..3c641856 100644
--- a/include/hamlib/riglist.h
+++ b/include/hamlib/riglist.h
@@ -72,6 +72,7 @@
#define RIG_MODEL_DUMMY_NOVFO RIG_MAKE_MODEL(RIG_DUMMY, 6)
#define RIG_MODEL_TCI1X RIG_MAKE_MODEL(RIG_DUMMY, 7)
#define RIG_MODEL_ACLOG RIG_MAKE_MODEL(RIG_DUMMY, 8)
+#define RIG_MODEL_SDRSHARP RIG_MAKE_MODEL(RIG_DUMMY, 9)
/*
* Yaesu
diff --git a/rigs/dummy/Android.mk b/rigs/dummy/Android.mk
index 84054465..4108a9db 100644
--- a/rigs/dummy/Android.mk
+++ b/rigs/dummy/Android.mk
@@ -2,7 +2,7 @@ LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
-LOCAL_SRC_FILES := dummy.c rot_dummy.c netrigctl.c netrotctl.c flrig.c trxmanager.c dummy_common.c
+LOCAL_SRC_FILES := dummy.c rot_dummy.c netrigctl.c netrotctl.c flrig.c trxmanager.c dummy_common.c sdrsharp.c
LOCAL_MODULE := dummy
LOCAL_CFLAGS :=
diff --git a/rigs/dummy/Makefile.am b/rigs/dummy/Makefile.am
index 5a419d3f..f763ee87 100644
--- a/rigs/dummy/Makefile.am
+++ b/rigs/dummy/Makefile.am
@@ -1,4 +1,4 @@
-DUMMYSRC = dummy_common.c dummy_common.h dummy.c dummy.h rot_dummy.c rot_dummy.h netrigctl.c netrotctl.c flrig.c flrig.h trxmanager.c trxmanager.h amp_dummy.c amp_dummy.h netampctl.c tci1x.c aclog.c
+DUMMYSRC = dummy_common.c dummy_common.h dummy.c dummy.h rot_dummy.c rot_dummy.h netrigctl.c netrotctl.c flrig.c flrig.h trxmanager.c trxmanager.h amp_dummy.c amp_dummy.h netampctl.c tci1x.c aclog.c sdrsharp.c
noinst_LTLIBRARIES = libhamlib-dummy.la
libhamlib_dummy_la_SOURCES = $(DUMMYSRC)
diff --git a/rigs/dummy/dummy.c b/rigs/dummy/dummy.c
index c9539053..d3f7f63b 100644
--- a/rigs/dummy/dummy.c
+++ b/rigs/dummy/dummy.c
@@ -2676,6 +2676,7 @@ DECLARE_INITRIG_BACKEND(dummy)
rig_register(&trxmanager_caps);
rig_register(&dummy_no_vfo_caps);
rig_register(&aclog_caps);
+ rig_register(&sdrsharp_caps);
// rig_register(&tci1x_caps);
return RIG_OK;
}
diff --git a/rigs/dummy/dummy.h b/rigs/dummy/dummy.h
index dc844a20..b800cfd5 100644
--- a/rigs/dummy/dummy.h
+++ b/rigs/dummy/dummy.h
@@ -46,6 +46,7 @@ extern const struct rig_caps flrig_caps;
extern const struct rig_caps trxmanager_caps;
extern const struct rig_caps tci1x_caps;
extern const struct rig_caps aclog_caps;
+extern const struct rig_caps sdrsharp_caps;
int netrigctl_get_vfo_mode(RIG *);
diff --git a/rigs/dummy/sdrsharp.c b/rigs/dummy/sdrsharp.c
new file mode 100644
index 00000000..0f95cdce
--- /dev/null
+++ b/rigs/dummy/sdrsharp.c
@@ -0,0 +1,573 @@
+/*
+* Hamlib rigctld backend - works with SDR#'s gpredict plugin for example
+* Copyright (c) 2023 by Michael Black W9MDB
+*
+*
+* This library is free software; you can redistribute it and/or
+* modify it under the terms of the GNU Lesser General Public
+* License as published by the Free Software Foundation; either
+* version 2.1 of the License, or (at your option) any later version.
+*
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this library; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+*
+*/
+#include <hamlib/config.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <hamlib/rig.h>
+#include <serial.h>
+#include <misc.h>
+#include <token.h>
+#include <register.h>
+#include <network.h>
+
+#include "dummy_common.h"
+
+#define DEBUG 1
+#define DEBUG_TRACE DEBUG_VERBOSE
+#define TRUE 1
+#define FALSE 0
+
+
+#define MAXCMDLEN 8192
+#define MAXXMLLEN 8192
+#define MAXARGLEN 128
+#define MAXBANDWIDTHLEN 4096
+
+#define DEFAULTPATH "127.0.0.1:4532"
+
+#define SDRSHARP_VFOS (RIG_VFO_A)
+
+#define SDRSHARP_MODES (RIG_MODE_NONE)
+
+struct sdrsharp_priv_data
+{
+ vfo_t curr_vfo;
+ char bandwidths[MAXBANDWIDTHLEN]; /* pipe delimited set */
+ int nbandwidths;
+ char info[8192];
+ ptt_t ptt;
+ split_t split;
+ rmode_t curr_modeA;
+ rmode_t curr_modeB;
+ freq_t curr_freqA;
+ freq_t curr_freqB;
+ pbwidth_t curr_widthA;
+ pbwidth_t curr_widthB;
+ int has_get_modeA; /* True if this function is available */
+ int has_get_bwA; /* True if this function is available */
+ int has_set_bwA; /* True if this function is available */
+ float powermeter_scale; /* So we can scale power meter to 0-1 */
+ value_t parms[RIG_SETTING_MAX];
+ struct ext_list *ext_parms;
+};
+
+/*
+* check_vfo
+* No assumptions
+*/
+static int check_vfo(vfo_t vfo)
+{
+ switch (vfo)
+ {
+ case RIG_VFO_A:
+ break;
+
+ case RIG_VFO_TX:
+ case RIG_VFO_B:
+ break;
+
+ case RIG_VFO_CURR:
+ break; // will default to A in which_vfo
+
+ default:
+ return (FALSE);
+ }
+
+ return (TRUE);
+}
+
+/*
+* read_transaction
+* Assumes rig!=NULL, xml!=NULL, xml_len>=MAXXMLLEN
+*/
+static int read_transaction(RIG *rig, char *xml, int xml_len)
+{
+ int retval;
+ int retry;
+ char *delims;
+ char *terminator = "\n";
+ struct rig_state *rs = &rig->state;
+
+ ENTERFUNC;
+
+ retry = 2;
+ delims = "\n";
+ xml[0] = 0;
+
+ do
+ {
+ char tmp_buf[MAXXMLLEN]; // plenty big for expected sdrsharp responses hopefully
+
+ if (retry < 2)
+ {
+ rig_debug(RIG_DEBUG_WARN, "%s: retry needed? retry=%d\n", __func__, retry);
+ }
+
+ int len = read_string(&rs->rigport, (unsigned char *) tmp_buf, sizeof(tmp_buf),
+ delims,
+ strlen(delims), 0, 1);
+
+ if (len > 0) { retry = 3; }
+
+ if (len <= 0)
+ {
+ rig_debug(RIG_DEBUG_ERR, "%s: read_string error=%d\n", __func__, len);
+ continue;
+ }
+
+ if (strlen(xml) + strlen(tmp_buf) < xml_len - 1)
+ {
+ strncat(xml, tmp_buf, xml_len - 1);
+ }
+ else
+ {
+ rig_debug(RIG_DEBUG_ERR,
+ "%s: xml buffer overflow!!\nTrying to add len=%d\nTo len=%d\n", __func__,
+ (int)strlen(tmp_buf), (int)strlen(xml));
+ RETURNFUNC(-RIG_EPROTO);
+ }
+ }
+ while (retry-- > 0 && strstr(xml, terminator) == NULL);
+
+ if (retry == 0)
+ {
+ rig_debug(RIG_DEBUG_WARN, "%s: retry timeout\n", __func__);
+ RETURNFUNC(-RIG_ETIMEOUT);
+ }
+
+ if (strstr(xml, terminator))
+ {
+// rig_debug(RIG_DEBUG_TRACE, "%s: got %s\n", __func__, terminator);
+ retval = RIG_OK;
+ }
+ else
+ {
+ rig_debug(RIG_DEBUG_VERBOSE, "%s: did not get %s\n", __func__, terminator);
+ retval = -(101 + RIG_EPROTO);
+ }
+
+ RETURNFUNC(retval);
+}
+
+/*
+* write_transaction
+* Assumes rig!=NULL, xml!=NULL, xml_len=total size of xml for response
+*/
+static int write_transaction(RIG *rig, char *xml, int xml_len)
+{
+
+ int try = rig->caps->retry;
+
+ int retval = -RIG_EPROTO;
+
+ struct rig_state *rs = &rig->state;
+
+ ENTERFUNC;
+
+ // This shouldn't ever happen...but just in case
+ // We need to avoid an empty write as rigctld replies with blank line
+ if (xml_len == 0)
+ {
+ rig_debug(RIG_DEBUG_ERR, "%s: len==0??\n", __func__);
+ RETURNFUNC(retval);
+ }
+
+ // appears we can lose sync if we don't clear things out
+ // shouldn't be anything for us now anyways
+ rig_flush(&rig->state.rigport);
+
+ while (try-- >= 0 && retval != RIG_OK)
+ {
+ retval = write_block(&rs->rigport, (unsigned char *) xml, strlen(xml));
+
+ if (retval < 0)
+ {
+ RETURNFUNC(-RIG_EIO);
+ }
+ }
+
+ RETURNFUNC(retval);
+}
+
+static int sdrsharp_transaction(RIG *rig, char *cmd, char *value,
+ int value_len)
+{
+ char xml[MAXXMLLEN];
+ int retry = 3;
+
+ ENTERFUNC;
+ ELAPSED1;
+
+ set_transaction_active(rig);
+
+ if (value)
+ {
+ value[0] = 0;
+ }
+
+ do
+ {
+ int retval;
+
+ if (retry != 3)
+ {
+ rig_debug(RIG_DEBUG_VERBOSE, "%s: cmd=%s, retry=%d\n", __func__, cmd, retry);
+ }
+
+ retval = write_transaction(rig, cmd, strlen(cmd));
+
+ if (retval != RIG_OK)
+ {
+ rig_debug(RIG_DEBUG_ERR, "%s: write_transaction error=%d\n", __func__, retval);
+
+ // if we get RIG_EIO the socket has probably disappeared
+ // so bubble up the error so port can re re-opened
+ if (retval == -RIG_EIO) { set_transaction_inactive(rig); RETURNFUNC(retval); }
+
+ hl_usleep(50 * 1000); // 50ms sleep if error
+ }
+
+ if (value)
+ {
+ read_transaction(rig, xml, sizeof(xml)); // this might time out -- that's OK
+ }
+
+ if (value) { strncpy(value, xml, value_len); }
+
+ }
+ while (((value && strlen(value) == 0))
+ && retry--); // we'll do retries if needed
+
+ if (value && strlen(value) == 0)
+ {
+ rig_debug(RIG_DEBUG_ERR, "%s: no value returned\n", __func__);
+ set_transaction_inactive(rig); RETURNFUNC(RIG_EPROTO);
+ }
+
+ ELAPSED2;
+ set_transaction_inactive(rig);
+ RETURNFUNC(RIG_OK);
+}
+
+/*
+* sdrsharp_init
+* Assumes rig!=NULL
+*/
+static int sdrsharp_init(RIG *rig)
+{
+ struct sdrsharp_priv_data *priv;
+
+ ENTERFUNC;
+ rig_debug(RIG_DEBUG_TRACE, "%s version %s\n", __func__, rig->caps->version);
+
+ rig->state.priv = (struct sdrsharp_priv_data *)calloc(1, sizeof(
+ struct sdrsharp_priv_data));
+
+ if (!rig->state.priv)
+ {
+ RETURNFUNC(-RIG_ENOMEM);
+ }
+
+ priv = rig->state.priv;
+
+ memset(priv, 0, sizeof(struct sdrsharp_priv_data));
+ memset(priv->parms, 0, RIG_SETTING_MAX * sizeof(value_t));
+
+ /*
+ * set arbitrary initial status
+ */
+ rig->state.current_vfo = RIG_VFO_A;
+ priv->split = 0;
+ priv->ptt = 0;
+ priv->curr_modeA = -1;
+ priv->curr_modeB = -1;
+ priv->curr_widthA = -1;
+ priv->curr_widthB = -1;
+
+ if (!rig->caps)
+ {
+ RETURNFUNC(-RIG_EINVAL);
+ }
+
+ strncpy(rig->state.rigport.pathname, DEFAULTPATH,
+ sizeof(rig->state.rigport.pathname));
+
+ RETURNFUNC(RIG_OK);
+}
+
+/*
+* sdrsharp_get_freq
+* Assumes rig!=NULL, rig->state.priv!=NULL, freq!=NULL
+*/
+static int sdrsharp_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
+{
+ char value[MAXARGLEN];
+ struct sdrsharp_priv_data *priv = (struct sdrsharp_priv_data *) rig->state.priv;
+
+ ENTERFUNC;
+ rig_debug(RIG_DEBUG_TRACE, "%s: vfo=%s\n", __func__,
+ rig_strvfo(vfo));
+
+
+ if (check_vfo(vfo) == FALSE)
+ {
+ rig_debug(RIG_DEBUG_ERR, "%s: unsupported VFO %s\n",
+ __func__, rig_strvfo(vfo));
+ RETURNFUNC(-RIG_EINVAL);
+ }
+
+ if (vfo == RIG_VFO_CURR)
+ {
+ vfo = rig->state.current_vfo;
+ rig_debug(RIG_DEBUG_TRACE, "%s: get_freq2 vfo=%s\n",
+ __func__, rig_strvfo(vfo));
+ }
+
+ char *cmd = "f\n";
+ int retval;
+
+ retval = sdrsharp_transaction(rig, cmd, value, sizeof(value));
+
+ if (retval != RIG_OK)
+ {
+ rig_debug(RIG_DEBUG_ERR, "%s: READBMF failed retval=%s\n", __func__,
+ rigerror(retval));
+ RETURNFUNC(retval);
+ }
+
+ *freq = 0;
+
+ sscanf(value, "%lf", freq);
+
+ if (*freq == 0)
+ {
+ rig_debug(RIG_DEBUG_ERR, "%s: freq==0??\nvalue=%s\n", __func__,
+ value);
+ RETURNFUNC(-RIG_EPROTO);
+ }
+ else
+ {
+ rig_debug(RIG_DEBUG_TRACE, "%s: freq=%.0f\n", __func__, *freq);
+ }
+
+ if (vfo == RIG_VFO_A)
+ {
+ priv->curr_freqA = *freq;
+ }
+ else // future support in SDRSHARP maybe?
+ {
+ priv->curr_freqB = *freq;
+ }
+
+ RETURNFUNC(RIG_OK);
+}
+
+/*
+* sdrsharp_open
+* Assumes rig!=NULL, rig->state.priv!=NULL
+*/
+static int sdrsharp_open(RIG *rig)
+{
+ int retval;
+ char value[MAXARGLEN];
+
+ ENTERFUNC;
+
+ freq_t freq;
+ retval = sdrsharp_get_freq(rig, RIG_VFO_CURR, &freq);
+
+ if (retval != RIG_OK)
+ {
+ rig_debug(RIG_DEBUG_ERR, "%s: sdrsharp_get_freq not working!!\n", __func__);
+ RETURNFUNC(RIG_EPROTO);
+ }
+
+ rig->state.current_vfo = RIG_VFO_A;
+ rig_debug(RIG_DEBUG_TRACE, "%s: currvfo=%s value=%s\n", __func__,
+ rig_strvfo(rig->state.current_vfo), value);
+
+ RETURNFUNC(retval);
+}
+
+/*
+* sdrsharp_close
+* Assumes rig!=NULL
+*/
+static int sdrsharp_close(RIG *rig)
+{
+ ENTERFUNC;
+
+ RETURNFUNC(RIG_OK);
+}
+
+/*
+* sdrsharp_cleanup
+* Assumes rig!=NULL, rig->state.priv!=NULL
+*/
+static int sdrsharp_cleanup(RIG *rig)
+{
+ struct sdrsharp_priv_data *priv;
+
+ rig_debug(RIG_DEBUG_TRACE, "%s\n", __func__);
+
+ if (!rig)
+ {
+ RETURNFUNC2(-RIG_EINVAL);
+ }
+
+ priv = (struct sdrsharp_priv_data *)rig->state.priv;
+
+ free(priv->ext_parms);
+ free(rig->state.priv);
+
+ rig->state.priv = NULL;
+
+ // we really don't need to free this up as it's only done once
+ // was causing problem when cleanup was followed by rig_open
+ // model_sdrsharp was not getting refilled
+ // if we can figure out that one we can re-enable this
+#if 0
+ int i;
+
+ for (i = 0; modeMap[i].mode_hamlib != 0; ++i)
+ {
+ if (modeMap[i].mode_sdrsharp)
+ {
+ ...
[truncated message content] |
|
From: n0nb <n0...@us...> - 2023-01-25 13:39:49
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Hamlib -- Ham radio control libraries".
The branch, Hamlib-4.5.5 has been updated
via 88f6eb29a8d29900f8486f550566f6628a64c12b (commit)
via 858737fa024ae1a73d09e735aa98239e67674808 (commit)
via b06f8fcb31f2a8062f2b03ebb1439adb283cb80c (commit)
via 9b3365941486109f761e8074f3ad703e32268ee2 (commit)
via f89b49800f85af23368203422afef182c4da2dc5 (commit)
via e089e9849006390d39ebd71cd90fd84f178c962c (commit)
via 383794637a8a7992ea015e5a84bf11a2079e6d0d (commit)
via 680c56c6ce1772bc97be413ea041b0ebf2650eb1 (commit)
via f5b9f6743c9601f06f04d6db4bc3b832072ff6a8 (commit)
via f0e7ec385a954113e9c027047a7f8d8f15f120c6 (commit)
via 84d86aaa73c337667d43c50afe2bfbb53f9feff9 (commit)
via 177d58b7576a3e203d6157a6c2fbfd4fa47ff885 (commit)
from dc1d9cf43ef330e8ea518e5bea99c1f83a63147c (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 88f6eb29a8d29900f8486f550566f6628a64c12b
Author: Mike Black W9MDB <mdb...@ya...>
Date: Tue Jan 24 11:28:33 2023 -0600
Update NEWS
diff --git a/NEWS b/NEWS
index 378ee292..8662ce99 100644
--- a/NEWS
+++ b/NEWS
@@ -25,6 +25,7 @@ Version 4.6
* Fix FTDX3000 rig split
Version 4.5.5
+ * Fix QRP QDX PTT to new TQ command due to firmware changes
* Remove EX103 check for FTDX5000
* Fix K3/K3S VFOB setting of mode/width
* Fix AGC level display in rigctld
commit 858737fa024ae1a73d09e735aa98239e67674808
Author: Mike Black W9MDB <mdb...@ya...>
Date: Tue Jan 24 11:22:19 2023 -0600
Change QRP QRDX PTT to use TQ instead TX...more incompability with TS-480 standard
diff --git a/rigs/kenwood/ts480.c b/rigs/kenwood/ts480.c
index 1d4fb807..59eb9d7a 100644
--- a/rigs/kenwood/ts480.c
+++ b/rigs/kenwood/ts480.c
@@ -1251,6 +1251,30 @@ int ts480_init(RIG *rig)
RETURNFUNC(RIG_OK);
}
+int qdx_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt)
+{
+ const char *ptt_cmd;
+
+ ENTERFUNC;
+ rig_debug(RIG_DEBUG_VERBOSE, "%s: ptt=%d\n", __func__, ptt);
+
+ switch (ptt)
+ {
+ case RIG_PTT_ON: ptt_cmd = "TQ1"; break;
+
+ case RIG_PTT_OFF: ptt_cmd = "TQ0"; break;
+
+ default: RETURNFUNC(-RIG_EINVAL);
+ }
+
+ int retval = kenwood_transaction(rig, ptt_cmd, NULL, 0);
+
+ //if (ptt == RIG_PTT_OFF) { hl_usleep(100 * 1000); } // a little time for PTT to turn off
+
+ RETURNFUNC(retval);
+}
+
+
/*
* TS-480 rig capabilities
* Notice that some rigs share the same functions.
@@ -1457,7 +1481,7 @@ const struct rig_caps qrplabs_caps =
RIG_MODEL(RIG_MODEL_QRPLABS),
.model_name = "QCX/QDX",
.mfg_name = "QRPLabs",
- .version = BACKEND_VER ".0",
+ .version = BACKEND_VER ".1",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
@@ -1780,7 +1804,7 @@ const struct rig_caps pt8000a_caps =
.set_split_vfo = kenwood_set_split_vfo,
.get_split_vfo = kenwood_get_split_vfo_if,
.get_ptt = kenwood_get_ptt,
- .set_ptt = kenwood_set_ptt,
+ .set_ptt = qdx_set_ptt,
.get_dcd = kenwood_get_dcd,
.set_powerstat = kenwood_set_powerstat,
.get_powerstat = kenwood_get_powerstat,
commit b06f8fcb31f2a8062f2b03ebb1439adb283cb80c
Author: Mike Black W9MDB <mdb...@ya...>
Date: Mon Jan 23 14:50:59 2023 -0600
Update NEWS
diff --git a/NEWS b/NEWS
index ff9b3656..378ee292 100644
--- a/NEWS
+++ b/NEWS
@@ -25,6 +25,7 @@ Version 4.6
* Fix FTDX3000 rig split
Version 4.5.5
+ * Remove EX103 check for FTDX5000
* Fix K3/K3S VFOB setting of mode/width
* Fix AGC level display in rigctld
* Change FTDX10 to no serial handshake
commit 9b3365941486109f761e8074f3ad703e32268ee2
Author: Mike Black W9MDB <mdb...@ya...>
Date: Mon Jan 23 14:49:06 2023 -0600
ERemove EX103 get/set for FTDX5000
diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c
index 65f8b9f4..ac04d2a8 100644
--- a/rigs/yaesu/newcat.c
+++ b/rigs/yaesu/newcat.c
@@ -641,6 +641,7 @@ int newcat_open(RIG *rig)
rig_debug(RIG_DEBUG_VERBOSE, "%s: disabling FTDX3000 band select\n", __func__);
}
+#if 0 // this apparently does not work
if (is_ftdx5000)
{
// Remember EX103 status
@@ -663,6 +664,7 @@ int newcat_open(RIG *rig)
if (priv->ret_data[6] == ';') { priv->front_rear_status = priv->ret_data[5]; }
}
+#endif
RETURNFUNC(RIG_OK);
}
@@ -695,6 +697,7 @@ int newcat_close(RIG *rig)
priv->poweron = 0;
}
+#if 0 // this apparently does not work -- we can't query EX103
if (is_ftdx5000)
{
// Restore EX103 status
@@ -703,6 +706,7 @@ int newcat_close(RIG *rig)
rig_debug(RIG_DEBUG_TRACE, "%s: cmd_str = %s\n", __func__, priv->cmd_str);
newcat_set_cmd(rig); // don't care about the return
}
+#endif
RETURNFUNC(RIG_OK);
}
diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h
index db1d64c4..60b2c9ad 100644
--- a/rigs/yaesu/newcat.h
+++ b/rigs/yaesu/newcat.h
@@ -50,7 +50,7 @@
typedef char ncboolean;
/* shared function version */
-#define NEWCAT_VER "20230115"
+#define NEWCAT_VER "20230123"
/* Hopefully large enough for future use, 128 chars plus '\0' */
#define NEWCAT_DATA_LEN 129
commit f89b49800f85af23368203422afef182c4da2dc5
Author: Mike Black W9MDB <mdb...@ya...>
Date: Mon Jan 23 09:10:58 2023 -0600
Update NEWS
diff --git a/NEWS b/NEWS
index a1b4ac1c..ff9b3656 100644
--- a/NEWS
+++ b/NEWS
@@ -25,6 +25,7 @@ Version 4.6
* Fix FTDX3000 rig split
Version 4.5.5
+ * Fix K3/K3S VFOB setting of mode/width
* Fix AGC level display in rigctld
* Change FTDX10 to no serial handshake
* Add TS2000 to has_ps exception
commit e089e9849006390d39ebd71cd90fd84f178c962c
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sun Jan 22 16:45:22 2023 -0600
Fix K3/K3S VFOB mode/bandwidth setting
https://github.com/Hamlib/Hamlib/issues/1224
diff --git a/rigs/kenwood/k3.c b/rigs/kenwood/k3.c
index a9b0a1f6..cfa530f7 100644
--- a/rigs/kenwood/k3.c
+++ b/rigs/kenwood/k3.c
@@ -190,7 +190,7 @@ const struct rig_caps k3_caps =
RIG_MODEL(RIG_MODEL_K3),
.model_name = "K3",
.mfg_name = "Elecraft",
- .version = BACKEND_VER ".25",
+ .version = BACKEND_VER ".26",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
@@ -343,7 +343,7 @@ const struct rig_caps k3s_caps =
RIG_MODEL(RIG_MODEL_K3S),
.model_name = "K3S",
.mfg_name = "Elecraft",
- .version = BACKEND_VER ".19",
+ .version = BACKEND_VER ".21",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
@@ -960,15 +960,21 @@ int k3_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
int err;
rmode_t temp_m;
pbwidth_t temp_w;
- char *cmd_mode = "DT";
+ char *cmd_data = "DT";
char *cmd_bw = "BW";
int cmd_bw_len = 6;
+ struct kenwood_priv_data *priv = rig->state.priv;
rig_debug(RIG_DEBUG_VERBOSE, "%s called vfo=%s\n", __func__, rig_strvfo(vfo));
- if (vfo == RIG_VFO_B && rig->caps->rig_model == RIG_MODEL_K4)
+ if ((priv->is_k3 || priv->is_k3s || priv->is_k4 || priv->is_k4d
+ || priv->is_k4hd) && vfo == RIG_VFO_B)
{
- cmd_mode = "DT$";
+ if (!(priv->is_k3 || priv->is_k3s))
+ {
+ cmd_data = "DT$";
+ }
+
cmd_bw = "BW$";
cmd_bw_len = 7;
@@ -993,8 +999,8 @@ int k3_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
if (temp_m == RIG_MODE_RTTY)
{
- err = kenwood_safe_transaction(rig, cmd_mode, buf, KENWOOD_MAX_BUF_LEN,
- strlen(cmd_mode) + 1);
+ err = kenwood_safe_transaction(rig, cmd_data, buf, KENWOOD_MAX_BUF_LEN,
+ strlen(cmd_data) + 1);
if (err != RIG_OK)
{
@@ -1021,8 +1027,8 @@ int k3_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
}
else if (temp_m == RIG_MODE_RTTYR)
{
- err = kenwood_safe_transaction(rig, cmd_mode, buf, KENWOOD_MAX_BUF_LEN,
- strlen(cmd_mode) + 1);
+ err = kenwood_safe_transaction(rig, cmd_data, buf, KENWOOD_MAX_BUF_LEN,
+ strlen(cmd_data) + 1);
if (err != RIG_OK)
{
diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c
index 1abad7a1..a82fc261 100644
--- a/rigs/kenwood/kenwood.c
+++ b/rigs/kenwood/kenwood.c
@@ -2640,8 +2640,8 @@ int kenwood_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
}
else
{
- if (vfo == RIG_VFO_B
- && rig->caps->rig_model == RIG_MODEL_K4) // K4 new MD$ command for VFOB
+ if ((priv->is_k3 || priv->is_k3s || priv->is_k4 || priv->is_k4d
+ || priv->is_k4hd) && vfo == RIG_VFO_B)
{
SNPRINTF(cmd, sizeof(cmd), "MD$");
offs = 3;
diff --git a/rigs/kenwood/kenwood.h b/rigs/kenwood/kenwood.h
index d0c077a0..45494637 100644
--- a/rigs/kenwood/kenwood.h
+++ b/rigs/kenwood/kenwood.h
@@ -29,7 +29,7 @@
#include "misc.h"
#include "idx_builtin.h"
-#define BACKEND_VER "20230115"
+#define BACKEND_VER "20230222"
#define EOM_KEN ';'
#define EOM_TH '\r'
commit 383794637a8a7992ea015e5a84bf11a2079e6d0d
Author: Mike Black W9MDB <mdb...@ya...>
Date: Mon Jan 23 09:09:09 2023 -0600
Fix icom.h
diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h
index 27bdebb0..efc28fa4 100644
--- a/rigs/icom/icom.h
+++ b/rigs/icom/icom.h
@@ -239,10 +239,7 @@ struct icom_priv_caps
struct icom_spectrum_scope_caps spectrum_scope_caps; /*!< Icom spectrum scope capabilities, if supported by the rig. Main/Sub scopes in Icom rigs have the same caps. */
struct icom_spectrum_edge_frequency_range spectrum_edge_frequency_ranges[ICOM_MAX_SPECTRUM_FREQ_RANGES]; /*!< Icom spectrum scope edge frequencies, if supported by the rig. Last entry should have zeros in all fields. */
struct cmdparams *extcmds; /*!< Pointer to extended operations array */
-<<<<<<< HEAD
-=======
int dualwatch_split; /*!< Rig supports dual watch for split ops -- e.g. ID-5100 */
->>>>>>> 9d096c4a (Improve powerstat on/off behavior for Icom rigs)
};
struct icom_priv_data
commit 680c56c6ce1772bc97be413ea041b0ebf2650eb1
Author: Mike Black W9MDB <mdb...@ya...>
Date: Thu Jan 19 17:15:59 2023 -0600
Allow get_powerstat when rig is powered off
https://github.com/Hamlib/Hamlib/issues/1220
diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c
index c9c87c56..91f407fd 100644
--- a/tests/rigctl_parse.c
+++ b/tests/rigctl_parse.c
@@ -1753,7 +1753,10 @@ readline_repeat:
&& cmd_entry->cmd != 0x8f // dump_state
&& cmd_entry->cmd != 0xf0 // chk_vfo
&& cmd_entry->cmd != 0x87 // set_powerstat
- && my_rig->caps->rig_model != RIG_MODEL_POWERSDR) // some rigs can do stuff when powered off
+ && cmd_entry->cmd != 0x88 // get_powerstat
+ && cmd_entry->cmd != 0xa5 // client_version
+ && my_rig->caps->rig_model !=
+ RIG_MODEL_POWERSDR) // some rigs can do stuff when powered off
{
rig_debug(RIG_DEBUG_WARN,
"%s: command %s not allowed when rig is powered off\n", __func__,
commit f5b9f6743c9601f06f04d6db4bc3b832072ff6a8
Author: Mike Black W9MDB <mdb...@ya...>
Date: Wed Jan 18 23:32:18 2023 -0600
Remove one sleep from set_powerstat loop
https://github.com/Hamlib/Hamlib/issues/1212
diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c
index 8b91dacb..de5e1871 100644
--- a/rigs/icom/icom.c
+++ b/rigs/icom/icom.c
@@ -8008,7 +8008,6 @@ int icom_set_powerstat(RIG *rig, powerstat_t status)
for (i = 0; i < 5 && retval != RIG_OK; ++i)
{
- sleep(1); // give it a while to power up
retval = icom_get_usb_echo_off(rig);
if (retval != RIG_OK) { sleep(1); }
commit f0e7ec385a954113e9c027047a7f8d8f15f120c6
Author: Mike Black W9MDB <mdb...@ya...>
Date: Wed Jan 18 23:27:27 2023 -0600
Make auto_power_on a bit more robust for RigPI which seems slow to get going
https://github.com/Hamlib/Hamlib/issues/1212
diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c
index bb90f1bb..8b91dacb 100644
--- a/rigs/icom/icom.c
+++ b/rigs/icom/icom.c
@@ -1140,7 +1140,8 @@ icom_rig_close(RIG *rig)
ENTERFUNC;
- if (priv->poweron == 0) RETURNFUNC(RIG_OK); // nothing to do
+ if (priv->poweron == 0) { RETURNFUNC(RIG_OK); } // nothing to do
+
if (priv->poweron == 1 && rs->auto_power_off)
{
// maybe we need power off?
@@ -7990,11 +7991,8 @@ int icom_set_powerstat(RIG *rig, powerstat_t status)
memset(fe_buf, 0xfe, fe_max);
// sending more than enough 0xfe's to wake up the rs232
write_block(&rs->rigport, fe_buf, fe_max);
- // close and re-open the rig
- // on linux the USB gets reset during power on
- rig_close(rig);
- sleep(1); // let serial bus idle for a while
- rig_open(rig);
+ hl_usleep(200 *
+ 1000); // need to wait a bit for RigPI and others to queue the echo
// we'll try 0x18 0x01 now -- should work on STBY rigs too
pwr_sc = S_PWR_ON;
@@ -8006,8 +8004,16 @@ int icom_set_powerstat(RIG *rig, powerstat_t status)
// poweron == 0 means never powered -- == 2 means CAT turned off
if (priv->poweron == 0 || priv->poweron == 2)
{
- sleep(1); // give it a while to power up
- icom_get_usb_echo_off(rig);
+ retval = -1;
+
+ for (i = 0; i < 5 && retval != RIG_OK; ++i)
+ {
+ sleep(1); // give it a while to power up
+ retval = icom_get_usb_echo_off(rig);
+
+ if (retval != RIG_OK) { sleep(1); }
+ }
+
return RIG_OK;
}
commit 84d86aaa73c337667d43c50afe2bfbb53f9feff9
Author: Mike Black W9MDB <mdb...@ya...>
Date: Wed Jan 18 15:00:18 2023 -0600
Improve powerstat on/off behavior for Icom rigs
https://github.com/Hamlib/Hamlib/issues/1212
diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c
index d912ad97..bb90f1bb 100644
--- a/rigs/icom/icom.c
+++ b/rigs/icom/icom.c
@@ -713,6 +713,7 @@ int icom_init(RIG *rig)
|| rig->caps->rig_model == RIG_MODEL_IC821H
|| rig->caps->rig_model == RIG_MODEL_IC910
|| rig->caps->rig_model == RIG_MODEL_IC2730
+ || rig->caps->rig_model == RIG_MODEL_ID5100
)
{
priv->x25cmdfails = 1;
@@ -991,6 +992,18 @@ icom_rig_open(RIG *rig)
rig_debug(RIG_DEBUG_VERBOSE, "%s: %s v%s\n", __func__, rig->caps->model_name,
rig->caps->version);
+
+ if (rs->auto_power_on && priv->poweron == 0)
+ {
+ rig_debug(RIG_DEBUG_VERBOSE,
+ "%s asking for power on *****************************************\n", __func__);
+ rig_set_powerstat(rig, 1);
+ rig_debug(RIG_DEBUG_VERBOSE,
+ "%s asking for power on #2 =======================================\n",
+ __func__);
+ priv->poweron = 1;
+ }
+
retry_open:
retval_echo = icom_get_usb_echo_off(rig);
@@ -1127,7 +1140,8 @@ icom_rig_close(RIG *rig)
ENTERFUNC;
- if (priv->poweron != 0 && rs->auto_power_off)
+ if (priv->poweron == 0) RETURNFUNC(RIG_OK); // nothing to do
+ if (priv->poweron == 1 && rs->auto_power_off)
{
// maybe we need power off?
rig_debug(RIG_DEBUG_VERBOSE, "%s trying power off\n", __func__);
@@ -7971,7 +7985,6 @@ int icom_set_powerstat(RIG *rig, powerstat_t status)
{
case RIG_POWER_ON:
- sleep(1); // let serial bus idle for a while
// ic7300 manual says ~150 for 115,200
// we'll just send a few more to be sure for all speeds
memset(fe_buf, 0xfe, fe_max);
@@ -7990,6 +8003,14 @@ int icom_set_powerstat(RIG *rig, powerstat_t status)
retval =
icom_transaction(rig, C_SET_PWR, pwr_sc, NULL, 0, ackbuf, &ack_len);
+ // poweron == 0 means never powered -- == 2 means CAT turned off
+ if (priv->poweron == 0 || priv->poweron == 2)
+ {
+ sleep(1); // give it a while to power up
+ icom_get_usb_echo_off(rig);
+ return RIG_OK;
+ }
+
break;
default:
@@ -7997,6 +8018,7 @@ int icom_set_powerstat(RIG *rig, powerstat_t status)
fe_buf[0] = 0;
retval =
icom_transaction(rig, C_SET_PWR, pwr_sc, NULL, 0, ackbuf, &ack_len);
+ priv->poweron = 2;
}
i = 0;
diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h
index 3f4c3c18..27bdebb0 100644
--- a/rigs/icom/icom.h
+++ b/rigs/icom/icom.h
@@ -239,6 +239,10 @@ struct icom_priv_caps
struct icom_spectrum_scope_caps spectrum_scope_caps; /*!< Icom spectrum scope capabilities, if supported by the rig. Main/Sub scopes in Icom rigs have the same caps. */
struct icom_spectrum_edge_frequency_range spectrum_edge_frequency_ranges[ICOM_MAX_SPECTRUM_FREQ_RANGES]; /*!< Icom spectrum scope edge frequencies, if supported by the rig. Last entry should have zeros in all fields. */
struct cmdparams *extcmds; /*!< Pointer to extended operations array */
+<<<<<<< HEAD
+=======
+ int dualwatch_split; /*!< Rig supports dual watch for split ops -- e.g. ID-5100 */
+>>>>>>> 9d096c4a (Improve powerstat on/off behavior for Icom rigs)
};
struct icom_priv_data
commit 177d58b7576a3e203d6157a6c2fbfd4fa47ff885
Author: Mike Black W9MDB <mdb...@ya...>
Date: Wed Jan 18 07:09:28 2023 -0600
Show AGC Level None when there are no AGC settings for rig
https://github.com/Hamlib/Hamlib/issues/1155
diff --git a/tests/dumpcaps.c b/tests/dumpcaps.c
index 0100c113..ed5f86db 100644
--- a/tests/dumpcaps.c
+++ b/tests/dumpcaps.c
@@ -318,6 +318,11 @@ int dumpcaps(RIG *rig, FILE *fout)
fprintf(fout, " %d=%s", caps->agc_levels[i],
rig_stragclevel(caps->agc_levels[i]));
}
+
+ if (i == 0)
+ {
+ fprintf(fout, " %d=%s", RIG_AGC_NONE, rig_stragclevel(RIG_AGC_NONE));
+ }
}
fprintf(fout, "\n");
-----------------------------------------------------------------------
Summary of changes:
NEWS | 3 +++
rigs/icom/icom.c | 41 ++++++++++++++++++++++++++++++++++-------
rigs/icom/icom.h | 1 +
rigs/kenwood/k3.c | 24 +++++++++++++++---------
rigs/kenwood/kenwood.c | 4 ++--
rigs/kenwood/kenwood.h | 2 +-
rigs/kenwood/ts480.c | 28 ++++++++++++++++++++++++++--
rigs/yaesu/newcat.c | 4 ++++
rigs/yaesu/newcat.h | 2 +-
tests/dumpcaps.c | 5 +++++
tests/rigctl_parse.c | 5 ++++-
11 files changed, 96 insertions(+), 23 deletions(-)
hooks/post-receive
--
Hamlib -- Ham radio control libraries
|
|
From: n0nb <n0...@us...> - 2023-01-25 02:39:39
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Hamlib -- Ham radio control libraries".
The branch, master has been updated
via 8d1eacc9cb1aa6c18f44533c292022280f02b897 (commit)
via 267184ad44eb703eaea274e612408739aae5faa5 (commit)
via a47eba7ce4102f332842e79cfeb64b08c69335d4 (commit)
via 76a3ab19eb78ef2df4ae4e65dff2e33274ac6a70 (commit)
via 3fd698d063906b1fbda4db75d38692202dbd322c (commit)
via b977858da94b3e1e88706f2be9d6ebc5ce8fc4b6 (commit)
via d68c218a3d249d14313086cb9c1c2312cdbba0d0 (commit)
via 79129087e0ed550dc19b7c435dc46ad948c61751 (commit)
via af941307495d3616ff78cc1fb37b96b87109a765 (commit)
via 907560270eca870606ed6002efaa69577f50c7ab (commit)
via 52bed765eff14c752aafd4814f5cf3b7e6ac3d41 (commit)
via 9626894029686803544cae7860f34b362dd7a19b (commit)
via 9b89a99f9985b90acfcb462647e0b9348cc9930f (commit)
via d16b52e414c7e2862dab145dee30eda3487ba04f (commit)
via 407b0fcc5414989d6032d845d139fb7b701ddfdc (commit)
via 344779eaf199fdfeea750db88820aab537835270 (commit)
via 18a2d91f59e0a04042bcaf68e47417f5d9695dbe (commit)
via 0c2426c800b754de0aa14a89421354e39473546f (commit)
via cdbd517228cf11d5a9e90d82fa534abc53d95eb4 (commit)
via cfde2c8a92105da471056fa70194ee10658c201f (commit)
via eb1d46723616ec3d94b453f0c1fed94bc977cfe5 (commit)
via 50a14bb08fdcccc59fc1f7cf803cd6866ee369f3 (commit)
via 13d27a3567c7c632eabded6e1c23f0a96c5053bc (commit)
via c78371353c704eb3c16da02b511e6f647ade4190 (commit)
via 268f44eb7d64a1ee0ca3489b8edd0188ce1fc69e (commit)
via 3daed948a8cfa9f02bb1e8035f6e3355eb31a22e (commit)
via 9d096c4ac95fae1c8fd235648874bc27d979d2bc (commit)
via ac220815c4ec81f20dc22ca051dc19e3c98cfa9d (commit)
via 57b063a44ce257e139633cd82f0e8245f15e4721 (commit)
via 9861d1f87ba92667f52558b76349b331620fd13f (commit)
via 6f6379e547772755368c35fc117b0ce57bd911ab (commit)
via b38739bcabf2a24bbde4315a70d6cbe551879b6c (commit)
from f392cc4c1804f06fe16f7e326c879e2ba0f20e1d (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 8d1eacc9cb1aa6c18f44533c292022280f02b897
Author: Mike Black W9MDB <mdb...@ya...>
Date: Tue Jan 24 11:28:33 2023 -0600
Update NEWS
diff --git a/NEWS b/NEWS
index 7f618af6..8662ce99 100644
--- a/NEWS
+++ b/NEWS
@@ -25,7 +25,7 @@ Version 4.6
* Fix FTDX3000 rig split
Version 4.5.5
- * Fix QRP QDX PTT to new TQ command
+ * Fix QRP QDX PTT to new TQ command due to firmware changes
* Remove EX103 check for FTDX5000
* Fix K3/K3S VFOB setting of mode/width
* Fix AGC level display in rigctld
commit 267184ad44eb703eaea274e612408739aae5faa5
Author: Mike Black W9MDB <mdb...@ya...>
Date: Tue Jan 24 11:26:22 2023 -0600
Change QRP QDX PTT command to TQ instead of TX -- more incompability with TS-480 commands
diff --git a/NEWS b/NEWS
index 378ee292..7f618af6 100644
--- a/NEWS
+++ b/NEWS
@@ -25,6 +25,7 @@ Version 4.6
* Fix FTDX3000 rig split
Version 4.5.5
+ * Fix QRP QDX PTT to new TQ command
* Remove EX103 check for FTDX5000
* Fix K3/K3S VFOB setting of mode/width
* Fix AGC level display in rigctld
commit a47eba7ce4102f332842e79cfeb64b08c69335d4
Author: Mike Black W9MDB <mdb...@ya...>
Date: Tue Jan 24 11:25:49 2023 -0600
Revert "Update NEWS"
This reverts commit 76a3ab19eb78ef2df4ae4e65dff2e33274ac6a70.
diff --git a/NEWS b/NEWS
index 7f618af6..378ee292 100644
--- a/NEWS
+++ b/NEWS
@@ -25,7 +25,6 @@ Version 4.6
* Fix FTDX3000 rig split
Version 4.5.5
- * Fix QRP QDX PTT to new TQ command
* Remove EX103 check for FTDX5000
* Fix K3/K3S VFOB setting of mode/width
* Fix AGC level display in rigctld
diff --git a/rigs/dummy/netrigctl.c b/rigs/dummy/netrigctl.c
index c4e90efb..b69e04b6 100644
--- a/rigs/dummy/netrigctl.c
+++ b/rigs/dummy/netrigctl.c
@@ -2065,9 +2065,6 @@ static int netrigctl_get_powerstat(RIG *rig, powerstat_t *status)
// also a problem with Flex 6xxx and Log4OM not working due to lack of PS command
rig_debug(RIG_DEBUG_VERBOSE,
"%s: PS command failed (ret=%d) so returning RIG_POWER_ON\n", __func__, ret);
- if (ret == -RIG_EPOWER)
- *status = RIG_POWER_OFF;
- else
*status = RIG_POWER_ON;
}
diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c
index b491a1c9..10ea9b1f 100644
--- a/rigs/yaesu/newcat.c
+++ b/rigs/yaesu/newcat.c
@@ -3622,7 +3622,7 @@ int newcat_get_powerstat(RIG *rig, powerstat_t *status)
// when not powered on need a dummy byte to wake it up
// then sleep from 1 to 2 seconds so we'll do 1.5 secs
- write_block(&state->rigport, (unsigned char *) ";;;", 3);
+ write_block(&state->rigport, (unsigned char *) "PS;", 3);
hl_usleep(1200000);
SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "%s%c", command, cat_term);
diff --git a/simulators/simft991.c b/simulators/simft991.c
index 49f61d17..965deb4f 100644
--- a/simulators/simft991.c
+++ b/simulators/simft991.c
@@ -104,11 +104,11 @@ int main(int argc, char *argv[])
while (1)
{
- start:
if (getmyline(fd, buf))
{
printf("Cmd:%s\n", buf);
}
+ else { continue; }
if (strcmp(buf, "RM5;") == 0)
{
@@ -172,10 +172,8 @@ int main(int argc, char *argv[])
}
else if (strcmp(buf, "PS;") == 0)
{
-#if 0
- SNPRINTF(buf, sizeof(buf), "PS0;");
+ SNPRINTF(buf, sizeof(buf), "PS1;");
n = write(fd, buf, strlen(buf));
-#endif
}
else if (strcmp(buf, "AI;") == 0)
{
diff --git a/src/rig.c b/src/rig.c
index 68104894..65927287 100644
--- a/src/rig.c
+++ b/src/rig.c
@@ -6079,7 +6079,6 @@ int HAMLIB_API rig_get_powerstat(RIG *rig, powerstat_t *status)
if (rig->caps->get_powerstat == NULL)
{
- rig_debug(RIG_DEBUG_VERBOSE, "%s: Rig does not have get_powerstat to assume RIG_POWER_ON\n", __func__);
*status = RIG_POWER_ON; // default to power if not available
RETURNFUNC(RIG_OK);
}
@@ -6087,7 +6086,6 @@ int HAMLIB_API rig_get_powerstat(RIG *rig, powerstat_t *status)
*status = RIG_POWER_OFF; // default now to power off until proven otherwise in get_powerstat
HAMLIB_TRACE;
retcode = rig->caps->get_powerstat(rig, status);
- if (retcode == -RIG_ETIMEOUT) status = RIG_POWER_OFF;
RETURNFUNC(retcode);
}
diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c
index 9cefcb0a..02c80195 100644
--- a/tests/rigctl_parse.c
+++ b/tests/rigctl_parse.c
@@ -4741,7 +4741,7 @@ declare_proto_rig(get_powerstat)
if (status != RIG_OK)
{
- stat = status;
+ RETURNFUNC(status);
}
if ((interactive && prompt) || (interactive && !prompt && ext_resp))
commit 76a3ab19eb78ef2df4ae4e65dff2e33274ac6a70
Author: Mike Black W9MDB <mdb...@ya...>
Date: Tue Jan 24 11:23:47 2023 -0600
Update NEWS
diff --git a/NEWS b/NEWS
index 378ee292..7f618af6 100644
--- a/NEWS
+++ b/NEWS
@@ -25,6 +25,7 @@ Version 4.6
* Fix FTDX3000 rig split
Version 4.5.5
+ * Fix QRP QDX PTT to new TQ command
* Remove EX103 check for FTDX5000
* Fix K3/K3S VFOB setting of mode/width
* Fix AGC level display in rigctld
diff --git a/rigs/dummy/netrigctl.c b/rigs/dummy/netrigctl.c
index b69e04b6..c4e90efb 100644
--- a/rigs/dummy/netrigctl.c
+++ b/rigs/dummy/netrigctl.c
@@ -2065,6 +2065,9 @@ static int netrigctl_get_powerstat(RIG *rig, powerstat_t *status)
// also a problem with Flex 6xxx and Log4OM not working due to lack of PS command
rig_debug(RIG_DEBUG_VERBOSE,
"%s: PS command failed (ret=%d) so returning RIG_POWER_ON\n", __func__, ret);
+ if (ret == -RIG_EPOWER)
+ *status = RIG_POWER_OFF;
+ else
*status = RIG_POWER_ON;
}
diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c
index 10ea9b1f..b491a1c9 100644
--- a/rigs/yaesu/newcat.c
+++ b/rigs/yaesu/newcat.c
@@ -3622,7 +3622,7 @@ int newcat_get_powerstat(RIG *rig, powerstat_t *status)
// when not powered on need a dummy byte to wake it up
// then sleep from 1 to 2 seconds so we'll do 1.5 secs
- write_block(&state->rigport, (unsigned char *) "PS;", 3);
+ write_block(&state->rigport, (unsigned char *) ";;;", 3);
hl_usleep(1200000);
SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "%s%c", command, cat_term);
diff --git a/simulators/simft991.c b/simulators/simft991.c
index 965deb4f..49f61d17 100644
--- a/simulators/simft991.c
+++ b/simulators/simft991.c
@@ -104,11 +104,11 @@ int main(int argc, char *argv[])
while (1)
{
+ start:
if (getmyline(fd, buf))
{
printf("Cmd:%s\n", buf);
}
- else { continue; }
if (strcmp(buf, "RM5;") == 0)
{
@@ -172,8 +172,10 @@ int main(int argc, char *argv[])
}
else if (strcmp(buf, "PS;") == 0)
{
- SNPRINTF(buf, sizeof(buf), "PS1;");
+#if 0
+ SNPRINTF(buf, sizeof(buf), "PS0;");
n = write(fd, buf, strlen(buf));
+#endif
}
else if (strcmp(buf, "AI;") == 0)
{
diff --git a/src/rig.c b/src/rig.c
index 65927287..68104894 100644
--- a/src/rig.c
+++ b/src/rig.c
@@ -6079,6 +6079,7 @@ int HAMLIB_API rig_get_powerstat(RIG *rig, powerstat_t *status)
if (rig->caps->get_powerstat == NULL)
{
+ rig_debug(RIG_DEBUG_VERBOSE, "%s: Rig does not have get_powerstat to assume RIG_POWER_ON\n", __func__);
*status = RIG_POWER_ON; // default to power if not available
RETURNFUNC(RIG_OK);
}
@@ -6086,6 +6087,7 @@ int HAMLIB_API rig_get_powerstat(RIG *rig, powerstat_t *status)
*status = RIG_POWER_OFF; // default now to power off until proven otherwise in get_powerstat
HAMLIB_TRACE;
retcode = rig->caps->get_powerstat(rig, status);
+ if (retcode == -RIG_ETIMEOUT) status = RIG_POWER_OFF;
RETURNFUNC(retcode);
}
diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c
index 02c80195..9cefcb0a 100644
--- a/tests/rigctl_parse.c
+++ b/tests/rigctl_parse.c
@@ -4741,7 +4741,7 @@ declare_proto_rig(get_powerstat)
if (status != RIG_OK)
{
- RETURNFUNC(status);
+ stat = status;
}
if ((interactive && prompt) || (interactive && !prompt && ext_resp))
commit 3fd698d063906b1fbda4db75d38692202dbd322c
Author: Mike Black W9MDB <mdb...@ya...>
Date: Tue Jan 24 11:22:19 2023 -0600
Change QRP QRDX PTT to use TQ instead TX...more incompability with TS-480 standard
diff --git a/rigs/kenwood/ts480.c b/rigs/kenwood/ts480.c
index 1d4fb807..59eb9d7a 100644
--- a/rigs/kenwood/ts480.c
+++ b/rigs/kenwood/ts480.c
@@ -1251,6 +1251,30 @@ int ts480_init(RIG *rig)
RETURNFUNC(RIG_OK);
}
+int qdx_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt)
+{
+ const char *ptt_cmd;
+
+ ENTERFUNC;
+ rig_debug(RIG_DEBUG_VERBOSE, "%s: ptt=%d\n", __func__, ptt);
+
+ switch (ptt)
+ {
+ case RIG_PTT_ON: ptt_cmd = "TQ1"; break;
+
+ case RIG_PTT_OFF: ptt_cmd = "TQ0"; break;
+
+ default: RETURNFUNC(-RIG_EINVAL);
+ }
+
+ int retval = kenwood_transaction(rig, ptt_cmd, NULL, 0);
+
+ //if (ptt == RIG_PTT_OFF) { hl_usleep(100 * 1000); } // a little time for PTT to turn off
+
+ RETURNFUNC(retval);
+}
+
+
/*
* TS-480 rig capabilities
* Notice that some rigs share the same functions.
@@ -1457,7 +1481,7 @@ const struct rig_caps qrplabs_caps =
RIG_MODEL(RIG_MODEL_QRPLABS),
.model_name = "QCX/QDX",
.mfg_name = "QRPLabs",
- .version = BACKEND_VER ".0",
+ .version = BACKEND_VER ".1",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
@@ -1780,7 +1804,7 @@ const struct rig_caps pt8000a_caps =
.set_split_vfo = kenwood_set_split_vfo,
.get_split_vfo = kenwood_get_split_vfo_if,
.get_ptt = kenwood_get_ptt,
- .set_ptt = kenwood_set_ptt,
+ .set_ptt = qdx_set_ptt,
.get_dcd = kenwood_get_dcd,
.set_powerstat = kenwood_set_powerstat,
.get_powerstat = kenwood_get_powerstat,
commit b977858da94b3e1e88706f2be9d6ebc5ce8fc4b6
Author: Mike Black W9MDB <mdb...@ya...>
Date: Mon Jan 23 14:50:59 2023 -0600
Update NEWS
diff --git a/NEWS b/NEWS
index ff9b3656..378ee292 100644
--- a/NEWS
+++ b/NEWS
@@ -25,6 +25,7 @@ Version 4.6
* Fix FTDX3000 rig split
Version 4.5.5
+ * Remove EX103 check for FTDX5000
* Fix K3/K3S VFOB setting of mode/width
* Fix AGC level display in rigctld
* Change FTDX10 to no serial handshake
commit d68c218a3d249d14313086cb9c1c2312cdbba0d0
Author: Mike Black W9MDB <mdb...@ya...>
Date: Mon Jan 23 14:49:06 2023 -0600
ERemove EX103 get/set for FTDX5000
diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c
index 39d94072..10ea9b1f 100644
--- a/rigs/yaesu/newcat.c
+++ b/rigs/yaesu/newcat.c
@@ -641,6 +641,7 @@ int newcat_open(RIG *rig)
rig_debug(RIG_DEBUG_VERBOSE, "%s: disabling FTDX3000 band select\n", __func__);
}
+#if 0 // this apparently does not work
if (is_ftdx5000)
{
// Remember EX103 status
@@ -663,6 +664,7 @@ int newcat_open(RIG *rig)
if (priv->ret_data[6] == ';') { priv->front_rear_status = priv->ret_data[5]; }
}
+#endif
RETURNFUNC(RIG_OK);
}
@@ -695,6 +697,7 @@ int newcat_close(RIG *rig)
priv->poweron = 0;
}
+#if 0 // this apparently does not work -- we can't query EX103
if (is_ftdx5000)
{
// Restore EX103 status
@@ -703,6 +706,7 @@ int newcat_close(RIG *rig)
rig_debug(RIG_DEBUG_TRACE, "%s: cmd_str = %s\n", __func__, priv->cmd_str);
newcat_set_cmd(rig); // don't care about the return
}
+#endif
RETURNFUNC(RIG_OK);
}
diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h
index db1d64c4..60b2c9ad 100644
--- a/rigs/yaesu/newcat.h
+++ b/rigs/yaesu/newcat.h
@@ -50,7 +50,7 @@
typedef char ncboolean;
/* shared function version */
-#define NEWCAT_VER "20230115"
+#define NEWCAT_VER "20230123"
/* Hopefully large enough for future use, 128 chars plus '\0' */
#define NEWCAT_DATA_LEN 129
commit 79129087e0ed550dc19b7c435dc46ad948c61751
Merge: af941307 90756027
Author: Mike Black W9MDB <mdb...@ya...>
Date: Mon Jan 23 09:12:48 2023 -0600
Merge branch 'master' of https://github.com/Hamlib/Hamlib
commit af941307495d3616ff78cc1fb37b96b87109a765
Author: Mike Black W9MDB <mdb...@ya...>
Date: Mon Jan 23 09:10:58 2023 -0600
Update NEWS
diff --git a/NEWS b/NEWS
index a1b4ac1c..ff9b3656 100644
--- a/NEWS
+++ b/NEWS
@@ -25,6 +25,7 @@ Version 4.6
* Fix FTDX3000 rig split
Version 4.5.5
+ * Fix K3/K3S VFOB setting of mode/width
* Fix AGC level display in rigctld
* Change FTDX10 to no serial handshake
* Add TS2000 to has_ps exception
commit 907560270eca870606ed6002efaa69577f50c7ab
Author: Michael Black <mdb...@ya...>
Date: Mon Jan 23 08:34:58 2023 -0600
Update test.json
Add WidthUpper/Lower to json draft
diff --git a/bindings/csharp/multicast/test.json b/bindings/csharp/multicast/test.json
index d417acce..488fbaa5 100644
--- a/bindings/csharp/multicast/test.json
+++ b/bindings/csharp/multicast/test.json
@@ -7,6 +7,8 @@
"Freq": 14074000,
"Mode": "USB",
"Width": 5000,
+ "WidthLower": 200,
+ "WidthUpper": 3000,
"RX": true,
"TX": false
},
@@ -15,8 +17,10 @@
"Freq": 14076000,
"Mode": "USB",
"Width": 5000,
+ "WidthLower": 200,
+ "WidthUpper": 3000,
"RX": false,
- "TX": false
+ "TX": true
}],
"__comment_spectrum__": "Rigs that have spectrum output may include this data",
commit 52bed765eff14c752aafd4814f5cf3b7e6ac3d41
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sun Jan 22 23:41:21 2023 -0600
Clean up rig power on/off sequencing for Kenwood/Elecraft rigs
Note that the K3/K3S cannot power on via CAT control
https://github.com/Hamlib/Hamlib/issues/1225
diff --git a/rigs/kenwood/elecraft.c b/rigs/kenwood/elecraft.c
index 077a4aa4..4d93369c 100644
--- a/rigs/kenwood/elecraft.c
+++ b/rigs/kenwood/elecraft.c
@@ -97,11 +97,19 @@ int elecraft_open(RIG *rig)
char buf[KENWOOD_MAX_BUF_LEN];
struct kenwood_priv_data *priv = rig->state.priv;
char *model = "Unknown";
+ struct rig_state *rs = &rig->state;
rig_debug(RIG_DEBUG_VERBOSE, "%s called, rig version=%s\n", __func__,
rig->caps->version);
+ if (rs->auto_power_on && priv->poweron == 0)
+ {
+ rig_set_powerstat(rig, 1);
+ priv->poweron = 1;
+ }
+
+
/* Actual read extension levels from radio.
*
* The value stored in the k?_ext_lvl variables map to
diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c
index a82fc261..e3da638d 100644
--- a/rigs/kenwood/kenwood.c
+++ b/rigs/kenwood/kenwood.c
@@ -342,6 +342,8 @@ transaction_write:
skip |= strncmp(cmdstr, "RU", 2) == 0;
skip |= strncmp(cmdstr, "RD", 2) == 0;
skip |= strncmp(cmdstr, "KYW", 3) == 0;
+ skip |= strncmp(cmdstr, "PS1", 3) == 0;
+ skip |= strncmp(cmdstr, "PS0", 3) == 0;
if (skip)
{
@@ -825,6 +827,14 @@ int kenwood_open(RIG *rig)
id[0] = 0;
rig->state.rigport.retry = 0;
+
+ if (rig->state.auto_power_on)
+ {
+ // Ensure rig is on
+ rig_set_powerstat(rig, 1);
+ sleep(1);
+ }
+
err = kenwood_get_id(rig, id);
if (err != RIG_OK)
@@ -857,14 +867,6 @@ int kenwood_open(RIG *rig)
err = RIG_OK; // reset our err back to OK for later checks
}
- if (err == -RIG_ETIMEOUT && rig->state.auto_power_on)
- {
- // Ensure rig is on
- rig_set_powerstat(rig, 1);
- /* Try get id again */
- err = kenwood_get_id(rig, id);
- }
-
if (RIG_OK != err)
{
rig_debug(RIG_DEBUG_ERR,
@@ -1069,6 +1071,8 @@ int kenwood_close(RIG *rig)
ENTERFUNC;
+ if (priv->poweron == 0) { RETURNFUNC(RIG_OK); } // nothing to do
+
if (!no_restore_ai && priv->trn_state >= 0)
{
/* restore AI state */
@@ -4825,9 +4829,16 @@ int kenwood_get_trn(RIG *rig, int *trn)
*/
int kenwood_set_powerstat(RIG *rig, powerstat_t status)
{
- int retval = kenwood_transaction(rig,
- (status == RIG_POWER_ON) ? ";;;;PS1;" : "PS0",
- NULL, 0);
+ int retval;
+ struct kenwood_priv_data *priv = rig->state.priv;
+
+ if ((priv->is_k3 || priv->is_k3s) && status == RIG_POWER_ON)
+ {
+ rig_debug(RIG_DEBUG_ERR,
+ "%s: K3/K3S must use aux I/O jack pulled low to power on\n", __func__);
+ return -RIG_EPOWER;
+ }
+
int i = 0;
int retry_save = rig->state.rigport.retry;
@@ -4835,6 +4846,10 @@ int kenwood_set_powerstat(RIG *rig, powerstat_t status)
rig->state.rigport.retry = 0;
+ retval = kenwood_transaction(rig,
+ (status == RIG_POWER_ON) ? ";;;;PS1;" : "PS0",
+ NULL, 0);
+
if (status == RIG_POWER_ON) // wait for wakeup only
{
for (i = 0; i < 8; ++i) // up to ~10 seconds including the timeouts
diff --git a/src/rig.c b/src/rig.c
index 2aa101ab..65927287 100644
--- a/src/rig.c
+++ b/src/rig.c
@@ -1267,6 +1267,19 @@ int HAMLIB_API rig_open(RIG *rig)
if (caps->rig_open != NULL)
{
+ if (caps->get_powerstat != NULL)
+ {
+ powerstat_t powerflag;
+ status = rig_get_powerstat(rig, &powerflag);
+ if (status == RIG_OK && powerflag == RIG_POWER_OFF) return (-RIG_EPOWER);
+ // don't need auto_power_on if power is already on
+ if (status == RIG_OK && powerflag == RIG_POWER_ON) rig->state.auto_power_on = 0;
+ if (status == -RIG_ETIMEOUT) {
+ rig_debug(RIG_DEBUG_ERR, "%s: Some rigs cannot get_powerstat while off\n", __func__);
+ rig_debug(RIG_DEBUG_ERR, "%s: Known rigs: K3, K3S\n", __func__);
+ return (-RIG_EPOWER);
+ }
+ }
status = caps->rig_open(rig);
if (status != RIG_OK)
diff --git a/tests/rigctl.c b/tests/rigctl.c
index f29defe9..081f25d7 100644
--- a/tests/rigctl.c
+++ b/tests/rigctl.c
@@ -565,8 +565,8 @@ int main(int argc, char *argv[])
if (retcode != RIG_OK)
{
- fprintf(stderr, "rig_open: error = %s %s \n", rig_file,
- strerror(errno));
+// fprintf(stderr, "rig_open: error = %s %s \n", rig_file,
+// rigerror(retcode));
if (!ignore_rig_open_error) { exit(2); }
}
commit 9626894029686803544cae7860f34b362dd7a19b
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sun Jan 22 16:45:22 2023 -0600
Fix K3/K3S VFOB mode/bandwidth setting
https://github.com/Hamlib/Hamlib/issues/1224
diff --git a/rigs/kenwood/k3.c b/rigs/kenwood/k3.c
index 336b30bc..0956e575 100644
--- a/rigs/kenwood/k3.c
+++ b/rigs/kenwood/k3.c
@@ -190,7 +190,7 @@ const struct rig_caps k3_caps =
RIG_MODEL(RIG_MODEL_K3),
.model_name = "K3",
.mfg_name = "Elecraft",
- .version = BACKEND_VER ".25",
+ .version = BACKEND_VER ".26",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
@@ -343,7 +343,7 @@ const struct rig_caps k3s_caps =
RIG_MODEL(RIG_MODEL_K3S),
.model_name = "K3S",
.mfg_name = "Elecraft",
- .version = BACKEND_VER ".20",
+ .version = BACKEND_VER ".21",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
@@ -960,15 +960,21 @@ int k3_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
int err;
rmode_t temp_m;
pbwidth_t temp_w;
- char *cmd_mode = "DT";
+ char *cmd_data = "DT";
char *cmd_bw = "BW";
int cmd_bw_len = 6;
+ struct kenwood_priv_data *priv = rig->state.priv;
rig_debug(RIG_DEBUG_VERBOSE, "%s called vfo=%s\n", __func__, rig_strvfo(vfo));
- if (vfo == RIG_VFO_B && rig->caps->rig_model == RIG_MODEL_K4)
+ if ((priv->is_k3 || priv->is_k3s || priv->is_k4 || priv->is_k4d
+ || priv->is_k4hd) && vfo == RIG_VFO_B)
{
- cmd_mode = "DT$";
+ if (!(priv->is_k3 || priv->is_k3s))
+ {
+ cmd_data = "DT$";
+ }
+
cmd_bw = "BW$";
cmd_bw_len = 7;
@@ -993,8 +999,8 @@ int k3_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
if (temp_m == RIG_MODE_RTTY)
{
- err = kenwood_safe_transaction(rig, cmd_mode, buf, KENWOOD_MAX_BUF_LEN,
- strlen(cmd_mode) + 1);
+ err = kenwood_safe_transaction(rig, cmd_data, buf, KENWOOD_MAX_BUF_LEN,
+ strlen(cmd_data) + 1);
if (err != RIG_OK)
{
@@ -1021,8 +1027,8 @@ int k3_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
}
else if (temp_m == RIG_MODE_RTTYR)
{
- err = kenwood_safe_transaction(rig, cmd_mode, buf, KENWOOD_MAX_BUF_LEN,
- strlen(cmd_mode) + 1);
+ err = kenwood_safe_transaction(rig, cmd_data, buf, KENWOOD_MAX_BUF_LEN,
+ strlen(cmd_data) + 1);
if (err != RIG_OK)
{
diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c
index 1abad7a1..a82fc261 100644
--- a/rigs/kenwood/kenwood.c
+++ b/rigs/kenwood/kenwood.c
@@ -2640,8 +2640,8 @@ int kenwood_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
}
else
{
- if (vfo == RIG_VFO_B
- && rig->caps->rig_model == RIG_MODEL_K4) // K4 new MD$ command for VFOB
+ if ((priv->is_k3 || priv->is_k3s || priv->is_k4 || priv->is_k4d
+ || priv->is_k4hd) && vfo == RIG_VFO_B)
{
SNPRINTF(cmd, sizeof(cmd), "MD$");
offs = 3;
diff --git a/rigs/kenwood/kenwood.h b/rigs/kenwood/kenwood.h
index d0c077a0..45494637 100644
--- a/rigs/kenwood/kenwood.h
+++ b/rigs/kenwood/kenwood.h
@@ -29,7 +29,7 @@
#include "misc.h"
#include "idx_builtin.h"
-#define BACKEND_VER "20230115"
+#define BACKEND_VER "20230222"
#define EOM_KEN ';'
#define EOM_TH '\r'
commit 9b89a99f9985b90acfcb462647e0b9348cc9930f
Merge: d16b52e4 407b0fcc
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sun Jan 22 10:49:45 2023 -0600
Merge branch 'master' of https://github.com/Hamlib/Hamlib
commit d16b52e414c7e2862dab145dee30eda3487ba04f
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sun Jan 22 10:43:58 2023 -0600
Fix IC7300 5 second sleep during poweron
Reverse ID-5100 logic for dual watch mode
https://github.com/Hamlib/Hamlib/issues/1220
diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c
index 3a700127..76929d4c 100644
--- a/rigs/icom/icom.c
+++ b/rigs/icom/icom.c
@@ -6620,7 +6620,7 @@ int icom_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo)
if (priv_caps->dualwatch_split)
{
- int wvfo = tx_vfo & (RIG_VFO_A | RIG_VFO_MAIN) ? S_MAIN : S_SUB;
+ int wvfo = tx_vfo & (RIG_VFO_A | RIG_VFO_MAIN) ? S_SUB : S_MAIN;
if (RIG_OK != (retval = icom_set_func(rig, RIG_VFO_CURR, RIG_FUNC_DUAL_WATCH,
split_sc)))
@@ -8020,6 +8020,11 @@ int icom_set_powerstat(RIG *rig, powerstat_t status)
priv->serial_USB_echo_off = 1;
retval =
icom_transaction(rig, C_SET_PWR, pwr_sc, NULL, 0, ackbuf, &ack_len);
+ if (rig->caps->rig_model == RIG_MODEL_IC7300)
+ {
+ rig_debug(RIG_DEBUG_VERBOSE, "%s: waiting 5 seconds for rig to wake up\n", __func__);
+ sleep(5); // IC7300 is slow to start up -- may need to add more rigs
+ }
// poweron == 0 means never powered -- == 2 means CAT turned off
if (priv->poweron == 0 || priv->poweron == 2)
@@ -8051,11 +8056,6 @@ int icom_set_powerstat(RIG *rig, powerstat_t status)
if (status == RIG_POWER_ON) // wait for wakeup only
{
- if (rig->caps->rig_model == RIG_MODEL_IC7300)
- {
- rig_debug(RIG_DEBUG_VERBOSE, "%s: waiting 5 seconds for rig to wake up\n", __func__);
- sleep(5); // IC7300 is slow to start up -- may need to add more rigs
- }
for (i = 0; i < retry; ++i) // up to 10 attempts
{
freq_t freq;
diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h
index a72ba5ed..6157453c 100644
--- a/rigs/icom/icom.h
+++ b/rigs/icom/icom.h
@@ -31,7 +31,7 @@
#include <sys/time.h>
#endif
-#define BACKEND_VER "20230121"
+#define BACKEND_VER "20230122"
#define ICOM_IS_ID31 rig_is_model(rig, RIG_MODEL_ID31)
#define ICOM_IS_ID51 rig_is_model(rig, RIG_MODEL_ID51)
commit 407b0fcc5414989d6032d845d139fb7b701ddfdc
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sun Jan 22 10:43:58 2023 -0600
Fix IC7300 5 second sleep during poweron
https://github.com/Hamlib/Hamlib/issues/1220
diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c
index 3a700127..76929d4c 100644
--- a/rigs/icom/icom.c
+++ b/rigs/icom/icom.c
@@ -6620,7 +6620,7 @@ int icom_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo)
if (priv_caps->dualwatch_split)
{
- int wvfo = tx_vfo & (RIG_VFO_A | RIG_VFO_MAIN) ? S_MAIN : S_SUB;
+ int wvfo = tx_vfo & (RIG_VFO_A | RIG_VFO_MAIN) ? S_SUB : S_MAIN;
if (RIG_OK != (retval = icom_set_func(rig, RIG_VFO_CURR, RIG_FUNC_DUAL_WATCH,
split_sc)))
@@ -8020,6 +8020,11 @@ int icom_set_powerstat(RIG *rig, powerstat_t status)
priv->serial_USB_echo_off = 1;
retval =
icom_transaction(rig, C_SET_PWR, pwr_sc, NULL, 0, ackbuf, &ack_len);
+ if (rig->caps->rig_model == RIG_MODEL_IC7300)
+ {
+ rig_debug(RIG_DEBUG_VERBOSE, "%s: waiting 5 seconds for rig to wake up\n", __func__);
+ sleep(5); // IC7300 is slow to start up -- may need to add more rigs
+ }
// poweron == 0 means never powered -- == 2 means CAT turned off
if (priv->poweron == 0 || priv->poweron == 2)
@@ -8051,11 +8056,6 @@ int icom_set_powerstat(RIG *rig, powerstat_t status)
if (status == RIG_POWER_ON) // wait for wakeup only
{
- if (rig->caps->rig_model == RIG_MODEL_IC7300)
- {
- rig_debug(RIG_DEBUG_VERBOSE, "%s: waiting 5 seconds for rig to wake up\n", __func__);
- sleep(5); // IC7300 is slow to start up -- may need to add more rigs
- }
for (i = 0; i < retry; ++i) // up to 10 attempts
{
freq_t freq;
diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h
index a72ba5ed..6157453c 100644
--- a/rigs/icom/icom.h
+++ b/rigs/icom/icom.h
@@ -31,7 +31,7 @@
#include <sys/time.h>
#endif
-#define BACKEND_VER "20230121"
+#define BACKEND_VER "20230122"
#define ICOM_IS_ID31 rig_is_model(rig, RIG_MODEL_ID31)
#define ICOM_IS_ID51 rig_is_model(rig, RIG_MODEL_ID51)
commit 344779eaf199fdfeea750db88820aab537835270
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sun Jan 22 10:02:46 2023 -0600
Add draft HamlibGUI controller using dotnet and GTK.
Should compile on Windows, Linux, and MacOS with appropriate dotnet package installed
See README.TXT in directory
https://github.com/Hamlib/Hamlib/issues/1223
diff --git a/bindings/csharp/hamlibgui/MainWindow.cs b/bindings/csharp/hamlibgui/MainWindow.cs
new file mode 100644
index 00000000..82701193
--- /dev/null
+++ b/bindings/csharp/hamlibgui/MainWindow.cs
@@ -0,0 +1,48 @@
+using System;
+using Gtk;
+using UI = Gtk.Builder.ObjectAttribute;
+
+namespace hamlibgui
+{
+class MainWindow : Window
+{
+ [UI] private Label _label1 = null;
+ [UI] private Button _button1 = null;
+
+ private bool connectFlag;
+
+ public MainWindow() : this(new Builder("MainWindow.glade")) { }
+
+ private MainWindow(Builder builder) : base(
+ builder.GetRawOwnedObject("MainWindow"))
+ {
+ builder.Autoconnect(this);
+
+ DeleteEvent += Window_DeleteEvent;
+ _button1.Clicked += Button1_Clicked;
+ }
+
+ private void Window_DeleteEvent(object sender, DeleteEventArgs a)
+ {
+ Application.Quit();
+ }
+
+ private void Button1_Clicked(object sender, EventArgs a)
+ {
+ connectFlag = !connectFlag;
+
+ if (connectFlag)
+ {
+ String mytext = "Rig Connected (not really)";
+ _label1.Text = mytext;
+ _button1.Label = "Disconnect Rig";
+ }
+ else
+ {
+ String mytext = "Rig not Connected ";
+ _label1.Text = mytext;
+ _button1.Label = "Connect to Rig";
+ }
+ }
+}
+}
diff --git a/bindings/csharp/hamlibgui/MainWindow.glade b/bindings/csharp/hamlibgui/MainWindow.glade
new file mode 100755
index 00000000..abc5b731
--- /dev/null
+++ b/bindings/csharp/hamlibgui/MainWindow.glade
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.38.2 -->
+<interface>
+ <requires lib="gtk+" version="3.18"/>
+ <object class="GtkWindow" id="MainWindow">
+ <property name="can-focus">False</property>
+ <property name="title" translatable="yes">Hamlib Control</property>
+ <property name="default-width">480</property>
+ <property name="default-height">240</property>
+ <child>
+ <object class="GtkBox">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="margin-left">4</property>
+ <property name="margin-right">4</property>
+ <property name="margin-top">4</property>
+ <property name="margin-bottom">4</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="GtkLabel" id="_label1">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="label" translatable="yes">Hamlib controller to go here</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="_button1">
+ <property name="label" translatable="yes">Connect to Rig</property>
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="receives-default">True</property>
+ <property name="tooltip-markup" translatable="yes">Click to connect/disconnect rig</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+</interface>
diff --git a/bindings/csharp/hamlibgui/Program.cs b/bindings/csharp/hamlibgui/Program.cs
new file mode 100755
index 00000000..1bad8e7a
--- /dev/null
+++ b/bindings/csharp/hamlibgui/Program.cs
@@ -0,0 +1,23 @@
+using System;
+using Gtk;
+
+namespace hamlibgui
+{
+ class Program
+ {
+ [STAThread]
+ public static void Main(string[] args)
+ {
+ Application.Init();
+
+ var app = new Application("org.hamlibgui.hamlibgui", GLib.ApplicationFlags.None);
+ app.Register(GLib.Cancellable.Current);
+
+ var win = new MainWindow();
+ app.AddWindow(win);
+
+ win.Show();
+ Application.Run();
+ }
+ }
+}
diff --git a/bindings/csharp/hamlibgui/README.txt b/bindings/csharp/hamlibgui/README.txt
new file mode 100644
index 00000000..4020be1e
--- /dev/null
+++ b/bindings/csharp/hamlibgui/README.txt
@@ -0,0 +1,18 @@
+This is a test of creating a portable Hamlib GUI controller using dotnet and GTK
+Should be able to compile on Windows, Linux, and MacOS
+No guarante this will go anywhere depending on ability to talk to Hamlib via C#
+
+On Windows
+dotnet new install GtkSharp.Template.CSharp
+dotnet build
+
+
+
+
+On Ubuntu I don't see the GtkSharp package -- but you can build the code generated on the Windows side.
+apt install dotnet-sdk-6.0
+dotnet build
+
+
+Note: On Windows you can create a skeleton GTK app
+dotnet new gtkapp
diff --git a/bindings/csharp/hamlibgui/hamlibgui.csproj b/bindings/csharp/hamlibgui/hamlibgui.csproj
new file mode 100755
index 00000000..459dedc8
--- /dev/null
+++ b/bindings/csharp/hamlibgui/hamlibgui.csproj
@@ -0,0 +1,19 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+ <PropertyGroup>
+ <OutputType>WinExe</OutputType>
+ <TargetFramework>net6.0</TargetFramework>
+ </PropertyGroup>
+
+ <ItemGroup>
+ <None Remove="**\*.glade" />
+ <EmbeddedResource Include="**\*.glade">
+ <LogicalName>%(Filename)%(Extension)</LogicalName>
+ </EmbeddedResource>
+ </ItemGroup>
+
+ <ItemGroup>
+ <PackageReference Include="GtkSharp" Version="3.24.24.*" />
+ </ItemGroup>
+
+</Project>
commit 18a2d91f59e0a04042bcaf68e47417f5d9695dbe
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sat Jan 21 22:49:51 2023 -0600
Add HAMLIB_VERSION_MAJOR, HAMLIB_VERSION_MINOR, and HAMLIB_VERSION_PATCH #defines
https://github.com/Hamlib/Hamlib/issues/1209
diff --git a/configure.ac b/configure.ac
index 0af90a70..ff777d51 100644
--- a/configure.ac
+++ b/configure.ac
@@ -59,11 +59,15 @@ dnl See README.release on setting these values
# Set them here to keep c++/Makefile and src/Makefile in sync.
ABI_VERSION=4
ABI_REVISION=6
+ABI_PATCH=0
ABI_AGE=0
AC_DEFINE_UNQUOTED([ABI_VERSION], [$ABI_VERSION], [Frontend ABI version])
AC_DEFINE_UNQUOTED([ABI_REVISION], [$ABI_REVISION], [Frontend ABI revision])
AC_DEFINE_UNQUOTED([ABI_AGE], [$ABI_AGE], [Frontend ABI age])
+AC_DEFINE_UNQUOTED([ABI_VERSION_MAJOR], [$ABI_VERSION], [Frontend Major version])
+AC_DEFINE_UNQUOTED([ABI_VERSION_MINOR], [$ABI_REVISION], [Frontend Minor version])
+AC_DEFINE_UNQUOTED([ABI_VERSION_PATCH], [$ABI_PATCH], [Frontend Patch version])
AC_SUBST([ABI_VERSION])
AC_SUBST([ABI_REVISION])
commit 0c2426c800b754de0aa14a89421354e39473546f
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sat Jan 21 17:21:04 2023 -0600
Add 5 second sleep during power on for IC7300
https://github.com/Hamlib/Hamlib/issues/1220
diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c
index 7cc67e52..3a700127 100644
--- a/rigs/icom/icom.c
+++ b/rigs/icom/icom.c
@@ -8051,6 +8051,11 @@ int icom_set_powerstat(RIG *rig, powerstat_t status)
if (status == RIG_POWER_ON) // wait for wakeup only
{
+ if (rig->caps->rig_model == RIG_MODEL_IC7300)
+ {
+ rig_debug(RIG_DEBUG_VERBOSE, "%s: waiting 5 seconds for rig to wake up\n", __func__);
+ sleep(5); // IC7300 is slow to start up -- may need to add more rigs
+ }
for (i = 0; i < retry; ++i) // up to 10 attempts
{
freq_t freq;
diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h
index 6629fcad..a72ba5ed 100644
--- a/rigs/icom/icom.h
+++ b/rigs/icom/icom.h
@@ -31,7 +31,7 @@
#include <sys/time.h>
#endif
-#define BACKEND_VER "20230118"
+#define BACKEND_VER "20230121"
#define ICOM_IS_ID31 rig_is_model(rig, RIG_MODEL_ID31)
#define ICOM_IS_ID51 rig_is_model(rig, RIG_MODEL_ID51)
commit cdbd517228cf11d5a9e90d82fa534abc53d95eb4
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sat Jan 21 12:55:44 2023 -0600
Remove double execution of get_powerstat -- was causing rigctld to give an error
https://github.com/Hamlib/Hamlib/issues/1220
diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c
index 2c417b47..02c80195 100644
--- a/tests/rigctl_parse.c
+++ b/tests/rigctl_parse.c
@@ -1731,23 +1731,6 @@ readline_repeat:
else
{
- if (my_rig->caps->get_powerstat && (rig_powerstat == RIG_POWER_OFF
- || rig_powerstat == RIG_POWER_STANDBY))
- {
- // Update power status
- powerstat_t stat = RIG_POWER_ON;
- retcode = rig_get_powerstat(my_rig, &stat);
-
- if (retcode == RIG_OK) { rig_powerstat = stat; }
-
- if (rig_powerstat != RIG_POWER_ON)
- {
- rig_debug(RIG_DEBUG_ERR,
- "%s: rig_powerstat is not on = %d\n", __func__,
- rig_powerstat);
- }
- }
-
// Allow only certain commands when the rig is powered off
if (retcode == RIG_OK && (rig_powerstat == RIG_POWER_OFF
|| rig_powerstat == RIG_POWER_STANDBY)
commit cfde2c8a92105da471056fa70194ee10658c201f
Author: Mike Black W9MDB <mdb...@ya...>
Date: Fri Jan 20 16:53:42 2023 -0600
Add ability for set_vfo_opt 0/1 so rigctl can control VFO option
diff --git a/src/rig.c b/src/rig.c
index 5eb5767f..2aa101ab 100644
--- a/src/rig.c
+++ b/src/rig.c
@@ -6917,10 +6917,14 @@ int HAMLIB_API rig_set_vfo_opt(RIG *rig, int status)
RETURNFUNC(-RIG_EINVAL);
}
+ // Only netrigctl has this function
+ // We allow the status to be set for rigctl use
if (rig->caps->set_vfo_opt == NULL)
{
ELAPSED2;
- RETURNFUNC(-RIG_ENAVAIL);
+ rig->state.vfo_opt = status;
+ //RETURNFUNC(-RIG_ENAVAIL);
+ RETURNFUNC(RIG_OK);
}
retcode = rig->caps->set_vfo_opt(rig, status);
commit eb1d46723616ec3d94b453f0c1fed94bc977cfe5
Author: Mike Black W9MDB <mdb...@ya...>
Date: Fri Jan 20 15:39:23 2023 -0600
Fix segfault in aclog.c
diff --git a/rigs/dummy/aclog.c b/rigs/dummy/aclog.c
index d5a5a828..b3a95524 100644
--- a/rigs/dummy/aclog.c
+++ b/rigs/dummy/aclog.c
@@ -301,7 +301,7 @@ static int aclog_transaction(RIG *rig, char *cmd, char *value,
// we get an unknown response if function does not exist
if (strstr(xml, "UNKNOWN")) { set_transaction_inactive(rig); RETURNFUNC(RIG_ENAVAIL); }
- strncpy(value, xml, value_len);
+ if (value) strncpy(value, xml, value_len);
}
while (((value && strlen(value) == 0))
commit 50a14bb08fdcccc59fc1f7cf803cd6866ee369f3
Author: Mike Black W9MDB <mdb...@ya...>
Date: Fri Jan 20 12:47:52 2023 -0600
Add ACLog rig -- should work with WSJT_X and Fake It mode -- mode setting is a bit odd though might need None for mode in WSJT-X and manually set rig
diff --git a/include/hamlib/riglist.h b/include/hamlib/riglist.h
index 9acb9a22..6d730595 100644
--- a/include/hamlib/riglist.h
+++ b/include/hamlib/riglist.h
@@ -71,7 +71,7 @@
#define RIG_MODEL_TRXMANAGER_RIG RIG_MAKE_MODEL(RIG_DUMMY, 5)
#define RIG_MODEL_DUMMY_NOVFO RIG_MAKE_MODEL(RIG_DUMMY, 6)
#define RIG_MODEL_TCI1X RIG_MAKE_MODEL(RIG_DUMMY, 7)
-
+#define RIG_MODEL_ACLOG RIG_MAKE_MODEL(RIG_DUMMY, 8)
/*
* Yaesu
@@ -128,7 +128,6 @@
#define RIG_MODEL_FT990UNI RIG_MAKE_MODEL(RIG_YAESU, 48)
#define RIG_MODEL_FT710 RIG_MAKE_MODEL(RIG_YAESU, 49)
-
/*
* Kenwood
*/
@@ -274,7 +273,6 @@
#define RIG_MODEL_G90 RIG_MAKE_MODEL(RIG_ICOM, 88) /* Xiegu G90 */
#define RIG_MODEL_X5105 RIG_MAKE_MODEL(RIG_ICOM, 89) /* Xiegu X5105 -- G90 compatible */
-
/*
* Optoelectronics (CI-V)
*/
@@ -283,7 +281,6 @@
#define RIG_MODEL_OS535 RIG_MAKE_MODEL(RIG_ICOM, 52)
#define RIG_MODEL_OS456 RIG_MAKE_MODEL(RIG_ICOM, 53)
-
/*
* TenTec (CI-V)
*/
@@ -292,7 +289,6 @@
#define RIG_MODEL_PARAGON2 RIG_MAKE_MODEL(RIG_ICOM, 59)
#define RIG_MODEL_DELTAII RIG_MAKE_MODEL(RIG_ICOM, 64)
-
/*
* Icom PCR
*/
@@ -303,7 +299,6 @@
#define RIG_MODEL_PCR1500 RIG_MAKE_MODEL(RIG_PCR, 3)
#define RIG_MODEL_PCR2500 RIG_MAKE_MODEL(RIG_PCR, 4)
-
/*
* AOR
*/
@@ -326,7 +321,6 @@
#define RIG_MODEL_AR7030P RIG_MAKE_MODEL(RIG_AOR, 15)
#define RIG_MODEL_SR2200 RIG_MAKE_MODEL(RIG_AOR, 16)
-
/*
* JRC
*/
@@ -340,7 +334,6 @@
#define RIG_MODEL_NRD535 RIG_MAKE_MODEL(RIG_JRC, 6)
#define RIG_MODEL_NRD545 RIG_MAKE_MODEL(RIG_JRC, 7)
-
/*
* Radio Shack
* Actually, they might be either Icom or Uniden. TBC --SF
@@ -354,7 +347,6 @@
#define RIG_MODEL_RS2042 RIG_MAKE_MODEL(RIG_RADIOSHACK, 5) /* w/ OptoElectronics OS435 Board */
#define RIG_MODEL_RS2041 RIG_MAKE_MODEL(RIG_RADIOSHACK, 6) /* PRO-2041 */
-
/*
* Uniden
*/
@@ -373,7 +365,6 @@
#define RIG_MODEL_BCD996T RIG_MAKE_MODEL(RIG_UNIDEN, 11)
#define RIG_MODEL_BC898 RIG_MAKE_MODEL(RIG_UNIDEN, 12)
-
/*
* Drake
*/
@@ -383,7 +374,6 @@
#define RIG_MODEL_DKR8A RIG_MAKE_MODEL(RIG_DRAKE, 2)
#define RIG_MODEL_DKR8B RIG_MAKE_MODEL(RIG_DRAKE, 3)
-
/*
* Lowe
*/
@@ -394,7 +384,6 @@
#define RIG_MODEL_HF250 RIG_MAKE_MODEL(RIG_LOWE, 3)
#define RIG_MODEL_HF235 RIG_MAKE_MODEL(RIG_LOWE, 4)
-
/*
* Racal
*/
@@ -406,7 +395,6 @@
#define RIG_MODEL_RA3710 RIG_MAKE_MODEL(RIG_RACAL, 4)
#define RIG_MODEL_RA3702 RIG_MAKE_MODEL(RIG_RACAL, 5)
-
/*
* Watkins-Johnson
*/
@@ -417,7 +405,6 @@
#define RIG_MODEL_WJ8711 RIG_MAKE_MODEL(RIG_WJ, 3)
#define RIG_MODEL_WJ8888 RIG_MAKE_MODEL(RIG_WJ, 4)
-
/*
* Rohde & Schwarz--ek
*/
@@ -429,7 +416,6 @@
#define RIG_MODEL_EK895 RIG_MAKE_MODEL(RIG_EK, 4)
#define RIG_MODEL_EK070 RIG_MAKE_MODEL(RIG_EK, 5)
-
/*
* Skanti
*/
@@ -440,7 +426,6 @@
#define RIG_MODEL_TRP9000 RIG_MAKE_MODEL(RIG_SKANTI, 3)
#define RIG_MODEL_TRP8255 RIG_MAKE_MODEL(RIG_SKANTI, 4)
-
/*
* WiNRADiO/LinRADiO
*/
@@ -458,7 +443,6 @@
#define RIG_MODEL_G305 RIG_MAKE_MODEL(RIG_WINRADIO, 10)
#define RIG_MODEL_G315 RIG_MAKE_MODEL(RIG_WINRADIO, 11)
-
/*
* Ten Tec
*/
@@ -477,7 +461,6 @@
#define RIG_MODEL_RX331 RIG_MAKE_MODEL(RIG_TENTEC, 12)
#define RIG_MODEL_TT599 RIG_MAKE_MODEL(RIG_TENTEC, 13) /* Eagle */
-
/*
* Alinco
*/
@@ -486,7 +469,6 @@
#define RIG_MODEL_DX77 RIG_MAKE_MODEL(RIG_ALINCO, 1)
#define RIG_MODEL_DXSR8 RIG_MAKE_MODEL(RIG_ALINCO, 2)
-
/*
* Kachina
*/
@@ -494,7 +476,6 @@
#define RIG_BACKEND_KACHINA "kachina"
#define RIG_MODEL_505DSP RIG_MAKE_MODEL(RIG_KACHINA, 1)
-
/*
* Gnuradio backend
*/
@@ -506,7 +487,6 @@
#define RIG_MODEL_GRAUDIOIQ RIG_MAKE_MODEL(RIG_GNURADIO, 4) /* I&Q stereo sound card source */
#define RIG_MODEL_USRP_G RIG_MAKE_MODEL(RIG_GNURADIO, 5) /* Universal Software Radio Peripheral */
-
/*
* Microtune tuners
*/
@@ -516,7 +496,6 @@
#define RIG_MODEL_MICROTUNE_4702 RIG_MAKE_MODEL(RIG_MICROTUNE, 2) /* Alan's */
#define RIG_MODEL_MICROTUNE_4707 RIG_MAKE_MODEL(RIG_MICROTUNE, 3)
-
/*
* TAPR
*/
@@ -524,7 +503,6 @@
#define RIG_BACKEND_TAPR "tapr"
#define RIG_MODEL_DSP10 RIG_MAKE_MODEL(RIG_TAPR, 1)
-
/*
* Flex-radio
*/
@@ -535,7 +513,6 @@
#define RIG_MODEL_DTTSP RIG_MAKE_MODEL(RIG_FLEXRADIO, 3)
#define RIG_MODEL_DTTSP_UDP RIG_MAKE_MODEL(RIG_FLEXRADIO, 4)
-
/*
* VEB Funkwerk Köpenick RFT
*/
@@ -543,7 +520,6 @@
#define RIG_BACKEND_RFT "rft"
#define RIG_MODEL_EKD500 RIG_MAKE_MODEL(RIG_RFT, 1)
-
/*
* Various kits
*/
@@ -569,7 +545,6 @@
#define RIG_MODEL_FUNCUBEDONGLEPLUS RIG_MAKE_MODEL(RIG_KIT, 18) /* FunCUBE Dongle Pro+ */
#define RIG_MODEL_RSHFIQ RIG_MAKE_MODEL(RIG_KIT, 19) /* RS-HFIQ */
-
/*
* SW/FM/TV tuner cards supported by Video4Linux,*BSD, ..
*/
@@ -578,7 +553,6 @@
#define RIG_MODEL_V4L RIG_MAKE_MODEL(RIG_TUNER, 1)
#define RIG_MODEL_V4L2 RIG_MAKE_MODEL(RIG_TUNER, 2)
-
/*
* Rohde & Schwarz--rs
*/
@@ -589,7 +563,6 @@
#define RIG_MODEL_XK2100 RIG_MAKE_MODEL(RIG_RS, 3)
#define RIG_MODEL_EK89X RIG_MAKE_MODEL(RIG_RS, 4)
-
/*
* Phillips/Simoco PRM80
*/
@@ -598,7 +571,6 @@
#define RIG_MODEL_PRM8060 RIG_MAKE_MODEL(RIG_PRM80, 1)
#define RIG_MODEL_PRM8070 RIG_MAKE_MODEL(RIG_PRM80, 2)
-
/*
* ADAT by HB9CBU
*
@@ -608,7 +580,6 @@
#define RIG_BACKEND_ADAT "adat"
#define RIG_MODEL_ADT_200A RIG_MAKE_MODEL(RIG_ADAT, 1)
-
/*
* ICOM Marine
*/
@@ -619,7 +590,6 @@
#define RIG_MODEL_IC_M710 RIG_MAKE_MODEL(RIG_ICMARINE, 3)
#define RIG_MODEL_IC_M803 RIG_MAKE_MODEL(RIG_ICMARINE, 4)
-
/*
* Dorji transceiver modules
*/
diff --git a/rigs/dummy/Makefile.am b/rigs/dummy/Makefile.am
index 7a60bdce..5a419d3f 100644
--- a/rigs/dummy/Makefile.am
+++ b/rigs/dummy/Makefile.am
@@ -1,4 +1,4 @@
-DUMMYSRC = dummy_common.c dummy_common.h dummy.c dummy.h rot_dummy.c rot_dummy.h netrigctl.c netrotctl.c flrig.c flrig.h trxmanager.c trxmanager.h amp_dummy.c amp_dummy.h netampctl.c tci1x.c
+DUMMYSRC = dummy_common.c dummy_common.h dummy.c dummy.h rot_dummy.c rot_dummy.h netrigctl.c netrotctl.c flrig.c flrig.h trxmanager.c trxmanager.h amp_dummy.c amp_dummy.h netampctl.c tci1x.c aclog.c
noinst_LTLIBRARIES = libhamlib-dummy.la
libhamlib_dummy_la_SOURCES = $(DUMMYSRC)
diff --git a/rigs/dummy/aclog.c b/rigs/dummy/aclog.c
new file mode 100644
index 00000000..d5a5a828
--- /dev/null
+++ b/rigs/dummy/aclog.c
@@ -0,0 +1,994 @@
+/*
+* Hamlib ACLog backend - main file
+* Copyright (c) 2023 by Michael Black W9MDB
+*
+*
+* This library is free software; you can redistribute it and/or
+* modify it under the terms of the GNU Lesser General Public
+* License as published by the Free Software Foundation; either
+* version 2.1 of the License, or (at your option) any later version.
+*
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this library; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+*
+*/
+#include <hamlib/config.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <hamlib/rig.h>
+#include <serial.h>
+#include <misc.h>
+#include <token.h>
+#include <register.h>
+#include <network.h>
+
+#include "dummy_common.h"
+
+#define DEBUG 1
+#define DEBUG_TRACE DEBUG_VERBOSE
+#define TRUE 1
+#define FALSE 0
+
+
+#define MAXCMDLEN 8192
+#define MAXXMLLEN 8192
+#define MAXARGLEN 128
+#define MAXBANDWIDTHLEN 4096
+
+#define DEFAULTPATH "127.0.0.1:1100"
+
+#define ACLOG_VFOS (RIG_VFO_A)
+
+#define ACLOG_MODES (RIG_MODE_AM | RIG_MODE_PKTAM | RIG_MODE_CW | RIG_MODE_CWR |\
+ RIG_MODE_RTTY | RIG_MODE_RTTYR |\
+ RIG_MODE_PKTLSB | RIG_MODE_PKTUSB |\
+ RIG_MODE_SSB | RIG_MODE_LSB | RIG_MODE_USB |\
+ RIG_MODE_FM | RIG_MODE_WFM | RIG_MODE_FMN | RIG_MODE_PKTFM |\
+ RIG_MODE_C4FM)
+
+#define streq(s1,s2) (strcmp(s1,s2)==0)
+
+struct aclog_priv_data
+{
+ vfo_t curr_vfo;
+ char bandwidths[MAXBANDWIDTHLEN]; /* pipe delimited set returned from aclog */
+ int nbandwidths;
+ char info[8192];
+ ptt_t ptt;
+ split_t split;
+ rmode_t curr_modeA;
+ rmode_t curr_modeB;
+ freq_t curr_freqA;
+ freq_t curr_freqB;
+ pbwidth_t curr_widthA;
+ pbwidth_t curr_widthB;
+ int has_get_modeA; /* True if this function is available */
+ int has_get_bwA; /* True if this function is available */
+ int has_set_bwA; /* True if this function is available */
+ float powermeter_scale; /* So we can scale power meter to 0-1 */
+ value_t parms[RIG_SETTING_MAX];
+ struct ext_list *ext_parms;
+};
+
+//Structure for mapping aclog dynmamic modes to hamlib modes
+//aclog displays modes as the rig displays them
+struct s_modeMap
+{
+ rmode_t mode_hamlib;
+ char *mode_aclog;
+};
+
+//ACLog will provide us the modes for the selected rig
+//We will then put them in this struct
+static struct s_modeMap modeMap[] =
+{
+ {RIG_MODE_USB, "|USB|"},
+ {RIG_MODE_USB, "|SSB|"},
+ {RIG_MODE_LSB, "|LSB|"},
+ {RIG_MODE_PKTUSB, NULL},
+ {RIG_MODE_PKTLSB, NULL},
+ {RIG_MODE_AM, "|AM|"},
+ {RIG_MODE_FM, "|FM|"},
+ {RIG_MODE_FMN, NULL},
+ {RIG_MODE_WFM, NULL},
+ {RIG_MODE_CW, "|CW|"},
+ {RIG_MODE_CWR, "|CWR|"},
+ {RIG_MODE_RTTY, "|RTTY|"},
+ {RIG_MODE_RTTYR, "|RTTYR|"},
+ {RIG_MODE_C4FM, "|C4FM|"},
+ {0, NULL}
+};
+
+/*
+* check_vfo
+* No assumptions
+*/
+static int check_vfo(vfo_t vfo)
+{
+ switch (vfo)
+ {
+ case RIG_VFO_A:
+ break;
+
+ case RIG_VFO_TX:
+ case RIG_VFO_B:
+ break;
+
+ case RIG_VFO_CURR:
+ break; // will default to A in which_vfo
+
+ default:
+ return (FALSE);
+ }
+
+ return (TRUE);
+}
+
+/*
+* read_transaction
+* Assumes rig!=NULL, xml!=NULL, xml_len>=MAXXMLLEN
+*/
+static int read_transaction(RIG *rig, char *xml, int xml_len)
+{
+ int retval;
+ int retry;
+ char *delims;
+ char *terminator = "</CMD>\r\n";
+ struct rig_state *rs = &rig->state;
+
+ ENTERFUNC;
+
+ retry = 2;
+ delims = "\n";
+ xml[0] = 0;
+
+ do
+ {
+ char tmp_buf[MAXXMLLEN]; // plenty big for expected aclog responses hopefully
+
+ if (retry < 2)
+ {
+ rig_debug(RIG_DEBUG_WARN, "%s: retry needed? retry=%d\n", __func__, retry);
+ }
+
+ int len = read_string(&rs->rigport, (unsigned char *) tmp_buf, sizeof(tmp_buf),
+ delims,
+ strlen(delims), 0, 1);
+ rig_debug(RIG_DEBUG_TRACE, "%s: string='%s'\n", __func__, tmp_buf);
+
+ // if our first response we should see the HTTP header
+ if (strlen(xml) == 0 && strstr(tmp_buf, "<CMD>") == NULL)
+ {
+ rig_debug(RIG_DEBUG_ERR, "%s: Expected '</CMD>', got '%s'\n", __func__,
+ tmp_buf);
+ continue; // we'll try again
+ }
+
+ if (len > 0) { retry = 3; }
+
+ if (len <= 0)
+ {
+ rig_debug(RIG_DEBUG_ERR, "%s: read_string error=%d\n", __func__, len);
+ continue;
+ }
+
+ if (strlen(xml) + strlen(tmp_buf) < xml_len - 1)
+ {
+ strncat(xml, tmp_buf, xml_len - 1);
+ }
+ else
+ {
+ rig_debug(RIG_DEBUG_ERR,
+ "%s: xml buffer overflow!!\nTrying to add len=%d\nTo len=%d\n", __func__,
+ (int)strlen(tmp_buf), (int)strlen(xml));
+ RETURNFUNC(-RIG_EPROTO);
+ }
+ }
+ while (retry-- > 0 && strstr(xml, terminator) == NULL);
+
+ if (retry == 0)
+ {
+ rig_debug(RIG_DEBUG_WARN, "%s: retry timeout\n", __func__);
+ RETURNFUNC(-RIG_ETIMEOUT);
+ }
+
+ if (strstr(xml, terminator))
+ {
+ rig_debug(RIG_DEBUG_TRACE, "%s: got %s\n", __func__, terminator);
+ retval = RIG_OK;
+ }
+ else
+ {
+ rig_debug(RIG_DEBUG_VERBOSE, "%s: did not get %s\n", __func__, terminator);
+ retval = -(101 + RIG_EPROTO);
+ }
+
+ RETURNFUNC(retval);
+}
+
+/*
+* write_transaction
+* Assumes rig!=NULL, xml!=NULL, xml_len=total size of xml for response
+*/
+static int write_transaction(RIG *rig, char *xml, int xml_len)
+{
+
+ int try = rig->caps->retry;
+
+ int retval = -RIG_EPROTO;
+
+ struct rig_state *rs = &rig->state;
+
+ ENTERFUNC;
+
+ // This shouldn't ever happen...but just in case
+ // We need to avoid an empty write as rigctld replies with blank line
+ if (xml_len == 0)
+ {
+ rig_debug(RIG_DEBUG_ERR, "%s: len==0??\n", __func__);
+ RETURNFUNC(retval);
+ }
+
+ // appears we can lose sync if we don't clear things out
+ // shouldn't be anything for us now anyways
+ rig_flush(&rig->state.rigport);
+
+ while (try-- >= 0 && retval != RIG_OK)
+ {
+ retval = write_block(&rs->rigport, (unsigned char *) xml, strlen(xml));
+
+ if (retval < 0)
+ {
+ RETURNFUNC(-RIG_EIO);
+ }
+ }
+
+ RETURNFUNC(retval);
+}
+
+static int aclog_transaction(RIG *rig, char *cmd, char *value,
+ int value_len)
+{
+ char xml[MAXXMLLEN];
+ int retry = 3;
+
+ ENTERFUNC;
+ ELAPSED1;
+
+ set_transaction_active(rig);
+
+ if (value)
+ {
+ value[0] = 0;
+ }
+
+ do
+ {
+ int retval;
+
+ if (retry != 3)
+ {
+ rig_debug(RIG_DEBUG_VERBOSE, "%s: cmd=%s, retry=%d\n", __func__, cmd, retry);
+ }
+
+ retval = write_transaction(rig, cmd, strlen(cmd));
+
+ if (retval != RIG_OK)
+ {
+ rig_debug(RIG_DEBUG_ERR, "%s: write_transaction error=%d\n", __func__, retval);
+
+ // if we get RIG_EIO the socket has probably disappeared
+ // so bubble up the error so port can re re-opened
+ if (retval == -RIG_EIO) { set_transaction_inactive(rig); RETURNFUNC(retval); }
+
+ hl_usleep(50 * 1000); // 50ms sleep if error
+ }
+
+ if (value)
+ {
+ read_transaction(rig, xml, sizeof(xml)); // this might time out -- that's OK
+ }
+
+ // we get an unknown response if function does not exist
+ if (strstr(xml, "UNKNOWN")) { set_transaction_inactive(rig); RETURNFUNC(RIG_ENAVAIL); }
+
+ strncpy(value, xml, value_len);
+
+ }
+ while (((value && strlen(value) == 0))
+ && retry--); // we'll do retries if needed
+
+ if (value && strlen(value) == 0)
+ {
+ rig_debug(RIG_DEBUG_ERR, "%s: no value returned\n", __func__);
+ set_transaction_inactive(rig); RETURNFUNC(RIG_EPROTO);
+ }
+
+ ELAPSED2;
+ set_transaction_inactive(rig);
+ RETURNFUNC(RIG_OK);
+}
+
+/*
+* aclog_init
+* Assumes rig!=NULL
+*/
+static int aclog_init(RIG *rig)
+{
+ struct aclog_priv_data *priv;
+
+ ENTERFUNC;
+ rig_debug(RIG_DEBUG_TRACE, "%s version %s\n", __func__, rig->caps->version);
+
+ rig->state.priv = (struct aclog_priv_data *)calloc(1, sizeof(
+ struct aclog_priv_data));
+
+ if (!rig->state.priv)
+ {
+ RETURNFUNC(-RIG_ENOMEM);
+ }
+
+ priv = rig->state.priv;
+
+ memset(priv, 0, sizeof(struct aclog_priv_data));
+ memset(priv->parms, 0, RIG_SETTING_MAX * sizeof(value_t));
+
+ /*
+ * set arbitrary initial status
+ */
+ rig->state.current_vfo = RIG_VFO_A;
+ priv->split = 0;
+ priv->ptt = 0;
+ priv->curr_modeA = -1;
+ priv->curr_modeB = -1;
+ priv->curr_widthA = -1;
+ priv->curr_widthB = -1;
+
+ if (!rig->caps)
+ {
+ RETURNFUNC(-RIG_EINVAL);
+ }
+
+ strncpy(rig->state.rigport.pathname, DEFAULTPATH,
+ sizeof(rig->state.rigport.pathname));
+
+ RETURNFUNC(RIG_OK);
+}
+
+/*
+* modeMapGet
+* Assumes mode!=NULL
+* Return the string for ACLog for the given hamlib mode
+*/
+static const char *modeMapGet(rmode_t modeHamlib)
+{
+ int i;
+
+ rig_debug(RIG_DEBUG_TRACE, "%s: called\n", __func__);
+
+ for (i = 0; modeMap[i].mode_hamlib != 0; ++i)
+ {
+ if (modeMap[i].mode_aclog == NULL) { continue; }
+
+ rig_debug(RIG_DEBUG_TRACE,
+ "%s: checking modeMap[%d]=%.0f to modeHamlib=%.0f, mode_aclog='%s'\n", __func__,
+ i, (double)modeMap[i].mode_hamlib, (double)modeHamlib, modeMap[i].mode_aclog);
+
+ if (modeMap[i].mode_hamlib == modeHamlib && strlen(modeMap[i].mode_aclog) > 0)
+ {
+ rig_debug(RIG_DEBUG_TRACE, "%s matched mode=%.0f, returning '%s'\n", __func__,
+ (double)modeHamlib, modeMap[i].mode_aclog);
+ return (modeMap[i].mode_aclog);
+ }
+ }
+
+ rig_debug(RIG_DEBUG_ERR, "%s: ACLog does not have mode: %s\n", __func__,
+ rig_strrmode(modeHamlib));
+ return ("ERROR");
+}
+
+/*
+* modeMapGetHamlib
+* Assumes mode!=NULL
+* Return the hamlib mode from the given ACLog string
+*/
+static rmode_t modeMapGetHamlib(const char *modeACLog)
+{
+ int i;
+ char modeCheck[64];
+
+ SNPRINTF(modeCheck, sizeof(modeCheck), "|%s|", modeACLog);
+
+ for (i = 0; modeMap[i].mode_hamlib != 0; ++i)
+ {
+ rig_debug(RIG_DEBUG_TRACE, "%s: find '%s' in '%s'\n", __func__,
+ modeCheck, modeMap[i].mode_aclog);
+
+ if (modeMap[i].mode_aclog
+ && strcmp(modeMap[i].mode_aclog, modeCheck) == 0)
+ {
+ return (modeMap[i].mode_hamlib);
+ }
+ }
+
+ rig_debug(RIG_DEBUG_TRACE, "%s: mode requested: %s, not in modeMap\n", __func__,
+ modeACLog);
+ return (RIG_MODE_NONE);
+}
+
+/*
+* aclog_get_freq
+* Assumes rig!=NULL, rig->state.priv!=NULL, freq!=NULL
+*/
+static int aclog_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
+{
+ char value[MAXARGLEN];
+ struct aclog_priv_data *priv = (struct aclog_priv_data *) rig->state.priv;
+
+ ENTERFUNC;
+ rig_debug(RIG_DEBUG_TRACE, "%s: vfo=%s\n", __func__,
+ rig_strvfo(vfo));
+
+
+ if (check_vfo(vfo) == FALSE)
+ {
+ rig_debug(RIG_DEBUG_ERR, "%s: unsupported VFO %s\n",
+ __func__, rig_strvfo(vfo));
+ RETURNFUNC(-RIG_EINVAL);
+ }
+
+ if (vfo == RIG_VFO_CURR)
+ {
+ vfo = rig->state.current_vfo;
+ rig_debug(RIG_DEBUG_TRACE, "%s: get_freq2 vfo=%s\n",
+ __func__, rig_strvfo(vfo));
+ }
+
+ char *cmd = "<CMD><READBMF></CMD>\r\n";
+ int retval;
+
+ retval = aclog_transaction(rig, cmd, value, sizeof(value));
+
+ if (retval != RIG_OK)
+ {
+ rig_debug(RIG_DEBUG_ERR, "%s: READBMF failed retval=%s\n", __func__,
+ rigerror(retval));
+ RETURNFUNC(retval);
+ }
+
+ char *p = strstr(value, "<FREQ>");
+ *freq = 0;
+
+ if (p) { sscanf(p, "<FREQ>%lf", freq); }
+
+ *freq *= 1e6; // convert from MHz to Hz
+
+ if (*freq == 0)
+ {
+ rig_debug(RIG_DEBUG_ERR, "%s: freq==0??\nvalue=%s\n", __func__,
+ value);
+ RETURNFUNC(-RIG_EPROTO);
+ }
+ else
+ {
+ rig_debug(RIG_DEBUG_TRACE, "%s: freq=%.0f\n", __func__, *freq);
+ }
+
+ if (vfo == RIG_VFO_A)
+ {
+ priv->curr_freqA = *freq;
+ }
+ else // future support in ACL...
[truncated message content] |
|
From: n0nb <n0...@us...> - 2023-01-18 12:58:18
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Hamlib -- Ham radio control libraries".
The branch, Hamlib-4.5.5 has been created
at dc1d9cf43ef330e8ea518e5bea99c1f83a63147c (commit)
- Log -----------------------------------------------------------------
commit dc1d9cf43ef330e8ea518e5bea99c1f83a63147c
Author: Mike Black W9MDB <mdb...@ya...>
Date: Tue Jan 17 23:54:05 2023 -0600
Fix AGC level display in rigctld
https://github.com/Hamlib/Hamlib/issues/1155
diff --git a/NEWS b/NEWS
index 23de5250..a1b4ac1c 100644
--- a/NEWS
+++ b/NEWS
@@ -25,6 +25,7 @@ Version 4.6
* Fix FTDX3000 rig split
Version 4.5.5
+ * Fix AGC level display in rigctld
* Change FTDX10 to no serial handshake
* Add TS2000 to has_ps exception
* Add FT991 to 60M exception
diff --git a/rigs/dummy/netrigctl.c b/rigs/dummy/netrigctl.c
index c0ce157a..ad90419e 100644
--- a/rigs/dummy/netrigctl.c
+++ b/rigs/dummy/netrigctl.c
@@ -815,7 +815,7 @@ static int netrigctl_open(RIG *rig)
int i = 0;
char *p = strtok(value, " ");
rig->caps->agc_levels[0] = RIG_AGC_NONE; // default value gets overwritten
- rig->caps->agc_level_count = 1;
+ rig->caps->agc_level_count = 0;
while (p)
{
@@ -2736,7 +2736,7 @@ struct rig_caps netrigctl_caps =
RIG_MODEL(RIG_MODEL_NETRIGCTL),
.model_name = "NET rigctl",
.mfg_name = "Hamlib",
- .version = "20230106.0",
+ .version = "20230117.0",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_OTHER,
diff --git a/src/sprintflst.c b/src/sprintflst.c
index 07e3c347..6a6c870f 100644
--- a/src/sprintflst.c
+++ b/src/sprintflst.c
@@ -939,7 +939,7 @@ int rig_sprintf_agc_levels(RIG *rig, char *str, int lenstr)
{
if (strlen(str) > 0) { strcat(str, " "); }
- sprintf(tmpbuf, "%d=%s", i,
+ sprintf(tmpbuf, "%d=%s", rig->caps->agc_levels[i],
rig_stragclevel(rig->caps->agc_levels[i]));
if (strlen(str) + strlen(tmpbuf) < lenstr - 1)
commit 8d20fa079f77329105a8d97d96d9cf5cd0cb59fb
Author: Mike Black W9MDB <mdb...@ya...>
Date: Tue Jan 17 22:31:17 2023 -0600
Update NEWS
diff --git a/NEWS b/NEWS
index 536a8033..23de5250 100644
--- a/NEWS
+++ b/NEWS
@@ -25,6 +25,7 @@ Version 4.6
* Fix FTDX3000 rig split
Version 4.5.5
+ * Change FTDX10 to no serial handshake
* Add TS2000 to has_ps exception
* Add FT991 to 60M exception
* Fix get_powerstat bad call in rigctl_parse.c
commit f5dc6edc160d925c2fc5d06f4f7f78d64b32a236
Author: Mike Black W9MDB <mdb...@ya...>
Date: Tue Jan 17 22:30:02 2023 -0600
Change FTDX10 handshake to None instead of Hardware
diff --git a/rigs/yaesu/ftdx10.c b/rigs/yaesu/ftdx10.c
index 9daf5241..77101d8a 100644
--- a/rigs/yaesu/ftdx10.c
+++ b/rigs/yaesu/ftdx10.c
@@ -137,7 +137,7 @@ const struct rig_caps ftdx10_caps =
RIG_MODEL(RIG_MODEL_FTDX10),
.model_name = "FTDX-10",
.mfg_name = "Yaesu",
- .version = NEWCAT_VER ".5",
+ .version = NEWCAT_VER ".6",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
@@ -149,7 +149,7 @@ const struct rig_caps ftdx10_caps =
.serial_data_bits = 8,
.serial_stop_bits = 2,
.serial_parity = RIG_PARITY_NONE,
- .serial_handshake = RIG_HANDSHAKE_HARDWARE,
+ .serial_handshake = RIG_HANDSHAKE_NONE,
.write_delay = FTDX10_WRITE_DELAY,
.post_write_delay = FTDX10_POST_WRITE_DELAY,
.timeout = 2000,
commit a03d5892255a3c2987e144b474d3edadba4209fa
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sun Jan 15 12:41:01 2023 -0600
Add TS-2000 to has_ps exceptions
https://github.com/Hamlib/Hamlib/issues/1213
diff --git a/NEWS b/NEWS
index 9a533279..536a8033 100644
--- a/NEWS
+++ b/NEWS
@@ -25,6 +25,7 @@ Version 4.6
* Fix FTDX3000 rig split
Version 4.5.5
+ * Add TS2000 to has_ps exception
* Add FT991 to 60M exception
* Fix get_powerstat bad call in rigctl_parse.c
* Really fix CM108 ptt_bitnum usage
diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c
index fe41cdbf..1abad7a1 100644
--- a/rigs/kenwood/kenwood.c
+++ b/rigs/kenwood/kenwood.c
@@ -771,6 +771,7 @@ int kenwood_init(RIG *rig)
if (rig->caps->rig_model == RIG_MODEL_TS450S
|| rig->caps->rig_model == RIG_MODEL_TS50
|| rig->caps->rig_model == RIG_MODEL_TS140S
+ || rig->caps->rig_model == RIG_MODEL_TS2000
|| rig->caps->rig_model == RIG_MODEL_TS440)
{
priv->has_ps = 0;
diff --git a/rigs/kenwood/kenwood.h b/rigs/kenwood/kenwood.h
index 69106804..d0c077a0 100644
--- a/rigs/kenwood/kenwood.h
+++ b/rigs/kenwood/kenwood.h
@@ -29,7 +29,7 @@
#include "misc.h"
#include "idx_builtin.h"
-#define BACKEND_VER "20230109"
+#define BACKEND_VER "20230115"
#define EOM_KEN ';'
#define EOM_TH '\r'
commit d80e23c15091874efc32592f26a7c91990fcb1f2
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sun Jan 15 10:18:44 2023 -0600
Update NEWS
diff --git a/NEWS b/NEWS
index e05a2746..9a533279 100644
--- a/NEWS
+++ b/NEWS
@@ -25,6 +25,7 @@ Version 4.6
* Fix FTDX3000 rig split
Version 4.5.5
+ * Add FT991 to 60M exception
* Fix get_powerstat bad call in rigctl_parse.c
* Really fix CM108 ptt_bitnum usage
* Fix Elecraft power2mW precision/accuracy
commit 0b886dfd0b8eef5e6309053effd9088d418b8ebe
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sun Jan 15 10:17:54 2023 -0600
Add FT991 to 60M exception
diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c
index 703b7fb6..65f8b9f4 100644
--- a/rigs/yaesu/newcat.c
+++ b/rigs/yaesu/newcat.c
@@ -824,6 +824,9 @@ int newcat_60m_exception(RIG *rig, freq_t freq, mode_t mode)
return -RIG_EINVAL;
}
+ // some rigs need to skip freq/mode settings as 60M only operates in memory mode
+ if (is_ft991) { return 1; }
+
if (!is_ftdx10 && !is_ft710 && !is_ftdx101d && !is_ftdx101mp) { return 0; }
rig_debug(RIG_DEBUG_VERBOSE, "%s: 60M exception ignoring freq/mode commands\n",
diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h
index 5202dcfd..db1d64c4 100644
--- a/rigs/yaesu/newcat.h
+++ b/rigs/yaesu/newcat.h
@@ -50,7 +50,7 @@
typedef char ncboolean;
/* shared function version */
-#define NEWCAT_VER "20230109"
+#define NEWCAT_VER "20230115"
/* Hopefully large enough for future use, 128 chars plus '\0' */
#define NEWCAT_DATA_LEN 129
commit ae0add1e980bbe2a4ce5552a58824947157f2d56
Author: Mike Black W9MDB <mdb...@ya...>
Date: Fri Jan 13 17:30:55 2023 -0600
Fix get_powerstat call when get_powerstat is not defined
https://github.com/Hamlib/Hamlib/issues/1217
diff --git a/NEWS b/NEWS
index 3c18ed21..e05a2746 100644
--- a/NEWS
+++ b/NEWS
@@ -24,8 +24,14 @@ Version 4.6
* Add FLIR PTU-D48, E46, D100, D300 rotors
* Fix FTDX3000 rig split
+Version 4.5.5
+ * Fix get_powerstat bad call in rigctl_parse.c
+ * Really fix CM108 ptt_bitnum usage
+ * Fix Elecraft power2mW precision/accuracy
+ * Fix power on/off/on for Icom rigs with rigctld power_on=0
+
Version 4.5.4
- * 2023-01-10
+ * 2023-XX-XX
* Fix CM108 ptt setting for non-default usage
* Fix power on/off for Icom rigs with rigctld power_on=0
* Fix get_powerstat status return for non-PS kenwood rigs
diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c
index 1b356aac..c9c87c56 100644
--- a/tests/rigctl_parse.c
+++ b/tests/rigctl_parse.c
@@ -1728,7 +1728,7 @@ readline_repeat:
else
{
- if (my_rig->caps->set_powerstat && (rig_powerstat == RIG_POWER_OFF
+ if (my_rig->caps->get_powerstat && (rig_powerstat == RIG_POWER_OFF
|| rig_powerstat == RIG_POWER_STANDBY))
{
// Update power status
commit c915e49e1bf49eca5afd9409344cf599410a77cd
Author: Mike Black W9MDB <mdb...@ya...>
Date: Tue Jan 10 23:08:53 2023 -0600
Fix BSD build include path
https://github.com/Hamlib/Hamlib/issues/1208
diff --git a/configure.ac b/configure.ac
index ff6db5d6..e5bdfc41 100644
--- a/configure.ac
+++ b/configure.ac
@@ -14,7 +14,7 @@ dnl Please do not use '-' in the version number, as package managers will fail,
dnl however, the use of '~' should be fine as apt (others?) will treat
dnl it as an earlier version than the actual release. TNX KA6MAL
dnl PACKAGE_NAME + " " + PACKAGE_VERSION must not exceed 20 chars!
-AC_INIT([Hamlib],[4.5.4],[ham...@li...],[hamlib],[http://www.hamlib.org])
+AC_INIT([Hamlib],[4.5.5],[ham...@li...],[hamlib],[http://www.hamlib.org])
AC_CONFIG_SRCDIR([include/hamlib/rig.h])
AC_CONFIG_MACRO_DIR([macros])
@@ -269,7 +269,7 @@ LT_INIT([win32-dll])
dnl The host_os variable is set by the AC_CANONICAL_HOST macro above.
AS_CASE(["$host_os"],
[freebsd*], [
- AM_CPPFLAGS="-I/usr/local/include ${AM_CPPFLAGS}"
+ AM_CPPFLAGS="${AM_CPPFLAGS} -I/usr/local/include"
AM_LDFLAGS="${AM_LDFLAGS} -L/usr/local/lib"
AC_SUBST([AM_LDFLAGS])],
-----------------------------------------------------------------------
hooks/post-receive
--
Hamlib -- Ham radio control libraries
|
|
From: n0nb <n0...@us...> - 2023-01-18 12:50:31
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Hamlib -- Ham radio control libraries".
The branch, master has been updated
via f392cc4c1804f06fe16f7e326c879e2ba0f20e1d (commit)
via 16af6ae3aa39835711c11ec5a4376ba173dc0fc6 (commit)
via aeb2692b4203f5b354cd667455f862af31821a66 (commit)
via c0866e0bad111a21021b9f3d30d91a1884c2df59 (commit)
via 739fe24e6287dfbdf1fafebd8c04b8cd3154e9eb (commit)
via d180883f3efc24c813d6c020f6c1ef3811d94002 (commit)
via c02370d27981c66c89be187965922f4bfae59d71 (commit)
via 3f8da23bb62f851377d474b1ab874833207aa73c (commit)
via cb1c98fa857f735f7f18f964948e320eefb63b20 (commit)
via 0ad5a4b7425f5a1c73ef89300920b3f4231a54a9 (commit)
via c3ff7e134fd18a6fbf0005002fd81317e584758b (commit)
via e681185b61f466350e194376a8fa5e19797c7233 (commit)
via 77ce6b6dc39ba90cc12d1253af0de4f5ec7abb81 (commit)
via 29a80fb496696fb40a93e022987371da5c1d68db (commit)
via 9c48ec785c69442892a8acb3257c308fb9611310 (commit)
via e4471b9ece77601d3a5af8740dbc85caa847c323 (commit)
via 37b29012934ba57d527535d84b86ea1460ff409e (commit)
via 51f9cbe4575ecb82e5ff34447d44ea9e6624ac6d (commit)
via dc131cba7fc76ee0e9bea1dd123b2e6ac6a681d3 (commit)
via 00dce998aebfd9f4b9addd3830eb4b9026e1d1ce (commit)
via 5ebde1ca34e2b44b5b1c0d5e4a38ce091639b19e (commit)
from aa1cf567f67febd90e6d6a804ba2950fd9f2b6cf (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit f392cc4c1804f06fe16f7e326c879e2ba0f20e1d
Author: Mike Black W9MDB <mdb...@ya...>
Date: Tue Jan 17 23:54:05 2023 -0600
Fix AGC level display in rigctld
https://github.com/Hamlib/Hamlib/issues/1155
diff --git a/NEWS b/NEWS
index 23de5250..a1b4ac1c 100644
--- a/NEWS
+++ b/NEWS
@@ -25,6 +25,7 @@ Version 4.6
* Fix FTDX3000 rig split
Version 4.5.5
+ * Fix AGC level display in rigctld
* Change FTDX10 to no serial handshake
* Add TS2000 to has_ps exception
* Add FT991 to 60M exception
diff --git a/rigs/dummy/netrigctl.c b/rigs/dummy/netrigctl.c
index 03976838..b69e04b6 100644
--- a/rigs/dummy/netrigctl.c
+++ b/rigs/dummy/netrigctl.c
@@ -814,7 +814,7 @@ static int netrigctl_open(RIG *rig)
int i = 0;
char *p = strtok(value, " ");
rig->caps->agc_levels[0] = RIG_AGC_NONE; // default value gets overwritten
- rig->caps->agc_level_count = 1;
+ rig->caps->agc_level_count = 0;
while (p)
{
@@ -2735,7 +2735,7 @@ struct rig_caps netrigctl_caps =
RIG_MODEL(RIG_MODEL_NETRIGCTL),
.model_name = "NET rigctl",
.mfg_name = "Hamlib",
- .version = "20230106.0",
+ .version = "20230117.0",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_OTHER,
diff --git a/src/sprintflst.c b/src/sprintflst.c
index 07e3c347..6a6c870f 100644
--- a/src/sprintflst.c
+++ b/src/sprintflst.c
@@ -939,7 +939,7 @@ int rig_sprintf_agc_levels(RIG *rig, char *str, int lenstr)
{
if (strlen(str) > 0) { strcat(str, " "); }
- sprintf(tmpbuf, "%d=%s", i,
+ sprintf(tmpbuf, "%d=%s", rig->caps->agc_levels[i],
rig_stragclevel(rig->caps->agc_levels[i]));
if (strlen(str) + strlen(tmpbuf) < lenstr - 1)
commit 16af6ae3aa39835711c11ec5a4376ba173dc0fc6
Author: Mike Black W9MDB <mdb...@ya...>
Date: Tue Jan 17 22:31:17 2023 -0600
Update NEWS
diff --git a/NEWS b/NEWS
index 536a8033..23de5250 100644
--- a/NEWS
+++ b/NEWS
@@ -25,6 +25,7 @@ Version 4.6
* Fix FTDX3000 rig split
Version 4.5.5
+ * Change FTDX10 to no serial handshake
* Add TS2000 to has_ps exception
* Add FT991 to 60M exception
* Fix get_powerstat bad call in rigctl_parse.c
commit aeb2692b4203f5b354cd667455f862af31821a66
Author: Mike Black W9MDB <mdb...@ya...>
Date: Tue Jan 17 22:30:02 2023 -0600
Change FTDX10 handshake to None instead of Hardware
diff --git a/rigs/yaesu/ftdx10.c b/rigs/yaesu/ftdx10.c
index 9daf5241..77101d8a 100644
--- a/rigs/yaesu/ftdx10.c
+++ b/rigs/yaesu/ftdx10.c
@@ -137,7 +137,7 @@ const struct rig_caps ftdx10_caps =
RIG_MODEL(RIG_MODEL_FTDX10),
.model_name = "FTDX-10",
.mfg_name = "Yaesu",
- .version = NEWCAT_VER ".5",
+ .version = NEWCAT_VER ".6",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
@@ -149,7 +149,7 @@ const struct rig_caps ftdx10_caps =
.serial_data_bits = 8,
.serial_stop_bits = 2,
.serial_parity = RIG_PARITY_NONE,
- .serial_handshake = RIG_HANDSHAKE_HARDWARE,
+ .serial_handshake = RIG_HANDSHAKE_NONE,
.write_delay = FTDX10_WRITE_DELAY,
.post_write_delay = FTDX10_POST_WRITE_DELAY,
.timeout = 2000,
commit c0866e0bad111a21021b9f3d30d91a1884c2df59
Author: Mike Black W9MDB <mdb...@ya...>
Date: Tue Jan 17 16:23:45 2023 -0600
Add hamlibmodels.c example
diff --git a/tests/hamlibmodels.c b/tests/hamlibmodels.c
new file mode 100644
index 00000000..a7cfac7f
--- /dev/null
+++ b/tests/hamlibmodels.c
@@ -0,0 +1,38 @@
+/* Example showing host to list all models */
+#include <stdio.h>
+#include <stdlib.h>
+#include <hamlib/rig.h>
+
+char *list[1000]; // as of 2023-01-17 we have 275 rigs so this should cover us for long time
+
+int nmodels = 0;
+
+static int hash_model_list(const struct rig_caps *caps, void *data)
+{
+ char s[256];
+ sprintf(s, "%s %s", caps->mfg_name, caps->model_name);
+ list[nmodels] = strdup(s);
+ ++nmodels;
+ return 1; /* !=0, we want them all ! */
+}
+
+int mycmp(const void *p1, const void *p2)
+{
+ const char **s1 = (const char **)p1;
+ const char **s2 = (const char **)p2;
+ return strcasecmp(*s1, *s2);
+}
+
+int main()
+{
+ rig_set_debug_level(RIG_DEBUG_NONE);
+ rig_load_all_backends();
+ rig_list_foreach(hash_model_list, NULL);
+ qsort(list, nmodels, sizeof(list) / 1000, mycmp);
+
+ for (int i = 0; i < nmodels; ++i) { printf("%s\n", list[i]); }
+
+ printf("%d models\n", nmodels);
+
+ return 0;
+}
commit 739fe24e6287dfbdf1fafebd8c04b8cd3154e9eb
Author: Mike Black W9MDB <mdb...@ya...>
Date: Tue Jan 17 15:45:29 2023 -0600
Add new simulator to Makefile.am
diff --git a/simulators/Makefile.am b/simulators/Makefile.am
index 3e2d7c04..115b0b20 100644
--- a/simulators/Makefile.am
+++ b/simulators/Makefile.am
@@ -8,7 +8,7 @@ DISTCLEANFILES =
bin_PROGRAMS =
-check_PROGRAMS = simelecraft simicom simkenwood simyaesu simicom9700 simft991 simftdx1200 simftdx3000 simjupiter simpowersdr simid5100
+check_PROGRAMS = simelecraft simicom simkenwood simyaesu simicom9700 simft991 simftdx1200 simftdx3000 simjupiter simpowersdr simid5100 simft736 simftdx5000
simelecraft_SOURCES = simelecraft.c
simicom_SOURCES = simicom.c
commit d180883f3efc24c813d6c020f6c1ef3811d94002
Author: Mike Black W9MDB <mdb...@ya...>
Date: Tue Jan 17 09:22:55 2023 -0600
Allow rigctl/rigctld to continue when a bad set_conf is called -- just shows a warning now
diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c
index c1c0dc8a..0d397724 100644
--- a/tests/rigctl_parse.c
+++ b/tests/rigctl_parse.c
@@ -2040,6 +2040,7 @@ void list_models()
int set_conf(RIG *my_rig, char *conf_parms)
{
char *p, *n;
+ int token;
p = conf_parms;
@@ -2063,12 +2064,20 @@ int set_conf(RIG *my_rig, char *conf_parms)
*n++ = '\0';
}
+ token = rig_token_lookup(my_rig, p);
+ if (token != 0)
+ {
ret = rig_set_conf(my_rig, rig_token_lookup(my_rig, p), q);
if (ret != RIG_OK)
{
return (ret);
}
+ }
+ else
+ {
+ rig_debug(RIG_DEBUG_WARN, "%s: invalid token %s for this rig\n", __func__, p);
+ }
p = n;
}
commit c02370d27981c66c89be187965922f4bfae59d71
Author: Mike Black W9MDB <mdb...@ya...>
Date: Tue Jan 17 09:19:39 2023 -0600
Allow rigctld to continue when an invalid set_conf parameter is used
diff --git a/src/conf.c b/src/conf.c
index a2e5898d..0b9e4f47 100644
--- a/src/conf.c
+++ b/src/conf.c
@@ -842,6 +842,8 @@ static int frontend_get_conf2(RIG *rig, token_t token, char *val, int val_len)
case TOK_HANDSHAKE:
if (rs->rigport.type.rig != RIG_PORT_SERIAL)
{
+ rig_debug(RIG_DEBUG_ERR, "%s: getting handshake is invalid for non-serial port rig type\n",
+ __func__);
return -RIG_EINVAL;
}
@@ -1251,6 +1253,7 @@ token_t HAMLIB_API rig_token_lookup(RIG *rig, const char *name)
*/
int HAMLIB_API rig_set_conf(RIG *rig, token_t token, const char *val)
{
+ struct rig_state *rs = &rig->state;
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
if (!rig || !rig->caps)
@@ -1258,6 +1261,13 @@ int HAMLIB_API rig_set_conf(RIG *rig, token_t token, const char *val)
return -RIG_EINVAL;
}
+ // Some parameters can be ignored
+ if (token == TOK_HANDSHAKE && (rs->rigport.type.rig != RIG_PORT_SERIAL))
+ {
+ rig_debug(RIG_DEBUG_WARN, "%s: handshake is not valid for non-serial port rig\n", __func__);
+ return RIG_OK; // this allows rigctld to continue and just print a warning instead of error
+ }
+
if (rig_need_debug(RIG_DEBUG_VERBOSE))
{
const struct confparams *cfp;
commit 3f8da23bb62f851377d474b1ab874833207aa73c
Author: Mike Black W9MDB <mdb...@ya...>
Date: Tue Jan 17 08:50:47 2023 -0600
Improved set_conf error when serial_handshake is invalid
diff --git a/src/conf.c b/src/conf.c
index f0612783..a2e5898d 100644
--- a/src/conf.c
+++ b/src/conf.c
@@ -369,6 +369,8 @@ static int frontend_set_conf(RIG *rig, token_t token, const char *val)
case TOK_HANDSHAKE:
if (rs->rigport.type.rig != RIG_PORT_SERIAL)
{
+ rig_debug(RIG_DEBUG_ERR, "%s: setting handshake is invalid for non-serial port rig type\n",
+ __func__);
return -RIG_EINVAL;
}
commit cb1c98fa857f735f7f18f964948e320eefb63b20
Author: Mike Black W9MDB <mdb...@ya...>
Date: Mon Jan 16 09:24:00 2023 -0600
Fix xdgpath in settings.c
diff --git a/src/settings.c b/src/settings.c
index 33c24b76..f11cc940 100644
--- a/src/settings.c
+++ b/src/settings.c
@@ -1029,7 +1029,7 @@ HAMLIB_EXPORT(int) rig_settings_get_path(char *path, int pathlen)
if (xdgpath)
{
- snprintf(path, pathlen - 1, "%s/%s/%s", xdgpath, cwd, HAMLIB_SETTINGS_FILE);
+ snprintf(path, pathlen - 1, "%s/%s", xdgpath, HAMLIB_SETTINGS_FILE);
}
else if (home && access(path, F_OK) != -1)
{
commit 0ad5a4b7425f5a1c73ef89300920b3f4231a54a9
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sun Jan 15 22:22:14 2023 -0600
Attempt to allow PS; query for Yaeus rigs when powered off
https://github.com/Hamlib/Hamlib/issues/1220
diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c
index 65f8b9f4..39d94072 100644
--- a/rigs/yaesu/newcat.c
+++ b/rigs/yaesu/newcat.c
@@ -3602,6 +3602,7 @@ int newcat_set_powerstat(RIG *rig, powerstat_t status)
int newcat_get_powerstat(RIG *rig, powerstat_t *status)
{
struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
+ struct rig_state *state = &rig->state;
int err;
char ps;
char command[] = "PS";
@@ -3615,6 +3616,11 @@ int newcat_get_powerstat(RIG *rig, powerstat_t *status)
RETURNFUNC(-RIG_ENAVAIL);
}
+ // when not powered on need a dummy byte to wake it up
+ // then sleep from 1 to 2 seconds so we'll do 1.5 secs
+ write_block(&state->rigport, (unsigned char *) "PS;", 3);
+ hl_usleep(1200000);
+
SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "%s%c", command, cat_term);
/* Get Power status */
commit c3ff7e134fd18a6fbf0005002fd81317e584758b
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sun Jan 15 12:41:01 2023 -0600
Add TS-2000 to has_ps exceptions
https://github.com/Hamlib/Hamlib/issues/1213
diff --git a/NEWS b/NEWS
index 9a533279..536a8033 100644
--- a/NEWS
+++ b/NEWS
@@ -25,6 +25,7 @@ Version 4.6
* Fix FTDX3000 rig split
Version 4.5.5
+ * Add TS2000 to has_ps exception
* Add FT991 to 60M exception
* Fix get_powerstat bad call in rigctl_parse.c
* Really fix CM108 ptt_bitnum usage
diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c
index fe41cdbf..1abad7a1 100644
--- a/rigs/kenwood/kenwood.c
+++ b/rigs/kenwood/kenwood.c
@@ -771,6 +771,7 @@ int kenwood_init(RIG *rig)
if (rig->caps->rig_model == RIG_MODEL_TS450S
|| rig->caps->rig_model == RIG_MODEL_TS50
|| rig->caps->rig_model == RIG_MODEL_TS140S
+ || rig->caps->rig_model == RIG_MODEL_TS2000
|| rig->caps->rig_model == RIG_MODEL_TS440)
{
priv->has_ps = 0;
diff --git a/rigs/kenwood/kenwood.h b/rigs/kenwood/kenwood.h
index 69106804..d0c077a0 100644
--- a/rigs/kenwood/kenwood.h
+++ b/rigs/kenwood/kenwood.h
@@ -29,7 +29,7 @@
#include "misc.h"
#include "idx_builtin.h"
-#define BACKEND_VER "20230109"
+#define BACKEND_VER "20230115"
#define EOM_KEN ';'
#define EOM_TH '\r'
commit e681185b61f466350e194376a8fa5e19797c7233
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sun Jan 15 10:18:44 2023 -0600
Update NEWS
diff --git a/NEWS b/NEWS
index e05a2746..9a533279 100644
--- a/NEWS
+++ b/NEWS
@@ -25,6 +25,7 @@ Version 4.6
* Fix FTDX3000 rig split
Version 4.5.5
+ * Add FT991 to 60M exception
* Fix get_powerstat bad call in rigctl_parse.c
* Really fix CM108 ptt_bitnum usage
* Fix Elecraft power2mW precision/accuracy
commit 77ce6b6dc39ba90cc12d1253af0de4f5ec7abb81
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sun Jan 15 10:17:54 2023 -0600
Add FT991 to 60M exception
diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c
index 703b7fb6..65f8b9f4 100644
--- a/rigs/yaesu/newcat.c
+++ b/rigs/yaesu/newcat.c
@@ -824,6 +824,9 @@ int newcat_60m_exception(RIG *rig, freq_t freq, mode_t mode)
return -RIG_EINVAL;
}
+ // some rigs need to skip freq/mode settings as 60M only operates in memory mode
+ if (is_ft991) { return 1; }
+
if (!is_ftdx10 && !is_ft710 && !is_ftdx101d && !is_ftdx101mp) { return 0; }
rig_debug(RIG_DEBUG_VERBOSE, "%s: 60M exception ignoring freq/mode commands\n",
diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h
index 5202dcfd..db1d64c4 100644
--- a/rigs/yaesu/newcat.h
+++ b/rigs/yaesu/newcat.h
@@ -50,7 +50,7 @@
typedef char ncboolean;
/* shared function version */
-#define NEWCAT_VER "20230109"
+#define NEWCAT_VER "20230115"
/* Hopefully large enough for future use, 128 chars plus '\0' */
#define NEWCAT_DATA_LEN 129
commit 29a80fb496696fb40a93e022987371da5c1d68db
Author: Mike Black W9MDB <mdb...@ya...>
Date: Fri Jan 13 17:30:55 2023 -0600
Fix get_powerstat call when get_powerstat is not defined
https://github.com/Hamlib/Hamlib/issues/1217
diff --git a/NEWS b/NEWS
index 996d795c..e05a2746 100644
--- a/NEWS
+++ b/NEWS
@@ -25,6 +25,7 @@ Version 4.6
* Fix FTDX3000 rig split
Version 4.5.5
+ * Fix get_powerstat bad call in rigctl_parse.c
* Really fix CM108 ptt_bitnum usage
* Fix Elecraft power2mW precision/accuracy
* Fix power on/off/on for Icom rigs with rigctld power_on=0
diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c
index c1aeb838..c1c0dc8a 100644
--- a/tests/rigctl_parse.c
+++ b/tests/rigctl_parse.c
@@ -1731,7 +1731,7 @@ readline_repeat:
else
{
- if (my_rig->caps->set_powerstat && (rig_powerstat == RIG_POWER_OFF
+ if (my_rig->caps->get_powerstat && (rig_powerstat == RIG_POWER_OFF
|| rig_powerstat == RIG_POWER_STANDBY))
{
// Update power status
commit 9c48ec785c69442892a8acb3257c308fb9611310
Author: Mike Black W9MDB <mdb...@ya...>
Date: Thu Jan 12 11:23:11 2023 -0600
Improve serial port timeout when permission proble or does not exist
https://github.com/Hamlib/Hamlib/issues/1216
diff --git a/src/serial.c b/src/serial.c
index e22df68b..05d72c22 100644
--- a/src/serial.c
+++ b/src/serial.c
@@ -231,7 +231,7 @@ int HAMLIB_API serial_open(hamlib_port_t *rp)
fd = OPEN(rp->pathname, O_RDWR | O_NOCTTY | O_NDELAY);
}
}
- while (++i <= 4 && fd == -1);
+ while (++i <= 4 && fd == -1 && errno != ENOENT && errno != EPERM);
if (fd == -1)
{
commit e4471b9ece77601d3a5af8740dbc85caa847c323
Author: Mike Black W9MDB <mdb...@ya...>
Date: Tue Jan 10 23:07:53 2023 -0600
Fix BSD build include path order
https://github.com/Hamlib/Hamlib/issues/1208
diff --git a/configure.ac b/configure.ac
index fcaffc79..0af90a70 100644
--- a/configure.ac
+++ b/configure.ac
@@ -273,7 +273,7 @@ dnl The host_os variable is set by the AC_CANONICAL_HOST macro above.
AM_CONDITIONAL([VERSIONDLL], false)
AS_CASE(["$host_os"],
[freebsd*], [
- AM_CPPFLAGS="-I/usr/local/include ${AM_CPPFLAGS}"
+ AM_CPPFLAGS="${AM_CPPFLAGS} -I/usr/local/include"
AM_LDFLAGS="${AM_LDFLAGS} -L/usr/local/lib"
AC_SUBST([AM_LDFLAGS])],
commit 37b29012934ba57d527535d84b86ea1460ff409e
Merge: dc131cba 51f9cbe4
Author: Michael Black <mdb...@ya...>
Date: Tue Jan 10 15:21:03 2023 -0600
Merge pull request #1215 from fillods/F8CFE/celestron_status
Update status of celestron to Stable
commit 51f9cbe4575ecb82e5ff34447d44ea9e6624ac6d
Author: Stephane Fillod <fi...@us...>
Date: Tue Jan 10 20:41:07 2023 +0100
Update status of celestron to Stable
Tested-by: Eric K0JEG
Tested-by: Daniel DL7NDR <04...@ma...>
Tested-by: Андрей Родионов <der...@gm...>
diff --git a/rotators/celestron/celestron.c b/rotators/celestron/celestron.c
index 87d98685..39baebe5 100644
--- a/rotators/celestron/celestron.c
+++ b/rotators/celestron/celestron.c
@@ -228,7 +228,7 @@ const struct rot_caps nexstar_rot_caps =
.mfg_name = "Celestron",
.version = "20220109.0",
.copyright = "LGPL",
- .status = RIG_STATUS_BETA,
+ .status = RIG_STATUS_STABLE,
.rot_type = ROT_TYPE_AZEL,
.port_type = RIG_PORT_SERIAL,
.serial_rate_min = 9600,
commit dc131cba7fc76ee0e9bea1dd123b2e6ac6a681d3
Author: Mike Black W9MDB <mdb...@ya...>
Date: Tue Jan 10 08:46:10 2023 -0600
Fix set_powerstat on/off/on for Icom rigs using rigctld power_on=0
https://github.com/Hamlib/Hamlib/issues/1212
diff --git a/NEWS b/NEWS
index 9c1c8353..996d795c 100644
--- a/NEWS
+++ b/NEWS
@@ -27,6 +27,7 @@ Version 4.6
Version 4.5.5
* Really fix CM108 ptt_bitnum usage
* Fix Elecraft power2mW precision/accuracy
+ * Fix power on/off/on for Icom rigs with rigctld power_on=0
Version 4.5.4
* 2023-XX-XX
diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c
index d912ad97..feaf733f 100644
--- a/rigs/icom/icom.c
+++ b/rigs/icom/icom.c
@@ -7977,11 +7977,6 @@ int icom_set_powerstat(RIG *rig, powerstat_t status)
memset(fe_buf, 0xfe, fe_max);
// sending more than enough 0xfe's to wake up the rs232
write_block(&rs->rigport, fe_buf, fe_max);
- // close and re-open the rig
- // on linux the USB gets reset during power on
- rig_close(rig);
- sleep(1); // let serial bus idle for a while
- rig_open(rig);
// we'll try 0x18 0x01 now -- should work on STBY rigs too
pwr_sc = S_PWR_ON;
@@ -8043,6 +8038,12 @@ int icom_set_powerstat(RIG *rig, powerstat_t status)
{
rig_debug(RIG_DEBUG_TRACE, "%s: Wait failed for get_powerstat\n",
__func__);
+ // close and re-open the rig
+ // on linux the USB gets reset during power on
+ rig_close(rig);
+ sleep(1);
+ rig_open(rig);
+
retval = -RIG_ETIMEOUT;
}
diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h
index 3f4c3c18..a9ba4fe9 100644
--- a/rigs/icom/icom.h
+++ b/rigs/icom/icom.h
@@ -31,7 +31,7 @@
#include <sys/time.h>
#endif
-#define BACKEND_VER "20230109"
+#define BACKEND_VER "20230110"
#define ICOM_IS_ID31 rig_is_model(rig, RIG_MODEL_ID31)
#define ICOM_IS_ID51 rig_is_model(rig, RIG_MODEL_ID51)
commit 00dce998aebfd9f4b9addd3830eb4b9026e1d1ce
Author: Mike Black W9MDB <mdb...@ya...>
Date: Mon Jan 9 23:26:15 2023 -0600
Fix Elecraft power2mW precision/accuracy
Should fix any others too
https://github.com/Hamlib/Hamlib/issues/1205
diff --git a/NEWS b/NEWS
index a8dd99d0..9c1c8353 100644
--- a/NEWS
+++ b/NEWS
@@ -26,6 +26,7 @@ Version 4.6
Version 4.5.5
* Really fix CM108 ptt_bitnum usage
+ * Fix Elecraft power2mW precision/accuracy
Version 4.5.4
* 2023-XX-XX
diff --git a/rigs/kenwood/k3.c b/rigs/kenwood/k3.c
index a9b0a1f6..336b30bc 100644
--- a/rigs/kenwood/k3.c
+++ b/rigs/kenwood/k3.c
@@ -343,7 +343,7 @@ const struct rig_caps k3s_caps =
RIG_MODEL(RIG_MODEL_K3S),
.model_name = "K3S",
.mfg_name = "Elecraft",
- .version = BACKEND_VER ".19",
+ .version = BACKEND_VER ".20",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
@@ -495,7 +495,7 @@ const struct rig_caps k4_caps =
RIG_MODEL(RIG_MODEL_K4),
.model_name = "K4",
.mfg_name = "Elecraft",
- .version = BACKEND_VER ".25",
+ .version = BACKEND_VER ".26",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
@@ -646,7 +646,7 @@ const struct rig_caps kx3_caps =
RIG_MODEL(RIG_MODEL_KX3),
.model_name = "KX3",
.mfg_name = "Elecraft",
- .version = BACKEND_VER ".18",
+ .version = BACKEND_VER ".19",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
@@ -797,7 +797,7 @@ const struct rig_caps kx2_caps =
RIG_MODEL(RIG_MODEL_KX2),
.model_name = "KX2",
.mfg_name = "Elecraft",
- .version = BACKEND_VER ".17",
+ .version = BACKEND_VER ".18",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
@@ -1839,7 +1839,9 @@ int k3_power2mW(RIG *rig,
freq_t freq,
rmode_t mode)
{
- *mwpower = power * k3_get_maxpower(rig) * 1000;
+ char buf[32];
+ snprintf(buf, sizeof(buf), "%.0f", power * k3_get_maxpower(rig) * 1000);
+ *mwpower = atoi(buf);
return RIG_OK;
}
diff --git a/simulators/simelecraft.c b/simulators/simelecraft.c
index ea82a0a3..8dc58b6e 100644
--- a/simulators/simelecraft.c
+++ b/simulators/simelecraft.c
@@ -281,7 +281,7 @@ int main(int argc, char *argv[])
}
else if (strncmp(buf, "PC;", 3) == 0)
{
- SNPRINTF(buf, sizeof(buf), "PC0150;");
+ SNPRINTF(buf, sizeof(buf), "PC0980;");
n = write(fd, buf, strlen(buf));
}
else if (strlen(buf) > 0)
diff --git a/src/rig.c b/src/rig.c
index 01e36480..8c14aa3e 100644
--- a/src/rig.c
+++ b/src/rig.c
@@ -5845,6 +5845,7 @@ int HAMLIB_API rig_power2mW(RIG *rig,
rmode_t mode)
{
const freq_range_t *txrange;
+ char buf[32];
ENTERFUNC;
@@ -5880,7 +5881,10 @@ int HAMLIB_API rig_power2mW(RIG *rig,
RETURNFUNC(-RIG_EINVAL);
}
- *mwpower = (unsigned int)(power * txrange->high_power);
+
+ snprintf(buf, sizeof(buf), "%.0f", power * txrange->high_power);
+ *mwpower = atoi(buf);
+ //*mwpower = (unsigned int)(power * txrange->high_power);
RETURNFUNC(RIG_OK);
}
commit 5ebde1ca34e2b44b5b1c0d5e4a38ce091639b19e
Author: Mike Black W9MDB <mdb...@ya...>
Date: Mon Jan 9 22:53:01 2023 -0600
Really fix CM108 ptt_bitnum usage
https://github.com/Hamlib/Hamlib/issues/1203
diff --git a/NEWS b/NEWS
index b2909aaa..a8dd99d0 100644
--- a/NEWS
+++ b/NEWS
@@ -24,6 +24,9 @@ Version 4.6
* Add FLIR PTU-D48, E46, D100, D300 rotors
* Fix FTDX3000 rig split
+Version 4.5.5
+ * Really fix CM108 ptt_bitnum usage
+
Version 4.5.4
* 2023-XX-XX
* Fix CM108 ptt setting for non-default usage
diff --git a/src/rig.c b/src/rig.c
index d4cff0ae..01e36480 100644
--- a/src/rig.c
+++ b/src/rig.c
@@ -1114,8 +1114,12 @@ int HAMLIB_API rig_open(RIG *rig)
rs->pttport.fd = cm108_open(&rs->pttport);
strncpy(rs->rigport.pathname, DEFAULT_CM108_PORT, HAMLIB_FILPATHLEN);
- rs->rigport.parm.cm108.ptt_bitnum = DEFAULT_CM108_PTT_BITNUM;
- rs->pttport.parm.cm108.ptt_bitnum = DEFAULT_CM108_PTT_BITNUM;
+
+ if (rs->rigport.parm.cm108.ptt_bitnum == 0)
+ {
+ rs->rigport.parm.cm108.ptt_bitnum = DEFAULT_CM108_PTT_BITNUM;
+ rs->pttport.parm.cm108.ptt_bitnum = DEFAULT_CM108_PTT_BITNUM;
+ }
if (rs->pttport.fd < 0)
{
@@ -6019,6 +6023,7 @@ int HAMLIB_API rig_set_powerstat(RIG *rig, powerstat_t status)
HAMLIB_TRACE;
retcode = rig->caps->set_powerstat(rig, status);
rig_flush(&rig->state.rigport); // if anything is queued up flush it
+ rig->state.auto_power_on = 1; // ensure we auto power on in the future
RETURNFUNC(retcode);
}
-----------------------------------------------------------------------
Summary of changes:
NEWS | 10 ++++++++++
configure.ac | 2 +-
rigs/dummy/netrigctl.c | 4 ++--
rigs/icom/icom.c | 11 ++++++-----
rigs/icom/icom.h | 2 +-
rigs/kenwood/k3.c | 12 +++++++-----
rigs/kenwood/kenwood.c | 1 +
rigs/kenwood/kenwood.h | 2 +-
rigs/yaesu/ftdx10.c | 4 ++--
rigs/yaesu/newcat.c | 9 +++++++++
rigs/yaesu/newcat.h | 2 +-
rotators/celestron/celestron.c | 2 +-
simulators/Makefile.am | 2 +-
simulators/simelecraft.c | 2 +-
src/conf.c | 12 ++++++++++++
src/rig.c | 15 ++++++++++++---
src/serial.c | 2 +-
src/settings.c | 2 +-
src/sprintflst.c | 2 +-
tests/hamlibmodels.c | 38 ++++++++++++++++++++++++++++++++++++++
tests/rigctl_parse.c | 11 ++++++++++-
21 files changed, 119 insertions(+), 28 deletions(-)
create mode 100644 tests/hamlibmodels.c
hooks/post-receive
--
Hamlib -- Ham radio control libraries
|
|
From: n0nb <n0...@us...> - 2023-01-10 02:23:13
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Hamlib -- Ham radio control libraries".
The annotated tag, 4.5.4 has been created
at c8cd1be4c5e8be392aad23c6464ca31f8476d718 (tag)
tagging 921cc52eb95cb67cada35a8d68d7f228a50a4479 (commit)
replaces 4.5.2
tagged by Nate Bargmann
on Mon Jan 9 20:22:26 2023 -0600
- Log -----------------------------------------------------------------
Hamlib 4.5.4 release
-----BEGIN PGP SIGNATURE-----
iF0EABECAB0WIQSC1k9rDmfNQfaJu6b7LFEw1VqIGQUCY7zL+QAKCRD7LFEw1VqI
Ge0eAKCfbaRoFnuNQkzENkyXU/ixrPRpCACgl4Y2BwsxF06oiet7vhW6rRZBWjU=
=GkCj
-----END PGP SIGNATURE-----
Mike Black W9MDB (55):
Fix grep error on mingw build
Update NEWS
Change FTDX5000 write_delay to zero -- was causing microham to return ?; to every command https://github.com/Hamlib/Hamlib/issues/1080
Update NEWS
FT5000 cannot use RIG_PTT_ON_DATA/MIC menu 103 control and is now set for rear automatically too https://github.com/Hamlib/Hamlib/issues/1193
Make sure FT5000 is in data mode for PTT request -- returns to MIC mode on shutdown https://github.com/Hamlib/Hamlib/issues/1193
Make FT5000 EX1031;TX1; command two commands https://github.com/Hamlib/Hamlib/issues/1193
FTDX5000 will now remember startup front/rear setting and restore it Will also allow front/rear selection in WSJT-X/JTDX https://github.com/Hamlib/Hamlib/issues/1195
astyle newcat.c
Allow for 36 and 37 byte IF lengths for ic10.c This should fix QRP QRDX buggy IF message -- hopefully the fix theirs to send 33 bytes. https://github.com/Hamlib/Hamlib/issues/1196#issuecomment-1367473810
Update NEWS
Add QRPLabs QCX/QDX for better behavior/capability from ts480 entry
Update NEWS
Remove set_rts and set_dtr low from serial.c This was causing hardward flow control to fail on Linux and MacOS https://github.com/Hamlib/Hamlib/issues/1198 https://github.com/Hamlib/Hamlib/issues/1199
Update NEWS
Remove get_powerstat from Icom ID-5100 -- does not have the ability to get power status https://github.com/Hamlib/Hamlib/issues/1201
Update NEWS
Fix ID5100 ID4100 ID31 ID51 get/set freq Remove get_powerstat from ID4100 ID31 ID51 as it they are not capable Add new rig_is_model function to help with Icom rig identification checks https://github.com/Hamlib/Hamlib/issues/1202 https://github.com/Hamlib/Hamlib/issues/1200
Update NEWS
Remove rigctltcp from tests/Makefile.am
Convert Icom 3-byte frequency to Hz from KHz https://github.com/Hamlib/Hamlib/issues/1200
Another attempt to fix get/set freq for ID5100 ID4100 ID31 ID51 https://github.com/Hamlib/Hamlib/issues/1202 https://github.com/Hamlib/Hamlib/issues/1200
Fix units for get freq for ID5100 ID4100 ID31 ID51 https://github.com/Hamlib/Hamlib/issues/1200
Fix ID5100 get/set_mode Remove ID rigs freq_len check as civ_731 setting should cover it https://github.com/Hamlib/Hamlib/issues/1204
Add PKTUSB to ft1000mp rigs
Remove XONXOFF flow control from ID5100 and ID4100 -- Firmware E8 is not working correclty that flow control https://github.com/Hamlib/Hamlib/issues/1202
Make 3-byte Icom ID rigs show error message
Get dummy rig to work with grig by disallowing empty "u" calls
Update ID5100 and ID4100 Promote ID5100 to stable https://github.com/Hamlib/Hamlib/issues/1204 https://github.com/Hamlib/Hamlib/issues/1202 https://github.com/Hamlib/Hamlib/issues/1202
Allow rigctld to start with autopower_on=0 and avoid timeouts at startup
Update NEWS
Fix rig_getpower2mW so it checks all range lists https://github.com/Hamlib/Hamlib/issues/1205
Update NEWS
Fix rigctld agc level readings -- allow for rig backedn to specify "RIG_AGC_NONE" now for clarity if desired https://github.com/Hamlib/Hamlib/issues/1155
Update man pages to clarify upper/lower case for set/get commands
Remove unnecessary check from netrigctl.c https://github.com/Hamlib/Hamlib/issues/1155
Remove EX039 check from FTDX3000/3000DM https://github.com/Hamlib/Hamlib/issues/1206
Fix elecraft power2mW by scaling power to either 15W or 100W based on KPA availability We are ignoring the tx_range values for the Kn series https://github.com/Hamlib/Hamlib/issues/1205
Force K22 mode on Elecraft rigs to get PC power level in .1W intervals for low power operations https://github.com/Hamlib/Hamlib/issues/1205
Fix FTDX3000 EX039 error https://github.com/Hamlib/Hamlib/issues/1206
Update NEWS
Update NEWS
Update timing in nrd535.c based on testing thanks to markjfine
Add FT-710 to 60M exception in newcat.c to allow some ability to work with WSJT-X https://github.com/Hamlib/Hamlib/issues/1211
Ensure 60M exception for FT710 is only for US language setting https://github.com/Hamlib/Hamlib/issues/1211
Close rig on set_powerstat 0 -- Linux was unable to reconnect to IC-7300 https://github.com/Hamlib/Hamlib/issues/1212
For Icom rigs close and reopen rig after set_powerstat=1 -- Linux resets the usb device https://github.com/Hamlib/Hamlib/issues/1212
Fix get_powerstat status return to always show POWER_ON for kenwood non-PS rigs https://github.com/Hamlib/Hamlib/issues/1213
Fix FT-710, FTDX10, FTDX101D/MP 60M operations https://github.com/Hamlib/Hamlib/issues/1211
Update NEWS
Fix CM108 ptt setting https://github.com/Hamlib/Hamlib/issues/1203
Update NEWS https://github.com/Hamlib/Hamlib/issues/1203
Add simjupiter
Revert "Close rig on set_powerstat 0 -- Linux was unable to reconnect to IC-7300"
Fix Icom poweron behavior https://github.com/Hamlib/Hamlib/issues/1212
Nate Bargmann (2):
Bump to version 4.5.4
Set release date in NEWS
-----------------------------------------------------------------------
hooks/post-receive
--
Hamlib -- Ham radio control libraries
|
|
From: n0nb <n0...@us...> - 2023-01-10 01:32:40
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Hamlib -- Ham radio control libraries".
The branch, Hamlib-4.5.4 has been created
at 921cc52eb95cb67cada35a8d68d7f228a50a4479 (commit)
- Log -----------------------------------------------------------------
commit 921cc52eb95cb67cada35a8d68d7f228a50a4479
Author: Nate Bargmann <n0...@n0...>
Date: Mon Jan 9 19:31:41 2023 -0600
Set release date in NEWS
diff --git a/NEWS b/NEWS
index b2909aaa..3c18ed21 100644
--- a/NEWS
+++ b/NEWS
@@ -25,7 +25,7 @@ Version 4.6
* Fix FTDX3000 rig split
Version 4.5.4
- * 2023-XX-XX
+ * 2023-01-10
* Fix CM108 ptt setting for non-default usage
* Fix power on/off for Icom rigs with rigctld power_on=0
* Fix get_powerstat status return for non-PS kenwood rigs
commit 1f56a1104e494557be3592f574e93d5892c2645a
Author: Nate Bargmann <n0...@n0...>
Date: Mon Jan 9 19:10:32 2023 -0600
Bump to version 4.5.4
diff --git a/configure.ac b/configure.ac
index 7f2a7007..ff6db5d6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -14,7 +14,7 @@ dnl Please do not use '-' in the version number, as package managers will fail,
dnl however, the use of '~' should be fine as apt (others?) will treat
dnl it as an earlier version than the actual release. TNX KA6MAL
dnl PACKAGE_NAME + " " + PACKAGE_VERSION must not exceed 20 chars!
-AC_INIT([Hamlib],[4.5.2],[ham...@li...],[hamlib],[http://www.hamlib.org])
+AC_INIT([Hamlib],[4.5.4],[ham...@li...],[hamlib],[http://www.hamlib.org])
AC_CONFIG_SRCDIR([include/hamlib/rig.h])
AC_CONFIG_MACRO_DIR([macros])
commit 59131c4496a0b07ff78a35ede5c8ec554fe1ad7b
Author: Mike Black W9MDB <mdb...@ya...>
Date: Mon Jan 9 12:34:22 2023 -0600
Fix Icom poweron behavior
https://github.com/Hamlib/Hamlib/issues/1212
diff --git a/NEWS b/NEWS
index 369326eb..b2909aaa 100644
--- a/NEWS
+++ b/NEWS
@@ -27,6 +27,7 @@ Version 4.6
Version 4.5.4
* 2023-XX-XX
* Fix CM108 ptt setting for non-default usage
+ * Fix power on/off for Icom rigs with rigctld power_on=0
* Fix get_powerstat status return for non-PS kenwood rigs
* Fix FT-710, FTDX10, FTDX101D/MP usage on 60M
* Fix timing on NRD-535D
diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c
index 2b101cc1..d912ad97 100644
--- a/rigs/icom/icom.c
+++ b/rigs/icom/icom.c
@@ -7979,8 +7979,8 @@ int icom_set_powerstat(RIG *rig, powerstat_t status)
write_block(&rs->rigport, fe_buf, fe_max);
// close and re-open the rig
// on linux the USB gets reset during power on
- sleep(1); // let serial bus idle for a while
rig_close(rig);
+ sleep(1); // let serial bus idle for a while
rig_open(rig);
// we'll try 0x18 0x01 now -- should work on STBY rigs too
commit 427237389098a9e608532ae95c686324ad9deb78
Author: Mike Black W9MDB <mdb...@ya...>
Date: Mon Jan 9 12:21:33 2023 -0600
Revert "Close rig on set_powerstat 0 -- Linux was unable to reconnect to IC-7300"
This reverts commit 93e3aec58863b87b41dd68fcef4f11f4838f418a.
diff --git a/NEWS b/NEWS
index a430b0f4..369326eb 100644
--- a/NEWS
+++ b/NEWS
@@ -28,7 +28,6 @@ Version 4.5.4
* 2023-XX-XX
* Fix CM108 ptt setting for non-default usage
* Fix get_powerstat status return for non-PS kenwood rigs
- * Fix set_powerstat 0 to reopen with IC-7300 (and others?) on Linux
* Fix FT-710, FTDX10, FTDX101D/MP usage on 60M
* Fix timing on NRD-535D
* Fix AGC levels with rigctld
diff --git a/src/rig.c b/src/rig.c
index fec3d8bc..d7462153 100644
--- a/src/rig.c
+++ b/src/rig.c
@@ -6015,9 +6015,6 @@ int HAMLIB_API rig_set_powerstat(RIG *rig, powerstat_t status)
HAMLIB_TRACE;
retcode = rig->caps->set_powerstat(rig, status);
rig_flush(&rig->state.rigport); // if anything is queued up flush it
-
- if (status == RIG_POWER_OFF) { rig_close(rig); }
-
RETURNFUNC(retcode);
}
commit 6db1e36b4650e3d3aee7a1c14b594e16430cc5d0
Author: Mike Black W9MDB <mdb...@ya...>
Date: Mon Jan 9 11:46:49 2023 -0600
Add simjupiter
diff --git a/simulators/simjupiter.c b/simulators/simjupiter.c
new file mode 100644
index 00000000..6d4849d4
--- /dev/null
+++ b/simulators/simjupiter.c
@@ -0,0 +1,117 @@
+// can run this using rigctl/rigctld and socat pty devices
+// gcc -o simft897 simft897.c
+#define _XOPEN_SOURCE 600
+#include <stdio.h>
+#include <stdlib.h>
+#include <fcntl.h>
+#include <string.h>
+#include <unistd.h>
+#include "../include/hamlib/rig.h"
+
+#define BUFSIZE 256
+
+float freqA = 14074000;
+float freqB = 14074500;
+char tx_vfo = '0';
+char rx_vfo = '0';
+char modeA = '1';
+char modeB = '1';
+int width_main = 500;
+int width_sub = 700;
+
+
+int
+getmyline(int fd, unsigned char *buf)
+{
+ unsigned char c;
+ int i = 0;
+ int n = 0;
+ memset(buf, 0, BUFSIZE);
+
+ while (i < 5 && read(fd, &c, 1) > 0)
+ {
+ buf[i++] = c;
+ n++;
+ }
+
+ printf("n=%d %02x %02x %02x %02x %02x\n", n, buf[0], buf[1], buf[2], buf[3],
+ buf[4]);
+ return n;
+}
+
+#if defined(WIN32) || defined(_WIN32)
+int openPort(char *comport) // doesn't matter for using pts devices
+{
+ int fd;
+ fd = open(comport, O_RDWR);
+
+ if (fd < 0)
+ {
+ perror(comport);
+ }
+
+ return fd;
+}
+
+#else
+int openPort(char *comport) // doesn't matter for using pts devices
+{
+ int fd = posix_openpt(O_RDWR);
+ char *name = ptsname(fd);
+
+ if (name == NULL)
+ {
+ perror("pstname");
+ return -1;
+ }
+
+ printf("name=%s\n", name);
+
+ if (fd == -1 || grantpt(fd) == -1 || unlockpt(fd) == -1)
+ {
+ perror("posix_openpt");
+ return -1;
+ }
+
+ return fd;
+}
+#endif
+
+
+
+int main(int argc, char *argv[])
+{
+ unsigned char buf[256];
+ unsigned char *pbuf;
+ int n;
+
+
+again:
+ int fd = openPort(argv[1]);
+
+ while (1)
+ {
+ int bytes = getmyline(fd, buf);
+
+ if (bytes == 0)
+ {
+ close(fd);
+ goto again;
+ }
+
+ if (bytes != 5)
+ {
+ printf("Not 5 bytes? bytes=%d\n", bytes);
+ }
+
+ switch (buf[0])
+ {
+ case '?': printf("Query %c\n", buf[1]);break;
+ case '*': printf("Set %c\n", buf[1]);break;
+
+ default: printf("Unknown cmd=%02x\n", buf[4]);
+ }
+ }
+
+ return 0;
+}
commit 63f9ac46895f6c33968df5cfff4caf8c9edee690
Author: Mike Black W9MDB <mdb...@ya...>
Date: Mon Jan 9 11:24:34 2023 -0600
Update NEWS
https://github.com/Hamlib/Hamlib/issues/1203
diff --git a/NEWS b/NEWS
index 632ff66b..a430b0f4 100644
--- a/NEWS
+++ b/NEWS
@@ -26,6 +26,7 @@ Version 4.6
Version 4.5.4
* 2023-XX-XX
+ * Fix CM108 ptt setting for non-default usage
* Fix get_powerstat status return for non-PS kenwood rigs
* Fix set_powerstat 0 to reopen with IC-7300 (and others?) on Linux
* Fix FT-710, FTDX10, FTDX101D/MP usage on 60M
commit bfc6d19a4b29bedc6567c7ddcc506c099a2bf8ac
Author: Mike Black W9MDB <mdb...@ya...>
Date: Mon Jan 9 11:03:50 2023 -0600
Fix CM108 ptt setting
https://github.com/Hamlib/Hamlib/issues/1203
diff --git a/src/conf.c b/src/conf.c
index e2149692..9667351e 100644
--- a/src/conf.c
+++ b/src/conf.c
@@ -554,6 +554,7 @@ static int frontend_set_conf(RIG *rig, token_t token, const char *val)
}
rs->pttport.parm.cm108.ptt_bitnum = val_i;
+ rs->rigport.parm.cm108.ptt_bitnum = val_i;
rs->pttport_deprecated.parm.cm108.ptt_bitnum = val_i;
break;
diff --git a/src/rig.c b/src/rig.c
index 5b872eaa..fec3d8bc 100644
--- a/src/rig.c
+++ b/src/rig.c
@@ -586,8 +586,13 @@ RIG *HAMLIB_API rig_init(rig_model_t rig_model)
*/
case RIG_PORT_CM108:
strncpy(rs->rigport.pathname, DEFAULT_CM108_PORT, HAMLIB_FILPATHLEN);
- rs->rigport.parm.cm108.ptt_bitnum = DEFAULT_CM108_PTT_BITNUM;
- rs->pttport.parm.cm108.ptt_bitnum = DEFAULT_CM108_PTT_BITNUM;
+
+ if (rs->rigport.parm.cm108.ptt_bitnum == 0)
+ {
+ rs->rigport.parm.cm108.ptt_bitnum = DEFAULT_CM108_PTT_BITNUM;
+ rs->pttport.parm.cm108.ptt_bitnum = DEFAULT_CM108_PTT_BITNUM;
+ }
+
break;
case RIG_PORT_GPIO:
commit ccca746fa7f7ac3183a8290ec41371ffbe8d021f
Author: Mike Black W9MDB <mdb...@ya...>
Date: Mon Jan 9 10:44:27 2023 -0600
Update NEWS
diff --git a/NEWS b/NEWS
index ca819542..632ff66b 100644
--- a/NEWS
+++ b/NEWS
@@ -28,7 +28,7 @@ Version 4.5.4
* 2023-XX-XX
* Fix get_powerstat status return for non-PS kenwood rigs
* Fix set_powerstat 0 to reopen with IC-7300 (and others?) on Linux
- * Fix FT-710 usage on 60M
+ * Fix FT-710, FTDX10, FTDX101D/MP usage on 60M
* Fix timing on NRD-535D
* Fix AGC levels with rigctld
* Fix FTDX3000 EX039 error
commit 2570c273abf8605b84a860cb1a6e187db294772e
Author: Mike Black W9MDB <mdb...@ya...>
Date: Mon Jan 9 10:42:57 2023 -0600
Fix FT-710, FTDX10, FTDX101D/MP 60M operations
https://github.com/Hamlib/Hamlib/issues/1211
diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c
index a3d5045d..703b7fb6 100644
--- a/rigs/yaesu/newcat.c
+++ b/rigs/yaesu/newcat.c
@@ -799,43 +799,88 @@ int newcat_get_conf2(RIG *rig, token_t token, char *val, int val_len)
RETURNFUNC(ret);
}
+static int freq_60m[] = { 5332000, 5348000, 5358500, 5373000, 5405000 };
+
/* returns 0 if no exeption or 1 if rig needs special handling */
-int newcat_60m_exception(RIG *rig, freq_t freq)
+int newcat_60m_exception(RIG *rig, freq_t freq, mode_t mode)
{
struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
int err;
- int is_exception = 0;
+ int channel = -1;
+ int i;
+ rmode_t tmode;
+ pbwidth_t twidth;
if (!(freq > 5.2 && freq < 5.5)) // we're not on 60M
{
return 0;
}
- if (is_ftdx10) { is_exception = 1; }
- else if (is_ft710)
+ if (mode != RIG_MODE_CW && mode != RIG_MODE_USB && mode != RIG_MODE_PKTUSB
+ && mode != RIG_MODE_RTTYR)
+ {
+ rig_debug(RIG_DEBUG_ERR,
+ "%s: only USB, PKTUSB, RTTYR, and CW allowed for 60M operations\n", __func__);
+ return -RIG_EINVAL;
+ }
+
+ if (!is_ftdx10 && !is_ft710 && !is_ftdx101d && !is_ftdx101mp) { return 0; }
+
+ rig_debug(RIG_DEBUG_VERBOSE, "%s: 60M exception ignoring freq/mode commands\n",
+ __func__);
+ // If US mode we need to use memory channels
+ SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "EX0301%c", cat_term);
+
+ if ((err = newcat_get_cmd(rig)) != RIG_OK)
{
- // If US mode we need to use memory channels
- SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "EX0301%c", cat_term);
+ RETURNFUNC2(err);
+ }
+
+ // 01 is the only exception so far -- others may be like UK and have full control too
+ if (strncmp(&priv->ret_data[6], "01", 2) != 0) { return 0; } // no exception
- if ((err = newcat_get_cmd(rig)) != RIG_OK)
+ // so now we should have a rig that has fixed memory channels 501-510 in USB/CW-U mode
+
+ // toggle vfo mode if we need to
+
+ rig_debug(RIG_DEBUG_VERBOSE, "%s: 60M exception ignoring freq/mode commands\n",
+ __func__);
+
+ rig_get_mode(rig, RIG_VFO_A, &tmode, &twidth);
+ if (tmode != RIG_VFO_MEM)
+ {
+ err = newcat_vfomem_toggle(rig);
+ if (err != RIG_OK)
{
- RETURNFUNC2(err);
+ rig_debug(RIG_DEBUG_ERR, "%s: Error toggling VFO_MEM\n", __func__);
+ return -err;
}
+ }
+ // find the nearest slot below what is requested
+ for (i = 0; i < 5; ++i)
+ {
+ if ((long)freq == freq_60m[i]) { channel = i; }
+ }
- // 01 is the only exception so far -- others may be like UK and have full control too
- if (strncmp(&priv->ret_data[6], "01", 2) != 0) { return 0; } // no exception
-
- is_exception = 1;
+ if (channel < 0)
+ {
+ rig_debug(RIG_DEBUG_ERR,
+ "%s: 60M allowed frequencies are 5.332, 5.348, 5.3585, 5.373,5.405, got %g\n",
+ __func__, freq / 1000);
+ return -RIG_EINVAL;
}
- if (is_exception)
+ if (mode == RIG_MODE_CW) { channel += 5; }
+
+ SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "MC%3d%c", channel + 501,
+ cat_term);
+
+ if ((err = newcat_set_cmd(rig)) != RIG_OK)
{
- rig_debug(RIG_DEBUG_VERBOSE, "%s: 60M exception ignoring freq/mode commands\n",
- __func__);
- return 1;
+ RETURNFUNC2(err);
}
- return 0;
+ return 1;
}
/*
@@ -854,10 +899,12 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
const struct rig_caps *caps;
struct newcat_priv_data *priv;
int special_60m = 0;
+ rmode_t tmode;
+ pbwidth_t twidth;
ENTERFUNC;
- if (newcat_60m_exception(rig, freq))
+ if (newcat_60m_exception(rig, freq, rig->state.cache.modeMainA))
{
// we don't try to set freq on 60m for some rigs since we must be in memory mode
// and we can't run split mode on 60M memory mode either
@@ -882,6 +929,13 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
priv = (struct newcat_priv_data *)rig->state.priv;
caps = rig->caps;
+ rig_get_mode(rig, RIG_VFO_A, &tmode, &twidth);
+ if (tmode == RIG_VFO_MEM)
+ {
+ // then we need to toggle back to VFO mode
+ newcat_vfomem_toggle(rig);
+ }
+
rig_debug(RIG_DEBUG_TRACE, "%s: passed vfo = %s\n", __func__, rig_strvfo(vfo));
// rig_debug(RIG_DEBUG_TRACE, "%s: translated vfo = %s\n", __func__, rig_strvfo(tvfo));
rig_debug(RIG_DEBUG_TRACE, "%s: passed freq = %"PRIfreq" Hz\n", __func__, freq);
@@ -1386,7 +1440,7 @@ int newcat_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
ENTERFUNC;
- if (newcat_60m_exception(rig, rig->state.cache.freqMainA)) { RETURNFUNC(RIG_OK); } // we don't set mode in this case
+ if (newcat_60m_exception(rig, rig->state.cache.freqMainA, mode)) { RETURNFUNC(RIG_OK); } // we don't set mode in this case
if (!newcat_valid_command(rig, "MD"))
{
diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h
index a0602bc0..5202dcfd 100644
--- a/rigs/yaesu/newcat.h
+++ b/rigs/yaesu/newcat.h
@@ -50,7 +50,7 @@
typedef char ncboolean;
/* shared function version */
-#define NEWCAT_VER "20230108"
+#define NEWCAT_VER "20230109"
/* Hopefully large enough for future use, 128 chars plus '\0' */
#define NEWCAT_DATA_LEN 129
commit eea990150204ee6f0ad2099ad436f9d25651ddb9
Author: Mike Black W9MDB <mdb...@ya...>
Date: Mon Jan 9 10:28:43 2023 -0600
Fix get_powerstat status return to always show POWER_ON for kenwood non-PS rigs
https://github.com/Hamlib/Hamlib/issues/1213
diff --git a/NEWS b/NEWS
index dec67ca5..ca819542 100644
--- a/NEWS
+++ b/NEWS
@@ -26,6 +26,7 @@ Version 4.6
Version 4.5.4
* 2023-XX-XX
+ * Fix get_powerstat status return for non-PS kenwood rigs
* Fix set_powerstat 0 to reopen with IC-7300 (and others?) on Linux
* Fix FT-710 usage on 60M
* Fix timing on NRD-535D
diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c
index 223adfae..fe41cdbf 100644
--- a/rigs/kenwood/kenwood.c
+++ b/rigs/kenwood/kenwood.c
@@ -4878,6 +4878,7 @@ int kenwood_get_powerstat(RIG *rig, powerstat_t *status)
if (!priv->has_ps)
{
+ *status = RIG_POWER_ON;
RETURNFUNC(RIG_OK); // fake the OK return for these rigs
}
diff --git a/rigs/kenwood/kenwood.h b/rigs/kenwood/kenwood.h
index 4787ae93..69106804 100644
--- a/rigs/kenwood/kenwood.h
+++ b/rigs/kenwood/kenwood.h
@@ -29,7 +29,7 @@
#include "misc.h"
#include "idx_builtin.h"
-#define BACKEND_VER "20221230"
+#define BACKEND_VER "20230109"
#define EOM_KEN ';'
#define EOM_TH '\r'
commit 5f9fc933f5f05070ca6310b5c26cda8f5a916463
Author: Mike Black W9MDB <mdb...@ya...>
Date: Mon Jan 9 09:50:25 2023 -0600
For Icom rigs close and reopen rig after set_powerstat=1 -- Linux resets the usb device
https://github.com/Hamlib/Hamlib/issues/1212
diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c
index e806c3cf..2b101cc1 100644
--- a/rigs/icom/icom.c
+++ b/rigs/icom/icom.c
@@ -7977,6 +7977,11 @@ int icom_set_powerstat(RIG *rig, powerstat_t status)
memset(fe_buf, 0xfe, fe_max);
// sending more than enough 0xfe's to wake up the rs232
write_block(&rs->rigport, fe_buf, fe_max);
+ // close and re-open the rig
+ // on linux the USB gets reset during power on
+ sleep(1); // let serial bus idle for a while
+ rig_close(rig);
+ rig_open(rig);
// we'll try 0x18 0x01 now -- should work on STBY rigs too
pwr_sc = S_PWR_ON;
diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h
index 254d89f9..3f4c3c18 100644
--- a/rigs/icom/icom.h
+++ b/rigs/icom/icom.h
@@ -31,7 +31,7 @@
#include <sys/time.h>
#endif
-#define BACKEND_VER "20230104"
+#define BACKEND_VER "20230109"
#define ICOM_IS_ID31 rig_is_model(rig, RIG_MODEL_ID31)
#define ICOM_IS_ID51 rig_is_model(rig, RIG_MODEL_ID51)
commit df2aa87a19b9d9dd9581a9f11f94f5ec444891d5
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sun Jan 8 16:48:35 2023 -0600
Close rig on set_powerstat 0 -- Linux was unable to reconnect to IC-7300
https://github.com/Hamlib/Hamlib/issues/1212
diff --git a/NEWS b/NEWS
index 6c17f323..dec67ca5 100644
--- a/NEWS
+++ b/NEWS
@@ -26,6 +26,7 @@ Version 4.6
Version 4.5.4
* 2023-XX-XX
+ * Fix set_powerstat 0 to reopen with IC-7300 (and others?) on Linux
* Fix FT-710 usage on 60M
* Fix timing on NRD-535D
* Fix AGC levels with rigctld
diff --git a/src/rig.c b/src/rig.c
index be9ca6d6..5b872eaa 100644
--- a/src/rig.c
+++ b/src/rig.c
@@ -6010,6 +6010,9 @@ int HAMLIB_API rig_set_powerstat(RIG *rig, powerstat_t status)
HAMLIB_TRACE;
retcode = rig->caps->set_powerstat(rig, status);
rig_flush(&rig->state.rigport); // if anything is queued up flush it
+
+ if (status == RIG_POWER_OFF) { rig_close(rig); }
+
RETURNFUNC(retcode);
}
commit 0fce421845b593ce59f9ca71fb069f7afae474fd
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sun Jan 8 10:28:34 2023 -0600
Ensure 60M exception for FT710 is only for US language setting
https://github.com/Hamlib/Hamlib/issues/1211
diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c
index 3a5bf33c..a3d5045d 100644
--- a/rigs/yaesu/newcat.c
+++ b/rigs/yaesu/newcat.c
@@ -799,22 +799,36 @@ int newcat_get_conf2(RIG *rig, token_t token, char *val, int val_len)
RETURNFUNC(ret);
}
+/* returns 0 if no exeption or 1 if rig needs special handling */
+int newcat_60m_exception(RIG *rig, freq_t freq)
+{
+ struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
+ int err;
+ int is_exception = 0;
+ if (!(freq > 5.2 && freq < 5.5)) // we're not on 60M
+ {
+ return 0;
+ }
+ if (is_ftdx10) { is_exception = 1; }
+ else if (is_ft710)
+ {
+ // If US mode we need to use memory channels
+ SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "EX0301%c", cat_term);
-/*
- * newcat_set_freq
- *
- * Set frequency for a given VFO
- * RIG_TARGETABLE_VFO
- * Does not SET priv->current_vfo
- *
- */
+ if ((err = newcat_get_cmd(rig)) != RIG_OK)
+ {
+ RETURNFUNC2(err);
+ }
-int newcat_60m_exception(RIG *rig, freq_t freq)
-{
- // can we improve this to set memory mode and pick the memory slot?
- if ((is_ftdx10 || is_ft710) && freq > 5.2 && freq < 5.5)
+ // 01 is the only exception so far -- others may be like UK and have full control too
+ if (strncmp(&priv->ret_data[6], "01", 2) != 0) { return 0; } // no exception
+
+ is_exception = 1;
+ }
+
+ if (is_exception)
{
rig_debug(RIG_DEBUG_VERBOSE, "%s: 60M exception ignoring freq/mode commands\n",
__func__);
@@ -824,6 +838,14 @@ int newcat_60m_exception(RIG *rig, freq_t freq)
return 0;
}
+/*
+ * newcat_set_freq
+ *
+ * Set frequency for a given VFO
+ * RIG_TARGETABLE_VFO
+ * Does not SET priv->current_vfo
+ *
+ */
int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
{
char c;
commit e3926a2e139f301f508d7236ca72e4fc0a0fbcac
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sun Jan 8 07:58:57 2023 -0600
Add FT-710 to 60M exception in newcat.c to allow some ability to work with WSJT-X
https://github.com/Hamlib/Hamlib/issues/1211
diff --git a/NEWS b/NEWS
index 187b734f..6c17f323 100644
--- a/NEWS
+++ b/NEWS
@@ -26,6 +26,7 @@ Version 4.6
Version 4.5.4
* 2023-XX-XX
+ * Fix FT-710 usage on 60M
* Fix timing on NRD-535D
* Fix AGC levels with rigctld
* Fix FTDX3000 EX039 error
diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c
index 281a2d33..3a5bf33c 100644
--- a/rigs/yaesu/newcat.c
+++ b/rigs/yaesu/newcat.c
@@ -814,7 +814,7 @@ int newcat_get_conf2(RIG *rig, token_t token, char *val, int val_len)
int newcat_60m_exception(RIG *rig, freq_t freq)
{
// can we improve this to set memory mode and pick the memory slot?
- if (is_ftdx10 && freq > 5.2 && freq < 5.5)
+ if ((is_ftdx10 || is_ft710) && freq > 5.2 && freq < 5.5)
{
rig_debug(RIG_DEBUG_VERBOSE, "%s: 60M exception ignoring freq/mode commands\n",
__func__);
diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h
index 78aa63aa..a0602bc0 100644
--- a/rigs/yaesu/newcat.h
+++ b/rigs/yaesu/newcat.h
@@ -50,7 +50,7 @@
typedef char ncboolean;
/* shared function version */
-#define NEWCAT_VER "20230107"
+#define NEWCAT_VER "20230108"
/* Hopefully large enough for future use, 128 chars plus '\0' */
#define NEWCAT_DATA_LEN 129
commit c653d5effdfaa734b94b745ce6e3802dc9319866
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sat Jan 7 22:17:24 2023 -0600
Update timing in nrd535.c based on testing thanks to markjfine
diff --git a/rigs/jrc/nrd535.c b/rigs/jrc/nrd535.c
index d4b0a707..a31e1700 100644
--- a/rigs/jrc/nrd535.c
+++ b/rigs/jrc/nrd535.c
@@ -96,7 +96,7 @@ const struct rig_caps nrd535_caps =
RIG_MODEL(RIG_MODEL_NRD535),
.model_name = "NRD-535D",
.mfg_name = "JRC",
- .version = BACKEND_VER ".0",
+ .version = BACKEND_VER ".1",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_RECEIVER,
@@ -110,8 +110,8 @@ const struct rig_caps nrd535_caps =
.serial_parity = RIG_PARITY_NONE,
.serial_handshake = RIG_HANDSHAKE_NONE,
.write_delay = 0,
- .post_write_delay = 20,
- .timeout = 200,
+ .post_write_delay = 21,
+ .timeout = 250,
.retry = 3,
.has_get_func = NRD535_FUNC,
commit 771075445f91d20e84b932ec6bfbd52dc9a938f4
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sat Jan 7 22:20:06 2023 -0600
Update NEWS
diff --git a/NEWS b/NEWS
index 2c6b975d..187b734f 100644
--- a/NEWS
+++ b/NEWS
@@ -26,6 +26,7 @@ Version 4.6
Version 4.5.4
* 2023-XX-XX
+ * Fix timing on NRD-535D
* Fix AGC levels with rigctld
* Fix FTDX3000 EX039 error
* Fix Elecraft power2mW operation
commit 8296a7f6cae251beac807ee3fca2a6e43a3ea171
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sat Jan 7 17:30:09 2023 -0600
Update NEWS
diff --git a/NEWS b/NEWS
index ac1b0756..2c6b975d 100644
--- a/NEWS
+++ b/NEWS
@@ -27,6 +27,8 @@ Version 4.6
Version 4.5.4
* 2023-XX-XX
* Fix AGC levels with rigctld
+ * Fix FTDX3000 EX039 error
+ * Fix Elecraft power2mW operation
* Fix rig_power2mW so it checks all ranges
* Allow rigctld to start with autopower_on=0 to avoid startup timeouts when rig is powered off
* Fix dummy device to work with grig by disallowing empty "u" call
commit 7b2abebeea8373475076860da0582edfd99f65fd
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sat Jan 7 16:03:34 2023 -0600
Fix FTDX3000 EX039 error
https://github.com/Hamlib/Hamlib/issues/1206
diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c
index 2d611638..281a2d33 100644
--- a/rigs/yaesu/newcat.c
+++ b/rigs/yaesu/newcat.c
@@ -546,6 +546,7 @@ int newcat_open(RIG *rig)
struct rig_state *rig_s = &rig->state;
const char *handshake[3] = {"None", "Xon/Xoff", "Hardware"};
int err;
+ int set_only = 0;
ENTERFUNC;
@@ -611,15 +612,24 @@ int newcat_open(RIG *rig)
else if (priv->rig_id == NC_RIGID_FT991A
|| rig->caps->rig_model == RIG_MODEL_FT991) { cmd = "EX0321;EX032;"; }
else if (priv->rig_id == NC_RIGID_FTDX3000
- || rig->caps->rig_model == RIG_MODEL_FTDX3000) { cmd = "EX0391;"; }
+ || rig->caps->rig_model == RIG_MODEL_FTDX3000) { cmd = "EX0391;"; set_only = 1; }
else if (priv->rig_id == NC_RIGID_FTDX3000DM
- || rig->caps->rig_model == RIG_MODEL_FTDX3000) { cmd = "EX0391;"; }
+ || rig->caps->rig_model == RIG_MODEL_FTDX3000) { cmd = "EX0391;"; set_only = 1; }
else if (priv->rig_id == NC_RIGID_FTDX5000
|| rig->caps->rig_model == RIG_MODEL_FTDX5000) { cmd = "EX0331;EX033"; }
SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "%s", cmd);
- if (RIG_OK != (err = newcat_get_cmd(rig)))
+ if (set_only)
+ {
+ err = newcat_set_cmd(rig);
+ }
+ else
+ {
+ err = newcat_get_cmd(rig);
+ }
+
+ if (err != RIG_OK)
{
RETURNFUNC(err);
}
@@ -636,9 +646,17 @@ int newcat_open(RIG *rig)
// Remember EX103 status
SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "EX103;");
rig_debug(RIG_DEBUG_TRACE, "%s: cmd_str = %s\n", __func__, priv->cmd_str);
- err = newcat_get_cmd(rig);
- if (RIG_OK != (err = newcat_get_cmd(rig)))
+ if (set_only)
+ {
+ err = newcat_set_cmd(rig);
+ }
+ else
+ {
+ err = newcat_get_cmd(rig);
+ }
+
+ if (err != RIG_OK)
{
RETURNFUNC(err);
}
diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h
index 7e196a9d..78aa63aa 100644
--- a/rigs/yaesu/newcat.h
+++ b/rigs/yaesu/newcat.h
@@ -50,7 +50,7 @@
typedef char ncboolean;
/* shared function version */
-#define NEWCAT_VER "20230106"
+#define NEWCAT_VER "20230107"
/* Hopefully large enough for future use, 128 chars plus '\0' */
#define NEWCAT_DATA_LEN 129
commit 09b71a11d0ef9e1b7c5ab330985d084a1da9e194
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sat Jan 7 11:46:56 2023 -0600
Force K22 mode on Elecraft rigs to get PC power level in .1W intervals for low power operations
https://github.com/Hamlib/Hamlib/issues/1205
diff --git a/rigs/kenwood/elecraft.c b/rigs/kenwood/elecraft.c
index ad3d4171..077a4aa4 100644
--- a/rigs/kenwood/elecraft.c
+++ b/rigs/kenwood/elecraft.c
@@ -165,6 +165,18 @@ int elecraft_open(RIG *rig)
}
}
+ if (rig->caps->rig_model != RIG_MODEL_XG3) // XG3 doesn't have extended
+ {
+ // turn on k2 extended to get PC values in more resolution
+ err = kenwood_transaction(rig, "K22;", NULL, 0);
+
+ if (err != RIG_OK)
+ {
+ rig_debug(RIG_DEBUG_ERR, "%s: error setting K22='%s'...continuing\n", __func__,
+ rigerror(err));
+ }
+ }
+
switch (rig->caps->rig_model)
{
case RIG_MODEL_K2:
@@ -310,8 +322,8 @@ int elecraft_open(RIG *rig)
kenwood_get_trn(rig, &priv->trn_state); /* ignore errors */
/* Currently we cannot cope with AI mode so turn it off in
case last client left it on */
- kenwood_set_trn(rig, RIG_TRN_OFF); /* ignore status in case
- it's not supported */
+ kenwood_set_trn(rig,
+ RIG_TRN_OFF); /* ignore status in case it's not supported */
}
// For rigs like K3X vfo emulation need to set VFO_A to start
diff --git a/rigs/kenwood/k3.c b/rigs/kenwood/k3.c
index 3847cd81..a9b0a1f6 100644
--- a/rigs/kenwood/k3.c
+++ b/rigs/kenwood/k3.c
@@ -160,7 +160,8 @@ int kx3_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val);
int kx3_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val);
int k3_set_func(RIG *rig, vfo_t vfo, setting_t func, int status);
int k3_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status);
-int k3_power2mW(RIG *rig, unsigned int *mwpower, float power, freq_t freq, rmode_t mode);
+int k3_power2mW(RIG *rig, unsigned int *mwpower, float power, freq_t freq,
+ rmode_t mode);
/* Private helper functions */
int set_rit_xit(RIG *rig, shortfreq_t rit);
@@ -1825,6 +1826,7 @@ static int k3_get_maxpower(RIG *rig)
break;
}
}
+
#endif
rig_debug(RIG_DEBUG_TRACE, "%s: maxpower=%d\n", __func__, maxpower);
@@ -1944,8 +1946,9 @@ int k3_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
break;
case RIG_LEVEL_RFPOWER:
- SNPRINTF(levelbuf, sizeof(levelbuf), "PC%03d",
- (int)(val.f * k3_get_maxpower(rig)));
+ kenwood_val = (int)(val.f * k3_get_maxpower(rig));
+ SNPRINTF(levelbuf, sizeof(levelbuf), "PC%03d%s", kenwood_val,
+ kenwood_val > 15 ? "1" : "0");
break;
default:
@@ -2247,7 +2250,15 @@ int k3_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
return RIG_EPROTO;
}
- val->f = (float) lvl / k3_get_maxpower(rig);
+ // extended K22 format PCnnnx where 0=.1W units and 1=1W units
+ if (len == 6 && levelbuf[5] == '0')
+ {
+ val->f = (float) lvl / 10.0 / k3_get_maxpower(rig);
+ }
+ else
+ {
+ val->f = (float) lvl / k3_get_maxpower(rig);
+ }
break;
diff --git a/simulators/simelecraft.c b/simulators/simelecraft.c
index 1c71ce6f..e5af7a66 100644
--- a/simulators/simelecraft.c
+++ b/simulators/simelecraft.c
@@ -132,7 +132,8 @@ int main(int argc, char *argv[])
{
printf("%s\n", buf);
usleep(50 * 1000);
- pbuf = "IF059014200000+000000700000;";
+ //pbuf = "IF059014200000+000000700000;";
+ pbuf = "IF00007230000 -000000 0001000001 ;" ;
n = write(fd, pbuf, strlen(pbuf));
printf("n=%d\n", n);
@@ -264,7 +265,7 @@ int main(int argc, char *argv[])
}
else if (strncmp(buf, "PC;", 3) == 0)
{
- SNPRINTF(buf, sizeof(buf), "PC005;");
+ SNPRINTF(buf, sizeof(buf), "PC0150;");
n = write(fd, buf, strlen(buf));
}
else if (strlen(buf) > 0)
commit 3e5080ebff5a98a52527c1c2fa4fc3818dbf7558
Author: Mike Black W9MDB <mdb...@ya...>
Date: Fri Jan 6 23:31:18 2023 -0600
Fix elecraft power2mW by scaling power to either 15W or 100W based on KPA availability
We are ignoring the tx_range values for the Kn series
https://github.com/Hamlib/Hamlib/issues/1205
diff --git a/rigs/kenwood/k3.c b/rigs/kenwood/k3.c
index fa85a7d6..3847cd81 100644
--- a/rigs/kenwood/k3.c
+++ b/rigs/kenwood/k3.c
@@ -160,6 +160,7 @@ int kx3_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val);
int kx3_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val);
int k3_set_func(RIG *rig, vfo_t vfo, setting_t func, int status);
int k3_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status);
+int k3_power2mW(RIG *rig, unsigned int *mwpower, float power, freq_t freq, rmode_t mode);
/* Private helper functions */
int set_rit_xit(RIG *rig, shortfreq_t rit);
@@ -188,7 +189,7 @@ const struct rig_caps k3_caps =
RIG_MODEL(RIG_MODEL_K3),
.model_name = "K3",
.mfg_name = "Elecraft",
- .version = BACKEND_VER ".24",
+ .version = BACKEND_VER ".25",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
@@ -331,6 +332,7 @@ const struct rig_caps k3_caps =
.get_ant = kenwood_get_ant,
.send_morse = kenwood_send_morse,
.wait_morse = rig_wait_morse,
+ .power2mW = k3_power2mW,
.hamlib_check_rig_caps = HAMLIB_CHECK_RIG_CAPS
};
@@ -340,7 +342,7 @@ const struct rig_caps k3s_caps =
RIG_MODEL(RIG_MODEL_K3S),
.model_name = "K3S",
.mfg_name = "Elecraft",
- .version = BACKEND_VER ".18",
+ .version = BACKEND_VER ".19",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
@@ -482,6 +484,7 @@ const struct rig_caps k3s_caps =
.get_ant = kenwood_get_ant,
.send_morse = kenwood_send_morse,
.wait_morse = rig_wait_morse,
+ .power2mW = k3_power2mW,
.hamlib_check_rig_caps = HAMLIB_CHECK_RIG_CAPS
};
@@ -491,7 +494,7 @@ const struct rig_caps k4_caps =
RIG_MODEL(RIG_MODEL_K4),
.model_name = "K4",
.mfg_name = "Elecraft",
- .version = BACKEND_VER ".24",
+ .version = BACKEND_VER ".25",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
@@ -633,6 +636,7 @@ const struct rig_caps k4_caps =
.get_ant = kenwood_get_ant,
.send_morse = kenwood_send_morse,
.wait_morse = rig_wait_morse,
+ .power2mW = k3_power2mW,
.hamlib_check_rig_caps = HAMLIB_CHECK_RIG_CAPS
};
@@ -641,7 +645,7 @@ const struct rig_caps kx3_caps =
RIG_MODEL(RIG_MODEL_KX3),
.model_name = "KX3",
.mfg_name = "Elecraft",
- .version = BACKEND_VER ".17",
+ .version = BACKEND_VER ".18",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
@@ -783,6 +787,7 @@ const struct rig_caps kx3_caps =
.get_ant = kenwood_get_ant,
.send_morse = kenwood_send_morse,
.wait_morse = rig_wait_morse,
+ .power2mW = k3_power2mW,
.hamlib_check_rig_caps = HAMLIB_CHECK_RIG_CAPS
};
@@ -791,7 +796,7 @@ const struct rig_caps kx2_caps =
RIG_MODEL(RIG_MODEL_KX2),
.model_name = "KX2",
.mfg_name = "Elecraft",
- .version = BACKEND_VER ".16",
+ .version = BACKEND_VER ".17",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
@@ -840,8 +845,8 @@ const struct rig_caps kx2_caps =
RIG_FRNG_END,
}, /* rx range */
.tx_range_list1 = {
- FRQ_RNG_HF(1, K3_MODES, mW(10), W(10), K3_VFO, K3_ANTS),
- FRQ_RNG_6m(1, K3_MODES, mW(10), W(10), K3_VFO, K3_ANTS),
+ FRQ_RNG_HF(1, K3_MODES, mW(10), W(12), K3_VFO, K3_ANTS),
+ FRQ_RNG_6m(1, K3_MODES, mW(10), W(12), K3_VFO, K3_ANTS),
RIG_FRNG_END,
}, /* tx range */
@@ -851,8 +856,8 @@ const struct rig_caps kx2_caps =
RIG_FRNG_END,
}, /* rx range */
.tx_range_list2 = {
- FRQ_RNG_HF(2, K3_MODES, mW(10), W(10), K3_VFO, K3_ANTS),
- FRQ_RNG_6m(2, K3_MODES, mW(10), W(10), K3_VFO, K3_ANTS),
+ FRQ_RNG_HF(2, K3_MODES, mW(10), W(12), K3_VFO, K3_ANTS),
+ FRQ_RNG_6m(2, K3_MODES, mW(10), W(12), K3_VFO, K3_ANTS),
RIG_FRNG_END,
}, /* tx range */
.tuning_steps = {
@@ -933,6 +938,7 @@ const struct rig_caps kx2_caps =
.get_ant = kenwood_get_ant,
.send_morse = kenwood_send_morse,
.wait_morse = rig_wait_morse,
+ .power2mW = k3_power2mW,
.hamlib_check_rig_caps = HAMLIB_CHECK_RIG_CAPS
};
@@ -1768,17 +1774,20 @@ int k3_get_split_mode(RIG *rig, vfo_t vfo, rmode_t *tx_mode,
static int k3_get_maxpower(RIG *rig)
{
- int retval;
- int maxpower = 12; // K3 default power level
- char levelbuf[KENWOOD_MAX_BUF_LEN];
+ //int retval;
+ int maxpower = 15; // K3 default power level
+ //char levelbuf[KENWOOD_MAX_BUF_LEN];
struct kenwood_priv_data *priv = rig->state.priv;
- // default range is 0-12 if there is no KPA3 installed
+ // default range is 0-15 if there is no KPA3 installed
if (priv->has_kpa3 || priv->has_kpa100)
{
maxpower = 110;
}
+// Elecraft makes max power pretty variable
+// So we will stick with 15W or 110W and scale everything to that
+#if 0
else if (RIG_IS_KX2 || RIG_IS_KX3)
{
@@ -1816,11 +1825,22 @@ static int k3_get_maxpower(RIG *rig)
break;
}
}
+#endif
rig_debug(RIG_DEBUG_TRACE, "%s: maxpower=%d\n", __func__, maxpower);
return maxpower;
}
+int k3_power2mW(RIG *rig,
+ unsigned int *mwpower,
+ float power,
+ freq_t freq,
+ rmode_t mode)
+{
+ *mwpower = power * k3_get_maxpower(rig) * 1000;
+ return RIG_OK;
+}
+
int k3_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
{
char levelbuf[16];
@@ -2220,13 +2240,7 @@ int k3_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
if (len == 5 || len == 6)
{
- sscanf(levelbuf + 2, "%d", &lvl);
-
- if (len == 6)
- {
- // K2 extended reply
- lvl /= 10;
- }
+ sscanf(levelbuf + 2, "%3d", &lvl);
}
else
{
diff --git a/simulators/simelecraft.c b/simulators/simelecraft.c
index 0be6800e..1c71ce6f 100644
--- a/simulators/simelecraft.c
+++ b/simulators/simelecraft.c
@@ -262,6 +262,11 @@ int main(int argc, char *argv[])
SNPRINTF(buf, sizeof(buf), "TQ0;");
write(fd, buf, strlen(buf));
}
+ else if (strncmp(buf, "PC;", 3) == 0)
+ {
+ SNPRINTF(buf, sizeof(buf), "PC005;");
+ n = write(fd, buf, strlen(buf));
+ }
else if (strlen(buf) > 0)
{
fprintf(stderr, "Unknown command: %s\n", buf);
commit b9ee776e5b58d7225730687b65e548423c241cef
Author: Mike Black W9MDB <mdb...@ya...>
Date: Fri Jan 6 22:22:25 2023 -0600
Remove EX039 check from FTDX3000/3000DM
https://github.com/Hamlib/Hamlib/issues/1206
diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c
index bf219832..2d611638 100644
--- a/rigs/yaesu/newcat.c
+++ b/rigs/yaesu/newcat.c
@@ -611,9 +611,9 @@ int newcat_open(RIG *rig)
else if (priv->rig_id == NC_RIGID_FT991A
|| rig->caps->rig_model == RIG_MODEL_FT991) { cmd = "EX0321;EX032;"; }
else if (priv->rig_id == NC_RIGID_FTDX3000
- || rig->caps->rig_model == RIG_MODEL_FTDX3000) { cmd = "EX0391;EX039;"; }
+ || rig->caps->rig_model == RIG_MODEL_FTDX3000) { cmd = "EX0391;"; }
else if (priv->rig_id == NC_RIGID_FTDX3000DM
- || rig->caps->rig_model == RIG_MODEL_FTDX3000) { cmd = "EX0391;EX039;"; }
+ || rig->caps->rig_model == RIG_MODEL_FTDX3000) { cmd = "EX0391;"; }
else if (priv->rig_id == NC_RIGID_FTDX5000
|| rig->caps->rig_model == RIG_MODEL_FTDX5000) { cmd = "EX0331;EX033"; }
diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h
index 914c535f..7e196a9d 100644
--- a/rigs/yaesu/newcat.h
+++ b/rigs/yaesu/newcat.h
@@ -50,7 +50,7 @@
typedef char ncboolean;
/* shared function version */
-#define NEWCAT_VER "20221228"
+#define NEWCAT_VER "20230106"
/* Hopefully large enough for future use, 128 chars plus '\0' */
#define NEWCAT_DATA_LEN 129
commit efc295159987f88d22d2f1c52081a77775bc2293
Author: Mike Black W9MDB <mdb...@ya...>
Date: Fri Jan 6 16:41:45 2023 -0600
Remove unnecessary check from netrigctl.c
https://github.com/Hamlib/Hamlib/issues/1155
diff --git a/rigs/dummy/netrigctl.c b/rigs/dummy/netrigctl.c
index 61c15d76..c0ce157a 100644
--- a/rigs/dummy/netrigctl.c
+++ b/rigs/dummy/netrigctl.c
@@ -825,7 +825,6 @@ static int netrigctl_open(RIG *rig)
if (n == 2)
{
- if (agc_code == RIG_AGC_OFF) { p = strtok(NULL, " "); continue; } ;
rig->caps->agc_levels[i++] = agc_code;
rig->caps->agc_level_count++;
rig_debug(RIG_DEBUG_VERBOSE, "%s: rig has agc code=%d, level=%s\n", __func__,
commit df8c625cc9723a5200bf8e4cd27fc993687ab656
Author: Mike Black W9MDB <mdb...@ya...>
Date: Fri Jan 6 10:30:32 2023 -0600
Update man pages to clarify upper/lower case for set/get commands
diff --git a/doc/man1/rigctl.1 b/doc/man1/rigctl.1
index 73bc1320..3eb537ef 100644
--- a/doc/man1/rigctl.1
+++ b/doc/man1/rigctl.1
@@ -351,12 +351,12 @@ Since most of the
.B Hamlib
operations have a
.BR set " and a " get
-method, an upper case letter will often be used for a
+method, a single upper case letter will often be used for a
.B set
-method whereas the corresponding lower case letter refers to the
+method whereas the corresponding single lower case letter refers to the
.B get
method. Each operation also has a long name; in interactive mode, prepend a
-backslash, \(oq\\\(cq, to enter a long command name.
+backslash, \(oq\\\(cq, to enter a long command name all lower case.
.
.PP
Example: Use \(lq\\dump_caps\(rq to see what capabilities this radio and
diff --git a/doc/man1/rigctld.1 b/doc/man1/rigctld.1
index 391920a7..fd9469fc 100644
--- a/doc/man1/rigctld.1
+++ b/doc/man1/rigctld.1
@@ -414,12 +414,12 @@ Since most of the
.B Hamlib
operations have a
.BR set " and a " get
-method, an upper case letter will be used for
+method, a single pper case letter will be used for
.B set
-methods whereas the corresponding lower case letter refers to the
+methods whereas the corresponding single lower case letter refers to the
.B get
method. Each operation also has a long name; prepend a backslash, \(oq\\\(cq,
-to send a long command name.
+to send a long command name all in lower case.
.
.PP
Example (Perl): \(lqprint $socket "\\\\dump_caps\\n";\(rq to see what the
commit 23e4eb2885809e087cb656a34ae6f9faee13aa7a
Author: Mike Black W9MDB <mdb...@ya...>
Date: Fri Jan 6 16:21:58 2023 -0600
Fix rigctld agc level readings -- allow for rig backedn to specify "RIG_AGC_NONE" now for clarity if desired
https://github.com/Hamlib/Hamlib/issues/1155
diff --git a/NEWS b/NEWS
index 0924a332..ac1b0756 100644
--- a/NEWS
+++ b/NEWS
@@ -26,6 +26,7 @@ Version 4.6
Version 4.5.4
* 2023-XX-XX
+ * Fix AGC levels with rigctld
* Fix rig_power2mW so it checks all ranges
* Allow rigctld to start with autopower_on=0 to avoid startup timeouts when rig is powered off
* Fix dummy device to work with grig by disallowing empty "u" call
diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h
index 4279bb15..37f85267 100644
--- a/include/hamlib/rig.h
+++ b/include/hamlib/rig.h
@@ -333,7 +333,7 @@ typedef enum {
*/
/* TODO: kill me, and replace by real AGC delay */
enum agc_level_e {
- RIG_AGC_OFF = 0,
+ RIG_AGC_OFF = 0,
RIG_AGC_SUPERFAST,
RIG_AGC_FAST,
RIG_AGC_SLOW,
@@ -341,7 +341,8 @@ enum agc_level_e {
RIG_AGC_MEDIUM,
RIG_AGC_AUTO,
RIG_AGC_LONG,
- RIG_AGC_ON /*< Turns AGC ON -- Kenwood -- restores last level set */
+ RIG_AGC_ON, /*< Turns AGC ON -- Kenwood -- restores last level set */
+ RIG_AGC_NONE /*< Rig does not have CAT AGC control */
};
diff --git a/rigs/dummy/netrigctl.c b/rigs/dummy/netrigctl.c
index 0477306d..61c15d76 100644
--- a/rigs/dummy/netrigctl.c
+++ b/rigs/dummy/netrigctl.c
@@ -812,9 +812,10 @@ static int netrigctl_open(RIG *rig)
}
else if (strcmp(setting, "agc_levels") == 0)
{
- int i = 1;
+ int i = 0;
char *p = strtok(value, " ");
- rig->caps->agc_levels[0] = RIG_AGC_OFF;
+ rig->caps->agc_levels[0] = RIG_AGC_NONE; // default value gets overwritten
+ rig->caps->agc_level_count = 1;
while (p)
{
@@ -824,7 +825,9 @@ static int netrigctl_open(RIG *rig)
if (n == 2)
{
+ if (agc_code == RIG_AGC_OFF) { p = strtok(NULL, " "); continue; } ;
rig->caps->agc_levels[i++] = agc_code;
+ rig->caps->agc_level_count++;
rig_debug(RIG_DEBUG_VERBOSE, "%s: rig has agc code=%d, level=%s\n", __func__,
agc_code, agc_string);
}
@@ -836,8 +839,6 @@ static int netrigctl_open(RIG *rig)
rig_debug(RIG_DEBUG_VERBOSE, "%d=%s\n", agc_code, agc_string);
p = strtok(NULL, " ");
}
-
- rig->caps->agc_level_count = i;
}
else
{
@@ -2736,7 +2737,7 @@ struct rig_caps netrigctl_caps =
RIG_MODEL(RIG_MODEL_NETRIGCTL),
.model_name = "NET rigctl",
.mfg_name = "Hamlib",
- .version = "20230104.0",
+ .version = "20230106.0",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_OTHER,
diff --git a/simulators/simft991.c b/simulators/simft991.c
index 83ebc2e7..965deb4f 100644
--- a/simulators/simft991.c
+++ b/simulators/simft991.c
@@ -12,6 +12,10 @@
float freqA = 14074000;
float freqB = 14074500;
+char tx_vfo = '0';
+char rx_vfo = '0';
+char modeA = '0';
+char modeB = '0';
// ID 0310 == 310, Must drop leading zero
typedef enum nc_rigid_e
@@ -104,7 +108,7 @@ int main(int argc, char *argv[])
{
printf("Cmd:%s\n", buf);
}
- else { return 0; }
+ else { continue; }
if (strcmp(buf, "RM5;") == 0)
{
@@ -137,6 +141,24 @@ int main(int argc, char *argv[])
if (n <= 0) { perror("IF"); }
}
+ else if (strcmp(buf, "FA;") == 0)
+ {
+ SNPRINTF(buf, sizeof(buf), "FA%08.0f;", freqA);
+ n = write(fd, buf, strlen(buf));
+ }
+ else if (strncmp(buf, "FA", 2) == 0)
+ {
+ sscanf(buf, "FA%f", &freqA);
+ }
+ else if (strcmp(buf, "FB;") == 0)
+ {
+ SNPRINTF(buf, sizeof(buf), "FB%08.0f;", freqB);
+ n = write(fd, buf, strlen(buf));
+ }
+ else if (strncmp(buf, "FB", 2) == 0)
+ {
+ sscanf(buf, "FB%f", &freqB);
+ }
else if (strcmp(buf, "ID;") == 0)
{
printf("%s\n", buf);
@@ -148,6 +170,11 @@ int main(int argc, char *argv[])
if (n <= 0) { perror("ID"); }
}
+ else if (strcmp(buf, "PS;") == 0)
+ {
+ SNPRINTF(buf, sizeof(buf), "PS1;");
+ n = write(fd, buf, strlen(buf));
+ }
else if (strcmp(buf, "AI;") == 0)
{
printf("%s\n", buf);
@@ -158,6 +185,54 @@ int main(int argc, char *argv[])
if (n <= 0) { perror("ID"); }
}
+ else if (strcmp(buf, "AI0;") == 0)
+ {
+ usleep(50 * 1000);
+ }
+ else if (strcmp(buf, "FT;") == 0)
+ {
+ usleep(50 * 1000);
+ SNPRINTF(buf, sizeof(buf), "FT%c;", tx_vfo);
+ printf(" FT response#1=%s, tx_vfo=%c\n", buf, tx_vfo);
+ n = write(fd, buf, strlen(buf));
+ printf(" FT response#2=%s\n", buf);
+
+ if (n < 0) { perror("FT"); }
+ }
+ else if (strncmp(buf, "FT", 2) == 0)
+ {
+ tx_vfo = buf[2];
+
+ if (tx_vfo == '3') { tx_vfo = '1'; }
+ else if (tx_vfo == '2') { tx_vfo = '0'; }
+ else { perror("Expected 2 or 3"); }
+ }
+ else if (strcmp(buf, "MD0;") == 0)
+ {
+ usleep(50 * 1000);
+ SNPRINTF(buf, sizeof(buf), "MD0%c;", modeA);
+ n = write(fd, buf, strlen(buf));
+
+ if (n < 0) { perror("MD0;"); }
+ }
+ else if (strncmp(buf, "MD0", 3) == 0)
+ {
+ modeA = buf[3];
+ }
+ else if (strcmp(buf, "MD1;") == 0)
+ {
+ usleep(50 * 1000);
+ SNPRINTF(buf, sizeof(buf), "MD1%c;", modeB);
+ n = write(fd, buf, strlen(buf));
+
+ if (n < 0) { perror("MD0;"); }
+ }
+ else if (strncmp(buf, "MD1", 3) == 0)
+ {
+ modeB = buf[3];
+ }
+
+
#if 0
else if (strncmp(buf, "AI", 2) == 0)
diff --git a/src/misc.c b/src/misc.c
index 008b1754..e38d35a5 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -1284,6 +1284,7 @@ static const struct
{ RIG_AGC_AUTO, "AUTO" },
{ RIG_AGC_LONG, "LONG" },
{ RIG_AGC_ON, "ON" },
+ { RIG_AGC_NONE, "NONE" },
{ -1, "" },
};
diff --git a/tests/dumpcaps.c b/tests/dumpcaps.c
index 19811bde..0100c113 100644
--- a/tests/dumpcaps.c
+++ b/tests/dumpcaps.c
@@ -296,7 +296,6 @@ int dumpcaps(RIG *rig, FILE *fout)
fprintf(fout, "\n");
-#if 0
fprintf(fout, "AGC levels:");
const struct icom_priv_caps *priv_caps =
(const struct icom_priv_caps *) rig->caps->priv;
@@ -313,6 +312,7 @@ int dumpcaps(RIG *rig, FILE *fout)
}
else
{
+
for (i = 0; i < HAMLIB_MAX_AGC_LEVELS && i < caps->agc_level_count; i++)
{
fprintf(fout, " %d=%s", caps->agc_levels[i],
@@ -320,16 +320,13 @@ int dumpcaps(RIG *rig, FILE *fout)
}
}
-#else
- //fprintf(fout, "\n");
- fprintf(fout, "AGC levels: ");
- char buf[1024];
- rig_sprintf_agc_levels(rig, buf, (int)sizeof(buf));
- fprintf(fout, "%s", buf);
-#endif
+ fprintf(fout, "\n");
if (i == 0)
{
+ rig_debug(RIG_DEBUG_WARN,
+ "%s: defaulting to all levels since rig does not have any\n", __func__);
+
// Fall back to printing out all levels for backwards-compatibility
for (i = RIG_AGC_OFF; i <= RIG_AGC_LAST; i++)
{
commit 852440b0fa14cb52fef0d84c88522c6fe8dbcb99
Author: Mike Black W9MDB <mdb...@ya...>
Date: Thu Jan 5 23:32:41 2023 -0600
Update NEWS
diff --git a/NEWS b/NEWS
index ae716d06..0924a332 100644
--- a/NEWS
+++ b/NEWS
@@ -26,6 +26,7 @@ Version 4.6
Version 4.5.4
* 2023-XX-XX
+ * Fix rig_power2mW so it checks all ranges
* Allow rigctld to start with autopower_on=0 to avoid startup timeouts when rig is powered off
* Fix dummy device to work with grig by disallowing empty "u" call
* Fix ID5100 and promote to stable and hopefully ID4100 too
commit 990c1768f8d3a2117e94880c213ddfa7ef3c57c6
Author: Mike Black W9MDB <mdb...@ya...>
Date: Thu Jan 5 23:31:15 2023 -0600
Fix rig_getpower2mW so it checks all range lists
https://github.com/Hamlib/Hamlib/issues/1205
diff --git a/src/rig.c b/src/rig.c
index 736cf818..be9ca6d6 100644
--- a/src/rig.c
+++ b/src/rig.c
@@ -5847,11 +5847,23 @@ int HAMLIB_API rig_power2mW(RIG *rig,
txrange = rig_get_range(rig->state.tx_range_list, freq, mode);
- if (!txrange)
+ // check all the range lists
+ if (txrange == NULL) { rig_get_range(rig->caps->tx_range_list1, freq, mode); }
+
+ if (txrange == NULL) { rig_get_range(rig->caps->tx_range_list2, freq, mode); }
+
+ if (txrange == NULL) { rig_get_range(rig->caps->tx_range_list3, freq, mode); }
+
+ if (txrange == NULL) { rig_get_range(rig->caps->tx_range_list4, freq, mode); }
+
+ if (txrange == NULL) { rig_get_range(rig->caps->tx_range_list5, freq, mode); }
+
+ if (txrange == NULL)
{
/*
* freq is not on the tx range!
*/
+ rig_debug(RIG_DEBUG_ERR, "%s: freq not in tx range\n", __func__);
RETURNFUNC(-RIG_EINVAL);
}
@@ -6843,7 +6855,7 @@ const freq_range_t *HAMLIB_API rig_get_range(const freq_range_t *range_list,
{
int i;
- if (!range_list)
+ if (range_list == NULL)
{
return (NULL);
}
commit 5c478c922232eb30fadc50854c1a6e65f75a63d3
Author: Mike Black W9MDB <mdb...@ya...>
Date: Wed Jan 4 17:23:49 2023 -0600
Update NEWS
diff --git a/NEWS b/NEWS
index 0facc972..ae716d06 100644
--- a/NEWS
+++ b/NEWS
@@ -26,6 +26,9 @@ Version 4.6
Version 4.5.4
* 2023-XX-XX
+ * Allow rigctld to start with autopower_on=0 to avoid startup timeouts when rig is powered off
+ * Fix dummy device to work with grig by disallowing empty "u" call
+ * Fix ID5100 and promote to stable and hopefully ID4100 too
* Remove get_powerstat from Icom ID-5100,ID-4100,ID-31,ID-51 and fix get/set freq in all
Version 4.5.3
commit 9e74696a427d3b455c78cade2ea8b49d258c896e
Author: Mike Black W9MDB <mdb...@ya...>
Date: Wed Jan 4 17:22:56 2023 -0600
Allow rigctld to start with autopower_on=0 and avoid timeouts at startup
diff --git a/tests/rigctld.c b/tests/rigctld.c
index 9bc906b2..e52f57f1 100644
--- a/tests/rigctld.c
+++ b/tests/rigctld.c
@@ -156,6 +156,7 @@ extern int lock_mode;
extern powerstat_t rig_powerstat;
static int rigctld_idle =
0; // if true then rig will close when no clients are connected
+static int skip_open = 0;
#define MAXCONFLEN 1024
@@ -509,19 +510,29 @@ int main(int argc, char *argv[])
exit(1);
}
- if (*conf_parms != '\0')
+ if (strcmp(optarg, "autopower_on=0") == 0)
{
- strcat(conf_parms, ",");
+ rig_debug(RIG_DEBUG_ERR, "%s: skipping rig_open\n", __func__);
+ skip_open = 1;
}
-
- if (strlen(conf_parms) + strlen(optarg) > MAXCONFLEN - 24)
+ else
{
- printf("Length of conf_parms exceeds internal maximum of %d\n",
- MAXCONFLEN - 24);
- return 1;
+
+ if (*conf_parms != '\0')
+ {
+ strcat(conf_parms, ",");
+ }
+
+ if (strlen(conf_parms) + strlen(optarg) > MAXCONFLEN - 24)
+ {
+ printf("Length of conf_parms exceeds internal maximum of %d\n",
+ MAXCONFLEN - 24);
+ return 1;
+ }
+
+ strncat(conf_parms, optarg, MAXCONFLEN - strlen(conf_parms));
}
- strncat(conf_parms, optarg, MAXCONFLEN - strlen(conf_parms));
break;
case 't':
@@ -758,8 +769,15 @@ int main(int argc, char *argv[])
}
/* attempt to open rig to check early for issues */
- retcode = rig_open(my_rig);
- rig_opened = retcode == RIG_OK ? 1 : 0;
+ if (skip_open)
+ {
+ rig_opened = 0;
+ }
+ else
+ {
+ retcode = rig_open(my_rig);
+ rig_opened = retcode == RIG_OK ? 1 : 0;
+ }
if (retcode != RIG_OK)
{
commit 41ad82139f954913090aa83d2e322a6e58412542
Author: Mike Black W9MDB <mdb...@ya...>
Date: Wed Jan 4 15:40:36 2023 -0600
Update ID5100 and ID4100
Promote ID5100 to stable
https://github.com/Hamlib/Hamlib/issues/1204
https://github.com/Hamlib/Hamlib/issues/1202
https://github.com/Hamlib/Hamlib/issues/1202
diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c
index c5dd7dcf..e806c3cf 100644
--- a/rigs/icom/icom.c
+++ b/rigs/icom/icom.c
@@ -1363,16 +1363,22 @@ int icom_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
else
{
cmd = C_SET_FREQ;
+ subcmd = -1;
if (ICOM_IS_ID5100 || ICOM_IS_ID4100 || ICOM_IS_ID31 || ICOM_IS_ID51)
{
// for these rigs 0x00 is setting the freq and 0x03 is just for reading
cmd = 0x00;
+ // temporary fix for ID5100 not giving ACK/NAK on 0x00 freq on E8 firmware
+ retval = icom_transaction(rig, cmd, subcmd, freqbuf, freq_len, NULL,
+ NULL);
+ return RIG_OK;
+ }
+ else
+ {
+ retval = icom_transaction(rig, cmd, subcmd, freqbuf, freq_len, ackbuf,
+ &ack_len);
}
-
- subcmd = -1;
- retval = icom_transaction(rig, cmd, subcmd, freqbuf, freq_len, ackbuf,
- &ack_len);
}
hl_usleep(50 * 1000); // pause for transceive message and we'll flush it
@@ -1699,7 +1705,8 @@ int icom_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
if (freq_len == 3 && (ICOM_IS_ID5100 || ICOM_IS_ID4100 || ICOM_IS_ID31
|| ICOM_IS_ID51))
{
- rig_debug(RIG_DEBUG_ERR, "%s: 3-byte ID5100/4100 length - turn off XONXOFF flow control\n", __func__);
+ rig_debug(RIG_DEBUG_ERR,
+ "%s: 3-byte ID5100/4100 length - turn off XONXOFF flow control\n", __func__);
}
else if (freq_len != 4 && freq_len != 5)
{
diff --git a/rigs/icom/id4100.c b/rigs/icom/id4100.c
index 52837820..6b4a46ac 100644
--- a/rigs/icom/id4100.c
+++ b/rigs/icom/id4100.c
@@ -98,7 +98,6 @@ const struct rig_caps id4100_caps =
.serial_data_bits = 8,
.serial_stop_bits = 1,
.serial_parity = RIG_PARITY_NONE,
- //.serial_handshake = RIG_HANDSHAKE_XONXOFF,
.serial_handshake = RIG_HANDSHAKE_NONE,
.write_delay = 0,
.post_write_delay = 0,
diff --git a/rigs/icom/id5100.c b/rigs/icom/id5100.c
index 3c04551e..d0de207d 100644
--- a/rigs/icom/id5100.c
+++ b/rigs/icom/id5100.c
@@ -90,13 +90,16 @@ int id5100_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
case RIG_MODE_FMN: icmode = 5; modebuf = 2; break;
- case RIG_MODE_DSTAR: icmode = 17; modebuf = 1; break;
+ case RIG_MODE_DSTAR: icmode = 0x17; modebuf = 1; break;
default:
rig_debug(RIG_DEBUG_ERR, "%s: Unknown mode=%s\n", __func__, rig_strrmode(mode));
return -RIG_EINVAL;
}
+ rig_debug(RIG_DEBUG_VERBOSE, "%s: mode=%d, modebuf=%c\n", __func__, icmode,
+ modebuf);
+
retval = icom_transaction(rig, C_SET_MODE, icmode, &modebuf, 1, ackbuf,
&ack_len);
@@ -118,11 +121,17 @@ int id5100_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
switch (modebuf[1])
{
- case 2: *mode = modebuf[3] == 1 ? RIG_MODE_AM : RIG_MODE_AMN; break;
+ case 2:
+ *mode = modebuf[2] == 1 ? RIG_MODE_AM : RIG_MODE_AMN;
+ *width = modebuf[2] == 1 ? 12000 : 6000; break;
- case 5: *mode = modebuf[3] == 1 ? RIG_MODE_FM : RIG_MODE_FMN; break;
+ case 5:
+ *mode = modebuf[2] == 1 ? RIG_MODE_FM : RIG_MODE_FMN;
+ *width = modebuf[2] == 1 ? 10000 : 5000; break;
- case 17: *mode = RIG_MODE_DSTAR; break;
+ case 0x17:
+ *mode = RIG_MODE_DSTAR;
+ *width = 6000; break;
}
return RIG_OK;
@@ -144,7 +153,7 @@ const struct rig_caps id5100_caps =
.mfg_name = "Icom",
.version = BACKEND_VER ".2",
.copyright = "LGPL",
- .status = RIG_STATUS_BETA,
+ .status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_MOBILE,
.ptt_type = RIG_PTT_RIG,
.dcd_type = RIG_DCD_RIG,
@@ -154,8 +163,6 @@ const struct rig_caps id5100_caps =
.serial_data_bits = 8,
.serial_stop_bits = 1,
.serial_parity = RIG_PARITY_NONE,
- // XONXOFF is not working on Firmware E8
- //.serial_handshake = RIG_HANDSHAKE_XONXOFF,
.serial_handshake = RIG_HANDSHAKE_NONE,
.write_delay = 0,
.post_write_delay = 0,
diff --git a/simulators/Makefile.am b/simulators/Makefile.am
index e0002914..eebddedd 100644
--- a/simulators/Makefile.am
+++ b/simulators/Makefile.am
@@ -8,12 +8,13 @@ DISTCLEANFILES =
bin_PROGRAMS =
-check_PROGRAMS = simelecraft simicom simkenwood simyaesu simicom9700
+check_PROGRAMS = simelecraft simicom simkenwood simyaesu simicom9700 simft991 simftdx1200 simftdx3000 simjupiter simpowersdr
simelecraft_SOURCES = simelecraft.c
simicom_SOURCES = simicom.c
simkenwood_SOURCES = simkenwood.c
simyaesu_SOURCES = simyaesu.c
+simid5100_SOURCES = simid5100.c
# include generated include files ahead of any in sources
#rigctl_CPPFLAGS = -I$(top_builddir)/tests -I$(top_builddir)/src -I$(srcdir) $(AM_CPPFLAGS)
@@ -25,17 +26,20 @@ simelecraft_CFL...
[truncated message content] |
|
From: n0nb <n0...@us...> - 2023-01-10 00:57:01
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Hamlib -- Ham radio control libraries".
The branch, master has been updated
via aa1cf567f67febd90e6d6a804ba2950fd9f2b6cf (commit)
via 7cc477869f195b1da5f536ad118bf45d8fe69e11 (commit)
via 3eedc5a5af3ed6b374ccc13d8d43b6111aa0f34b (commit)
via 56c87cfa9a4f88381cb01384215a0f1d4ae86ac3 (commit)
via 7c5b095ff3618ba8b25370d15cea1fe8f11e2227 (commit)
via 58621995f3c28529ba2f86b0b6fe071d288a212a (commit)
via d2ef9d5edaa843d0a9cd653eb39245c243f300c4 (commit)
via 89fadca3bdbcbc288e0b3db02d1a7143be8a95f1 (commit)
via 93e3aec58863b87b41dd68fcef4f11f4838f418a (commit)
via 57522f0b93958262225827088667035735503f25 (commit)
via 8be3fcbef500df7c1ce6d14fdb1a06dbd5015c10 (commit)
via 0a2dddfce05043eb1e0c1137e32b15e153a966e3 (commit)
via e3ac42a6b65246114d5fdc6e98d708f45879d3fb (commit)
via 02312ef322a7664e25c50eb993e04f0b2607500d (commit)
via 6cb7a8c56080218c61de8f0322df04639d0f0147 (commit)
via 7978d74750db62ce36190bd97f160395e41c6f3f (commit)
via eb904148b5a35dc1b13d70076370125658671778 (commit)
via 22df154486fa59489d9bc51ff220ab70e2961c66 (commit)
via 79255fa27cba9ea1884e29df700466ef5f946566 (commit)
via 4a487ffdcceb2789930fd1e941810a9f5cd4aaf8 (commit)
via db218e9e73e6763dafb7a7137656c4faf11ef360 (commit)
via 86771a95575116f31f498a8912d36e114f1109bc (commit)
via e6c5c15452bad475ddf69c0ae74cd63e6bc347b3 (commit)
via bbd0f856ca3f26b5d6367c4ca3d8519e58458e08 (commit)
via 31d2939acc21fe58b5f203fa5a1c1e6bebb947c4 (commit)
via 589736e8f7e8e8def8f136436a8b9af72c32d31b (commit)
via 6dbd2cff5e1b5be4aefeb463f00391e5d05d89a5 (commit)
via 902be172c1613d97bcba8f90e9199100c0578b0b (commit)
via f1b6d322ba549a245ff9e488b3e02b755512e1aa (commit)
via 87cc9a8c3d133ab18a6f4b9758e98836bd0fd101 (commit)
via 383c95b9c4cfce2cc7b3ad243c997953b716994c (commit)
via af9a7a6938f0f7a7ea7c329b110241480f474577 (commit)
via cceffce4a50bf4413dfcca0e1ba3d2ada7aa48a6 (commit)
via 0404b43bd8225608d443dab3a48f1161b12b2486 (commit)
via 138795668f66c472bcaf16f3b1eb7076dfad88ba (commit)
via 9c5809ffba8712c314a78dcadcfe8ae75a1beaa7 (commit)
via 1b6b78f54a98f9450a621895fd759d89435fb060 (commit)
via 4c09344f32cff0eb27333b904db017324aef4be7 (commit)
from 9f0bd7b310e7d21c857052cb6249d6210caabd61 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit aa1cf567f67febd90e6d6a804ba2950fd9f2b6cf
Author: Mike Black W9MDB <mdb...@ya...>
Date: Mon Jan 9 12:34:22 2023 -0600
Fix Icom poweron behavior
https://github.com/Hamlib/Hamlib/issues/1212
diff --git a/NEWS b/NEWS
index 369326eb..b2909aaa 100644
--- a/NEWS
+++ b/NEWS
@@ -27,6 +27,7 @@ Version 4.6
Version 4.5.4
* 2023-XX-XX
* Fix CM108 ptt setting for non-default usage
+ * Fix power on/off for Icom rigs with rigctld power_on=0
* Fix get_powerstat status return for non-PS kenwood rigs
* Fix FT-710, FTDX10, FTDX101D/MP usage on 60M
* Fix timing on NRD-535D
diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c
index 2b101cc1..d912ad97 100644
--- a/rigs/icom/icom.c
+++ b/rigs/icom/icom.c
@@ -7979,8 +7979,8 @@ int icom_set_powerstat(RIG *rig, powerstat_t status)
write_block(&rs->rigport, fe_buf, fe_max);
// close and re-open the rig
// on linux the USB gets reset during power on
- sleep(1); // let serial bus idle for a while
rig_close(rig);
+ sleep(1); // let serial bus idle for a while
rig_open(rig);
// we'll try 0x18 0x01 now -- should work on STBY rigs too
commit 7cc477869f195b1da5f536ad118bf45d8fe69e11
Author: Mike Black W9MDB <mdb...@ya...>
Date: Mon Jan 9 12:21:33 2023 -0600
Revert "Close rig on set_powerstat 0 -- Linux was unable to reconnect to IC-7300"
This reverts commit 93e3aec58863b87b41dd68fcef4f11f4838f418a.
diff --git a/NEWS b/NEWS
index a430b0f4..369326eb 100644
--- a/NEWS
+++ b/NEWS
@@ -28,7 +28,6 @@ Version 4.5.4
* 2023-XX-XX
* Fix CM108 ptt setting for non-default usage
* Fix get_powerstat status return for non-PS kenwood rigs
- * Fix set_powerstat 0 to reopen with IC-7300 (and others?) on Linux
* Fix FT-710, FTDX10, FTDX101D/MP usage on 60M
* Fix timing on NRD-535D
* Fix AGC levels with rigctld
diff --git a/src/rig.c b/src/rig.c
index aa3be50d..d4cff0ae 100644
--- a/src/rig.c
+++ b/src/rig.c
@@ -6019,9 +6019,6 @@ int HAMLIB_API rig_set_powerstat(RIG *rig, powerstat_t status)
HAMLIB_TRACE;
retcode = rig->caps->set_powerstat(rig, status);
rig_flush(&rig->state.rigport); // if anything is queued up flush it
-
- if (status == RIG_POWER_OFF) { rig_close(rig); }
-
RETURNFUNC(retcode);
}
commit 3eedc5a5af3ed6b374ccc13d8d43b6111aa0f34b
Author: Mike Black W9MDB <mdb...@ya...>
Date: Mon Jan 9 11:24:34 2023 -0600
Update NEWS
https://github.com/Hamlib/Hamlib/issues/1203
diff --git a/NEWS b/NEWS
index 632ff66b..a430b0f4 100644
--- a/NEWS
+++ b/NEWS
@@ -26,6 +26,7 @@ Version 4.6
Version 4.5.4
* 2023-XX-XX
+ * Fix CM108 ptt setting for non-default usage
* Fix get_powerstat status return for non-PS kenwood rigs
* Fix set_powerstat 0 to reopen with IC-7300 (and others?) on Linux
* Fix FT-710, FTDX10, FTDX101D/MP usage on 60M
commit 56c87cfa9a4f88381cb01384215a0f1d4ae86ac3
Author: Mike Black W9MDB <mdb...@ya...>
Date: Mon Jan 9 11:03:50 2023 -0600
Fix CM108 ptt setting
https://github.com/Hamlib/Hamlib/issues/1203
diff --git a/src/conf.c b/src/conf.c
index 92f067a3..f0612783 100644
--- a/src/conf.c
+++ b/src/conf.c
@@ -559,6 +559,7 @@ static int frontend_set_conf(RIG *rig, token_t token, const char *val)
}
rs->pttport.parm.cm108.ptt_bitnum = val_i;
+ rs->rigport.parm.cm108.ptt_bitnum = val_i;
rs->pttport_deprecated.parm.cm108.ptt_bitnum = val_i;
break;
diff --git a/src/rig.c b/src/rig.c
index b65a5419..aa3be50d 100644
--- a/src/rig.c
+++ b/src/rig.c
@@ -588,8 +588,13 @@ RIG *HAMLIB_API rig_init(rig_model_t rig_model)
*/
case RIG_PORT_CM108:
strncpy(rs->rigport.pathname, DEFAULT_CM108_PORT, HAMLIB_FILPATHLEN);
- rs->rigport.parm.cm108.ptt_bitnum = DEFAULT_CM108_PTT_BITNUM;
- rs->pttport.parm.cm108.ptt_bitnum = DEFAULT_CM108_PTT_BITNUM;
+
+ if (rs->rigport.parm.cm108.ptt_bitnum == 0)
+ {
+ rs->rigport.parm.cm108.ptt_bitnum = DEFAULT_CM108_PTT_BITNUM;
+ rs->pttport.parm.cm108.ptt_bitnum = DEFAULT_CM108_PTT_BITNUM;
+ }
+
break;
case RIG_PORT_GPIO:
commit 7c5b095ff3618ba8b25370d15cea1fe8f11e2227
Author: Mike Black W9MDB <mdb...@ya...>
Date: Mon Jan 9 10:44:27 2023 -0600
Update NEWS
diff --git a/NEWS b/NEWS
index ca819542..632ff66b 100644
--- a/NEWS
+++ b/NEWS
@@ -28,7 +28,7 @@ Version 4.5.4
* 2023-XX-XX
* Fix get_powerstat status return for non-PS kenwood rigs
* Fix set_powerstat 0 to reopen with IC-7300 (and others?) on Linux
- * Fix FT-710 usage on 60M
+ * Fix FT-710, FTDX10, FTDX101D/MP usage on 60M
* Fix timing on NRD-535D
* Fix AGC levels with rigctld
* Fix FTDX3000 EX039 error
commit 58621995f3c28529ba2f86b0b6fe071d288a212a
Author: Mike Black W9MDB <mdb...@ya...>
Date: Mon Jan 9 10:42:57 2023 -0600
Fix FT-710, FTDX10, FTDX101D/MP 60M operations
https://github.com/Hamlib/Hamlib/issues/1211
diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c
index a3d5045d..703b7fb6 100644
--- a/rigs/yaesu/newcat.c
+++ b/rigs/yaesu/newcat.c
@@ -799,43 +799,88 @@ int newcat_get_conf2(RIG *rig, token_t token, char *val, int val_len)
RETURNFUNC(ret);
}
+static int freq_60m[] = { 5332000, 5348000, 5358500, 5373000, 5405000 };
+
/* returns 0 if no exeption or 1 if rig needs special handling */
-int newcat_60m_exception(RIG *rig, freq_t freq)
+int newcat_60m_exception(RIG *rig, freq_t freq, mode_t mode)
{
struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
int err;
- int is_exception = 0;
+ int channel = -1;
+ int i;
+ rmode_t tmode;
+ pbwidth_t twidth;
if (!(freq > 5.2 && freq < 5.5)) // we're not on 60M
{
return 0;
}
- if (is_ftdx10) { is_exception = 1; }
- else if (is_ft710)
+ if (mode != RIG_MODE_CW && mode != RIG_MODE_USB && mode != RIG_MODE_PKTUSB
+ && mode != RIG_MODE_RTTYR)
+ {
+ rig_debug(RIG_DEBUG_ERR,
+ "%s: only USB, PKTUSB, RTTYR, and CW allowed for 60M operations\n", __func__);
+ return -RIG_EINVAL;
+ }
+
+ if (!is_ftdx10 && !is_ft710 && !is_ftdx101d && !is_ftdx101mp) { return 0; }
+
+ rig_debug(RIG_DEBUG_VERBOSE, "%s: 60M exception ignoring freq/mode commands\n",
+ __func__);
+ // If US mode we need to use memory channels
+ SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "EX0301%c", cat_term);
+
+ if ((err = newcat_get_cmd(rig)) != RIG_OK)
{
- // If US mode we need to use memory channels
- SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "EX0301%c", cat_term);
+ RETURNFUNC2(err);
+ }
+
+ // 01 is the only exception so far -- others may be like UK and have full control too
+ if (strncmp(&priv->ret_data[6], "01", 2) != 0) { return 0; } // no exception
- if ((err = newcat_get_cmd(rig)) != RIG_OK)
+ // so now we should have a rig that has fixed memory channels 501-510 in USB/CW-U mode
+
+ // toggle vfo mode if we need to
+
+ rig_debug(RIG_DEBUG_VERBOSE, "%s: 60M exception ignoring freq/mode commands\n",
+ __func__);
+
+ rig_get_mode(rig, RIG_VFO_A, &tmode, &twidth);
+ if (tmode != RIG_VFO_MEM)
+ {
+ err = newcat_vfomem_toggle(rig);
+ if (err != RIG_OK)
{
- RETURNFUNC2(err);
+ rig_debug(RIG_DEBUG_ERR, "%s: Error toggling VFO_MEM\n", __func__);
+ return -err;
}
+ }
+ // find the nearest slot below what is requested
+ for (i = 0; i < 5; ++i)
+ {
+ if ((long)freq == freq_60m[i]) { channel = i; }
+ }
- // 01 is the only exception so far -- others may be like UK and have full control too
- if (strncmp(&priv->ret_data[6], "01", 2) != 0) { return 0; } // no exception
-
- is_exception = 1;
+ if (channel < 0)
+ {
+ rig_debug(RIG_DEBUG_ERR,
+ "%s: 60M allowed frequencies are 5.332, 5.348, 5.3585, 5.373,5.405, got %g\n",
+ __func__, freq / 1000);
+ return -RIG_EINVAL;
}
- if (is_exception)
+ if (mode == RIG_MODE_CW) { channel += 5; }
+
+ SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "MC%3d%c", channel + 501,
+ cat_term);
+
+ if ((err = newcat_set_cmd(rig)) != RIG_OK)
{
- rig_debug(RIG_DEBUG_VERBOSE, "%s: 60M exception ignoring freq/mode commands\n",
- __func__);
- return 1;
+ RETURNFUNC2(err);
}
- return 0;
+ return 1;
}
/*
@@ -854,10 +899,12 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
const struct rig_caps *caps;
struct newcat_priv_data *priv;
int special_60m = 0;
+ rmode_t tmode;
+ pbwidth_t twidth;
ENTERFUNC;
- if (newcat_60m_exception(rig, freq))
+ if (newcat_60m_exception(rig, freq, rig->state.cache.modeMainA))
{
// we don't try to set freq on 60m for some rigs since we must be in memory mode
// and we can't run split mode on 60M memory mode either
@@ -882,6 +929,13 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
priv = (struct newcat_priv_data *)rig->state.priv;
caps = rig->caps;
+ rig_get_mode(rig, RIG_VFO_A, &tmode, &twidth);
+ if (tmode == RIG_VFO_MEM)
+ {
+ // then we need to toggle back to VFO mode
+ newcat_vfomem_toggle(rig);
+ }
+
rig_debug(RIG_DEBUG_TRACE, "%s: passed vfo = %s\n", __func__, rig_strvfo(vfo));
// rig_debug(RIG_DEBUG_TRACE, "%s: translated vfo = %s\n", __func__, rig_strvfo(tvfo));
rig_debug(RIG_DEBUG_TRACE, "%s: passed freq = %"PRIfreq" Hz\n", __func__, freq);
@@ -1386,7 +1440,7 @@ int newcat_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
ENTERFUNC;
- if (newcat_60m_exception(rig, rig->state.cache.freqMainA)) { RETURNFUNC(RIG_OK); } // we don't set mode in this case
+ if (newcat_60m_exception(rig, rig->state.cache.freqMainA, mode)) { RETURNFUNC(RIG_OK); } // we don't set mode in this case
if (!newcat_valid_command(rig, "MD"))
{
diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h
index a0602bc0..5202dcfd 100644
--- a/rigs/yaesu/newcat.h
+++ b/rigs/yaesu/newcat.h
@@ -50,7 +50,7 @@
typedef char ncboolean;
/* shared function version */
-#define NEWCAT_VER "20230108"
+#define NEWCAT_VER "20230109"
/* Hopefully large enough for future use, 128 chars plus '\0' */
#define NEWCAT_DATA_LEN 129
commit d2ef9d5edaa843d0a9cd653eb39245c243f300c4
Author: Mike Black W9MDB <mdb...@ya...>
Date: Mon Jan 9 10:28:43 2023 -0600
Fix get_powerstat status return to always show POWER_ON for kenwood non-PS rigs
https://github.com/Hamlib/Hamlib/issues/1213
diff --git a/NEWS b/NEWS
index dec67ca5..ca819542 100644
--- a/NEWS
+++ b/NEWS
@@ -26,6 +26,7 @@ Version 4.6
Version 4.5.4
* 2023-XX-XX
+ * Fix get_powerstat status return for non-PS kenwood rigs
* Fix set_powerstat 0 to reopen with IC-7300 (and others?) on Linux
* Fix FT-710 usage on 60M
* Fix timing on NRD-535D
diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c
index 223adfae..fe41cdbf 100644
--- a/rigs/kenwood/kenwood.c
+++ b/rigs/kenwood/kenwood.c
@@ -4878,6 +4878,7 @@ int kenwood_get_powerstat(RIG *rig, powerstat_t *status)
if (!priv->has_ps)
{
+ *status = RIG_POWER_ON;
RETURNFUNC(RIG_OK); // fake the OK return for these rigs
}
diff --git a/rigs/kenwood/kenwood.h b/rigs/kenwood/kenwood.h
index 4787ae93..69106804 100644
--- a/rigs/kenwood/kenwood.h
+++ b/rigs/kenwood/kenwood.h
@@ -29,7 +29,7 @@
#include "misc.h"
#include "idx_builtin.h"
-#define BACKEND_VER "20221230"
+#define BACKEND_VER "20230109"
#define EOM_KEN ';'
#define EOM_TH '\r'
commit 89fadca3bdbcbc288e0b3db02d1a7143be8a95f1
Author: Mike Black W9MDB <mdb...@ya...>
Date: Mon Jan 9 09:50:25 2023 -0600
For Icom rigs close and reopen rig after set_powerstat=1 -- Linux resets the usb device
https://github.com/Hamlib/Hamlib/issues/1212
diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c
index e806c3cf..2b101cc1 100644
--- a/rigs/icom/icom.c
+++ b/rigs/icom/icom.c
@@ -7977,6 +7977,11 @@ int icom_set_powerstat(RIG *rig, powerstat_t status)
memset(fe_buf, 0xfe, fe_max);
// sending more than enough 0xfe's to wake up the rs232
write_block(&rs->rigport, fe_buf, fe_max);
+ // close and re-open the rig
+ // on linux the USB gets reset during power on
+ sleep(1); // let serial bus idle for a while
+ rig_close(rig);
+ rig_open(rig);
// we'll try 0x18 0x01 now -- should work on STBY rigs too
pwr_sc = S_PWR_ON;
diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h
index 254d89f9..3f4c3c18 100644
--- a/rigs/icom/icom.h
+++ b/rigs/icom/icom.h
@@ -31,7 +31,7 @@
#include <sys/time.h>
#endif
-#define BACKEND_VER "20230104"
+#define BACKEND_VER "20230109"
#define ICOM_IS_ID31 rig_is_model(rig, RIG_MODEL_ID31)
#define ICOM_IS_ID51 rig_is_model(rig, RIG_MODEL_ID51)
commit 93e3aec58863b87b41dd68fcef4f11f4838f418a
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sun Jan 8 16:48:35 2023 -0600
Close rig on set_powerstat 0 -- Linux was unable to reconnect to IC-7300
https://github.com/Hamlib/Hamlib/issues/1212
diff --git a/NEWS b/NEWS
index 6c17f323..dec67ca5 100644
--- a/NEWS
+++ b/NEWS
@@ -26,6 +26,7 @@ Version 4.6
Version 4.5.4
* 2023-XX-XX
+ * Fix set_powerstat 0 to reopen with IC-7300 (and others?) on Linux
* Fix FT-710 usage on 60M
* Fix timing on NRD-535D
* Fix AGC levels with rigctld
diff --git a/src/rig.c b/src/rig.c
index eaac46ec..b65a5419 100644
--- a/src/rig.c
+++ b/src/rig.c
@@ -6014,6 +6014,9 @@ int HAMLIB_API rig_set_powerstat(RIG *rig, powerstat_t status)
HAMLIB_TRACE;
retcode = rig->caps->set_powerstat(rig, status);
rig_flush(&rig->state.rigport); // if anything is queued up flush it
+
+ if (status == RIG_POWER_OFF) { rig_close(rig); }
+
RETURNFUNC(retcode);
}
commit 57522f0b93958262225827088667035735503f25
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sun Jan 8 10:28:34 2023 -0600
Ensure 60M exception for FT710 is only for US language setting
https://github.com/Hamlib/Hamlib/issues/1211
diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c
index 3a5bf33c..a3d5045d 100644
--- a/rigs/yaesu/newcat.c
+++ b/rigs/yaesu/newcat.c
@@ -799,22 +799,36 @@ int newcat_get_conf2(RIG *rig, token_t token, char *val, int val_len)
RETURNFUNC(ret);
}
+/* returns 0 if no exeption or 1 if rig needs special handling */
+int newcat_60m_exception(RIG *rig, freq_t freq)
+{
+ struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
+ int err;
+ int is_exception = 0;
+ if (!(freq > 5.2 && freq < 5.5)) // we're not on 60M
+ {
+ return 0;
+ }
+ if (is_ftdx10) { is_exception = 1; }
+ else if (is_ft710)
+ {
+ // If US mode we need to use memory channels
+ SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "EX0301%c", cat_term);
-/*
- * newcat_set_freq
- *
- * Set frequency for a given VFO
- * RIG_TARGETABLE_VFO
- * Does not SET priv->current_vfo
- *
- */
+ if ((err = newcat_get_cmd(rig)) != RIG_OK)
+ {
+ RETURNFUNC2(err);
+ }
-int newcat_60m_exception(RIG *rig, freq_t freq)
-{
- // can we improve this to set memory mode and pick the memory slot?
- if ((is_ftdx10 || is_ft710) && freq > 5.2 && freq < 5.5)
+ // 01 is the only exception so far -- others may be like UK and have full control too
+ if (strncmp(&priv->ret_data[6], "01", 2) != 0) { return 0; } // no exception
+
+ is_exception = 1;
+ }
+
+ if (is_exception)
{
rig_debug(RIG_DEBUG_VERBOSE, "%s: 60M exception ignoring freq/mode commands\n",
__func__);
@@ -824,6 +838,14 @@ int newcat_60m_exception(RIG *rig, freq_t freq)
return 0;
}
+/*
+ * newcat_set_freq
+ *
+ * Set frequency for a given VFO
+ * RIG_TARGETABLE_VFO
+ * Does not SET priv->current_vfo
+ *
+ */
int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
{
char c;
commit 8be3fcbef500df7c1ce6d14fdb1a06dbd5015c10
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sun Jan 8 07:58:57 2023 -0600
Add FT-710 to 60M exception in newcat.c to allow some ability to work with WSJT-X
https://github.com/Hamlib/Hamlib/issues/1211
diff --git a/NEWS b/NEWS
index 187b734f..6c17f323 100644
--- a/NEWS
+++ b/NEWS
@@ -26,6 +26,7 @@ Version 4.6
Version 4.5.4
* 2023-XX-XX
+ * Fix FT-710 usage on 60M
* Fix timing on NRD-535D
* Fix AGC levels with rigctld
* Fix FTDX3000 EX039 error
diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c
index 281a2d33..3a5bf33c 100644
--- a/rigs/yaesu/newcat.c
+++ b/rigs/yaesu/newcat.c
@@ -814,7 +814,7 @@ int newcat_get_conf2(RIG *rig, token_t token, char *val, int val_len)
int newcat_60m_exception(RIG *rig, freq_t freq)
{
// can we improve this to set memory mode and pick the memory slot?
- if (is_ftdx10 && freq > 5.2 && freq < 5.5)
+ if ((is_ftdx10 || is_ft710) && freq > 5.2 && freq < 5.5)
{
rig_debug(RIG_DEBUG_VERBOSE, "%s: 60M exception ignoring freq/mode commands\n",
__func__);
diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h
index 78aa63aa..a0602bc0 100644
--- a/rigs/yaesu/newcat.h
+++ b/rigs/yaesu/newcat.h
@@ -50,7 +50,7 @@
typedef char ncboolean;
/* shared function version */
-#define NEWCAT_VER "20230107"
+#define NEWCAT_VER "20230108"
/* Hopefully large enough for future use, 128 chars plus '\0' */
#define NEWCAT_DATA_LEN 129
commit 0a2dddfce05043eb1e0c1137e32b15e153a966e3
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sat Jan 7 22:20:06 2023 -0600
Update NEWS
diff --git a/NEWS b/NEWS
index 2c6b975d..187b734f 100644
--- a/NEWS
+++ b/NEWS
@@ -26,6 +26,7 @@ Version 4.6
Version 4.5.4
* 2023-XX-XX
+ * Fix timing on NRD-535D
* Fix AGC levels with rigctld
* Fix FTDX3000 EX039 error
* Fix Elecraft power2mW operation
commit e3ac42a6b65246114d5fdc6e98d708f45879d3fb
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sat Jan 7 22:17:24 2023 -0600
Update timing in nrd535.c based on testing thanks to markjfine
diff --git a/rigs/jrc/nrd535.c b/rigs/jrc/nrd535.c
index d4b0a707..a31e1700 100644
--- a/rigs/jrc/nrd535.c
+++ b/rigs/jrc/nrd535.c
@@ -96,7 +96,7 @@ const struct rig_caps nrd535_caps =
RIG_MODEL(RIG_MODEL_NRD535),
.model_name = "NRD-535D",
.mfg_name = "JRC",
- .version = BACKEND_VER ".0",
+ .version = BACKEND_VER ".1",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_RECEIVER,
@@ -110,8 +110,8 @@ const struct rig_caps nrd535_caps =
.serial_parity = RIG_PARITY_NONE,
.serial_handshake = RIG_HANDSHAKE_NONE,
.write_delay = 0,
- .post_write_delay = 20,
- .timeout = 200,
+ .post_write_delay = 21,
+ .timeout = 250,
.retry = 3,
.has_get_func = NRD535_FUNC,
commit 02312ef322a7664e25c50eb993e04f0b2607500d
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sat Jan 7 17:30:09 2023 -0600
Update NEWS
diff --git a/NEWS b/NEWS
index ac1b0756..2c6b975d 100644
--- a/NEWS
+++ b/NEWS
@@ -27,6 +27,8 @@ Version 4.6
Version 4.5.4
* 2023-XX-XX
* Fix AGC levels with rigctld
+ * Fix FTDX3000 EX039 error
+ * Fix Elecraft power2mW operation
* Fix rig_power2mW so it checks all ranges
* Allow rigctld to start with autopower_on=0 to avoid startup timeouts when rig is powered off
* Fix dummy device to work with grig by disallowing empty "u" call
commit 6cb7a8c56080218c61de8f0322df04639d0f0147
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sat Jan 7 16:03:34 2023 -0600
Fix FTDX3000 EX039 error
https://github.com/Hamlib/Hamlib/issues/1206
diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c
index 2d611638..281a2d33 100644
--- a/rigs/yaesu/newcat.c
+++ b/rigs/yaesu/newcat.c
@@ -546,6 +546,7 @@ int newcat_open(RIG *rig)
struct rig_state *rig_s = &rig->state;
const char *handshake[3] = {"None", "Xon/Xoff", "Hardware"};
int err;
+ int set_only = 0;
ENTERFUNC;
@@ -611,15 +612,24 @@ int newcat_open(RIG *rig)
else if (priv->rig_id == NC_RIGID_FT991A
|| rig->caps->rig_model == RIG_MODEL_FT991) { cmd = "EX0321;EX032;"; }
else if (priv->rig_id == NC_RIGID_FTDX3000
- || rig->caps->rig_model == RIG_MODEL_FTDX3000) { cmd = "EX0391;"; }
+ || rig->caps->rig_model == RIG_MODEL_FTDX3000) { cmd = "EX0391;"; set_only = 1; }
else if (priv->rig_id == NC_RIGID_FTDX3000DM
- || rig->caps->rig_model == RIG_MODEL_FTDX3000) { cmd = "EX0391;"; }
+ || rig->caps->rig_model == RIG_MODEL_FTDX3000) { cmd = "EX0391;"; set_only = 1; }
else if (priv->rig_id == NC_RIGID_FTDX5000
|| rig->caps->rig_model == RIG_MODEL_FTDX5000) { cmd = "EX0331;EX033"; }
SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "%s", cmd);
- if (RIG_OK != (err = newcat_get_cmd(rig)))
+ if (set_only)
+ {
+ err = newcat_set_cmd(rig);
+ }
+ else
+ {
+ err = newcat_get_cmd(rig);
+ }
+
+ if (err != RIG_OK)
{
RETURNFUNC(err);
}
@@ -636,9 +646,17 @@ int newcat_open(RIG *rig)
// Remember EX103 status
SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "EX103;");
rig_debug(RIG_DEBUG_TRACE, "%s: cmd_str = %s\n", __func__, priv->cmd_str);
- err = newcat_get_cmd(rig);
- if (RIG_OK != (err = newcat_get_cmd(rig)))
+ if (set_only)
+ {
+ err = newcat_set_cmd(rig);
+ }
+ else
+ {
+ err = newcat_get_cmd(rig);
+ }
+
+ if (err != RIG_OK)
{
RETURNFUNC(err);
}
diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h
index 7e196a9d..78aa63aa 100644
--- a/rigs/yaesu/newcat.h
+++ b/rigs/yaesu/newcat.h
@@ -50,7 +50,7 @@
typedef char ncboolean;
/* shared function version */
-#define NEWCAT_VER "20230106"
+#define NEWCAT_VER "20230107"
/* Hopefully large enough for future use, 128 chars plus '\0' */
#define NEWCAT_DATA_LEN 129
commit 7978d74750db62ce36190bd97f160395e41c6f3f
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sat Jan 7 11:46:56 2023 -0600
Force K22 mode on Elecraft rigs to get PC power level in .1W intervals for low power operations
https://github.com/Hamlib/Hamlib/issues/1205
diff --git a/rigs/kenwood/elecraft.c b/rigs/kenwood/elecraft.c
index ad3d4171..077a4aa4 100644
--- a/rigs/kenwood/elecraft.c
+++ b/rigs/kenwood/elecraft.c
@@ -165,6 +165,18 @@ int elecraft_open(RIG *rig)
}
}
+ if (rig->caps->rig_model != RIG_MODEL_XG3) // XG3 doesn't have extended
+ {
+ // turn on k2 extended to get PC values in more resolution
+ err = kenwood_transaction(rig, "K22;", NULL, 0);
+
+ if (err != RIG_OK)
+ {
+ rig_debug(RIG_DEBUG_ERR, "%s: error setting K22='%s'...continuing\n", __func__,
+ rigerror(err));
+ }
+ }
+
switch (rig->caps->rig_model)
{
case RIG_MODEL_K2:
@@ -310,8 +322,8 @@ int elecraft_open(RIG *rig)
kenwood_get_trn(rig, &priv->trn_state); /* ignore errors */
/* Currently we cannot cope with AI mode so turn it off in
case last client left it on */
- kenwood_set_trn(rig, RIG_TRN_OFF); /* ignore status in case
- it's not supported */
+ kenwood_set_trn(rig,
+ RIG_TRN_OFF); /* ignore status in case it's not supported */
}
// For rigs like K3X vfo emulation need to set VFO_A to start
diff --git a/rigs/kenwood/k3.c b/rigs/kenwood/k3.c
index 3847cd81..a9b0a1f6 100644
--- a/rigs/kenwood/k3.c
+++ b/rigs/kenwood/k3.c
@@ -160,7 +160,8 @@ int kx3_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val);
int kx3_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val);
int k3_set_func(RIG *rig, vfo_t vfo, setting_t func, int status);
int k3_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status);
-int k3_power2mW(RIG *rig, unsigned int *mwpower, float power, freq_t freq, rmode_t mode);
+int k3_power2mW(RIG *rig, unsigned int *mwpower, float power, freq_t freq,
+ rmode_t mode);
/* Private helper functions */
int set_rit_xit(RIG *rig, shortfreq_t rit);
@@ -1825,6 +1826,7 @@ static int k3_get_maxpower(RIG *rig)
break;
}
}
+
#endif
rig_debug(RIG_DEBUG_TRACE, "%s: maxpower=%d\n", __func__, maxpower);
@@ -1944,8 +1946,9 @@ int k3_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
break;
case RIG_LEVEL_RFPOWER:
- SNPRINTF(levelbuf, sizeof(levelbuf), "PC%03d",
- (int)(val.f * k3_get_maxpower(rig)));
+ kenwood_val = (int)(val.f * k3_get_maxpower(rig));
+ SNPRINTF(levelbuf, sizeof(levelbuf), "PC%03d%s", kenwood_val,
+ kenwood_val > 15 ? "1" : "0");
break;
default:
@@ -2247,7 +2250,15 @@ int k3_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
return RIG_EPROTO;
}
- val->f = (float) lvl / k3_get_maxpower(rig);
+ // extended K22 format PCnnnx where 0=.1W units and 1=1W units
+ if (len == 6 && levelbuf[5] == '0')
+ {
+ val->f = (float) lvl / 10.0 / k3_get_maxpower(rig);
+ }
+ else
+ {
+ val->f = (float) lvl / k3_get_maxpower(rig);
+ }
break;
diff --git a/simulators/simelecraft.c b/simulators/simelecraft.c
index 661095a9..ea82a0a3 100644
--- a/simulators/simelecraft.c
+++ b/simulators/simelecraft.c
@@ -132,7 +132,8 @@ int main(int argc, char *argv[])
{
printf("%s\n", buf);
usleep(50 * 1000);
- pbuf = "IF059014200000+000000700000;";
+ //pbuf = "IF059014200000+000000700000;";
+ pbuf = "IF00007230000 -000000 0001000001 ;" ;
n = write(fd, pbuf, strlen(pbuf));
printf("n=%d\n", n);
@@ -280,7 +281,7 @@ int main(int argc, char *argv[])
}
else if (strncmp(buf, "PC;", 3) == 0)
{
- SNPRINTF(buf, sizeof(buf), "PC005;");
+ SNPRINTF(buf, sizeof(buf), "PC0150;");
n = write(fd, buf, strlen(buf));
}
else if (strlen(buf) > 0)
commit eb904148b5a35dc1b13d70076370125658671778
Author: Mike Black W9MDB <mdb...@ya...>
Date: Fri Jan 6 23:31:18 2023 -0600
Fix elecraft power2mW by scaling power to either 15W or 100W based on KPA availability
We are ignoring the tx_range values for the Kn series
https://github.com/Hamlib/Hamlib/issues/1205
diff --git a/rigs/kenwood/k3.c b/rigs/kenwood/k3.c
index fa85a7d6..3847cd81 100644
--- a/rigs/kenwood/k3.c
+++ b/rigs/kenwood/k3.c
@@ -160,6 +160,7 @@ int kx3_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val);
int kx3_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val);
int k3_set_func(RIG *rig, vfo_t vfo, setting_t func, int status);
int k3_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status);
+int k3_power2mW(RIG *rig, unsigned int *mwpower, float power, freq_t freq, rmode_t mode);
/* Private helper functions */
int set_rit_xit(RIG *rig, shortfreq_t rit);
@@ -188,7 +189,7 @@ const struct rig_caps k3_caps =
RIG_MODEL(RIG_MODEL_K3),
.model_name = "K3",
.mfg_name = "Elecraft",
- .version = BACKEND_VER ".24",
+ .version = BACKEND_VER ".25",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
@@ -331,6 +332,7 @@ const struct rig_caps k3_caps =
.get_ant = kenwood_get_ant,
.send_morse = kenwood_send_morse,
.wait_morse = rig_wait_morse,
+ .power2mW = k3_power2mW,
.hamlib_check_rig_caps = HAMLIB_CHECK_RIG_CAPS
};
@@ -340,7 +342,7 @@ const struct rig_caps k3s_caps =
RIG_MODEL(RIG_MODEL_K3S),
.model_name = "K3S",
.mfg_name = "Elecraft",
- .version = BACKEND_VER ".18",
+ .version = BACKEND_VER ".19",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
@@ -482,6 +484,7 @@ const struct rig_caps k3s_caps =
.get_ant = kenwood_get_ant,
.send_morse = kenwood_send_morse,
.wait_morse = rig_wait_morse,
+ .power2mW = k3_power2mW,
.hamlib_check_rig_caps = HAMLIB_CHECK_RIG_CAPS
};
@@ -491,7 +494,7 @@ const struct rig_caps k4_caps =
RIG_MODEL(RIG_MODEL_K4),
.model_name = "K4",
.mfg_name = "Elecraft",
- .version = BACKEND_VER ".24",
+ .version = BACKEND_VER ".25",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
@@ -633,6 +636,7 @@ const struct rig_caps k4_caps =
.get_ant = kenwood_get_ant,
.send_morse = kenwood_send_morse,
.wait_morse = rig_wait_morse,
+ .power2mW = k3_power2mW,
.hamlib_check_rig_caps = HAMLIB_CHECK_RIG_CAPS
};
@@ -641,7 +645,7 @@ const struct rig_caps kx3_caps =
RIG_MODEL(RIG_MODEL_KX3),
.model_name = "KX3",
.mfg_name = "Elecraft",
- .version = BACKEND_VER ".17",
+ .version = BACKEND_VER ".18",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
@@ -783,6 +787,7 @@ const struct rig_caps kx3_caps =
.get_ant = kenwood_get_ant,
.send_morse = kenwood_send_morse,
.wait_morse = rig_wait_morse,
+ .power2mW = k3_power2mW,
.hamlib_check_rig_caps = HAMLIB_CHECK_RIG_CAPS
};
@@ -791,7 +796,7 @@ const struct rig_caps kx2_caps =
RIG_MODEL(RIG_MODEL_KX2),
.model_name = "KX2",
.mfg_name = "Elecraft",
- .version = BACKEND_VER ".16",
+ .version = BACKEND_VER ".17",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
@@ -840,8 +845,8 @@ const struct rig_caps kx2_caps =
RIG_FRNG_END,
}, /* rx range */
.tx_range_list1 = {
- FRQ_RNG_HF(1, K3_MODES, mW(10), W(10), K3_VFO, K3_ANTS),
- FRQ_RNG_6m(1, K3_MODES, mW(10), W(10), K3_VFO, K3_ANTS),
+ FRQ_RNG_HF(1, K3_MODES, mW(10), W(12), K3_VFO, K3_ANTS),
+ FRQ_RNG_6m(1, K3_MODES, mW(10), W(12), K3_VFO, K3_ANTS),
RIG_FRNG_END,
}, /* tx range */
@@ -851,8 +856,8 @@ const struct rig_caps kx2_caps =
RIG_FRNG_END,
}, /* rx range */
.tx_range_list2 = {
- FRQ_RNG_HF(2, K3_MODES, mW(10), W(10), K3_VFO, K3_ANTS),
- FRQ_RNG_6m(2, K3_MODES, mW(10), W(10), K3_VFO, K3_ANTS),
+ FRQ_RNG_HF(2, K3_MODES, mW(10), W(12), K3_VFO, K3_ANTS),
+ FRQ_RNG_6m(2, K3_MODES, mW(10), W(12), K3_VFO, K3_ANTS),
RIG_FRNG_END,
}, /* tx range */
.tuning_steps = {
@@ -933,6 +938,7 @@ const struct rig_caps kx2_caps =
.get_ant = kenwood_get_ant,
.send_morse = kenwood_send_morse,
.wait_morse = rig_wait_morse,
+ .power2mW = k3_power2mW,
.hamlib_check_rig_caps = HAMLIB_CHECK_RIG_CAPS
};
@@ -1768,17 +1774,20 @@ int k3_get_split_mode(RIG *rig, vfo_t vfo, rmode_t *tx_mode,
static int k3_get_maxpower(RIG *rig)
{
- int retval;
- int maxpower = 12; // K3 default power level
- char levelbuf[KENWOOD_MAX_BUF_LEN];
+ //int retval;
+ int maxpower = 15; // K3 default power level
+ //char levelbuf[KENWOOD_MAX_BUF_LEN];
struct kenwood_priv_data *priv = rig->state.priv;
- // default range is 0-12 if there is no KPA3 installed
+ // default range is 0-15 if there is no KPA3 installed
if (priv->has_kpa3 || priv->has_kpa100)
{
maxpower = 110;
}
+// Elecraft makes max power pretty variable
+// So we will stick with 15W or 110W and scale everything to that
+#if 0
else if (RIG_IS_KX2 || RIG_IS_KX3)
{
@@ -1816,11 +1825,22 @@ static int k3_get_maxpower(RIG *rig)
break;
}
}
+#endif
rig_debug(RIG_DEBUG_TRACE, "%s: maxpower=%d\n", __func__, maxpower);
return maxpower;
}
+int k3_power2mW(RIG *rig,
+ unsigned int *mwpower,
+ float power,
+ freq_t freq,
+ rmode_t mode)
+{
+ *mwpower = power * k3_get_maxpower(rig) * 1000;
+ return RIG_OK;
+}
+
int k3_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
{
char levelbuf[16];
@@ -2220,13 +2240,7 @@ int k3_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
if (len == 5 || len == 6)
{
- sscanf(levelbuf + 2, "%d", &lvl);
-
- if (len == 6)
- {
- // K2 extended reply
- lvl /= 10;
- }
+ sscanf(levelbuf + 2, "%3d", &lvl);
}
else
{
diff --git a/simulators/simelecraft.c b/simulators/simelecraft.c
index 1d34c05b..661095a9 100644
--- a/simulators/simelecraft.c
+++ b/simulators/simelecraft.c
@@ -278,6 +278,11 @@ int main(int argc, char *argv[])
SNPRINTF(buf, sizeof(buf), "TQ0;");
n = write(fd, buf, strlen(buf));
}
+ else if (strncmp(buf, "PC;", 3) == 0)
+ {
+ SNPRINTF(buf, sizeof(buf), "PC005;");
+ n = write(fd, buf, strlen(buf));
+ }
else if (strlen(buf) > 0)
{
fprintf(stderr, "Unknown command: %s\n", buf);
commit 22df154486fa59489d9bc51ff220ab70e2961c66
Author: Mike Black W9MDB <mdb...@ya...>
Date: Fri Jan 6 22:22:25 2023 -0600
Remove EX039 check from FTDX3000/3000DM
https://github.com/Hamlib/Hamlib/issues/1206
diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c
index bf219832..2d611638 100644
--- a/rigs/yaesu/newcat.c
+++ b/rigs/yaesu/newcat.c
@@ -611,9 +611,9 @@ int newcat_open(RIG *rig)
else if (priv->rig_id == NC_RIGID_FT991A
|| rig->caps->rig_model == RIG_MODEL_FT991) { cmd = "EX0321;EX032;"; }
else if (priv->rig_id == NC_RIGID_FTDX3000
- || rig->caps->rig_model == RIG_MODEL_FTDX3000) { cmd = "EX0391;EX039;"; }
+ || rig->caps->rig_model == RIG_MODEL_FTDX3000) { cmd = "EX0391;"; }
else if (priv->rig_id == NC_RIGID_FTDX3000DM
- || rig->caps->rig_model == RIG_MODEL_FTDX3000) { cmd = "EX0391;EX039;"; }
+ || rig->caps->rig_model == RIG_MODEL_FTDX3000) { cmd = "EX0391;"; }
else if (priv->rig_id == NC_RIGID_FTDX5000
|| rig->caps->rig_model == RIG_MODEL_FTDX5000) { cmd = "EX0331;EX033"; }
diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h
index 914c535f..7e196a9d 100644
--- a/rigs/yaesu/newcat.h
+++ b/rigs/yaesu/newcat.h
@@ -50,7 +50,7 @@
typedef char ncboolean;
/* shared function version */
-#define NEWCAT_VER "20221228"
+#define NEWCAT_VER "20230106"
/* Hopefully large enough for future use, 128 chars plus '\0' */
#define NEWCAT_DATA_LEN 129
commit 79255fa27cba9ea1884e29df700466ef5f946566
Author: Mike Black W9MDB <mdb...@ya...>
Date: Fri Jan 6 16:41:45 2023 -0600
Remove unnecessary check from netrigctl.c
https://github.com/Hamlib/Hamlib/issues/1155
diff --git a/rigs/dummy/netrigctl.c b/rigs/dummy/netrigctl.c
index 6ad737fc..03976838 100644
--- a/rigs/dummy/netrigctl.c
+++ b/rigs/dummy/netrigctl.c
@@ -824,7 +824,6 @@ static int netrigctl_open(RIG *rig)
if (n == 2)
{
- if (agc_code == RIG_AGC_OFF) { p = strtok(NULL, " "); continue; } ;
rig->caps->agc_levels[i++] = agc_code;
rig->caps->agc_level_count++;
rig_debug(RIG_DEBUG_VERBOSE, "%s: rig has agc code=%d, level=%s\n", __func__,
commit 4a487ffdcceb2789930fd1e941810a9f5cd4aaf8
Author: Mike Black W9MDB <mdb...@ya...>
Date: Fri Jan 6 16:21:58 2023 -0600
Fix rigctld agc level readings -- allow for rig backedn to specify "RIG_AGC_NONE" now for clarity if desired
https://github.com/Hamlib/Hamlib/issues/1155
diff --git a/NEWS b/NEWS
index 0924a332..ac1b0756 100644
--- a/NEWS
+++ b/NEWS
@@ -26,6 +26,7 @@ Version 4.6
Version 4.5.4
* 2023-XX-XX
+ * Fix AGC levels with rigctld
* Fix rig_power2mW so it checks all ranges
* Allow rigctld to start with autopower_on=0 to avoid startup timeouts when rig is powered off
* Fix dummy device to work with grig by disallowing empty "u" call
diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h
index a55ef92f..438040ef 100644
--- a/include/hamlib/rig.h
+++ b/include/hamlib/rig.h
@@ -332,7 +332,7 @@ typedef enum {
*/
/* TODO: kill me, and replace by real AGC delay */
enum agc_level_e {
- RIG_AGC_OFF = 0,
+ RIG_AGC_OFF = 0,
RIG_AGC_SUPERFAST,
RIG_AGC_FAST,
RIG_AGC_SLOW,
@@ -340,7 +340,8 @@ enum agc_level_e {
RIG_AGC_MEDIUM,
RIG_AGC_AUTO,
RIG_AGC_LONG,
- RIG_AGC_ON /*< Turns AGC ON -- Kenwood -- restores last level set */
+ RIG_AGC_ON, /*< Turns AGC ON -- Kenwood -- restores last level set */
+ RIG_AGC_NONE /*< Rig does not have CAT AGC control */
};
diff --git a/rigs/dummy/netrigctl.c b/rigs/dummy/netrigctl.c
index 393b1ea9..6ad737fc 100644
--- a/rigs/dummy/netrigctl.c
+++ b/rigs/dummy/netrigctl.c
@@ -811,9 +811,10 @@ static int netrigctl_open(RIG *rig)
}
else if (strcmp(setting, "agc_levels") == 0)
{
- int i = 1;
+ int i = 0;
char *p = strtok(value, " ");
- rig->caps->agc_levels[0] = RIG_AGC_OFF;
+ rig->caps->agc_levels[0] = RIG_AGC_NONE; // default value gets overwritten
+ rig->caps->agc_level_count = 1;
while (p)
{
@@ -823,7 +824,9 @@ static int netrigctl_open(RIG *rig)
if (n == 2)
{
+ if (agc_code == RIG_AGC_OFF) { p = strtok(NULL, " "); continue; } ;
rig->caps->agc_levels[i++] = agc_code;
+ rig->caps->agc_level_count++;
rig_debug(RIG_DEBUG_VERBOSE, "%s: rig has agc code=%d, level=%s\n", __func__,
agc_code, agc_string);
}
@@ -835,8 +838,6 @@ static int netrigctl_open(RIG *rig)
rig_debug(RIG_DEBUG_VERBOSE, "%d=%s\n", agc_code, agc_string);
p = strtok(NULL, " ");
}
-
- rig->caps->agc_level_count = i;
}
else
{
@@ -2735,7 +2736,7 @@ struct rig_caps netrigctl_caps =
RIG_MODEL(RIG_MODEL_NETRIGCTL),
.model_name = "NET rigctl",
.mfg_name = "Hamlib",
- .version = "20230104.0",
+ .version = "20230106.0",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_OTHER,
diff --git a/simulators/simft991.c b/simulators/simft991.c
index 83ebc2e7..965deb4f 100644
--- a/simulators/simft991.c
+++ b/simulators/simft991.c
@@ -12,6 +12,10 @@
float freqA = 14074000;
float freqB = 14074500;
+char tx_vfo = '0';
+char rx_vfo = '0';
+char modeA = '0';
+char modeB = '0';
// ID 0310 == 310, Must drop leading zero
typedef enum nc_rigid_e
@@ -104,7 +108,7 @@ int main(int argc, char *argv[])
{
printf("Cmd:%s\n", buf);
}
- else { return 0; }
+ else { continue; }
if (strcmp(buf, "RM5;") == 0)
{
@@ -137,6 +141,24 @@ int main(int argc, char *argv[])
if (n <= 0) { perror("IF"); }
}
+ else if (strcmp(buf, "FA;") == 0)
+ {
+ SNPRINTF(buf, sizeof(buf), "FA%08.0f;", freqA);
+ n = write(fd, buf, strlen(buf));
+ }
+ else if (strncmp(buf, "FA", 2) == 0)
+ {
+ sscanf(buf, "FA%f", &freqA);
+ }
+ else if (strcmp(buf, "FB;") == 0)
+ {
+ SNPRINTF(buf, sizeof(buf), "FB%08.0f;", freqB);
+ n = write(fd, buf, strlen(buf));
+ }
+ else if (strncmp(buf, "FB", 2) == 0)
+ {
+ sscanf(buf, "FB%f", &freqB);
+ }
else if (strcmp(buf, "ID;") == 0)
{
printf("%s\n", buf);
@@ -148,6 +170,11 @@ int main(int argc, char *argv[])
if (n <= 0) { perror("ID"); }
}
+ else if (strcmp(buf, "PS;") == 0)
+ {
+ SNPRINTF(buf, sizeof(buf), "PS1;");
+ n = write(fd, buf, strlen(buf));
+ }
else if (strcmp(buf, "AI;") == 0)
{
printf("%s\n", buf);
@@ -158,6 +185,54 @@ int main(int argc, char *argv[])
if (n <= 0) { perror("ID"); }
}
+ else if (strcmp(buf, "AI0;") == 0)
+ {
+ usleep(50 * 1000);
+ }
+ else if (strcmp(buf, "FT;") == 0)
+ {
+ usleep(50 * 1000);
+ SNPRINTF(buf, sizeof(buf), "FT%c;", tx_vfo);
+ printf(" FT response#1=%s, tx_vfo=%c\n", buf, tx_vfo);
+ n = write(fd, buf, strlen(buf));
+ printf(" FT response#2=%s\n", buf);
+
+ if (n < 0) { perror("FT"); }
+ }
+ else if (strncmp(buf, "FT", 2) == 0)
+ {
+ tx_vfo = buf[2];
+
+ if (tx_vfo == '3') { tx_vfo = '1'; }
+ else if (tx_vfo == '2') { tx_vfo = '0'; }
+ else { perror("Expected 2 or 3"); }
+ }
+ else if (strcmp(buf, "MD0;") == 0)
+ {
+ usleep(50 * 1000);
+ SNPRINTF(buf, sizeof(buf), "MD0%c;", modeA);
+ n = write(fd, buf, strlen(buf));
+
+ if (n < 0) { perror("MD0;"); }
+ }
+ else if (strncmp(buf, "MD0", 3) == 0)
+ {
+ modeA = buf[3];
+ }
+ else if (strcmp(buf, "MD1;") == 0)
+ {
+ usleep(50 * 1000);
+ SNPRINTF(buf, sizeof(buf), "MD1%c;", modeB);
+ n = write(fd, buf, strlen(buf));
+
+ if (n < 0) { perror("MD0;"); }
+ }
+ else if (strncmp(buf, "MD1", 3) == 0)
+ {
+ modeB = buf[3];
+ }
+
+
#if 0
else if (strncmp(buf, "AI", 2) == 0)
diff --git a/src/misc.c b/src/misc.c
index bab1b104..a82a2360 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -1282,6 +1282,7 @@ static const struct
{ RIG_AGC_AUTO, "AUTO" },
{ RIG_AGC_LONG, "LONG" },
{ RIG_AGC_ON, "ON" },
+ { RIG_AGC_NONE, "NONE" },
{ -1, "" },
};
diff --git a/tests/dumpcaps.c b/tests/dumpcaps.c
index 19811bde..0100c113 100644
--- a/tests/dumpcaps.c
+++ b/tests/dumpcaps.c
@@ -296,7 +296,6 @@ int dumpcaps(RIG *rig, FILE *fout)
fprintf(fout, "\n");
-#if 0
fprintf(fout, "AGC levels:");
const struct icom_priv_caps *priv_caps =
(const struct icom_priv_caps *) rig->caps->priv;
@@ -313,6 +312,7 @@ int dumpcaps(RIG *rig, FILE *fout)
}
else
{
+
for (i = 0; i < HAMLIB_MAX_AGC_LEVELS && i < caps->agc_level_count; i++)
{
fprintf(fout, " %d=%s", caps->agc_levels[i],
@@ -320,16 +320,13 @@ int dumpcaps(RIG *rig, FILE *fout)
}
}
-#else
- //fprintf(fout, "\n");
- fprintf(fout, "AGC levels: ");
- char buf[1024];
- rig_sprintf_agc_levels(rig, buf, (int)sizeof(buf));
- fprintf(fout, "%s", buf);
-#endif
+ fprintf(fout, "\n");
if (i == 0)
{
+ rig_debug(RIG_DEBUG_WARN,
+ "%s: defaulting to all levels since rig does not have any\n", __func__);
+
// Fall back to printing out all levels for backwards-compatibility
for (i = RIG_AGC_OFF; i <= RIG_AGC_LAST; i++)
{
commit db218e9e73e6763dafb7a7137656c4faf11ef360
Author: Mike Black W9MDB <mdb...@ya...>
Date: Fri Jan 6 10:30:32 2023 -0600
Update man pages to clarify upper/lower case for set/get commands
diff --git a/doc/man1/rigctl.1 b/doc/man1/rigctl.1
index d68fae78..3d95cc5e 100644
--- a/doc/man1/rigctl.1
+++ b/doc/man1/rigctl.1
@@ -373,12 +373,12 @@ Since most of the
.B Hamlib
operations have a
.BR set " and a " get
-method, an upper case letter will often be used for a
+method, a single upper case letter will often be used for a
.B set
-method whereas the corresponding lower case letter refers to the
+method whereas the corresponding single lower case letter refers to the
.B get
method. Each operation also has a long name; in interactive mode, prepend a
-backslash, \(oq\\\(cq, to enter a long command name.
+backslash, \(oq\\\(cq, to enter a long command name all lower case.
.
.PP
Example: Use \(lq\\dump_caps\(rq to see what capabilities this radio and
diff --git a/doc/man1/rigctld.1 b/doc/man1/rigctld.1
index 0e82f40d..6b55bf59 100644
--- a/doc/man1/rigctld.1
+++ b/doc/man1/rigctld.1
@@ -436,12 +436,12 @@ Since most of the
.B Hamlib
operations have a
.BR set " and a " get
-method, an upper case letter will be used for
+method, a single pper case letter will be used for
.B set
-methods whereas the corresponding lower case letter refers to the
+methods whereas the corresponding single lower case letter refers to the
.B get
method. Each operation also has a long name; prepend a backslash, \(oq\\\(cq,
-to send a long command name.
+to send a long command name all in lower case.
.
.PP
Example (Perl): \(lqprint $socket "\\\\dump_caps\\n";\(rq to see what the
commit 86771a95575116f31f498a8912d36e114f1109bc
Author: Mike Black W9MDB <mdb...@ya...>
Date: Fri Jan 6 07:56:11 2023 -0600
Update simelecraft.c
diff --git a/simulators/simelecraft.c b/simulators/simelecraft.c
index 0be6800e..1d34c05b 100644
--- a/simulators/simelecraft.c
+++ b/simulators/simelecraft.c
@@ -105,7 +105,7 @@ int main(int argc, char *argv[])
buf[0] = 0;
if (getmyline(fd, buf) > 0) { printf("Cmd:%s\n", buf); }
- else { return 0; }
+ else {continue; }
if (strcmp(buf, "RM5;") == 0)
{
@@ -149,6 +149,22 @@ int main(int argc, char *argv[])
if (n <= 0) { perror("ID"); }
}
+ else if (strcmp(buf, "PS;") == 0)
+ {
+ SNPRINTF(buf, sizeof(buf), "PS1;");
+ n = write(fd, buf, strlen(buf));
+ }
+ else if (strcmp(buf, "BW;") == 0)
+ {
+ SNPRINTF(buf, sizeof(buf), "BW0190;");
+ n = write(fd, buf, strlen(buf));
+ }
+ else if (strcmp(buf, "BN;") == 0)
+ {
+ SNPRINTF(buf, sizeof(buf), "BN03;");
+ n = write(fd, buf, strlen(buf));
+ }
+
#if 0
else if (strncmp(buf, "AI", 2) == 0)
@@ -199,29 +215,29 @@ int main(int argc, char *argv[])
}
else if (strcmp(buf, "K2;") == 0)
{
- write(fd, "K20;", 4);
+ n = write(fd, "K20;", 4);
}
else if (strcmp(buf, "K3;") == 0)
{
- write(fd, "K30;", 4);
+ n = write(fd, "K30;", 4);
}
else if (strcmp(buf, "RVM;") == 0)
{
- write(fd, "RV02.37;", 8);
+ n = write(fd, "RV02.37;", 8);
}
else if (strcmp(buf, "AI;") == 0)
{
- write(fd, "AI0;", 4);
+ n = write(fd, "AI0;", 4);
}
else if (strcmp(buf, "MD;") == 0)
{
SNPRINTF(buf, sizeof(buf), "MD%d;", modea);
- write(fd, buf, strlen(buf));
+ n = write(fd, buf, strlen(buf));
}
else if (strcmp(buf, "MD$;") == 0)
{
SNPRINTF(buf, sizeof(buf), "MD$%d;", modeb);
- write(fd, buf, strlen(buf));
+ n = write(fd, buf, strlen(buf));
}
else if (strncmp(buf, "MD", 2) == 0)
{
@@ -231,12 +247,12 @@ int main(int argc, char *argv[])
else if (strcmp(buf, "FA;") == 0)
{
SNPRINTF(buf, sizeof(buf), "FA%011d;", freqa);
- write(fd, buf, strlen(buf));
+ n = write(fd, buf, strlen(buf));
}
else if (strcmp(buf, "FB;") == 0)
{
SNPRINTF(buf, sizeof(buf), "FB%011d;", freqb);
- write(fd, buf, strlen(buf));
+ n = write(fd, buf, strlen(buf));
}
else if (strncmp(buf, "FA", 2) == 0)
@@ -250,17 +266,17 @@ int main(int argc, char *argv[])
else if (strncmp(buf, "FR;", 3) == 0)
{
SNPRINTF(buf, sizeof(buf), "FR0;");
- write(fd, buf, strlen(buf));
+ n = write(fd, buf, strlen(buf));
}
else if (strncmp(buf, "FT;", 3) == 0)
{
SNPRINTF(buf, sizeof(buf), "FT0;");
- write(fd, buf, strlen(buf));
+ n = write(fd, buf, strlen(buf));
}
else if (strncmp(buf, "TQ;", 3) == 0)
{
SNPRINTF(buf, sizeof(buf), "TQ0;");
- write(fd, buf, strlen(buf));
+ n = write(fd, buf, strlen(buf));
}
else if (strlen(buf) > 0)
{
commit e6c5c15452bad475ddf69c0ae74cd63e6bc347b3
Author: Mike Black W9MDB <mdb...@ya...>
Date: Thu Jan 5 23:32:41 2023 -0600
Update NEWS
diff --git a/NEWS b/NEWS
index ae716d06..0924a332 100644
--- a/NEWS
+++ b/NEWS
@@ -26,6 +26,7 @@ Version 4.6
Version 4.5.4
* 2023-XX-XX
+ * Fix rig_power2mW so it checks all ranges
* Allow rigctld to start with autopower_on=0 to avoid startup timeouts when rig is powered off
* Fix dummy device to work with grig by disallowing empty "u" call
* Fix ID5100 and promote to stable and hopefully ID4100 too
commit bbd0f856ca3f26b5d6367c4ca3d8519e58458e08
Author: Mike Black W9MDB <mdb...@ya...>
Date: Thu Jan 5 23:31:15 2023 -0600
Fix rig_getpower2mW so it checks all range lists
https://github.com/Hamlib/Hamlib/issues/1205
diff --git a/src/rig.c b/src/rig.c
index 7422fd27..eaac46ec 100644
--- a/src/rig.c
+++ b/src/rig.c
@@ -5851,11 +5851,23 @@ int HAMLIB_API rig_power2mW(RIG *rig,
txrange = rig_get_range(rig->state.tx_range_list, freq, mode);
- if (!txrange)
+ // check all the range lists
+ if (txrange == NULL) { rig_get_range(rig->caps->tx_range_list1, freq, mode); }
+
+ if (txrange == NULL) { rig_get_range(rig->caps->tx_range_list2, freq, mode); }
+
+ if (txrange == NULL) { rig_get_range(rig->caps->tx_range_list3, freq, mode); }
+
+ if (txrange == NULL) { rig_get_range(rig->caps->tx_range_list4, freq, mode); }
+
+ if (txrange == NULL) { rig_get_range(rig->caps->tx_range_list5, freq, mode); }
+
+ if (txrange == NULL)
{
/*
* freq is not on the tx range!
*/
+ rig_debug(RIG_DEBUG_ERR, "%s: freq not in tx range\n", __func__);
RETURNFUNC(-RIG_EINVAL);
}
@@ -6847,7 +6859,7 @@ const freq_range_t *HAMLIB_API rig_get_range(const freq_range_t *range_list,
{
int i;
- if (!range_list)
+ if (range_list == NULL)
{
return (NULL);
}
commit 31d2939acc21fe58b5f203fa5a1c1e6bebb947c4
Author: Mike Black W9MDB <mdb...@ya...>
Date: Thu Jan 5 10:02:46 2023 -0600
Fix auto_power_on check in rigctld.c
diff --git a/tests/rigctld.c b/tests/rigctld.c
index e52f57f1..f61c9ff0 100644
--- a/tests/rigctld.c
+++ b/tests/rigctld.c
@@ -510,7 +510,7 @@ int main(int argc, char *argv[])
exit(1);
}
- if (strcmp(optarg, "autopower_on=0") == 0)
+ if (strcmp(optarg, "auto_power_on=0") == 0)
{
rig_debug(RIG_DEBUG_ERR, "%s: skipping rig_open\n", __func__);
skip_open = 1;
commit 589736e8f7e8e8def8f136436a8b9af72c32d31b
Author: Mike Black W9MDB <mdb...@ya...>
Date: Wed Jan 4 17:33:55 2023 -0600
Add simid5100.c
diff --git a/simulators/simid5100.c b/simulators/simid5100.c
new file mode 100644
index 00000000..3db0a01f
--- /dev/null
+++ b/simulators/simid5100.c
@@ -0,0 +1,476 @@
+// simicom will show the pts port to use for rigctl on Unix
+// using virtual serial ports on Windows is to be developed yet
+// Needs a lot of improvement to work on all Icoms
+// gcc -g -Wall -o simicom simicom.c -lhamlib
+// On mingw in the hamlib src directory
+// gcc -static -I../include -g -Wall -o simicom simicom.c -L../../build/src/.libs -lhamlib -lwsock32 -lws2_32
+#define _XOPEN_SOURCE 600
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <sys/time.h>
+#include <hamlib/rig.h>
+#include "../src/misc.h"
+#include <termios.h>
+#include <unistd.h>
+
+
+#define BUFSIZE 256
+
+int civ_731_mode = 0;
+vfo_t current_vfo = RIG_VFO_A;
+int split = 0;
+
+// we make B different from A to ensure we see a difference at startup
+float freqA = 145000000;
+float freqB = 14074500;
+mode_t modeA = RIG_MODE_PKTUSB;
+mode_t modeB = RIG_MODE_PKTUSB;
+int datamodeA = 0;
+int datamodeB = 0;
+int filterA = 0;
+ant_t ant_curr = 0;
+int ant_option = 0;
+int ptt = 0;
+int satmode = 0;
+int agc_time = 1;
+int ovf_status = 0;
+int powerstat = 1;
+
+void dumphex(unsigned char *buf, int n)
+{
+ for (int i = 0; i < n; ++i) { printf("%02x ", buf[i]); }
+
+ printf("\n");
+}
+
+int
+frameGet(int fd, unsigned char *buf)
+{
+ int i = 0;
+ memset(buf, 0, BUFSIZE);
+ unsigned char c;
+
+again:
+
+ while (read(fd, &c, 1) > 0)
+ {
+ buf[i++] = c;
+ //printf("i=%d, c=0x%02x\n",i,c);
+
+ if (c == 0xfd)
+ {
+ dumphex(buf, i);
+ return i;
+ }
+
+ if (i > 2 && c == 0xfe)
+ {
+ printf("Turning power on due to 0xfe string\n");
+ powerstat = 1;
+ int j;
+
+ for (j = i; j < 175; ++j)
+ {
+ if (read(fd, &c, 1) < 0) { break; }
+ }
+
+ i = 0;
+ goto again;
+ }
+ }
+
+ printf("Error???\n");
+
+ return 0;
+}
+
+void frameParse(int fd, unsigned char *frame, int len)
+{
+ double freq;
+ int n = 0;
+
+ dumphex(frame, len);
+
+ if (frame[0] != 0xfe && frame[1] != 0xfe)
+ {
+ printf("expected fe fe, got ");
+ dumphex(frame, len);
+ return;
+ }
+
+ switch (frame[4])
+ {
+ case 0x00:
+ freq = from_bcd(&frame[5], 5 * 2);
+ freqA = freq;
+ printf("freq=%lf\n", freqA);
+ break;
+ case 0x03:
+
+ //from_bcd(frameackbuf[2], (civ_731_mode ? 4 : 5) * 2);
+ if (current_vfo == RIG_VFO_A || current_vfo == RIG_VFO_MAIN)
+ {
+ printf("get_freqA\n");
+ to_bcd(&frame[5], (long long)freqA/10000, 3 * 2);
+ dump_hex(frame,11);
+ }
+ else
+ {
+ printf("get_freqB\n");
+ to_bcd(&frame[5], (long long)freqB/10000, 3 * 2);
+ }
+
+ frame[8] = 0xfd;
+ dump_hex(frame,9);
+
+ n = write(fd, frame, 9);
+
+ break;
+
+ case 0x04:
+ if (current_vfo == RIG_VFO_A || current_vfo == RIG_VFO_MAIN)
+ {
+ printf("get_modeA\n");
+ frame[5] = modeA;
+ frame[6] = filterA;
+ }
+ else
+ {
+ printf("get_modeB\n");
+ frame[5] = modeB;
+ frame[6] = filterA;
+ }
+
+ frame[7] = 0xfd;
+ n = write(fd, frame, 8);
+ break;
+
+ case 0x05:
+ freq = from_bcd(&frame[5], (civ_731_mode ? 4 : 5) * 2);
+ printf("set_freq to %.0f\n", freq);
+
+ if (current_vfo == RIG_VFO_A || current_vfo == RIG_VFO_MAIN) { freqA = freq; }
+ else { freqB = freq; }
+
+ frame[4] = 0xfb;
+ frame[5] = 0xfd;
+ n = write(fd, frame, 6);
+ break;
+
+ case 0x06:
+ if (current_vfo == RIG_VFO_A || current_vfo == RIG_VFO_MAIN) { modeA = frame[6]; }
+ else { modeB = frame[6]; }
+
+ frame[4] = 0xfb;
+ frame[5] = 0xfd;
+ n = write(fd, frame, 6);
+ break;
+
+ case 0x07:
+
+ switch (frame[5])
+ {
+ case 0x00: current_vfo = RIG_VFO_A; break;
+
+ case 0x01: current_vfo = RIG_VFO_B; break;
+
+ case 0xd0: current_vfo = RIG_VFO_MAIN; break;
+
+ case 0xd1: current_vfo = RIG_VFO_SUB; break;
+ }
+
+ printf("set_vfo to %s\n", rig_strvfo(current_vfo));
+
+ frame[4] = 0xfb;
+ frame[5] = 0xfd;
+ n = write(fd, frame, 6);
+ break;
+
+ case 0x0f:
+ if (frame[5] == 0) { split = 0; }
+ else if (frame[5] == 1) { split = 1; }
+ else { frame[6] = split; }
+
+ if (frame[5] == 0xfd)
+ {
+ printf("get split %d\n", 1);
+ frame[7] = 0xfd;
+ n = write(fd, frame, 8);
+ }
+ else
+ {
+ printf("set split %d\n", 1);
+ frame[4] = 0xfb;
+ frame[5] = 0xfd;
+ n = write(fd, frame, 6);
+ }
+
+ break;
+
+ case 0x12: // we're simulating the 3-byte version -- not the 2-...
[truncated message content] |
|
From: n0nb <n0...@us...> - 2023-01-03 01:57:55
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Hamlib -- Ham radio control libraries".
The branch, master has been updated
via 9f0bd7b310e7d21c857052cb6249d6210caabd61 (commit)
via 0b2f0873b036b339f5f65412cc17a464cc2ef3ba (commit)
via c7b33ef0b3296a88ca387db1ac3634e19075dab1 (commit)
via f68d45d99b5b08ac64d19a20d8aedfc27270de3e (commit)
via fa7289995c29719739edd13d3e945248adc0905a (commit)
via 582686505cbbc43f2013b7b8355d1f877671ef7e (commit)
via 712564a2ae97343c5ed7001f90e79716939ed1d0 (commit)
via 2fc1d157baa1454307665d759ee41b9cc9e1b8da (commit)
via b1fcdea72d35a3648bacf202f8614d8ac33bc197 (commit)
via 1ee37d0a563de967ec0855bcd7f96bfb394e4866 (commit)
via c1662ce8865c7ff585f5085a1f8ecd6c3ac8b042 (commit)
via 1bb1f545ebe7cf4f1aec069598e1f2545484f0ca (commit)
via 64c566cd14b743c91563c986cd70c0a3be431b9d (commit)
via b6654c78cba91a2818c9380710f1af91bde8f5ab (commit)
via f67a53c41c0067d495e4a30c131df94301e43d47 (commit)
via 04ccccb02d2819899a2981dea219318908529d4d (commit)
via 7e81e8552a6fdc121e3427e4afb97bfa31f8619a (commit)
via 1fd44dcef2c17db8923f1b41c84619ddf882d8fb (commit)
via 2306ee4f1dd73f942f07c34d870a891e43377d46 (commit)
via 606aea1552e173a793b206cb9ec2733ff59dc322 (commit)
via cfc2e28c1968638bf20802ffa188f02cb4faeb94 (commit)
via a75b274f6f4dd4ef5690581d0ecce653fbd29b1a (commit)
via ab511cbea65c6764410ed5a623106175675d14d3 (commit)
via 0450b36c67e59403983d1170058b8fe67c949d8e (commit)
via bc6c14e43048179a99805bc434e139b5e253327e (commit)
via c59b5383e9371c8d638f9f8d727f1ca612ad229e (commit)
via 97ef9e5beae4e30ecfa26a09f2d1bfcbb61e2184 (commit)
via 5db44be3ba1bbca5da66ed23b4bd6fdad3d7d054 (commit)
via e70465a9c04c16c34a4ddc0e2b811ec12f9ece4b (commit)
from b61550bf6b53c0cef885ed1443967a6c9aa2fb78 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 9f0bd7b310e7d21c857052cb6249d6210caabd61
Author: Mike Black W9MDB <mdb...@ya...>
Date: Mon Jan 2 11:38:27 2023 -0600
Add rigctltcp.c -- not working yet
diff --git a/tests/rigctltcp.c b/tests/rigctltcp.c
new file mode 100644
index 00000000..81080ef3
--- /dev/null
+++ b/tests/rigctltcp.c
@@ -0,0 +1,1563 @@
+/*
+ * rigctltcp.c - (C) Stephane Fillod 2000-2011
+ * (C) Nate Bargmann 2008,2010,2011,2012,2013
+ * (C) The Hamlib Group 2012-2022
+ *
+ * This program test/control a radio using Hamlib.
+ * It takes commands from a tcp network connection.
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ */
+
+#include <hamlib/config.h>
+
+#ifdef WIN32
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <ctype.h>
+#include <errno.h>
+#include <signal.h>
+
+#include <getopt.h>
+
+#include <sys/types.h> /* See NOTES */
+
+#ifdef HAVE_NETINET_IN_H
+# include <netinet/in.h>
+#endif
+
+#ifdef HAVE_ARPA_INET_H
+# include <arpa/inet.h>
+#endif
+
+#ifdef HAVE_SYS_SOCKET_H
+# include <sys/socket.h>
+#elif HAVE_WS2TCPIP_H
+# include <ws2tcpip.h>
+# include <fcntl.h>
+# if defined(HAVE_WSPIAPI_H)
+# include <wspiapi.h>
+# endif
+#endif
+
+#ifdef HAVE_NETDB_H
+# include <netdb.h>
+#endif
+
+#ifdef HAVE_PTHREAD
+# include <pthread.h>
+#endif
+
+#include <hamlib/rig.h>
+#include "misc.h"
+#include "iofunc.h"
+#include "serial.h"
+#include "sprintflst.h"
+#include "network.h"
+
+#include "rigctl_parse.h"
+
+
+/*
+ * Reminder: when adding long options,
+ * keep up to date SHORT_OPTIONS, usage()'s output and man page. thanks.
+ * TODO: add an option to read from a file
+ */
+#define SHORT_OPTIONS "m:r:p:d:P:D:s:S:c:T:t:C:W:w:x:z:lLuovhVZMRA:n:"
+static struct option long_options[] =
+{
+ {"model", 1, 0, 'm'},
+ {"rig-file", 1, 0, 'r'},
+ {"ptt-file", 1, 0, 'p'},
+ {"dcd-file", 1, 0, 'd'},
+ {"ptt-type", 1, 0, 'P'},
+ {"dcd-type", 1, 0, 'D'},
+ {"serial-speed", 1, 0, 's'},
+ {"separator", 1, 0, 'S'},
+ {"civaddr", 1, 0, 'c'},
+ {"listen-addr", 1, 0, 'T'},
+ {"port", 1, 0, 't'},
+ {"set-conf", 1, 0, 'C'},
+ {"list", 0, 0, 'l'},
+ {"show-conf", 0, 0, 'L'},
+ {"dump-caps", 0, 0, 'u'},
+ {"vfo", 0, 0, 'o'},
+ {"verbose", 0, 0, 'v'},
+ {"help", 0, 0, 'h'},
+ {"version", 0, 0, 'V'},
+ {"twiddle_timeout", 1, 0, 'W'},
+ {"twiddle_rit", 1, 0, 'w'},
+ {"uplink", 1, 0, 'x'},
+ {"debug-time-stamps", 0, 0, 'Z'},
+ {"multicast-addr", 1, 0, 'M'},
+ {"multicast-port", 1, 0, 'n'},
+ {"password", 1, 0, 'A'},
+ {"rigctld-idle", 0, 0, 'R'},
+ {0, 0, 0, 0}
+};
+
+
+struct handle_data
+{
+ RIG *rig;
+ int sock;
+ struct sockaddr_storage cli_addr;
+ socklen_t clilen;
+ int vfo_mode;
+ int use_password;
+};
+
+
+void *handle_socket(void *arg);
+void usage(void);
+
+
+#ifdef HAVE_PTHREAD
+static unsigned client_count;
+#endif
+
+static RIG *my_rig; /* handle to rig (instance) */
+static volatile int rig_opened = 0;
+static int verbose;
+
+#ifdef HAVE_SIG_ATOMIC_T
+static sig_atomic_t volatile ctrl_c;
+#else
+static int volatile ctrl_c;
+#endif
+
+const char *portno = "4532";
+const char *src_addr = NULL; /* INADDR_ANY */
+const char *multicast_addr = "0.0.0.0";
+int multicast_port = 4532;
+extern char rigctld_password[65];
+char resp_sep = '\n';
+extern int lock_mode;
+extern powerstat_t rig_powerstat;
+static int rigctld_idle =
+ 0; // if true then rig will close when no clients are connected
+
+#define MAXCONFLEN 1024
+
+
+void mutex_rigctld(int lock)
+{
+#ifdef HAVE_PTHREAD
+ static pthread_mutex_t client_lock = PTHREAD_MUTEX_INITIALIZER;
+
+ if (lock)
+ {
+ pthread_mutex_lock(&client_lock);
+ rig_debug(RIG_DEBUG_VERBOSE, "%s: client lock engaged\n", __func__);
+ }
+ else
+ {
+ rig_debug(RIG_DEBUG_VERBOSE, "%s: client lock disengaged\n", __func__);
+ pthread_mutex_unlock(&client_lock);
+ }
+
+#endif
+}
+
+#ifdef WIN32
+static BOOL WINAPI CtrlHandler(DWORD fdwCtrlType)
+{
+ rig_debug(RIG_DEBUG_VERBOSE, "%s: called\n", __func__);
+
+ switch (fdwCtrlType)
+ {
+ case CTRL_C_EVENT:
+ case CTRL_CLOSE_EVENT:
+ ctrl_c = 1;
+ return TRUE;
+
+ default:
+ return FALSE;
+ }
+}
+#else
+static void signal_handler(int sig)
+{
+ switch (sig)
+ {
+ case SIGINT:
+ ctrl_c = 1;
+ break;
+
+ default:
+ /* do nothing */
+ break;
+ }
+}
+#endif
+
+static void handle_error(enum rig_debug_level_e lvl, const char *msg)
+{
+ int e;
+#ifdef __MINGW32__
+ LPVOID lpMsgBuf;
+
+ lpMsgBuf = (LPVOID)"Unknown error";
+ e = WSAGetLastError();
+
+ if (FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER
+ | FORMAT_MESSAGE_FROM_SYSTEM
+ | FORMAT_MESSAGE_IGNORE_INSERTS,
+ NULL, e,
+ MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
+ // Default language
+ (LPTSTR)&lpMsgBuf, 0, NULL))
+ {
+
+ rig_debug(lvl, "%s: Network error %d: %s\n", msg, e, (char *)lpMsgBuf);
+ LocalFree(lpMsgBuf);
+ }
+ else
+ {
+ rig_debug(lvl, "%s: Network error %d\n", msg, e);
+ }
+
+#else
+ e = errno;
+ rig_debug(lvl, "%s: Network error %d: %s\n", msg, e, strerror(e));
+#endif
+}
+
+int main(int argc, char *argv[])
+{
+ rig_model_t my_model = RIG_MODEL_DUMMY;
+
+ int retcode; /* generic return code from functions */
+
+ int show_conf = 0;
+ int dump_caps_opt = 0;
+ const char *rig_file = NULL, *ptt_file = NULL, *dcd_file = NULL;
+ ptt_type_t ptt_type = RIG_PTT_NONE;
+ dcd_type_t dcd_type = RIG_DCD_NONE;
+ int serial_rate = 0;
+ char *civaddr = NULL; /* NULL means no need to set conf */
+ char conf_parms[MAXCONFLEN] = "";
+
+ struct addrinfo hints, *result, *saved_result;
+ int sock_listen;
+ int reuseaddr = 1;
+ int twiddle_timeout = 0;
+ int twiddle_rit = 0;
+ int uplink = 0;
+ char host[NI_MAXHOST];
+ char serv[NI_MAXSERV];
+ char rigstartup[1024];
+ char vbuf[1024];
+#if HAVE_SIGACTION
+ struct sigaction act;
+#endif
+
+#ifdef HAVE_PTHREAD
+ pthread_t thread;
+ pthread_attr_t attr;
+#endif
+ struct handle_data *arg;
+ int vfo_mode = 0; /* vfo_mode=0 means target VFO is current VFO */
+ int i;
+ extern int is_rigctld;
+
+ is_rigctld = 1;
+
+ int err = setvbuf(stderr, vbuf, _IOFBF, sizeof(vbuf));
+
+ if (err) { rig_debug(RIG_DEBUG_ERR, "%s: setvbuf err=%s\n", __func__, strerror(err)); }
+
+
+ while (1)
+ {
+ int c;
+ int option_index = 0;
+ char dummy[2];
+
+ c = getopt_long(argc,
+ argv,
+ SHORT_OPTIONS,
+ long_options,
+ &option_index);
+
+ if (c == -1)
+ {
+ break;
+ }
+
+ switch (c)
+ {
+ case 'h':
+ usage();
+ exit(0);
+
+ case 'V':
+ printf("rigctl %s\n", hamlib_version2);
+ exit(0);
+
+ case 'R':
+ rigctld_idle = 1;
+ break;
+
+ case 'A':
+ strncpy(rigctld_password, optarg, sizeof(rigctld_password) - 1);
+ //char *md5 = rig_make_m d5(rigctld_password);
+ char md5[HAMLIB_SECRET_LENGTH + 1];
+ rig_password_generate_secret(rigctld_password, md5);
+ printf("Secret key: %s\n", md5);
+ rig_settings_save("sharedkey", md5, e_CHAR);
+ break;
+
+ case 'm':
+ if (!optarg)
+ {
+ usage(); /* wrong arg count */
+ exit(1);
+ }
+
+ my_model = atoi(optarg);
+ break;
+
+ case 'r':
+ if (!optarg)
+ {
+ usage(); /* wrong arg count */
+ exit(1);
+ }
+
+ rig_file = optarg;
+ break;
+
+ case 'p':
+ if (!optarg)
+ {
+ usage(); /* wrong arg count */
+ exit(1);
+ }
+
+ ptt_file = optarg;
+ break;
+
+ case 'd':
+ if (!optarg)
+ {
+ usage(); /* wrong arg count */
+ exit(1);
+ }
+
+ dcd_file = optarg;
+ break;
+
+ case 'P':
+ if (!optarg)
+ {
+ usage(); /* wrong arg count */
+ exit(1);
+ }
+
+ if (!strcmp(optarg, "RIG"))
+ {
+ ptt_type = RIG_PTT_RIG;
+ }
+ else if (!strcmp(optarg, "DTR"))
+ {
+ ptt_type = RIG_PTT_SERIAL_DTR;
+ }
+ else if (!strcmp(optarg, "RTS"))
+ {
+ ptt_type = RIG_PTT_SERIAL_RTS;
+ }
+ else if (!strcmp(optarg, "PARALLEL"))
+ {
+ ptt_type = RIG_PTT_PARALLEL;
+ }
+ else if (!strcmp(optarg, "CM108"))
+ {
+ ptt_type = RIG_PTT_CM108;
+ }
+ else if (!strcmp(optarg, "GPIO"))
+ {
+ ptt_type = RIG_PTT_GPIO;
+ }
+ else if (!strcmp(optarg, "GPION"))
+ {
+ ptt_type = RIG_PTT_GPION;
+ }
+ else if (!strcmp(optarg, "NONE"))
+ {
+ ptt_type = RIG_PTT_NONE;
+ }
+ else
+ {
+ puts("Unrecognised PTT type, using NONE");
+ ptt_type = RIG_PTT_NONE;
+ }
+
+ break;
+
+ case 'D':
+ if (!optarg)
+ {
+ usage(); /* wrong arg count */
+ exit(1);
+ }
+
+ if (!strcmp(optarg, "RIG"))
+ {
+ dcd_type = RIG_DCD_RIG;
+ }
+ else if (!strcmp(optarg, "DSR"))
+ {
+ dcd_type = RIG_DCD_SERIAL_DSR;
+ }
+ else if (!strcmp(optarg, "CTS"))
+ {
+ dcd_type = RIG_DCD_SERIAL_CTS;
+ }
+ else if (!strcmp(optarg, "CD"))
+ {
+ dcd_type = RIG_DCD_SERIAL_CAR;
+ }
+ else if (!strcmp(optarg, "PARALLEL"))
+ {
+ dcd_type = RIG_DCD_PARALLEL;
+ }
+ else if (!strcmp(optarg, "CM108"))
+ {
+ dcd_type = RIG_DCD_CM108;
+ }
+ else if (!strcmp(optarg, "GPIO"))
+ {
+ dcd_type = RIG_DCD_GPIO;
+ }
+ else if (!strcmp(optarg, "GPION"))
+ {
+ dcd_type = RIG_DCD_GPION;
+ }
+ else if (!strcmp(optarg, "NONE"))
+ {
+ dcd_type = RIG_DCD_NONE;
+ }
+ else
+ {
+ puts("Unrecognised DCD type, using NONE");
+ dcd_type = RIG_DCD_NONE;
+ }
+
+ break;
+
+ case 'c':
+ if (!optarg)
+ {
+ usage(); /* wrong arg count */
+ exit(1);
+ }
+
+ civaddr = optarg;
+ break;
+
+ case 'S':
+ if (!optarg)
+ {
+ usage(); /* wrong arg count */
+ exit(1);
+ }
+
+ resp_sep = *optarg;
+ rig_debug(RIG_DEBUG_VERBOSE, "%s: resp_sep=%c\n", __func__, resp_sep);
+ break;
+
+ case 's':
+ if (!optarg)
+ {
+ usage(); /* wrong arg count */
+ exit(1);
+ }
+
+ if (sscanf(optarg, "%d%1s", &serial_rate, dummy) != 1)
+ {
+ fprintf(stderr, "Invalid baud rate of %s\n", optarg);
+ exit(1);
+ }
+
+ break;
+
+ case 'C':
+ if (!optarg)
+ {
+ usage(); /* wrong arg count */
+ exit(1);
+ }
+
+ if (*conf_parms != '\0')
+ {
+ strcat(conf_parms, ",");
+ }
+
+ if (strlen(conf_parms) + strlen(optarg) > MAXCONFLEN - 24)
+ {
+ printf("Length of conf_parms exceeds internal maximum of %d\n",
+ MAXCONFLEN - 24);
+ return 1;
+ }
+
+ strncat(conf_parms, optarg, MAXCONFLEN - strlen(conf_parms));
+ break;
+
+ case 't':
+ if (!optarg)
+ {
+ usage(); /* wrong arg count */
+ exit(1);
+ }
+
+ portno = optarg;
+ break;
+
+ case 'T':
+ if (!optarg)
+ {
+ usage(); /* wrong arg count */
+ exit(1);
+ }
+
+ src_addr = optarg;
+ break;
+
+ case 'o':
+ vfo_mode++;
+ //rig_debug(RIG_DEBUG_ERR, "%s: #0 vfo_mode=%d\n", __func__, vfo_mode);
+ break;
+
+ case 'v':
+ verbose++;
+ break;
+
+ case 'L':
+ show_conf++;
+ break;
+
+ case 'l':
+ list_models();
+ exit(0);
+
+ case 'u':
+ dump_caps_opt++;
+ break;
+
+ case 'W':
+ if (!optarg)
+ {
+ usage(); /* wrong arg count */
+ exit(1);
+ }
+
+ twiddle_timeout = atoi(optarg);
+ fprintf(stderr,
+ "twiddle_timeout is deprecated...use e.g. --set-conf=twiddle_timeout=5\n");
+ break;
+
+ case 'w':
+ if (!optarg)
+ {
+ usage(); /* wrong arg count */
+ exit(1);
+ }
+
+ twiddle_rit = atoi(optarg);
+ fprintf(stderr,
+ "twiddle_timeout is deprecated...use e.g. --set-conf=twiddle_timeout=5\n");
+ break;
+
+
+ case 'x':
+ if (!optarg)
+ {
+ usage(); /* wrong arg count */
+ exit(1);
+ }
+
+ uplink = atoi(optarg);
+ break;
+
+
+ case 'Z':
+ rig_set_debug_time_stamp(1);
+ break;
+
+ case 'M':
+ if (!optarg)
+ {
+ usage(); /* wrong arg count */
+ exit(1);
+ }
+
+ multicast_addr = optarg;
+ break;
+
+ case 'n':
+ if (!optarg)
+ {
+ usage(); /* wrong arg count */
+ exit(1);
+ }
+
+ multicast_port = atoi(optarg);
+
+ if (multicast_port == 0)
+ {
+ fprintf(stderr, "Invalid multicast port: %s\n", optarg);
+ exit(1);
+ }
+
+ break;
+
+ default:
+ usage(); /* unknown option? */
+ exit(1);
+ }
+ }
+
+#if 0
+
+ if (!vfo_mode)
+ {
+ printf("Recommend using --vfo switch for rigctld if client supports it\n");
+ printf("rigctl and netrigctl will automatically detect vfo mode\n");
+ }
+
+#endif
+
+ rig_set_debug(verbose);
+
+ SNPRINTF(rigstartup, sizeof(rigstartup), "%s(%d) Startup:", __FILE__, __LINE__);
+
+ for (i = 0; i < argc; ++i) { strcat(rigstartup, " "); strcat(rigstartup, argv[i]); }
+
+ rig_debug(RIG_DEBUG_VERBOSE, "%s\n", rigstartup);
+
+ rig_debug(RIG_DEBUG_VERBOSE, "rigctld %s\n", hamlib_version2);
+ rig_debug(RIG_DEBUG_VERBOSE, "%s",
+ "Report bugs to <ham...@li...>\n\n");
+ rig_debug(RIG_DEBUG_VERBOSE, "Max# of rigctld client services=%d\n",
+ NI_MAXSERV);
+
+ my_rig = rig_init(my_model);
+
+ if (!my_rig)
+ {
+ fprintf(stderr,
+ "Unknown rig num %u, or initialization error.\n",
+ my_model);
+
+ fprintf(stderr, "Please check with --list option.\n");
+ exit(2);
+ }
+
+ retcode = set_conf(my_rig, conf_parms);
+
+ if (retcode != RIG_OK)
+ {
+ fprintf(stderr, "Config parameter error: %s\n", rigerror(retcode));
+ exit(2);
+ }
+
+ if (rig_file)
+ {
+ strncpy(my_rig->state.rigport.pathname, rig_file, HAMLIB_FILPATHLEN - 1);
+ }
+
+ my_rig->state.twiddle_timeout = twiddle_timeout;
+ my_rig->state.twiddle_rit = twiddle_rit;
+ my_rig->state.uplink = uplink;
+ rig_debug(RIG_DEBUG_TRACE, "%s: twiddle=%d, uplink=%d, twiddle_rit=%d\n",
+ __func__,
+ my_rig->state.twiddle_timeout, my_rig->state.uplink, my_rig->state.twiddle_rit);
+
+ /*
+ * ex: RIG_PTT_PARALLEL and /dev/parport0
+ */
+ if (ptt_type != RIG_PTT_NONE)
+ {
+ my_rig->state.pttport.type.ptt = ptt_type;
+ my_rig->state.pttport_deprecated.type.ptt = ptt_type;
+ // This causes segfault since backend rig_caps are const
+ // rigctld will use the rig->state version of this for clients
+ //my_rig->caps->ptt_type = ptt_type;
+ }
+
+ if (dcd_type != RIG_DCD_NONE)
+ {
+ my_rig->state.dcdport.type.dcd = dcd_type;
+ my_rig->state.dcdport_deprecated.type.dcd = dcd_type;
+ }
+
+ if (ptt_file)
+ {
+ strncpy(my_rig->state.pttport.pathname, ptt_file, HAMLIB_FILPATHLEN - 1);
+ strncpy(my_rig->state.pttport_deprecated.pathname, ptt_file,
+ HAMLIB_FILPATHLEN - 1);
+ }
+
+ if (dcd_file)
+ {
+ strncpy(my_rig->state.dcdport.pathname, dcd_file, HAMLIB_FILPATHLEN - 1);
+ strncpy(my_rig->state.dcdport_deprecated.pathname, dcd_file,
+ HAMLIB_FILPATHLEN - 1);
+ }
+
+ /* FIXME: bound checking and port type == serial */
+ if (serial_rate != 0)
+ {
+ my_rig->state.rigport.parm.serial.rate = serial_rate;
+ my_rig->state.rigport_deprecated.parm.serial.rate = serial_rate;
+ }
+
+ if (civaddr)
+ {
+ rig_set_conf(my_rig, rig_token_lookup(my_rig, "civaddr"), civaddr);
+ }
+
+ /*
+ * print out conf parameters
+ */
+ if (show_conf)
+ {
+ rig_token_foreach(my_rig, print_conf_list, (rig_ptr_t)my_rig);
+ }
+
+ /*
+ * print out conf parameters, and exits immediately
+ * We may be interested only in only caps, and rig_open may fail.
+ */
+ if (dump_caps_opt)
+ {
+ dumpcaps(my_rig, stdout);
+ rig_cleanup(my_rig); /* if you care about memory */
+ exit(0);
+ }
+
+ /* attempt to open rig to check early for issues */
+ retcode = rig_open(my_rig);
+ rig_opened = retcode == RIG_OK ? 1 : 0;
+
+ if (retcode != RIG_OK)
+ {
+ fprintf(stderr, "rig_open: error = %s %s %s \n", rigerror(retcode), rig_file,
+ strerror(errno));
+ // continue even if opening the rig fails, because it may be powered off
+ }
+
+ if (verbose > RIG_DEBUG_ERR)
+ {
+ printf("Opened rig model %u, '%s'\n",
+ my_rig->caps->rig_model,
+ my_rig->caps->model_name);
+ }
+
+ rig_debug(RIG_DEBUG_VERBOSE, "Backend version: %s, Status: %s\n",
+ my_rig->caps->version, rig_strstatus(my_rig->caps->status));
+
+ // Normally we keep the rig open to speed up the 1st client connect
+ // But some rigs like the FT-736 have to lock the rig for CAT control
+ // So they need to release the rig when no clients are connected
+ if (rigctld_idle)
+ {
+ rig_close(my_rig); /* we will reopen for clients */
+
+ if (verbose > RIG_DEBUG_ERR)
+ {
+ printf("Closed rig model %d, '%s - will reopen for clients'\n",
+ my_rig->caps->rig_model,
+ my_rig->caps->model_name);
+ }
+ }
+
+#ifdef __MINGW32__
+# ifndef SO_OPENTYPE
+# define SO_OPENTYPE 0x7008
+# endif
+# ifndef SO_SYNCHRONOUS_NONALERT
+# define SO_SYNCHRONOUS_NONALERT 0x20
+# endif
+# ifndef INVALID_SOCKET
+# define INVALID_SOCKET -1
+# endif
+
+ WSADATA wsadata;
+
+ if (WSAStartup(MAKEWORD(1, 1), &wsadata) == SOCKET_ERROR)
+ {
+ fprintf(stderr, "WSAStartup socket error\n");
+ exit(1);
+ }
+
+ {
+ int sockopt = SO_SYNCHRONOUS_NONALERT;
+ setsockopt(INVALID_SOCKET, SOL_SOCKET, SO_OPENTYPE, (char *)&sockopt,
+ sizeof(sockopt));
+ }
+
+#endif
+
+ /*
+ * Prepare listening socket
+ */
+ memset(&hints, 0, sizeof(struct addrinfo));
+ hints.ai_family = AF_UNSPEC; /* Allow IPv4 or IPv6 */
+ hints.ai_socktype = SOCK_STREAM;/* TCP socket */
+ hints.ai_flags = AI_PASSIVE; /* For wildcard IP address */
+ hints.ai_protocol = 0; /* Any protocol */
+
+ retcode = getaddrinfo(src_addr, portno, &hints, &result);
+
+ if (retcode == 0 && result->ai_family == AF_INET6)
+ {
+ rig_debug(RIG_DEBUG_TRACE, "%s: Using IPV6\n", __func__);
+ }
+ else if (retcode == 0)
+ {
+ rig_debug(RIG_DEBUG_TRACE, "%s: Using IPV4\n", __func__);
+ }
+ else
+ {
+ fprintf(stderr, "getaddrinfo: %s\n", gai_strerror(retcode));
+ exit(2);
+ }
+
+ saved_result = result;
+
+ enum multicast_item_e items = RIG_MULTICAST_POLL | RIG_MULTICAST_TRANSCEIVE |
+ RIG_MULTICAST_SPECTRUM;
+ retcode = network_multicast_publisher_start(my_rig, multicast_addr,
+ multicast_port, items);
+
+ if (retcode != RIG_OK)
+ {
+ rig_debug(RIG_DEBUG_ERR, "%s: network_multicast_server failed: %s\n", __FILE__,
+ rigerror(retcode));
+ // we will consider this non-fatal for now
+ }
+
+ do
+ {
+ sock_listen = socket(result->ai_family,
+ result->ai_socktype,
+ result->ai_protocol);
+
+ if (sock_listen < 0)
+ {
+ handle_error(RIG_DEBUG_ERR, "socket");
+ freeaddrinfo(saved_result); /* No longer needed */
+ exit(2);
+ }
+
+ if (setsockopt(sock_listen,
+ SOL_SOCKET,
+ SO_REUSEADDR,
+ (char *)&reuseaddr,
+ sizeof(reuseaddr))
+ < 0)
+ {
+
+ handle_error(RIG_DEBUG_ERR, "setsockopt");
+ freeaddrinfo(saved_result); /* No longer needed */
+ exit(1);
+ }
+
+#ifdef IPV6_V6ONLY
+
+ if (AF_INET6 == result->ai_family)
+ {
+ /* allow IPv4 mapped to IPv6 clients Windows and BSD default
+ this to 1 (i.e. disallowed) and we prefer it off */
+ int sockopt = 0;
+
+ if (setsockopt(sock_listen,
+ IPPROTO_IPV6,
+ IPV6_V6ONLY,
+ (char *)&sockopt,
+ sizeof(sockopt))
+ < 0)
+ {
+
+ handle_error(RIG_DEBUG_ERR, "setsockopt");
+ freeaddrinfo(saved_result); /* No longer needed */
+ exit(1);
+ }
+ }
+
+#endif
+
+ if (0 == bind(sock_listen, result->ai_addr, result->ai_addrlen))
+ {
+ break;
+ }
+
+ handle_error(RIG_DEBUG_WARN, "binding failed (trying next interface)");
+#ifdef __MINGW32__
+ closesocket(sock_listen);
+#else
+ close(sock_listen);
+#endif
+ }
+ while ((result = result->ai_next) != NULL);
+
+ freeaddrinfo(saved_result); /* No longer needed */
+
+ if (NULL == result)
+ {
+ rig_debug(RIG_DEBUG_ERR, "%s: bind error - no available interface\n", __func__);
+ exit(1);
+ }
+
+ if (listen(sock_listen, 4) < 0)
+ {
+ handle_error(RIG_DEBUG_ERR, "listening");
+ exit(1);
+ }
+
+#if HAVE_SIGACTION
+
+#ifdef SIGPIPE
+ /* Ignore SIGPIPE as we will handle it at the write()/send() calls
+ that will consequently fail with EPIPE. All child threads will
+ inherit this disposition which is what we want. */
+ memset(&act, 0, sizeof act);
+ act.sa_handler = SIG_IGN;
+ act.sa_flags = SA_RESTART;
+
+ if (sigaction(SIGPIPE, &act, NULL))
+ {
+ handle_error(RIG_DEBUG_ERR, "sigaction SIGPIPE");
+ }
+
+#endif
+
+#ifdef SIGINT
+ memset(&act, 0, sizeof act);
+ act.sa_handler = signal_handler;
+
+ if (sigaction(SIGINT, &act, NULL))
+ {
+ handle_error(RIG_DEBUG_ERR, "sigaction SIGINT");
+ }
+
+#endif
+#elif defined (WIN32)
+
+ if (!SetConsoleCtrlHandler(CtrlHandler, TRUE))
+ {
+ handle_error(RIG_DEBUG_ERR, "SetConsoleCtrlHandler");
+ }
+
+#elif HAVE_SIGNAL
+#ifdef SIGPIPE
+
+ if (SIG_ERR == signal(SIGPIPE, SIG_IGN))
+ {
+ handle_error(RIG_DEBUG_ERR, "signal SIGPIPE");
+ }
+
+#endif
+#ifdef SIGINT
+
+ if (SIG_ERR == signal(SIGINT, signal_handler))
+ {
+ handle_error(RIG_DEBUG_ERR, "signal SIGINT");
+ }
+
+#endif
+#endif
+
+ /*
+ * main loop accepting connections
+ */
+ rig_debug(RIG_DEBUG_TRACE, "%s: rigctltcp listening on port %s\n", __func__,
+ portno);
+
+ do
+ {
+ fd_set set;
+ struct timeval timeout;
+
+ arg = calloc(1, sizeof(struct handle_data));
+
+ if (!arg)
+ {
+ rig_debug(RIG_DEBUG_ERR, "calloc: %s\n", strerror(errno));
+ exit(1);
+ }
+
+ if (rigctld_password[0] != 0) { arg->use_password = 1; }
+
+ /* use select to allow for periodic checks for CTRL+C */
+ FD_ZERO(&set);
+ FD_SET(sock_listen, &set);
+ timeout.tv_sec = 5;
+ timeout.tv_usec = 0;
+ retcode = select(sock_listen + 1, &set, NULL, NULL, &timeout);
+
+ if (retcode == -1)
+ {
+ int errno_stored = errno;
+ rig_debug(RIG_DEBUG_ERR, "%s: select() failed: %s\n", __func__,
+ strerror(errno_stored));
+
+ if (ctrl_c)
+ {
+ rig_debug(RIG_DEBUG_VERBOSE, "%s: ctrl_c when retcode==-1\n", __func__);
+ break;
+ }
+
+ if (errno == EINTR)
+ {
+ rig_debug(RIG_DEBUG_VERBOSE, "%s: ignoring interrupted system call\n",
+ __func__);
+ retcode = 0;
+ }
+ }
+ else if (retcode == 0)
+ {
+ if (ctrl_c)
+ {
+ rig_debug(RIG_DEBUG_VERBOSE, "%s: ctrl_c when retcode==0\n", __func__);
+ break;
+ }
+ }
+ else
+ {
+ arg->rig = my_rig;
+ arg->clilen = sizeof(arg->cli_addr);
+ arg->vfo_mode = vfo_mode;
+ arg->sock = accept(sock_listen,
+ (struct sockaddr *)&arg->cli_addr,
+ &arg->clilen);
+
+ if (arg->sock < 0)
+ {
+ handle_error(RIG_DEBUG_ERR, "accept");
+ break;
+ }
+
+ if ((retcode = getnameinfo((struct sockaddr const *)&arg->cli_addr,
+ arg->clilen,
+ host,
+ sizeof(host),
+ serv,
+ sizeof(serv),
+ NI_NUMERICHOST | NI_NUMERICSERV))
+ < 0)
+ {
+ rig_debug(RIG_DEBUG_WARN,
+ "Peer lookup error: %s",
+ gai_strerror(retcode));
+ }
+
+ rig_debug(RIG_DEBUG_VERBOSE,
+ "Connection opened from %s:%s\n",
+ host,
+ serv);
+
+#ifdef HAVE_PTHREAD
+ pthread_attr_init(&attr);
+ pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
+
+ retcode = pthread_create(&thread, &attr, handle_socket, arg);
+
+ if (retcode != 0)
+ {
+ rig_debug(RIG_DEBUG_ERR, "pthread_create: %s\n", strerror(retcode));
+ break;
+ }
+
+#else
+ handle_socket(arg);
+#endif
+ }
+ }
+ while (retcode == 0 && !ctrl_c);
+
+ rig_debug(RIG_DEBUG_VERBOSE, "%s: while loop done\n", __func__);
+
+#ifdef HAVE_PTHREAD
+ /* allow threads to finish current action */
+ mutex_rigctld(1);
+ HAMLIB_TRACE;
+
+ if (client_count)
+ {
+ rig_debug(RIG_DEBUG_WARN, "%u outstanding client(s)\n", client_count);
+ }
+
+ rig_close(my_rig);
+ HAMLIB_TRACE;
+ mutex_rigctld(0);
+ HAMLIB_TRACE;
+#else
+ rig_close(my_rig); /* close port */
+#endif
+
+ HAMLIB_TRACE;
+ network_multicast_publisher_stop(my_rig);
+
+ HAMLIB_TRACE;
+ rig_cleanup(my_rig); /* if you care about memory */
+
+#ifdef __MINGW32__
+ WSACleanup();
+#endif
+
+ return 0;
+}
+
+static FILE *get_fsockout(struct handle_data *handle_data_arg)
+{
+#ifdef __MINGW32__
+ int sock_osfhandle = _open_osfhandle(handle_data_arg->sock, _O_RDONLY);
+ return _fdopen(sock_osfhandle, "wb");
+#else
+ return fdopen(handle_data_arg->sock, "wb");
+#endif
+}
+
+static FILE *get_fsockin(struct handle_data *handle_data_arg)
+{
+#ifdef __MINGW32__
+ int sock_osfhandle = _open_osfhandle(handle_data_arg->sock, _O_RDONLY);
+
+ if (sock_osfhandle == -1)
+ {
+ rig_debug(RIG_DEBUG_ERR, "_open_osfhandle error: %s\n", strerror(errno));
+ return NULL;
+ }
+
+ return _fdopen(sock_osfhandle, "rb");
+#else
+ return fdopen(handle_data_arg->sock, "rb");
+#endif
+}
+
+/*
+ * This is the function run by the threads
+ */
+void *handle_socket(void *arg)
+{
+ struct handle_data *handle_data_arg = (struct handle_data *)arg;
+ FILE *fsockin = NULL;
+ FILE *fsockout = NULL;
+ int retcode = RIG_OK;
+ char host[NI_MAXHOST];
+ char serv[NI_MAXSERV];
+ rig_powerstat = RIG_POWER_ON; // defaults to power on
+
+ fsockin = get_fsockin(handle_data_arg);
+
+ if (!fsockin)
+ {
+ rig_debug(RIG_DEBUG_ERR, "%s: fdopen(0x%d) in: %s\n", __func__,
+ handle_data_arg->sock,
+ strerror(errno));
+ goto handle_exit;
+ }
+
+ fsockout = get_fsockout(handle_data_arg);
+
+ if (!fsockout)
+ {
+ rig_debug(RIG_DEBUG_ERR, "%s: fdopen out: %s\n", __func__, strerror(errno));
+ fclose(fsockin);
+ fsockin = NULL;
+
+ goto handle_exit;
+ }
+
+#ifdef HAVE_PTHREAD
+ mutex_rigctld(1);
+
+ ++client_count;
+#if 0
+
+ if (!client_count++)
+ {
+ retcode = rig_open(my_rig);
+
+ if (RIG_OK == retcode && verbose > RIG_DEBUG_ERR)
+ {
+ printf("Opened rig model %d, '%s'\n",
+ my_rig->caps->rig_model,
+ my_rig->caps->model_name);
+ }
+ }
+
+#endif
+
+ mutex_rigctld(0);
+#else
+ mutext_rigctld(1);
+ retcode = rig_open(my_rig);
+ mutext_rigctld(1);
+
+ if (RIG_OK == retcode && verbose > RIG_DEBUG_ERR)
+ {
+ printf("Opened rig model %d, '%s'\n",
+ my_rig->caps->rig_model,
+ my_rig->caps->model_name);
+ }
+
+#endif
+
+ if (my_rig->caps->get_powerstat)
+ {
+ mutex_rigctld(1);
+ rig_get_powerstat(my_rig, &rig_powerstat);
+ mutex_rigctld(0);
+ my_rig->state.powerstat = rig_powerstat;
+ }
+
+ do
+ {
+ mutex_rigctld(1);
+
+ if (!rig_opened)
+ {
+ retcode = rig_open(my_rig);
+ rig_opened = retcode == RIG_OK ? 1 : 0;
+ rig_debug(RIG_DEBUG_ERR, "%s: rig_open reopened retcode=%d\n", __func__,
+ retcode);
+ }
+
+ mutex_rigctld(0);
+
+ int nbytes = -1;
+
+ if (rig_opened) // only do this if rig is open
+ {
+ powerstat_t powerstat;
+ unsigned char cmd[64];
+ unsigned char reply[64];
+ unsigned char *term = (unsigned char *)";";
+ rig_debug(RIG_DEBUG_TRACE, "%s: doing rigctl_parse vfo_mode=%d, secure=%d\n",
+ __func__,
+ handle_data_arg->vfo_mode, handle_data_arg->use_password);
+#if 0
+ retcode = rigctl_parse(handle_data_arg->rig, fsockin, fsockout, NULL, 0,
+ mutex_rigctld,
+ 1, 0, &handle_data_arg->vfo_mode, send_cmd_term, &ext_resp, &resp_sep,
+ handle_data_arg->use_password);
+#else
+ memset(cmd, 0, sizeof(cmd));
+ nbytes = -1;
+
+ do
+ {
+ ++nbytes;
+ int val = fgetc(fsockin);
+
+ if (val == EOF) { goto client_done; }
+
+ rig_debug(RIG_DEBUG_ERR, "%s: val=0x%02x @ %d\n", __func__, val, nbytes);
+
+ cmd[nbytes] = val;
+ }
+ while (nbytes < sizeof(cmd) - 1 && cmd[nbytes] != ';' && cmd[nbytes] != 0xfd);
+
+ ++nbytes;
+ rig_debug(RIG_DEBUG_ERR, "%s: bytes=%d, cmd=%s\n", __func__, nbytes, cmd);
+
+ if (cmd[nbytes - 1] == ';')
+ {
+ rig_debug(RIG_DEBUG_ERR, "%s: cmd kenwood=%s\n", __func__, cmd);
+ term[0] = ';';
+ term[1] = 0;
+ }
+ else if (cmd[0] == 0xfe && cmd[1] == 0xfe)
+ {
+ rig_debug(RIG_DEBUG_ERR, "%s: cmd#2 icom=%s\n", __func__, cmd);
+ dump_hex(cmd, nbytes);
+ term[0] = 0xfd;
+ term[1] = 0;
+ }
+ else
+ {
+ rig_debug(RIG_DEBUG_ERR, "%s: unknown cmd:", __func__);
+ dump_hex(cmd, nbytes);
+ cmd[0] = 0;
+ }
+
+ // This should work with Icom binary cmds any ASCII cmd with last char being standard terminator
+ // This means some of the 5-byte rigs won't be handled correctly -- to be fixed?
+#if 1
+
+ if (cmd[0] != 0)
+ {
+ memset(reply, 0, sizeof(reply));
+ rig_flush(&my_rig->state.rigport);
+ retcode = rig_send_raw(my_rig, cmd, nbytes, reply, sizeof(reply),
+ &cmd[nbytes - 1]);
+
+ if (retcode < 0)
+ {
+ rig_debug(RIG_DEBUG_ERR, "%s: rig_send_raw error=%s\n", __func__,
+ rigerror(retcode));
+ }
+ else
+ {
+
+ rig_debug(RIG_DEBUG_VERBOSE, "%s: reply(%d bytes)='%s'\n", __func__, retcode, reply);
+
+ fwrite(reply, retcode, 1, fsockout);
+ fflush(fsockout);
+ }
+ }
+
+#endif
+#if 0
+
+ if (strncmp(cmd, "FA", 2) == 0)
+ {
+ char *s = "FA00014074000;";
+ printf("%s\n", s);
+ fwrite(s, strlen(s), 1, fsockout);
+ fflush(fsockout);
+ }
+ else if (strncmp(cmd, "FB", 2) == 0)
+ {
+ char *s = "FB00014075000;";
+ printf("%s\n", s);
+ fwrite(s, strlen(s), 1, fsockout);
+ fflush(fsockout);
+ }
+ else if (strncmp(cmd, "AG0", 2) == 0)
+ {
+ char *s = "AG0000;";
+ printf("%s\n", s);
+ fwrite(s, strlen(s), 1, fsockout);
+ fflush(fsockout);
+ }
+ else if (strncmp(cmd, "IF", 2) == 0)
+ {
+ char *s = "IF000101310001000+0000000000020010000;";
+ printf("%s\n", s);
+ fwrite(s, strlen(s), 1, fsockout);
+ fflush(fsockout);
+ }
+
+#endif
+
+#endif
+
+ if (retcode != 0) { rig_debug(RIG_DEBUG_VERBOSE, "%s: rigctl_parse retcode=%d\n", __func__, retcode); }
+
+ // update our power stat in case power gets turned off
+ if (retcode == -RIG_ETIMEOUT
+ && my_rig->caps->get_powerstat) // if we get a timeout we might be powered off
+ {
+ rig_get_powerstat(my_rig, &powerstat);
+ rig_powerstat = powerstat;
+
+ if (powerstat == RIG_POWER_OFF) { retcode = -RIG_EPOWER; }
+ }
+ }
+ else
+ {
+ retcode = -RIG_EIO;
+ }
+
+ // if we get a hard error we try to reopen the rig again
+ // this should cover short dropouts that can occur
+ if (retcode < 0 && !RIG_IS_SOFT_ERRCODE(-retcode))
+ {
+ int retry = 3;
+ rig_debug(RIG_DEBUG_ERR, "%s: i/o error\n", __func__);
+
+ do
+ {
+ mutex_rigctld(1);
+ retcode = rig_close(my_rig);
+ rig_opened = 0;
+ mutex_rigctld(0);
+ rig_debug(RIG_DEBUG_ERR, "%s: rig_close retcode=%d\n", __func__, retcode);
+
+ hl_usleep(1000 * 1000);
+
+ mutex_rigctld(1);
+
+ if (!rig_opened)
+ {
+ retcode = rig_open(my_rig);
+ rig_opened = retcode == RIG_OK ? 1 : 0;
+ rig_debug(RIG_DEBUG_ERR, "%s: rig_open retcode=%d, opened=%d\n", __func__,
+ retcode, rig_opened);
+ }
+
+ mutex_rigctld(0);
+ }
+ while (!ctrl_c && !rig_opened && retry-- > 0 && retcode != RIG_OK);
+ }
+ }
+ while (!ctrl_c && (retcode == RIG_OK || RIG_IS_SOFT_ERRCODE(-retcode)));
+
+client_done:
+
+ if (rigctld_idle && client_count == 1)
+ {
+ rig_close(my_rig);
+
+ if (verbose > RIG_DEBUG_ERR) { printf("Closed rig model %s. Will reopen for new clients\n", my_rig->caps->model_name); }
+ }
+
+
+#ifdef HAVE_PTHREAD
+ --client_count;
+
+ if (rigctld_idle && client_count > 0) { printf("%d client%s still connected so rig remains open\n", client_count, client_count > 1 ? "s" : ""); }
+
+#if 0
+ mutex_rigctld(1);
+
+ /* Release rig if there are no clients */
+ if (!--client_count)
+ {
+ rig_close(my_rig);
+
+ if (verbose > RIG_DEBUG_ERR)
+ {
+ printf("Closed rig model %d, '%s - no clients, will reopen for new clients'\n",
+ my_rig->caps->rig_model,
+ my_rig->caps->model_name);
+ }
+ }
+
+ mutex_rigctld(0);
+#endif
+#else
+ rig_close(my_rig);
+
+ if (verbose > RIG_DEBUG_ERR)
+ {
+ printf("Closed rig model %d, '%s - will reopen for new clients'\n",
+ my_rig->caps->rig_model,
+ my_rig->caps->model_name);
+ }
+
+#endif
+
+ if ((retcode = getnameinfo((struct sockaddr const *)&handle_data_arg->cli_addr,
+ handle_data_arg->clilen,
+ host,
+ sizeof(host),
+ serv,
+ sizeof(serv),
+ NI_NUMERICHOST | NI_NUMERICSERV))
+ < 0)
+ {
+
+ rig_debug(RIG_DEBUG_WARN, "Peer lookup error: %s", gai_strerror(retcode));
+ }
+
+ rig_debug(RIG_DEBUG_VERBOSE,
+ "Connection closed from %s:%s\n",
+ host,
+ serv);
+
+handle_exit:
+
+// for MINGW we close the handle before fclose
+#ifdef __MINGW32__
+ retcode = closesocket(handle_data_arg->sock);
+
+ if (retcode != 0) { rig_debug(RIG_DEBUG_ERR, "%s: fclose(fsockin) %s\n", __func__, strerror(retcode)); }
+
+#endif
+
+ if (fsockin) { fclose(fsockin); }
+
+ if (fsockout) { fclose(fsockout); }
+
+// for everybody else we close the handle after fclose
+#ifndef __MINGW32__
+ retcode = close(handle_data_arg->sock);
+
+ if (retcode != 0 && errno != EBADF) { rig_debug(RIG_DEBUG_ERR, "%s: close(handle_data_arg->sock) %s\n", __func__, strerror(errno)); }
+
+#endif
+
+ free(arg);
+
+#ifdef HAVE_PTHREAD
+ pthread_exit(NULL);
+#endif
+ return NULL;
+}
+
+
+void usage(void)
+{
+ printf("Usage: rigctld [OPTION]...\n"
+ "Daemon serving COMMANDs to a connected radio transceiver or receiver.\n\n");
+
+
+ printf(
+ " -m, --model=ID select radio model number. See model list\n"
+ " -r, --rig-file=DEVICE set device of the radio to operate on\n"
+ " -p, --ptt-file=DEVICE set device of the PTT device to operate on\n"
+ " -d, --dcd-file=DEVICE set device of the DCD device to operate on\n"
+ " -P, --ptt-type=TYPE set type of the PTT device to operate on\n"
+ " -D, --dcd-type=TYPE set type of the DCD device to operate on\n"
+ " -s, --serial-speed=BAUD set serial speed of the serial port\n"
+ " -c, --civaddr=ID set CI-V address, decimal (for Icom rigs only)\n"
+ " -t, --port=NUM set TCP listening port, default %s\n"
+ " -S, --separator=CHAR set char as rigctld response separator, default is \\n\n"
+ " -T, --listen-addr=IPADDR set listening IP address, default ANY\n"
+ " -C, --set-conf=PARM=VAL set config parameters\n"
+ " -L, --show-conf list all config parameters\n"
+ " -l, --list list all model numbers and exit\n"
+ " -u, --dump-caps dump capabilities and exit\n"
+ " -o, --vfo do not default to VFO_CURR, require extra vfo arg\n"
+ " -v, --verbose set verbose mode, cumulative (-v to -vvvvv)\n"
+ " -W, --twiddle_timeout timeout after detecting vfo manual change\n"
+ " -w, --twiddle_rit suppress VFOB getfreq so RIT can be twiddled\n"
+ " -x, --uplink set uplink get_freq ignore, 1=Sub, 2=Main\n"
+ " -Z, --debug-time-stamps enable time stamps for debug messages\n"
+ " -M, --multicast-addr=addr set multicast UDP address, default 0.0.0.0 (off), recommend 224.0.1.1\n"
+ " -n, --multicast-port=port set multicast UDP port, default 4532\n"
+ " -A, --password set password for rigctld access\n"
+ " -R, --rigctld-idle make rigctld close the rig when no clients are connected\n"
+ " -h, --help display this help and exit\n"
+ " -V, --version output version information and exit\n\n",
+ portno);
+
+ usage_rig(stdout);
+
+ printf("\nError codes and messages\n");
+
+ for (enum rig_errcode_e e = 0; e < RIG_EEND; ++e)
+ {
+ printf("-%d - %s", e, rigerror2(e));
+ }
+
+
+ printf("\nReport bugs to <ham...@li...>.\n");
+
+}
commit 0b2f0873b036b339f5f65412cc17a464cc2ef3ba
Author: Mike Black W9MDB <mdb...@ya...>
Date: Mon Jan 2 11:32:18 2023 -0600
Update NEWS
diff --git a/NEWS b/NEWS
index 5290f313..0facc972 100644
--- a/NEWS
+++ b/NEWS
@@ -26,7 +26,7 @@ Version 4.6
Version 4.5.4
* 2023-XX-XX
- * Remove get_powerstat from Icom ID-5100
+ * Remove get_powerstat from Icom ID-5100,ID-4100,ID-31,ID-51 and fix get/set freq in all
Version 4.5.3
* 2022-12-31
commit c7b33ef0b3296a88ca387db1ac3634e19075dab1
Author: Mike Black W9MDB <mdb...@ya...>
Date: Mon Jan 2 11:30:52 2023 -0600
Fix ID5100 ID4100 ID31 ID51 get/set freq
Remove get_powerstat from ID4100 ID31 ID51 as it they are not capable
Add new rig_is_model function to help with Icom rig identification checks
https://github.com/Hamlib/Hamlib/issues/1202
https://github.com/Hamlib/Hamlib/issues/1200
diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h
index eb3d9a0e..a55ef92f 100644
--- a/include/hamlib/rig.h
+++ b/include/hamlib/rig.h
@@ -3428,6 +3428,8 @@ extern HAMLIB_EXPORT(char*) rig_make_md5(char *pass);
extern HAMLIB_EXPORT(int) rig_set_lock_mode(RIG *rig, int lock);
extern HAMLIB_EXPORT(int) rig_get_lock_mode(RIG *rig, int *lock);
+extern HAMLIB_EXPORT(int) rig_is_model(RIG *rig, rig_model_t model);
+
//! @endcond
diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c
index e17d1e98..41f236f2 100644
--- a/rigs/icom/icom.c
+++ b/rigs/icom/icom.c
@@ -1324,7 +1324,15 @@ int icom_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
RETURNFUNC2(retval);
}
- freq_len = priv->civ_731_mode ? 4 : 5;
+ if (ICOM_IS_ID5100 || ICOM_IS_ID5100)
+ {
+ freq_len = 3;
+ }
+ else
+ {
+ freq_len = priv->civ_731_mode ? 4 : 5;
+ }
+
/*
* to_bcd requires nibble len
*/
@@ -1688,7 +1696,11 @@ int icom_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
RETURNFUNC(RIG_OK);
}
- if (freq_len != 4 && freq_len != 5)
+ if (freq_len == 3 && (ICOM_IS_ID5100 || ICOM_IS_ID4100 || ICOM_IS_ID31 || ICOM_IS_ID51))
+ {
+ rig_debug(RIG_DEBUG_TRACE, "%s: 3-byte ID5100/4100 length\n", __func__);
+ }
+ else if (freq_len != 4 && freq_len != 5)
{
rig_debug(RIG_DEBUG_ERR, "%s: wrong frame len=%d\n",
__func__, freq_len);
@@ -1698,7 +1710,7 @@ int icom_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
RETURNFUNC(-RIG_ERJCTED);
}
- if (freq_len != (priv->civ_731_mode ? 4 : 5))
+ if (freq_len != 3 && freq_len != (priv->civ_731_mode ? 4 : 5))
{
rig_debug(RIG_DEBUG_WARN, "%s: freq len (%d) differs from expected\n",
__func__, freq_len);
diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h
index be4475cd..0ddce378 100644
--- a/rigs/icom/icom.h
+++ b/rigs/icom/icom.h
@@ -31,7 +31,12 @@
#include <sys/time.h>
#endif
-#define BACKEND_VER "20221120"
+#define BACKEND_VER "20230102"
+
+#define ICOM_IS_ID31 rig_is_model(rig, RIG_MODEL_ID31)
+#define ICOM_IS_ID51 rig_is_model(rig, RIG_MODEL_ID51)
+#define ICOM_IS_ID4100 rig_is_model(rig, RIG_MODEL_ID4100)
+#define ICOM_IS_ID5100 rig_is_model(rig, RIG_MODEL_ID5100)
#define ICOM_IS_SECONDARY_VFO(vfo) ((vfo) & (RIG_VFO_B | RIG_VFO_SUB | RIG_VFO_SUB_B | RIG_VFO_MAIN_B))
#define ICOM_GET_VFO_NUMBER(vfo) (ICOM_IS_SECONDARY_VFO(vfo) ? 0x01 : 0x00)
diff --git a/rigs/icom/id31.c b/rigs/icom/id31.c
index 26453be7..03e9e535 100644
--- a/rigs/icom/id31.c
+++ b/rigs/icom/id31.c
@@ -82,7 +82,7 @@ const struct rig_caps id31_caps =
RIG_MODEL(RIG_MODEL_ID31),
.model_name = "ID-31",
.mfg_name = "Icom",
- .version = BACKEND_VER ".0",
+ .version = BACKEND_VER ".1",
.copyright = "LGPL",
.status = RIG_STATUS_ALPHA,
.rig_type = RIG_TYPE_HANDHELD,
@@ -179,7 +179,7 @@ const struct rig_caps id31_caps =
.get_mode = icom_get_mode,
.set_powerstat = icom_set_powerstat,
- .get_powerstat = icom_get_powerstat,
+// .get_powerstat = icom_get_powerstat, // not capable
.decode_event = icom_decode_event,
.set_func = icom_set_func,
diff --git a/rigs/icom/id4100.c b/rigs/icom/id4100.c
index d46e7a6c..83efa22a 100644
--- a/rigs/icom/id4100.c
+++ b/rigs/icom/id4100.c
@@ -86,9 +86,9 @@ const struct rig_caps id4100_caps =
RIG_MODEL(RIG_MODEL_ID4100),
.model_name = "ID-4100",
.mfg_name = "Icom",
- .version = BACKEND_VER ".0",
+ .version = BACKEND_VER ".1",
.copyright = "LGPL",
- .status = RIG_STATUS_ALPHA,
+ .status = RIG_STATUS_BETA,
.rig_type = RIG_TYPE_MOBILE,
.ptt_type = RIG_PTT_RIG,
.dcd_type = RIG_DCD_RIG,
@@ -98,7 +98,7 @@ const struct rig_caps id4100_caps =
.serial_data_bits = 8,
.serial_stop_bits = 1,
.serial_parity = RIG_PARITY_NONE,
- .serial_handshake = RIG_HANDSHAKE_NONE,
+ .serial_handshake = RIG_HANDSHAKE_XONXOFF,
.write_delay = 0,
.post_write_delay = 0,
.timeout = 1000,
@@ -187,7 +187,7 @@ const struct rig_caps id4100_caps =
.get_mode = icom_get_mode,
.set_vfo = icom_set_vfo,
- .set_powerstat = icom_set_powerstat,
+ //.set_powerstat = icom_set_powerstat, // ID-4100 does cannot query power
.get_powerstat = icom_get_powerstat,
.decode_event = icom_decode_event,
diff --git a/rigs/icom/id51.c b/rigs/icom/id51.c
index 1d10da00..25f56e7c 100644
--- a/rigs/icom/id51.c
+++ b/rigs/icom/id51.c
@@ -89,7 +89,7 @@ const struct rig_caps id51_caps =
RIG_MODEL(RIG_MODEL_ID51),
.model_name = "ID-51",
.mfg_name = "Icom",
- .version = BACKEND_VER ".0",
+ .version = BACKEND_VER ".1",
.copyright = "LGPL",
.status = RIG_STATUS_ALPHA,
.rig_type = RIG_TYPE_HANDHELD,
@@ -185,7 +185,7 @@ const struct rig_caps id51_caps =
.rig_open = icom_rig_open,
.rig_close = icom_rig_close,
.set_powerstat = icom_set_powerstat,
- .get_powerstat = icom_get_powerstat,
+// .get_powerstat = icom_get_powerstat, // not capable
.set_freq = icom_set_freq,
.get_freq = icom_get_freq,
diff --git a/src/rig.c b/src/rig.c
index 87876dcb..7422fd27 100644
--- a/src/rig.c
+++ b/src/rig.c
@@ -7717,3 +7717,15 @@ HAMLIB_EXPORT(int) rig_get_lock_mode(RIG *rig, int *mode)
return (retcode);
}
+
+HAMLIB_EXPORT(int) rig_is_model(RIG *rig, rig_model_t model)
+{
+ int is_rig;
+
+ //a bit too verbose so disable this unless needed
+ //rig_debug(RIG_DEBUG_TRACE, "%s(%d):%s called\n", __FILE__, __LINE__, __func__);
+ is_rig = (model == rig->caps->rig_model) ? 1 : 0;
+
+ return (is_rig); // RETURN is too verbose here
+}
+
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 69cd60be..cd0d8cb8 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -14,7 +14,7 @@ endif
DISTCLEANFILES = rigctl.log rigctl.sum testbcd.log testbcd.sum
-bin_PROGRAMS = rigctl rigctld rigmem rigsmtr rigswr rotctl rotctld rigctlcom ampctl ampctld $(TESTLIBUSB)
+bin_PROGRAMS = rigctl rigctld rigmem rigsmtr rigswr rotctl rotctld rigctlcom rigctltcp ampctl ampctld $(TESTLIBUSB)
#check_PROGRAMS = dumpmem testrig testrigopen testrigcaps testtrn testbcd testfreq listrigs testloc rig_bench testcache cachetest cachetest2 testcookie testgrid testsecurity
check_PROGRAMS = dumpmem testrig testrigopen testrigcaps testtrn testbcd testfreq listrigs testloc rig_bench testcache cachetest cachetest2 testcookie testgrid
@@ -26,6 +26,7 @@ AMPCOMMONSRC = ampctl_parse.c ampctl_parse.h dumpcaps_amp.c uthash.h
rigctl_SOURCES = rigctl.c $(RIGCOMMONSRC)
rigctld_SOURCES = rigctld.c $(RIGCOMMONSRC)
rigctlcom_SOURCES = rigctlcom.c $(RIGCOMMONSRC)
+rigctltcp_SOURCES = rigctltcp.c $(RIGCOMMONSRC)
rotctl_SOURCES = rotctl.c $(ROTCOMMONSRC)
rotctld_SOURCES = rotctld.c $(ROTCOMMONSRC)
ampctl_SOURCES = ampctl.c $(AMPCOMMONSRC)
@@ -50,6 +51,7 @@ rotctld_CFLAGS = $(AM_CFLAGS) $(PTHREAD_CFLAGS) -I$(top_builddir)/src
ampctl_CFLAGS = $(AM_CFLAGS) $(PTHREAD_CFLAGS) -I$(top_builddir)/src
ampctld_CFLAGS = $(AM_CFLAGS) $(PTHREAD_CFLAGS) -I$(top_builddir)/src
rigctlcom_CFLAGS = $(AM_CFLAGS) $(PTHREAD_CFLAGS) -I$(top_builddir)/security
+rigctltcp_CFLAGS = $(AM_CFLAGS) $(PTHREAD_CFLAGS) -I$(top_builddir)/security
if HAVE_LIBUSB
rigtestlibusb_CFLAGS = $(AM_CFLAGS) $(PTHREAD_CFLAGS) $(LIBUSB_CFLAGS)
endif
@@ -63,6 +65,7 @@ ampctl_LDADD = $(PTHREAD_LIBS) $(LDADD) $(READLINE_LIBS)
ampctld_LDADD = $(NET_LIBS) $(PTHREAD_LIBS) $(LDADD) $(READLINE_LIBS)
rigmem_LDADD = $(LIBXML2_LIBS) $(LDADD)
rigctlcom_LDADD = $(NET_LIBS) $(PTHREAD_LIBS) $(LDADD) $(READLINE_LIBS)
+rigctltcp_LDADD = $(NET_LIBS) $(PTHREAD_LIBS) $(LDADD) $(READLINE_LIBS)
if HAVE_LIBUSB
rigtestlibusb_LDADD = $(LIBUSB_LIBS)
endif
@@ -78,6 +81,7 @@ rigctld_LDFLAGS = $(WINEXELDFLAGS)
rotctld_LDFLAGS = $(WINEXELDFLAGS)
ampctld_LDFLAGS = $(WINEXELDFLAGS)
rigctlcom_LDFLAGS = $(WINEXELDFLAGS)
+rigctltcp_LDFLAGS = $(WINEXELDFLAGS)
if HAVE_LIBUSB
rigtestlibusb_LDFLAGS = $(WINEXELDFLAGS)
endif
commit f68d45d99b5b08ac64d19a20d8aedfc27270de3e
Author: Mike Black W9MDB <mdb...@ya...>
Date: Mon Jan 2 08:58:21 2023 -0600
Update NEWS
diff --git a/NEWS b/NEWS
index 8d1f0e39..5290f313 100644
--- a/NEWS
+++ b/NEWS
@@ -26,6 +26,7 @@ Version 4.6
Version 4.5.4
* 2023-XX-XX
+ * Remove get_powerstat from Icom ID-5100
Version 4.5.3
* 2022-12-31
commit fa7289995c29719739edd13d3e945248adc0905a
Author: Mike Black W9MDB <mdb...@ya...>
Date: Mon Jan 2 08:48:59 2023 -0600
Remove get_powerstat from Icom ID-5100 -- does not have the ability to get power status
https://github.com/Hamlib/Hamlib/issues/1201
diff --git a/rigs/icom/id5100.c b/rigs/icom/id5100.c
index e9769737..2448ff8f 100644
--- a/rigs/icom/id5100.c
+++ b/rigs/icom/id5100.c
@@ -86,7 +86,7 @@ const struct rig_caps id5100_caps =
RIG_MODEL(RIG_MODEL_ID5100),
.model_name = "ID-5100",
.mfg_name = "Icom",
- .version = BACKEND_VER ".1",
+ .version = BACKEND_VER ".2",
.copyright = "LGPL",
.status = RIG_STATUS_BETA,
.rig_type = RIG_TYPE_MOBILE,
@@ -189,7 +189,7 @@ const struct rig_caps id5100_caps =
.set_vfo = icom_set_vfo,
.set_powerstat = icom_set_powerstat,
- .get_powerstat = icom_get_powerstat,
+ //.get_powerstat = icom_get_powerstat, // ID-5100 cannot get power status
.decode_event = icom_decode_event,
.set_func = icom_set_func,
commit 582686505cbbc43f2013b7b8355d1f877671ef7e
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sun Jan 1 16:40:19 2023 -0600
TS-890S query rig to find out which meter type the operator has selected
Thanks to N3GB George Baltz
diff --git a/rigs/kenwood/ts890s.c b/rigs/kenwood/ts890s.c
index dc2781b9..cae17b1c 100644
--- a/rigs/kenwood/ts890s.c
+++ b/rigs/kenwood/ts890s.c
@@ -17,10 +17,12 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <hamlib/config.h>
#include <stdio.h>
+#include <math.h>
#include <hamlib/rig.h>
#include "kenwood.h"
@@ -366,6 +368,59 @@ int kenwood_ts890_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
#endif
return -RIG_ENIMPL;
+ case RIG_LEVEL_STRENGTH:
+ {
+ cal_table_float_t *table;
+ /* Values taken from the TS-890S In-Depth Manual (IDM), p. 8
+ * 0.03 - 21.5 MHz, Preamp 1
+ */
+ /* Meter Type 1 - Kenwood specific, factory default */
+ static cal_table_float_t meter_type1 =
+ {
+ 9, { { 0, -28.4f}, { 3, -26}, {11, -19.5f},
+ {19, -13}, {27, -6.5f}, {35, 0},
+ {48, 20}, {59, 40}, {70, 60}
+ } };
+ /* Meter Type 2 - IARU recommended */
+ static cal_table_float_t meter_type2 =
+ {
+ 9, { { 0, -54}, { 3, -48}, {11, -36},
+ {19, -24}, {27, -12}, {35, 0},
+ {48, 20}, {59, 40}, {70, 60}
+ } };
+ /* Find out which meter type is in use */
+ retval = kenwood_safe_transaction(rig, "EX00011", ackbuf, sizeof(ackbuf), 11);
+
+ if (retval != RIG_OK)
+ {
+ return retval;
+ }
+ if (strncmp(ackbuf + 8, "000", 3) == 0)
+ {
+ table = &meter_type1;
+ }
+ else if (strncmp(ackbuf + 8, "001", 3) == 0)
+ {
+ table = &meter_type2;
+ }
+ else
+ {
+ rig_debug(RIG_DEBUG_ERR, "%s: Unexpected meter type: %s\n",
+ __func__, ackbuf);
+ return -RIG_EPROTO;
+ }
+ retval = kenwood_safe_transaction(rig, "SM", ackbuf, 10, 6);
+ if (retval != RIG_OK)
+ {
+ return retval;
+ }
+
+ sscanf(ackbuf + 2, "%d", &val->i);
+ /* Convert reading back to dB (rounded) */
+ val->i = (int)floorf(rig_raw2val_float(val->i, table) + 0.5f);
+ return RIG_OK;
+ }
+
default:
return kenwood_get_level(rig, vfo, level, val);
}
@@ -378,39 +433,6 @@ static struct kenwood_priv_caps ts890s_priv_caps =
.cmdtrm = EOM_KEN,
};
-/* S-meter calibration table
- * The TS-890S has two distinct S-meter curves, selectable
- * by menu option. Define both, but since Hamlib has only
- * one slot, use the the IARU one.
- * Values taken from TS-890S In-Depth Manual, p. 8
- */
-/* Meter Type 1 - Kenwood specific (default) */
-#define TS890_SM_CAL2 { 9, \
- { \
- { 0, -28 }, \
- { 3, -26 }, \
- { 11, -20 }, \
- { 19, -13 }, \
- { 27, -7 }, \
- { 35, 0 }, \
- { 48, 20 }, \
- { 59, 40 }, \
- { 70, 60 }, \
- } }
-/* Meter Type 2 - IARU Standard */
-#define TS890_SM_CAL1 { 9, \
- { \
- { 0, -54 }, \
- { 3, -48 }, \
- { 11, -36 }, \
- { 19, -24 }, \
- { 27, -12 }, \
- { 35, 0 }, \
- { 48, 20 }, \
- { 59, 40 }, \
- { 70, 60 }, \
- } }
-
/* SWR meter calibration table */
/* The full scale value reads infinity, so arbitrary */
#define TS890_SWR_CAL { 5, \
@@ -543,7 +565,6 @@ const struct rig_caps ts890s_caps =
},
.vfo_ops = TS890_VFO_OPS,
- .str_cal = TS890_SM_CAL1,
.swr_cal = TS890_SWR_CAL,
.priv = (void *)& ts890s_priv_caps,
commit 712564a2ae97343c5ed7001f90e79716939ed1d0
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sun Jan 1 16:39:25 2023 -0600
...
[truncated message content] |
|
From: n0nb <n0...@us...> - 2023-01-01 00:29:25
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Hamlib -- Ham radio control libraries".
The branch, Hamlib-4.5.3 has been updated
via b6209911b0a54473c21fbe33845fb64af6dfacd6 (commit)
via 6a677b99195933b484fa053da1c62d9abebc91a7 (commit)
from 084617dbb9686c4f72014ce78b75f87001f18c99 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit b6209911b0a54473c21fbe33845fb64af6dfacd6
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sat Dec 31 14:46:26 2022 -0600
Update NEWS
diff --git a/NEWS b/NEWS
index 55d6b54b..63a39459 100644
--- a/NEWS
+++ b/NEWS
@@ -23,6 +23,7 @@ Version 4.6
* Fix FTDX3000 rig split
Version 4.5.3
+ * 2022-12-31
* Fix serial.c for hardware flow control on Linux and MacOSy
* Add QRPLabs QCX/QDX rig -- not quite a TS480
* Fix QRP QRDX firmware bugs in IF message so PTT works now
commit 6a677b99195933b484fa053da1c62d9abebc91a7
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sat Dec 31 13:44:53 2022 -0600
Bump version to 4.5.3
diff --git a/configure.ac b/configure.ac
index 7f2a7007..88b73e34 100644
--- a/configure.ac
+++ b/configure.ac
@@ -14,7 +14,7 @@ dnl Please do not use '-' in the version number, as package managers will fail,
dnl however, the use of '~' should be fine as apt (others?) will treat
dnl it as an earlier version than the actual release. TNX KA6MAL
dnl PACKAGE_NAME + " " + PACKAGE_VERSION must not exceed 20 chars!
-AC_INIT([Hamlib],[4.5.2],[ham...@li...],[hamlib],[http://www.hamlib.org])
+AC_INIT([Hamlib],[4.5.3],[ham...@li...],[hamlib],[http://www.hamlib.org])
AC_CONFIG_SRCDIR([include/hamlib/rig.h])
AC_CONFIG_MACRO_DIR([macros])
-----------------------------------------------------------------------
Summary of changes:
NEWS | 1 +
configure.ac | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
hooks/post-receive
--
Hamlib -- Ham radio control libraries
|
|
From: n0nb <n0...@us...> - 2022-12-31 20:36:34
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Hamlib -- Ham radio control libraries".
The branch, Hamlib-4.5.3 has been created
at 084617dbb9686c4f72014ce78b75f87001f18c99 (commit)
- Log -----------------------------------------------------------------
commit 084617dbb9686c4f72014ce78b75f87001f18c99
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sat Dec 31 09:34:29 2022 -0600
Update NEWS
diff --git a/NEWS b/NEWS
index 81605135..55d6b54b 100644
--- a/NEWS
+++ b/NEWS
@@ -23,6 +23,7 @@ Version 4.6
* Fix FTDX3000 rig split
Version 4.5.3
+ * Fix serial.c for hardware flow control on Linux and MacOSy
* Add QRPLabs QCX/QDX rig -- not quite a TS480
* Fix QRP QRDX firmware bugs in IF message so PTT works now
* FTDX5000 will now remember startup front/read settings and restore it
commit 6643d44ed9963c387fbeaaa155f69ca096335c7a
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sat Dec 31 09:30:25 2022 -0600
Remove set_rts and set_dtr low from serial.c
This was causing hardward flow control to fail on Linux and MacOS
https://github.com/Hamlib/Hamlib/issues/1198
https://github.com/Hamlib/Hamlib/issues/1199
diff --git a/src/serial.c b/src/serial.c
index 378117ee..a22aed95 100644
--- a/src/serial.c
+++ b/src/serial.c
@@ -290,8 +290,10 @@ int HAMLIB_API serial_setup(hamlib_port_t *rp)
fd = rp->fd;
// Linux sets pins high so we force them low once
- ser_set_rts(rp, 0);
- ser_set_dtr(rp, 0);
+ // This fails on Linux and MacOS with hardware flow control
+ // Seems setting low disables hardware flow setting later
+// ser_set_rts(rp, 0);
+// ser_set_dtr(rp, 0);
/*
* Get the current options for the port...
commit 1f332d733347eaa5bddceabd315b1848346e05f6
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sat Dec 31 08:10:06 2022 -0600
Update NEWS
diff --git a/NEWS b/NEWS
index d4f6fee1..81605135 100644
--- a/NEWS
+++ b/NEWS
@@ -23,6 +23,7 @@ Version 4.6
* Fix FTDX3000 rig split
Version 4.5.3
+ * Add QRPLabs QCX/QDX rig -- not quite a TS480
* Fix QRP QRDX firmware bugs in IF message so PTT works now
* FTDX5000 will now remember startup front/read settings and restore it
* Fix FTDX5000 write_delay with microham
commit 85c4f730619968fd7b4e34f54076bb2cf949b010
Author: Mike Black W9MDB <mdb...@ya...>
Date: Fri Dec 30 16:04:39 2022 -0600
Add QRPLabs QCX/QDX for better behavior/capability from ts480 entry
diff --git a/include/hamlib/riglist.h b/include/hamlib/riglist.h
index a6843224..c5b56fc2 100644
--- a/include/hamlib/riglist.h
+++ b/include/hamlib/riglist.h
@@ -185,6 +185,7 @@
#define RIG_MODEL_MALACHITE RIG_MAKE_MODEL(RIG_KENWOOD, 49)
#define RIG_MODEL_LAB599_TX500 RIG_MAKE_MODEL(RIG_KENWOOD,50)
#define RIG_MODEL_SDRUNO RIG_MAKE_MODEL(RIG_KENWOOD,51)
+#define RIG_MODEL_QRPLABS RIG_MAKE_MODEL(RIG_KENWOOD,52)
/*
* Icom
diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c
index 055bb3e1..223adfae 100644
--- a/rigs/kenwood/kenwood.c
+++ b/rigs/kenwood/kenwood.c
@@ -5774,6 +5774,7 @@ DECLARE_INITRIG_BACKEND(kenwood)
rig_register(&malachite_caps);
rig_register(&tx500_caps);
rig_register(&sdruno_caps);
+ rig_register(&qrplabs_caps);
return (RIG_OK);
}
diff --git a/rigs/kenwood/kenwood.h b/rigs/kenwood/kenwood.h
index e7278771..4787ae93 100644
--- a/rigs/kenwood/kenwood.h
+++ b/rigs/kenwood/kenwood.h
@@ -29,7 +29,7 @@
#include "misc.h"
#include "idx_builtin.h"
-#define BACKEND_VER "20221128"
+#define BACKEND_VER "20221230"
#define EOM_KEN ';'
#define EOM_TH '\r'
@@ -110,6 +110,7 @@ extern struct confparams kenwood_cfg_params[];
#define RIG_IS_PT8000A (rig->caps->rig_model == RIG_MODEL_PT8000A)
#define RIG_IS_POWERSDR (rig->caps->rig_model == RIG_MODEL_POWERSDR)
#define RIG_IS_MALACHITE (rig->caps->rig_model == RIG_MODEL_MALACHITE)
+#define RIG_IS_QRPLABS (rig->caps->rig_model == RIG_MODEL_QRPLABS)
struct kenwood_filter_width
{
@@ -311,6 +312,7 @@ extern const struct rig_caps pt8000a_caps;
extern const struct rig_caps malachite_caps;
extern const struct rig_caps tx500_caps;
extern const struct rig_caps sdruno_caps;
+extern const struct rig_caps qrplabs_caps;
/* use when not interested in the answer, but want to check its len */
static int inline kenwood_simple_transaction(RIG *rig, const char *cmd,
diff --git a/rigs/kenwood/ts480.c b/rigs/kenwood/ts480.c
index 880221b1..1d4fb807 100644
--- a/rigs/kenwood/ts480.c
+++ b/rigs/kenwood/ts480.c
@@ -1448,6 +1448,198 @@ const struct rig_caps ts480_caps =
.hamlib_check_rig_caps = HAMLIB_CHECK_RIG_CAPS
};
+/*
+ * QRPLabs TS-480 emulation rig capabilities
+ * Notice that some rigs share the same functions.
+ */
+const struct rig_caps qrplabs_caps =
+{
+ RIG_MODEL(RIG_MODEL_QRPLABS),
+ .model_name = "QCX/QDX",
+ .mfg_name = "QRPLabs",
+ .version = BACKEND_VER ".0",
+ .copyright = "LGPL",
+ .status = RIG_STATUS_STABLE,
+ .rig_type = RIG_TYPE_TRANSCEIVER,
+ .ptt_type = RIG_PTT_RIG,
+ .dcd_type = RIG_DCD_RIG,
+ .port_type = RIG_PORT_SERIAL,
+ .serial_rate_min = 4800,
+ .serial_rate_max = 115200,
+ .serial_data_bits = 8,
+ .serial_stop_bits = 1,
+ .serial_parity = RIG_PARITY_NONE,
+ .serial_handshake = RIG_HANDSHAKE_NONE,
+ .write_delay = 0,
+ .post_write_delay = 0,
+ .timeout = 500,
+ .retry = 3,
+ .preamp = {12, RIG_DBLST_END,},
+ .attenuator = {12, RIG_DBLST_END,},
+ .max_rit = kHz(9.99),
+ .max_xit = kHz(9.99),
+ .max_ifshift = Hz(0),
+ .targetable_vfo = RIG_TARGETABLE_FREQ,
+ .transceive = RIG_TRN_RIG,
+ .agc_level_count = 3,
+ .agc_levels = { RIG_AGC_OFF, RIG_AGC_FAST, RIG_AGC_SLOW },
+
+ .rx_range_list1 = {
+ {kHz(100), Hz(59999999), TS480_ALL_MODES, -1, -1, TS480_VFO},
+ RIG_FRNG_END,
+ }, /*!< Receive frequency range list for ITU region 1 */
+ .tx_range_list1 = {
+ {kHz(1810), kHz(1850), TS480_OTHER_TX_MODES, 5000, 100000, TS480_VFO}, /* 100W class */
+ {kHz(1810), kHz(1850), TS480_AM_TX_MODES, 5000, 25000, TS480_VFO}, /* 25W class */
+ {kHz(3500), kHz(3800), TS480_OTHER_TX_MODES, 5000, 100000, TS480_VFO},
+ {kHz(3500), kHz(3800), TS480_AM_TX_MODES, 5000, 25000, TS480_VFO},
+ {MHz(7), kHz(7200), TS480_OTHER_TX_MODES, 5000, 100000, TS480_VFO},
+ {MHz(7), kHz(7200), TS480_AM_TX_MODES, 5000, 25000, TS480_VFO},
+ {kHz(10100), kHz(10150), TS480_OTHER_TX_MODES, 5000, 100000, TS480_VFO},
+ {kHz(10100), kHz(10150), TS480_AM_TX_MODES, 5000, 25000, TS480_VFO},
+ {MHz(14), kHz(14350), TS480_OTHER_TX_MODES, 5000, 100000, TS480_VFO},
+ {MHz(14), kHz(14350), TS480_AM_TX_MODES, 5000, 25000, TS480_VFO},
+ {kHz(18068), kHz(18168), TS480_OTHER_TX_MODES, 5000, 100000, TS480_VFO},
+ {kHz(18068), kHz(18168), TS480_AM_TX_MODES, 5000, 25000, TS480_VFO},
+ {MHz(21), kHz(21450), TS480_OTHER_TX_MODES, 5000, 100000, TS480_VFO},
+ {MHz(21), kHz(21450), TS480_AM_TX_MODES, 5000, 25000, TS480_VFO},
+ {kHz(24890), kHz(24990), TS480_OTHER_TX_MODES, 5000, 100000, TS480_VFO},
+ {kHz(24890), kHz(24990), TS480_AM_TX_MODES, 5000, 25000, TS480_VFO},
+ {MHz(28), kHz(29700), TS480_OTHER_TX_MODES, 5000, 100000, TS480_VFO},
+ {MHz(28), kHz(29700), TS480_AM_TX_MODES, 5000, 25000, TS480_VFO},
+ {MHz(50), kHz(52000), TS480_OTHER_TX_MODES, 5000, 100000, TS480_VFO},
+ {MHz(50), kHz(52000), TS480_AM_TX_MODES, 5000, 25000, TS480_VFO},
+ RIG_FRNG_END,
+ }, /*!< Transmit frequency range list for ITU region 1 */
+ .rx_range_list2 = {
+ {kHz(100), Hz(59999999), TS480_ALL_MODES, -1, -1, TS480_VFO},
+ RIG_FRNG_END,
+ }, /*!< Receive frequency range list for ITU region 2 */
+ .tx_range_list2 = {
+ {kHz(1800), MHz(2) - 1, TS480_OTHER_TX_MODES, 5000, 100000, TS480_VFO}, /* 100W class */
+ {kHz(1800), MHz(2) - 1, TS480_AM_TX_MODES, 5000, 25000, TS480_VFO}, /* 25W class */
+ {kHz(3500), MHz(4) - 1, TS480_OTHER_TX_MODES, 5000, 100000, TS480_VFO},
+ {kHz(3500), MHz(4) - 1, TS480_AM_TX_MODES, 5000, 25000, TS480_VFO},
+ {kHz(5250), kHz(5450), TS480_OTHER_TX_MODES, 5000, 100000, TS480_VFO},
+ {kHz(5250), kHz(5450), TS480_AM_TX_MODES, 5000, 25000, TS480_VFO},
+ {MHz(7), kHz(7300), TS480_OTHER_TX_MODES, 5000, 100000, TS480_VFO},
+ {MHz(7), kHz(7300), TS480_AM_TX_MODES, 5000, 25000, TS480_VFO},
+ {kHz(10100), kHz(10150), TS480_OTHER_TX_MODES, 5000, 100000, TS480_VFO},
+ {kHz(10100), kHz(10150), TS480_AM_TX_MODES, 5000, 25000, TS480_VFO},
+ {MHz(14), kHz(14350), TS480_OTHER_TX_MODES, 5000, 100000, TS480_VFO},
+ {MHz(14), kHz(14350), TS480_AM_TX_MODES, 5000, 25000, TS480_VFO},
+ {kHz(18068), kHz(18168), TS480_OTHER_TX_MODES, 5000, 100000, TS480_VFO},
+ {kHz(18068), kHz(18168), TS480_AM_TX_MODES, 5000, 25000, TS480_VFO},
+ {MHz(21), kHz(21450), TS480_OTHER_TX_MODES, 5000, 100000, TS480_VFO},
+ {MHz(21), kHz(21450), TS480_AM_TX_MODES, 5000, 25000, TS480_VFO},
+ {kHz(24890), kHz(24990), TS480_OTHER_TX_MODES, 5000, 100000, TS480_VFO},
+ {kHz(24890), kHz(24990), TS480_AM_TX_MODES, 5000, 25000, TS480_VFO},
+ {MHz(28), kHz(29700), TS480_OTHER_TX_MODES, 5000, 100000, TS480_VFO},
+ {MHz(28), kHz(29700), TS480_AM_TX_MODES, 5000, 25000, TS480_VFO},
+ {MHz(50), kHz(52000), TS480_OTHER_TX_MODES, 5000, 100000, TS480_VFO},
+ {MHz(50), kHz(52000), TS480_AM_TX_MODES, 5000, 25000, TS480_VFO},
+ RIG_FRNG_END,
+ }, /*!< Transmit frequency range list for ITU region 2 */
+ .tuning_steps = {
+ {TS480_ALL_MODES, kHz(1)},
+ {TS480_ALL_MODES, Hz(2500)},
+ {TS480_ALL_MODES, kHz(5)},
+ {TS480_ALL_MODES, Hz(6250)},
+ {TS480_ALL_MODES, kHz(10)},
+ {TS480_ALL_MODES, Hz(12500)},
+ {TS480_ALL_MODES, kHz(15)},
+ {TS480_ALL_MODES, kHz(20)},
+ {TS480_ALL_MODES, kHz(25)},
+ {TS480_ALL_MODES, kHz(30)},
+ {TS480_ALL_MODES, kHz(100)},
+ {TS480_ALL_MODES, kHz(500)},
+ {TS480_ALL_MODES, MHz(1)},
+ {TS480_ALL_MODES, 0}, /* any tuning step */
+ RIG_TS_END,
+ },
+ /* mode/filter list, remember: order matters! */
+ .filters = {
+ {RIG_MODE_SSB, kHz(2.4)},
+ {RIG_MODE_SSB, Hz(270)},
+ {RIG_MODE_SSB, Hz(500)},
+ {RIG_MODE_CW | RIG_MODE_CWR, Hz(200)},
+ {RIG_MODE_CW | RIG_MODE_CWR, Hz(50)},
+ {RIG_MODE_CW | RIG_MODE_CWR, Hz(1000)},
+ {RIG_MODE_CW | RIG_MODE_CWR, Hz(80)},
+ {RIG_MODE_CW | RIG_MODE_CWR, Hz(100)},
+ {RIG_MODE_CW | RIG_MODE_CWR, Hz(150)},
+ {RIG_MODE_CW | RIG_MODE_CWR, Hz(300)},
+ {RIG_MODE_CW | RIG_MODE_CWR, Hz(400)},
+ {RIG_MODE_CW | RIG_MODE_CWR, Hz(500)},
+ {RIG_MODE_CW | RIG_MODE_CWR, Hz(600)},
+ {RIG_MODE_CW | RIG_MODE_CWR, Hz(2000)},
+ {RIG_MODE_RTTY | RIG_MODE_RTTYR, Hz(500)},
+ {RIG_MODE_RTTY | RIG_MODE_RTTYR, Hz(250)},
+ {RIG_MODE_RTTY | RIG_MODE_RTTYR, Hz(1000)},
+ {RIG_MODE_RTTY | RIG_MODE_RTTYR, Hz(1500)},
+ {RIG_MODE_AM, kHz(6)},
+ {RIG_MODE_AM, kHz(2.4)},
+ {RIG_MODE_FM, kHz(12)},
+ RIG_FLT_END,
+ },
+ .vfo_ops = TS480_VFO_OPS,
+ .level_gran =
+ {
+#include "level_gran_kenwood.h"
+ [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
+ [LVL_VOXDELAY] = { .min = { .i = 0 }, .max = { .i = 30 }, .step = { .i = 1 } },
+ [LVL_KEYSPD] = {.min = {.i = 10}, .max = {.i = 60}, .step = {.i = 1}},
+ [LVL_CWPITCH] = {.min = {.i = 400}, .max = {.i = 1000}, .step = {.i = 50}},
+ [LVL_BKIN_DLYMS] = {.min = {.i = 0}, .max = {.i = 1000}, .step = {.i = 50}},
+ [LVL_SLOPE_LOW] = {.min = {.i = 0}, .max = {.i = 2400}, .step = {.i = 10}},
+ [LVL_SLOPE_HIGH] = {.min = {.i = 0}, .max = {.i = 5000}, .step = {.i = 10}},
+ },
+ .str_cal = TS480_STR_CAL,
+ .swr_cal = TS480_SWR_CAL,
+
+ .ext_tokens = ts480_ext_tokens,
+ .extfuncs = ts480_ext_funcs,
+ .extlevels = ts480_ext_levels,
+
+ .priv = (void *)& ts480_priv_caps,
+ .rig_init = ts480_init,
+ .rig_open = kenwood_open,
+ .rig_cleanup = kenwood_cleanup,
+ .set_freq = kenwood_set_freq,
+ .get_freq = kenwood_get_freq,
+ .set_rit = ts480_set_rit,
+ .get_rit = ts480_get_rit,
+ .set_xit = ts480_set_rit,
+ .get_xit = ts480_get_rit,
+ .set_mode = kenwood_set_mode,
+ .get_mode = kenwood_get_mode,
+ .set_vfo = kenwood_set_vfo,
+ .get_vfo = kenwood_get_vfo_if,
+ .set_split_vfo = kenwood_set_split_vfo,
+ .get_split_vfo = kenwood_get_split_vfo_if,
+ .get_ptt = kenwood_get_ptt,
+ .set_ptt = kenwood_set_ptt,
+ .get_dcd = kenwood_get_dcd,
+ .get_info = kenwood_ts480_get_info,
+ .reset = kenwood_reset,
+ .has_set_level = TS480_LEVEL_SET,
+ .has_get_level = TS480_LEVEL_GET,
+ .set_level = kenwood_ts480_set_level,
+ .get_level = kenwood_ts480_get_level,
+ .set_ext_level = ts480_set_ext_level,
+ .get_ext_level = ts480_get_ext_level,
+ .has_get_func = TS480_FUNC_ALL,
+ .has_set_func = TS480_FUNC_ALL,
+ .set_func = ts480_set_func,
+ .get_func = ts480_get_func,
+ .set_ext_func = ts480_set_ext_func,
+ .get_ext_func = ts480_get_ext_func,
+ .send_morse = kenwood_send_morse,
+ .wait_morse = rig_wait_morse,
+ .vfo_op = kenwood_vfo_op,
+ .hamlib_check_rig_caps = HAMLIB_CHECK_RIG_CAPS
+};
+
/*
* Hilberling PS8000A TS480 emulation
* Notice that some rigs share the same functions.
commit 96c8278d3b9f47b4a38a23f7d4b39d376dd6a08d
Author: Mike Black W9MDB <mdb...@ya...>
Date: Fri Dec 30 09:37:50 2022 -0600
Update NEWS
diff --git a/NEWS b/NEWS
index e3da9970..d4f6fee1 100644
--- a/NEWS
+++ b/NEWS
@@ -23,6 +23,8 @@ Version 4.6
* Fix FTDX3000 rig split
Version 4.5.3
+ * Fix QRP QRDX firmware bugs in IF message so PTT works now
+ * FTDX5000 will now remember startup front/read settings and restore it
* Fix FTDX5000 write_delay with microham
* Fix grep error on MingW build
commit 7898baf6ed162f4c5dbe721a32f697b71f32a782
Author: Mike Black W9MDB <mdb...@ya...>
Date: Thu Dec 29 11:36:50 2022 -0600
Allow for 36 and 37 byte IF lengths for ic10.c
This should fix QRP QRDX buggy IF message -- hopefully the fix theirs to send 33 bytes.
https://github.com/Hamlib/Hamlib/issues/1196#issuecomment-1367473810
diff --git a/rigs/kenwood/ic10.c b/rigs/kenwood/ic10.c
index 73cd64e6..d89e7882 100644
--- a/rigs/kenwood/ic10.c
+++ b/rigs/kenwood/ic10.c
@@ -532,7 +532,7 @@ int ic10_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt)
{
struct kenwood_priv_caps *priv = (struct kenwood_priv_caps *)rig->caps->priv;
char infobuf[50];
- int retval, iflen;
+ int retval, iflen, offset;
retval = get_ic10_if(rig, infobuf);
@@ -546,8 +546,15 @@ int ic10_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt)
/* IFggmmmkkkhhh snnnzrx yytdfcp */
/* IFggmmmkkkhhhxxxxxrrrrrssxcctmfcp */
-
- *ptt = infobuf[iflen - 5] == '0' ? RIG_PTT_OFF : RIG_PTT_ON;
+ /* IFggmmmkkkhhhxxxxxrrrrrssxcctmfcp#### what should be if p13/p14/p15 included */
+ /* IF00014074000 +00000000003000000 ; QRP QDX bad IF command -- 36 bytes instead of 33 */
+ /* QRP QDX should be 37 bytes but used only 1 byte for p14 instead of 2 bytes */
+ /* 12345678901234567890123456789012345678 */
+ offset = 5;
+ if (iflen == 36) offset = 8; // QRP QDX gets completely bogus length
+ else if (iflen == 37) offset = 9; // just incase somebody does this add p13/p14x2/p15
+
+ *ptt = infobuf[iflen - offset] == '0' ? RIG_PTT_OFF : RIG_PTT_ON;
return RIG_OK;
}
commit 4f8c9b1f497df7fa1331ddf8b8424fa9309c63de
Author: Mike Black W9MDB <mdb...@ya...>
Date: Wed Dec 28 16:36:59 2022 -0600
astyle newcat.c
diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c
index c782afa1..bf219832 100644
--- a/rigs/yaesu/newcat.c
+++ b/rigs/yaesu/newcat.c
@@ -637,11 +637,13 @@ int newcat_open(RIG *rig)
SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "EX103;");
rig_debug(RIG_DEBUG_TRACE, "%s: cmd_str = %s\n", __func__, priv->cmd_str);
err = newcat_get_cmd(rig);
+
if (RIG_OK != (err = newcat_get_cmd(rig)))
{
RETURNFUNC(err);
}
- if (priv->ret_data[6] == ';') priv->front_rear_status = priv->ret_data[5];
+
+ if (priv->ret_data[6] == ';') { priv->front_rear_status = priv->ret_data[5]; }
}
RETURNFUNC(RIG_OK);
@@ -678,7 +680,8 @@ int newcat_close(RIG *rig)
if (is_ftdx5000)
{
// Restore EX103 status
- SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "EX103%c;", priv->front_rear_status);
+ SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "EX103%c;",
+ priv->front_rear_status);
rig_debug(RIG_DEBUG_TRACE, "%s: cmd_str = %s\n", __func__, priv->cmd_str);
newcat_set_cmd(rig); // don't care about the return
}
@@ -1770,6 +1773,7 @@ int newcat_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt)
switch (ptt)
{
case RIG_PTT_ON_MIC:
+
/* Build the command string */
// the FTDX5000 uses menu 103 for front/rear audio in USB mode
if (is_ftdx5000)
@@ -1779,12 +1783,14 @@ int newcat_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt)
rig_debug(RIG_DEBUG_TRACE, "%s: cmd_str = %s\n", __func__, priv->cmd_str);
newcat_set_cmd(rig); // don't care about the return
}
+
SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "%s", txon);
rig_debug(RIG_DEBUG_TRACE, "%s: cmd_str = %s\n", __func__, priv->cmd_str);
err = newcat_set_cmd(rig);
break;
case RIG_PTT_ON_DATA:
+
/* Build the command string */
// the FTDX5000 uses menu 103 for front/rear audio in USB mode
if (is_ftdx5000)
@@ -1794,6 +1800,7 @@ int newcat_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt)
rig_debug(RIG_DEBUG_TRACE, "%s: cmd_str = %s\n", __func__, priv->cmd_str);
newcat_set_cmd(rig); // don't care about the return
}
+
SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "%s", txon);
rig_debug(RIG_DEBUG_TRACE, "%s: cmd_str = %s\n", __func__, priv->cmd_str);
err = newcat_set_cmd(rig);
commit 43e46d49c5ec10f28b97aaddf9c3b6ef2c98e703
Author: Mike Black W9MDB <mdb...@ya...>
Date: Wed Dec 28 16:34:32 2022 -0600
FTDX5000 will now remember startup front/rear setting and restore it
Will also allow front/rear selection in WSJT-X/JTDX
https://github.com/Hamlib/Hamlib/issues/1195
diff --git a/rigs/yaesu/ft5000.c b/rigs/yaesu/ft5000.c
index 06ac95eb..70aa44df 100644
--- a/rigs/yaesu/ft5000.c
+++ b/rigs/yaesu/ft5000.c
@@ -51,7 +51,7 @@ const struct newcat_priv_caps ftdx5000_priv_caps =
{ .index = 8, .set_value = 0, .get_value = '6', .width = 3000, .optional = 0 },
{ .index = 9, .set_value = 0, .get_value = '9', .width = 600, .optional = 0 },
{ .index = 10, .set_value = 0, .get_value = 'A', .width = 300, .optional = 0 },
- }
+ },
};
const struct confparams ftdx5000_ext_levels[] =
@@ -140,11 +140,11 @@ const struct rig_caps ftdx5000_caps =
RIG_MODEL(RIG_MODEL_FTDX5000),
.model_name = "FTDX-5000",
.mfg_name = "Yaesu",
- .version = NEWCAT_VER ".8",
+ .version = NEWCAT_VER ".9",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
- .ptt_type = RIG_PTT_RIG,
+ .ptt_type = RIG_PTT_RIG_MICDATA,
.dcd_type = RIG_DCD_NONE,
.port_type = RIG_PORT_SERIAL,
.serial_rate_min = 4800, /* Default rate per manual */
diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c
index c5f87e37..c782afa1 100644
--- a/rigs/yaesu/newcat.c
+++ b/rigs/yaesu/newcat.c
@@ -545,6 +545,7 @@ int newcat_open(RIG *rig)
struct newcat_priv_data *priv = rig->state.priv;
struct rig_state *rig_s = &rig->state;
const char *handshake[3] = {"None", "Xon/Xoff", "Hardware"};
+ int err;
ENTERFUNC;
@@ -600,7 +601,6 @@ int newcat_open(RIG *rig)
|| priv->rig_id == NC_RIGID_FTDX3000
|| priv->rig_id == NC_RIGID_FTDX3000DM)
{
- int err;
char *cmd = "EX0291;EX029;"; // FT2000/D
if (priv->rig_id == NC_RIGID_FT950 || rig->caps->rig_model == RIG_MODEL_FT950) { cmd = "EX0271;EX027;"; }
@@ -631,6 +631,19 @@ int newcat_open(RIG *rig)
rig_debug(RIG_DEBUG_VERBOSE, "%s: disabling FTDX3000 band select\n", __func__);
}
+ if (is_ftdx5000)
+ {
+ // Remember EX103 status
+ SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "EX103;");
+ rig_debug(RIG_DEBUG_TRACE, "%s: cmd_str = %s\n", __func__, priv->cmd_str);
+ err = newcat_get_cmd(rig);
+ if (RIG_OK != (err = newcat_get_cmd(rig)))
+ {
+ RETURNFUNC(err);
+ }
+ if (priv->ret_data[6] == ';') priv->front_rear_status = priv->ret_data[5];
+ }
+
RETURNFUNC(RIG_OK);
}
@@ -664,8 +677,8 @@ int newcat_close(RIG *rig)
if (is_ftdx5000)
{
- // Ensure FT5000 is back to MIC input
- SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "EX1030;");
+ // Restore EX103 status
+ SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "EX103%c;", priv->front_rear_status);
rig_debug(RIG_DEBUG_TRACE, "%s: cmd_str = %s\n", __func__, priv->cmd_str);
newcat_set_cmd(rig); // don't care about the return
}
@@ -1757,13 +1770,21 @@ int newcat_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt)
switch (ptt)
{
case RIG_PTT_ON_MIC:
+ /* Build the command string */
+ // the FTDX5000 uses menu 103 for front/rear audio in USB mode
+ if (is_ftdx5000)
+ {
+ // Ensure FT5000 is back to MIC input
+ SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "EX1030;");
+ rig_debug(RIG_DEBUG_TRACE, "%s: cmd_str = %s\n", __func__, priv->cmd_str);
+ newcat_set_cmd(rig); // don't care about the return
+ }
+ SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "%s", txon);
+ rig_debug(RIG_DEBUG_TRACE, "%s: cmd_str = %s\n", __func__, priv->cmd_str);
+ err = newcat_set_cmd(rig);
break;
case RIG_PTT_ON_DATA:
- break;
-
- case RIG_PTT_ON:
-
/* Build the command string */
// the FTDX5000 uses menu 103 for front/rear audio in USB mode
if (is_ftdx5000)
@@ -1776,6 +1797,12 @@ int newcat_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt)
SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "%s", txon);
rig_debug(RIG_DEBUG_TRACE, "%s: cmd_str = %s\n", __func__, priv->cmd_str);
err = newcat_set_cmd(rig);
+ break;
+
+ case RIG_PTT_ON:
+ SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "%s", txon);
+ rig_debug(RIG_DEBUG_TRACE, "%s: cmd_str = %s\n", __func__, priv->cmd_str);
+ err = newcat_set_cmd(rig);
break;
diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h
index 11051545..914c535f 100644
--- a/rigs/yaesu/newcat.h
+++ b/rigs/yaesu/newcat.h
@@ -128,6 +128,7 @@ struct newcat_priv_data
char last_if_response[NEWCAT_DATA_LEN];
int poweron; /* to prevent powering on more than once */
int question_mark_response_means_rejected; /* the question mark response has multiple meanings */
+ char front_rear_status; /* e.g. FTDX5000 EX103 status */
};
/*
diff --git a/simulators/simftdx5000.c b/simulators/simftdx5000.c
index 4b435257..e8ce7d1d 100644
--- a/simulators/simftdx5000.c
+++ b/simulators/simftdx5000.c
@@ -22,6 +22,7 @@ int ai = 0;
int sh = 25;
int na = 0;
int ex039 = 0;
+int ex103 = 0;
// ID 0310 == 310, Must drop leading zero
typedef enum nc_rigid_e
@@ -316,6 +317,20 @@ int main(int argc, char *argv[])
{
sscanf(buf, "EX039%d", &ex039);
}
+ else if (strcmp(buf, "EX103;") == 0)
+ {
+ SNPRINTF(buf, sizeof(buf), "EX103%d;", ex103);
+ n = write(fd, buf, strlen(buf));
+ }
+ else if (strncmp(buf, "EX103", 3) == 0)
+ {
+ sscanf(buf, "EX103%d", &ex103);
+ }
+ else if (strcmp(buf, "PS;") == 0)
+ {
+ SNPRINTF(buf, sizeof(buf), "PS1;");
+ n = write(fd, buf, strlen(buf));
+ }
else if (strlen(buf) > 0)
{
fprintf(stderr, "Unknown command: %s\n", buf);
commit ba079fe7f05306ef0a001048fecf2f6c65cb42a0
Author: Mike Black W9MDB <mdb...@ya...>
Date: Wed Dec 28 14:27:05 2022 -0600
Make FT5000 EX1031;TX1; command two commands
https://github.com/Hamlib/Hamlib/issues/1193
diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c
index 019f10e1..c5f87e37 100644
--- a/rigs/yaesu/newcat.c
+++ b/rigs/yaesu/newcat.c
@@ -1769,17 +1769,13 @@ int newcat_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt)
if (is_ftdx5000)
{
// Ensure FT5000 is back to MIC input
- SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "EX1031;%s", txon);
+ SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "EX1031;");
rig_debug(RIG_DEBUG_TRACE, "%s: cmd_str = %s\n", __func__, priv->cmd_str);
newcat_set_cmd(rig); // don't care about the return
}
- else
- {
- SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "%s", txon);
- rig_debug(RIG_DEBUG_TRACE, "%s: cmd_str = %s\n", __func__, priv->cmd_str);
- err = newcat_set_cmd(rig);
- }
-
+ SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "%s", txon);
+ rig_debug(RIG_DEBUG_TRACE, "%s: cmd_str = %s\n", __func__, priv->cmd_str);
+ err = newcat_set_cmd(rig);
break;
commit 9ad6f24089d124a30efc2efec805c0a74a0670b4
Author: Mike Black W9MDB <mdb...@ya...>
Date: Wed Dec 28 14:11:25 2022 -0600
Make sure FT5000 is in data mode for PTT request -- returns to MIC mode on shutdown
https://github.com/Hamlib/Hamlib/issues/1193
diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c
index 9bff762a..019f10e1 100644
--- a/rigs/yaesu/newcat.c
+++ b/rigs/yaesu/newcat.c
@@ -1741,7 +1741,7 @@ int newcat_get_vfo(RIG *rig, vfo_t *vfo)
int newcat_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt)
{
struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
- int err;
+ int err = -RIG_EPROTO;
char txon[] = "TX1;";
char txoff[] = "TX0;";
@@ -1756,24 +1756,31 @@ int newcat_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt)
switch (ptt)
{
- // the FTDX5000 uses menu 103 for front/rear audio in USB mode
case RIG_PTT_ON_MIC:
- SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "EX1030;");
- rig_debug(RIG_DEBUG_TRACE, "%s: cmd_str = %s\n", __func__, priv->cmd_str);
- err = newcat_set_cmd(rig);
break;
case RIG_PTT_ON_DATA:
- SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "EX1031;");
- rig_debug(RIG_DEBUG_TRACE, "%s: cmd_str = %s\n", __func__, priv->cmd_str);
- err = newcat_set_cmd(rig);
break;
case RIG_PTT_ON:
+
/* Build the command string */
- SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "%s", txon);
- rig_debug(RIG_DEBUG_TRACE, "%s: cmd_str = %s\n", __func__, priv->cmd_str);
- err = newcat_set_cmd(rig);
+ // the FTDX5000 uses menu 103 for front/rear audio in USB mode
+ if (is_ftdx5000)
+ {
+ // Ensure FT5000 is back to MIC input
+ SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "EX1031;%s", txon);
+ rig_debug(RIG_DEBUG_TRACE, "%s: cmd_str = %s\n", __func__, priv->cmd_str);
+ newcat_set_cmd(rig); // don't care about the return
+ }
+ else
+ {
+ SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "%s", txon);
+ rig_debug(RIG_DEBUG_TRACE, "%s: cmd_str = %s\n", __func__, priv->cmd_str);
+ err = newcat_set_cmd(rig);
+ }
+
+
break;
case RIG_PTT_OFF:
diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h
index a0be7487..11051545 100644
--- a/rigs/yaesu/newcat.h
+++ b/rigs/yaesu/newcat.h
@@ -50,7 +50,7 @@
typedef char ncboolean;
/* shared function version */
-#define NEWCAT_VER "20221223"
+#define NEWCAT_VER "20221228"
/* Hopefully large enough for future use, 128 chars plus '\0' */
#define NEWCAT_DATA_LEN 129
commit 35946f5d6b96f6f5866d54d87281731e12389599
Author: Mike Black W9MDB <mdb...@ya...>
Date: Wed Dec 28 12:41:39 2022 -0600
FT5000 cannot use RIG_PTT_ON_DATA/MIC menu 103 control and is now set for rear automatically too
https://github.com/Hamlib/Hamlib/issues/1193
diff --git a/rigs/yaesu/ft5000.c b/rigs/yaesu/ft5000.c
index cd1ebfb9..06ac95eb 100644
--- a/rigs/yaesu/ft5000.c
+++ b/rigs/yaesu/ft5000.c
@@ -140,11 +140,11 @@ const struct rig_caps ftdx5000_caps =
RIG_MODEL(RIG_MODEL_FTDX5000),
.model_name = "FTDX-5000",
.mfg_name = "Yaesu",
- .version = NEWCAT_VER ".7",
+ .version = NEWCAT_VER ".8",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
- .ptt_type = RIG_PTT_RIG_MICDATA,
+ .ptt_type = RIG_PTT_RIG,
.dcd_type = RIG_DCD_NONE,
.port_type = RIG_PORT_SERIAL,
.serial_rate_min = 4800, /* Default rate per manual */
commit fcffad9ff2df583d89f2bf60131dfc0d6bd9e85d
Author: Mike Black W9MDB <mdb...@ya...>
Date: Mon Dec 26 10:25:06 2022 -0600
Update NEWS
diff --git a/NEWS b/NEWS
index 43c762c5..e3da9970 100644
--- a/NEWS
+++ b/NEWS
@@ -23,6 +23,7 @@ Version 4.6
* Fix FTDX3000 rig split
Version 4.5.3
+ * Fix FTDX5000 write_delay with microham
* Fix grep error on MingW build
Version 4.5.2
commit a3fecb63a28b9519cf7ccd1885babdac008c87d6
Author: Mike Black W9MDB <mdb...@ya...>
Date: Mon Dec 26 10:23:44 2022 -0600
Change FTDX5000 write_delay to zero -- was causing microham to return ?; to every command
https://github.com/Hamlib/Hamlib/issues/1080
diff --git a/rigs/yaesu/ft5000.h b/rigs/yaesu/ft5000.h
index cecd304f..becd0c14 100644
--- a/rigs/yaesu/ft5000.h
+++ b/rigs/yaesu/ft5000.h
@@ -141,7 +141,7 @@
/* Delay between bytes sent to FT-5000
* Should not exceed value set in CAT TOT menu (rig default is 10 mSec)
*/
-#define FTDX5000_WRITE_DELAY 1
+#define FTDX5000_WRITE_DELAY 0
/* Delay sequential fast writes */
commit 5b46a408f3ea193a4fffb66d70c82eff2fc5a102
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sat Dec 24 14:03:18 2022 -0600
Update NEWS
diff --git a/NEWS b/NEWS
index 6eba3a94..43c762c5 100644
--- a/NEWS
+++ b/NEWS
@@ -22,6 +22,9 @@ Version 4.6
* Add FLIR PTU-D48, E46, D100, D300 rotors
* Fix FTDX3000 rig split
+Version 4.5.3
+ * Fix grep error on MingW build
+
Version 4.5.2
* 2022-12-23
* Fix PowerSDR ability to do commands while powered off
commit 16e55b604707ec7f0222efb451d3c62f8d1824d9
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sat Dec 24 11:28:11 2022 -0600
Fix grep error on mingw build
diff --git a/src/Makefile.am b/src/Makefile.am
index fe4431de..751dc984 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -30,9 +30,10 @@ EXTRA_DIST = Android.mk hamlibdatetime.h.in
# directory before the source directory for the hamlibdatetime.h
# header.
hamlibdatetime.h: FORCE
+ echo "#define HAMLIBDATETIME "\"$$(TZ=UTC git --git-dir=$(top_srcdir)/.git log --no-merges --date='format-local:%b %d %H:%M:%SZ %Y SHA=' --format='%cd' -n 1)$$(git --git-dir=$(top_srcdir)/.git log --no-merges -n 1 | cut -c8-13)\"
@if test -x $(top_srcdir)/.git ; then \
echo "/* This date time is from the last non-merge commit to Hamlib. */" > $(builddir)/$(@F).tmp ;\
- echo "#define HAMLIBDATETIME "\"$$(TZ=UTC git --git-dir=$(top_srcdir)/.git log --no-merges --date='format-local:%a %b %d %H:%M:%S %Y %z SHA=' --format='%cd' -n 1)$$(git --git-dir=$(top_srcdir)/.git log --no-merges | grep commit | head -n 1 | cut -c8-13)\" >> $(builddir)/$(@F).tmp ;\
+ echo "#define HAMLIBDATETIME "\"$$(TZ=UTC git --git-dir=$(top_srcdir)/.git log --no-merges --date='format-local:%b %d %H:%M:%SZ %Y SHA=' --format='%cd' -n 1)$$(git --git-dir=$(top_srcdir)/.git log --no-merges -n 1 | head -n 1 | cut -c8-13)\" >> $(builddir)/$(@F).tmp ;\
diff -qN $(builddir)/$(@F).tmp $(builddir)/$(@F) ; test $$? -eq 0 || { echo "Generating SCS header \"$(builddir)/$(@F)\"" ; mv -f $(builddir)/$(@F).tmp $(builddir)/$(@F) ; } ;\
rm -f $(builddir)/$(@F).tmp ;\
else \
-----------------------------------------------------------------------
hooks/post-receive
--
Hamlib -- Ham radio control libraries
|
|
From: n0nb <n0...@us...> - 2022-12-24 17:25:55
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Hamlib -- Ham radio control libraries".
The annotated tag, 4.5.2 has been created
at 062c8c1c6556887813beb043ff0ea557cf6a3fb4 (tag)
tagging f12ac6279b421ea12a4440c5b1a3caddfc183916 (commit)
replaces 4.5.1
tagged by Nate Bargmann
on Sat Dec 24 11:23:22 2022 -0600
- Log -----------------------------------------------------------------
Hamlib 4.5.2 release
-----BEGIN PGP SIGNATURE-----
iF0EABECAB0WIQSC1k9rDmfNQfaJu6b7LFEw1VqIGQUCY6c1swAKCRD7LFEw1VqI
GazOAJwLkYXCDjrqlCuoSiRsnES1hqaohQCbBUPlsEU9DsmXoYiBry2vK7Upx1Y=
=1zi6
-----END PGP SIGNATURE-----
Mike Black W9MDB (34):
Update simftdx3000.c
Hamlib-4.5.2 bug fixes
Add --disable-parallel configure option https://github.com/Hamlib/Hamlib/issues/1181
Fix rigctld segfault when using -P RTS https://github.com/Hamlib/Hamlib/issues/1182
astyle newcat.c
Add FTDX1200 to rigs that need to ensure PTT is off before changing frequency https://github.com/Hamlib/Hamlib/issues/1185
Update simftdx1200.c
If get_powerstat fails assume rig is powered on -- should fix sdr++ problem https://github.com/Hamlib/Hamlib/issues/1186
Allow rigctld to close the rig with the -R option when client disconnects. This makes it close when any one client disconnects. Should only close when no clients are connected -- that will be the next patch This is for the FT736R and gpredict https://github.com/Hamlib/Hamlib/issues/1187
-R option will keep rig open as long as 1 or more clients are connected https://github.com/Hamlib/Hamlib/issues/1187
Update NEWS
Update NEWS
If get_powerstat fails in any way then always return RIG_POWER_ON https://github.com/Hamlib/Hamlib/issues/1189
If get_powerstat fails assume rig is powered on -- should fix sdr++ problem https://github.com/Hamlib/Hamlib/issues/1186
Add get_freq cached for FT736R to allow working with gpredict https://github.com/Hamlib/Hamlib/issues/1187
Update NEWS
Update NEWS
Update NEWS
Fix kenwood_ts890_get_level -- thanks to N3GB George Baltz
Update NEWS
Update NEWS
FT-736 did not have get_mode so only call get_mode when available https://github.com/Hamlib/Hamlib/issues/1187
Do not reset cache for unidirectional rigs https://github.com/Hamlib/Hamlib/issues/1187
FT-736 did not have get_mode so only call get_mode when available https://github.com/Hamlib/Hamlib/issues/1187
Reset rig->state.cache.split so it can be set again when rigctld reopens the rig https://github.com/Hamlib/Hamlib/issues/1187
Ensure get_powerstat return RIG_OK when rig does not have get_powerstat https://github.com/Hamlib/Hamlib/issues/1189
Fix unidirectional rig cached frequency (e.g. FT736R) https://github.com/Hamlib/Hamlib/issues/1187
Change TX-500 to only have 9600 baud available https://github.com/Hamlib/Hamlib/issues/1188
Allow POWERSDR to do commands when powered off
Remove powerstat from TX-500 -- was always responding PS0; https://github.com/Hamlib/Hamlib/issues/1188
Update NEWS
Make FTDX5000 return to MIC input on closing https://github.com/Hamlib/Hamlib/issues/1193
Update NEWS
Update NEWS
Nate Bargmann (1):
Quell groff warning of "font p not found".
PianetaRadio (4):
Update prosistel.c
Update prosistel.h
Update prosistel.c
Update rotlist.h
-----------------------------------------------------------------------
hooks/post-receive
--
Hamlib -- Ham radio control libraries
|
|
From: n0nb <n0...@us...> - 2022-12-24 17:25:42
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Hamlib -- Ham radio control libraries".
The branch, Hamlib-4.5.2 has been created
at f12ac6279b421ea12a4440c5b1a3caddfc183916 (commit)
- Log -----------------------------------------------------------------
commit f12ac6279b421ea12a4440c5b1a3caddfc183916
Author: Mike Black W9MDB <mdb...@ya...>
Date: Fri Dec 23 17:04:12 2022 -0600
Update NEWS
diff --git a/NEWS b/NEWS
index 38f6f3e7..6eba3a94 100644
--- a/NEWS
+++ b/NEWS
@@ -14,16 +14,22 @@ Version 5.x -- future
Version 4.6
* 2023-11-XX -- Planned for Nov 2023
+ * Add --set-conf=tuner_control_pathname=hamlib_tuner_control (default)
+ If file exists then it will be called with 0/1 (Off/On) argument
+ with 'U TUNER 0' or 'U TUNER 1"
+ Default path is for current directory
* Add MDS 4710/9710 rigs
+ * Add FLIR PTU-D48, E46, D100, D300 rotors
+ * Fix FTDX3000 rig split
Version 4.5.2
+ * 2022-12-23
* Fix PowerSDR ability to do commands while powered off
* Fix TX-500 operations
* Fix FTDX5000 to return to MIC input on closing
* Fix rig.c calling rig_get_mode when backend does not have get_mode
* Fix kenwood_ts890_get_level
* Add Prosistel D elevation CBOX az to fix problem with azimuth control
- * 2022-12-XX -- Planned for Dec 2022
* Fix FT736R gpredict usage by adding cached get_freq
* Fix get_powerstat problem with Log4OM/Flex and others
* Fix -R option to not need argument
@@ -34,7 +40,7 @@ Version 4.5.2
Version 4.5.1
* 2022-12-08
* FT2000, FTDX3000/D, FT891, FT991, FT950, FTDX5000 now set CAT TOT to 100ms
- * Add missing NB2 setting to FT-950, FTDX-1200, FTDX-3000, FTDX-5000, FTDX-9000
+ * Add missing NB2 setting to FT-950, FTDX-1200, FT-2000, FTDX-3000, FTDX-5000, FTDX-9000
* Add missing meter reading to TS-890S -- thanks to Geore Baltz N3GB
* Fix FT736 VFOB freq and mode set
* Added send_raw to rigctl -- see rigctl man page
commit ad511c496efd6965052966448f0dcd67c58d43de
Author: Mike Black W9MDB <mdb...@ya...>
Date: Fri Dec 23 16:53:18 2022 -0600
Update NEWS
diff --git a/NEWS b/NEWS
index 82344221..38f6f3e7 100644
--- a/NEWS
+++ b/NEWS
@@ -19,6 +19,7 @@ Version 4.6
Version 4.5.2
* Fix PowerSDR ability to do commands while powered off
* Fix TX-500 operations
+ * Fix FTDX5000 to return to MIC input on closing
* Fix rig.c calling rig_get_mode when backend does not have get_mode
* Fix kenwood_ts890_get_level
* Add Prosistel D elevation CBOX az to fix problem with azimuth control
commit ee96efd5bca8b5bda03a98438ad28fed805bfe32
Author: Mike Black W9MDB <mdb...@ya...>
Date: Fri Dec 23 16:49:45 2022 -0600
Make FTDX5000 return to MIC input on closing
https://github.com/Hamlib/Hamlib/issues/1193
diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c
index fda8aa01..9bff762a 100644
--- a/rigs/yaesu/newcat.c
+++ b/rigs/yaesu/newcat.c
@@ -662,6 +662,14 @@ int newcat_close(RIG *rig)
priv->poweron = 0;
}
+ if (is_ftdx5000)
+ {
+ // Ensure FT5000 is back to MIC input
+ SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "EX1030;");
+ rig_debug(RIG_DEBUG_TRACE, "%s: cmd_str = %s\n", __func__, priv->cmd_str);
+ newcat_set_cmd(rig); // don't care about the return
+ }
+
RETURNFUNC(RIG_OK);
}
diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h
index c45a4d9d..a0be7487 100644
--- a/rigs/yaesu/newcat.h
+++ b/rigs/yaesu/newcat.h
@@ -50,7 +50,7 @@
typedef char ncboolean;
/* shared function version */
-#define NEWCAT_VER "20221211"
+#define NEWCAT_VER "20221223"
/* Hopefully large enough for future use, 128 chars plus '\0' */
#define NEWCAT_DATA_LEN 129
commit 289788bae98f02d81a6afb1fc2fdb683f72302a3
Author: Mike Black W9MDB <mdb...@ya...>
Date: Tue Dec 20 08:50:32 2022 -0600
Update NEWS
diff --git a/NEWS b/NEWS
index 908ad034..82344221 100644
--- a/NEWS
+++ b/NEWS
@@ -17,6 +17,8 @@ Version 4.6
* Add MDS 4710/9710 rigs
Version 4.5.2
+ * Fix PowerSDR ability to do commands while powered off
+ * Fix TX-500 operations
* Fix rig.c calling rig_get_mode when backend does not have get_mode
* Fix kenwood_ts890_get_level
* Add Prosistel D elevation CBOX az to fix problem with azimuth control
commit 0d2fd757bf91476f98cfe47c61d3785d16b40887
Author: Mike Black W9MDB <mdb...@ya...>
Date: Mon Dec 19 14:55:14 2022 -0600
Remove powerstat from TX-500 -- was always responding PS0;
https://github.com/Hamlib/Hamlib/issues/1188
diff --git a/rigs/kenwood/tx500.c b/rigs/kenwood/tx500.c
index 5f2c4f5c..6edeffdc 100644
--- a/rigs/kenwood/tx500.c
+++ b/rigs/kenwood/tx500.c
@@ -318,8 +318,8 @@ const struct rig_caps tx500_caps =
.set_channel = ts2000_set_channel,
.set_trn = kenwood_set_trn,
.get_trn = kenwood_get_trn,
- .set_powerstat = kenwood_set_powerstat,
- .get_powerstat = kenwood_get_powerstat,
+ //.set_powerstat = kenwood_set_powerstat,
+ //.get_powerstat = kenwood_get_powerstat,
.get_info = kenwood_get_info,
.reset = kenwood_reset,
.hamlib_check_rig_caps = HAMLIB_CHECK_RIG_CAPS
commit fef4c674a10242271c896be61e775a686a96688c
Author: Mike Black W9MDB <mdb...@ya...>
Date: Mon Dec 19 16:58:44 2022 -0600
Allow POWERSDR to do commands when powered off
diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c
index 6cb82915..1b356aac 100644
--- a/tests/rigctl_parse.c
+++ b/tests/rigctl_parse.c
@@ -1752,7 +1752,8 @@ readline_repeat:
&& cmd_entry->cmd != '3' // dump_conf
&& cmd_entry->cmd != 0x8f // dump_state
&& cmd_entry->cmd != 0xf0 // chk_vfo
- && cmd_entry->cmd != 0x87) // set_powerstat
+ && cmd_entry->cmd != 0x87 // set_powerstat
+ && my_rig->caps->rig_model != RIG_MODEL_POWERSDR) // some rigs can do stuff when powered off
{
rig_debug(RIG_DEBUG_WARN,
"%s: command %s not allowed when rig is powered off\n", __func__,
commit b041a7f6075cc3c6594800ad78794ab7ed5f8754
Author: Mike Black W9MDB <mdb...@ya...>
Date: Tue Dec 20 08:29:12 2022 -0600
Change TX-500 to only have 9600 baud available
https://github.com/Hamlib/Hamlib/issues/1188
diff --git a/rigs/kenwood/tx500.c b/rigs/kenwood/tx500.c
index d5cb6398..5f2c4f5c 100644
--- a/rigs/kenwood/tx500.c
+++ b/rigs/kenwood/tx500.c
@@ -127,15 +127,15 @@ const struct rig_caps tx500_caps =
RIG_MODEL(RIG_MODEL_LAB599_TX500),
.model_name = "TX-500",
.mfg_name = "Lab599",
- .version = BACKEND_VER ".1",
+ .version = BACKEND_VER ".3",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
.ptt_type = RIG_PTT_RIG,
.dcd_type = RIG_DCD_RIG,
.port_type = RIG_PORT_SERIAL,
- .serial_rate_min = 1200,
- .serial_rate_max = 57600,
+ .serial_rate_min = 9600,
+ .serial_rate_max = 9600,
.serial_data_bits = 8,
.serial_stop_bits = 1,
.serial_parity = RIG_PARITY_NONE,
commit ac882ee896afff59ebc54e4fafc26dd0466c65b1
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sun Dec 18 09:01:27 2022 -0600
Fix unidirectional rig cached frequency (e.g. FT736R)
https://github.com/Hamlib/Hamlib/issues/1187
diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h
index 066db187..b9e90cd5 100644
--- a/include/hamlib/rig.h
+++ b/include/hamlib/rig.h
@@ -3396,6 +3396,7 @@ extern HAMLIB_EXPORT(int) rig_set_vfo_opt(RIG *rig, int status);
extern HAMLIB_EXPORT(int) rig_get_vfo_info(RIG *rig, vfo_t vfo, freq_t *freq, rmode_t *mode, pbwidth_t *width, split_t *split, int *satmode);
extern HAMLIB_EXPORT(int) rig_get_rig_info(RIG *rig, char *response, int max_response_len);
extern HAMLIB_EXPORT(int) rig_get_cache(RIG *rig, vfo_t vfo, freq_t *freq, int * cache_ms_freq, rmode_t *mode, int *cache_ms_mode, pbwidth_t *width, int *cache_ms_width);
+extern HAMLIB_EXPORT(int) rig_get_cache_freq(RIG *rig, vfo_t vfo, freq_t *freq, int * cache_ms_freq);
extern HAMLIB_EXPORT(int) rig_set_clock(RIG *rig, int year, int month, int day, int hour, int min, int sec, double msec, int utc_offset);
extern HAMLIB_EXPORT(int) rig_get_clock(RIG *rig, int *year, int *month, int *day, int *hour, int *min, int *sec, double *msec, int *utc_offset);
diff --git a/rigs/yaesu/ft736.c b/rigs/yaesu/ft736.c
index 52cd85fc..8858512f 100644
--- a/rigs/yaesu/ft736.c
+++ b/rigs/yaesu/ft736.c
@@ -31,6 +31,7 @@
#include "misc.h"
#include "yaesu.h"
#include "tones.h"
+#include "cache.h"
@@ -99,7 +100,7 @@ const struct rig_caps ft736_caps =
RIG_MODEL(RIG_MODEL_FT736R),
.model_name = "FT-736R",
.mfg_name = "Yaesu",
- .version = "20221214.0",
+ .version = "20221218.0",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
@@ -270,6 +271,7 @@ int ft736_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
{
unsigned char cmd[YAESU_CMD_LENGTH] = { 0x00, 0x00, 0x00, 0x00, 0x01};
struct ft736_priv_data *priv = (struct ft736_priv_data *)rig->state.priv;
+ int retval;
// we will assume requesting to set VFOB is split mode
if (vfo == RIG_VFO_B) { return rig_set_split_freq(rig, vfo, freq); }
@@ -288,8 +290,11 @@ int ft736_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
cmd[0] = (cmd[0] & 0x0f) | 0xc0;
}
- /* Frequency set */
- return write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH);
+ retval = write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH);
+
+ if (retval == RIG_OK) { rig_set_cache_freq(rig, vfo, freq); }
+
+ return retval;
}
int ft736_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
@@ -297,7 +302,7 @@ int ft736_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
rig_debug(RIG_DEBUG_VERBOSE, "%s: called\n", __func__);
if (vfo == RIG_VFO_A || vfo == RIG_VFO_MAIN) { *freq = rig->state.cache.freqMainA; }
- else { *freq = rig->state.cache.freqMainB; }
+ else { rig_get_cache_freq(rig, vfo, freq, NULL); }
return RIG_OK;
}
diff --git a/src/cache.c b/src/cache.c
index 7bdafbfa..b912bdee 100644
--- a/src/cache.c
+++ b/src/cache.c
@@ -442,6 +442,41 @@ int rig_get_cache(RIG *rig, vfo_t vfo, freq_t *freq, int *cache_ms_freq,
return RIG_OK;
}
+/**
+ * \brief get cached values for a VFO
+ * \param rig The rig handle
+ * \param vfo The VFO to get information from
+ * \param freq The frequency is stored here
+ * \param cache_ms_freq The age of the last frequency update in ms -- NULL if you don't want it
+
+ * Use this to query the frequency cache and then determine to actually fetch data from
+ * the rig.
+ *
+ * \return RIG_OK if the operation has been successful, otherwise
+ * a negative value if an error occurred (in which case, cause is
+ * set appropriately).
+ *
+ */
+int rig_get_cache_freq(RIG *rig, vfo_t vfo, freq_t *freq, int *cache_ms_freq_p)
+{
+ rmode_t mode;
+ int cache_ms_freq;
+ int cache_ms_mode;
+ pbwidth_t width;
+ int cache_ms_width;
+ int retval;
+ retval = rig_get_cache(rig, vfo, freq, &cache_ms_freq, &mode, &cache_ms_mode,
+ &width, &cache_ms_width);
+
+ if (retval == RIG_OK)
+ {
+ if (cache_ms_freq_p) { *cache_ms_freq_p = cache_ms_freq; }
+ }
+
+ return retval;
+}
+
+
void rig_cache_show(RIG *rig, const char *func, int line)
{
rig_debug(RIG_DEBUG_CACHE,
diff --git a/src/rig.c b/src/rig.c
index 5523ef42..b42cf331 100644
--- a/src/rig.c
+++ b/src/rig.c
@@ -1808,7 +1808,11 @@ int HAMLIB_API rig_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
if (retcode != RIG_OK) { RETURNFUNC(retcode); }
- rig_set_cache_freq(rig, vfo, (freq_t)0);
+ // Unidirectional rigs do not reset cache
+ if (rig->caps->rig_model != RIG_MODEL_FT736R)
+ {
+ rig_set_cache_freq(rig, vfo, (freq_t)0);
+ }
#if 0 // this verification seems to be causing bad behavior on some rigs
commit ce8f50d04ccfb2760482f4e40b8a3f6fb724d4b5
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sat Dec 17 17:23:52 2022 -0600
Ensure get_powerstat return RIG_OK when rig does not have get_powerstat
https://github.com/Hamlib/Hamlib/issues/1189
diff --git a/src/rig.c b/src/rig.c
index c50f047a..5523ef42 100644
--- a/src/rig.c
+++ b/src/rig.c
@@ -6032,7 +6032,7 @@ int HAMLIB_API rig_get_powerstat(RIG *rig, powerstat_t *status)
if (rig->caps->get_powerstat == NULL)
{
*status = RIG_POWER_ON; // default to power if not available
- RETURNFUNC(-RIG_ENAVAIL);
+ RETURNFUNC(RIG_OK);
}
*status = RIG_POWER_OFF; // default now to power off until proven otherwise in get_powerstat
commit 701a53ce2339598744a5a9739d400525610cec11
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sat Dec 17 10:35:56 2022 -0600
Reset rig->state.cache.split so it can be set again when rigctld reopens the rig
https://github.com/Hamlib/Hamlib/issues/1187
diff --git a/src/rig.c b/src/rig.c
index 5ffaa221..c50f047a 100644
--- a/src/rig.c
+++ b/src/rig.c
@@ -1520,6 +1520,8 @@ int HAMLIB_API rig_close(RIG *rig)
remove_opened_rig(rig);
+ // zero split so it will allow it to be set again on open for rigctld
+ rig->state.cache.split = 0;
rs->comm_state = 0;
rig_debug(RIG_DEBUG_VERBOSE, "%s(%d): %p rs->comm_state==0?=%d\n", __func__,
__LINE__, &rs->comm_state,
commit baaf214f9ca759d267b2f47fa4b92e6e50c6f189
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sat Dec 17 09:59:04 2022 -0600
FT-736 did not have get_mode so only call get_mode when available
https://github.com/Hamlib/Hamlib/issues/1187
commit 777a40216e7ffcb82b206bde626cf0b117547188
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sat Dec 17 10:19:46 2022 -0600
Do not reset cache for unidirectional rigs
https://github.com/Hamlib/Hamlib/issues/1187
diff --git a/src/rig.c b/src/rig.c
index b1533efc..5ffaa221 100644
--- a/src/rig.c
+++ b/src/rig.c
@@ -1897,7 +1897,12 @@ int HAMLIB_API rig_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
#endif
)
{
- rig_set_cache_freq(rig, RIG_VFO_ALL, (freq_t)0);
+ // Unidirectional rigs do not reset cache
+ if (rig->caps->rig_model != RIG_MODEL_FT736R)
+ {
+ rig_set_cache_freq(rig, RIG_VFO_ALL, (freq_t)0);
+ }
+
HAMLIB_TRACE;
retcode = rig_get_freq(rig, vfo, &freq_new);
commit 7a3600295f4359d3323332a1a62d72e35abcf604
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sat Dec 17 09:59:04 2022 -0600
FT-736 did not have get_mode so only call get_mode when available
https://github.com/Hamlib/Hamlib/issues/1187
diff --git a/src/rig.c b/src/rig.c
index 7c8b326f..b1533efc 100644
--- a/src/rig.c
+++ b/src/rig.c
@@ -1346,14 +1346,18 @@ int HAMLIB_API rig_open(RIG *rig)
rig_debug(RIG_DEBUG_VERBOSE, "%s(%d): Current split=%d, tx_vfo=%s\n", __func__,
__LINE__, split, rig_strvfo(tx_vfo));
rmode_t mode;
- pbwidth_t width;
- rig_get_mode(rig, RIG_VFO_A, &mode, &width);
+ pbwidth_t width = 2400; // we'll use 2400Hz as default width
- if (split)
+ if (rig->caps->get_mode)
{
- rig_debug(RIG_DEBUG_VERBOSE, "xxxsplit=%d\n", split);
- HAMLIB_TRACE;
- rig_get_mode(rig, RIG_VFO_B, &mode, &width);
+ rig_get_mode(rig, RIG_VFO_A, &mode, &width);
+
+ if (split)
+ {
+ rig_debug(RIG_DEBUG_VERBOSE, "xxxsplit=%d\n", split);
+ HAMLIB_TRACE;
+ rig_get_mode(rig, RIG_VFO_B, &mode, &width);
+ }
}
}
}
@@ -2892,8 +2896,9 @@ int HAMLIB_API rig_get_vfo(RIG *rig, vfo_t *vfo)
if (cache_ms < rig->state.cache.timeout_ms)
{
- rig_debug(RIG_DEBUG_TRACE, "%s: cache hit age=%dms\n", __func__, cache_ms);
*vfo = rig->state.cache.vfo;
+ rig_debug(RIG_DEBUG_TRACE, "%s: cache hit age=%dms, vfo=%s\n", __func__,
+ cache_ms, rig_strvfo(*vfo));
ELAPSED2;
RETURNFUNC(RIG_OK);
}
commit 3b8bc150d12f5f56e3ebb05c588d6aa022528934
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sat Dec 17 10:00:07 2022 -0600
Update NEWS
diff --git a/NEWS b/NEWS
index 6b8bc4fe..908ad034 100644
--- a/NEWS
+++ b/NEWS
@@ -17,6 +17,7 @@ Version 4.6
* Add MDS 4710/9710 rigs
Version 4.5.2
+ * Fix rig.c calling rig_get_mode when backend does not have get_mode
* Fix kenwood_ts890_get_level
* Add Prosistel D elevation CBOX az to fix problem with azimuth control
* 2022-12-XX -- Planned for Dec 2022
commit b35dc746cc728477a3c769ccffb6729e331ee553
Author: Mike Black W9MDB <mdb...@ya...>
Date: Thu Dec 15 17:14:00 2022 -0600
Update NEWS
diff --git a/NEWS b/NEWS
index 026f9410..6b8bc4fe 100644
--- a/NEWS
+++ b/NEWS
@@ -17,6 +17,7 @@ Version 4.6
* Add MDS 4710/9710 rigs
Version 4.5.2
+ * Fix kenwood_ts890_get_level
* Add Prosistel D elevation CBOX az to fix problem with azimuth control
* 2022-12-XX -- Planned for Dec 2022
* Fix FT736R gpredict usage by adding cached get_freq
commit 9f67561d230133dbc7154ae16742e209c69a36e3
Author: Mike Black W9MDB <mdb...@ya...>
Date: Thu Dec 15 17:11:08 2022 -0600
Fix kenwood_ts890_get_level -- thanks to N3GB George Baltz
diff --git a/rigs/kenwood/ts890s.c b/rigs/kenwood/ts890s.c
index 9c23b131..dc2781b9 100644
--- a/rigs/kenwood/ts890s.c
+++ b/rigs/kenwood/ts890s.c
@@ -305,7 +305,7 @@ int kenwood_ts890_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
if (rig->caps->swr_cal.size)
{
- val->f = rig_raw2val_float(val->i, &rig->caps->swr_cal);
+ val->f = rig_raw2val_float(levelint, &rig->caps->swr_cal);
}
else
{
@@ -432,7 +432,7 @@ const struct rig_caps ts890s_caps =
RIG_MODEL(RIG_MODEL_TS890S),
.model_name = "TS-890S",
.mfg_name = "Kenwood",
- .version = BACKEND_VER ".9",
+ .version = BACKEND_VER ".10",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
commit 2d226f446485b8fc4da22a32fb595d5af47e1fff
Author: Mike Black W9MDB <mdb...@ya...>
Date: Thu Dec 15 12:04:14 2022 -0600
Update NEWS
diff --git a/NEWS b/NEWS
index c717fd69..026f9410 100644
--- a/NEWS
+++ b/NEWS
@@ -17,6 +17,7 @@ Version 4.6
* Add MDS 4710/9710 rigs
Version 4.5.2
+ * Add Prosistel D elevation CBOX az to fix problem with azimuth control
* 2022-12-XX -- Planned for Dec 2022
* Fix FT736R gpredict usage by adding cached get_freq
* Fix get_powerstat problem with Log4OM/Flex and others
commit d31d651de55797c298a4808ee19f00a57bce604c
Author: PianetaRadio <789...@us...>
Date: Thu Dec 15 18:24:55 2022 +0100
Update rotlist.h
Add Elevation rotator with Control box responding to azimuth logic
diff --git a/include/hamlib/rotlist.h b/include/hamlib/rotlist.h
index 744c716c..62d64ffe 100644
--- a/include/hamlib/rotlist.h
+++ b/include/hamlib/rotlist.h
@@ -557,6 +557,7 @@
#define ROT_MODEL_PROSISTEL_D_AZ ROT_MAKE_MODEL(ROT_PROSISTEL, 1)
#define ROT_MODEL_PROSISTEL_D_EL ROT_MAKE_MODEL(ROT_PROSISTEL, 2)
#define ROT_MODEL_PROSISTEL_COMBI_TRACK_AZEL ROT_MAKE_MODEL(ROT_PROSISTEL, 3)
+#define ROT_MODEL_PROSISTEL_D_EL_CBOXAZ ROT_MAKE_MODEL(ROT_PROSISTEL, 4)
/**
commit bc7e88dd9d0f93a8eece5d2c9ea4122114f8ce2f
Author: PianetaRadio <789...@us...>
Date: Thu Dec 15 18:21:23 2022 +0100
Update prosistel.c
Add Elevation rotator with Control box responding to azimuth logic
diff --git a/rotators/prosistel/prosistel.c b/rotators/prosistel/prosistel.c
index 1ab58602..76a2a37f 100644
--- a/rotators/prosistel/prosistel.c
+++ b/rotators/prosistel/prosistel.c
@@ -379,6 +379,15 @@ static const struct prosistel_rot_priv_caps prosistel_rot_combitrack_priv_caps =
};
+// Elevation rotator with Control box D using azimuth logic
+static const struct prosistel_rot_priv_caps prosistel_rot_el_cboxaz =
+{
+ .angle_multiplier = 1.0f,
+ .stop_angle = 997,
+ .elevation_id = 'A',
+};
+
+
/*
* Prosistel rotator capabilities
*/
@@ -487,7 +496,7 @@ const struct rot_caps prosistel_combi_track_azel_rot_caps =
};
-//Elevation rotator with ControlBox using azimuth logic
+// Elevation rotator with Control box D using azimuth logic
const struct rot_caps prosistel_d_el_cboxaz_rot_caps =
{
ROT_MODEL(ROT_MODEL_PROSISTEL_D_EL_CBOXAZ),
commit fcf69dff5e3388caaa5d2d21968c2b83227550fc
Author: PianetaRadio <789...@us...>
Date: Thu Dec 15 18:12:32 2022 +0100
Update prosistel.h
Add Elevation rotator with Control box responding to azimuth logic
diff --git a/rotators/prosistel/prosistel.h b/rotators/prosistel/prosistel.h
index ee7b3594..2b1b90c8 100644
--- a/rotators/prosistel/prosistel.h
+++ b/rotators/prosistel/prosistel.h
@@ -25,5 +25,6 @@
extern const struct rot_caps prosistel_d_az_rot_caps;
extern const struct rot_caps prosistel_d_el_rot_caps;
extern const struct rot_caps prosistel_combi_track_azel_rot_caps;
+extern const struct rot_caps prosistel_d_el_cboxaz_rot_caps;
#endif /* _ROT_PROSISTEL_H */
commit b1e501a856b8caa2535a7d06853b7979dc87d5eb
Author: PianetaRadio <789...@us...>
Date: Thu Dec 15 18:09:51 2022 +0100
Update prosistel.c
Add Elevation rotator with Control box responding to azimuth logic
diff --git a/rotators/prosistel/prosistel.c b/rotators/prosistel/prosistel.c
index 511cde4a..1ab58602 100644
--- a/rotators/prosistel/prosistel.c
+++ b/rotators/prosistel/prosistel.c
@@ -486,6 +486,43 @@ const struct rot_caps prosistel_combi_track_azel_rot_caps =
.get_position = prosistel_rot_get_position,
};
+
+//Elevation rotator with ControlBox using azimuth logic
+const struct rot_caps prosistel_d_el_cboxaz_rot_caps =
+{
+ ROT_MODEL(ROT_MODEL_PROSISTEL_D_EL_CBOXAZ),
+ .model_name = "D elevation CBOX az",
+ .mfg_name = "Prosistel",
+ .version = "20221215.0",
+ .copyright = "LGPL",
+ .status = RIG_STATUS_STABLE,
+ .rot_type = ROT_TYPE_ELEVATION,
+ .port_type = RIG_PORT_SERIAL,
+ .serial_rate_min = 9600,
+ .serial_rate_max = 9600,
+ .serial_data_bits = 8,
+ .serial_stop_bits = 1,
+ .serial_parity = RIG_PARITY_NONE,
+ .serial_handshake = RIG_HANDSHAKE_NONE,
+ .write_delay = 0,
+ .post_write_delay = 0,
+ .timeout = 3000,
+ .retry = 3,
+
+ .min_az = 0.0,
+ .max_az = 0.0,
+ .min_el = 0.0,
+ .max_el = 90.0,
+
+ .priv = &prosistel_rot_el_cboxaz,
+
+ .rot_open = prosistel_rot_open,
+ .stop = prosistel_rot_stop,
+ .set_position = prosistel_rot_set_position,
+ .get_position = prosistel_rot_get_position,
+};
+
+
DECLARE_INITROT_BACKEND(prosistel)
{
rig_debug(RIG_DEBUG_VERBOSE, "%s: _init called\n", __func__);
@@ -493,6 +530,7 @@ DECLARE_INITROT_BACKEND(prosistel)
rot_register(&prosistel_d_az_rot_caps);
rot_register(&prosistel_d_el_rot_caps);
rot_register(&prosistel_combi_track_azel_rot_caps);
+ rot_register(&prosistel_d_el_cboxaz_rot_caps);
return RIG_OK;
}
commit 4e88d847b08cbff97de5c1a7b5ee5ad376d2cb0f
Author: Mike Black W9MDB <mdb...@ya...>
Date: Wed Dec 14 11:17:17 2022 -0600
Update NEWS
diff --git a/NEWS b/NEWS
index 6595b48e..c717fd69 100644
--- a/NEWS
+++ b/NEWS
@@ -18,6 +18,7 @@ Version 4.6
Version 4.5.2
* 2022-12-XX -- Planned for Dec 2022
+ * Fix FT736R gpredict usage by adding cached get_freq
* Fix get_powerstat problem with Log4OM/Flex and others
* Fix -R option to not need argument
* Fix -R option to close rig on last rigctld client disconnect
commit 80cdb9b953fcdf9b4b027aeed33df6758806492a
Author: Mike Black W9MDB <mdb...@ya...>
Date: Wed Dec 14 11:04:30 2022 -0600
Update NEWS
diff --git a/NEWS b/NEWS
index 08d9411b..6595b48e 100644
--- a/NEWS
+++ b/NEWS
@@ -18,6 +18,7 @@ Version 4.6
Version 4.5.2
* 2022-12-XX -- Planned for Dec 2022
+ * Fix get_powerstat problem with Log4OM/Flex and others
* Fix -R option to not need argument
* Fix -R option to close rig on last rigctld client disconnect
* Add FTDX1200 to rigs that need to ensure PTT is off before changing frequency
commit f0636bc87590d84ca9b205222854704286a0319c
Author: Mike Black W9MDB <mdb...@ya...>
Date: Wed Dec 14 11:14:54 2022 -0600
Add get_freq cached for FT736R to allow working with gpredict
https://github.com/Hamlib/Hamlib/issues/1187
diff --git a/rigs/yaesu/ft736.c b/rigs/yaesu/ft736.c
index eda6cea0..52cd85fc 100644
--- a/rigs/yaesu/ft736.c
+++ b/rigs/yaesu/ft736.c
@@ -58,6 +58,7 @@ static int ft736_open(RIG *rig);
static int ft736_close(RIG *rig);
static int ft736_set_freq(RIG *rig, vfo_t vfo, freq_t freq);
+static int ft736_get_freq(RIG *rig, vfo_t vfo, freq_t *freq); // cached answer
static int ft736_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width);
static int ft736_set_split_vfo(RIG *rig, vfo_t vfo, split_t split,
vfo_t tx_vfo);
@@ -98,7 +99,7 @@ const struct rig_caps ft736_caps =
RIG_MODEL(RIG_MODEL_FT736R),
.model_name = "FT-736R",
.mfg_name = "Yaesu",
- .version = "20211271.0",
+ .version = "20221214.0",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
@@ -195,6 +196,7 @@ const struct rig_caps ft736_caps =
.rig_close = ft736_close,
.set_freq = ft736_set_freq,
+ .get_freq = ft736_get_freq,
.set_mode = ft736_set_mode,
.set_ptt = ft736_set_ptt,
.get_dcd = ft736_get_dcd,
@@ -290,6 +292,17 @@ int ft736_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
return write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH);
}
+int ft736_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
+{
+ rig_debug(RIG_DEBUG_VERBOSE, "%s: called\n", __func__);
+
+ if (vfo == RIG_VFO_A || vfo == RIG_VFO_MAIN) { *freq = rig->state.cache.freqMainA; }
+ else { *freq = rig->state.cache.freqMainB; }
+
+ return RIG_OK;
+}
+
+
#define MD_LSB 0x00
commit bc45b17ae2d995e05d8bb8d10d4652a65b648d31
Author: Mike Black W9MDB <mdb...@ya...>
Date: Mon Dec 12 17:38:52 2022 -0600
If get_powerstat fails assume rig is powered on -- should fix sdr++ problem
https://github.com/Hamlib/Hamlib/issues/1186
commit 2dd31355fc5fe3dd1a4afdd8843f53132bce7395
Author: Mike Black W9MDB <mdb...@ya...>
Date: Wed Dec 14 09:05:27 2022 -0600
If get_powerstat fails in any way then always return RIG_POWER_ON
https://github.com/Hamlib/Hamlib/issues/1189
diff --git a/rigs/dummy/netrigctl.c b/rigs/dummy/netrigctl.c
index eed16b83..cd6a7c63 100644
--- a/rigs/dummy/netrigctl.c
+++ b/rigs/dummy/netrigctl.c
@@ -2052,23 +2052,22 @@ static int netrigctl_get_powerstat(RIG *rig, powerstat_t *status)
ret = netrigctl_transaction(rig, cmd, strlen(cmd), buf);
- if (ret == 1)
+ if (ret == 0)
+ {
+ *status = atoi(buf);
+ }
+ else
{
// was causing problems with sdr++ since it does not have PS command
// a return of 1 should indicate there is no powerstat command available
// so we fake the ON status
+ // also a problem with Flex 6xxx and Log4OM not working due to lack of PS command
+ rig_debug(RIG_DEBUG_VERBOSE,
+ "%s: PS command failed (ret=%d) so returning RIG_POWER_ON\n", __func__, ret);
*status = RIG_POWER_ON;
- return RIG_OK;
- }
-
- if (ret <= 0)
- {
- return (ret < 0) ? ret : -RIG_EPROTO;
}
- *status = atoi(buf);
-
- return RIG_OK;
+ return RIG_OK; // always return RIG_OK
}
@@ -2735,7 +2734,7 @@ struct rig_caps netrigctl_caps =
RIG_MODEL(RIG_MODEL_NETRIGCTL),
.model_name = "NET rigctl",
.mfg_name = "Hamlib",
- .version = "20221212.0",
+ .version = "20221214.0",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_OTHER,
commit 9edbc9e4b0a231e835b9c4331821aa955366f272
Author: Mike Black W9MDB <mdb...@ya...>
Date: Tue Dec 13 08:02:24 2022 -0600
Update NEWS
diff --git a/NEWS b/NEWS
index 5a48443e..08d9411b 100644
--- a/NEWS
+++ b/NEWS
@@ -21,7 +21,7 @@ Version 4.5.2
* Fix -R option to not need argument
* Fix -R option to close rig on last rigctld client disconnect
* Add FTDX1200 to rigs that need to ensure PTT is off before changing frequency
- * Add --disable-parallel configure option for mingw builds
+ * Add --disable-parallel configure option for mingw builds on Linux
Version 4.5.1
* 2022-12-08
commit 23d98c1e5628597a37b68f9b53859ea1ba37e5b2
Author: Mike Black W9MDB <mdb...@ya...>
Date: Mon Dec 12 23:53:41 2022 -0600
Update NEWS
diff --git a/NEWS b/NEWS
index 70890f3c..5a48443e 100644
--- a/NEWS
+++ b/NEWS
@@ -16,6 +16,13 @@ Version 4.6
* 2023-11-XX -- Planned for Nov 2023
* Add MDS 4710/9710 rigs
+Version 4.5.2
+ * 2022-12-XX -- Planned for Dec 2022
+ * Fix -R option to not need argument
+ * Fix -R option to close rig on last rigctld client disconnect
+ * Add FTDX1200 to rigs that need to ensure PTT is off before changing frequency
+ * Add --disable-parallel configure option for mingw builds
+
Version 4.5.1
* 2022-12-08
* FT2000, FTDX3000/D, FT891, FT991, FT950, FTDX5000 now set CAT TOT to 100ms
commit fd186abcaeb63506bff9c65b7332fb913f64569d
Author: Mike Black W9MDB <mdb...@ya...>
Date: Mon Dec 12 23:46:53 2022 -0600
-R option will keep rig open as long as 1 or more clients are connected
https://github.com/Hamlib/Hamlib/issues/1187
diff --git a/tests/rigctld.c b/tests/rigctld.c
index 6b837ae6..9bc906b2 100644
--- a/tests/rigctld.c
+++ b/tests/rigctld.c
@@ -1197,7 +1197,7 @@ void *handle_socket(void *arg)
#ifdef HAVE_PTHREAD
mutex_rigctld(1);
-// ++client_count;
+ ++client_count;
#if 0
if (!client_count++)
@@ -1313,14 +1313,19 @@ void *handle_socket(void *arg)
}
while (!ctrl_c && (retcode == RIG_OK || RIG_IS_SOFT_ERRCODE(-retcode)));
- if (rigctld_idle)
+ if (rigctld_idle && client_count == 1)
{
rig_close(my_rig);
if (verbose > RIG_DEBUG_ERR) { printf("Closed rig model %s. Will reopen for new clients\n", my_rig->caps->model_name); }
}
+
#ifdef HAVE_PTHREAD
+ --client_count;
+
+ if (rigctld_idle && client_count > 0) { printf("%d client%s still connected so rig remains open\n", client_count, client_count > 1 ? "s" : ""); }
+
#if 0
mutex_rigctld(1);
commit 01799cb64f2afa8a8be06a46c0a6f0d4f8a38351
Author: Mike Black W9MDB <mdb...@ya...>
Date: Mon Dec 12 23:28:22 2022 -0600
Allow rigctld to close the rig with the -R option when client disconnects.
This makes it close when any one client disconnects.
Should only close when no clients are connected -- that will be the next patch
This is for the FT736R and gpredict
https://github.com/Hamlib/Hamlib/issues/1187
diff --git a/tests/rigctld.c b/tests/rigctld.c
index bd2915dd..6b837ae6 100644
--- a/tests/rigctld.c
+++ b/tests/rigctld.c
@@ -83,7 +83,7 @@
* keep up to date SHORT_OPTIONS, usage()'s output and man page. thanks.
* TODO: add an option to read from a file
*/
-#define SHORT_OPTIONS "m:r:R:p:d:P:D:s:S:c:T:t:C:W:w:x:z:lLuovhVZMA:n:"
+#define SHORT_OPTIONS "m:r:p:d:P:D:s:S:c:T:t:C:W:w:x:z:lLuovhVZMRA:n:"
static struct option long_options[] =
{
{"model", 1, 0, 'm'},
@@ -154,6 +154,8 @@ extern char rigctld_password[65];
char resp_sep = '\n';
extern int lock_mode;
extern powerstat_t rig_powerstat;
+static int rigctld_idle =
+ 0; // if true then rig will close when no clients are connected
#define MAXCONFLEN 1024
@@ -262,8 +264,6 @@ int main(int argc, char *argv[])
int twiddle_timeout = 0;
int twiddle_rit = 0;
int uplink = 0;
- int rigctld_idle =
- 0; // if true then rig will close when no clients are connected
char host[NI_MAXHOST];
char serv[NI_MAXSERV];
char rigstartup[1024];
@@ -1313,6 +1313,13 @@ void *handle_socket(void *arg)
}
while (!ctrl_c && (retcode == RIG_OK || RIG_IS_SOFT_ERRCODE(-retcode)));
+ if (rigctld_idle)
+ {
+ rig_close(my_rig);
+
+ if (verbose > RIG_DEBUG_ERR) { printf("Closed rig model %s. Will reopen for new clients\n", my_rig->caps->model_name); }
+ }
+
#ifdef HAVE_PTHREAD
#if 0
mutex_rigctld(1);
commit 46f30345b9c57e85f08630fad9b1c3c2b0b98a7c
Author: Mike Black W9MDB <mdb...@ya...>
Date: Mon Dec 12 17:38:52 2022 -0600
If get_powerstat fails assume rig is powered on -- should fix sdr++ problem
https://github.com/Hamlib/Hamlib/issues/1186
diff --git a/rigs/dummy/netrigctl.c b/rigs/dummy/netrigctl.c
index 3aba3def..eed16b83 100644
--- a/rigs/dummy/netrigctl.c
+++ b/rigs/dummy/netrigctl.c
@@ -2052,6 +2052,15 @@ static int netrigctl_get_powerstat(RIG *rig, powerstat_t *status)
ret = netrigctl_transaction(rig, cmd, strlen(cmd), buf);
+ if (ret == 1)
+ {
+ // was causing problems with sdr++ since it does not have PS command
+ // a return of 1 should indicate there is no powerstat command available
+ // so we fake the ON status
+ *status = RIG_POWER_ON;
+ return RIG_OK;
+ }
+
if (ret <= 0)
{
return (ret < 0) ? ret : -RIG_EPROTO;
@@ -2726,7 +2735,7 @@ struct rig_caps netrigctl_caps =
RIG_MODEL(RIG_MODEL_NETRIGCTL),
.model_name = "NET rigctl",
.mfg_name = "Hamlib",
- .version = "20221201.0",
+ .version = "20221212.0",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_OTHER,
commit 859204026277a3f396a88b5e8f06415fe363cc22
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sun Dec 11 14:50:13 2022 -0600
Update simftdx1200.c
diff --git a/simulators/simftdx1200.c b/simulators/simftdx1200.c
new file mode 100644
index 00000000..2808405a
--- /dev/null
+++ b/simulators/simftdx1200.c
@@ -0,0 +1,309 @@
+// can run this using rigctl/rigctld and socat pty devices
+// gcc -o simyaesu simyaesu.c
+#define _XOPEN_SOURCE 600
+#include <stdio.h>
+#include <stdlib.h>
+#include <fcntl.h>
+#include <string.h>
+#include <unistd.h>
+#include "../include/hamlib/rig.h"
+
+#define BUFSIZE 256
+
+float freqA = 14074000;
+float freqB = 14074500;
+int vfo = 0;
+int ft = 0;
+int md = 1;
+int vs = 0;
+int tx = 0;
+int ai = 0;
+int sh = 25;
+int na = 0;
+int ex039 = 0;
+
+// ID 0310 == 310, Must drop leading zero
+typedef enum nc_rigid_e
+{
+ NC_RIGID_NONE = 0,
+ NC_RIGID_FT450 = 241,
+ NC_RIGID_FT450D = 244,
+ NC_RIGID_FT950 = 310,
+ NC_RIGID_FT891 = 135,
+ NC_RIGID_FT991 = 135,
+ NC_RIGID_FT2000 = 251,
+ NC_RIGID_FT2000D = 252,
+ NC_RIGID_FTDX1200 = 583,
+ NC_RIGID_FTDX9000D = 101,
+ NC_RIGID_FTDX9000Contest = 102,
+ NC_RIGID_FTDX9000MP = 103,
+ NC_RIGID_FTDX5000 = 362,
+ NC_RIGID_FTDX3000 = 460,
+ NC_RIGID_FTDX101D = 681,
+ NC_RIGID_FTDX101MP = 682
+} nc_rigid_t;
+
+int
+getmyline(int fd, char *buf)
+{
+ char c;
+ int i = 0;
+ memset(buf, 0, BUFSIZE);
+
+ while (read(fd, &c, 1) > 0)
+ {
+ buf[i++] = c;
+
+ if (c == ';') { return strlen(buf); }
+ }
+
+ return strlen(buf);
+}
+
+#if defined(WIN32) || defined(_WIN32)
+int openPort(char *comport) // doesn't matter for using pts devices
+{
+ int fd;
+ fd = open(comport, O_RDWR);
+
+ if (fd < 0)
+ {
+ perror(comport);
+ }
+
+ return fd;
+}
+
+#else
+int openPort(char *comport) // doesn't matter for using pts devices
+{
+ int fd = posix_openpt(O_RDWR);
+ char *name = ptsname(fd);
+
+ if (name == NULL)
+ {
+ perror("pstname");
+ return -1;
+ }
+
+ printf("name=%s\n", name);
+
+ if (fd == -1 || grantpt(fd) == -1 || unlockpt(fd) == -1)
+ {
+ perror("posix_openpt");
+ return -1;
+ }
+
+ return fd;
+}
+#endif
+
+
+
+int main(int argc, char *argv[])
+{
+ char buf[256];
+ char *pbuf;
+ int n;
+ int fd = openPort(argv[1]);
+
+ while (1)
+ {
+ if (getmyline(fd, buf))
+ {
+ printf("Cmd:%s\n", buf);
+ }
+ else { continue; }
+
+ if (strcmp(buf, "RM5;") == 0)
+ {
+ printf("%s\n", buf);
+ usleep(50 * 1000);
+ pbuf = "RM5100000;";
+ n = write(fd, pbuf, strlen(pbuf));
+ printf("n=%d\n", n);
+
+ if (n <= 0) { perror("RM5"); }
+ }
+
+ if (strcmp(buf, "AN0;") == 0)
+ {
+ printf("%s\n", buf);
+ usleep(50 * 1000);
+ pbuf = "AN030;";
+ n = write(fd, pbuf, strlen(pbuf));
+ printf("n=%d\n", n);
+
+ if (n <= 0) { perror("AN"); }
+ }
+ else if (strcmp(buf, "IF;") == 0)
+ {
+ printf("%s\n", buf);
+ usleep(50 * 1000);
+ pbuf = "IF059014200000+000000700000;";
+ n = write(fd, pbuf, strlen(pbuf));
+ printf("n=%d\n", n);
+
+ if (n <= 0) { perror("IF"); }
+ }
+ else if (strcmp(buf, "ID;") == 0)
+ {
+ printf("%s\n", buf);
+ usleep(50 * 1000);
+ int id = NC_RIGID_FTDX3000;
+ SNPRINTF(buf, sizeof(buf), "ID%03d;", id);
+ n = write(fd, buf, strlen(buf));
+ printf("n=%d\n", n);
+
+ if (n <= 0) { perror("ID"); }
+ }
+ else if (strcmp(buf, "AI;") == 0)
+ {
+ printf("%s\n", buf);
+ usleep(50 * 1000);
+ SNPRINTF(buf, sizeof(buf), "AI0;");
+ n = write(fd, buf, strlen(buf));
+ printf("n=%d\n", n);
+
+ if (n <= 0) { perror("ID"); }
+ }
+
+#if 0
+ else if (strncmp(buf, "AI", 2) == 0)
+ {
+ if (strcmp(buf, "AI;"))
+ {
+ printf("%s\n", buf);
+ usleep(50 * 1000);
+ n = fprintf(fp, "%s", "AI0;");
+ printf("n=%d\n", n);
+
+ if (n <= 0) { perror("AI"); }
+ }
+ }
+
+#endif
+ else if (strcmp(buf, "VS;") == 0)
+ {
+ printf("%s\n", buf);
+ usleep(50 * 1000);
+ pbuf = "VS0;";
+ n = write(fd, pbuf, strlen(pbuf));
+ printf("n=%d\n", n);
+
+ if (n < 0) { perror("VS"); }
+ }
+ else if (strcmp(buf, "EX032;") == 0)
+ {
+ static int ant = 0;
+ ant = (ant + 1) % 3;
+ printf("%s\n", buf);
+ usleep(50 * 1000);
+ SNPRINTF(buf, sizeof(buf), "EX032%1d;", ant);
+ n = write(fd, buf, strlen(buf));
+ printf("n=%d\n", n);
+
+ if (n < 0) { perror("EX032"); }
+ }
+
+ else if (strcmp(buf, "FA;") == 0)
+ {
+ SNPRINTF(buf, sizeof(buf), "FA%08.0f;", freqA);
+ n = write(fd, buf, strlen(buf));
+ }
+ else if (strncmp(buf, "FA", 2) == 0)
+ {
+ sscanf(buf, "FA%f", &freqA);
+ }
+ else if (strcmp(buf, "FB;") == 0)
+ {
+ SNPRINTF(buf, sizeof(buf), "FB%08.0f;", freqB);
+ n = write(fd, buf, strlen(buf));
+ }
+ else if (strncmp(buf, "FB", 2) == 0)
+ {
+ sscanf(buf, "FB%f", &freqB);
+ }
+ else if (strcmp(buf, "VS;") == 0)
+ {
+ SNPRINTF(buf, sizeof(buf), "VS%c;", vfo == 0 ? '0' : '1');
+ n = write(fd, buf, strlen(buf));
+ }
+ else if (strcmp(buf, "FT;") == 0)
+ {
+ SNPRINTF(buf, sizeof(buf), "FT%d;", ft);
+ n = write(fd, buf, strlen(buf));
+ }
+ else if (strcmp(buf, "MD0;") == 0)
+ {
+ SNPRINTF(buf, sizeof(buf), "MD0%d;", md);
+ n = write(fd, buf, strlen(buf));
+ }
+ else if (strcmp(buf, "VS;") == 0)
+ {
+ SNPRINTF(buf, sizeof(buf), "VS%d;", vs);
+ n = write(fd, buf, strlen(buf));
+ }
+ else if (strncmp(buf, "VS", 2) == 0)
+ {
+ sscanf(buf, "VS%d", &vs);
+ }
+ else if (strcmp(buf, "TX;") == 0)
+ {
+ SNPRINTF(buf, sizeof(buf), "TX%d;", tx);
+ n = write(fd, buf, strlen(buf));
+ }
+ else if (strncmp(buf, "TX", 2) == 0)
+ {
+ sscanf(buf, "TX%d", &tx);
+ }
+ else if (strcmp(buf, "AI;") == 0)
+ {
+ SNPRINTF(buf, sizeof(buf), "AI%d;", ai);
+ n = write(fd, buf, strlen(buf));
+ }
+ else if (strncmp(buf, "AI", 2) == 0)
+ {
+ sscanf(buf, "AI%d", &ai);
+ }
+ else if (strcmp(buf, "SH0;") == 0)
+ {
+ SNPRINTF(buf, sizeof(buf), "SH0%d;", sh);
+ n = write(fd, buf, strlen(buf));
+ }
+ else if (strncmp(buf, "SH0", 3) == 0)
+ {
+ sscanf(buf, "SH0%d", &sh);
+ }
+ else if (strcmp(buf, "NA0;") == 0)
+ {
+ SNPRINTF(buf, sizeof(buf), "NA0%d;", na);
+ n = write(fd, buf, strlen(buf));
+ }
+ else if (strncmp(buf, "NA0", 3) == 0)
+ {
+ sscanf(buf, "NA0%d", &na);
+ }
+ else if (strcmp(buf, "EX039;") == 0)
+ {
+ SNPRINTF(buf, sizeof(buf), "EX039%d;", ex039);
+ n = write(fd, buf, strlen(buf));
+ }
+ else if (strncmp(buf, "EX039", 3) == 0)
+ {
+ sscanf(buf, "EX039%d", &ex039);
+ }
+ else if (strcmp(buf,"PS;") == 0)
+ {
+ SNPRINTF(buf, sizeof(buf), "PS1;");
+ n = write(fd, buf, strlen(buf));
+ }
+ else if (strlen(buf) > 0)
+ {
+ fprintf(stderr, "Unknown command: %s\n", buf);
+ }
+
+ }
+
+ return 0;
+}
commit 0d4f647da3d0510b48a7a04821bccaa67f72c5aa
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sun Dec 11 11:53:22 2022 -0600
Add FTDX1200 to rigs that need to ensure PTT is off before changing frequency
https://github.com/Hamlib/Hamlib/issues/1185
diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c
index c5f987b4..fda8aa01 100644
--- a/rigs/yaesu/newcat.c
+++ b/rigs/yaesu/newcat.c
@@ -886,7 +886,7 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
if (vfo != rig->state.tx_vfo) { return -RIG_ENTARGET; }
}
- if (is_ftdx3000 || is_ftdx3000dm || is_ftdx5000)
+ if (is_ftdx3000 || is_ftdx3000dm || is_ftdx5000 || is_ftdx1200)
{
// we have a few rigs that can't set freq while PTT_ON
// so we'll try a few times to see if we just need to wait a bit
diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h
index 3f35b553..c45a4d9d 100644
--- a/rigs/yaesu/newcat.h
+++ b/rigs/yaesu/newcat.h
@@ -50,7 +50,7 @@
typedef char ncboolean;
/* shared function version */
-#define NEWCAT_VER "20221204"
+#define NEWCAT_VER "20221211"
/* Hopefully large enough for future use, 128 chars plus '\0' */
#define NEWCAT_DATA_LEN 129
commit ec5dde91c594533cf842a859f61ec45443266dea
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sun Dec 11 13:56:29 2022 -0600
astyle newcat.c
diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c
index 5bdae1f4..c5f987b4 100644
--- a/rigs/yaesu/newcat.c
+++ b/rigs/yaesu/newcat.c
@@ -604,12 +604,18 @@ int newcat_open(RIG *rig)
char *cmd = "EX0291;EX029;"; // FT2000/D
if (priv->rig_id == NC_RIGID_FT950 || rig->caps->rig_model == RIG_MODEL_FT950) { cmd = "EX0271;EX027;"; }
- else if (priv->rig_id == NC_RIGID_FT891 || rig->caps->rig_model == RIG_MODEL_FT891) { cmd = "EX05071;EX0507;"; }
- else if (priv->rig_id == NC_RIGID_FT991 || rig->caps->rig_model == RIG_MODEL_FT991) { cmd = "EX0321;EX032;"; }
- else if (priv->rig_id == NC_RIGID_FT991A || rig->caps->rig_model == RIG_MODEL_FT991) { cmd = "EX0321;EX032;"; }
- else if (priv->rig_id == NC_RIGID_FTDX3000 || rig->caps->rig_model == RIG_MODEL_FTDX3000) { cmd = "EX0391;EX039;"; }
- else if (priv->rig_id == NC_RIGID_FTDX3000DM || rig->caps->rig_model == RIG_MODEL_FTDX3000) { cmd = "EX0391;EX039;"; }
- else if (priv->rig_id == NC_RIGID_FTDX5000 || rig->caps->rig_model == RIG_MODEL_FTDX5000) { cmd = "EX0331;EX033"; }
+ else if (priv->rig_id == NC_RIGID_FT891
+ || rig->caps->rig_model == RIG_MODEL_FT891) { cmd = "EX05071;EX0507;"; }
+ else if (priv->rig_id == NC_RIGID_FT991
+ || rig->caps->rig_model == RIG_MODEL_FT991) { cmd = "EX0321;EX032;"; }
+ else if (priv->rig_id == NC_RIGID_FT991A
+ || rig->caps->rig_model == RIG_MODEL_FT991) { cmd = "EX0321;EX032;"; }
+ else if (priv->rig_id == NC_RIGID_FTDX3000
+ || rig->caps->rig_model == RIG_MODEL_FTDX3000) { cmd = "EX0391;EX039;"; }
+ else if (priv->rig_id == NC_RIGID_FTDX3000DM
+ || rig->caps->rig_model == RIG_MODEL_FTDX3000) { cmd = "EX0391;EX039;"; }
+ else if (priv->rig_id == NC_RIGID_FTDX5000
+ || rig->caps->rig_model == RIG_MODEL_FTDX5000) { cmd = "EX0331;EX033"; }
SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "%s", cmd);
commit e883918d853043f5d434925ffb945e9f25474860
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sat Dec 10 11:49:45 2022 -0600
Fix rigctld segfault when using -P RTS
https://github.com/Hamlib/Hamlib/issues/1182
diff --git a/Segfault-award b/Segfault-award
index 2d02ce1b..e09c6749 100644
--- a/Segfault-award
+++ b/Segfault-award
@@ -7,6 +7,8 @@ A developer cannot apply for HSHR for segfaults on his/her own code.
Here is the list of the brave fellows:
+* Saku Nyland OH1KH v4.5.1, 10/2022, rigctld.c using ptt_type=RTS
+
* David Kjellquist WB5NHL, v1.1.3, 09/2002, kenwood/ts570.c
caught on TS570D backend startup.
diff --git a/tests/rigctld.c b/tests/rigctld.c
index 470534c3..bd2915dd 100644
--- a/tests/rigctld.c
+++ b/tests/rigctld.c
@@ -701,7 +701,9 @@ int main(int argc, char *argv[])
{
my_rig->state.pttport.type.ptt = ptt_type;
my_rig->state.pttport_deprecated.type.ptt = ptt_type;
- my_rig->caps->ptt_type = ptt_type;
+ // This causes segfault since backend rig_caps are const
+ // rigctld will use the rig->state version of this for clients
+ //my_rig->caps->ptt_type = ptt_type;
}
if (dcd_type != RIG_DCD_NONE)
commit 5c12619117c959ad7fba4406a7fe8381410ebfcc
Author: Mike Black W9MDB <mdb...@ya...>
Date: Fri Dec 9 23:32:51 2022 -0600
Add --disable-parallel configure option
https://github.com/Hamlib/Hamlib/issues/1181
diff --git a/configure.ac b/configure.ac
index 203b640b..7f2a7007 100644
--- a/configure.ac
+++ b/configure.ac
@@ -694,6 +694,15 @@ AC_ARG_ENABLE([winradio],
[cf_with_winradio="yes" AC_DEFINE([HAVE_WINRADIO],[1],[Define if winradio backend is built])])
AC_MSG_RESULT([$cf_with_winradio])
+dnl Parallel port device disable
+AC_MSG_CHECKING([whether to build parallel port devices])
+AC_ARG_ENABLE([parallel],
+ [AS_HELP_STRING([--disable-parallel],
+ [do not build parallel devices @<:@default=yes@:>@])],
+ [cf_with_parallel="no"],
+ [cf_with_parallel="yes" AC_DEFINE([HAVE_PARALLEL],[1],[Define if parallel devices are to be built])])
+AC_MSG_RESULT([$cf_with_parallel])
+
DL_LIBS=""
AS_IF([test x"${cf_with_winradio}" = "xyes"],
@@ -912,6 +921,7 @@ echo \
Enable HTML rig feature matrix ${cf_enable_html_matrix}
Enable WinRadio ${cf_with_winradio}
+ Enable Parallel ${cf_with_parallel}
Enable USRP ${cf_with_usrp}
Enable USB backends ${cf_with_libusb}
Enable shared libs ${enable_shared}
diff --git a/rotators/fodtrack/fodtrack.c b/rotators/fodtrack/fodtrack.c
index ad9e5850..9f6006ce 100644
--- a/rotators/fodtrack/fodtrack.c
+++ b/rotators/fodtrack/fodtrack.c
@@ -26,9 +26,11 @@
#include <sys/ioctl.h>
#endif
+#ifdef HAVE_PARALLEL
#ifdef HAVE_LINUX_PARPORT_H
#include <linux/parport.h>
#endif
+#endif
#include "hamlib/rotator.h"
#include "parallel.h"
diff --git a/src/parallel.h b/src/parallel.h
index c676ee43..0cdc1f0b 100644
--- a/src/parallel.h
+++ b/src/parallel.h
@@ -26,9 +26,11 @@
#include <hamlib/rig.h>
#include "iofunc.h"
+#ifdef HAVE_PARALLEL
#ifdef HAVE_LINUX_PARPORT_H
# include <linux/parport.h>
#endif
+#endif
#ifndef PARPORT_CONTROL_STROBE
# define PARPORT_CONTROL_STROBE 0x1
commit 64b333944a374f4d56b3509cdb1d5b550ce1ac8f
Author: Nate Bargmann <n0...@n0...>
Date: Fri Dec 9 08:24:36 2022 -0600
Quell groff warning of "font p not found".
Font names need to be upper case in nroff.
diff --git a/doc/man1/rigctl.1 b/doc/man1/rigctl.1
index 772173be..73bc1320 100644
--- a/doc/man1/rigctl.1
+++ b/doc/man1/rigctl.1
@@ -1289,7 +1289,7 @@ CW Skimmer is started and "set_lock_mode 0" when CW Skimmer is stopped.
Returns current lock mode status 1=On, 2=Off (only useful when using rigctld)
.
.TP
-.BR send_raw " \(aq" \fITerminator\fP "\(aq \(aq" \fIString\fp \(aq
+.BR send_raw " \(aq" \fITerminator\fP "\(aq \(aq" \fIString\fP \(aq
.EX
Can send ASCII string or 0xnn values -- there can be no spaces in the command string.
Possible terminator values are CR, LF, ;, ICOM, 0-100 (bytes to read), or -1 meaning unknown (will timeout on read)
commit 18da3525081c15182760af21f5b8895f5adc96f5
Author: Mike Black W9MDB <mdb...@ya...>
Date: Fri Dec 9 08:30:02 2022 -0600
Hamlib-4.5.2 bug fixes
diff --git a/configure.ac b/configure.ac
index c92e77cc..203b640b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -14,7 +14,7 @@ dnl Please do not use '-' in the version number, as package managers will fail,
dnl however, the use of '~' should be fine as apt (others?) will treat
dnl it as an earlier version than the actual release. TNX KA6MAL
dnl PACKAGE_NAME + " " + PACKAGE_VERSION must not exceed 20 chars!
-AC_INIT([Hamlib],[4.5.1],[ham...@li...],[hamlib],[http://www.hamlib.org])
+AC_INIT([Hamlib],[4.5.2],[ham...@li...],[hamlib],[http://www.hamlib.org])
AC_CONFIG_SRCDIR([include/hamlib/rig.h])
AC_CONFIG_MACRO_DIR([macros])
commit 71a9976d9fa674410fa1532c5dba022b8a54fcf6
Author: Mike Black W9MDB <mdb...@ya...>
Date: Thu Dec 8 22:37:10 2022 -0600
Update simftdx3000.c
diff --git a/simulators/simftdx3000.c b/simulators/simftdx3000.c
index e8c4a31f..33b0cd00 100644
--- a/simulators/simftdx3000.c
+++ b/simulators/simftdx3000.c
@@ -252,6 +252,11 @@ int main(int argc, char *argv[])
{
sscanf(buf, "MD0%d", &md);
}
+ else if (strcmp(buf, "PS;") == 0)
+ {
+ SNPRINTF(buf, sizeof(buf), "PS1;");
+ n = write(fd, buf, strlen(buf));
+ }
else if (strcmp(buf, "VS;") == 0)
{
SNPRINTF(buf, sizeof(buf), "VS%d;", vs);
-----------------------------------------------------------------------
hooks/post-receive
--
Hamlib -- Ham radio control libraries
|
|
From: n0nb <n0...@us...> - 2022-12-24 17:09:39
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Hamlib -- Ham radio control libraries".
The branch, master has been updated
via b61550bf6b53c0cef885ed1443967a6c9aa2fb78 (commit)
via 4689a2ff11674da65c1a1245a204010c5f4b758e (commit)
via bfa4bbd50da3f143074fa87b46b50b749d7d7948 (commit)
via 70f38022b6da3375c4b321b810f417d20e29ac45 (commit)
via 33b24561291db92010a851e2fda4660bb9fc3bb1 (commit)
via 17f88dccbf97259f5ea1728ad39f57a08e96a0e7 (commit)
via 267d07f708bea7a6734129b469dc55fdddb5a3b5 (commit)
via f31e1b7ad9b9cc3f035a3942fc4dc303e53b1ac4 (commit)
via cafc094788fcdd65e5fb936e5451a08b780c8ecd (commit)
via b153bcd1e5604b55fd5c0d1b46389909f074c169 (commit)
via f468fa3c1d93e93652cbdbfc8998546b6a79a422 (commit)
via 31e911edb87e3eeec794cb4d26e8bcfea9cd6834 (commit)
via 287fb9091b6479b06eaa55981da149c43145ce60 (commit)
via 04b18c9d5be503a064c9198843408799d2c53e0f (commit)
via ea29263f3512dda2f93ba3429189a20a6782a305 (commit)
via b1828d951a2159e87b6208f6eb3aabdacc03b6aa (commit)
via 9970a2767d2f49c427c51c6a0780a41010269b89 (commit)
via 04f5195cfd68df95bdaaa185b577555390f1276c (commit)
via 9508c45f00558bce22409c472b0de3d5d95f40c8 (commit)
via 120c580de0b67a9da1deac2b53e4238fd3774d57 (commit)
via 250a5b0211fd2e8000dcf02e943915940a2ff911 (commit)
via f554c3a7ffb495cb0ad007d0b1cc86c183c78696 (commit)
via 32b1ce161e5f2726be1f195b531eca14c196514a (commit)
via 830bf5a94171847ff82ce9f22edcfd3a2a2fecf8 (commit)
via 9eecfc3b2df1804f6ddccafea160fe6f9d80efc6 (commit)
via 40066a6cfa0cc7d49d9e2a25edf5dcac46421e84 (commit)
via b1ac588667e74af74e7eb32be3badfc4ad1e77d8 (commit)
via 7fc23e59a337e853e292e8e89d39d6a2179498ea (commit)
via 2a84386ae89989158d9bc628654188219138f9d5 (commit)
via 57f2646daaeac87ee430ec485f0abc1c4c5f1d80 (commit)
via e9192f5a8b19a609960d76506c189141ab25fe31 (commit)
via a9497b295854d942b3605294622c9402b14c5245 (commit)
via eb03592d002af78ff7755f463680ab75ac1bd972 (commit)
via d1fffb7c84c3d9e2ade81ef6baeff66fe421155d (commit)
via 368a07ad78b46ea8ed010a9bc039b5ea4cafebd4 (commit)
via f224e71a5830eaabe1f751a5d172bdea3ce6f618 (commit)
via 5b704d24fb4556be7e76603d7a3bcfdde76bee16 (commit)
via 5c4c2f7748d05c390754e52c81bf017789999723 (commit)
via df8b88072a74947ffc14d70e0902d43a5a2b2436 (commit)
via 3a91446287b1ab3fe3630be108141e306d5caf2e (commit)
via d977f3fbdb0131315c7a8c9395899a3ee09a8e64 (commit)
via 294bdc7d2aa04909abc638fad877083dc1ac8cbd (commit)
via d1dccffd6b01360c0bb72acd988a09d6a94fcf1c (commit)
via fd245473865a22704941ca1ca92ce6a51e68daeb (commit)
via 5339b431e4f47faaa380dc8f909d0de0efe4ee28 (commit)
via 17ad0fcb90bbcc060c94f9bed6aa302a4789298f (commit)
via 6331709fd6fd015dd8eb8aac8a0ebf3cc4411ca2 (commit)
via ebdad6d736282756f59b365386b347b7ba5f5543 (commit)
via 6ef7009f6c2302cc954efdf401fd9bf5edd28e37 (commit)
via 2f7e5ab733c9b1ebb919959550b02cc9938c2871 (commit)
via f359f32bc4075973ab6b8bbc570cbae56c973ec4 (commit)
via 34ef939350ba0add7f1604e7377a65882e72c41e (commit)
via f17a08fe85ebff5e6962b420a48cba51fb0d84ba (commit)
via f4923723fb1ac46daf6e9beb5fb8b88acba0c49b (commit)
via 05a8aaebe327ef0a738a2cd5743d57d2ef1a2510 (commit)
via a5773f6f4e430dcff9de7beb0ac8a2da8f88f3e9 (commit)
via 3f077a5cf5a179b2258d857cd5facda43649eb4b (commit)
via 6008979708c64d27b1684ab278e1856dac5e37ec (commit)
via 93c4c28d0627c490818a7750aecaa2512ab097d8 (commit)
via 84fc3169df66aba2a5ce940c1f9ad162fa73f092 (commit)
via b93551712fb0d77f0957275f6dc4005721dccec5 (commit)
via 2f6b80d98d475c8cc4a7a3bf0ca8a771dee78d4b (commit)
via 6de45dd331c289f21be597b9e4d49e3629eca73e (commit)
via f7fe2912eca74a9edb8818c6e3fb6ac6ef53dd1d (commit)
from 477c94c8fbf1ec4b82fb976d569c9d87357f7d1d (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit b61550bf6b53c0cef885ed1443967a6c9aa2fb78
Merge: 4689a2ff bfa4bbd5
Author: Mike Black W9MDB <mdb...@ya...>
Date: Fri Dec 23 23:40:11 2022 -0600
Merge branch 'master' of https://github.com/Hamlib/Hamlib
commit 4689a2ff11674da65c1a1245a204010c5f4b758e
Author: Mike Black W9MDB <mdb...@ya...>
Date: Fri Dec 23 23:39:20 2022 -0600
Add client_version for rigctld clients to report their version to rigctld
This should allow for rigctld to report deprecation, compatibility, or alternatives
https://github.com/Hamlib/Hamlib/issues/1153
diff --git a/NEWS b/NEWS
index 77ccf2c2..23e9b44e 100644
--- a/NEWS
+++ b/NEWS
@@ -14,6 +14,7 @@ Version 5.x -- future
Version 4.6
* 2023-11-XX -- Planned for Nov 2023
+ * Add client_version to rigctld so client can report it's version for future use/compatility/alternatives
* Add --set-conf=tuner_control_pathname=hamlib_tuner_control (default)
If file exists then it will be called with 0/1 (Off/On) argument
with 'U TUNER 0' or 'U TUNER 1"
@@ -23,11 +24,13 @@ Version 4.6
* Fix FTDX3000 rig split
Version 4.5.2
+ * 2022-12-23
+ * Fix PowerSDR ability to do commands while powered off
+ * Fix TX-500 operations
* Fix FTDX5000 to return to MIC input on closing
* Fix rig.c calling rig_get_mode when backend does not have get_mode
* Fix kenwood_ts890_get_level
* Add Prosistel D elevation CBOX az to fix problem with azimuth control
- * 2022-12-XX -- Planned for Dec 2022
* Fix FT736R gpredict usage by adding cached get_freq
* Fix get_powerstat problem with Log4OM/Flex and others
* Fix -R option to not need argument
diff --git a/doc/man1/rigctl.1 b/doc/man1/rigctl.1
index 33e75464..d68fae78 100644
--- a/doc/man1/rigctl.1
+++ b/doc/man1/rigctl.1
@@ -1321,6 +1321,11 @@ Examples:
send_raw -1 0xFE;0xFE;0x94;0x03;0xFD
send_raw 14 0xFE;0xFE;0x94;0x03;0xFD
.
+.TP
+.BR client_version " \(aq" \fIString\fP "\(aq
+.EX
+ Client can send it's version to rigctld and get feedback on compatibility, deprecation, and alternatives
+.
.SH READLINE
.
If
diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h
index d93e7986..eb3d9a0e 100644
--- a/include/hamlib/rig.h
+++ b/include/hamlib/rig.h
@@ -2589,6 +2589,7 @@ struct rig_state {
int lock_mode; /*<! flag that prevents mode changes if ~= 0 -- see set/get_lock_mode */
powerstat_t powerstat; /*<! power status */
char *tuner_control_pathname; /*<! Path to external tuner control program that get 0/1 (Off/On) argument */
+ char client_version[32]; /*<! Allow client to report version for compatility checks/capability */
};
//! @cond Doxygen_Suppress
diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c
index 1b356aac..c1aeb838 100644
--- a/tests/rigctl_parse.c
+++ b/tests/rigctl_parse.c
@@ -259,6 +259,7 @@ declare_proto_rig(get_separator);
declare_proto_rig(set_lock_mode);
declare_proto_rig(get_lock_mode);
declare_proto_rig(send_raw);
+declare_proto_rig(client_version);
/*
@@ -372,6 +373,7 @@ static struct test_table test_list[] =
{ 0xa2, "set_lock_mode", ACTION(set_lock_mode), ARG_IN | ARG_NOVFO, "Locked" },
{ 0xa3, "get_lock_mode", ACTION(get_lock_mode), ARG_NOVFO, "Locked" },
{ 0xa4, "send_raw", ACTION(send_raw), ARG_NOVFO | ARG_IN1 | ARG_IN2 | ARG_OUT3, "Terminator", "Command", "Send raw answer" },
+ { 0xa5, "client_version", ACTION(client_version), ARG_NOVFO | ARG_IN1, "Version", "Client version" },
{ 0x00, "", NULL },
};
@@ -674,6 +676,7 @@ int rigctl_parse(RIG *my_rig, FILE *fin, FILE *fout, char *argv[], int argc,
char arg2[MAXARGSZ + 1], *p2 = NULL;
char arg3[MAXARGSZ + 1], *p3 = NULL;
vfo_t vfo = RIG_VFO_CURR;
+ char client_version[32];
rig_debug(RIG_DEBUG_TRACE, "%s: called, interactive=%d\n", __func__,
interactive);
@@ -1753,7 +1756,9 @@ readline_repeat:
&& cmd_entry->cmd != 0x8f // dump_state
&& cmd_entry->cmd != 0xf0 // chk_vfo
&& cmd_entry->cmd != 0x87 // set_powerstat
- && my_rig->caps->rig_model != RIG_MODEL_POWERSDR) // some rigs can do stuff when powered off
+ && cmd_entry->cmd != 0xa5 // client_version
+ && my_rig->caps->rig_model !=
+ RIG_MODEL_POWERSDR) // some rigs can do stuff when powered off
{
rig_debug(RIG_DEBUG_WARN,
"%s: command %s not allowed when rig is powered off\n", __func__,
@@ -1778,6 +1783,10 @@ readline_repeat:
p2 ? p2 : "",
p3 ? p3 : "");
}
+
+ // we need to copy client_version to our thread in case there are multiple client versions
+ // client_version is used to determine any backward compatiblity requirements or problems
+ strncpy(client_version, my_rig->state.client_version, sizeof(client_version));
}
@@ -1855,6 +1864,20 @@ void version()
printf("%s\n", hamlib_copyright);
}
+declare_proto_rig(client_version)
+{
+ if ((interactive && prompt) || (interactive && !prompt && ext_resp))
+ {
+ fprintf(fout, "%s: ", cmd->arg1);
+ }
+
+ fprintf(fout, "%s%c", arg1, resp_sep);
+ strncpy(rig->state.client_version, arg1, sizeof(rig->state.client_version) - 1);
+ rig_debug(RIG_DEBUG_VERBOSE, "%s: client_version=%s\n", __func__,
+ rig->state.client_version);
+ return RIG_OK;
+}
+
void usage_rig(FILE *fout)
{
commit bfa4bbd50da3f143074fa87b46b50b749d7d7948
Author: Mike Black W9MDB <mdb...@ya...>
Date: Fri Dec 23 17:44:44 2022 -0600
Full version info now available for Windows File/Properties/Details
Will show git version until released
https://github.com/Hamlib/Hamlib/issues/1168
diff --git a/src/Makefile.am b/src/Makefile.am
index 90c34e42..47c8ec9b 100755
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -51,7 +51,7 @@ LTRCCOMPILE = $(LIBTOOL) --mode=compile --tag=RC $(RCCOMPILE)
$(LTRCCOMPILE) -i "$<" -o "$@"
.rc.o:
- $(RCCOMPILE) -i "$<" -o "$@"
+ $(RCCOMPILE) -O coff -i "$<" -o "$@"
.mc.rc:
$(WINDMC) "$<"
diff --git a/src/version_dll.rc b/src/version_dll.rc
index 1abe9f54..329aefc6 100755
--- a/src/version_dll.rc
+++ b/src/version_dll.rc
@@ -1,20 +1,22 @@
#include <windows.h>
#include <hamlibdatetime.h>
+#include <config.h>
-#define VERSIONINFO_1 1
+//#define HAMLIB_RC_FILEVERSION 4,6,0,0
-VERSIONINFO_1 VERSIONINFO
+VS_VERSION_INFO VERSIONINFO
+FILEVERSION ABI_VERSION,ABI_REVISION,ABI_AGE,0
+FILETYPE VFT_DLL
+FILESUBTYPE VFT2_UNKNOWN
{
BLOCK "StringFileInfo"
{
BLOCK "040904E4"
{
VALUE "FileDescription", "Hamlib DLL"
- VALUE "FileVersion", "4.6.0.0"
- VALUE "ProductName", "Hamlib"
+ VALUE "ProductName", PACKAGE_STRING
VALUE "ProductVersion", HAMLIBDATETIME
- VALUE "InternalName", "sha256"
- VALUE "LegalCopyright", "Copyright Hamlib Team 2022"
+ VALUE "LegalCopyright", "Copyright Hamlib Team 1991-2023"
VALUE "OriginalFilename", "libhamlib-4.dll"
}
@@ -22,7 +24,6 @@ VERSIONINFO_1 VERSIONINFO
BLOCK "VarFileInfo"
{
- VALUE "Translation", 0x409, 1200
+ VALUE "Translation", 0x409, 20127
}
-
}
commit 70f38022b6da3375c4b321b810f417d20e29ac45
Author: Mike Black W9MDB <mdb...@ya...>
Date: Fri Dec 23 16:53:18 2022 -0600
Update NEWS
diff --git a/NEWS b/NEWS
index 36502060..77ccf2c2 100644
--- a/NEWS
+++ b/NEWS
@@ -23,6 +23,7 @@ Version 4.6
* Fix FTDX3000 rig split
Version 4.5.2
+ * Fix FTDX5000 to return to MIC input on closing
* Fix rig.c calling rig_get_mode when backend does not have get_mode
* Fix kenwood_ts890_get_level
* Add Prosistel D elevation CBOX az to fix problem with azimuth control
commit 33b24561291db92010a851e2fda4660bb9fc3bb1
Author: Mike Black W9MDB <mdb...@ya...>
Date: Fri Dec 23 16:49:45 2022 -0600
Make FTDX5000 return to MIC input on closing
https://github.com/Hamlib/Hamlib/issues/1193
diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c
index fda8aa01..9bff762a 100644
--- a/rigs/yaesu/newcat.c
+++ b/rigs/yaesu/newcat.c
@@ -662,6 +662,14 @@ int newcat_close(RIG *rig)
priv->poweron = 0;
}
+ if (is_ftdx5000)
+ {
+ // Ensure FT5000 is back to MIC input
+ SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "EX1030;");
+ rig_debug(RIG_DEBUG_TRACE, "%s: cmd_str = %s\n", __func__, priv->cmd_str);
+ newcat_set_cmd(rig); // don't care about the return
+ }
+
RETURNFUNC(RIG_OK);
}
diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h
index c45a4d9d..a0be7487 100644
--- a/rigs/yaesu/newcat.h
+++ b/rigs/yaesu/newcat.h
@@ -50,7 +50,7 @@
typedef char ncboolean;
/* shared function version */
-#define NEWCAT_VER "20221211"
+#define NEWCAT_VER "20221223"
/* Hopefully large enough for future use, 128 chars plus '\0' */
#define NEWCAT_DATA_LEN 129
commit 17f88dccbf97259f5ea1728ad39f57a08e96a0e7
Author: Mike Black W9MDB <mdb...@ya...>
Date: Thu Dec 22 12:14:29 2022 -0600
Fix version_dll.c
https://github.com/Hamlib/Hamlib/issues/1168
diff --git a/src/version_dll.rc b/src/version_dll.rc
index a5703f90..1abe9f54 100755
--- a/src/version_dll.rc
+++ b/src/version_dll.rc
@@ -9,7 +9,6 @@ VERSIONINFO_1 VERSIONINFO
{
BLOCK "040904E4"
{
-<<<<<<< HEAD
VALUE "FileDescription", "Hamlib DLL"
VALUE "FileVersion", "4.6.0.0"
VALUE "ProductName", "Hamlib"
@@ -17,27 +16,13 @@ VERSIONINFO_1 VERSIONINFO
VALUE "InternalName", "sha256"
VALUE "LegalCopyright", "Copyright Hamlib Team 2022"
VALUE "OriginalFilename", "libhamlib-4.dll"
-=======
- VALUE "CompanyName", "Hamlib Team\000"
- VALUE "FileDescription", "Hamlib DLL\000"
- VALUE "ProductName", "Hamlib\000"
- VALUE "FileVersion", 4,6,0,0
- VALUE "ProductVersion", HAMLIBDATETIME
- VALUE "InternalName", "sha256"
- VALUE "LegalCopyright", "Copyright Hamlib Team 2022\000"
- VALUE "OriginalFilename", "libhamlib-4.dll\000"
->>>>>>> cafc094788fcdd65e5fb936e5451a08b780c8ecd
}
}
BLOCK "VarFileInfo"
{
-<<<<<<< HEAD
VALUE "Translation", 0x409, 1200
-=======
- VALUE "Translation", 0x409, 1252
->>>>>>> cafc094788fcdd65e5fb936e5451a08b780c8ecd
}
}
commit 267d07f708bea7a6734129b469dc55fdddb5a3b5
Merge: f31e1b7a cafc0947
Author: Mike Black W9MDB <mdb...@ya...>
Date: Thu Dec 22 11:58:13 2022 -0600
Merge branch 'master' of https://github.com/Hamlib/Hamlib
diff --cc configure.ac
index 394d2701,265279c9..d0938071
--- a/configure.ac
+++ b/configure.ac
@@@ -285,8 -284,8 +285,9 @@@ AS_CASE(["$host_os"]
AC_SUBST([OSXLDFLAGS])],
[mingw* | pw32* | cygwin*], [
+ AM_CONDITIONAL([VERSIONDLL], true)
WINLDFLAGS="-Wl,--output-def,libhamlib.def -Wl,--add-stdcall-alias"
+ VERSIONDLL="version_dll.rc"
AC_SUBST([WINLDFLAGS])
# Enable ld's "auto import" for executables
diff --cc src/Makefile.am
index 94ed7462,25e4f7cd..90c34e42
mode 100755,100644..100755
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@@ -10,15 -11,10 +10,15 @@@ RIGSRC = hamlibdatetime.h rig.c serial.
network.c network.h cm108.c cm108.h gpio.c gpio.h idx_builtin.h token.h \
par_nt.h microham.c microham.h amplifier.c amp_reg.c amp_conf.c \
amp_conf.h amp_settings.c extamp.c sleep.c sleep.h sprintflst.c \
- sprintflst.h cache.c cache.h snapshot_data.c snapshot_data.h $(VERSIONDLL)
+ sprintflst.h cache.c cache.h snapshot_data.c snapshot_data.h
+
+if VERSIONDLL
+RIGSRC += \
+ version_dll.rc
+endif
lib_LTLIBRARIES = libhamlib.la
- libhamlib_la_SOURCES = $(RIGSRC)
+ libhamlib_la_SOURCES = $(RIGSRC) $(VERSIONDLL)
libhamlib_la_LDFLAGS = $(WINLDFLAGS) $(OSXLDFLAGS) -no-undefined -version-info $(ABI_VERSION):$(ABI_REVISION):$(ABI_AGE)
libhamlib_la_LIBADD = $(top_builddir)/lib/libmisc.la $(top_builddir)/security/libsecurity.la \
diff --cc src/version_dll.rc
index 1abe9f54,70e758ad..a5703f90
--- a/src/version_dll.rc
+++ b/src/version_dll.rc
@@@ -9,20 -9,21 +9,35 @@@ VERSIONINFO_1 VERSIONINF
{
BLOCK "040904E4"
{
++<<<<<<< HEAD
+ VALUE "FileDescription", "Hamlib DLL"
+ VALUE "FileVersion", "4.6.0.0"
+ VALUE "ProductName", "Hamlib"
+ VALUE "ProductVersion", HAMLIBDATETIME
+ VALUE "InternalName", "sha256"
+ VALUE "LegalCopyright", "Copyright Hamlib Team 2022"
+ VALUE "OriginalFilename", "libhamlib-4.dll"
++=======
+ VALUE "CompanyName", "Hamlib Team\000"
+ VALUE "FileDescription", "Hamlib DLL\000"
+ VALUE "ProductName", "Hamlib\000"
+ VALUE "FileVersion", 4,6,0,0
+ VALUE "ProductVersion", HAMLIBDATETIME
+ VALUE "InternalName", "sha256"
+ VALUE "LegalCopyright", "Copyright Hamlib Team 2022\000"
+ VALUE "OriginalFilename", "libhamlib-4.dll\000"
++>>>>>>> cafc094788fcdd65e5fb936e5451a08b780c8ecd
}
}
BLOCK "VarFileInfo"
{
++<<<<<<< HEAD
+ VALUE "Translation", 0x409, 1200
++=======
+ VALUE "Translation", 0x409, 1252
++>>>>>>> cafc094788fcdd65e5fb936e5451a08b780c8ecd
}
}
commit f31e1b7ad9b9cc3f035a3942fc4dc303e53b1ac4
Author: Mike Black W9MDB <mdb...@ya...>
Date: Thu Dec 22 11:50:50 2022 -0600
File/Properties/Details on hamlib-X.dll now shows information except for File version (still to be fixed)
https://github.com/Hamlib/Hamlib/issues/1168
diff --git a/configure.ac b/configure.ac
index a8527b8e..394d2701 100644
--- a/configure.ac
+++ b/configure.ac
@@ -15,6 +15,8 @@ dnl however, the use of '~' should be fine as apt (others?) will treat
dnl it as an earlier version than the actual release. TNX KA6MAL
dnl PACKAGE_NAME + " " + PACKAGE_VERSION must not exceed 20 chars!
AC_INIT([Hamlib],[4.6~git],[ham...@li...],[hamlib],[http://www.hamlib.org])
+#AC_INIT([PRODUCT_NAME], [Hamlib])
+#AC_DEFINE([Hamlib], [PRODUCT_VERSION_RESOURCE])
AC_CONFIG_SRCDIR([include/hamlib/rig.h])
AC_CONFIG_MACRO_DIR([macros])
@@ -260,6 +262,7 @@ LT_PREREQ([2.2.6b])
dnl N.B. LT_INIT([win32-dll]) does not work for older libtool
dnl so require new enough version above.
LT_INIT([win32-dll])
+LT_LANG([Windows Resource])
## -------------------------- ##
@@ -267,6 +270,7 @@ LT_INIT([win32-dll])
## -------------------------- ##
dnl The host_os variable is set by the AC_CANONICAL_HOST macro above.
+AM_CONDITIONAL([VERSIONDLL], false)
AS_CASE(["$host_os"],
[freebsd*], [
AM_CPPFLAGS="-I/usr/local/include ${AM_CPPFLAGS}"
@@ -281,6 +285,7 @@ AS_CASE(["$host_os"],
AC_SUBST([OSXLDFLAGS])],
[mingw* | pw32* | cygwin*], [
+ AM_CONDITIONAL([VERSIONDLL], true)
WINLDFLAGS="-Wl,--output-def,libhamlib.def -Wl,--add-stdcall-alias"
AC_SUBST([WINLDFLAGS])
diff --git a/src/Makefile.am b/src/Makefile.am
old mode 100644
new mode 100755
index fe4431de..94ed7462
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,4 +1,3 @@
-# src/Makefile.am
BUILT_SOURCES = $(builddir)/hamlibdatetime.h
@@ -11,7 +10,12 @@ RIGSRC = hamlibdatetime.h rig.c serial.c serial.h misc.c misc.h register.c regis
network.c network.h cm108.c cm108.h gpio.c gpio.h idx_builtin.h token.h \
par_nt.h microham.c microham.h amplifier.c amp_reg.c amp_conf.c \
amp_conf.h amp_settings.c extamp.c sleep.c sleep.h sprintflst.c \
- sprintflst.h cache.c cache.h snapshot_data.c snapshot_data.h
+ sprintflst.h cache.c cache.h snapshot_data.c snapshot_data.h
+
+if VERSIONDLL
+RIGSRC += \
+ version_dll.rc
+endif
lib_LTLIBRARIES = libhamlib.la
libhamlib_la_SOURCES = $(RIGSRC)
@@ -20,7 +24,7 @@ libhamlib_la_LDFLAGS = $(WINLDFLAGS) $(OSXLDFLAGS) -no-undefined -version-info $
libhamlib_la_LIBADD = $(top_builddir)/lib/libmisc.la $(top_builddir)/security/libsecurity.la \
$(BACKENDEPS) $(RIG_BACKENDEPS) $(ROT_BACKENDEPS) $(AMP_BACKENDEPS) $(NET_LIBS) $(MATH_LIBS) $(LIBUSB_LIBS) $(INDI_LIBS)
-libhamlib_la_DEPENDENCIES = $(top_builddir)/lib/libmisc.la $(top_builddir)/security/libsecurity.la $(BACKENDEPS) $(RIG_BACKENDEPS) $(ROT_BACKENDEPS) $(AMP_BACKENDEPS)
+libhamlib_la_DEPENDENCIES = $(top_builddir)/lib/libmisc.la $(top_builddir)/security/libsecurity.la $(BACKENDEPS) $(RIG_BACKENDEPS) $(ROT_BACKENDEPS) $(AMP_BACKENDEPS)
EXTRA_DIST = Android.mk hamlibdatetime.h.in
@@ -32,13 +36,29 @@ EXTRA_DIST = Android.mk hamlibdatetime.h.in
hamlibdatetime.h: FORCE
@if test -x $(top_srcdir)/.git ; then \
echo "/* This date time is from the last non-merge commit to Hamlib. */" > $(builddir)/$(@F).tmp ;\
- echo "#define HAMLIBDATETIME "\"$$(TZ=UTC git --git-dir=$(top_srcdir)/.git log --no-merges --date='format-local:%a %b %d %H:%M:%S %Y %z SHA=' --format='%cd' -n 1)$$(git --git-dir=$(top_srcdir)/.git log --no-merges | grep commit | head -n 1 | cut -c8-13)\" >> $(builddir)/$(@F).tmp ;\
+ echo "#define HAMLIBDATETIME "\"$$(TZ=UTC git --git-dir=$(top_srcdir)/.git log --no-merges --date='format-local:%b %d %H:%M:%SZ %Y SHA=' --format='%cd' -n 1)$$(git --git-dir=$(top_srcdir)/.git log --no-merges | grep commit | head -n 1 | cut -c8-13)\" >> $(builddir)/$(@F).tmp ;\
diff -qN $(builddir)/$(@F).tmp $(builddir)/$(@F) ; test $$? -eq 0 || { echo "Generating SCS header \"$(builddir)/$(@F)\"" ; mv -f $(builddir)/$(@F).tmp $(builddir)/$(@F) ; } ;\
rm -f $(builddir)/$(@F).tmp ;\
else \
test -f $(srcdir)/$(@F) || cp $(srcdir)/$(@F).in $(srcdir)/$(@F) ;\
fi
+RCCOMPILE = $(RC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS)
+
+LTRCCOMPILE = $(LIBTOOL) --mode=compile --tag=RC $(RCCOMPILE)
+
+.rc.lo:
+ $(LTRCCOMPILE) -i "$<" -o "$@"
+
+.rc.o:
+ $(RCCOMPILE) -i "$<" -o "$@"
+
+.mc.rc:
+ $(WINDMC) "$<"
+
+#version.la: version.rc
+# windres $(srcdir)/version.rc -o $(builddir)/version.o
+
FORCE:
# If we are making a distribution out-of-source and we have generated
diff --git a/src/version_dll.rc b/src/version_dll.rc
new file mode 100755
index 00000000..1abe9f54
--- /dev/null
+++ b/src/version_dll.rc
@@ -0,0 +1,28 @@
+#include <windows.h>
+#include <hamlibdatetime.h>
+
+#define VERSIONINFO_1 1
+
+VERSIONINFO_1 VERSIONINFO
+{
+ BLOCK "StringFileInfo"
+ {
+ BLOCK "040904E4"
+ {
+ VALUE "FileDescription", "Hamlib DLL"
+ VALUE "FileVersion", "4.6.0.0"
+ VALUE "ProductName", "Hamlib"
+ VALUE "ProductVersion", HAMLIBDATETIME
+ VALUE "InternalName", "sha256"
+ VALUE "LegalCopyright", "Copyright Hamlib Team 2022"
+ VALUE "OriginalFilename", "libhamlib-4.dll"
+ }
+
+ }
+
+ BLOCK "VarFileInfo"
+ {
+ VALUE "Translation", 0x409, 1200
+ }
+
+}
commit cafc094788fcdd65e5fb936e5451a08b780c8ecd
Author: Mike Black W9MDB <mdb...@ya...>
Date: Wed Dec 21 15:44:36 2022 -0600
Add version information for Windows file/Properties/Details
https://github.com/Hamlib/Hamlib/issues/1168
diff --git a/configure.ac b/configure.ac
index a8527b8e..265279c9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -15,6 +15,8 @@ dnl however, the use of '~' should be fine as apt (others?) will treat
dnl it as an earlier version than the actual release. TNX KA6MAL
dnl PACKAGE_NAME + " " + PACKAGE_VERSION must not exceed 20 chars!
AC_INIT([Hamlib],[4.6~git],[ham...@li...],[hamlib],[http://www.hamlib.org])
+#AC_INIT([PRODUCT_NAME], [Hamlib])
+#AC_DEFINE([Hamlib], [PRODUCT_VERSION_RESOURCE])
AC_CONFIG_SRCDIR([include/hamlib/rig.h])
AC_CONFIG_MACRO_DIR([macros])
@@ -260,6 +262,7 @@ LT_PREREQ([2.2.6b])
dnl N.B. LT_INIT([win32-dll]) does not work for older libtool
dnl so require new enough version above.
LT_INIT([win32-dll])
+LT_LANG([Windows Resource])
## -------------------------- ##
@@ -282,6 +285,7 @@ AS_CASE(["$host_os"],
[mingw* | pw32* | cygwin*], [
WINLDFLAGS="-Wl,--output-def,libhamlib.def -Wl,--add-stdcall-alias"
+ VERSIONDLL="version_dll.rc"
AC_SUBST([WINLDFLAGS])
# Enable ld's "auto import" for executables
diff --git a/src/Makefile.am b/src/Makefile.am
index fe4431de..25e4f7cd 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -11,16 +11,16 @@ RIGSRC = hamlibdatetime.h rig.c serial.c serial.h misc.c misc.h register.c regis
network.c network.h cm108.c cm108.h gpio.c gpio.h idx_builtin.h token.h \
par_nt.h microham.c microham.h amplifier.c amp_reg.c amp_conf.c \
amp_conf.h amp_settings.c extamp.c sleep.c sleep.h sprintflst.c \
- sprintflst.h cache.c cache.h snapshot_data.c snapshot_data.h
+ sprintflst.h cache.c cache.h snapshot_data.c snapshot_data.h $(VERSIONDLL)
lib_LTLIBRARIES = libhamlib.la
-libhamlib_la_SOURCES = $(RIGSRC)
+libhamlib_la_SOURCES = $(RIGSRC) $(VERSIONDLL)
libhamlib_la_LDFLAGS = $(WINLDFLAGS) $(OSXLDFLAGS) -no-undefined -version-info $(ABI_VERSION):$(ABI_REVISION):$(ABI_AGE)
libhamlib_la_LIBADD = $(top_builddir)/lib/libmisc.la $(top_builddir)/security/libsecurity.la \
$(BACKENDEPS) $(RIG_BACKENDEPS) $(ROT_BACKENDEPS) $(AMP_BACKENDEPS) $(NET_LIBS) $(MATH_LIBS) $(LIBUSB_LIBS) $(INDI_LIBS)
-libhamlib_la_DEPENDENCIES = $(top_builddir)/lib/libmisc.la $(top_builddir)/security/libsecurity.la $(BACKENDEPS) $(RIG_BACKENDEPS) $(ROT_BACKENDEPS) $(AMP_BACKENDEPS)
+libhamlib_la_DEPENDENCIES = $(top_builddir)/lib/libmisc.la $(top_builddir)/security/libsecurity.la $(BACKENDEPS) $(RIG_BACKENDEPS) $(ROT_BACKENDEPS) $(AMP_BACKENDEPS)
EXTRA_DIST = Android.mk hamlibdatetime.h.in
@@ -32,13 +32,29 @@ EXTRA_DIST = Android.mk hamlibdatetime.h.in
hamlibdatetime.h: FORCE
@if test -x $(top_srcdir)/.git ; then \
echo "/* This date time is from the last non-merge commit to Hamlib. */" > $(builddir)/$(@F).tmp ;\
- echo "#define HAMLIBDATETIME "\"$$(TZ=UTC git --git-dir=$(top_srcdir)/.git log --no-merges --date='format-local:%a %b %d %H:%M:%S %Y %z SHA=' --format='%cd' -n 1)$$(git --git-dir=$(top_srcdir)/.git log --no-merges | grep commit | head -n 1 | cut -c8-13)\" >> $(builddir)/$(@F).tmp ;\
+ echo "#define HAMLIBDATETIME "\"$$(TZ=UTC git --git-dir=$(top_srcdir)/.git log --no-merges --date='format-local:%b %d %H:%M:%SZ %Y SHA=' --format='%cd' -n 1)$$(git --git-dir=$(top_srcdir)/.git log --no-merges | grep commit | head -n 1 | cut -c8-13)\" >> $(builddir)/$(@F).tmp ;\
diff -qN $(builddir)/$(@F).tmp $(builddir)/$(@F) ; test $$? -eq 0 || { echo "Generating SCS header \"$(builddir)/$(@F)\"" ; mv -f $(builddir)/$(@F).tmp $(builddir)/$(@F) ; } ;\
rm -f $(builddir)/$(@F).tmp ;\
else \
test -f $(srcdir)/$(@F) || cp $(srcdir)/$(@F).in $(srcdir)/$(@F) ;\
fi
+RCCOMPILE = $(RC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS)
+
+LTRCCOMPILE = $(LIBTOOL) --mode=compile --tag=RC $(RCCOMPILE)
+
+.rc.lo:
+ $(LTRCCOMPILE) -i "$<" -o "$@"
+
+.rc.o:
+ $(RCCOMPILE) -i "$<" -o "$@"
+
+.mc.rc:
+ $(WINDMC) "$<"
+
+#version.la: version.rc
+# windres $(srcdir)/version.rc -o $(builddir)/version.o
+
FORCE:
# If we are making a distribution out-of-source and we have generated
diff --git a/src/version_dll.rc b/src/version_dll.rc
new file mode 100755
index 00000000..70e758ad
--- /dev/null
+++ b/src/version_dll.rc
@@ -0,0 +1,29 @@
+#include <windows.h>
+#include <hamlibdatetime.h>
+
+#define VERSIONINFO_1 1
+
+VERSIONINFO_1 VERSIONINFO
+{
+ BLOCK "StringFileInfo"
+ {
+ BLOCK "040904E4"
+ {
+ VALUE "CompanyName", "Hamlib Team\000"
+ VALUE "FileDescription", "Hamlib DLL\000"
+ VALUE "ProductName", "Hamlib\000"
+ VALUE "FileVersion", 4,6,0,0
+ VALUE "ProductVersion", HAMLIBDATETIME
+ VALUE "InternalName", "sha256"
+ VALUE "LegalCopyright", "Copyright Hamlib Team 2022\000"
+ VALUE "OriginalFilename", "libhamlib-4.dll\000"
+ }
+
+ }
+
+ BLOCK "VarFileInfo"
+ {
+ VALUE "Translation", 0x409, 1252
+ }
+
+}
commit b153bcd1e5604b55fd5c0d1b46389909f074c169
Author: Mike Black W9MDB <mdb...@ya...>
Date: Tue Dec 20 08:29:12 2022 -0600
Change TX-500 to only have 9600 baud available
https://github.com/Hamlib/Hamlib/issues/1188
diff --git a/rigs/kenwood/tx500.c b/rigs/kenwood/tx500.c
index 0cb037ba..6edeffdc 100644
--- a/rigs/kenwood/tx500.c
+++ b/rigs/kenwood/tx500.c
@@ -127,15 +127,15 @@ const struct rig_caps tx500_caps =
RIG_MODEL(RIG_MODEL_LAB599_TX500),
.model_name = "TX-500",
.mfg_name = "Lab599",
- .version = BACKEND_VER ".2",
+ .version = BACKEND_VER ".3",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
.ptt_type = RIG_PTT_RIG,
.dcd_type = RIG_DCD_RIG,
.port_type = RIG_PORT_SERIAL,
- .serial_rate_min = 1200,
- .serial_rate_max = 57600,
+ .serial_rate_min = 9600,
+ .serial_rate_max = 9600,
.serial_data_bits = 8,
.serial_stop_bits = 1,
.serial_parity = RIG_PARITY_NONE,
commit f468fa3c1d93e93652cbdbfc8998546b6a79a422
Author: Mike Black W9MDB <mdb...@ya...>
Date: Mon Dec 19 16:58:44 2022 -0600
Allow POWERSDR to do commands when powered off
diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c
index 6cb82915..1b356aac 100644
--- a/tests/rigctl_parse.c
+++ b/tests/rigctl_parse.c
@@ -1752,7 +1752,8 @@ readline_repeat:
&& cmd_entry->cmd != '3' // dump_conf
&& cmd_entry->cmd != 0x8f // dump_state
&& cmd_entry->cmd != 0xf0 // chk_vfo
- && cmd_entry->cmd != 0x87) // set_powerstat
+ && cmd_entry->cmd != 0x87 // set_powerstat
+ && my_rig->caps->rig_model != RIG_MODEL_POWERSDR) // some rigs can do stuff when powered off
{
rig_debug(RIG_DEBUG_WARN,
"%s: command %s not allowed when rig is powered off\n", __func__,
commit 31e911edb87e3eeec794cb4d26e8bcfea9cd6834
Author: Mike Black W9MDB <mdb...@ya...>
Date: Mon Dec 19 14:55:14 2022 -0600
Remove powerstat from TX-500 -- was always responding PS0;
https://github.com/Hamlib/Hamlib/issues/1188
diff --git a/rigs/kenwood/tx500.c b/rigs/kenwood/tx500.c
index d5cb6398..0cb037ba 100644
--- a/rigs/kenwood/tx500.c
+++ b/rigs/kenwood/tx500.c
@@ -127,7 +127,7 @@ const struct rig_caps tx500_caps =
RIG_MODEL(RIG_MODEL_LAB599_TX500),
.model_name = "TX-500",
.mfg_name = "Lab599",
- .version = BACKEND_VER ".1",
+ .version = BACKEND_VER ".2",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
@@ -318,8 +318,8 @@ const struct rig_caps tx500_caps =
.set_channel = ts2000_set_channel,
.set_trn = kenwood_set_trn,
.get_trn = kenwood_get_trn,
- .set_powerstat = kenwood_set_powerstat,
- .get_powerstat = kenwood_get_powerstat,
+ //.set_powerstat = kenwood_set_powerstat,
+ //.get_powerstat = kenwood_get_powerstat,
.get_info = kenwood_get_info,
.reset = kenwood_reset,
.hamlib_check_rig_caps = HAMLIB_CHECK_RIG_CAPS
commit 287fb9091b6479b06eaa55981da149c43145ce60
Author: Mike Black W9MDB <mdb...@ya...>
Date: Mon Dec 19 14:38:58 2022 -0600
Update info in hamlib_tuner_control
https://github.com/Hamlib/Hamlib/issues/1192
diff --git a/tests/hamlib_tuner_control b/tests/hamlib_tuner_control
index 4f5b923e..d8836c06 100755
--- a/tests/hamlib_tuner_control
+++ b/tests/hamlib_tuner_control
@@ -1,4 +1,9 @@
#!/bin/sh
+# Put this script in /usr/local/bin
+# --set-conf=tuner_contrl_pathname=/usr/local/bin/hamlib_tuner_control
+# Or use a batch file in Windows for example in C:\Util\tuner.bat
+# echo Tuner %1
+# --set-conf=C:/Util/tuner.bat
if [ "$#" -eq 0 ]
then
echo "Expected arg 0 or 1...got nothing"
commit 04b18c9d5be503a064c9198843408799d2c53e0f
Author: Mike Black W9MDB <mdb...@ya...>
Date: Mon Dec 19 12:55:18 2022 -0600
Add --set-conf=tuner_control_pathname=hamlib_tuner_control
Program will be passed 0 or 1 (Off or On)
Example script in tests/hamlib_tuner_control
https://github.com/Hamlib/Hamlib/issues/1192
diff --git a/NEWS b/NEWS
index 730d3779..36502060 100644
--- a/NEWS
+++ b/NEWS
@@ -14,6 +14,10 @@ Version 5.x -- future
Version 4.6
* 2023-11-XX -- Planned for Nov 2023
+ * Add --set-conf=tuner_control_pathname=hamlib_tuner_control (default)
+ If file exists then it will be called with 0/1 (Off/On) argument
+ with 'U TUNER 0' or 'U TUNER 1"
+ Default path is for current directory
* Add MDS 4710/9710 rigs
* Add FLIR PTU-D48, E46, D100, D300 rotors
* Fix FTDX3000 rig split
diff --git a/doc/man1/rigctl.1 b/doc/man1/rigctl.1
index 73bc1320..33e75464 100644
--- a/doc/man1/rigctl.1
+++ b/doc/man1/rigctl.1
@@ -187,8 +187,30 @@ above. Note the dummy device has no serial parameters.
.
.TP
.BR \-C ", " \-\-set\-conf = \fIparm=val\fP [ \fI,parm=val\fP ]
-Set radio configuration parameter(s), e.g.
-.IR stop_bits=2 .
+Set configuration parameter(s). Some common ones are:
+.in +4n
+.EX
+.RB write_delay: "Delay in ms between each byte sent out"
+.RB post_write_delay: "Delay in ms between each command sent out"
+.RB timeout: "Timeout in ms"
+.RB retry: "Max number of retry"
+.RB ptt_type: "Push-To-Talk interface type override"
+.RB ptt_pathname: "Path name to the device file of the Push-To-Talk"
+.RB ptt_bitnum: "Push-To-Talk GPIO bit number"
+.RB dcd_type: "Data Carrier Detect (or squelch) interface type override"
+.RB dcd_pathname: "Path name to the device file of the Data Carrier Detect (or squelch)"
+.RB lo_freq: "Frequency to add to the VFO frequency for use with a transverter"
+.RB auto_power_on: "True enables compatible rigs to be powered up on open"
+.RB auto_power_off: "True enables compatible rigs to be powered down on close"
+.RB auto_disable_screensaver: "True enables compatible rigs to have their screen saver disabled on open"
+.RB disable_yaesu_bandselect: "True disables the automatic band select on band change for Yaesu rigs"
+.RB ptt_share: "True enables ptt port to be shared with other apps"
+.RB twiddle_timeout: "For satellite ops when VFOB is twiddled will pause VFOB commands until timeout"
+.RB twiddle_rit: "Suppress get_freq on VFOB for RIT tuning satellites"
+.RB async: "True enables asynchronous data transfer for backends that support it. This allows use of transceive and spectrum data."
+.RB tuner_control_pathname: "Path name to a script/program to control a tuner with 1 argument of 0/1 for Tuner Off/On"
+.EE
+.in
.IP
Use the
.B -L
diff --git a/doc/man1/rigctld.1 b/doc/man1/rigctld.1
index 391920a7..0e82f40d 100644
--- a/doc/man1/rigctld.1
+++ b/doc/man1/rigctld.1
@@ -293,8 +293,30 @@ above.
.
.TP
.BR \-C ", " \-\-set\-conf = \fIparm=val\fP [ \fI,parm=val\fP ]
-Set radio configuration parameter(s), e.g.
-.IR stop_bits=2 .
+Set configuration parameter(s). Some common ones are:
+.in +4
+.EX
+.RB write_delay: "Delay in ms between each byte sent out"
+.RB post_write_delay: "Delay in ms between each command sent out"
+.RB timeout: "Timeout in ms"
+.RB retry: "Max number of retry"
+.RB ptt_type: "Push-To-Talk interface type override"
+.RB ptt_pathname: "Path name to the device file of the Push-To-Talk"
+.RB ptt_bitnum: "Push-To-Talk GPIO bit number"
+.RB dcd_type: "Data Carrier Detect (or squelch) interface type override"
+.RB dcd_pathname: "Path name to the device file of the Data Carrier Detect (or squelch)"
+.RB lo_freq: "Frequency to add to the VFO frequency for use with a transverter"
+.RB auto_power_on: "True enables compatible rigs to be powered up on open"
+.RB auto_power_off: "True enables compatible rigs to be powered down on close"
+.RB auto_disable_screensaver: "True enables compatible rigs to have their screen saver disabled on open"
+.RB disable_yaesu_bandselect: "True disables the automatic band select on band change for Yaesu rigs"
+.RB ptt_share: "True enables ptt port to be shared with other apps"
+.RB twiddle_timeout: "For satellite ops when VFOB is twiddled will pause VFOB commands until timeout"
+.RB twiddle_rit: "Suppress get_freq on VFOB for RIT tuning satellites"
+.RB async: "True enables asynchronous data transfer for backends that support it. This allows use of transceive and spectrum data."
+.RB tuner_control_pathname: "Path name to a script/program to control a tuner with 1 argument of 0/1 for Tuner Off/On"
+.EE
+.in
.IP
Use the
.B -L
diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h
index 6c768168..d93e7986 100644
--- a/include/hamlib/rig.h
+++ b/include/hamlib/rig.h
@@ -2588,6 +2588,7 @@ struct rig_state {
int depth; /*<! a depth counter to use for debug indentation and such */
int lock_mode; /*<! flag that prevents mode changes if ~= 0 -- see set/get_lock_mode */
powerstat_t powerstat; /*<! power status */
+ char *tuner_control_pathname; /*<! Path to external tuner control program that get 0/1 (Off/On) argument */
};
//! @cond Doxygen_Suppress
diff --git a/src/conf.c b/src/conf.c
index e2149692..92f067a3 100644
--- a/src/conf.c
+++ b/src/conf.c
@@ -170,6 +170,11 @@ static const struct confparams frontend_cfg_params[] =
"True enables asynchronous data transfer for backends that support it. This allows use of transceive and spectrum data.",
"0", RIG_CONF_CHECKBUTTON, { }
},
+ {
+ TOK_TUNER_CONTROL_PATHNAME, "tuner_control_pathname", "Tuner script/program path name",
+ "Path name to a script/program to control a tuner with 1 argument of 0/1 for Tuner Off/On",
+ "hamlib_tuner_control", RIG_CONF_STRING,
+ },
{ RIG_CONF_END, NULL, }
};
@@ -715,6 +720,11 @@ static int frontend_set_conf(RIG *rig, token_t token, const char *val)
rs->async_data_enabled = val_i ? 1 : 0;
break;
+ case TOK_TUNER_CONTROL_PATHNAME:
+ rs->tuner_control_pathname = strdup(val); // yeah -- need to free it
+ break;
+
+
default:
return -RIG_EINVAL;
}
diff --git a/src/rig.c b/src/rig.c
index 52a7a393..87876dcb 100644
--- a/src/rig.c
+++ b/src/rig.c
@@ -143,6 +143,8 @@ const char hamlib_copyright[231] = /* hamlib 1.2 ABI specifies 231 bytes */
# define DEFAULT_CM108_PORT "/dev/hidraw0"
#endif
+#define DEFAULT_TUNER_CONTROL_PATHNAME "hamlib_tuner_control"
+
#if defined(WIN32) && !defined(__CYGWIN__)
/* FIXME: Determine correct GPIO bit number for W32 using MinGW. */
# define DEFAULT_CM108_PTT_BITNUM 2
@@ -564,6 +566,8 @@ RIG *HAMLIB_API rig_init(rig_model_t rig_model)
rs->rigport.asyncio = 0;
#endif
+ rs->tuner_control_pathname = DEFAULT_TUNER_CONTROL_PATHNAME;
+
switch (caps->port_type)
{
case RIG_PORT_SERIAL:
diff --git a/src/settings.c b/src/settings.c
index 73d1fc98..33c24b76 100644
--- a/src/settings.c
+++ b/src/settings.c
@@ -39,6 +39,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <errno.h> /* Error number definitions */
+#include <unistd.h>
#include <hamlib/rig.h>
#include "cal.h"
@@ -488,11 +489,34 @@ int HAMLIB_API rig_set_func(RIG *rig, vfo_t vfo, setting_t func, int status)
caps = rig->caps;
- if (caps->set_func == NULL || !rig_has_set_func(rig, func))
+ if ((caps->set_func == NULL || !rig_has_set_func(rig, func))
+ && access(rig->state.tuner_control_pathname, X_OK) == -1)
{
return -RIG_ENAVAIL;
}
+ if (access(rig->state.tuner_control_pathname, X_OK) != -1)
+ {
+ char cmd[1024];
+ snprintf(cmd, sizeof(cmd), "%s %d", rig->state.tuner_control_pathname, status);
+ rig_debug(RIG_DEBUG_TRACE, "%s: Calling external script '%s'\n", __func__,
+ rig->state.tuner_control_pathname);
+ retcode = system(cmd);
+
+ if (retcode != 0) { rig_debug(RIG_DEBUG_ERR, "%s: executing %s failed\n", __func__, rig->state.tuner_control_pathname); }
+
+ return (retcode == 0 ? RIG_OK : -RIG_ERJCTED);
+ }
+ else
+ {
+ if (strcmp(rig->state.tuner_control_pathname, "hamlib_tuner_control"))
+ {
+ rig_debug(RIG_DEBUG_ERR, "%s: unable to find '%s'\n", __func__,
+ rig->state.tuner_control_pathname);
+ return -RIG_EINVAL;
+ }
+ }
+
if ((caps->targetable_vfo & RIG_TARGETABLE_FUNC)
|| vfo == RIG_VFO_CURR
|| vfo == rig->state.current_vfo)
diff --git a/src/token.h b/src/token.h
index 46b80f19..186f9b1e 100644
--- a/src/token.h
+++ b/src/token.h
@@ -93,6 +93,8 @@
#define TOK_FLUSHX TOKEN_FRONTEND(36)
/** \brief Asynchronous data transfer support */
#define TOK_ASYNC TOKEN_FRONTEND(37)
+/** \brief Tuner external control pathname */
+#define TOK_TUNER_CONTROL_PATHNAME TOKEN_FRONTEND(38)
/*
* rig specific tokens
diff --git a/tests/hamlib_tuner_control b/tests/hamlib_tuner_control
new file mode 100755
index 00000000..4f5b923e
--- /dev/null
+++ b/tests/hamlib_tuner_control
@@ -0,0 +1,8 @@
+#!/bin/sh
+if [ "$#" -eq 0 ]
+then
+echo "Expected arg 0 or 1...got nothing"
+exit 1
+fi
+echo Tuner Control $1
+echo `date` " " Tuner Control $1 >>tuner_control.log
commit ea29263f3512dda2f93ba3429189a20a6782a305
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sun Dec 18 09:01:27 2022 -0600
Fix unidirectional rig cached frequency (e.g. FT736R)
https://github.com/Hamlib/Hamlib/issues/1187
diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h
index e0d31a52..6c768168 100644
--- a/include/hamlib/rig.h
+++ b/include/hamlib/rig.h
@@ -3395,6 +3395,7 @@ extern HAMLIB_EXPORT(int) rig_set_vfo_opt(RIG *rig, int status);
extern HAMLIB_EXPORT(int) rig_get_vfo_info(RIG *rig, vfo_t vfo, freq_t *freq, rmode_t *mode, pbwidth_t *width, split_t *split, int *satmode);
extern HAMLIB_EXPORT(int) rig_get_rig_info(RIG *rig, char *response, int max_response_len);
extern HAMLIB_EXPORT(int) rig_get_cache(RIG *rig, vfo_t vfo, freq_t *freq, int * cache_ms_freq, rmode_t *mode, int *cache_ms_mode, pbwidth_t *width, int *cache_ms_width);
+extern HAMLIB_EXPORT(int) rig_get_cache_freq(RIG *rig, vfo_t vfo, freq_t *freq, int * cache_ms_freq);
extern HAMLIB_EXPORT(int) rig_set_clock(RIG *rig, int year, int month, int day, int hour, int min, int sec, double msec, int utc_offset);
extern HAMLIB_EXPORT(int) rig_get_clock(RIG *rig, int *year, int *month, int *day, int *hour, int *min, int *sec, double *msec, int *utc_offset);
diff --git a/rigs/yaesu/ft736.c b/rigs/yaesu/ft736.c
index 52cd85fc..8858512f 100644
--- a/rigs/yaesu/ft736.c
+++ b/rigs/yaesu/ft736.c
@@ -31,6 +31,7 @@
#include "misc.h"
#include "yaesu.h"
#include "tones.h"
+#include "cache.h"
@@ -99,7 +100,7 @@ const struct rig_caps ft736_caps =
RIG_MODEL(RIG_MODEL_FT736R),
.model_name = "FT-736R",
.mfg_name = "Yaesu",
- .version = "20221214.0",
+ .version = "20221218.0",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
@@ -270,6 +271,7 @@ int ft736_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
{
unsigned char cmd[YAESU_CMD_LENGTH] = { 0x00, 0x00, 0x00, 0x00, 0x01};
struct ft736_priv_data *priv = (struct ft736_priv_data *)rig->state.priv;
+ int retval;
// we will assume requesting to set VFOB is split mode
if (vfo == RIG_VFO_B) { return rig_set_split_freq(rig, vfo, freq); }
@@ -288,8 +290,11 @@ int ft736_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
cmd[0] = (cmd[0] & 0x0f) | 0xc0;
}
- /* Frequency set */
- return write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH);
+ retval = write_block(&rig->state.rigport, cmd, YAESU_CMD_LENGTH);
+
+ if (retval == RIG_OK) { rig_set_cache_freq(rig, vfo, freq); }
+
+ return retval;
}
int ft736_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
@@ -297,7 +302,7 @@ int ft736_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
rig_debug(RIG_DEBUG_VERBOSE, "%s: called\n", __func__);
if (vfo == RIG_VFO_A || vfo == RIG_VFO_MAIN) { *freq = rig->state.cache.freqMainA; }
- else { *freq = rig->state.cache.freqMainB; }
+ else { rig_get_cache_freq(rig, vfo, freq, NULL); }
return RIG_OK;
}
diff --git a/src/cache.c b/src/cache.c
index 7bdafbfa..b912bdee 100644
--- a/src/cache.c
+++ b/src/cache.c
@@ -442,6 +442,41 @@ int rig_get_cache(RIG *rig, vfo_t vfo, freq_t *freq, int *cache_ms_freq,
return RIG_OK;
}
+/**
+ * \brief get cached values for a VFO
+ * \param rig The rig handle
+ * \param vfo The VFO to get information from
+ * \param freq The frequency is stored here
+ * \param cache_ms_freq The age of the last frequency update in ms -- NULL if you don't want it
+
+ * Use this to query the frequency cache and then determine to actually fetch data from
+ * the rig.
+ *
+ * \return RIG_OK if the operation has been successful, otherwise
+ * a negative value if an error occurred (in which case, cause is
+ * set appropriately).
+ *
+ */
+int rig_get_cache_freq(RIG *rig, vfo_t vfo, freq_t *freq, int *cache_ms_freq_p)
+{
+ rmode_t mode;
+ int cache_ms_freq;
+ int cache_ms_mode;
+ pbwidth_t width;
+ int cache_ms_width;
+ int retval;
+ retval = rig_get_cache(rig, vfo, freq, &cache_ms_freq, &mode, &cache_ms_mode,
+ &width, &cache_ms_width);
+
+ if (retval == RIG_OK)
+ {
+ if (cache_ms_freq_p) { *cache_ms_freq_p = cache_ms_freq; }
+ }
+
+ return retval;
+}
+
+
void rig_cache_show(RIG *rig, const char *func, int line)
{
rig_debug(RIG_DEBUG_CACHE,
diff --git a/src/rig.c b/src/rig.c
index 175bfd9c..52a7a393 100644
--- a/src/rig.c
+++ b/src/rig.c
@@ -1806,7 +1806,11 @@ int HAMLIB_API rig_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
if (retcode != RIG_OK) { RETURNFUNC(retcode); }
- rig_set_cache_freq(rig, vfo, (freq_t)0);
+ // Unidirectional rigs do not reset cache
+ if (rig->caps->rig_model != RIG_MODEL_FT736R)
+ {
+ rig_set_cache_freq(rig, vfo, (freq_t)0);
+ }
#if 0 // this verification seems to be causing bad behavior on some rigs
commit b1828d951a2159e87b6208f6eb3aabdacc03b6aa
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sat Dec 17 17:23:52 2022 -0600
Ensure get_powerstat return RIG_OK when rig does not have get_powerstat
https://github.com/Hamlib/Hamlib/issues/1189
diff --git a/src/rig.c b/src/rig.c
index e5075d15..175bfd9c 100644
--- a/src/rig.c
+++ b/src/rig.c
@@ -6032,7 +6032,7 @@ int HAMLIB_API rig_get_powerstat(RIG *rig, powerstat_t *status)
if (rig->caps->get_powerstat == NULL)
{
*status = RIG_POWER_ON; // default to power if not available
- RETURNFUNC(-RIG_ENAVAIL);
+ RETURNFUNC(RIG_OK);
}
*status = RIG_POWER_OFF; // default now to power off until proven otherwise in get_powerstat
commit 9970a2767d2f49c427c51c6a0780a41010269b89
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sat Dec 17 10:35:56 2022 -0600
Reset rig->state.cache.split so it can be set again when rigctld reopens the rig
https://github.com/Hamlib/Hamlib/issues/1187
diff --git a/src/rig.c b/src/rig.c
index 71f32138..e5075d15 100644
--- a/src/rig.c
+++ b/src/rig.c
@@ -1518,6 +1518,8 @@ int HAMLIB_API rig_close(RIG *rig)
remove_opened_rig(rig);
+ // zero split so it will allow it to be set again on open for rigctld
+ rig->state.cache.split = 0;
rs->comm_state = 0;
rig_debug(RIG_DEBUG_VERBOSE, "%s(%d): %p rs->comm_state==0?=%d\n", __func__,
__LINE__, &rs->comm_state,
commit 04f5195cfd68df95bdaaa185b577555390f1276c
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sat Dec 17 10:19:46 2022 -0600
Do not reset cache for unidirectional rigs
https://github.com/Hamlib/Hamlib/issues/1187
diff --git a/src/rig.c b/src/rig.c
index f5c792fd..71f32138 100644
--- a/src/rig.c
+++ b/src/rig.c
@@ -1895,7 +1895,12 @@ int HAMLIB_API rig_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
#endif
)
{
- rig_set_cache_freq(rig, RIG_VFO_ALL, (freq_t)0);
+ // Unidirectional rigs do not reset cache
+ if (rig->caps->rig_model != RIG_MODEL_FT736R)
+ {
+ rig_set_cache_freq(rig, RIG_VFO_ALL, (freq_t)0);
+ }
+
HAMLIB_TRACE;
retcode = rig_get_freq(rig, vfo, &freq_new);
commit 9508c45f00558bce22409c472b0de3d5d95f40c8
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sat Dec 17 10:00:07 2022 -0600
Update NEWS
diff --git a/NEWS b/NEWS
index 3fadca9e..730d3779 100644
--- a/NEWS
+++ b/NEWS
@@ -19,6 +19,7 @@ Version 4.6
* Fix FTDX3000 rig split
Version 4.5.2
+ * Fix rig.c calling rig_get_mode when backend does not have get_mode
* Fix kenwood_ts890_get_level
* Add Prosistel D elevation CBOX az to fix problem with azimuth control
* 2022-12-XX -- Planned for Dec 2022
commit 120c580de0b67a9da1deac2b53e4238fd3774d57
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sat Dec 17 09:59:04 2022 -0600
FT-736 did not have get_mode so only call get_mode when available
https://github.com/Hamlib/Hamlib/issues/1187
diff --git a/src/rig.c b/src/rig.c
index 477c5c74..f5c792fd 100644
--- a/src/rig.c
+++ b/src/rig.c
@@ -1344,14 +1344,18 @@ int HAMLIB_API rig_open(RIG *rig)
rig_debug(RIG_DEBUG_VERBOSE, "%s(%d): Current split=%d, tx_vfo=%s\n", __func__,
__LINE__, split, rig_strvfo(tx_vfo));
rmode_t mode;
- pbwidth_t width;
- rig_get_mode(rig, RIG_VFO_A, &mode, &width);
+ pbwidth_t width = 2400; // we'll use 2400Hz as default width
- if (split)
+ if (rig->caps->get_mode)
{
- rig_debug(RIG_DEBUG_VERBOSE, "xxxsplit=%d\n", split);
- HAMLIB_TRACE;
- rig_get_mode(rig, RIG_VFO_B, &mode, &width);
+ rig_get_mode(rig, RIG_VFO_A, &mode, &width);
+
+ if (split)
+ {
+ rig_debug(RIG_DEBUG_VERBOSE, "xxxsplit=%d\n", split);
+ HAMLIB_TRACE;
+ rig_get_mode(rig, RIG_VFO_B, &mode, &width);
+ }
}
}
}
@@ -2891,7 +2895,8 @@ int HAMLIB_API rig_get_vfo(RIG *rig, vfo_t *vfo)
if (cache_ms < rig->state.cache.timeout_ms)
{
*vfo = rig->state.cache.vfo;
- rig_debug(RIG_DEBUG_TRACE, "%s: cache hit age=%dms, vfo=%s\n", __func__, cache_ms, rig_strvfo(*vfo));
+ rig_debug(RIG_DEBUG_TRACE, "%s: cache hit age=%dms, vfo=%s\n", __func__,
+ cache_ms, rig_strvfo(*vfo));
ELAPSED2;
RETURNFUNC(RIG_OK);
}
@@ -4424,7 +4429,7 @@ int HAMLIB_API rig_set_split_mode(RIG *rig,
if (tx_vfo == RIG_VFO_B || tx_vfo == RIG_VFO_SUB) { rx_vfo = RIG_VFO_A; }
- if (vfo == RIG_VFO_CURR && tx_vfo == RIG_VFO_B) { rx_vfo = RIG_VFO_A; }
+ if (vfo == RIG_VFO_CURR && tx_vfo == RIG_VFO_B) { rx_vfo = RIG_VFO_A; }
else if (vfo == RIG_VFO_CURR && tx_vfo == RIG_VFO_A) { rx_vfo = RIG_VFO_B; }
else if (vfo == RIG_VFO_CURR && tx_vfo == RIG_VFO_MAIN) { rx_vfo = RIG_VFO_SUB; }
else if (vfo == RIG_VFO_CURR && tx_vfo == RIG_VFO_SUB) { rx_vfo = RIG_VFO_MAIN; }
commit 250a5b0211fd2e8000dcf02e943915940a2ff911
Author: Mike Black W9MDB <mdb...@ya...>
Date: Thu Dec 15 17:14:00 2022 -0600
Update NEWS
diff --git a/NEWS b/NEWS
index d2d0bb3c..3fadca9e 100644
--- a/NEWS
+++ b/NEWS
@@ -19,6 +19,7 @@ Version 4.6
* Fix FTDX3000 rig split
Version 4.5.2
+ * Fix kenwood_ts890_get_level
* Add Prosistel D elevation CBOX az to fix problem with azimuth control
* 2022-12-XX -- Planned for Dec 2022
* Fix FT736R gpredict usage by adding cached get_freq
commit f554c3a7ffb495cb0ad007d0b1cc86c183c78696
Author: Mike Black W9MDB <mdb...@ya...>
Date: Thu Dec 15 17:11:08 2022 -0600
Fix kenwood_ts890_get_level -- thanks to N3GB George Baltz
diff --git a/rigs/kenwood/ts890s.c b/rigs/kenwood/ts890s.c
index 9c23b131..dc2781b9 100644
--- a/rigs/kenwood/ts890s.c
+++ b/rigs/kenwood/ts890s.c
@@ -305,7 +305,7 @@ int kenwood_ts890_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
if (rig->caps->swr_cal.size)
{
- val->f = rig_raw2val_float(val->i, &rig->caps->swr_cal);
+ val->f = rig_raw2val_float(levelint, &rig->caps->swr_cal);
}
else
{
@@ -432,7 +432,7 @@ const struct rig_caps ts890s_caps =
RIG_MODEL(RIG_MODEL_TS890S),
.model_name = "TS-890S",
.mfg_name = "Kenwood",
- .version = BACKEND_VER ".9",
+ .version = BACKEND_VER ".10",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
commit 32b1ce161e5f2726be1f195b531eca14c196514a
Author: Mike Black W9MDB <mdb...@ya...>
Date: Thu Dec 15 12:04:14 2022 -0600
Update NEWS
diff --git a/NEWS b/NEWS
index c665f25e..d2d0bb3c 100644
--- a/NEWS
+++ b/NEWS
@@ -19,6 +19,7 @@ Version 4.6
* Fix FTDX3000 rig split
Version 4.5.2
+ * Add Prosistel D elevation CBOX az to fix problem with azimuth control
* 2022-12-XX -- Planned for Dec 2022
* Fix FT736R gpredict usage by adding cached get_freq
* Fix get_powerstat problem with Log4OM/Flex and others
commit 830bf5a94171847ff82ce9f22edcfd3a2a2fecf8
Merge: 2a84386a 9eecfc3b
Author: Michael Black <mdb...@ya...>
Date: Thu Dec 15 11:42:53 2022 -0600
Merge pull request #1191 from PianetaRadio/master
Rotator Prosistel elevation with azimuth logic
commit 9eecfc3b2df1804f6ddccafea160fe6f9d80efc6
Author: PianetaRadio <789...@us...>
Date: Thu Dec 15 18:24:55 2022 +0100
Update rotlist.h
Add Elevation rotator with Control box responding to azimuth logic
diff --git a/include/hamlib/rotlist.h b/include/hamlib/rotlist.h
index 2ede3f89..2565d56a 100644
--- a/include/hamlib/rotlist.h
+++ b/include/hamlib/rotlist.h
@@ -557,6 +557,7 @@
#define ROT_MODEL_PROSISTEL_D_AZ ROT_MAKE_MODEL(ROT_PROSISTEL, 1)
#define ROT_MODEL_PROSISTEL_D_EL ROT_MAKE_MODEL(ROT_PROSISTEL, 2)
#define ROT_MODEL_PROSISTEL_COMBI_TRACK_AZEL ROT_MAKE_MODEL(ROT_PROSISTEL, 3)
+#define ROT_MODEL_PROSISTEL_D_EL_CBOXAZ ROT_MAKE_MODEL(ROT_PROSISTEL, 4)
/**
commit 40066a6cfa0cc7d49d9e2a25edf5dcac46421e84
Author: PianetaRadio <789...@us...>
Date: Thu Dec 15 18:21:23 2022 +0100
Update prosistel.c
Add Elevation rotator with Control box responding to azimuth logic
diff --git a/rotators/prosistel/prosistel.c b/rotators/prosistel/prosistel.c
index 1ab58602..76a2a37f 100644
--- a/rotators/prosistel/prosistel.c
+++ b/rotators/prosistel/prosistel.c
@@ -379,6 +379,15 @@ static const struct prosistel_rot_priv_caps prosistel_rot_combitrack_priv_caps =
};
+// Elevation rotator with Control box D using azimuth logic
+static const struct prosistel_rot_priv_caps prosistel_rot_el_cboxaz =
+{
+ .angle_multiplier = 1.0f,
+ .stop_angle = 997,
+ .elevation_id = 'A',
+};
+
+
/*
* Prosistel rotator capabilities
*/
@@ -487,7 +496,7 @@ const struct rot_caps prosistel_combi_track_azel_rot_caps =
};
-//Elevation rotator with ControlBox using azimuth logic
+// Elevation rotator with Control box D using azimuth logic
const struct rot_caps prosistel_d_el_cboxaz_rot_caps =
{
ROT_MODEL(ROT_MODEL_PROSISTEL_D_EL_CBOXAZ),
commit b1ac588667e74af74e7eb32be3badfc4ad1e77d8
Author: PianetaRadio <789...@us...>
Date: Thu Dec 15 18:12:32 2022 +0100
Update prosistel.h
Add Elevation rotator with Control box responding to azimuth logic
diff --git a/rotators/prosistel/prosistel.h b/rotators/prosistel/prosistel.h
index ee7b3594..2b1b90c8 100644
--- a/rotators/prosistel/prosistel.h
+++ b/rotators/prosistel/prosistel.h
@@ -25,5 +25,6 @@
extern const struct rot_caps prosistel_d_az_rot_caps;
extern const struct rot_caps prosistel_d_el_rot_caps;
extern const struct rot_caps prosistel_combi_track_azel_rot_caps;
+extern const struct rot_caps prosistel_d_el_cboxaz_rot_caps;
#endif /* _ROT_PROSISTEL_H */
commit 7fc23e59a337e853e292e8e89d39d6a2179498ea
Author: PianetaRadio <789...@us...>
Date: Thu Dec 15 18:09:51 2022 +0100
Update prosistel.c
Add Elevation rotator with Control box responding to azimuth logic
diff --git a/rotators/prosistel/prosistel.c b/rotators/prosistel/prosistel.c
index 511cde4a..1ab58602 100644
--- a/rotators/prosistel/prosistel.c
+++ b/rotators/prosistel/prosistel.c
@@ -486,6 +486,43 @@ const struct rot_caps prosistel_combi_track_azel_rot_caps =
.get_position = prosistel_rot_get_position,
};
+
+//Elevation rotator with ControlBox using azimuth logic
+const struct rot_caps prosistel_d_el_cboxaz_rot_caps =
+{
+ ROT_MODEL(ROT_MODEL_PROSISTEL_D_EL_CBOXAZ),
+ .model_name = "D elevation CBOX az",
+ .mfg_name = "Prosistel",
+ .version = "20221215.0",
+ .copyright = "LGPL",
+ .status = RIG_STATUS_STABLE,
+ .rot_type = ROT_TYPE_ELEVATION,
+ .port_type = RIG_PORT_SERIAL,
+ .serial_rate_min = 9600,
+ .serial_rate_max = 9600,
+ .serial_data_bits = 8,
+ .serial_stop_bits = 1,
+ .serial_parity = RIG_PARITY_NONE,
+ .serial_handshake = RIG_HANDSHAKE_NONE,
+ .write_delay = 0,
+ .post_write_delay = 0,
+ .timeout = 3000,
+ .retry = 3,
+
+ .min_az = 0.0,
+ .max_az = 0.0,
+ .min_el = 0.0,
+ .max_el = 90.0,
+
+ .priv = &prosistel_rot_el_cboxaz,
+
+ .rot_open = prosistel_rot_open,
+ .stop = prosistel_rot_stop,
+ .set_position = prosistel_rot_set_position,
+ .get_position = prosistel_rot_get_position,
+};
+
+
DECLARE_INITROT_BACKEND(prosistel)
{
rig_debug(RIG_DEBUG_VERBOSE, "%s: _init called\n", __func__);
@@ -493,6 +530,7 @@ DECLARE_INITROT_BACKEND(prosistel)
rot_register(&prosistel_d_az_rot_caps);
rot_register(&prosistel_d_el_rot_caps);
rot_register(&prosistel_combi_track_azel_rot_caps);
+ rot_register(&prosistel_d_el_cboxaz_rot_caps);
return RIG_OK;
}
commit 2a84386ae89989158d9bc628654188219138f9d5
Author: Mike Black W9MDB <mdb...@ya...>
Date: Wed Dec 14 22:59:46 2022 -0600
Add simft736.c and update others
diff --git a/simulators/simft747gx.c b/simulators/simft736.c
similarity index 70%
copy from simulators/simft747gx.c
copy to simulators/simft736.c
index a0ce5cb8..da4e5c39 100644
--- a/simulators/simft747gx.c
+++ b/simulators/simft736.c
@@ -28,7 +28,7 @@ getmyline(int fd, unsigned char *buf)
int n = 0;
memset(buf, 0, BUFSIZE);
- while (read(fd, &c, 1) > 0 && i < 5)
+ while (i < 5 && read(fd, &c, 1) > 0)
{
buf[i++] = c;
n++;
@@ -102,78 +102,63 @@ again:
if (bytes != 5)
{
printf("Not 5 bytes? bytes=%d\n", bytes);
+ continue;
}
switch (buf[4])
{
- case 0x01:
- printf("SPLIT\n");
- break;
-
- case 0x02:
- printf("MEMORY\n");
+ case 0x00:
+ printf("CAT On\n");
break;
- case 0x03:
- printf("VFO_TO_M\n");
+ case 0x80:
+ printf("CAT Off\n");
break;
- case 0x04:
- printf("DLOCK\n");
+ case 0x01:
+ printf("FREQ_SET\n");
break;
- case 0x05:
- printf("A_BVFO\n");
+ case 0x07:
+ printf("MODE_SET\n");
break;
- case 0x06:
- printf("M_TO_VFO\n");
+ case 0x0e:
+ printf("Full Duplex On\n");
break;
- case 0x07:
- printf("UP500K\n");
+ case 0x8e:
+ printf("Full Duplex Off\n");
break;
case 0x08:
- printf("DN500K\n");
+ printf("Tx\n");
break;
- case 0x09:
- printf("CLAR\n");
+ case 0x88:
+ printf("Rx\n");
break;
- case 0x0a:
- printf("FREQ_SET\n");
- break;
-
- case 0x0c:
- ...
[truncated message content] |