[Hamlib-commits] Hamlib -- Ham radio control libraries branch master updated. cb2c757c6230767fd1191
Library to control radio transceivers and receivers
Brought to you by:
n0nb
From: Michael B. <mdb...@us...> - 2020-09-13 13:30:41
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Hamlib -- Ham radio control libraries". The branch, master has been updated via cb2c757c6230767fd1191aed47c6d11a9c1900b3 (commit) via fb9acd8b5eda50a0a89d3ac0f756f703317d48bc (commit) via 1dd62dc5d32333ab01d2b912b841175e4fd8a844 (commit) via aeaa96bc3b471c8c09e86a1e436e14be92c49019 (commit) via 6e45a7ba785cccf756f086617f246fd0e3e5be36 (commit) via 83667f4c65bf3b2ccb685c979734a1710b811695 (commit) via d47987db8502aa0ab486df1bb32780c0d8d37739 (commit) via 03ad7a953f4a31ab4b5c78a8394d6a5d62604801 (commit) via 54c522ef99014c0085d8f2ac9697002a4cf3900d (commit) from 975824c61856af7be12459f60296b5fbf15ced00 (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 cb2c757c6230767fd1191aed47c6d11a9c1900b3 Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Sep 13 08:30:10 2020 -0500 Remove TODO files as they have been replaced with github issues diff --git a/TODO b/TODO deleted file mode 100644 index 9f1abb2b..00000000 --- a/TODO +++ /dev/null @@ -1,61 +0,0 @@ -hamlib - (C) Frank Singleton 2000 - - -GENERAL PROJECT TODO --------------------- - -1. Implement more interfaces/backends [ongoing] -2. Write More extensive Test Suites [ongoing] -3. Document API's [ongoing] -4. Document Limitations/Assumptions. -6. Encourage people to build cool GUI's using - our libs. (any GTK wiz's out here ..) -8. More safe checking during function calls (in rig_* wrappers). -13. ~/.hamlibrc and /etc/hamlibrc preferences file -14. Write the list of all functions that should be in the API -18. rewrite the post_write_delay. Active delay is a waste of cycles! [need test] -23. add support in the API for additional filters, DSP bandpass control -25. Write aclocal .m4 macro helpers for autoconf support [need test] -26. Write rig protocol simulator so no hardware is involved with Hamlib testing -27. complete memory bank support -28. add rig_srch_ctcss, rig_srch_dcs, etc. -29. emulate get_stuff (caching) if backend has no support for it -30. Write perl/python/etc. modules [ongoing] - -DONE ----- - -5. Build top level Makefile for maintenance - -7. Move common routines to a common area - and avoid duplication. - -9. If read from rig takes > "n" seconds, then no longer - block on read, just return error. - -10. Improve Makefiles (autoconf?) - -12. Add general rig capabilities handling. see rig.h - -15. Handle retransmissions (no more than n) if timeout (->backends) -16. Write .spec (rpm) and .deb (debian) package files - -17a. Add support for a configurable debug level (none, function calls, - packet traces) - -17b. In serial.c (and non serial too), use buffered IO instead of read/write, - for better performance. Use flushing with fwrite. - -18. Get Git updates mailed to our hamlib-cvs-digest list -19. specify how to access Reverse modes (CWR, RTTYR). through set_mode? -22. handle nicely different versions of same rig coming for - ITU region1/region2 ham band (-> freq ranges in capabilities) - -11. Add some scanning routines [ 1.1.2? ] - -20. adapt API include files to support C++ (__BEGIN_DECLS/__END_DECLS, etc.) -21. grab cygwin and test portability under Win32 (what about MacOS?) -24. Should Hamlib (the library itself) be LGPL'ed ? -31. Add some antenna tuner support -33. Merge dumpmem/dumpcaps into rigctl -32. Document C++/tcltk bindings, complete Hamlib API documentation using doxygen diff --git a/TODO.skeleton b/TODO.skeleton deleted file mode 100644 index 1f7dac7c..00000000 --- a/TODO.skeleton +++ /dev/null @@ -1,15 +0,0 @@ -hamlib - (C) Frank Singleton 2000 - -TODO.<your rig> - (C) <your name> 2000 -This shared library provides an API for communicating -via serial interface to a <your rig> using the <your interface> interface. - -TODO ----- - -1. Complete pcodes -2. Write More extensive Test Suite -3. Document API -4. Document Limitations/Assumptions. -5. - commit fb9acd8b5eda50a0a89d3ac0f756f703317d48bc Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Sep 13 08:08:23 2020 -0500 Adding phpdemo diff --git a/bindings/phpdemo.php b/bindings/phpdemo.php new file mode 100644 index 00000000..a1eb33aa --- /dev/null +++ b/bindings/phpdemo.php @@ -0,0 +1,41 @@ +<?php +// This example needs to be improved by adding get_freq, set_freq functions and such. +// Need to parse the returns from rigctl +print("Hamlib demo\n"); +$descriptorspec = array( + 0 => array("pipe", "r"), // stdin is a pipe that the child will read from + 1 => array("pipe", "w"), // stdout is a pipe that the child will write to + 2 => array("file", "/tmp/error-output.txt", "a") // stderr is a file to write to +); + +$cmd = "rigctl -m 2"; +$process = proc_open($cmd, $descriptorspec, $pipes); + +if (is_resource($process)) { + // $pipes now looks like this: + // 0 => writeable handle connected to child stdin + // 1 => readable handle connected to child stdout + // Any error output will be appended to /tmp/error-output.txt + + echo fread($pipes[1], 32); + + echo "Main Freq: "; + fwrite($pipes[0], "f Main\n"); + fread($pipes[1],32); + echo fread($pipes[1],64); + echo "\n"; + echo "=====\n"; + + fwrite($pipes[0], "f Sub\n"); + echo "Sub Freq:" ; + echo fread($pipes[1],32); + echo "\n"; + + fclose($pipes[0]); + fclose($pipes[1]); + + $return_value = proc_close($process); + + echo "command returned $return_value\n"; +} +?> commit 1dd62dc5d32333ab01d2b912b841175e4fd8a844 Merge: d47987db aeaa96bc Author: Michael Black <mdb...@ya...> Date: Sat Sep 12 23:42:39 2020 -0500 Merge pull request #376 from mdblack98/master Fix collisions between PARM, LEVEL, FUNC, TOKEN commit aeaa96bc3b471c8c09e86a1e436e14be92c49019 Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Sep 12 21:37:10 2020 -0700 Fix icom_get_parm to eliminate collisions diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index b25576ab..6fcd4f10 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -2217,7 +2217,7 @@ int icom_set_cmd(RIG *rig, vfo_t vfo, struct cmdparams *par, value_t val) to_bcd_be(&cmdbuf[cmdlen], (int)(val.f * 255.0), (cmdlen * 2)); break; - case CMD_DAT_TIM: + case CMD_DAT_TIM: // returned as seconds since midnight to_bcd_be(&cmdbuf[cmdlen], ((((int)val.f / 3600) * 100) + (((int)val.f / 60) % 60)), (par->datlen * 2)); break; @@ -5628,7 +5628,7 @@ int icom_get_parm(RIG *rig, setting_t parm, value_t *val) for (i = 0; cmd && cmd[i].id.s != 0; i++) { - if (cmd[i].id.s == parm) + if (cmd[i].cmdparamtype == CMD_PARAM_TYPE_PARM && cmd[i].id.s == parm) { return icom_get_cmd(rig, RIG_VFO_NONE, (struct cmdparams *)&cmd[i], val); } diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h index a1e1903c..9c23d651 100644 --- a/rigs/icom/icom.h +++ b/rigs/icom/icom.h @@ -31,7 +31,7 @@ #include <sys/time.h> #endif -#define BACKEND_VER "20200911" +#define BACKEND_VER "20200912" /* * defines used by comp_cal_str in rig.c commit 6e45a7ba785cccf756f086617f246fd0e3e5be36 Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Sep 12 14:26:57 2020 -0700 Fix ic7300 VOXDELAY and other extcmd structures diff --git a/rigs/icom/ic7100.c b/rigs/icom/ic7100.c index 5320c55e..42dce0ee 100644 --- a/rigs/icom/ic7100.c +++ b/rigs/icom/ic7100.c @@ -108,11 +108,11 @@ int ic7100_tokens[] = { TOK_DSTAR_CODE, TOK_DSTAR_DSQL, TOK_DSTAR_CALL_SIGN, TOK struct cmdparams ic7100_extcmds[] = { - { {.s = RIG_PARM_BEEP}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x03}, CMD_DAT_BOL, 1 }, - { {.s = RIG_PARM_BACKLIGHT}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x04}, CMD_DAT_LVL, 2 }, - { {.s = RIG_PARM_KEYLIGHT}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x05}, CMD_DAT_LVL, 2 }, - { {.s = RIG_PARM_TIME}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x21}, CMD_DAT_TIM, 2 }, - { {.s = RIG_LEVEL_VOXDELAY}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x65}, CMD_DAT_INT, 1 }, + { {.s = RIG_PARM_BEEP}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x03}, CMD_DAT_BOL, 1 }, + { {.s = RIG_PARM_BACKLIGHT}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x04}, CMD_DAT_LVL, 2 }, + { {.s = RIG_PARM_KEYLIGHT}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x05}, CMD_DAT_LVL, 2 }, + { {.s = RIG_PARM_TIME}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x21}, CMD_DAT_TIM, 2 }, + { {.s = RIG_LEVEL_VOXDELAY}, CMD_PARAM_TYPE_LEVEL, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x65}, CMD_DAT_INT, 1 }, { {.s = RIG_PARM_NONE} } }; diff --git a/rigs/icom/ic7300.c b/rigs/icom/ic7300.c index 9ce7b994..68987aef 100644 --- a/rigs/icom/ic7300.c +++ b/rigs/icom/ic7300.c @@ -62,7 +62,7 @@ struct cmdparams ic7300_extcmds[] = { {.s = RIG_PARM_BEEP}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x23}, CMD_DAT_BOL, 1 }, { {.s = RIG_PARM_BACKLIGHT}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x81}, CMD_DAT_LVL, 2 }, { {.s = RIG_PARM_TIME}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x95}, CMD_DAT_TIM, 2 }, - { {.s = RIG_LEVEL_VOXDELAY}, CMD_PARAM_TYPE_LEVEL, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x03, 0x59}, CMD_DAT_INT, 1 }, + { {.s = RIG_LEVEL_VOXDELAY}, CMD_PARAM_TYPE_LEVEL, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x59}, CMD_DAT_INT, 1 }, { {.s = RIG_PARM_NONE} } }; diff --git a/rigs/icom/ic7600.c b/rigs/icom/ic7600.c index f39e3e26..1b7add09 100644 --- a/rigs/icom/ic7600.c +++ b/rigs/icom/ic7600.c @@ -55,10 +55,10 @@ struct cmdparams ic7600_extcmds[] = { - { {.s = RIG_PARM_BEEP}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x59}, CMD_DAT_BOL, 1 }, - { {.s = RIG_PARM_BACKLIGHT}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x38}, CMD_DAT_LVL, 2 }, - { {.s = RIG_PARM_TIME}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x54}, CMD_DAT_TIM, 2 }, - { {.s = RIG_LEVEL_VOXDELAY}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x67}, CMD_DAT_INT, 1 }, + { {.s = RIG_PARM_BEEP}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x59}, CMD_DAT_BOL, 1 }, + { {.s = RIG_PARM_BACKLIGHT}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x38}, CMD_DAT_LVL, 2 }, + { {.s = RIG_PARM_TIME}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x54}, CMD_DAT_TIM, 2 }, + { {.s = RIG_LEVEL_VOXDELAY}, CMD_PARAM_TYPE_LEVEL, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x67}, CMD_DAT_INT, 1 }, { {.s = RIG_PARM_NONE} } }; diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 68497030..b25576ab 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -2700,13 +2700,16 @@ int icom_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) const struct cmdparams *cmd = priv->extcmds; int i; + for (i = 0; cmd && cmd[i].id.s != 0; i++) { + rig_debug(RIG_DEBUG_TRACE, "%s: i=%d\n", __func__, i); if (cmd[i].cmdparamtype == CMD_PARAM_TYPE_LEVEL && cmd[i].id.s == level) { return icom_get_cmd(rig, vfo, (struct cmdparams *)&cmd[i], val); } } + rig_debug(RIG_DEBUG_TRACE, "%s: no extcmd found\n", __func__); rs = &rig->state; commit 83667f4c65bf3b2ccb685c979734a1710b811695 Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Sep 12 11:21:33 2020 -0500 Added CMD_PARAM_TYPE values for icom rigs to distinguish the different ext cmd types https://github.com/Hamlib/Hamlib/issues/373 diff --git a/rigs/icom/ic7300.c b/rigs/icom/ic7300.c index 1cdcd0d1..9ce7b994 100644 --- a/rigs/icom/ic7300.c +++ b/rigs/icom/ic7300.c @@ -59,15 +59,15 @@ struct cmdparams ic7300_extcmds[] = { - { {.s = RIG_PARM_BEEP}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x23}, CMD_DAT_BOL, 1 }, - { {.s = RIG_PARM_BACKLIGHT}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x81}, CMD_DAT_LVL, 2 }, - { {.s = RIG_PARM_TIME}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x95}, CMD_DAT_TIM, 2 }, + { {.s = RIG_PARM_BEEP}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x23}, CMD_DAT_BOL, 1 }, + { {.s = RIG_PARM_BACKLIGHT}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x81}, CMD_DAT_LVL, 2 }, + { {.s = RIG_PARM_TIME}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x95}, CMD_DAT_TIM, 2 }, + { {.s = RIG_LEVEL_VOXDELAY}, CMD_PARAM_TYPE_LEVEL, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x03, 0x59}, CMD_DAT_INT, 1 }, { {.s = RIG_PARM_NONE} } }; struct cmdparams ic7300_extlevels[] = { - { {.s = RIG_LEVEL_VOXDELAY}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x03, 0x59}, CMD_DAT_INT, 1 }, }; /* @@ -151,15 +151,11 @@ struct cmdparams ic7300_extlevels[] = struct cmdparams ic9700_extcmds[] = { - { {.s = RIG_PARM_BEEP}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x29}, CMD_DAT_BOL, 1 }, - { {.s = RIG_PARM_BACKLIGHT}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x52}, CMD_DAT_LVL, 2 }, - { {.s = RIG_PARM_SCREENSAVER}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x67}, CMD_DAT_INT, 1 }, - { {.s = RIG_PARM_NONE} } -}; - -struct cmdparams ic9700_extlevels[] = -{ - { {.s = RIG_LEVEL_VOXDELAY}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x03, 0x30}, CMD_DAT_INT, 1 }, + { {.s = RIG_PARM_BEEP}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x29}, CMD_DAT_BOL, 1 }, + { {.s = RIG_PARM_BACKLIGHT}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x52}, CMD_DAT_LVL, 2 }, + { {.s = RIG_PARM_SCREENSAVER}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x67}, CMD_DAT_INT, 1 }, + { {.s = RIG_LEVEL_VOXDELAY}, CMD_PARAM_TYPE_LEVEL, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x03, 0x30}, CMD_DAT_INT, 1 }, + { {0} } }; #define IC9700_STR_CAL { 7, \ @@ -233,7 +229,6 @@ static const struct icom_priv_caps IC7300_priv_caps = { .level = -1, .icom_level = 0 }, }, .extcmds = ic7300_extcmds, /* Custom op parameters */ - .extlevels = ic7300_extlevels, /* Custom parameters */ }; static const struct icom_priv_caps IC9700_priv_caps = @@ -251,7 +246,6 @@ static const struct icom_priv_caps IC9700_priv_caps = { .level = -1, .icom_level = 0 }, }, .extcmds = ic9700_extcmds, /* Custom op parameters */ - .extlevels = ic9700_extlevels, /* Custom op parameters */ }; static const struct icom_priv_caps IC705_priv_caps = @@ -269,7 +263,6 @@ static const struct icom_priv_caps IC705_priv_caps = { .level = -1, .icom_level = 0 }, }, .extcmds = ic7300_extcmds, /* Custom parameters */ - .extlevels = ic7300_extlevels, /* Custom parameters */ }; const struct rig_caps ic7300_caps = diff --git a/rigs/icom/ic756.c b/rigs/icom/ic756.c index 730b802d..95ae2684 100644 --- a/rigs/icom/ic756.c +++ b/rigs/icom/ic756.c @@ -64,11 +64,11 @@ struct cmdparams ic756pro_cmdparms[] = { - { {.s = RIG_PARM_BEEP}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x20}, CMD_DAT_BOL, 1 }, - { {.s = RIG_PARM_BACKLIGHT}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x09}, CMD_DAT_LVL, 2 }, - { {.s = RIG_PARM_TIME}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x16}, CMD_DAT_TIM, 2 }, - { {.s = RIG_LEVEL_VOXDELAY}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x60}, CMD_DAT_INT, 1 }, - { {.s = RIG_PARM_NONE} } + { {.s = RIG_PARM_BEEP}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x20}, CMD_DAT_BOL, 1 }, + { {.s = RIG_PARM_BACKLIGHT}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x09}, CMD_DAT_LVL, 2 }, + { {.s = RIG_PARM_TIME}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x16}, CMD_DAT_TIM, 2 }, + { {.s = RIG_LEVEL_VOXDELAY}, CMD_PARAM_TYPE_LEVEL, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x60}, CMD_DAT_INT, 1 }, + { {0} } }; #define IC756PRO_STR_CAL { 16, \ diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 275f59da..68497030 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -476,34 +476,34 @@ const struct confparams icom_ext_parms[] = const struct cmdparams icom_ext_cmd[] = { - { {.t = TOK_DSTAR_DSQL}, C_CTL_DIG, S_DIG_DSCSQL, SC_MOD_RW, 1, {0}, CMD_DAT_BOL, 1 }, - { {.t = TOK_DSTAR_CALL_SIGN}, C_CTL_DIG, S_DIG_DSCALS, SC_MOD_RW12, 2, {0}, CMD_DAT_BUF, 38 }, - { {.t = TOK_DSTAR_MESSAGE}, C_CTL_DIG, S_DIG_DSMESS, SC_MOD_RW12, 2, {0}, CMD_DAT_STR, 32 }, - { {.t = TOK_DSTAR_STATUS}, C_CTL_DIG, S_DIG_DSRSTS, SC_MOD_RW12, 2, {0}, CMD_DAT_BUF, 1 }, - { {.t = TOK_DSTAR_GPS_DATA}, C_CTL_DIG, S_DIG_DSGPSD, SC_MOD_RW12, 2, {0}, CMD_DAT_BUF, 52 }, - { {.t = TOK_DSTAR_GPS_MESS}, C_CTL_DIG, S_DIG_DSGPSM, SC_MOD_RW12, 2, {0}, CMD_DAT_STR, 52 }, - { {.t = TOK_DSTAR_CODE}, C_CTL_DIG, S_DIG_DSCSQL, SC_MOD_RW12, 2, {0}, CMD_DAT_FLT, 1 }, - { {.t = TOK_DSTAR_TX_DATA}, C_CTL_DSD, S_DSD_DSTXDT, SC_MOD_RW, 1, {0}, CMD_DAT_BUF, 30 }, - { {.t = TOK_DSTAR_MY_CS}, C_CTL_DVT, S_DVT_DSMYCS, SC_MOD_RW, 1, {0}, CMD_DAT_STR, 12 }, - { {.t = TOK_DSTAR_TX_CS}, C_CTL_DVT, S_DVT_DSTXCS, SC_MOD_RW, 1, {0}, CMD_DAT_STR, 24 }, - { {.t = TOK_DSTAR_TX_MESS}, C_CTL_DVT, S_DVT_DSTXMS, SC_MOD_RW, 1, {0}, CMD_DAT_STR, 20 }, - { {.t = TOK_DRIVE_GAIN}, C_CTL_LVL, S_LVL_DRIVE, SC_MOD_RW, 1, {0}, CMD_DAT_FLT, 2 }, - { {.t = TOK_DIGI_SEL_FUNC}, C_CTL_FUNC, S_FUNC_DIGISEL, SC_MOD_RW, 1, {0}, CMD_DAT_BOL, 1 }, - { {.t = TOK_DIGI_SEL_LEVEL}, C_CTL_LVL, S_LVL_DIGI, SC_MOD_RW, 1, {0}, CMD_DAT_FLT, 2 }, - { {.t = TOK_SCOPE_DAT}, C_CTL_SCP, S_SCP_DAT, SC_MOD_RD, 0, {0}, CMD_DAT_BUF, 481 }, - { {.t = TOK_SCOPE_STS}, C_CTL_SCP, S_SCP_STS, SC_MOD_RW, 0, {0}, CMD_DAT_BOL, 1 }, - { {.t = TOK_SCOPE_DOP}, C_CTL_SCP, S_SCP_DOP, SC_MOD_RW, 0, {0}, CMD_DAT_BOL, 1 }, - { {.t = TOK_SCOPE_MSS}, C_CTL_SCP, S_SCP_MSS, SC_MOD_RW, 0, {0}, CMD_DAT_BOL, 1 }, - { {.t = TOK_SCOPE_MOD}, C_CTL_SCP, S_SCP_MOD, SC_MOD_RW, 0, {0}, CMD_DAT_WRD, 2 }, - { {.t = TOK_SCOPE_SPN}, C_CTL_SCP, S_SCP_SPN, SC_MOD_RW, 0, {0}, CMD_DAT_BUF, 6 }, - { {.t = TOK_SCOPE_EDG}, C_CTL_SCP, S_SCP_EDG, SC_MOD_RW, 0, {0}, CMD_DAT_WRD, 2 }, - { {.t = TOK_SCOPE_HLD}, C_CTL_SCP, S_SCP_HLD, SC_MOD_RW, 0, {0}, CMD_DAT_WRD, 2 }, - { {.t = TOK_SCOPE_REF}, C_CTL_SCP, S_SCP_REF, SC_MOD_RW, 0, {0}, CMD_DAT_BUF, 4 }, - { {.t = TOK_SCOPE_SWP}, C_CTL_SCP, S_SCP_SWP, SC_MOD_RW, 0, {0}, CMD_DAT_WRD, 2 }, - { {.t = TOK_SCOPE_STX}, C_CTL_SCP, S_SCP_STX, SC_MOD_RW, 0, {0}, CMD_DAT_BOL, 1 }, - { {.t = TOK_SCOPE_TYP}, C_CTL_SCP, S_SCP_TYP, SC_MOD_RW, 0, {0}, CMD_DAT_INT, 1 }, - { {.t = TOK_SCOPE_VBW}, C_CTL_SCP, S_SCP_VBW, SC_MOD_RW, 0, {0}, CMD_DAT_WRD, 2 }, - { {.t = TOK_SCOPE_FEF}, C_CTL_SCP, S_SCP_FEF, SC_MOD_RW, 0, {0}, CMD_DAT_BUF, 12 }, + { {.t = TOK_DSTAR_DSQL}, CMD_PARAM_TYPE_TOKEN, C_CTL_DIG, S_DIG_DSCSQL, SC_MOD_RW, 1, {0}, CMD_DAT_BOL, 1 }, + { {.t = TOK_DSTAR_CALL_SIGN}, CMD_PARAM_TYPE_TOKEN, C_CTL_DIG, S_DIG_DSCALS, SC_MOD_RW12, 2, {0}, CMD_DAT_BUF, 38 }, + { {.t = TOK_DSTAR_MESSAGE}, CMD_PARAM_TYPE_TOKEN, C_CTL_DIG, S_DIG_DSMESS, SC_MOD_RW12, 2, {0}, CMD_DAT_STR, 32 }, + { {.t = TOK_DSTAR_STATUS}, CMD_PARAM_TYPE_TOKEN, C_CTL_DIG, S_DIG_DSRSTS, SC_MOD_RW12, 2, {0}, CMD_DAT_BUF, 1 }, + { {.t = TOK_DSTAR_GPS_DATA}, CMD_PARAM_TYPE_TOKEN, C_CTL_DIG, S_DIG_DSGPSD, SC_MOD_RW12, 2, {0}, CMD_DAT_BUF, 52 }, + { {.t = TOK_DSTAR_GPS_MESS}, CMD_PARAM_TYPE_TOKEN, C_CTL_DIG, S_DIG_DSGPSM, SC_MOD_RW12, 2, {0}, CMD_DAT_STR, 52 }, + { {.t = TOK_DSTAR_CODE}, CMD_PARAM_TYPE_TOKEN, C_CTL_DIG, S_DIG_DSCSQL, SC_MOD_RW12, 2, {0}, CMD_DAT_FLT, 1 }, + { {.t = TOK_DSTAR_TX_DATA}, CMD_PARAM_TYPE_TOKEN, C_CTL_DSD, S_DSD_DSTXDT, SC_MOD_RW, 1, {0}, CMD_DAT_BUF, 30 }, + { {.t = TOK_DSTAR_MY_CS}, CMD_PARAM_TYPE_TOKEN, C_CTL_DVT, S_DVT_DSMYCS, SC_MOD_RW, 1, {0}, CMD_DAT_STR, 12 }, + { {.t = TOK_DSTAR_TX_CS}, CMD_PARAM_TYPE_TOKEN, C_CTL_DVT, S_DVT_DSTXCS, SC_MOD_RW, 1, {0}, CMD_DAT_STR, 24 }, + { {.t = TOK_DSTAR_TX_MESS}, CMD_PARAM_TYPE_TOKEN, C_CTL_DVT, S_DVT_DSTXMS, SC_MOD_RW, 1, {0}, CMD_DAT_STR, 20 }, + { {.t = TOK_DRIVE_GAIN}, CMD_PARAM_TYPE_TOKEN, C_CTL_LVL, S_LVL_DRIVE, SC_MOD_RW, 1, {0}, CMD_DAT_FLT, 2 }, + { {.t = TOK_DIGI_SEL_FUNC}, CMD_PARAM_TYPE_TOKEN, C_CTL_FUNC, S_FUNC_DIGISEL, SC_MOD_RW, 1, {0}, CMD_DAT_BOL, 1 }, + { {.t = TOK_DIGI_SEL_LEVEL}, CMD_PARAM_TYPE_TOKEN, C_CTL_LVL, S_LVL_DIGI, SC_MOD_RW, 1, {0}, CMD_DAT_FLT, 2 }, + { {.t = TOK_SCOPE_DAT}, CMD_PARAM_TYPE_TOKEN, C_CTL_SCP, S_SCP_DAT, SC_MOD_RD, 0, {0}, CMD_DAT_BUF, 481 }, + { {.t = TOK_SCOPE_STS}, CMD_PARAM_TYPE_TOKEN, C_CTL_SCP, S_SCP_STS, SC_MOD_RW, 0, {0}, CMD_DAT_BOL, 1 }, + { {.t = TOK_SCOPE_DOP}, CMD_PARAM_TYPE_TOKEN, C_CTL_SCP, S_SCP_DOP, SC_MOD_RW, 0, {0}, CMD_DAT_BOL, 1 }, + { {.t = TOK_SCOPE_MSS}, CMD_PARAM_TYPE_TOKEN, C_CTL_SCP, S_SCP_MSS, SC_MOD_RW, 0, {0}, CMD_DAT_BOL, 1 }, + { {.t = TOK_SCOPE_MOD}, CMD_PARAM_TYPE_TOKEN, C_CTL_SCP, S_SCP_MOD, SC_MOD_RW, 0, {0}, CMD_DAT_WRD, 2 }, + { {.t = TOK_SCOPE_SPN}, CMD_PARAM_TYPE_TOKEN, C_CTL_SCP, S_SCP_SPN, SC_MOD_RW, 0, {0}, CMD_DAT_BUF, 6 }, + { {.t = TOK_SCOPE_EDG}, CMD_PARAM_TYPE_TOKEN, C_CTL_SCP, S_SCP_EDG, SC_MOD_RW, 0, {0}, CMD_DAT_WRD, 2 }, + { {.t = TOK_SCOPE_HLD}, CMD_PARAM_TYPE_TOKEN, C_CTL_SCP, S_SCP_HLD, SC_MOD_RW, 0, {0}, CMD_DAT_WRD, 2 }, + { {.t = TOK_SCOPE_REF}, CMD_PARAM_TYPE_TOKEN, C_CTL_SCP, S_SCP_REF, SC_MOD_RW, 0, {0}, CMD_DAT_BUF, 4 }, + { {.t = TOK_SCOPE_SWP}, CMD_PARAM_TYPE_TOKEN, C_CTL_SCP, S_SCP_SWP, SC_MOD_RW, 0, {0}, CMD_DAT_WRD, 2 }, + { {.t = TOK_SCOPE_STX}, CMD_PARAM_TYPE_TOKEN, C_CTL_SCP, S_SCP_STX, SC_MOD_RW, 0, {0}, CMD_DAT_BOL, 1 }, + { {.t = TOK_SCOPE_TYP}, CMD_PARAM_TYPE_TOKEN, C_CTL_SCP, S_SCP_TYP, SC_MOD_RW, 0, {0}, CMD_DAT_INT, 1 }, + { {.t = TOK_SCOPE_VBW}, CMD_PARAM_TYPE_TOKEN, C_CTL_SCP, S_SCP_VBW, SC_MOD_RW, 0, {0}, CMD_DAT_WRD, 2 }, + { {.t = TOK_SCOPE_FEF}, CMD_PARAM_TYPE_TOKEN, C_CTL_SCP, S_SCP_FEF, SC_MOD_RW, 0, {0}, CMD_DAT_BUF, 12 }, { {0} } }; @@ -2340,7 +2340,7 @@ int icom_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); - const struct cmdparams *cmd = priv_caps->extlevels; + const struct cmdparams *cmd = priv_caps->extcmds; for (i = 0; cmd && cmd[i].id.s != 0; i++) { @@ -2697,12 +2697,12 @@ int icom_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); const struct icom_priv_caps *priv = rig->caps->priv; - const struct cmdparams *cmd = priv->extlevels; + const struct cmdparams *cmd = priv->extcmds; int i; for (i = 0; cmd && cmd[i].id.s != 0; i++) { - if (cmd[i].id.s == level) + if (cmd[i].cmdparamtype == CMD_PARAM_TYPE_LEVEL && cmd[i].id.s == level) { return icom_get_cmd(rig, vfo, (struct cmdparams *)&cmd[i], val); } @@ -3186,7 +3186,7 @@ int icom_get_ext_level(RIG *rig, vfo_t vfo, token_t token, value_t *val) } else if (cfp[i].token == token) { - return icom_get_ext_cmd(rig, vfo, token, val); + return icom_get_ext_cmd(rig, vfo, CMD_PARAM_TYPE_LEVEL, token, val); } else { i++; } } @@ -3236,7 +3236,7 @@ int icom_get_ext_func(RIG *rig, vfo_t vfo, token_t token, int *status) } else if (cfp[i].token == token) { - return icom_get_ext_cmd(rig, vfo, token, (value_t *)status); + return icom_get_ext_cmd(rig, vfo, CMD_PARAM_TYPE_FUNC, token, (value_t *)status); } else { i++; } } @@ -3286,7 +3286,7 @@ int icom_get_ext_parm(RIG *rig, token_t token, value_t *val) } else if (cfp[i].token == token) { - return icom_get_ext_cmd(rig, RIG_VFO_NONE, token, val); + return icom_get_ext_cmd(rig, RIG_VFO_NONE, CMD_PARAM_TYPE_PARM, token, val); } else { i++; } } @@ -3294,7 +3294,7 @@ int icom_get_ext_parm(RIG *rig, token_t token, value_t *val) return -RIG_EINVAL; } -int icom_get_ext_cmd(RIG *rig, vfo_t vfo, token_t token, value_t *val) +int icom_get_ext_cmd(RIG *rig, vfo_t vfo, cmd_param_t cmdparamtype, token_t token, value_t *val) { int i; @@ -3316,7 +3316,7 @@ int icom_get_ext_cmd(RIG *rig, vfo_t vfo, token_t token, value_t *val) cmd = icom_ext_cmd; i = 0; } - else if (cmd[i].id.t == token) + else if (cmd[i].cmdparamtype == cmdparamtype && cmd[i].id.t == token) { return icom_get_cmd(rig, vfo, (struct cmdparams *)&cmd[i], val); } diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h index fe259658..a1e1903c 100644 --- a/rigs/icom/icom.h +++ b/rigs/icom/icom.h @@ -106,11 +106,21 @@ struct icom_agc_level icom_level; /* Icom AGC level for C_CTL_FUNC (0x16), S_FUNC_AGC (0x12) command */ }; +typedef enum +{ + CMD_PARAM_TYPE_NONE, + CMD_PARAM_TYPE_LEVEL, + CMD_PARAM_TYPE_PARM, + CMD_PARAM_TYPE_TOKEN, + CMD_PARAM_TYPE_FUNC, +} cmd_param_t; + struct cmdparams { /* Lookup table item for levels & parms */ union { setting_t s; /* Level or parm */ token_t t; /* TOKEN_BACKEND */ } id; + cmd_param_t cmdparamtype; /* CMD_PARAM_TYPE_LEVEL or CMD_PARAM_TYPE_PARM */ int command; /* CI-V command */ int subcmd; /* CI-V Subcommand */ int submod; /* Subcommand modifier */ @@ -167,8 +177,6 @@ struct icom_priv_caps int agc_levels_present; /* Flag to indicate that agc_levels array is populated */ struct icom_agc_level agc_levels[RIG_AGC_LAST + 1]; /* Icom rig-specific AGC levels, the last entry should have level -1 */ struct cmdparams *extcmds; /* Pointer to extended operations array */ - struct cmdparams *extlevels; /* Pointer to extended operations array */ - struct cmdparams *extparms; /* Pointer to extended operations array */ }; @@ -282,7 +290,7 @@ int icom_get_parm(RIG *rig, setting_t parm, value_t *val); int icom_set_ext_parm(RIG *rig, token_t token, value_t val); int icom_get_ext_parm(RIG *rig, token_t token, value_t *val); int icom_set_ext_cmd(RIG *rig, vfo_t vfo, token_t token, value_t val); -int icom_get_ext_cmd(RIG *rig, vfo_t vfo, token_t token, value_t *val); +int icom_get_ext_cmd(RIG *rig, vfo_t vfo, cmd_param_t cmdparamtype, token_t token, value_t *val); int icom_set_conf(RIG *rig, token_t token, const char *val); int icom_get_conf(RIG *rig, token_t token, char *val); int icom_set_powerstat(RIG *rig, powerstat_t status); diff --git a/rigs/icom/icr30.c b/rigs/icom/icr30.c index 84014af0..6300b986 100644 --- a/rigs/icom/icr30.c +++ b/rigs/icom/icr30.c @@ -68,9 +68,9 @@ struct confparams icr30_ext[] = struct cmdparams icr30_extcmds[] = { - { {.t = TOK_ANL}, C_CTL_MEM, S_MEM_ANL, SC_MOD_RW, 0, {}, CMD_DAT_BOL, 1 }, - { {.t = TOK_EAR}, C_CTL_MEM, S_MEM_EAR, SC_MOD_RW, 0, {}, CMD_DAT_BOL, 1 }, - { {.t = TOK_REC}, C_CTL_MEM, S_MEM_REC, SC_MOD_WR, 0, {}, CMD_DAT_BOL, 1 }, + { {.t = TOK_ANL}, CMD_PARAM_TYPE_TOKEN, C_CTL_MEM, S_MEM_ANL, SC_MOD_RW, 0, {}, CMD_DAT_BOL, 1 }, + { {.t = TOK_EAR}, CMD_PARAM_TYPE_TOKEN, C_CTL_MEM, S_MEM_EAR, SC_MOD_RW, 0, {}, CMD_DAT_BOL, 1 }, + { {.t = TOK_REC}, CMD_PARAM_TYPE_TOKEN, C_CTL_MEM, S_MEM_REC, SC_MOD_WR, 0, {}, CMD_DAT_BOL, 1 }, { {0} } }; diff --git a/rigs/icom/icr8600.c b/rigs/icom/icr8600.c index 1cfe03ca..a945cc22 100644 --- a/rigs/icom/icr8600.c +++ b/rigs/icom/icr8600.c @@ -69,10 +69,10 @@ struct cmdparams icr8600_extcmds[] = { - { {.s = RIG_PARM_BEEP}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x38}, CMD_DAT_BOL, 1 }, - { {.s = RIG_PARM_BACKLIGHT}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x15}, CMD_DAT_LVL, 2 }, - { {.s = RIG_PARM_KEYLIGHT}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x16}, CMD_DAT_LVL, 2 }, - { {.s = RIG_PARM_TIME}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x32}, CMD_DAT_TIM, 2 }, + { {.s = RIG_PARM_BEEP}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x38}, CMD_DAT_BOL, 1 }, + { {.s = RIG_PARM_BACKLIGHT}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x15}, CMD_DAT_LVL, 2 }, + { {.s = RIG_PARM_KEYLIGHT}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x16}, CMD_DAT_LVL, 2 }, + { {.s = RIG_PARM_TIME}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x32}, CMD_DAT_TIM, 2 }, { {.s = RIG_PARM_NONE} } }; commit d47987db8502aa0ab486df1bb32780c0d8d37739 Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Sep 12 08:59:55 2020 -0500 Fix bindings since itu_region has been deprecated diff --git a/bindings/luatest.lua b/bindings/luatest.lua index 05de17b0..dd768745 100755 --- a/bindings/luatest.lua +++ b/bindings/luatest.lua @@ -22,15 +22,11 @@ function doStartup() my_rig:set_conf("retry", "5") my_rig:open() - -- 1073741944 is token value for "itu_region" - -- but using get_conf is much more convenient - region = my_rig:get_conf(1073741944) - regionstr = my_rig:get_conf("itu_region") tpath = my_rig:get_conf("rig_pathname") retry = my_rig:get_conf("retry") print (string.format("status(str):\t\t%s", Hamlib.rigerror(my_rig.error_status))) - print (string.format("get_conf:\t\tpath = %s, retry = %s, ITU region = %s, ITU region (str) = %s", tpath, retry, region, regionstr)) + print (string.format("get_conf:\t\tpath = %s, retry = %s", tpath, retry)) my_rig:set_freq(Hamlib.RIG_VFO_B, 5700000000) my_rig:set_vfo(Hamlib.RIG_VFO_B) @@ -45,7 +41,6 @@ function doStartup() mode, width = my_rig:get_mode() print(string.format("mode:\t\t\t%s\nbandwidth:\t\t%d", Hamlib.rig_strrmode(mode), width)) - print(string.format("ITU_region:\t\t%s", my_rig.state.itu_region)) print(string.format("Backend copyright:\t%s",my_rig.caps.copyright)) print(string.format("Model:\t\t\t%s", my_rig.caps.model_name)) diff --git a/bindings/perltest.pl b/bindings/perltest.pl index e5c9db74..91652ad2 100755 --- a/bindings/perltest.pl +++ b/bindings/perltest.pl @@ -15,12 +15,9 @@ $rig->set_conf("rig_pathname","/dev/Rig"); $rig->open(); -# 1073741944 is token value for "itu_region" -# but using get_conf is much more convenient -$region = $rig->get_conf(1073741944); $rpath = $rig->get_conf("rig_pathname"); $retry = $rig->get_conf("retry"); -print "get_conf:\t\tpath = \"$rpath\", retry = $retry, ITU region = $region\n"; +print "get_conf:\t\tpath = \"$rpath\", retry = $retry\n"; $rig->set_freq($Hamlib::RIG_VFO_A, 14266000); @@ -38,7 +35,6 @@ $rig->set_vfo($Hamlib::RIG_VFO_B); $rig->set_mode($Hamlib::RIG_MODE_CW, $Hamlib::RIG_PASSBAND_NORMAL); -print "ITU region:\t\t$rig->{state}->{itu_region}\n"; print "Backend copyright:\t$rig->{caps}->{copyright}\n"; print "Model:\t\t\t$rig->{caps}->{model_name}\n"; print "Manufacturer:\t\t$rig->{caps}->{mfg_name}\n"; diff --git a/bindings/py3test.py b/bindings/py3test.py index dd5b7456..8ed1cf42 100755 --- a/bindings/py3test.py +++ b/bindings/py3test.py @@ -25,15 +25,12 @@ def StartUp(): my_rig.open () - # 1073741944 is token value for "itu_region" - # but using get_conf is much more convenient - region = my_rig.get_conf(1073741944) rpath = my_rig.get_conf("rig_pathname") retry = my_rig.get_conf("retry") print("status(str):\t\t%s" % Hamlib.rigerror(my_rig.error_status)) - print("get_conf:\t\tpath = %s, retry = %s, ITU region = %s" \ - % (rpath, retry, region)) + print("get_conf:\t\tpath = %s, retry = %s" \ + % (rpath, retry)) my_rig.set_freq(Hamlib.RIG_VFO_B, 5700000000) my_rig.set_vfo(Hamlib.RIG_VFO_B) @@ -50,7 +47,6 @@ def StartUp(): print("mode:\t\t\t%s\nbandwidth:\t\t%s" % (Hamlib.rig_strrmode(mode), width)) - print("ITU_region:\t\t%s" % my_rig.state.itu_region) print("Backend copyright:\t%s" % my_rig.caps.copyright) print("Model:\t\t\t%s" % my_rig.caps.model_name) print("Manufacturer:\t\t%s" % my_rig.caps.mfg_name) diff --git a/bindings/pytest.py b/bindings/pytest.py index 797aa020..b271834a 100755 --- a/bindings/pytest.py +++ b/bindings/pytest.py @@ -25,15 +25,12 @@ def StartUp(verbose): my_rig.open() - # 1073741944 is token value for "itu_region" - # but using get_conf is much more convenient - region = my_rig.get_conf(1073741944) rpath = my_rig.get_conf("rig_pathname") retry = my_rig.get_conf("retry") print "status(str):\t\t", Hamlib.rigerror(my_rig.error_status) - print "get_conf:\t\tpath = %s, retry = %s, ITU region = %s" \ - % (rpath, retry, region) + print "get_conf:\t\tpath = %s, retry = %s" \ + % (rpath, retry) my_rig.set_freq(Hamlib.RIG_VFO_B, 5700000000) my_rig.set_vfo(Hamlib.RIG_VFO_B) @@ -50,7 +47,6 @@ def StartUp(verbose): print "mode:\t\t\t", Hamlib.rig_strrmode(mode), "\nbandwidth:\t\t", width - print "ITU_region:\t\t", my_rig.state.itu_region print "Backend copyright:\t", my_rig.caps.copyright print "Model:\t\t\t", my_rig.caps.model_name print "Manufacturer:\t\t", my_rig.caps.mfg_name diff --git a/bindings/tcltest.tcl.in b/bindings/tcltest.tcl.in index 107085bc..51e9c0b7 100644 --- a/bindings/tcltest.tcl.in +++ b/bindings/tcltest.tcl.in @@ -31,10 +31,8 @@ set mode [rig_strrmode [lindex $moderes 0]] puts "mode:\t\t$mode\nbandwidth:\t[lindex $moderes 1]Hz" set state [my_rig cget -state] -puts "ITU_region:\t[$state cget -itu_region]" # The following works well also -# puts ITU_region:[[my_rig cget -state] cget -itu_region] set rigcaps [my_rig cget -caps] #set model [$rigcaps cget -model_name] commit 03ad7a953f4a31ab4b5c78a8394d6a5d62604801 Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Sep 11 22:44:35 2020 -0500 Update codeql diff --git a/rigs/icom/ic7300.c b/rigs/icom/ic7300.c index 985121e8..1cdcd0d1 100644 --- a/rigs/icom/ic7300.c +++ b/rigs/icom/ic7300.c @@ -62,16 +62,12 @@ struct cmdparams ic7300_extcmds[] = { {.s = RIG_PARM_BEEP}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x23}, CMD_DAT_BOL, 1 }, { {.s = RIG_PARM_BACKLIGHT}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x81}, CMD_DAT_LVL, 2 }, { {.s = RIG_PARM_TIME}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x95}, CMD_DAT_TIM, 2 }, - { {.s = RIG_LEVEL_VOXDELAY}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x91}, CMD_DAT_INT, 1 }, { {.s = RIG_PARM_NONE} } }; -struct cmdparams ic705_extcmds[] = +struct cmdparams ic7300_extlevels[] = { - { {.s = RIG_PARM_BEEP}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x29}, CMD_DAT_BOL, 1 }, { {.s = RIG_LEVEL_VOXDELAY}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x03, 0x59}, CMD_DAT_INT, 1 }, - { {.s = RIG_PARM_SCREENSAVER}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x38}, CMD_DAT_INT, 1 }, - { {.s = RIG_PARM_NONE} } }; /* @@ -157,11 +153,15 @@ struct cmdparams ic9700_extcmds[] = { { {.s = RIG_PARM_BEEP}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x29}, CMD_DAT_BOL, 1 }, { {.s = RIG_PARM_BACKLIGHT}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x52}, CMD_DAT_LVL, 2 }, - { {.s = RIG_LEVEL_VOXDELAY}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x03, 0x30}, CMD_DAT_INT, 1 }, { {.s = RIG_PARM_SCREENSAVER}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x67}, CMD_DAT_INT, 1 }, { {.s = RIG_PARM_NONE} } }; +struct cmdparams ic9700_extlevels[] = +{ + { {.s = RIG_LEVEL_VOXDELAY}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x03, 0x30}, CMD_DAT_INT, 1 }, +}; + #define IC9700_STR_CAL { 7, \ { \ { 0, -54 }, \ @@ -233,6 +233,7 @@ static const struct icom_priv_caps IC7300_priv_caps = { .level = -1, .icom_level = 0 }, }, .extcmds = ic7300_extcmds, /* Custom op parameters */ + .extlevels = ic7300_extlevels, /* Custom parameters */ }; static const struct icom_priv_caps IC9700_priv_caps = @@ -250,6 +251,7 @@ static const struct icom_priv_caps IC9700_priv_caps = { .level = -1, .icom_level = 0 }, }, .extcmds = ic9700_extcmds, /* Custom op parameters */ + .extlevels = ic9700_extlevels, /* Custom op parameters */ }; static const struct icom_priv_caps IC705_priv_caps = @@ -266,7 +268,8 @@ static const struct icom_priv_caps IC705_priv_caps = { .level = RIG_AGC_SLOW, .icom_level = 3 }, { .level = -1, .icom_level = 0 }, }, - .extcmds = ic705_extcmds, /* Custom op parameters */ + .extcmds = ic7300_extcmds, /* Custom parameters */ + .extlevels = ic7300_extlevels, /* Custom parameters */ }; const struct rig_caps ic7300_caps = diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 059310bc..275f59da 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -2340,7 +2340,7 @@ int icom_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); - const struct cmdparams *cmd = priv_caps->extcmds; + const struct cmdparams *cmd = priv_caps->extlevels; for (i = 0; cmd && cmd[i].id.s != 0; i++) { @@ -2697,7 +2697,7 @@ int icom_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); const struct icom_priv_caps *priv = rig->caps->priv; - const struct cmdparams *cmd = priv->extcmds; + const struct cmdparams *cmd = priv->extlevels; int i; for (i = 0; cmd && cmd[i].id.s != 0; i++) commit 54c522ef99014c0085d8f2ac9697002a4cf3900d Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Sep 11 09:49:47 2020 -0500 Start of migrating Icom rigs to separate LEVEL and PARM values to avoid collisions https://github.com/Hamlib/Hamlib/issues/373 diff --git a/rigs/icom/ic756.c b/rigs/icom/ic756.c index 9c740424..730b802d 100644 --- a/rigs/icom/ic756.c +++ b/rigs/icom/ic756.c @@ -542,7 +542,7 @@ const struct rig_caps ic756pro2_caps = RIG_MODEL(RIG_MODEL_IC756PROII), .model_name = "IC-756PROII", .mfg_name = "Icom", - .version = BACKEND_VER ".1", + .version = BACKEND_VER ".0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h index 90fb245e..fe259658 100644 --- a/rigs/icom/icom.h +++ b/rigs/icom/icom.h @@ -31,7 +31,7 @@ #include <sys/time.h> #endif -#define BACKEND_VER "20200910" +#define BACKEND_VER "20200911" /* * defines used by comp_cal_str in rig.c @@ -167,6 +167,8 @@ struct icom_priv_caps int agc_levels_present; /* Flag to indicate that agc_levels array is populated */ struct icom_agc_level agc_levels[RIG_AGC_LAST + 1]; /* Icom rig-specific AGC levels, the last entry should have level -1 */ struct cmdparams *extcmds; /* Pointer to extended operations array */ + struct cmdparams *extlevels; /* Pointer to extended operations array */ + struct cmdparams *extparms; /* Pointer to extended operations array */ }; ----------------------------------------------------------------------- Summary of changes: TODO | 61 ---------------------------------------- TODO.skeleton | 15 ---------- bindings/luatest.lua | 7 +---- bindings/perltest.pl | 6 +--- bindings/phpdemo.php | 41 +++++++++++++++++++++++++++ bindings/py3test.py | 8 ++---- bindings/pytest.py | 8 ++---- bindings/tcltest.tcl.in | 2 -- rigs/icom/ic7100.c | 10 +++---- rigs/icom/ic7300.c | 26 ++++++++--------- rigs/icom/ic756.c | 12 ++++---- rigs/icom/ic7600.c | 8 +++--- rigs/icom/icom.c | 75 +++++++++++++++++++++++++------------------------ rigs/icom/icom.h | 14 +++++++-- rigs/icom/icr30.c | 6 ++-- rigs/icom/icr8600.c | 8 +++--- 16 files changed, 131 insertions(+), 176 deletions(-) delete mode 100644 TODO delete mode 100644 TODO.skeleton create mode 100644 bindings/phpdemo.php hooks/post-receive -- Hamlib -- Ham radio control libraries |