[Hamlib-commits] Hamlib -- Ham radio control libraries branch master updated. 468dd151102ef94d71c07
Library to control radio transceivers and receivers
Brought to you by:
n0nb
From: Nate B. <n0...@us...> - 2022-05-18 08:46:43
|
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 468dd151102ef94d71c071b1acf736b65cc727ff (commit) via a0cb833548de747eafc7d22c3cf3258645277eaf (commit) via 21a2190e7f7a1294324ec5c4a649051ba4f9c325 (commit) via da28af73e64e2a2b219babddb13b9f02efb028fe (commit) via d89bc3df4ffb51c41e1033d7c54da9f188fec568 (commit) via 59211b6a5881285a0dc2070f25ddb1cfbbe520a8 (commit) via bdd7ffdda19064bbe3467a91f9ecdf407034452d (commit) via a0321ba25f1b7073736cbb631427b53f70b32df6 (commit) via 72f38f02d1010c570a2b1bf3791f535e8abdbc8a (commit) via e9fb733dae0e7acb2897850787ebbdcf2520e37c (commit) via 17539bb68adabb1f8e08247a87f6c2042345699b (commit) via 0849172dc55f2768ee17bad8d8708fcaf65189d3 (commit) via 4d8e64acfe6996071feaf2d166ec0c8611278320 (commit) via ecd78e73542b283f9f691d5da0bafd9920941883 (commit) via 4c2ab11c561ef3e9d745a883081f6aac3077a659 (commit) via 82a915563b0f9ba3f2c22caa63bee84b9c6d27c9 (commit) via d54f5a1c34fc7a5714f86d5a785fe7851caea820 (commit) via a518bdcaf1043cfe8c47c39ff38c31cab4de5227 (commit) via 3892bc41dc87dc8ff3a55097e1354f1edb4e9709 (commit) via f16988d3638ddc9487171dcf2bc3f88fd489d888 (commit) via 51cbf4af7ab7b73e7efe5213024c35865934cc91 (commit) via 67a7a613a0f42c97d48230528d4f0227bdbfe2d0 (commit) via cb8b7c185c80d1fcf4687df3689f25ab7df6879d (commit) via 6f9d057162a448a891016fc86606ecdfc33fc50b (commit) via 2f638a10bf77e4d3c4c28ecfd168cdbf18535d30 (commit) via 81d0c3c768b23b2c3e73e5df5165ce3a4f833dde (commit) via 3096ad8b6801063d095a9136e858aa1c0f0cd8a1 (commit) via d0fa5d7776e8451f144652f92d848ea0858d279e (commit) via 80043d437c8a05958452fdd3f82a4d15c08ad6c9 (commit) via c63a71601a314925e79550abf72cc4c7e993004f (commit) via 49cbc18e198132ba72e647058778d49a15c3173d (commit) via 066978ed15d27c995f23946f4c2adf4a5889cddd (commit) via ed1f0a22dcd131df70dda2954fec829e5f53e661 (commit) via cc73447d7c5961e4932dd274da623123adeff531 (commit) via 4bf2a8a2b84a0737131766ac0adea164710a17fb (commit) via 10635407654c4c0db493d25ec9d5985912e4cc70 (commit) via 3a569fcde1f0fe1fdaf7f0e80f561313f8307c5d (commit) via 2aa8d4b675531c46d7fdcd424f396a9a908410c8 (commit) via 11ffd603abd7f1acf3239090d2597c8a77ccf11c (commit) via 45208df8c61795c02b0ce802f2304c2fafff4746 (commit) via 1f5f80805793a917a84422528625b3e75c62bc06 (commit) via 6ad3ace7263ba98b5c8320ac518d9c718fce0bef (commit) via 71407bbf1da8b2a4bde40b45a8bb5a3ac20953ef (commit) via 019faf3b6a63d6f044d2761dc5239ff5703afad4 (commit) via a22787393f98fda919b7a43140b8d5f0084a87ce (commit) via e76cd714549bf46a04fc7dc28e1c81f3187cda9d (commit) via af8b0d57e91bf8cdbc938330b702970bf6e5e04f (commit) via c107fd4af31981da573ecb586b702cd006e9a5fd (commit) via 8865bf6c66e795e2fa290e8b0329c6d4e10ad0d4 (commit) via 434d28cd9a87c6dcf89b59f5c5e5434d87101ca7 (commit) via 22d40093275c254cb5fe122786475dd1e26822c8 (commit) via e4d7dbf24cbeeb1eddfef9ee77797c880c29c13c (commit) via e9d9cb9eabdd4b3af4a125c282230a260cb17bb1 (commit) via ab499d31eb357cebb988232d346d847d6e2f47a6 (commit) via 1dd915a7066b16607f6407b08f206aa7505ed867 (commit) via e661642a7d5f094813d10e211079ec3d6fbedd98 (commit) via f0f96dd5ce54734e52d5d033fb103874ccc5f8ed (commit) via f0c84aa33887146f980bef423898eaa436b091ae (commit) via 80fb97b433a6bcd13591866b3aed640e2be88a0a (commit) via ddf0be7b72a7e797c5cde12fec7d6a7883a5254d (commit) via ca53b02dcdeca0f8c174d292ac89675e7c138c10 (commit) via 4fa9a211adbcb1ae9329db41c27854af70f39d64 (commit) via c774a05be43622c21b28e19a7432e58737678dab (commit) via 4d919ec4546f2eb2ee15f04ce93b789824d20c4a (commit) via 9dfbd235af43e3cce4dc26ed75545493f1473ee4 (commit) via 279bc84dfee648e8e3e248e211007400b82cfe44 (commit) via 6cc4aefdb0f8823f4965d6bf600865d75caf88cc (commit) via c0d298f0eb9087ea72c4d271bef4f0247fb4ed4f (commit) via 5259102cf1b58a57ecc9e67c5b96855f35cdb28c (commit) via 24c7a0042a992c5bc6f3ec65581c9acb7abf1367 (commit) via a0796552901a984a0e1f79afb67cddd0a63a572c (commit) via 8bf1e7c649ac10f7672e0b99d854bde772458b83 (commit) via cc7d9cd78da4982a0d913fc0cf5d00793d4e0976 (commit) via d60391fcb08f9969c9956a95b74da00818a662e0 (commit) via b30db5bc594c5ec5af6df6d19d1e211c169c4882 (commit) via 8cfa1f2f7d14b665ce6b5c6a248840259b69f0e8 (commit) via e3bf699732327d8d640ce7ae5920af19058d5e7b (commit) via 704a6aac4b703f7b3802d640cd24f5386bac050a (commit) via e4bd3c8edecb104495af8d8fc3b62f33b51186fa (commit) via f0469e48a77491171f53d8091ed99a80e3bc4ef0 (commit) via 3a4d99dd7730a9057440a44df2350ecd24498d05 (commit) via 9d73fa737d0fff47e6af7ba9454527d5f0241621 (commit) via 4ecf274353d9e05ffb2e31a3a6ba320d01c5c7ab (commit) via 9d952e6d09989d3594c3d0378b3a144dc6221b57 (commit) via 428ca4a196d6b50032495e120671ed92d4b1fce4 (commit) via 1b64214032e441c1302fd1ec55ea892fce83bbca (commit) via 19c17eb5ba52e729eec15f8d0556eefd251a9565 (commit) via 79180089a64f7cf3acc62bc532052fb0a5444267 (commit) via f35e2d8c34d3ea7ac4fb4572916efb0ed642ce6b (commit) via 157eead0213c5aaac20c51308cb418061862cd32 (commit) via 5cce47e23322aac3f5dd198cda6611d85f29fc29 (commit) via f9c0758e1425272ff078414e61c22d298d0b319a (commit) via 829b632984f7e67cc8e4420951687c4424758281 (commit) via 56efa155dc0bfdcfa042690ac5780d9c5777f67b (commit) via 0b62193d92e1969af809e4a1127d1b2f118e0d5a (commit) via 5c0e98fe5693a28854f5a9968afe67609586ce58 (commit) via d7da44a3b5e1d7f2330f5be45047ed05af744d9a (commit) via 4b64d5f7c37882c6bddcaad82be8c7b3dd0aace4 (commit) via e1c2a08789f9f18ffd0b930f52bb62a33db5c31a (commit) via 5c1ed109a962dd1f1abec81651adeb6f809aca33 (commit) via 533ad321d4f457770fda1f7110be63368788e7d4 (commit) via 15795d8366356ffbe8cc39af054399cdcf096b5a (commit) via 244738fcc93dc812b347339bacbb2c73072199c4 (commit) via a975d734ba44e152c6ef95c75da418593e5cfa8e (commit) via e05d04046065999a30c58c1786a92a5ad59dd0f3 (commit) via 3529c789a8d06afac3325608885d7aeb9d01f11b (commit) via c8faa7a9150825b18f24dcffe86e926a2f649b3b (commit) via 6ad344034107374485ee043e9695b5d304e045f3 (commit) from c76dc1453d963334968ab9879caceb180021f12b (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 468dd151102ef94d71c071b1acf736b65cc727ff Author: Mike Black W9MDB <mdb...@ya...> Date: Tue May 17 17:03:48 2022 -0500 Update simkenwood.c diff --git a/simulators/simkenwood.c b/simulators/simkenwood.c index ec1e9dc3..89c9e107 100644 --- a/simulators/simkenwood.c +++ b/simulators/simkenwood.c @@ -14,6 +14,7 @@ float freqA = 14074000; float freqB = 14074500; int filternum = 7; int datamode = 0; +int ptt, ptt_data, ptt_mic, ptt_tune; // ID 0310 == 310, Must drop leading zero typedef enum nc_rigid_e @@ -260,6 +261,18 @@ int main(int argc, char *argv[]) { continue; } + else if (strncmp(buf, "TX", 2) == 0) + { + ptt = ptt_mic = ptt_data = ptt_tune = 0; + switch(buf[2]) + { + case ';': ptt = 1; + case '0': ptt_mic = 1; + case '1': ptt_data = 1; + case '2': ptt_tune = 1; + } + continue; + } else if (strlen(buf) > 0) { fprintf(stderr, "Unknown command: %s\n", buf); commit a0cb833548de747eafc7d22c3cf3258645277eaf Author: Mike Black W9MDB <mdb...@ya...> Date: Tue May 17 17:03:22 2022 -0500 Update simicom.c diff --git a/simulators/simicom.c b/simulators/simicom.c index d99d65b8..93e96346 100644 --- a/simulators/simicom.c +++ b/simulators/simicom.c @@ -15,6 +15,7 @@ #include "../src/misc.h" #define BUFSIZE 256 +#define X25 int civ_731_mode = 0; vfo_t current_vfo = RIG_VFO_A; @@ -25,6 +26,7 @@ float freqA = 14074000; float freqB = 14074500; mode_t modeA = RIG_MODE_CW; mode_t modeB = RIG_MODE_USB; +int datamode = 0; pbwidth_t widthA = 0; pbwidth_t widthB = 1; ant_t ant_curr = 0; @@ -250,7 +252,7 @@ void frameParse(int fd, unsigned char *frame, int len) break; -#if 1 +#ifdef X25 case 0x25: if (frame[6] == 0xfd) @@ -281,6 +283,18 @@ void frameParse(int fd, unsigned char *frame, int len) frame[5] = 0xfd; } + break; + case 0x26: + for(int i=0;i<6;++i) printf("%02x:",frame[i]); + if (frame[6] == 0xfd) // then a query + { + frame[6] = frame[5] == 0? modeA : modeB; + frame[7] = datamode; + frame[8] = 0xfb; + frame[9] = 0xfd; + write(fd, frame, 10); + } + printf("\n"); break; #else @@ -288,6 +302,10 @@ void frameParse(int fd, unsigned char *frame, int len) frame[4] = 0xfa; frame[5] = 0xfd; break; + case 0x26: + frame[4] = 0xfa; + frame[5] = 0xfd; + break; #endif default: printf("cmd 0x%02x unknown\n", frame[4]); @@ -353,6 +371,11 @@ int main(int argc, char **argv) int fd = openPort(argv[1]); printf("%s: %s\n", argv[0], rig_version()); +#ifdef X25 + printf("x25/x26 command recognized\n"); +#else + printf("x25/x26 command rejected\n"); +#endif #if defined(WIN32) || defined(_WIN32) if (argc != 2) commit 21a2190e7f7a1294324ec5c4a649051ba4f9c325 Author: Mike Black W9MDB <mdb...@ya...> Date: Tue May 17 16:19:36 2022 -0500 Update simyaesu.c diff --git a/simulators/simyaesu.c b/simulators/simyaesu.c index 612f4fd9..8e5c2e73 100644 --- a/simulators/simyaesu.c +++ b/simulators/simyaesu.c @@ -17,9 +17,12 @@ char rx_vfo = '0'; vfo_t curr_vfo = RIG_VFO_A; char modeA = '1'; char modeB = '1'; -int width = 0; int ptt; int power = 1; +int roofing_filter_main = 1; +int roofing_filter_sub = 6; +int width_main = 0; +int width_sub = 0; // ID 0310 == 310, Must drop leading zero typedef enum nc_rigid_e @@ -354,19 +357,54 @@ int main(int argc, char *argv[]) if (n < 0) { perror("EX032"); } } + else if (strcmp(buf, "NA0;") == 0) + { + SNPRINTF(buf, sizeof(buf), "NA00;"); + usleep(50 * 1000); + n = write(fd, buf, strlen(buf)); + //printf("%s n=%d\n", buf, n); + } + else if (strcmp(buf, "RF0;") == 0) + { + SNPRINTF(buf, sizeof(buf), "RF0%d;", roofing_filter_main); + usleep(50 * 1000); + n = write(fd, buf, strlen(buf)); + } + else if (strcmp(buf, "RF1;") == 0) + { + SNPRINTF(buf, sizeof(buf), "RF1%d;", roofing_filter_sub); + usleep(50 * 1000); + n = write(fd, buf, strlen(buf)); + } + else if (strncmp(buf, "RF", 2) == 0) + { + SNPRINTF(buf, sizeof(buf), "RF%c%d;", buf[2], buf[2]==0?roofing_filter_main:roofing_filter_sub); + usleep(50 * 1000); + n = write(fd, buf, strlen(buf)); + } else if (strcmp(buf, "SH0;") == 0) { - SNPRINTF(buf, sizeof(buf), "SH0%02d;", width); + SNPRINTF(buf, sizeof(buf), "SH%c%02d;", buf[2], width_main); usleep(50 * 1000); n = write(fd, buf, strlen(buf)); - printf("%s n=%d\n", buf, n); } - else if (strcmp(buf, "NA0;") == 0) + else if (strcmp(buf, "SH1;") == 0) { - SNPRINTF(buf, sizeof(buf), "NA00;"); + SNPRINTF(buf, sizeof(buf), "SH%c%02d;", buf[2], width_sub); usleep(50 * 1000); n = write(fd, buf, strlen(buf)); - //printf("%s n=%d\n", buf, n); + } + else if (strncmp(buf, "SH",2) == 0 && strlen(buf) > 4) + { + int vfo, twidth; + sscanf(buf,"SH%1d%d", &vfo, &twidth); + if (vfo == 0) width_main = twidth; + else width_sub = twidth; + printf("width_main=%d, width_sub=%d\n", width_main, width_sub); + } + else if (strncmp(buf, "SH",2) == 0) + { + SNPRINTF(buf, sizeof(buf), "SH%c%02d;", buf[2], buf[2]==0?width_main:width_sub); } else if (strlen(buf) > 0) commit da28af73e64e2a2b219babddb13b9f02efb028fe Author: Mike Black W9MDB <mdb...@ya...> Date: Tue May 17 09:10:40 2022 -0500 Update informatino for GRBLTRK rotor diff --git a/NEWS b/NEWS index 7871bc04..3526578d 100644 --- a/NEWS +++ b/NEWS @@ -16,6 +16,7 @@ Version 4.6 Version 4.5 * 2022-05-XX + * Add GRBLTRK rotor project -- two axis rotor * enum meter_level_e is deprecated and will be removed in 4.6 * Add SDRPlay SDRUno rig -- can now use Data/Pkt in WSJTX * Add ability to use cat_string to FLRig via the "w" and "W" commands diff --git a/rotators/grbltrk/README.txt b/rotators/grbltrk/README.txt new file mode 100644 index 00000000..873e6d6c --- /dev/null +++ b/rotators/grbltrk/README.txt @@ -0,0 +1,2 @@ +More information at +https://github.com/wuxx/AntRunner commit d89bc3df4ffb51c41e1033d7c54da9f188fec568 Merge: 59211b6a e9fb733d Author: Michael Black <mdb...@ya...> Date: Tue May 17 08:14:48 2022 -0500 Merge pull request #1032 from wuxx/master add new rotator grbltrk commit 59211b6a5881285a0dc2070f25ddb1cfbbe520a8 Author: Mike Black W9MDB <mdb...@ya...> Date: Tue May 17 07:49:44 2022 -0500 Fix mode=NONE in rig_set_mode diff --git a/src/rig.c b/src/rig.c index 1d78b95e..d0af7a0e 100644 --- a/src/rig.c +++ b/src/rig.c @@ -2105,8 +2105,11 @@ int HAMLIB_API rig_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) RETURNFUNC2(-RIG_ENAVAIL); } - if (vfo == RIG_VFO_CURR) { vfo = rig->state.current_vfo; } - else if (mode == RIG_MODE_NONE) // the we just use the current mode to set width + if (vfo == RIG_VFO_CURR) + { + vfo = rig->state.current_vfo; + } + if (mode == RIG_MODE_NONE) // the we just use the current mode to set width { pbwidth_t twidth; rig_get_mode(rig, vfo, &mode, &twidth); commit bdd7ffdda19064bbe3467a91f9ecdf407034452d Merge: a0321ba2 72f38f02 Author: Mike Black W9MDB <mdb...@ya...> Date: Tue May 17 07:42:23 2022 -0500 Merge branch 'master' of https://github.com/Hamlib/Hamlib commit a0321ba25f1b7073736cbb631427b53f70b32df6 Author: Mike Black W9MDB <mdb...@ya...> Date: Tue May 17 06:39:10 2022 -0500 Add ability to set mode only with rig_set_mode by using Mode=NONE diff --git a/src/rig.c b/src/rig.c index 99a269c1..1d78b95e 100644 --- a/src/rig.c +++ b/src/rig.c @@ -2106,6 +2106,11 @@ int HAMLIB_API rig_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) } if (vfo == RIG_VFO_CURR) { vfo = rig->state.current_vfo; } + else if (mode == RIG_MODE_NONE) // the we just use the current mode to set width + { + pbwidth_t twidth; + rig_get_mode(rig, vfo, &mode, &twidth); + } vfo = vfo_fixup(rig, vfo, rig->state.cache.split); commit 72f38f02d1010c570a2b1bf3791f535e8abdbc8a Author: Mike Black W9MDB <mdb...@ya...> Date: Tue May 17 06:39:10 2022 -0500 Add ability to set mode only with rig_set_mode by using VFO=NONE diff --git a/src/rig.c b/src/rig.c index 99a269c1..1d78b95e 100644 --- a/src/rig.c +++ b/src/rig.c @@ -2106,6 +2106,11 @@ int HAMLIB_API rig_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) } if (vfo == RIG_VFO_CURR) { vfo = rig->state.current_vfo; } + else if (mode == RIG_MODE_NONE) // the we just use the current mode to set width + { + pbwidth_t twidth; + rig_get_mode(rig, vfo, &mode, &twidth); + } vfo = vfo_fixup(rig, vfo, rig->state.cache.split); commit e9fb733dae0e7acb2897850787ebbdcf2520e37c Author: wuxx <wuj...@gm...> Date: Tue May 17 13:23:44 2022 +0800 add new rotator grbltrk Changes to be committed: modified: Android.mk modified: configure.ac modified: include/hamlib/rotlist.h new file: rotators/grbltrk/Android.mk new file: rotators/grbltrk/Makefile.am new file: rotators/grbltrk/grbltrk.c modified: src/rot_reg.c diff --git a/Android.mk b/Android.mk index fd6cb4dc..1abfacca 100644 --- a/Android.mk +++ b/Android.mk @@ -34,6 +34,7 @@ include $(TOP_PATH)/rotators/amsat/Android.mk include $(TOP_PATH)/rotators/ars/Android.mk include $(TOP_PATH)/rotators/celestron/Android.mk include $(TOP_PATH)/rotators/cnctrk/Android.mk +include $(TOP_PATH)/rotators/grbltrk/Android.mk include $(TOP_PATH)/rotators/easycomm/Android.mk include $(TOP_PATH)/rotators/ether6/Android.mk include $(TOP_PATH)/rotators/fodtrack/Android.mk diff --git a/configure.ac b/configure.ac index ab6e120f..5a6250ff 100644 --- a/configure.ac +++ b/configure.ac @@ -48,7 +48,7 @@ dnl Beware of duplication should a backend directory include both rig and dnl rotor definitions, e.g. "dummy". Optional backends will not be listed dnl here but will be added later, e.g. "winradio". RIG_BACKEND_LIST="rigs/adat rigs/alinco rigs/aor rigs/barrett rigs/codan rigs/dorji rigs/drake rigs/dummy rigs/elad rigs/flexradio rigs/icom rigs/icmarine rigs/jrc rigs/kachina rigs/kenwood rigs/kit rigs/lowe rigs/pcr rigs/prm80 rigs/racal rigs/rft rigs/rs rigs/skanti rigs/tapr rigs/tentec rigs/tuner rigs/uniden rigs/winradio rigs/wj rigs/yaesu rigs/gomspace" -ROT_BACKEND_LIST="rotators/amsat rotators/ars rotators/celestron rotators/cnctrk rotators/easycomm rotators/ether6 rotators/fodtrack rotators/gs232a rotators/heathkit rotators/m2 rotators/meade rotators/rotorez rotators/sartek rotators/spid rotators/ts7400 rotators/prosistel rotators/ioptron rotators/satel rotators/radant" +ROT_BACKEND_LIST="rotators/amsat rotators/ars rotators/celestron rotators/cnctrk rotators/grbltrk rotators/easycomm rotators/ether6 rotators/fodtrack rotators/gs232a rotators/heathkit rotators/m2 rotators/meade rotators/rotorez rotators/sartek rotators/spid rotators/ts7400 rotators/prosistel rotators/ioptron rotators/satel rotators/radant" # Amplifiers are all in the amplifiers directory AMP_BACKEND_LIST="amplifiers/elecraft" @@ -831,6 +831,7 @@ rotators/amsat/Makefile rotators/ars/Makefile rotators/celestron/Makefile rotators/cnctrk/Makefile +rotators/grbltrk/Makefile rotators/easycomm/Makefile rotators/ether6/Makefile rotators/fodtrack/Makefile diff --git a/include/hamlib/rotlist.h b/include/hamlib/rotlist.h index 522d4acb..2bca4607 100644 --- a/include/hamlib/rotlist.h +++ b/include/hamlib/rotlist.h @@ -623,6 +623,20 @@ #define ROT_BACKEND_ANDROIDSENSOR "androidsensor" #define ROT_MODEL_ANDROIDSENSOR ROT_MAKE_MODEL(ROT_ANDROIDSENSOR, 1) +/** + * \brief A macro that returns the model number of the GRBLTRK backend. + * + * \def ROT_MODEL_GRBLTRK + * + * The GRBLTRK backend can be used with rotators that support the GRBL + * protocol. + */ +//! @cond Doxygen_Suppress +#define ROT_GRBLTRK 24 +#define ROT_BACKEND_GRBLTRK "grbltrk" +//! @endcond +#define ROT_MODEL_GRBLTRK_SER ROT_MAKE_MODEL(ROT_GRBLTRK, 1) +#define ROT_MODEL_GRBLTRK_NET ROT_MAKE_MODEL(ROT_GRBLTRK, 2) /** * \brief Convenience type definition for a rotator model. diff --git a/rotators/grbltrk/Android.mk b/rotators/grbltrk/Android.mk new file mode 100755 index 00000000..89978259 --- /dev/null +++ b/rotators/grbltrk/Android.mk @@ -0,0 +1,12 @@ +LOCAL_PATH:= $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := grbltrk.c +LOCAL_MODULE := grbltrk + +LOCAL_CFLAGS := -DHAVE_CONFIG_H +LOCAL_C_INCLUDES := android include src +LOCAL_LDLIBS := -lhamlib -Lobj/local/armeabi + +include $(BUILD_STATIC_LIBRARY) diff --git a/rotators/grbltrk/Makefile.am b/rotators/grbltrk/Makefile.am new file mode 100755 index 00000000..fbd33aa5 --- /dev/null +++ b/rotators/grbltrk/Makefile.am @@ -0,0 +1,5 @@ + +noinst_LTLIBRARIES = libhamlib-grbltrk.la +libhamlib_grbltrk_la_SOURCES = grbltrk.c + +EXTRA_DIST = Android.mk diff --git a/rotators/grbltrk/grbltrk.c b/rotators/grbltrk/grbltrk.c new file mode 100755 index 00000000..00142361 --- /dev/null +++ b/rotators/grbltrk/grbltrk.c @@ -0,0 +1,564 @@ +/* + * Hamlib Rotator backend - LinuxCNC no hardware port + * Copyright (c) 2015 by Robert Freeman + * Adapted from AMSAT code by Stephane Fillod + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <math.h> +#include <stdlib.h> +#include <string.h> /* String function definitions */ +#include <unistd.h> /* UNIX standard function definitions */ + +#ifdef HAVE_SYS_IOCTL_H +#include <sys/ioctl.h> +#endif + +#include "hamlib/rotator.h" +#include "hamlib/rig.h" + +#include "misc.h" +#include "serial.h" +#include "token.h" +#include "network.h" + +#include "register.h" + +#define RSIZE (1024) + +#define XDEGREE2MM(d) ((d)/9.0) + +// 42-gear-22 +#define YDEGREE2MM(d) ((d)/9.0) + +//#define YDEGREE2MM(d) ((d) * ((1710) / (77*9))) +//#define YDEGREE2MM(d) ((d) * ((190) / (77))) + +/* + +$0=10 (step pulse, usec) +$1=25 (step idle delay, msec) +$2=0 (step port invert mask:00000000) +$3=0 (dir port invert mask:00000000) +$4=0 (step enable invert, bool) +$5=0 (limit pins invert, bool) +$6=0 (probe pin invert, bool) +$10=3 (status report mask:00000011) +$11=0.010 (junction deviation, mm) +$12=0.002 (arc tolerance, mm) +$13=0 (report inches, bool) +$20=0 (soft limits, bool) +$21=0 (hard limits, bool) +$22=0 (homing cycle, bool) +$23=0 (homing dir invert mask:00000000) +$24=25.000 (homing feed, mm/min) +$25=500.000 (homing seek, mm/min) +$26=250 (homing debounce, msec) +$27=1.000 (homing pull-off, mm) +$30=1000. (rpm max) +$31=0. (rpm min) +$32=0 (motor lock bool) +$33=7 (motor mode mask:00000111) +$100=80.000 (x, step/mm) +$101=80.000 (y, step/mm) +$102=80.000 (z, step/mm) +$110=10000.000 (x max rate, mm/min) +$111=10000.000 (y max rate, mm/min) +$112=10000.000 (z max rate, mm/min) +$120=250.000 (x accel, mm/sec^2) +$121=250.000 (y accel, mm/sec^2) +$122=250.000 (z accel, mm/sec^2) +$130=500.000 (x max travel, mm) +$131=500.000 (y max travel, mm) +$132=500.000 (z max travel, mm) + +*/ + +char *grbl_get_config = "$$\r\n"; +char *grbl_get_pos = "?\r\n"; + +char *grbl_init_list[] = +{ + "$1=255\r\n", /* lock motors */ + "$3=3\r\n", /* invert X and Y direction */ + //"$100=80\r\n", /* axis-x a4988 16 microstep */ + "$100=1776\r\n", /* axis-x a4988 16 microstep 42-gear-motor-22-(1710/77) (80*1710)/77 */ + //"$101=160\n", /* axis-y drv8825 32 microstep */ + //"$101=80\n", /* axis-y a4988 16 microstep */ + "$101=1776\r\n", /* axis-y a4988 16 microstep 42-gear-motor-22-(1710/77) (80*1710)/77 */ + "$110=50\r\n", + "$111=50\r\n", + "$120=25\r\n", + "$121=25\r\n", + "G90\r\n", + "G0 X0 Y0\r\n", +}; + +static int +grbl_request(ROT *rot, char *request, uint32_t req_size, char *response, uint32_t *resp_size) +{ + int retval; + static int fail_count = 0; + + rot_debug(RIG_DEBUG_ERR, "req: [%s][%d]\n", request, fail_count); + + if (rot->caps->rot_model == ROT_MODEL_GRBLTRK_SER + || rot->caps->rot_model == ROT_MODEL_GRBLTRK_NET) { + //fprintf(stderr, "ctrl by serial/network\n"); + + if ((retval = write_block(&rot->state.rotport, (unsigned char *)request, req_size)) != RIG_OK) { + rot_debug(RIG_DEBUG_ERR, "%s write_block fail!\n", __func__); + //exit(-1); + fail_count++; + //return RIG_EIO; + } else { + fail_count = 0; + } + + rig_flush(&rot->state.rotport); + + usleep(300000); + if ((retval = read_string(&rot->state.rotport, (unsigned char *)response, 1024, "\n", 1, 0, 1)) < 0) { + rot_debug(RIG_DEBUG_ERR, "%s read_string fail! (%d) \n", __func__, retval); + //exit(-1); + fail_count++; + //return RIG_EIO; + } else { + fail_count = 0; + } + + if (fail_count >= 10) { + rot_debug(RIG_DEBUG_ERR, "%s too much xfer fail! exit\n", __func__); + exit(-1); + } + + rig_flush(&rot->state.rotport); + + rot_debug(RIG_DEBUG_ERR, "rsp: [%s]\n", response); + //fprintf(stderr, "rsp: [%s]\n", response); + + *resp_size = retval; + + } + + return RIG_OK; +} + +static int +grbl_init(ROT *rot) +{ + int i, retval; + uint32_t init_count; + char rsp[RSIZE]; + uint32_t resp_size; + + /* get total config */ + grbl_request(rot, grbl_get_config, strlen(grbl_get_config), rsp, &resp_size); + if (strstr(rsp, grbl_init_list[0]) != NULL) { + rot_debug(RIG_DEBUG_ERR, "%s: grbl already configured\n", __func__); + return RIG_OK; + } + + init_count = sizeof(grbl_init_list) / sizeof(grbl_init_list[0]); + + for(i = 0; i < init_count; i++) { + rot_debug(RIG_DEBUG_ERR, "grbl_request [%s] ", grbl_init_list[i]); + retval = grbl_request(rot, grbl_init_list[i], strlen(grbl_init_list[i]), rsp, &resp_size); + //fprintf(stderr, "done\n"); + if (retval != RIG_OK) { + rot_debug(RIG_DEBUG_ERR, "grbl_request [%s] fail\n", grbl_init_list[i]); + return RIG_EIO; + } + } + + return RIG_OK; +} + +static int +grbltrk_rot_set_position(ROT *rot, azimuth_t curr_az, elevation_t curr_el) +{ + int i; + int retval; + static float prev_az, prev_el; + + static float prev_x, curr_x; + float x[3], delta[3]; + + float y; + + char req[RSIZE] = {0}; + char rsp[RSIZE] = {0}; + uint32_t rsp_size; + + float min_value; + int min_index; + + /* az:x: 0 - 360 */ + /* el:y: 0 - 90 */ + rot_debug(RIG_DEBUG_ERR, + "%s: (prev_x) = (%.3f); (prev_az) = (%.3f); (prev_el) = (%.3f); (curr_az, curr_el) = (%.3f, %.3f)\n", __func__, + prev_x, prev_az, prev_el, curr_az, curr_el); + + /* convert degree to mm, 360 degree = 40mm, 1 degree = 0.111mm */ + //x = az * 0.111; + //y = el * 0.111; + + /* 360 -> 0 */ + if ((prev_az > 270 && prev_az < 360) && + (curr_az > 0 && curr_az < 90 )) { + + rot_debug(RIG_DEBUG_ERR, "%s:%d\n", __func__, __LINE__); + if (prev_x >= XDEGREE2MM(270)) { + curr_x = XDEGREE2MM(curr_az) + XDEGREE2MM(360); + } else { + curr_x = XDEGREE2MM(curr_az); + } + /* 0 -> 360 */ + } else if ((prev_az > 0 && prev_az < 90 ) && + (curr_az > 270 && curr_az < 360)) { + rot_debug(RIG_DEBUG_ERR, "%s:%d\n", __func__, __LINE__); + + if (prev_x >= XDEGREE2MM(360)) { + curr_x = XDEGREE2MM(curr_az); + } else { + curr_x = XDEGREE2MM(curr_az) - XDEGREE2MM(360); + } + + /* reset */ + } else if (curr_az == 0 && curr_el == 0) { + rot_debug(RIG_DEBUG_ERR, "%s: reset\n", __func__); + curr_x = 0; + } else { + rot_debug(RIG_DEBUG_ERR, "%s:%d prev_x: %.3f\n", __func__, __LINE__, prev_x); + + x[0] = XDEGREE2MM(curr_az) - XDEGREE2MM(360); + x[1] = XDEGREE2MM(curr_az); + x[2] = XDEGREE2MM(curr_az) + XDEGREE2MM(360); + + delta[0] = prev_x - x[0]; + delta[1] = prev_x - x[1]; + delta[2] = prev_x - x[2]; + + if (delta[0] < 0) { delta[0] = -1 * delta[0]; } + if (delta[1] < 0) { delta[1] = -1 * delta[1]; } + if (delta[2] < 0) { delta[2] = -1 * delta[2]; } + + min_value = delta[0]; + min_index = 0; + + for(i = 0; i < 3; i++) { + if (delta[i] <= min_value) { + min_value = delta[i]; + min_index = i; + } + } + + curr_x = x[min_index]; + rot_debug(RIG_DEBUG_ERR, "min_index: %d; curr_x: %.3f\n", min_index, curr_x); + } + + y = YDEGREE2MM(curr_el); + + /**/ + + snprintf(req, sizeof(req), "G0 X%.3f Y%.3f\n", curr_x, y); + + retval = grbl_request(rot, req, strlen(req), rsp, &rsp_size); + + if (retval != RIG_OK) + { + return retval; + } + + prev_az = curr_az; + prev_el = curr_el; + + prev_x = curr_x; + return RIG_OK; + +} + +static int +grbltrk_rot_get_position(ROT *rot, azimuth_t *az, elevation_t *el) +{ + + //static char req[RSIZE]; + static char rsp[RSIZE]; + uint32_t rsp_size; + + float mpos[3]; + char dummy0[256]; + char dummy1[256]; + + int retval; + int i; + + rot_debug(RIG_DEBUG_ERR, "%s called\n", __func__); + + //snprintf(req, sizeof(req), "?\r\n"); + + for(i = 0; i < 5; i++) { + retval = grbl_request(rot, grbl_get_pos, strlen(grbl_get_pos), rsp, &rsp_size); + + /*FIXME: X Y safe check */ + + if (retval != RIG_OK) + { + return retval; + } + + if (strstr(rsp, "MPos") == NULL) { + rot_debug(RIG_DEBUG_ERR, "%s no MPos found, continue\n", __func__); + continue; + } + + /* grbl 0.9 mega328p */ + /* <Idle,MPos:0.000,0.000,0.000,WPos:0.000,0.000,0.000,SC:0> */ + //sscanf(rsp, "%[^','],MPos:%f,%f,%f,WPos:%f,%f,%f,%s", &dummy[0], &mpos[0], &mpos[1], &mpos[2], &wpos[0], &wpos[1], &wpos[2], &dummy[1]); + + /* grbl 1.3a esp32 */ + //<Idle|MPos:0.000,0.000,0.000|FS:0,0|Pn:P|WCO:5.000,0.000,0.000> + sscanf(rsp, "%[^'|']|MPos:%f,%f,%s", dummy0, &mpos[0], &mpos[1], dummy1); + + //rot_debug(RIG_DEBUG_ERR, "%s: (%.3f, %.3f) (%.3f, %.3f)\n", __func__, mpos[0], mpos[1], wpos[0], wpos[1]); + + //*az = (azimuth_t) mpos[0] / 0.111; + //*el = (elevation_t) mpos[1] / 0.111; + *az = (azimuth_t) mpos[0] * 9; + *el = (elevation_t) mpos[1] * 9; + + if ((*az) < 0) { + (*az) = (*az) + 360; + } + + //rot_debug(RIG_DEBUG_ERR, "%s: (az, el) = (%.3f, %.3f)\n", __func__, *az, *el); + + rot_debug(RIG_DEBUG_ERR, "%s: (az, el) = (%.3f, %.3f)\n", __func__, *az, *el); + + return RIG_OK; + + } + + *az = (azimuth_t) 0; + *el = (elevation_t) 0; + return RIG_OK; +} + +static int +grbltrk_rot_set_conf(ROT *rot, token_t token, const char *val) +{ + int i, retval; + char req[RSIZE] = {0}; + char rsp[RSIZE]; + uint32_t resp_size, len; + + rot_debug(RIG_DEBUG_ERR, "token: %ld; value: [%s]\n", token, val); + + len = strlen(val); + + if ((len != 0) && (val[0] == 'G')) { + + for(i = 0; i < len; i++) { + + if (val[i] == '@') { + req[i] = ' '; + } else { + req[i] = val[i]; + } + } + + req[i] = '\n'; + len = strlen(req); + + rot_debug(RIG_DEBUG_ERR, "send gcode [%s]\n", req); + retval = grbl_request(rot, req, len, rsp, &resp_size); + if (retval < 0) { + rot_debug(RIG_DEBUG_ERR, "grbl_request [%s] fail\n", val); + return RIG_EIO; + } + } + + return RIG_OK; +} + +static int +grbltrk_rot_init(ROT *rot) +{ + int r = RIG_OK; + + rot_debug(RIG_DEBUG_ERR, "%s:%d rot->caps->rot_model: %d\n", __func__, __LINE__, rot->caps->rot_model); + + return r; +} + +static int +grbl_net_open(ROT *rot, int port) +{ + //network_open(&rot->state.rotport, port); + + //rot_debug(RIG_DEBUG_ERR, "%s:%d network_fd: %d\n", __func__, __LINE__, (&rot->state.rotport)->fd); + rot_debug(RIG_DEBUG_ERR, "%s:%d \n", __func__, __LINE__); + + return 0; +} + +static int +grbltrk_rot_open(ROT *rot) +{ + int r = RIG_OK; + char host[128] = {0}; + //char ip[32]; + //int port; + + //rot_debug(RIG_DEBUG_ERR, "%s:%d rot->caps->rot_model: %d\n", __func__, __LINE__, rot->caps->rot_model); + if (rot->caps->rot_model == ROT_MODEL_GRBLTRK_SER) { + rot_debug(RIG_DEBUG_ERR, "%s:%d ctrl via serial\n", __func__, __LINE__); + } else if (rot->caps->rot_model == ROT_MODEL_GRBLTRK_NET) { + rot_get_conf(rot, TOK_PATHNAME, host); + rot_debug(RIG_DEBUG_ERR, "%s:%d ctrl via net, host [%s]\n", __func__, __LINE__, host); + grbl_net_open(rot, 23); + +#if 0 + if (sscanf(host, "%[^:]:%d", ip, &port) == 2) { + grbl_net_open(rot, ip, port); + } else { + grbl_net_open(rot, NULL, 0); /* use default ip & port */ + } +#endif + + } + + grbl_init(rot); + + //rot_debug(RIG_DEBUG_ERR, "%s:%d\n", __func__, __LINE__); + + return r; +} + +static void +grbl_net_close(ROT *rot) +{ + port_close(&rot->state.rotport, RIG_PORT_NETWORK); +} + +static int +grbltrk_rot_close(ROT *rot) +{ + int r = RIG_OK; + + if (rot->caps->rot_model == ROT_MODEL_GRBLTRK_SER) { + rot_debug(RIG_DEBUG_ERR, "%s:%d\n", __func__, __LINE__); + } else if (rot->caps->rot_model == ROT_MODEL_GRBLTRK_NET) { + rot_debug(RIG_DEBUG_ERR, "%s:%d\n", __func__, __LINE__); + grbl_net_close(rot); + } + + rot_debug(RIG_DEBUG_ERR, "%s:%d\n", __func__, __LINE__); + + return r; +} + + +/** CNCTRK implements essentially only the set position function. + it assumes there is a LinuxCNC running with the Axis GUI */ +const struct rot_caps grbltrk_serial_rot_caps = +{ + ROT_MODEL(ROT_MODEL_GRBLTRK_SER), + .model_name = "GRBLTRK via Serial", + .mfg_name = "BG5DIW", + .version = "20220515.0", + .copyright = "LGPL", + .status = RIG_STATUS_BETA, + .rot_type = ROT_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 = 400, + .retry = 0, + + + .min_az = 0, + .max_az = 360, + .min_el = 0, + .max_el = 90, + + .rot_init = grbltrk_rot_init, + .rot_open = grbltrk_rot_open, + + .set_position = grbltrk_rot_set_position, + .get_position = grbltrk_rot_get_position, + .set_conf = grbltrk_rot_set_conf, +}; + +const struct rot_caps grbltrk_net_rot_caps = +{ + ROT_MODEL(ROT_MODEL_GRBLTRK_NET), + .model_name = "GRBLTRK via Net", + .mfg_name = "BG5DIW", + .version = "20220515.0", + .copyright = "LGPL", + .status = RIG_STATUS_BETA, + .rot_type = ROT_TYPE_OTHER, + .port_type = RIG_PORT_NETWORK, /* RIG_PORT_NONE */ + //.port_type = RIG_PORT_NONE, /* RIG_PORT_NONE */ + + .write_delay = 0, + .post_write_delay = 0, + .timeout = 300, + .retry = 0, + //.retry = 3, + + + .min_az = 0, + .max_az = 360, + .min_el = 0, + .max_el = 90, + + .rot_init = grbltrk_rot_init, + .rot_open = grbltrk_rot_open, + .rot_close = grbltrk_rot_close, + + .set_position = grbltrk_rot_set_position, + .get_position = grbltrk_rot_get_position, + .set_conf = grbltrk_rot_set_conf, +}; + + +/* ************************************************************************* */ + +DECLARE_INITROT_BACKEND(grbltrk) +{ + rig_debug(RIG_DEBUG_VERBOSE, "%s: _init called\n", __func__); + + //rot_debug(RIG_DEBUG_ERR, "%s: _init called\n", __func__); + + rot_register(&grbltrk_serial_rot_caps); + + rot_register(&grbltrk_net_rot_caps); + + return RIG_OK; +} diff --git a/src/rot_reg.c b/src/rot_reg.c index 1300b36b..aeebf322 100644 --- a/src/rot_reg.c +++ b/src/rot_reg.c @@ -90,6 +90,7 @@ DEFINE_INITROT_BACKEND(indi); #if defined(ANDROID) || defined(__ANDROID__) DEFINE_INITROT_BACKEND(androidsensor); #endif +DEFINE_INITROT_BACKEND(grbltrk); //! @endcond /** @@ -137,6 +138,7 @@ static struct #if defined(ANDROID) || defined(__ANDROID__) { ROT_ANDROIDSENSOR, ROT_BACKEND_ANDROIDSENSOR, ROT_FUNCNAMA(androidsensor) }, #endif + { ROT_GRBLTRK, ROT_BACKEND_GRBLTRK, ROT_FUNCNAMA(grbltrk) }, { 0, NULL }, /* end */ }; commit 17539bb68adabb1f8e08247a87f6c2042345699b Author: Mike Black W9MDB <mdb...@ya...> Date: Mon May 16 22:56:16 2022 -0500 Add VFO UP DOWN to PowerSDR diff --git a/rigs/kenwood/flex6xxx.c b/rigs/kenwood/flex6xxx.c index 01762e15..339ac430 100644 --- a/rigs/kenwood/flex6xxx.c +++ b/rigs/kenwood/flex6xxx.c @@ -42,7 +42,7 @@ #define F6K_LEVEL_ALL (RIG_LEVEL_SLOPE_HIGH|RIG_LEVEL_SLOPE_LOW|RIG_LEVEL_KEYSPD) #define F6K_VFO (RIG_VFO_A|RIG_VFO_B) -#define POWERSDR_VFO_OP (RIG_OP_BAND_UP|RIG_OP_BAND_DOWN) +#define POWERSDR_VFO_OP (RIG_OP_BAND_UP|RIG_OP_BAND_DOWN|RIG_OP_UP|RIG_OP_DOWN) #define F6K_ANTS (RIG_ANT_1|RIG_ANT_2|RIG_ANT_3) @@ -1231,7 +1231,7 @@ const struct rig_caps powersdr_caps = RIG_MODEL(RIG_MODEL_POWERSDR), .model_name = "PowerSDR/Thetis", .mfg_name = "FlexRadio/ANAN", - .version = "20220512.0", + .version = "20220516.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, commit 0849172dc55f2768ee17bad8d8708fcaf65189d3 Author: Mike Black W9MDB <mdb...@ya...> Date: Sun May 15 22:29:43 2022 -0500 Add elapsed time to rig_vfo_op diff --git a/src/rig.c b/src/rig.c index 2ca3123c..99a269c1 100644 --- a/src/rig.c +++ b/src/rig.c @@ -2756,6 +2756,7 @@ int HAMLIB_API rig_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) { ptt = RIG_PTT_ON; } + #endif /* fall through */ @@ -5842,6 +5843,7 @@ int HAMLIB_API rig_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op) vfo_t curr_vfo; ENTERFUNC; + ELAPSED1; if (CHECK_RIG_ARG(rig)) { @@ -5861,12 +5863,14 @@ int HAMLIB_API rig_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op) || vfo == rig->state.current_vfo) { retcode = caps->vfo_op(rig, vfo, op); + ELAPSED2; RETURNFUNC(retcode); } if (!caps->set_vfo) { rig_debug(RIG_DEBUG_WARN, "%s: no set_vfo\n", __func__); + ELAPSED2; RETURNFUNC(-RIG_ENAVAIL); } @@ -5890,6 +5894,7 @@ int HAMLIB_API rig_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op) retcode = rc2; } + ELAPSED2; RETURNFUNC(retcode); } commit 4d8e64acfe6996071feaf2d166ec0c8611278320 Author: Mike Black W9MDB <mdb...@ya...> Date: Sun May 15 11:53:38 2022 -0500 Stop mapping MICDATA ptt to PTT -- there should be no reason to do this and it was interfering with rigctld and MICDATA rigs TS480/590/890/990 https://github.com/Hamlib/Hamlib/issues/998 diff --git a/src/rig.c b/src/rig.c index 5369d55b..2ca3123c 100644 --- a/src/rig.c +++ b/src/rig.c @@ -2751,10 +2751,12 @@ int HAMLIB_API rig_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) switch (rig->state.pttport.type.ptt) { case RIG_PTT_RIG: +#if 0 // https://github.com/Hamlib/Hamlib/issues/998 -- this is interfering with rigctld and MICDATA rigs if (ptt == RIG_PTT_ON_MIC || ptt == RIG_PTT_ON_DATA) { ptt = RIG_PTT_ON; } +#endif /* fall through */ case RIG_PTT_RIG_MICDATA: diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c index 5740763f..de1aeb65 100644 --- a/tests/rigctl_parse.c +++ b/tests/rigctl_parse.c @@ -2448,6 +2448,7 @@ declare_proto_rig(set_ptt) CHKSCN1ARG(sscanf(arg1, "%d", &scr)); ptt = scr; + rig_debug(RIG_DEBUG_VERBOSE, "%s: set_ptt ptt=%d\n", __func__, ptt); /* * We allow RIG_PTT_ON_MIC and RIG_PTT_ON_DATA arriving from netrigctl. @@ -2462,11 +2463,16 @@ declare_proto_rig(set_ptt) case RIG_PTT_ON_MIC: case RIG_PTT_ON_DATA: + // No longer map this -- is confusing rigctld and MICDATA rigs + // https://github.com/Hamlib/Hamlib/issues/998 +#if 0 // map to a legal value - if (rig->state.pttport.type.ptt != RIG_PTT_RIG_MICDATA) + if (rig->caps->ptt_type != RIG_PTT_RIG_MICDATA) { + rig_debug(RIG_DEBUG_ERR, "%s: pttport.type.ptt=%d\n", __func__, rig->state.pttport.type.ptt); ptt = RIG_PTT_ON; } +#endif break; @@ -2482,6 +2488,7 @@ declare_proto_rig(set_ptt) RETURNFUNC(-RIG_EINVAL); } + rig_debug(RIG_DEBUG_ERR, "%s: ptt=%d\n", __func__, ptt); RETURNFUNC(rig_set_ptt(rig, vfo, ptt)); } commit ecd78e73542b283f9f691d5da0bafd9920941883 Author: Mike Black W9MDB <mdb...@ya...> Date: Sun May 15 11:26:29 2022 -0500 Clean up simkenwood warnings diff --git a/simulators/simkenwood.c b/simulators/simkenwood.c index d31369ad..ec1e9dc3 100644 --- a/simulators/simkenwood.c +++ b/simulators/simkenwood.c @@ -199,12 +199,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), "FA%011d;", freqa); - write(fd, buf, strlen(buf)); + n = write(fd, buf, strlen(buf)); } else if (strncmp(buf, "FA", 2) == 0) { @@ -217,18 +217,18 @@ int main(int argc, char *argv[]) else if (strncmp(buf, "AI;", 3) == 0) { SNPRINTF(buf, sizeof(buf), "AI0;"); - write(fd, buf, strlen(buf)); + n = write(fd, buf, strlen(buf)); } else if (strncmp(buf, "SA;", 3) == 0) { SNPRINTF(buf, sizeof(buf), "SA0;"); - write(fd, buf, strlen(buf)); + n = write(fd, buf, strlen(buf)); } else if (strncmp(buf, "MD;", 3) == 0) { SNPRINTF(buf, sizeof(buf), "MD%d;", modeA); // not worried about modeB yet for simulator - write(fd, buf, strlen(buf)); + n = write(fd, buf, strlen(buf)); } else if (strncmp(buf, "MD", 2) == 0) { @@ -237,7 +237,7 @@ int main(int argc, char *argv[]) else if (strncmp(buf, "FL;", 3) == 0) { SNPRINTF(buf, sizeof(buf), "FL%03d;", filternum); - write(fd, buf, strlen(buf)); + n = write(fd, buf, strlen(buf)); } else if (strncmp(buf, "FL", 2) == 0) { @@ -246,7 +246,7 @@ int main(int argc, char *argv[]) else if (strncmp(buf, "DA;", 3) == 0) { SNPRINTF(buf, sizeof(buf), "DA%d;", datamode); - write(fd, buf, strlen(buf)); + n = write(fd, buf, strlen(buf)); } else if (strncmp(buf, "DA", 2) == 0) { commit 4c2ab11c561ef3e9d745a883081f6aac3077a659 Author: Mike Black W9MDB <mdb...@ya...> Date: Sun May 15 10:03:40 2022 -0500 Move longlat2locator and locator2longlat to rig.h from rotator.h These are more generic now than just for rotator use diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h index d2ceb0fb..b6582aef 100644 --- a/include/hamlib/rig.h +++ b/include/hamlib/rig.h @@ -3391,14 +3391,14 @@ extern HAMLIB_EXPORT(int) rig_password(RIG *rig, const char *key1); extern HAMLIB_EXPORT(void) rig_password_generate_secret(char *pass, char result[HAMLIB_SECRET_LENGTH + 1]); -//extern HAMLIB_EXPORT(int) -int longlat2locator HAMLIB_PARAMS((double longitude, +extern HAMLIB_EXPORT(int) +longlat2locator HAMLIB_PARAMS((double longitude, double latitude, char *locator_res, int pair_count)); -//extern HAMLIB_EXPORT(int) -int locator2longlat HAMLIB_PARAMS((double *longitude, +extern HAMLIB_EXPORT(int) +locator2longlat HAMLIB_PARAMS((double *longitude, double *latitude, const char *locator)); diff --git a/include/hamlib/rotator.h b/include/hamlib/rotator.h index 626d63b2..7eb04012 100644 --- a/include/hamlib/rotator.h +++ b/include/hamlib/rotator.h @@ -751,6 +751,7 @@ distance_long_path HAMLIB_PARAMS((double distance)); extern HAMLIB_EXPORT(double) azimuth_long_path HAMLIB_PARAMS((double azimuth)); +#if 0 extern HAMLIB_EXPORT(int) longlat2locator HAMLIB_PARAMS((double longitude, double latitude, @@ -761,6 +762,7 @@ extern HAMLIB_EXPORT(int) locator2longlat HAMLIB_PARAMS((double *longitude, double *latitude, const char *locator)); +#endif extern HAMLIB_EXPORT(double) dms2dec HAMLIB_PARAMS((int degrees, commit 82a915563b0f9ba3f2c22caa63bee84b9c6d27c9 Author: Mike Black W9MDB <mdb...@ya...> Date: Sun May 15 09:31:09 2022 -0500 Remove debug from barrett.c to prevent compilation warning diff --git a/rigs/barrett/barrett.c b/rigs/barrett/barrett.c index db9beec1..3e212358 100644 --- a/rigs/barrett/barrett.c +++ b/rigs/barrett/barrett.c @@ -163,8 +163,8 @@ int barrett_transaction(RIG *rig, char *cmd, int expected, char **result) strtok_r(*result, "\r", &dummy); } - rig_debug(RIG_DEBUG_VERBOSE, "%s: returning result=%s\n", __func__, - *result); + //rig_debug(RIG_DEBUG_VERBOSE, "%s: returning result=%s\n", __func__, + // *result); } else { commit d54f5a1c34fc7a5714f86d5a785fe7851caea820 Author: Mike Black W9MDB <mdb...@ya...> Date: Sun May 15 09:17:51 2022 -0500 Speed up yaesu compilation a bit when using -j switch in make by moving yaesu.c up the list diff --git a/rigs/yaesu/Makefile.am b/rigs/yaesu/Makefile.am index ad71aec0..da537a66 100644 --- a/rigs/yaesu/Makefile.am +++ b/rigs/yaesu/Makefile.am @@ -14,6 +14,6 @@ NEWCATSRC = newcat.c newcat.h ft450.c ft450.h ft950.c ft950.h ft991.c ft991.h \ ft891.c ft891.h ftdx101.c ftdx101.h ftdx101mp.c ft3000.c ftdx10.c noinst_LTLIBRARIES = libhamlib-yaesu.la -libhamlib_yaesu_la_SOURCES = $(YAESUSRC) $(NEWCATSRC) yaesu.c yaesu.h +libhamlib_yaesu_la_SOURCES = yaesu.c yaesu.h $(YAESUSRC) $(NEWCATSRC) EXTRA_DIST = README.ft890 README.ft920 Android.mk commit a518bdcaf1043cfe8c47c39ff38c31cab4de5227 Author: Mike Black W9MDB <mdb...@ya...> Date: Sun May 15 09:15:27 2022 -0500 Speed up icom compilation a bit when using -j switch in make by moving icom.c up the list diff --git a/rigs/icom/Makefile.am b/rigs/icom/Makefile.am index fc928be3..fbad2ffc 100644 --- a/rigs/icom/Makefile.am +++ b/rigs/icom/Makefile.am @@ -1,4 +1,4 @@ -ICOMSRC = ic706.c icr8500.c ic735.c ic775.c ic756.c \ +ICOMSRC = icom.c icom.h icom_defs.h frame.c frame.h ic706.c icr8500.c ic735.c ic775.c ic756.c \ ic275.c ic475.c ic1275.c ic820h.c ic821h.c \ icr7000.c ic910.c ic9100.c ic970.c ic725.c ic737.c ic718.c \ os535.c os456.c omni.c delta2.c ic92d.c \ @@ -9,7 +9,7 @@ ICOMSRC = ic706.c icr8500.c ic735.c ic775.c ic756.c \ ic707.c ic728.c ic751.c ic761.c \ ic78.c ic7800.c ic785x.c \ ic7000.c ic7100.c ic7200.c ic7300.c ic7600.c ic7610.c ic7700.c icf8101.c \ - icom.c icom.h icom_defs.h frame.c frame.h ic7300.h optoscan.c optoscan.h xiegu.c + ic7300.h optoscan.c optoscan.h xiegu.c noinst_LTLIBRARIES = libhamlib-icom.la libhamlib_icom_la_SOURCES = $(ICOMSRC) commit 3892bc41dc87dc8ff3a55097e1354f1edb4e9709 Author: Mike Black W9MDB <mdb...@ya...> Date: Sat May 14 22:13:17 2022 -0500 Remove form feed form rigctl_parse. Did not do what we need for node-red diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c index 80d35390..5740763f 100644 --- a/tests/rigctl_parse.c +++ b/tests/rigctl_parse.c @@ -1782,7 +1782,6 @@ readline_repeat: } } } - fprintf(fout, "\f"); // add a form feed for node-red tcp request to use as end-char fflush(fout); commit f16988d3638ddc9487171dcf2bc3f88fd489d888 Author: Mike Black W9MDB <mdb...@ya...> Date: Sat May 14 17:36:28 2022 -0500 Fix get_vfo_info prompt diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c index 7605cb08..80d35390 100644 --- a/tests/rigctl_parse.c +++ b/tests/rigctl_parse.c @@ -88,11 +88,12 @@ extern int read_history(); #define ARG_OUT3 0x20 #define ARG_IN4 0x40 #define ARG_OUT4 0x80 +#define ARG_OUT5 0x100 #define ARG_IN_LINE 0x4000 #define ARG_NOVFO 0x8000 #define ARG_IN (ARG_IN1|ARG_IN2|ARG_IN3|ARG_IN4) -#define ARG_OUT (ARG_OUT1|ARG_OUT2|ARG_OUT3|ARG_OUT4) +#define ARG_OUT (ARG_OUT1|ARG_OUT2|ARG_OUT3|ARG_OUT4|ARG_OUT5) static int chk_vfo_executed; char rigctld_password[64]; @@ -140,6 +141,7 @@ struct test_table const char *arg3; const char *arg4; const char *arg5; + const char *arg6; }; @@ -344,7 +346,7 @@ static struct test_table test_list[] = { 0x8f, "dump_state", ACTION(dump_state), ARG_OUT | ARG_NOVFO }, { 0xf0, "chk_vfo", ACTION(chk_vfo), ARG_NOVFO, "ChkVFO" }, /* rigctld only--check for VFO mode */ { 0xf2, "set_vfo_opt", ACTION(set_vfo_opt), ARG_NOVFO | ARG_IN, "Status" }, /* turn vfo option on/off */ - { 0xf3, "get_vfo_info", ACTION(get_vfo_info), ARG_NOVFO | ARG_IN1 | ARG_OUT4, "Freq", "Mode", "Width", "Split", "SatMode" }, /* get several vfo parameters at once */ + { 0xf3, "get_vfo_info", ACTION(get_vfo_info), ARG_IN1 | ARG_OUT5, "VFO", "Freq", "Mode", "Width", "Split", "SatMode" }, /* get several vfo parameters at once */ { 0xf5, "get_rig_info", ACTION(get_rig_info), ARG_NOVFO | ARG_OUT, "RigInfo" }, /* get several vfo parameters at once */ { 0xf4, "get_vfo_list", ACTION(get_vfo_list), ARG_OUT | ARG_NOVFO, "VFOs" }, { 0xf6, "get_modes", ACTION(get_modes), ARG_OUT | ARG_NOVFO, "Modes" }, @@ -1780,6 +1782,7 @@ readline_repeat: } } } + fprintf(fout, "\f"); // add a form feed for node-red tcp request to use as end-char fflush(fout); @@ -2316,11 +2319,11 @@ declare_proto_rig(get_vfo_info) if ((interactive && prompt) || (interactive && !prompt && ext_resp)) { - fprintf(fout, "%s: %.0f\n", cmd->arg1, freq); - fprintf(fout, "%s: %s\n", cmd->arg2, modestr); - fprintf(fout, "%s: %d\n", cmd->arg3, (int)width); - fprintf(fout, "%s: %d\n", cmd->arg4, (int)split); - fprintf(fout, "%s: %d\n", cmd->arg5, (int)satmode); + fprintf(fout, "%s: %.0f\n", cmd->arg2, freq); + fprintf(fout, "%s: %s\n", cmd->arg3, modestr); + fprintf(fout, "%s: %d\n", cmd->arg4, (int)width); + fprintf(fout, "%s: %d\n", cmd->arg5, (int)split); + fprintf(fout, "%s: %d\n", cmd->arg6, (int)satmode); } else { commit 51cbf4af7ab7b73e7efe5213024c35865934cc91 Author: Mike Black W9MDB <mdb...@ya...> Date: Fri May 13 22:29:13 2022 -0500 For the FT-991 do not call get_narrow when mode is C4FM, PKTFM, or PKTFMN diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 9269c5b1..3d975a8d 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -9156,10 +9156,12 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) } /* end if is_ft891 */ else if (is_ft991) { - if ((narrow = get_narrow(rig, vfo)) < 0) + // some modes are fixed and can't be queried with "NA0" + if (mode != RIG_MODE_C4FM && mode != RIG_MODE_PKTFM && mode != RIG_MODE_PKTFMN && (narrow = get_narrow(rig, vfo)) < 0) { RETURNFUNC(-RIG_EPROTO); } + narrow = 0; switch (mode) { commit 67a7a613a0f42c97d48230528d4f0227bdbfe2d0 Author: Mike Black W9MDB <mdb...@ya...> Date: Fri May 13 17:07:59 2022 -0500 Update NEWS with an async example diff --git a/NEWS b/NEWS index 964a2342..7871bc04 100644 --- a/NEWS +++ b/NEWS @@ -15,7 +15,7 @@ Version 5.x -- future Version 4.6 Version 4.5 - * 2022-04-XX + * 2022-05-XX * enum meter_level_e is deprecated and will be removed in 4.6 * Add SDRPlay SDRUno rig -- can now use Data/Pkt in WSJTX * Add ability to use cat_string to FLRig via the "w" and "W" commands @@ -29,6 +29,10 @@ Version 4.5 rigctld -A will produce a consistent shared key for any specific password that can used in \password and rig_set_password TBD The shared key can also be placed in .hamlib_settings * Asynchronous rig data output handling to support transceive and spectrum data. Mikael, OH3BHX + Example for the IC-7300 to multicast on port 20001 and provide async rig information + rigctld --port=20001 --model=3073 --serial-speed=115200 --rig-file=/dev/serial/... --set-conf=rts_state=OFF --set-conf=dtr_state=OFF --multicast-addr=224.0.0.1 --multicast-port=20001 --set-conf=async=1 + +Also, spectrum data output needs to be enabled with: \set_func SPECTRUM 1 * See new set_conf option async for some Icom rigs * Multicast UDP packet output for asynchronous data. Mikael, OH3BHX * Rig state poll routine to serve commonly used data like frequency and mode from cache. Mikael, OH3BHX commit cb8b7c185c80d1fcf4687df3689f25ab7df6879d Author: Mike Black W9MDB <mdb...@ya...> Date: Fri May 13 16:53:22 2022 -0500 Correct compile warning in settings.c https://github.com/Hamlib/Hamlib/issues/985 diff --git a/src/settings.c b/src/settings.c index abe36289..40add6a7 100644 --- a/src/settings.c +++ b/src/settings.c @@ -1113,8 +1113,9 @@ HAMLIB_EXPORT(int) rig_settings_load_all(char *settings_file) if (strcmp(s, "sharedkey") == 0) { - //sharedkey = strdup(v); - //rig_debug(RIG_DEBUG_TRACE, "%s: settings_file=%s, shared_key=%s\n", __func__, settings_file, sharedkey); + char *sharedkey = strdup(v); + rig_debug(RIG_DEBUG_TRACE, "%s: settings_file=%s, shared_key=%s\n", __func__, settings_file, sharedkey); + free(sharedkey); } } commit 6f9d057162a448a891016fc86606ecdfc33fc50b Author: Mike Black W9MDB <mdb...@ya...> Date: Fri May 13 16:50:13 2022 -0500 astyle files getting ready for release diff --git a/rigs/dummy/dummy.c b/rigs/dummy/dummy.c index d7961feb..0db6be3b 100644 --- a/rigs/dummy/dummy.c +++ b/rigs/dummy/dummy.c @@ -519,16 +519,17 @@ static int dummy_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) vfo = vfo_fixup(rig, vfo, rig->state.cache.split); - if (width == RIG_PASSBAND_NOCHANGE) { - switch(vfo) + if (width == RIG_PASSBAND_NOCHANGE) + { + switch (vfo) { case RIG_VFO_MAIN: - case RIG_VFO_A: width = priv->vfo_a.width;break; + case RIG_VFO_A: width = priv->vfo_a.width; break; case RIG_VFO_SUB: - case RIG_VFO_B: width = priv->vfo_b.width;break; + case RIG_VFO_B: width = priv->vfo_b.width; break; - case RIG_VFO_C: width = priv->vfo_c.width;break; + case RIG_VFO_C: width = priv->vfo_c.width; break; } } diff --git a/rigs/dummy/flrig.c b/rigs/dummy/flrig.c index a818d705..7e0904c5 100644 --- a/rigs/dummy/flrig.c +++ b/rigs/dummy/flrig.c @@ -806,12 +806,14 @@ static int flrig_open(RIG *rig) int v1 = 0, v2 = 0, v3 = 0, v4 = 0; sscanf(value, "%d.%d.%d.%d", &v1, &v2, &v3, &v4); char version[32]; - sprintf(version,"%03d%03d%03d%03d",v1,v2,v3,v4); + sprintf(version, "%03d%03d%03d%03d", v1, v2, v3, v4); int iversion = 0; - sscanf(version,"%d", &iversion); - rig_debug(RIG_DEBUG_VERBOSE, "%s: version='%s'=%d\n", __func__, version, iversion); + sscanf(version, "%d", &iversion); + rig_debug(RIG_DEBUG_VERBOSE, "%s: version='%s'=%d\n", __func__, version, + iversion); priv->has_verify_cmds = 0; + if (iversion >= 1003054000) // 1.3.54 or greater { priv->has_verify_cmds = 1; @@ -869,10 +871,12 @@ static int flrig_open(RIG *rig) /* see if get_bwA is available */ retval = flrig_transaction(rig, "rig.get_bwA", NULL, value, sizeof(value)); + if (retval == RIG_ENAVAIL) // must not have it { priv->has_get_bwA = 0; - rig_debug(RIG_DEBUG_VERBOSE, "%s: get_bwA is not available=%s\n", __func__, value); + rig_debug(RIG_DEBUG_VERBOSE, "%s: get_bwA is not available=%s\n", __func__, + value); } else { @@ -882,10 +886,12 @@ static int flrig_open(RIG *rig) /* see if set_bwA is available */ retval = flrig_transaction(rig, "rig.set_bwA", NULL, value, sizeof(value)); + if (retval == RIG_ENAVAIL) // must not have it { priv->has_set_bwA = 0; - rig_debug(RIG_DEBUG_VERBOSE, "%s: set_bwA is not available=%s\n", __func__, value); + rig_debug(RIG_DEBUG_VERBOSE, "%s: set_bwA is not available=%s\n", __func__, + value); } else { @@ -1520,9 +1526,13 @@ static int flrig_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) width); if (vfo == RIG_VFO_A) - retval = flrig_transaction(rig, "rig.set_bwA", cmd_arg, NULL, 0); + { + retval = flrig_transaction(rig, "rig.set_bwA", cmd_arg, NULL, 0); + } else - retval = flrig_transaction(rig, "rig.set_bwB", cmd_arg, NULL, 0); + { + retval = flrig_transaction(rig, "rig.set_bwB", cmd_arg, NULL, 0); + } if (retval < 0) { @@ -2335,7 +2345,7 @@ static int flrig_get_ext_parm(RIG *rig, token_t token, value_t *val) RETURNFUNC(RIG_OK); } -HAMLIB_EXPORT(int) flrig_cat_string (RIG *rig, const char *arg) +HAMLIB_EXPORT(int) flrig_cat_string(RIG *rig, const char *arg) { int retval; char cmd_arg[MAXARGLEN]; diff --git a/rigs/dummy/netrigctl.c b/rigs/dummy/netrigctl.c index d8c55122..0c527435 100644 --- a/rigs/dummy/netrigctl.c +++ b/rigs/dummy/netrigctl.c @@ -2640,7 +2640,9 @@ int netrigctl_password(RIG *rig, const char *key1) rig_debug(RIG_DEBUG_VERBOSE, "%s: key1=%s\n", __func__, key1); SNPRINTF(cmdbuf, sizeof(cmdbuf), "\\password %s\n", key1); retval = netrigctl_transaction(rig, cmdbuf, strlen(cmdbuf), buf); - if (retval != RIG_OK) retval = -RIG_EPROTO; + + if (retval != RIG_OK) { retval = -RIG_EPROTO; } + RETURNFUNC(retval); } diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index d1acd783..01451981 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -678,12 +678,13 @@ int icom_init(RIG *rig) priv->filter = RIG_PASSBAND_NOCHANGE; priv->x25cmdfails = 0; priv->x1cx03cmdfails = 0; + // we can add rigs here that will never use the 0x25 cmd // some like the 751 don't even reject the command and have to time out if (rig->caps->rig_model == RIG_MODEL_IC706 - || rig->caps->rig_model == RIG_MODEL_IC706MKII - || rig->caps->rig_model == RIG_MODEL_IC706MKIIG - || rig->caps->rig_model == RIG_MODEL_IC751 + || rig->caps->rig_model == RIG_MODEL_IC706MKII + || rig->caps->rig_model == RIG_MODEL_IC706MKIIG + || rig->caps->rig_model == RIG_MODEL_IC751 ) { priv->x25cmdfails = 1; @@ -5366,8 +5367,8 @@ int icom_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq) // we can add rigs we kn... [truncated message content] |