[Hamlib-commits] Hamlib -- Ham radio control libraries branch master updated. 77d9d11f9249edeaedef9
Library to control radio transceivers and receivers
Brought to you by:
n0nb
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] |