[Hamlib-commits] Hamlib -- Ham radio control libraries branch master updated. d8a3aac62587e7e73cc27
Library to control radio transceivers and receivers
Brought to you by:
n0nb
From: n0nb <n0...@us...> - 2025-04-01 20:41:24
|
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 d8a3aac62587e7e73cc27d165115a5ee3833baa8 (commit) via a9ce0b07dd8730bc901f11ca3008230b1606633d (commit) via 44014b914ea69c7418569a1f7b6b55711aeaa81a (commit) via ad20668c752e61e8866891adc29c339dbca6a33d (commit) via 9fe15f396312dca878435ed4ed1121a3928bd025 (commit) via e00f3575697d8258fb88745d428b77fff75f1095 (commit) via c6a30081cbc3752ef1c904512ff4bbf8b2fe9e03 (commit) via d9545845b01b830f4aa5470e842e754ca023484a (commit) via 0e1e794cfa569c8994ab98a75d133a1fb6b3fbb3 (commit) via cd72187a7cc99c0168f6150de7cb21dbed7801d5 (commit) via 2da07e484c5162a8ed8e3be2395452c2b21a0bcb (commit) via cb0196875b1580cdef6cd8748eed8f84b305a173 (commit) via e109fe355d0fb4f1da9fc0dcb3dc5a304f08a771 (commit) via 0f519185acd7861412cb320e423145984ba05ab9 (commit) via 1049dc2457f2c90d47012da376836803b7c19dea (commit) via f8740ddd2899388f86bc3098afc0ae9d05f297a7 (commit) via ed52875c3d6988917b84cae6f96f2440063453e3 (commit) via c2d3202ffb0f4c51431b982ca023a586fcdbafc0 (commit) via a3e23e79cd97b4c48ea56cc2776b68d86db61a08 (commit) via 9b2904c0b676dc4ed57bd09e300b6a1e81b930c8 (commit) via 5caa22b79a5532b2848a8e6689e0be2b36a94fde (commit) via 43f8afa6a4f13fbfb96c2ec75f25ddfb5da9a8e2 (commit) via 7269ba62647a613ba7b63fc6ddbd2070ba7f9db5 (commit) via 701d6bf477f784192684c8035cd874d10966a5e6 (commit) via 3dbb7011d1a2c14cc0f2351c321b66787d51e9f3 (commit) via 6b11c7e970ba9f7a348ba4836d94bfcf177f2ece (commit) via f2f947c51d45f5596afd0b8b3c8df7c3d88d93dd (commit) via 0147da5a3ca8dc0f874d2a43ff5a2e702bbc4f41 (commit) via 439bd96b5d01ddbaf811a1e1df98c08a1caff406 (commit) via 3d46647808dc9dde14106d259aebefa85042cd43 (commit) via 9de6fe2400cff5489cd487e71af299758a4ee567 (commit) via 2a9634d7053c2fa9d125473f9d285c32bcca24fb (commit) via fb145e873b63adf3c640292efb336783a97117bd (commit) via beea87c2aece53f04a6ac8ae10a43f456136e31d (commit) from 98a0184680a70aa4943ea2ba7dbcf8ca03bebf1f (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 d8a3aac62587e7e73cc27d165115a5ee3833baa8 Merge: 44014b914 a9ce0b07d Author: Nate Bargmann <n0...@n0...> Date: Tue Apr 1 15:37:16 2025 -0500 Merge pull request #1688 from brianjester/patch-1 Update README.developer commit a9ce0b07dd8730bc901f11ca3008230b1606633d Author: brianjester <bri...@pr...> Date: Sun Mar 30 18:34:43 2025 -0700 Update README.developer fix typo diff --git a/README.developer b/README.developer index 2b5f64695..4ded18b26 100644 --- a/README.developer +++ b/README.developer @@ -331,7 +331,7 @@ Additionally, you may want to add the '--with-perl-binding' or '--with-python-binding' or '--with-tcl-binding' or '--with-lua-binding' if you are interested in SWIG binding support for those scripting languages. -For LUA bindinds if you run "lua luatest.lua" and see this error message: +For LUA bindings if you run "lua luatest.lua" and see this error message: luatest.lua:44: Error in Rig::set_mode (arg 2), expected 'rmode_t' got 'string' This means you need to upgrade both swig and lua for 64-bit lua support This is known to work on swig 4.0.1 and lua 5.3.5 commit 44014b914ea69c7418569a1f7b6b55711aeaa81a Merge: ad20668c7 9fe15f396 Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Mar 22 14:47:18 2025 -0500 Merge branch 'master' of github.com:Hamlib/Hamlib commit ad20668c752e61e8866891adc29c339dbca6a33d Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Mar 22 14:45:32 2025 -0500 Fix headers for compability with swig 4.3.0 https://github.com/Hamlib/Hamlib/issues/1669 diff --git a/include/hamlib/riglist.h b/include/hamlib/riglist.h index b7a441c0a..2dda81d2a 100644 --- a/include/hamlib/riglist.h +++ b/include/hamlib/riglist.h @@ -32,7 +32,7 @@ // With a max of 1000 models per backend we get total a model number range of 1001-33001 // This MAX was 100 prior to 2020-02-18 and Icom was close to running out of the 100 range #define MAX_MODELS_PER_BACKEND 1000 -#define RIG_MAKE_MODEL(a,b) ((a)*MAX_MODELS_PER_BACKEND+(b)) +#define RIG_MAKE_MODEL(a,b) (MAX_MODELS_PER_BACKEND*(a)+(b)) #define RIG_BACKEND_NUM(a) ((a)/MAX_MODELS_PER_BACKEND) //! @endcond diff --git a/include/hamlib/rotlist.h b/include/hamlib/rotlist.h index 37d410846..0fff30f3a 100644 --- a/include/hamlib/rotlist.h +++ b/include/hamlib/rotlist.h @@ -24,7 +24,7 @@ #define _ROTLIST_H 1 //! @cond Doxygen_Suppress -#define ROT_MAKE_MODEL(a,b) ((a)*100+(b)) +#define ROT_MAKE_MODEL(a,b) (100*(a)+(b)) #define ROT_BACKEND_NUM(a) ((a)/100) //! @endcond commit 9fe15f396312dca878435ed4ed1121a3928bd025 Merge: c6a30081c e00f35756 Author: Michael Black <mdb...@ya...> Date: Mon Mar 17 15:59:31 2025 -0500 Merge pull request #1683 from dforsi/fix/typos Fix my previous commit ("Add bold" d9545845) commit e00f3575697d8258fb88745d428b77fff75f1095 Author: Daniele Forsi IU5HKX <iu...@gm...> Date: Mon Mar 17 21:49:57 2025 +0100 Fix my previous commit ("Add bold" d9545845) diff --git a/doc/man1/rigctld.1 b/doc/man1/rigctld.1 index 39d4f29c7..1c77bf3e2 100644 --- a/doc/man1/rigctld.1 +++ b/doc/man1/rigctld.1 @@ -119,7 +119,7 @@ See model list (use \(lqrigctld -l\(rq). (or third party software using the C API) will use radio model 2 for .B NET rigctl (this model number is not used for -.B rigctl +.B rigctld even though it shows in the model list). . @@ -399,19 +399,19 @@ option as it generates no output on its own. .TP .BR \-A ", " \-\-password Sets password on -.B rigctl +.B rigctld which requires hamlib to use rig_set_password and rigctl to use \\password to access rigctld. A 32-char shared secret will be displayed to be used on the client side. . .TP .BR \-R ", " \-\-rigctld\-idle Will make -.B rigctl +.B rigctld close the rig when no clients are connected. Normally remains connected to speed up connects. . .TP .BR \-b ", " \-\-bind\-all Will make -.B rigctl +.B rigctld try to bind to first network device available. . .TP @@ -421,7 +421,7 @@ Show a summary of these options and exit. .TP .BR \-V ", " \-\-version Show version of -.B rigctl +.B rigctld and exit. . .PP @@ -1233,7 +1233,7 @@ Examples: .TP .BR client_version " \(aq" \fIString\fP "\(aq Client can send its version to -.B rigctl +.B rigctld and get feedback on compatibility, deprecation, and alternatives .TP .BR hamlib_version commit c6a30081cbc3752ef1c904512ff4bbf8b2fe9e03 Merge: 0f519185a d9545845b Author: Michael Black <mdb...@ya...> Date: Sun Mar 16 17:10:43 2025 -0500 Merge pull request #1682 from dforsi/fix/manpages Fix manpages commit d9545845b01b830f4aa5470e842e754ca023484a Author: Daniele Forsi IU5HKX <iu...@gm...> Date: Sun Mar 16 18:21:06 2025 +0100 Add bold diff --git a/doc/man1/rigctld.1 b/doc/man1/rigctld.1 index ea3d35329..39d4f29c7 100644 --- a/doc/man1/rigctld.1 +++ b/doc/man1/rigctld.1 @@ -118,7 +118,9 @@ See model list (use \(lqrigctld -l\(rq). .B rigctl (or third party software using the C API) will use radio model 2 for .B NET rigctl -(this model number is not used for rigctld even though it shows in the model +(this model number is not used for +.B rigctl +even though it shows in the model list). . .TP @@ -396,15 +398,21 @@ option as it generates no output on its own. . .TP .BR \-A ", " \-\-password -Sets password on rigctld which requires hamlib to use rig_set_password and rigctl to use \\password to access rigctld. A 32-char shared secret will be displayed to be used on the client side. +Sets password on +.B rigctl +which requires hamlib to use rig_set_password and rigctl to use \\password to access rigctld. A 32-char shared secret will be displayed to be used on the client side. . .TP .BR \-R ", " \-\-rigctld\-idle -Will make rigctld close the rig when no clients are connected. Normally remains connected to speed up connects. +Will make +.B rigctl +close the rig when no clients are connected. Normally remains connected to speed up connects. . .TP .BR \-b ", " \-\-bind\-all -Will make rigctld try to bind to first network device available. +Will make +.B rigctl +try to bind to first network device available. . .TP .BR \-h ", " \-\-help @@ -1224,7 +1232,9 @@ Examples: . .TP .BR client_version " \(aq" \fIString\fP "\(aq -Client can send its version to rigctld and get feedback on compatibility, deprecation, and alternatives +Client can send its version to +.B rigctl +and get feedback on compatibility, deprecation, and alternatives .TP .BR hamlib_version Returns Hamlib version with ISO8601 date/time commit 0e1e794cfa569c8994ab98a75d133a1fb6b3fbb3 Author: Daniele Forsi IU5HKX <iu...@gm...> Date: Sat Mar 8 16:12:38 2025 +0100 Set parameter keywords bold, not their descriptions diff --git a/doc/man1/rigctl.1 b/doc/man1/rigctl.1 index d7176bd1f..56ae33044 100644 --- a/doc/man1/rigctl.1 +++ b/doc/man1/rigctl.1 @@ -191,27 +191,27 @@ above. Will exit if no -r is given. Note the dummy device has no serial paramete Set configuration parameter(s). Some common ones are: .in +4n .EX -.RB async: "True enables asynchronous data transfer for backends that support it. This allows use of transceive and spectrum data." -.RB auto_power_on: "True enables compatible rigs to be powered up on open" -.RB auto_power_off: "True enables compatible rigs to be powered down on close" -.RB auto_disable_screensaver: "True enables compatible rigs to have their screen saver disabled on open" -.RB dcd_type: "Data Carrier Detect (or squelch) interface type override" -.RB dcd_pathname: "Path name to the device file of the Data Carrier Detect (or squelch)" -.RB disable_yaesu_bandselect: "True disables the automatic band select on band change for Yaesu rigs" -.RB dtr_state: "ON turns on DTR, OFF turns it off, Unset disables it" -.RB lo_freq: "Frequency to add to the VFO frequency for use with a transverter" -.RB post_write_delay: "Delay in ms between each command sent out" -.RB ptt_share: "True enables ptt port to be shared with other apps" -.RB ptt_type: "Push-To-Talk interface type override" -.RB ptt_pathname: "Path name to the device file of the Push-To-Talk" -.RB ptt_bitnum: "Push-To-Talk GPIO bit number" -.RB retry: "Max number of retry" -.RB rts_state: "ON turns on DTR, OFF turns it off, Unset disables it" -.RB twiddle_timeout: "For satellite ops when VFOB is twiddled will pause VFOB commands until timeout" -.RB twiddle_rit: "Suppress get_freq on VFOB for RIT tuning satellites" -.RB timeout: "Timeout in ms" -.RB write_delay: "Delay in ms between each byte sent out" -.RB tuner_control_pathname: "Path name to a script/program to control a tuner with 1 argument of 0/1 for Tuner Off/On" +.BR async: "True enables asynchronous data transfer for backends that support it. This allows use of transceive and spectrum data." +.BR auto_power_on: "True enables compatible rigs to be powered up on open" +.BR auto_power_off: "True enables compatible rigs to be powered down on close" +.BR auto_disable_screensaver: "True enables compatible rigs to have their screen saver disabled on open" +.BR dcd_type: "Data Carrier Detect (or squelch) interface type override" +.BR dcd_pathname: "Path name to the device file of the Data Carrier Detect (or squelch)" +.BR disable_yaesu_bandselect: "True disables the automatic band select on band change for Yaesu rigs" +.BR dtr_state: "ON turns on DTR, OFF turns it off, Unset disables it" +.BR lo_freq: "Frequency to add to the VFO frequency for use with a transverter" +.BR post_write_delay: "Delay in ms between each command sent out" +.BR ptt_share: "True enables ptt port to be shared with other apps" +.BR ptt_type: "Push-To-Talk interface type override" +.BR ptt_pathname: "Path name to the device file of the Push-To-Talk" +.BR ptt_bitnum: "Push-To-Talk GPIO bit number" +.BR retry: "Max number of retry" +.BR rts_state: "ON turns on DTR, OFF turns it off, Unset disables it" +.BR twiddle_timeout: "For satellite ops when VFOB is twiddled will pause VFOB commands until timeout" +.BR twiddle_rit: "Suppress get_freq on VFOB for RIT tuning satellites" +.BR timeout: "Timeout in ms" +.BR write_delay: "Delay in ms between each byte sent out" +.BR tuner_control_pathname: "Path name to a script/program to control a tuner with 1 argument of 0/1 for Tuner Off/On" .EE .in .IP diff --git a/doc/man1/rigctld.1 b/doc/man1/rigctld.1 index 439c3a742..ea3d35329 100644 --- a/doc/man1/rigctld.1 +++ b/doc/man1/rigctld.1 @@ -299,27 +299,27 @@ above. Set configuration parameter(s). Some common ones are: .in +4 .EX -.RB async: "True enables asynchronous data transfer for backends that support it. This allows use of transceive and spectrum data." -.RB auto_power_on: "True enables compatible rigs to be powered up on open" -.RB auto_power_off: "True enables compatible rigs to be powered down on close" -.RB auto_disable_screensaver: "True enables compatible rigs to have their screen saver disabled on open" -.RB dcd_type: "Data Carrier Detect (or squelch) interface type override" -.RB dcd_pathname: "Path name to the device file of the Data Carrier Detect (or squelch)" -.RB disable_yaesu_bandselect: "True disables the automatic band select on band change for Yaesu rigs" -.RB dtr_state: "ON turns on DTR, OFF turns it off, Unset disables it" -.RB lo_freq: "Frequency to add to the VFO frequency for use with a transverter" -.RB post_write_delay: "Delay in ms between each command sent out" -.RB ptt_share: "True enables ptt port to be shared with other apps" -.RB ptt_type: "Push-To-Talk interface type override" -.RB ptt_pathname: "Path name to the device file of the Push-To-Talk" -.RB ptt_bitnum: "Push-To-Talk GPIO bit number" -.RB retry: "Max number of retry" -.RB rts_state: "ON turns on DTR, OFF turns it off, Unset disables it" -.RB twiddle_timeout: "For satellite ops when VFOB is twiddled will pause VFOB commands until timeout" -.RB twiddle_rit: "Suppress get_freq on VFOB for RIT tuning satellites" -.RB timeout: "Timeout in ms" -.RB write_delay: "Delay in ms between each byte sent out" -.RB tuner_control_pathname: "Path name to a script/program to control a tuner with 1 argument of 0/1 for Tuner Off/On" +.BR async: "True enables asynchronous data transfer for backends that support it. This allows use of transceive and spectrum data." +.BR auto_power_on: "True enables compatible rigs to be powered up on open" +.BR auto_power_off: "True enables compatible rigs to be powered down on close" +.BR auto_disable_screensaver: "True enables compatible rigs to have their screen saver disabled on open" +.BR dcd_type: "Data Carrier Detect (or squelch) interface type override" +.BR dcd_pathname: "Path name to the device file of the Data Carrier Detect (or squelch)" +.BR disable_yaesu_bandselect: "True disables the automatic band select on band change for Yaesu rigs" +.BR dtr_state: "ON turns on DTR, OFF turns it off, Unset disables it" +.BR lo_freq: "Frequency to add to the VFO frequency for use with a transverter" +.BR post_write_delay: "Delay in ms between each command sent out" +.BR ptt_share: "True enables ptt port to be shared with other apps" +.BR ptt_type: "Push-To-Talk interface type override" +.BR ptt_pathname: "Path name to the device file of the Push-To-Talk" +.BR ptt_bitnum: "Push-To-Talk GPIO bit number" +.BR retry: "Max number of retry" +.BR rts_state: "ON turns on DTR, OFF turns it off, Unset disables it" +.BR twiddle_timeout: "For satellite ops when VFOB is twiddled will pause VFOB commands until timeout" +.BR twiddle_rit: "Suppress get_freq on VFOB for RIT tuning satellites" +.BR timeout: "Timeout in ms" +.BR write_delay: "Delay in ms between each byte sent out" +.BR tuner_control_pathname: "Path name to a script/program to control a tuner with 1 argument of 0/1 for Tuner Off/On" .EE .in .IP commit cd72187a7cc99c0168f6150de7cb21dbed7801d5 Author: Daniele Forsi IU5HKX <iu...@gm...> Date: Sat Mar 8 16:08:03 2025 +0100 Fix usage of .EX Add missing .EE and remove some .EE that were out of place. diff --git a/doc/man1/rigctl.1 b/doc/man1/rigctl.1 index a0d6e8e32..d7176bd1f 100644 --- a/doc/man1/rigctl.1 +++ b/doc/man1/rigctl.1 @@ -739,6 +739,7 @@ symbols. For Yaesu rigs use memory#1-5 or up to 50 char msg .EX Example from command line: rigctl -m 3073 -r /dev/ttyUSB0 b "CQ CQ DE ME" Yaesu example to send message#1: rigctl -m 1035 -r /dev/ttyUSB0 b 1 +.EE . .TP .BR 0xbb ", " stop_morse " @@ -1406,62 +1407,59 @@ Returns current lock mode status 1=On, 2=Off (only useful when using rigctld) . .TP .BR send_raw " \(aq" \fITerminator\fP "\(aq \(aq" \fIString\fP \(aq -.EX Can send ASCII string or 0xnn values or xnn values -- there can be no spaces in the command string. Possible terminator values are CR, LF, ;, ICOM, 0-100 (bytes to read), or -1 meaning unknown (will timeout on read) Examples (note that a ; must be escaped in Unix/Linux): +.IP For Windows & Unix/Linux we have a new colon-separated format for hex digits +.EX send_raw icom 0xFE:0xFE:0x94:0x03:0xFD Note: colon-separated does not have to be escaped on Unix/Linux send_raw -1 0xFE:0xFE:0x94:0x03:0xFD send_raw 14 0xFE:0xFE:0x94:0x03:0xFD Note that ASCII commands still require escaping the semicolon on Unix/Linux send_raw \; FA\;MD\; - +.EE For Windows: +.EX send_raw icom 0xFE;0xFE;0x94;0x03;0xFD send_raw -1 0xFE;0xFE;0x94;0x03;0xFD send_raw 14 0xFE;0xFE;0x94;0x03;0xFD - - For Unix/Linux +.EE +For Unix/Linux +.EX send_raw icom 0xFE\;0xFE\;0x94\;0x03\;0xFD send_raw \; FA\;MD\; send_raw -1 0xFE\;0xFE\;0x94\;0x03\;0xFD send_raw 14 0xFE\;0xFE\;0x94\;0x03\;0xFD +.EE . .TP .BR client_version " \(aq" \fIString\fP "\(aq -.EX Client can send its version to rigctld and get feedback on compatibility, deprecation, and alternatives .TP .BR hamlib_version -.EX Returns hamlib version with ISO8601 date/time . .TP .BR test -.EX Performs test routines. Under development. . .TP .BR set_gpio " \(aq" \fIGPIO#\fP "\(aq -.EX Sets GPIO1, GPIO2, GPIO3, GPIO4 on the GPIO ptt port Can also use 1,2,3,4 . .TP .BR get_gpio " \(aq" \fIGPIO#\fP "\(aq -.EX Reads GPIO1, GPIO2, GPIO3, GPIO4 on the GPIO ptt port Can also use 1,2,3,4 . .TP .BR skip_init -.EX Skips rig initialization -- useful when executing commands with rigctl to speed up things . .TP .BR freq_skip " " 'skip' -.EX When skip!=0 skips setting freq on TX_VFO when in RX and on RX_VFO when in TX -- for use with gpredict and rigs that do not have TARGETABLE_VFO . .SH READLINE diff --git a/doc/man1/rigctld.1 b/doc/man1/rigctld.1 index 5d2f18055..439c3a742 100644 --- a/doc/man1/rigctld.1 +++ b/doc/man1/rigctld.1 @@ -736,6 +736,7 @@ symbols. For Yaesu rigs use memory# (1-5 for most rigs) or up to 50 char messag .EX Example from rigctld socket: b CQ CQ DE ME Yaesu example to send message#1 frm rigctld socket: b 1 +.EE . .TP .BR 0xbb ", " stop_morse " @@ -1211,38 +1212,34 @@ Returns current lock mode status 1=On, 2=Off (only useful with rigctld) . .TP .BR send_raw " \(aq" \fITerminator\fP "\(aq \(aq" \fIString\fP \(aq -.EX Can send ASCII string or 0xnn values -- there can be no spaces in the command string. Possible terminator values are CR, LF, ;, ICOM, 0-100 (bytes to read), or -1 meaning unknown (will timeout on read) Examples: +.EX send_raw ; FA;MD; send_raw icom 0xFE;0xFE;0x94;0x03;0xFD send_raw -1 0xFE;0xFE;0x94;0x03;0xFD send_raw 14 0xFE;0xFE;0x94;0x03;0xFD +.EE . .TP .BR client_version " \(aq" \fIString\fP "\(aq -.EX Client can send its version to rigctld and get feedback on compatibility, deprecation, and alternatives .TP .BR hamlib_version -.EX Returns Hamlib version with ISO8601 date/time . .TP .BR test -.EX Performs test routines. Under development. . .TP .BR set_gpio " \(aq" \fIGPIO#\fP "\(aq -.EX Sets GPIO1, GPIO2, GPIO3, GPIO4 on the GPIO ptt port Can also use 1,2,3,4 . .TP .BR get_gpio " \(aq" \fIGPIO#\fP "\(aq -.EX Reads GPIO1, GPIO2, GPIO3, GPIO4 on the GPIO ptt port Can also use 1,2,3,4 . commit 2da07e484c5162a8ed8e3be2395452c2b21a0bcb Author: Daniele Forsi IU5HKX <iu...@gm...> Date: Thu Mar 6 23:39:45 2025 +0100 Escape literal \n Otherwise it isn't rendered correctly. diff --git a/doc/man1/rigctld.1 b/doc/man1/rigctld.1 index e1fbb6ca9..5d2f18055 100644 --- a/doc/man1/rigctld.1 +++ b/doc/man1/rigctld.1 @@ -211,7 +211,7 @@ Use .I char as separator instead of line feed. .IP -The default is \n. Recommend using $ or @ as they work on both Unix and Windows +The default is \(oq\\n\(cq. Recommend using $ or @ as they work on both Unix and Windows. .IP . .TP commit cb0196875b1580cdef6cd8748eed8f84b305a173 Author: Daniele Forsi IU5HKX <iu...@gm...> Date: Wed Mar 5 22:35:09 2025 +0100 Fix underline and italics diff --git a/doc/man1/rigctl.1 b/doc/man1/rigctl.1 index 95c7bbddd..a0d6e8e32 100644 --- a/doc/man1/rigctl.1 +++ b/doc/man1/rigctl.1 @@ -81,13 +81,15 @@ Use .I device as the file name of the port connected to the radio. .IP -Typically /dev/ttyS0 ", " /dev/ttyS1 ", " /dev/ttyUSB0 , +Typically +.IR /dev/ttyS0 ", " /dev/ttyS1 ", " /dev/ttyUSB0 , etc. on Linux, .IR COM1 ", " COM2 , etc. on MS Windows. The BSD flavors and Mac OS/X have their own designations. See your system's documentation. .IP -Can be a network address:port, e.g. 127.0.0.1:12345 +Can be a network address:port, e.g. +.IR 127.0.0.1:12345 .IP The special string \(lquh\-rig\(rq may be given to enable micro-ham device support. diff --git a/doc/man1/rigctld.1 b/doc/man1/rigctld.1 index 9c22bd619..e1fbb6ca9 100644 --- a/doc/man1/rigctld.1 +++ b/doc/man1/rigctld.1 @@ -127,14 +127,16 @@ Use .I device as the file name of the port connected to the radio. .IP -Typically /dev/ttyS0 ", " /dev/ttyS1 ", " /dev/ttyUSB0 , +Typically +.IR /dev/ttyS0 ", " /dev/ttyS1 ", " /dev/ttyUSB0 , etc. on Linux, .IR COM1 ", " COM2 , etc. on MS Windows. The BSD flavors and Mac OS/X have their own designations. See your system's documentation. .IP .IP -Can be a network address:port, e.g. 127.0.0.1:12345 +Can be a network address:port, e.g. +.IR 127.0.0.1:12345 .IP The special string \(lquh\-rig\(rq may be given to enable micro-ham device support. @@ -205,7 +207,9 @@ in which case it is hexadecimal. . .TP .BR \-S ", " \-\-separator = \fIchar\fP -Use char as separator instead of line feed +Use +.I char +as separator instead of line feed. .IP The default is \n. Recommend using $ or @ as they work on both Unix and Windows .IP commit e109fe355d0fb4f1da9fc0dcb3dc5a304f08a771 Author: Daniele Forsi IU5HKX <iu...@gm...> Date: Wed Mar 5 22:28:14 2025 +0100 Fix typos diff --git a/doc/man1/rigctl.1 b/doc/man1/rigctl.1 index e8ce4e31a..95c7bbddd 100644 --- a/doc/man1/rigctl.1 +++ b/doc/man1/rigctl.1 @@ -335,7 +335,7 @@ Sets the cookie to be used for remote access security . .TP .BR \-# ", " \-\-skip_init -Skips most startup intialization. +Skips most startup initialization. . .TP .B \- @@ -701,7 +701,7 @@ and .IP Number is 1-based antenna# (\(oq1\(cq, \(oq2\(cq, \(oq3\(cq, ...). .IP -Option depends on rig..for Icom it probably sets the Tx & Rx antennas as in the IC-7851. See your manual for rig specific option values. Most rigs don't care about the option. +Option depends on rig. For Icom it probably sets the Tx & Rx antennas as in the IC-7851. See your manual for rig specific option values. Most rigs don't care about the option. .IP For the IC-7851, FTDX3000 (and perhaps others) it means this: .IP @@ -727,7 +727,7 @@ A value of 0 for Antenna will return the current TX antenna .IP -Option returned depends on rig..for Icom is likely the RX only flag. +Option returned depends on rig. For Icom it is likely the RX only flag. . .TP .BR b ", " send_morse " \(aq" \fIMorse\fP \(aq @@ -828,7 +828,7 @@ code. .BR 0x93 ", " get_dcs_sql Get .RI \(aq "DCS Sql" \(aq - code. +code. . .TP .BR N ", " set_ts " \(aq" "\fITuning Step\fP" \(aq @@ -1138,7 +1138,6 @@ Sets memory channel information Get channel memory. .IP If readonly!=0 then only channel data is returned and rig remains on the current channel. If readonly=0 then rig will be set to the channel requested. -data. . .TP .BR A ", " set_trn " \(aq" \fITransceive\fP \(aq @@ -1465,8 +1464,6 @@ When skip!=0 skips setting freq on TX_VFO when in RX and on RX_VFO when in TX -- . .SH READLINE . -.SH READLINE -. If .B Readline library development files are found at configure time, diff --git a/doc/man1/rigctld.1 b/doc/man1/rigctld.1 index b42b83066..9c22bd619 100644 --- a/doc/man1/rigctld.1 +++ b/doc/man1/rigctld.1 @@ -112,7 +112,7 @@ Here is a summary of the supported options: .BR \-m ", " \-\-model = \fIid\fP Select radio model number. Defaults to dummy device. .IP -See model list (use \(lqrigctl -l\(rq). +See model list (use \(lqrigctld -l\(rq). .IP .BR Note : .B rigctl @@ -256,7 +256,7 @@ rigctl -m 2 ip6-localhost Exceptions: .EX rigctl -m 2 -r 127.0.0.1 (only works if localhost is IPV4 address) -rigctl -m 2 -r ::1 (only works localhost is IPV6 address) +rigctl -m 2 -r ::1 (only works if localhost is IPV6 address) .EE .in . @@ -345,7 +345,7 @@ Windows. The output can be piped to .BR more (1) or .BR less (1), -e.g. \(lqrigctl -l | more\(rq. +e.g. \(lqrigctld -l | more\(rq. . .TP .BR \-o ", " \-\-vfo @@ -375,12 +375,12 @@ Should only be needed when controlling software should be "paused" so you can move the VFO. Continuous movement extends the timeout. . .TP -.BR \-x ", " \-\-uplink=option +.BR \-x ", " \-\-uplink = \fIoption\fP 1=Sub, 2=Main .IP For GPredict use to ignore get_freq for Sub or Main uplink VFO. .IP -Should allow downlink VFO movement without confusing GPredict or the uplink +Should allow downlink VFO movement without confusing GPredict or the uplink. . .TP .BR \-Z ", " \-\-debug\-time\-stamps @@ -703,7 +703,7 @@ Set number (\(oq0\(cq, \(oq1\(cq, \(oq2\(cq, ...). .IP .IP -Option depends on rig..for Icom it probably sets the Tx & Rx antennas as in the IC-7851. See your manual for rig specific option values. Most rigs don't care about the option. +Option depends on rig. For Icom it probably sets the Tx & Rx antennas as in the IC-7851. See your manual for rig specific option values. Most rigs don't care about the option. .IP For the IC-7851 (and perhaps others) it means this: .IP @@ -739,7 +739,7 @@ Stop sending the current morse code. . .TP .BR 0xbc ", " wait_morse " -Wait for morse to finish -- only works on full break-in +Wait for morse to finish -- only works on full break-in. . .TP .BR 0x94 ", " send_voice_mem " \(aq" \fIMsgnum\fP \(aq @@ -823,7 +823,7 @@ code. .BR 0x93 ", " get_dcs_sql Get .RI \(aq "DCS Sql" \(aq - code. +code. . .TP .BR N ", " set_ts " \(aq" "\fITuning Step\fP" \(aq @@ -882,7 +882,7 @@ Set and .RI \(aq "Level Value" \(aq. .IP -evel is a token: \(oqPREAMP\(cq, \(oqATT\(cq, \(oqVOXDELAY\(cq, \(oqAF\(cq, +Level is a token: \(oqPREAMP\(cq, \(oqATT\(cq, \(oqVOXDELAY\(cq, \(oqAF\(cq, \(oqRF\(cq, \(oqSQL\(cq, \(oqIF\(cq, \(oqAPF\(cq, \(oqNR\(cq, \(oqPBT_IN\(cq, \(oqPBT_OUT\(cq, \(oqCWPITCH\(cq, \(oqRFPOWER\(cq, \(oqMICGAIN\(cq, \(oqKEYSPD\(cq, \(oqNOTCHF\(cq, \(oqCOMP\(cq, \(oqAGC\(cq, \(oqBKINDL\(cq, @@ -1013,7 +1013,6 @@ Not implemented yet. Get channel memory. .IP If readonly!=0 then only channel data is returned and rig remains on the current channel. If readonly=0 then rig will be set to the channel requested. -data. . .TP .BR A ", " set_trn " \(aq" \fITransceive\fP \(aq @@ -1021,7 +1020,7 @@ Set .RI \(aq Transceive \(aq mode. .IP -Transcieve is a token: \(oqOFF\(cq, \(oqRIG\(cq, \(oqPOLL\(cq. +Transceive is a token: \(oqOFF\(cq, \(oqRIG\(cq, \(oqPOLL\(cq. .IP Transceive is a mechanism for radios to report events without a specific call for information. @@ -1220,16 +1219,11 @@ Examples: .TP .BR client_version " \(aq" \fIString\fP "\(aq .EX - Client can send its version to rigctld and get feedback on compatibility, deprecation, and alternatives -.TP -.BR hamlib_version -.EX -Returns hamlib version with ISO8601 date/time -. +Client can send its version to rigctld and get feedback on compatibility, deprecation, and alternatives .TP .BR hamlib_version .EX -Returns hamlib version with ISO8601 date/time +Returns Hamlib version with ISO8601 date/time . .TP .BR test commit 0f519185acd7861412cb320e423145984ba05ab9 Merge: 1049dc245 a3e23e79c Author: Michael Black <mdb...@ya...> Date: Wed Mar 12 23:10:20 2025 -0500 Merge pull request #1676 from GeoBaltz/fix26a More fixes for send_morse sync commit 1049dc2457f2c90d47012da376836803b7c19dea Merge: f8740ddd2 ed52875c3 Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Mar 12 12:49:40 2025 -0500 Merge branch 'master' of github.com:Hamlib/Hamlib commit f8740ddd2899388f86bc3098afc0ae9d05f297a7 Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Mar 12 12:49:17 2025 -0500 Fix FTDX101D/MP ALC scale diff --git a/rigs/yaesu/ftdx101.c b/rigs/yaesu/ftdx101.c index 82e5d5eea..1ae7918c6 100644 --- a/rigs/yaesu/ftdx101.c +++ b/rigs/yaesu/ftdx101.c @@ -173,7 +173,7 @@ struct rig_caps ftdx101d_caps = RIG_MODEL(RIG_MODEL_FTDX101D), .model_name = "FTDX-101D", .mfg_name = "Yaesu", - .version = NEWCAT_VER ".21", + .version = NEWCAT_VER ".22", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -238,6 +238,7 @@ struct rig_caps ftdx101d_caps = .bank_qty = 0, .chan_desc_sz = 0, .rfpower_meter_cal = FTDX101D_RFPOWER_METER_WATTS_CAL, + .alc_cal = FTDX101D_ALC_METER_CAL, .str_cal = FTDX101D_STR_CAL, .swr_cal = FTDX101D_SWR_CAL, .chan_list = { diff --git a/rigs/yaesu/ftdx101.h b/rigs/yaesu/ftdx101.h index 64a433a3c..f0e3c3972 100644 --- a/rigs/yaesu/ftdx101.h +++ b/rigs/yaesu/ftdx101.h @@ -73,6 +73,15 @@ RIG_OP_UP|RIG_OP_DOWN|RIG_OP_BAND_UP|RIG_OP_BAND_DOWN|\ RIG_OP_TO_VFO|RIG_OP_FROM_VFO|RIG_OP_TOGGLE) +#define FTDX101D_ALC_METER_CAL \ +{ \ + 2, \ + { \ + {0, 0.0f}, \ + {121, 1.0f} \ + } \ +} + #define FTDX101D_RFPOWER_METER_CAL \ { \ 6, \ commit ed52875c3d6988917b84cae6f96f2440063453e3 Merge: 43f8afa6a c2d3202ff Author: Michael Black <mdb...@ya...> Date: Mon Mar 10 09:24:53 2025 -0500 Merge pull request #1679 from gereta/patch-3 Update skywatcher.h - Added coordinates for parking position commit c2d3202ffb0f4c51431b982ca023a586fcdbafc0 Author: gereta <355...@us...> Date: Mon Mar 10 08:18:46 2025 +0100 Update skywatcher.h - Added coordinates for parking position Added coordinates for parking position diff --git a/rotators/skywatcher/skywatcher.h b/rotators/skywatcher/skywatcher.h index 2164098ff..70c6c5dfc 100644 --- a/rotators/skywatcher/skywatcher.h +++ b/rotators/skywatcher/skywatcher.h @@ -20,6 +20,9 @@ #ifndef HAMLIB_SKYWATCHER_H #define HAMLIB_SKYWATCHER_H 1 +#define SKYWATCHER_PARK_AZ 0 +#define SKYWATCHER_PARK_EL 0 + #include "rotator.h" extern const struct rot_caps skywatcher_rot_caps; commit a3e23e79cd97b4c48ea56cc2776b68d86db61a08 Author: George Baltz N3GB <Geo...@gm...> Date: Tue Mar 4 21:32:34 2025 -0500 Minor cleanups/fixes Return status from rig_send_morse Remove duplicate include and some dead code Avoid future NULL dereference in error cases diff --git a/src/rig.c b/src/rig.c index dffbcbcbc..0e5aa74e7 100644 --- a/src/rig.c +++ b/src/rig.c @@ -61,9 +61,8 @@ #include <sys/types.h> #include <sys/stat.h> #include <errno.h> -#include "mutex.h" -#include <hamlib/rig.h> +#include "mutex.h" #include "serial.h" #include "parallel.h" #include "network.h" @@ -957,9 +956,7 @@ int HAMLIB_API rig_open(RIG *rig) { struct rig_caps *caps; struct rig_state *rs; - hamlib_port_t *rp = RIGPORT(rig); - hamlib_port_t *pttp = PTTPORT(rig); - hamlib_port_t *dcdp = DCDPORT(rig); + hamlib_port_t *rp, *pttp, *dcdp; int status = RIG_OK; value_t parm_value; //unsigned int net1, net2, net3, net4, net5, net6, net7, net8, port; @@ -975,6 +972,9 @@ int HAMLIB_API rig_open(RIG *rig) caps = rig->caps; rs = STATE(rig); + rp = RIGPORT(rig); + pttp = PTTPORT(rig); + dcdp = DCDPORT(rig); rp->rig = rig; rs->rigport_deprecated.rig = rig; @@ -1685,9 +1685,7 @@ int HAMLIB_API rig_open(RIG *rig) int HAMLIB_API rig_close(RIG *rig) { const struct rig_caps *caps; - hamlib_port_t *rp = RIGPORT(rig); - hamlib_port_t *pttp = PTTPORT(rig); - hamlib_port_t *dcdp = DCDPORT(rig); + hamlib_port_t *rp, *pttp, *dcdp; struct rig_state *rs; if (!rig || !rig->caps) @@ -1701,6 +1699,9 @@ int HAMLIB_API rig_close(RIG *rig) caps = rig->caps; rs = STATE(rig); + rp = RIGPORT(rig); + pttp = PTTPORT(rig); + dcdp = DCDPORT(rig); if (!rs->comm_state) { @@ -7476,9 +7477,10 @@ int HAMLIB_API rig_send_morse(RIG *rig, vfo_t vfo, const char *msg) LOCK(1); retcode = caps->send_morse(rig, vfo, msg); LOCK(0); +#else + retcode = push(rs->fifo_morse, msg); #endif - push(rs->fifo_morse, msg); - RETURNFUNC(RIG_OK); + RETURNFUNC(retcode); } if (!caps->set_vfo) @@ -8404,20 +8406,6 @@ void rig_lock(RIG *rig, int lock) struct rig_state *rs = STATE(rig); -#if 0 - if (rs->multicast == NULL) - { - rig_debug(RIG_DEBUG_BUG, "%s: locking skipped, lock = %d\n", __func__, lock); - return; - } // not initialized yet - - if (!rs->multicast->mutex_initialized) - { - rs->multicast->mutex = initializer; - rs->multicast->mutex_initialized = 1; - } -#endif - if (lock) { pthread_mutex_lock(&rs->api_mutex); @@ -9058,7 +9046,7 @@ int morse_data_handler_set_keyspd(RIG *rig, int keyspd) * Get the address of a structure without relying on changeable * internal data organization. * - * \retval The address of the enumed structure + * \retval The address of the enumed structure, NULL if error * * Note: This is meant for use by the HAMLIB_???PORT macros mostly. Only * compatibility with them is supported. @@ -9067,6 +9055,13 @@ int morse_data_handler_set_keyspd(RIG *rig, int keyspd) */ HAMLIB_EXPORT(void *) rig_data_pointer(RIG *rig, rig_ptrx_t idx) { + + if (!rig) + { + rig_debug(RIG_DEBUG_ERR, "%s: missing rig\n", __func__); + return NULL; + } + switch (idx) { case RIG_PTRX_RIGPORT: commit 9b2904c0b676dc4ed57bd09e300b6a1e81b930c8 Author: George Baltz N3GB <Geo...@gm...> Date: Tue Mar 4 16:58:43 2025 -0500 Fix timeout in kenwood_stop_morse Add "KY0" to exceptions. diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index d2e444a45..83a93270c 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -392,6 +392,7 @@ transaction_write: skip |= strncmp(cmdstr, "RD", 2) == 0; skip |= strncmp(cmdstr, "KYW", 3) == 0; skip |= strncmp(cmdstr, "KY ", 3) == 0; + skip |= strncmp(cmdstr, "KY0", 3) == 0; skip |= strncmp(cmdstr, "KY2", 3) == 0; skip |= strncmp(cmdstr, "PS1", 3) == 0; skip |= strncmp(cmdstr, "PS0", 3) == 0; @@ -400,7 +401,8 @@ transaction_write: if (skip) { // most command we give them a little time -- but not KY - if (strncmp(cmdstr, "KY ", 3) != 0 && strncmp(cmdstr, "KY2", 3) != 0) + if (strncmp(cmdstr, "KY", 2) != 0 || (cmdstr[2] != ' ' && cmdstr[2] != '0' + && cmdstr[2] != '2')) { hl_usleep(200 * 1000); // give little settle time for these commands } commit 5caa22b79a5532b2848a8e6689e0be2b36a94fde Author: George Baltz N3GB <Geo...@gm...> Date: Mon Mar 3 15:49:12 2025 -0500 Add locking to rig_stop_morse and rig_wait_morse diff --git a/src/rig.c b/src/rig.c index bddb74d07..dffbcbcbc 100644 --- a/src/rig.c +++ b/src/rig.c @@ -7545,14 +7545,18 @@ int HAMLIB_API rig_stop_morse(RIG *rig, vfo_t vfo) resetFIFO(rs->fifo_morse); // clear out the CW queue + LOCK(1); if (vfo == RIG_VFO_CURR || vfo == rs->current_vfo) { - RETURNFUNC(caps->stop_morse(rig, vfo)); + retcode = caps->stop_morse(rig, vfo); + LOCK(0); + RETURNFUNC(retcode); } if (!caps->set_vfo) { + LOCK(0); RETURNFUNC(-RIG_ENAVAIL); } @@ -7562,6 +7566,7 @@ int HAMLIB_API rig_stop_morse(RIG *rig, vfo_t vfo) if (retcode != RIG_OK) { + LOCK(0); RETURNFUNC(retcode); } @@ -7576,6 +7581,7 @@ int HAMLIB_API rig_stop_morse(RIG *rig, vfo_t vfo) retcode = rc2; } + LOCK(0); RETURNFUNC(retcode); } @@ -7645,14 +7651,18 @@ int HAMLIB_API rig_wait_morse(RIG *rig, vfo_t vfo) caps = rig->caps; + LOCK(1); if (vfo == RIG_VFO_CURR || vfo == STATE(rig)->current_vfo) { - RETURNFUNC(wait_morse_ptt(rig, vfo)); + retcode = wait_morse_ptt(rig, vfo); + LOCK(0); + RETURNFUNC(retcode); } if (!caps->set_vfo) { + LOCK(0); RETURNFUNC(-RIG_ENAVAIL); } @@ -7662,6 +7672,7 @@ int HAMLIB_API rig_wait_morse(RIG *rig, vfo_t vfo) if (retcode != RIG_OK) { + LOCK(0); RETURNFUNC(retcode); } @@ -7676,6 +7687,7 @@ int HAMLIB_API rig_wait_morse(RIG *rig, vfo_t vfo) retcode = rc2; } + LOCK(0); RETURNFUNC(retcode); } commit 43f8afa6a4f13fbfb96c2ec75f25ddfb5da9a8e2 Author: Michael Black W9MDB <mdb...@ya...> Date: Tue Mar 4 14:43:40 2025 -0600 Add simicr8600 diff --git a/simulators/Makefile.am b/simulators/Makefile.am index 489484799..a58e79147 100644 --- a/simulators/Makefile.am +++ b/simulators/Makefile.am @@ -8,7 +8,7 @@ DISTCLEANFILES = bin_PROGRAMS = -check_PROGRAMS = simelecraft simicgeneric simkenwood simyaesu simic9100 simic9700 simft991 simftdx1200 simftdx3000 simjupiter simpowersdr simid5100 simft736 simftdx5000 simtmd700 simrotorez simspid simft817 simts590 simft847 simic7300 simic7000 simic7100 simic7200 simatd578 simic905 simts450 simic7600 simic7610 simic705 simts950 simts990 simic7851 simftdx101 simxiegug90 simqrplabs simft818 simic275 simtrusdx simft1000 simtmd710 simts890 simxiegux108g simxiegux6100 simic910 simft450 simelecraftk4 simmicom simflex simft710 simic2730 simorion simpmr171 simic7700 simft990 simpstrotator simeasycomm +check_PROGRAMS = simelecraft simicgeneric simkenwood simyaesu simic9100 simic9700 simft991 simftdx1200 simftdx3000 simjupiter simpowersdr simid5100 simft736 simftdx5000 simtmd700 simrotorez simspid simft817 simts590 simft847 simic7300 simic7000 simic7100 simic7200 simatd578 simic905 simts450 simic7600 simic7610 simic705 simts950 simts990 simic7851 simftdx101 simxiegug90 simqrplabs simft818 simic275 simtrusdx simft1000 simtmd710 simts890 simxiegux108g simxiegux6100 simic910 simft450 simelecraftk4 simmicom simflex simft710 simic2730 simorion simpmr171 simic7700 simft990 simpstrotator simeasycomm simicr8600 simelecraft_SOURCES = simelecraft.c simkenwood_SOURCES = simkenwood.c diff --git a/simulators/simicr8600.c b/simulators/simicr8600.c new file mode 100644 index 000000000..8a29e2ffd --- /dev/null +++ b/simulators/simicr8600.c @@ -0,0 +1,485 @@ +// 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 +#if 0 +struct ip_mreq +{ + int dummy; +}; +#endif + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> +#include <fcntl.h> +#include <sys/time.h> +#include <hamlib/rig.h> +#include "../src/misc.h" +#include "sim.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_CW; +mode_t modeB = RIG_MODE_USB; +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; + +void dumphex(const unsigned char *buf, int n) +{ + for (int i = 0; i < n; ++i) { printf("%02x ", buf[i]); } + + printf("\n"); +} + +int +frameGet(int fd, unsigned char *buf) +{ + int i = 0; + memset(buf, 0, BUFSIZE); + unsigned char c; + + while (read(fd, &c, 1) > 0) + { + buf[i++] = c; + //printf("i=%d, c=0x%02x\n",i,c); + + if (c == 0xfd) + { + dumphex(buf, i); + return i; + } + } + + printf("Error %s\n", strerror(errno)); + + return 0; +} + +void frameParse(int fd, unsigned char *frame, int len) +{ + double freq; + + if (len == 0) + { + printf("%s: len==0\n", __func__); + return; + } + + 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; + 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; + 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; + 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; + WRITE(fd, frame, 6); + break; + + case 0x07: + switch (frame[5]) + { + case 0x00: current_vfo = RIG_VFO_VFO; break; + + case 0x01: current_vfo = RIG_VFO_MEM; break; + + printf("set_vfo to %s\n", rig_strvfo(current_vfo)); + + frame[4] = 0xfb; + frame[5] = 0xfd; + WRITE(fd, frame, 6); + break; + + case 0x0f: + if (frame[5] == 0) { split = 0; } + else { split = 1; } + + printf("set split %d\n", 1); + frame[4] = 0xfb; + frame[5] = 0xfd; + 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("n=WRITE 8 bytes\n"); + dump_hex(frame, 8); + WRITE(fd, frame, 8); + break; + + case 0x14: + switch (frame[5]) + { + static int power_level = 0; + static int level = 0; + + case 0x01: + level = 255; + printf("Using AF level %d\n", level); + to_bcd(&frame[6], (long long) level, 2); + frame[8] = 0xfd; + WRITE(fd, frame, 9); + 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; + WRITE(fd, frame, 9); + break; + } + + break; + + case 0x15: + switch (frame[5]) + { + static int meter_level = 0; + + 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; + WRITE(fd, frame, 9); + break; + } + + break; + + case 0x18: // miscellaneous things + frame[5] = 1; + frame[6] = 0xfd; + 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; + WRITE(fd, frame, 8); + break; + + case 0x04: // IC7200 data mode + frame[6] = 0; + frame[7] = 0; + frame[8] = 0xfd; + WRITE(fd, frame, 9); + break; + + case 0x07: // satmode + frame[6] = 0; + frame[7] = 0xfd; + WRITE(fd, frame, 8); + break; + + } + + break; + + case 0x1c: + switch (frame[5]) + { + case 0: + if (frame[6] == 0xfd) + { + frame[6] = ptt; + frame[7] = 0xfd; + WRITE(fd, frame, 8); + } + else + { + ptt = frame[6]; + frame[7] = 0xfb; + frame[8] = 0xfd; + WRITE(fd, frame, 9); + } + + break; + + } + + break; + + +#ifdef X25 + + case 0x25: + if (frame[6] == 0xfd) + { + if (frame[5] == 0x00) + { + to_bcd(&frame[6], (long long)freqA, (civ_731_mode ? 4 : 5) * 2); + printf("get_freqA=%.0f\n", freqA); + } + else + { + to_bcd(&frame[6], (long long)freqB, (civ_731_mode ? 4 : 5) * 2); + printf("get_freqB=%.0f\n", freqB); + } + + frame[11] = 0xfd; + WRITE(fd, frame, 12); + } + else + { + freq = from_bcd(&frame[6], (civ_731_mode ? 4 : 5) * 2); + printf("set_freq to %.0f\n", freq); + + if (frame[5] == 0x00) { freqA = freq; } + else { freqB = freq; } + + frame[4] = 0xfb; + frame[5] = 0xfd; + WRITE(fd, frame, 6); + } + + break; + + case 0x26: + for (int i = 0; i < 6; ++i) { printf("%02x:", frame[i]); } + + if (frame[6] == 0xfd) // then a query + { + for (int i = 0; i < 6; ++i) { printf("%02x:", frame[i]); } + + frame[6] = frame[5] == 0 ? modeA : modeB; + frame[7] = frame[5] == 0 ? datamodeA : datamodeB; + frame[8] = 0xfb; + frame[9] = 0xfd; + WRITE(fd, frame, 10); + } + else + { + for (int i = 0; i < 12; ++i) { printf("%02x:", frame[i]); } + + if (frame[5] == 0) + { + modeA = frame[6]; + datamodeA = frame[7]; + } + else + { + modeB = frame[6]; + datamodeB = frame[7]; + } + + frame[4] = 0xfb; + frame[5] = 0xfd; + WRITE(fd, frame, 6); + } + + printf("\n"); + break; +#else + + case 0x25: + 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]); + } + + // don't care about the rig type yet + +} + +#if defined(WIN32) || defined(_WIN32) +int openPort(char *comport) // doesn't matter for using pts devices +{ + int fd; + fd = open(comport, O_RDWR); + + if (fd < 0) + { + perror(comport); + } + + return fd; +} + +#else +int openPort(char *comport) // doesn't matter for using pts devices +{ + int fd = posix_openpt(O_RDWR); + char *name = ptsname(fd); + + if (name == NULL) + { + perror("pstname"); + return -1; + } + + printf("name=%s\n", name); + + if (fd == -1 || grantpt(fd) == -1 || unlockpt(fd) == -1) + { + perror("posix_openpt"); + return -1; + } + + return fd; +} +#endif + +void rigStatus() +{ + char vfoa = current_vfo == RIG_VFO_A ? '*' : ' '; + char vfob = current_vfo == RIG_VFO_B ? '*' : ' '; + printf("%cVFOA: mode=%d datamode=%d width=%ld freq=%.0f\n", vfoa, modeA, + datamodeA, + widthA, + freqA); + printf("%cVFOB: mode=%d datamode=%d width=%ld freq=%.0f\n", vfob, modeB, + datamodeB, + widthB, + freqB); +} + +int main(int argc, char **argv) +{ + unsigned char buf[256]; + 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) + { + printf("Missing comport argument\n"); + printf("%s [comport]\n", argv[0]); + exit(1); + } + +#endif + + while (1) + { + int len = frameGet(fd, buf); + + if (len <= 0) + { + close(fd); + fd = openPort(argv[1]); + } + + frameParse(fd, buf, len); + rigStatus(); + } + + return 0; +} commit 7269ba62647a613ba7b63fc6ddbd2070ba7f9db5 Merge: 701d6bf47 f2f947c51 Author: Michael Black W9MDB <mdb...@ya...> Date: Tue Mar 4 14:42:32 2025 -0600 Merge branch 'master' of github.com:Hamlib/Hamlib commit 701d6bf477f784192684c8035cd874d10966a5e6 Author: Michael Black W9MDB <mdb...@ya...> Date: Tue Mar 4 14:41:31 2025 -0600 Hopefully fix CODAN NGS set_freq/get_freq diff --git a/rigs/codan/codan.c b/rigs/codan/codan.c index a311105d9..996d2c595 100644 --- a/rigs/codan/codan.c +++ b/rigs/codan/codan.c @@ -55,7 +55,7 @@ int codan_transaction(RIG *rig, char *cmd, int expected, char **result) // Seems the 2110 wants CR instead of LF if (rig->caps->rig_model == RIG_MODEL_CODAN_2110 || rig->caps->rig_model == RIG_MODEL_CODAN_NGT) { - SNPRINTF(cmd_buf, sizeof(cmd_buf), "%s%c", cmd, 0x0d); + SNPRINTF(cmd_buf, sizeof(cmd_buf), "%s%c%c", cmd, 0x0d, 0x0a); } else { @@ -170,7 +170,7 @@ int codan_init(RIG *rig) RETURNFUNC2(RIG_OK); } -int codan_set_freq_2110(RIG *rig, vfo_t vfo, freq_t freq) +int codan_set_freq_ngt(RIG *rig, vfo_t vfo, freq_t freq) { char cmd_buf[MAXCMDLEN]; int retval; @@ -179,7 +179,7 @@ int codan_set_freq_2110(RIG *rig, vfo_t vfo, freq_t freq) rig_strvfo(vfo), freq); // Purportedly can't do split so we just set VFOB=VFOA - SNPRINTF(cmd_buf, sizeof(cmd_buf), "\rfreq %.0f", freq / 1000); + SNPRINTF(cmd_buf, sizeof(cmd_buf), "\rfreq %.3f", freq / 1000); char *response = NULL; retval = codan_transaction(rig, cmd_buf, 0, &response); @@ -207,9 +207,9 @@ int codan_open(RIG *rig) codan_transaction(rig, "login", 1, &results); - if (rig->caps->rig_model == RIG_MODEL_CODAN_2110) + if (rig->caps->rig_model == RIG_MODEL_CODAN_NGT) { - codan_set_freq_2110(rig, RIG_VFO_A, 14074000.0); + codan_set_freq_ngt(rig, RIG_VFO_A, 14074000.0); } else { @@ -385,6 +385,9 @@ int codan_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) retval = sscanf(response, "FREQ: %lg", freq); + if (retval == 0) + retval = sscanf(response, "CHAN: %lg", freq); + *freq *= 1000; // returned freq is in kHz if (retval != 1) @@ -491,7 +494,7 @@ int codan_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) return RIG_OK; } -int codan_set_ptt_2110(RIG *rig, vfo_t vfo, ptt_t ptt) +int codan_set_ptt_ngs(RIG *rig, vfo_t vfo, ptt_t ptt) { int retval; char cmd_buf[MAXCMDLEN]; @@ -585,7 +588,7 @@ struct rig_caps codan_ngt_caps = RIG_MODEL(RIG_MODEL_CODAN_NGT), .model_name = "NGT", .mfg_name = "CODAN", - .version = BACKEND_VER ".2", + .version = BACKEND_VER ".3", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -635,7 +638,7 @@ struct rig_caps codan_ngt_caps = .rig_open = codan_open, - .set_freq = codan_set_freq, + .set_freq = codan_set_freq_ngt, .get_freq = codan_get_freq, .set_mode = codan_set_mode, .get_mode = codan_get_mode, @@ -650,7 +653,7 @@ struct rig_caps codan_2110_caps = RIG_MODEL(RIG_MODEL_CODAN_2110), .model_name = "2110", .mfg_name = "CODAN", - .version = BACKEND_VER ".1", + .version = BACKEND_VER ".0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -699,13 +702,13 @@ struct rig_caps codan_2110_caps = .rig_open = codan_open, .rig_cleanup = codan_cleanup, - .set_freq = codan_set_freq_2110, + .set_freq = codan_set_freq, .get_freq = codan_get_freq, .set_mode = codan_set_mode, .get_mode = codan_get_mode, - .set_ptt = codan_set_ptt_2110, - .get_ptt = codan_get_ptt_2110, + .set_ptt = codan_set_ptt, + .get_ptt = codan_get_ptt, .hamlib_check_rig_caps = HAMLIB_CHECK_RIG_CAPS }; @@ -714,7 +717,7 @@ DECLARE_INITRIG_BACKEND(codan) rig_debug(RIG_DEBUG_VERBOSE, "%s: _init called\n", __func__); rig_register(&codan_envoy_caps); - rig_register(&codan_ngs_caps); + rig_register(&codan_ngt_caps); rig_register(&codan_2110_caps); rig_debug(RIG_DEBUG_VERBOSE, "%s: _init back from rig_register\n", __func__); diff --git a/rigs/codan/codan.h b/rigs/codan/codan.h index 96ae9e10d..2338be809 100644 --- a/rigs/codan/codan.h +++ b/rigs/codan/codan.h @@ -35,7 +35,7 @@ #define CODAN_DATA_LEN 64 extern struct rig_caps codan_envoy_caps; -extern struct rig_caps codan_ngs_caps; +extern struct rig_caps codan_ngt_caps; extern struct rig_caps codan_2021_caps; struct codan_priv_data { diff --git a/src/rig.c b/src/rig.c index 6e772fcf0..c016f30f4 100644 --- a/src/rig.c +++ b/src/rig.c @@ -1551,9 +1551,11 @@ int HAMLIB_API rig_open(RIG *rig) if (ICOM_EXCEPTIONS) { myvfo = RIG_VFO_MAIN_A; } + if ((STATE(rig)->vfo_list & RIG_VFO_VFO) == RIG_VFO_VFO) { myvfo = RIG_VFO_VFO; } + retval = rig_get_freq(rig, myvfo, &freq); - if (retval == RIG_OK && rig->caps->rig_model != RIG_MODEL_F6K) + if (retval == RIG_OK && rig->caps->rig_model != RIG_MODEL_F6K && ((STATE(rig)->vfo_list & RIG_VFO_VFO) == RIG_VFO_VFO)) { split_t split = RIG_SPLIT_OFF; vfo_t tx_vfo = RIG_VFO_NONE; commit 3dbb7011d1a2c14cc0f2351c321b66787d51e9f3 Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Mar 1 16:42:15 2025 -0600 Fix NGT caps name diff --git a/rigs/codan/codan.c b/rigs/codan/codan.c index 53fa82f6d..a311105d9 100644 --- a/rigs/codan/codan.c +++ b/rigs/codan/codan.c @@ -580,7 +580,7 @@ struct rig_caps codan_envoy_caps = .hamlib_check_rig_caps = HAMLIB_CHECK_RIG_CAPS }; -struct rig_caps codan_ngs_caps = +struct rig_caps codan_ngt_caps = { RIG_MODEL(RIG_MODEL_CODAN_NGT), .model_name = "NGT", commit 6b11c7e970ba9f7a348ba4836d94bfcf177f2ece Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Mar 1 16:40:14 2025 -0600 Remove ptt from CODAN NGS -- does not have it diff --git a/rigs/codan/codan.c b/rigs/codan/codan.c index bf7078eaf..53fa82f6d 100644 --- a/rigs/codan/codan.c +++ b/rigs/codan/codan.c @@ -515,11 +515,6 @@ int codan_set_ptt_2110(RIG *rig, vfo_t vfo, ptt_t ptt) return RIG_OK; } - - - - - struct rig_caps codan_envoy_caps = { RIG_MODEL(RIG_MODEL_CODAN_ENVOY), @@ -590,7 +585,7 @@ struct rig_caps codan_ngs_caps = RIG_MODEL(RIG_MODEL_CODAN_NGT), .model_name = "NGT", .mfg_name = "CODAN", - .version = BACKEND_VER ".1", + .version = BACKEND_VER ".2", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -638,13 +633,15 @@ struct rig_caps codan_ngs_caps = .rig_init = codan_init, .rig_cleanup = codan_cleanup, + .rig_open = codan_open, + .set_freq = codan_set_freq, .get_freq = codan_get_freq, .set_mode = codan_set_mode, .get_mode = codan_get_mode, - .set_ptt = codan_set_ptt, - .get_ptt = codan_get_ptt, + //.set_ptt = codan_set_ptt, // does not have it + //.get_ptt = codan_get_ptt, .hamlib_check_rig_caps = HAMLIB_CHECK_RIG_CAPS }; commit f2f947c51d45f5596afd0b8b3c8df7c3d88d93dd Merge: 3d4664780 0147da5a3 Author: Michael Black <mdb...@ya...> Date: Fri Feb 28 06:13:46 2025 -0600 Merge pull request #1675 from GeoBaltz/fix26 DO NOT MERGE! commit 0147da5a3ca8dc0f874d2a43ff5a2e702bbc4f41 Author: George Baltz N3GB <Geo...@gm...> Date: Fri Feb 28 05:29:44 2025 -0500 Replace rs->multicast->mutex with a dedicated mutex for the API. Use PTHREAD_MUTEX_RECURSIVE and change LOCK() to always call rig_lock(). Still needs a reliable way to determine availability. diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h index 6db75e359..ea6bd8db0 100644 --- a/include/hamlib/rig.h +++ b/include/hamlib/rig.h @@ -2891,6 +2891,7 @@ struct rig_state { struct timespec freq_event_elapsed; int freq_skip; /*!< allow frequency skip for gpredict RX/TX freq set */ client_t client; + pthread_mutex_t api_mutex; // Lock for any API entry // New rig_state items go before this line ============================================ }; diff --git a/src/rig.c b/src/rig.c index 6232a46b7..5234e3f3c 100644 --- a/src/rig.c +++ b/src/rig.c @@ -171,11 +171,21 @@ const char hamlib_copyright[231] = /* hamlib 1.2 ABI specifies 231 bytes */ #define ICOM_EXCEPTIONS (rig->caps->rig_model == RIG_MODEL_IC9700 || rig->caps->rig_model == RIG_MODEL_IC9100 || rig->caps->rig_model == RIG_MODEL_IC910) +// If the OS/library supports it, use a recursive mutex for the main lock. +// This eliminates depth races, and guards against multiple app threads, too. +// Set define to 0 to use depth-based locking. It should be deduced from the +// environment, but I can't find a fine-grained enough parameter. Should be +// OK on any POSIX-2017 or later system. +#define USE_RECURSIVE_MUTEX 1 +#if USE_RECURSIVE_MUTEX +#define LOCK(n) rig_lock(rig,n) +#else // The LOCK m... [truncated message content] |