[Hamlib-commits] Hamlib -- Ham radio control libraries branch master updated. d444fe43c61477ea82300
Library to control radio transceivers and receivers
Brought to you by:
n0nb
From: n0nb <n0...@us...> - 2024-11-18 15:33:44
|
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 d444fe43c61477ea823009ab5de24c69cf4de817 (commit) via eafdf897056165aecd6f67de1950290c5d9b2373 (commit) via b86822064a25abc0d70cfad7129ba4b6850ba9c4 (commit) via 05d7551c22bf568a2e081fb9bd0560b302acd06a (commit) via 92b692bd919434d509ce922204417b7b55fa1caa (commit) via 06bd1fe3e190173ea2ee0e47790bd0d396877975 (commit) via 1d3941d1175bc7da0b5f7d6d3de3efd80c91b268 (commit) via fbcd0f166748648d695e1cd966c0e6fa012f21d0 (commit) via 320daa975a441acae11c44be4dcdd95be498c380 (commit) via 22c00013206b021d95606af67bee01bfb3253c8a (commit) via 3bd462308ceaef956ba0a40564e9529ea0aaa6f8 (commit) via 356776f4bf56098c1afe1d59333c8b5c836513d4 (commit) via 27643a9a0edb147a5fb8aa20b4bb5bfc8bbb2711 (commit) via 7a98365c151b6aa15e1940556575042e18c25d2c (commit) via 473a77406e90db47ff6cfbd8b05038a55e67eb5b (commit) via c22392e5cd8654874b9e18bdc99d80293c0f28a8 (commit) via 32e6b90f4abbea1da9fbf0f3f88327ae624e2a3e (commit) via 6dcd60c2ac68bed9b5129befdac71f06d265cdce (commit) via 84b733d028cd00cdb3210cd12d1e79e3dd558b54 (commit) via 0bd214f2c46131da04ac83ccdbab5bb8a99343df (commit) via ec36b21f5415c57b6135dc3cdd35d047e6a36bff (commit) via 10292fd3383ff28b384ab7c42c63c19733c0e121 (commit) via dd9696cf2dc72d9397d290c3986d6b63a3cf7061 (commit) via d0b19252343ab4c584db3467b39de5dcce701309 (commit) via 27767fcfc1ce18ee06276d76f14decc569ba236c (commit) via 5c269964c28a32876dc04b715095e5d094b76055 (commit) via 7f8f7a0e58ea1ce01c2d63b53a30cc3d0da509e2 (commit) via ad70cc0ba46257ecd45dbe578b5fca2ef737fb6d (commit) via 4e4c82e83ca492aa51a208c1a577a2f45523be39 (commit) via d76da346f560a46bde785a436ca97e82ae25b735 (commit) via 4acfeef26a8cf9a0bbbcc95c5a55d922a7b1a079 (commit) via 5a9deee7d0132b656a15a56835eee758426a0e97 (commit) via 44bb600a01a7a1f4c44e115cc33910032db45eb3 (commit) from ece40e6bc28ee304a806181fc6483adec540c25c (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 d444fe43c61477ea823009ab5de24c69cf4de817 Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Nov 18 08:57:17 2024 -0600 Fix compile warnings from gcc 14.2.0 diff --git a/src/rig.c b/src/rig.c index 21948050c..a6cd5f2f3 100644 --- a/src/rig.c +++ b/src/rig.c @@ -1517,7 +1517,7 @@ int HAMLIB_API rig_open(RIG *rig) if (status < 0) { - rig_debug(RIG_DEBUG_ERR, "%s: cw_data_handler_start failed: %s\n", __func__, + rig_debug(RIG_DEBUG_ERR, "%s: cw_data_handler_start failed: %.23000s\n", __func__, rigerror(status)); port_close(rp, rp->type.rig); RETURNFUNC2(status); @@ -1602,7 +1602,7 @@ int HAMLIB_API rig_open(RIG *rig) if (retval != RIG_OK) { - rig_debug(RIG_DEBUG_ERR, "%s: network_multicast_publisher_start failed: %s\n", + rig_debug(RIG_DEBUG_ERR, "%s: network_multicast_publisher_start failed: %.23000s\n", __FILE__, rigerror(retval)); // we will consider this non-fatal for now @@ -1613,7 +1613,7 @@ int HAMLIB_API rig_open(RIG *rig) if (retval != RIG_OK) { - rig_debug(RIG_DEBUG_ERR, "%s: network_multicast_receiver_start failed: %s\n", + rig_debug(RIG_DEBUG_ERR, "%s: network_multicast_receiver_start failed: %.23000s\n", __FILE__, rigerror(retval)); // we will consider this non-fatal for now @@ -1623,7 +1623,7 @@ int HAMLIB_API rig_open(RIG *rig) if (retval != RIG_OK) { - rig_debug(RIG_DEBUG_ERR, "%s: rig_poll_routine_start failed: %s\n", __FILE__, + rig_debug(RIG_DEBUG_ERR, "%s: rig_poll_routine_start failed: %.23000s\n", __FILE__, rigerror(retval)); // we will consider this non-fatal for now } @@ -2287,7 +2287,7 @@ int rig_set_freq(RIG *rig, vfo_t vfo, freq_t freq) if (retcode != RIG_OK) { - rig_debug(RIG_DEBUG_ERR, "%s: set_vfo failed: %s\n", __func__, + rig_debug(RIG_DEBUG_ERR, "%s: set_vfo failed: %.23000s\n", __func__, rigerror(retcode)); } @@ -2913,7 +2913,7 @@ int HAMLIB_API rig_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) if (retcode != RIG_OK) { - rig_debug(RIG_DEBUG_TRACE, "%s: failed set_mode(%s)=%s\n", + rig_debug(RIG_DEBUG_TRACE, "%s: failed set_mode(%s)=%.23000s\n", __func__, rig_strrmode(mode), rigerror(retcode)); ELAPSED2; LOCK(0); @@ -3328,7 +3328,7 @@ int HAMLIB_API rig_set_vfo(RIG *rig, vfo_t vfo) if (retcode != RIG_OK) { - rig_debug(RIG_DEBUG_WARN, "%s: rig_get_vfo error=%s\n", __func__, + rig_debug(RIG_DEBUG_WARN, "%s: rig_get_vfo error=%.23000s\n", __func__, rigerror(retcode)); } @@ -8768,7 +8768,7 @@ void *morse_data_handler(void *arg) if (result != RIG_OK) { - rig_debug(RIG_DEBUG_ERR, "%s: error: %s\n", __func__, rigerror(result)); + rig_debug(RIG_DEBUG_ERR, "%s: error: %.23971s\n", __func__, rigerror(result)); if (result == -RIG_EINVAL) { commit eafdf897056165aecd6f67de1950290c5d9b2373 Author: Mike Black W9MDB <mdb...@ya...> Date: Sun Nov 17 16:54:05 2024 -0600 Fix for FT817 when rig is manually set to non-dig mode and WSJTX then tries digmode Memory was not reflecing non-digmode when FM was selected so we now check to see if mode is changing diff --git a/rigs/yaesu/ft817.c b/rigs/yaesu/ft817.c index 859aa9faa..68a28bf73 100644 --- a/rigs/yaesu/ft817.c +++ b/rigs/yaesu/ft817.c @@ -310,7 +310,7 @@ struct rig_caps ft817_caps = RIG_MODEL(RIG_MODEL_FT817), .model_name = "FT-817", .mfg_name = "Yaesu", - .version = "20241112.0", + .version = "20241117.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -460,7 +460,7 @@ struct rig_caps q900_caps = RIG_MODEL(RIG_MODEL_Q900), .model_name = "Q900", .mfg_name = "Guohe", - .version = "20241112.0", + .version = "20241117.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -610,7 +610,7 @@ struct rig_caps ft818_caps = RIG_MODEL(RIG_MODEL_FT818), .model_name = "FT-818", .mfg_name = "Yaesu", - .version = "20221112.0", + .version = "20221117.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -1710,11 +1710,15 @@ static int ft817_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) digmode[0] = digmode[0] >> 5; // shift 5 bits // check if we're already in the mode and return if so - if (digmode[0] == 0x00 && mode == RIG_MODE_RTTY) { return RIG_OK; } - else if (digmode[0] == 0x01 && mode == RIG_MODE_PSKR) { return RIG_OK; } - else if (digmode[0] == 0x02 && mode == RIG_MODE_PSK) { return RIG_OK; } - else if (digmode[0] == 0x03 && mode == RIG_MODE_PKTLSB) { return RIG_OK; } - else if (digmode[0] == 0x04 && mode == RIG_MODE_PKTUSB) { return RIG_OK; } + // the memory check was failing when in FM mode -- still showing digmode + if (rig->state.current_mode == mode) + { + if (digmode[0] == 0x00 && mode == RIG_MODE_RTTY) { return RIG_OK; } + else if (digmode[0] == 0x01 && mode == RIG_MODE_PSKR) { return RIG_OK; } + else if (digmode[0] == 0x02 && mode == RIG_MODE_PSK) { return RIG_OK; } + else if (digmode[0] == 0x03 && mode == RIG_MODE_PKTLSB) { return RIG_OK; } + else if (digmode[0] == 0x04 && mode == RIG_MODE_PKTUSB) { return RIG_OK; } + } memcpy(data, ncmd[FT817_NATIVE_CAT_EEPROM_WRITE].nseq, YAESU_CMD_LENGTH); commit b86822064a25abc0d70cfad7129ba4b6850ba9c4 Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Nov 14 16:24:39 2024 -0600 Change all Flex-radio to FlexRadio diff --git a/rigs/flexradio/sdr1k.c b/rigs/flexradio/sdr1k.c index e31e2438b..e66de1632 100644 --- a/rigs/flexradio/sdr1k.c +++ b/rigs/flexradio/sdr1k.c @@ -114,7 +114,7 @@ struct rig_caps sdr1k_rig_caps = { RIG_MODEL(RIG_MODEL_SDR1000), .model_name = "SDR-1000", - .mfg_name = "Flex-radio", + .mfg_name = "FlexRadio", .version = "20200323.0", .copyright = "LGPL", .status = RIG_STATUS_BETA, diff --git a/rigs/flexradio/smartsdr_caps.h b/rigs/flexradio/smartsdr_caps.h index 5396f5fde..4736412f2 100644 --- a/rigs/flexradio/smartsdr_caps.h +++ b/rigs/flexradio/smartsdr_caps.h @@ -1,4 +1,4 @@ - .mfg_name = "Flex-radio", + .mfg_name = "FlexRadio", .version = "20240814.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, diff --git a/rigs/kenwood/flex6xxx.c b/rigs/kenwood/flex6xxx.c index e2da38baf..76da92547 100644 --- a/rigs/kenwood/flex6xxx.c +++ b/rigs/kenwood/flex6xxx.c @@ -1339,7 +1339,7 @@ struct rig_caps f6k_caps = { RIG_MODEL(RIG_MODEL_F6K), .model_name = "6xxx", - .mfg_name = "Flex-radio", + .mfg_name = "FlexRadio", .version = "20240829.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, @@ -1481,7 +1481,7 @@ struct rig_caps powersdr_caps = { RIG_MODEL(RIG_MODEL_POWERSDR), .model_name = "PowerSDR", - .mfg_name = "Flex-radio/Apache", + .mfg_name = "FlexRadio/Apache", .version = "20231107.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, commit 05d7551c22bf568a2e081fb9bd0560b302acd06a Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Nov 12 16:28:33 2024 -0600 Update msvc 2022 build to use lib instead of link Apparently it got changed diff --git a/scripts/build-w64.sh b/scripts/build-w64.sh index fff9b6241..665dfadf6 100755 --- a/scripts/build-w64.sh +++ b/scripts/build-w64.sh @@ -206,7 +206,7 @@ not appear to be correct to generate a 64 bit libhamlib-4.lib file! For VS 2022: cd lib/msvc -c:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.32.31326\bin\Hostx64\x86\link.exe /lib /machine:i386 /def:libhamlib-4.def +c:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.32.31326\bin\Hostx64\x86\lib.exe /lib /machine:i386 /def:libhamlib-4.def The published Hamlib API may be found at: commit 92b692bd919434d509ce922204417b7b55fa1caa Merge: 06bd1fe3e 1d3941d11 Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Nov 12 16:07:58 2024 -0600 Merge branch 'master' of https://github.com/Hamlib/Hamlib commit 06bd1fe3e190173ea2ee0e47790bd0d396877975 Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Nov 12 16:06:57 2024 -0600 Fix ft817.c DIG/PKT modes https://github.com/Hamlib/Hamlib/issues/1629 diff --git a/rigs/yaesu/ft817.c b/rigs/yaesu/ft817.c index d492d46bc..859aa9faa 100644 --- a/rigs/yaesu/ft817.c +++ b/rigs/yaesu/ft817.c @@ -186,8 +186,8 @@ static const yaesu_cmd_set_t ncmd[] = { 1, { 0x04, 0x00, 0x00, 0x00, 0x07 } }, /* mode set main AM */ { 1, { 0x08, 0x00, 0x00, 0x00, 0x07 } }, /* mode set main FM */ { 1, { 0x88, 0x00, 0x00, 0x00, 0x07 } }, /* mode set main FM-N */ - { 1, { 0x0a, 0x00, 0x00, 0x00, 0x0a } }, /* mode set main DIG */ - { 1, { 0x0c, 0x00, 0x00, 0x00, 0x0c } }, /* mode set main PKT */ + { 1, { 0x0a, 0x00, 0x00, 0x00, 0x07 } }, /* mode set main DIG */ + { 1, { 0x0c, 0x00, 0x00, 0x00, 0x07 } }, /* mode set main PKT */ { 1, { 0x00, 0x00, 0x00, 0x00, 0x05 } }, /* clar on */ { 1, { 0x00, 0x00, 0x00, 0x00, 0x85 } }, /* clar off */ { 0, { 0x00, 0x00, 0x00, 0x00, 0xf5 } }, /* set clar freq */ @@ -310,7 +310,7 @@ struct rig_caps ft817_caps = RIG_MODEL(RIG_MODEL_FT817), .model_name = "FT-817", .mfg_name = "Yaesu", - .version = "20241109.0", + .version = "20241112.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -460,7 +460,7 @@ struct rig_caps q900_caps = RIG_MODEL(RIG_MODEL_Q900), .model_name = "Q900", .mfg_name = "Guohe", - .version = "20241109.0", + .version = "20241112.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -610,7 +610,7 @@ struct rig_caps ft818_caps = RIG_MODEL(RIG_MODEL_FT818), .model_name = "FT-818", .mfg_name = "Yaesu", - .version = "20221109.0", + .version = "20221112.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, commit 1d3941d1175bc7da0b5f7d6d3de3efd80c91b268 Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Nov 12 16:06:57 2024 -0600 Fix ft817.c DIG/PKT modes diff --git a/rigs/yaesu/ft817.c b/rigs/yaesu/ft817.c index d492d46bc..859aa9faa 100644 --- a/rigs/yaesu/ft817.c +++ b/rigs/yaesu/ft817.c @@ -186,8 +186,8 @@ static const yaesu_cmd_set_t ncmd[] = { 1, { 0x04, 0x00, 0x00, 0x00, 0x07 } }, /* mode set main AM */ { 1, { 0x08, 0x00, 0x00, 0x00, 0x07 } }, /* mode set main FM */ { 1, { 0x88, 0x00, 0x00, 0x00, 0x07 } }, /* mode set main FM-N */ - { 1, { 0x0a, 0x00, 0x00, 0x00, 0x0a } }, /* mode set main DIG */ - { 1, { 0x0c, 0x00, 0x00, 0x00, 0x0c } }, /* mode set main PKT */ + { 1, { 0x0a, 0x00, 0x00, 0x00, 0x07 } }, /* mode set main DIG */ + { 1, { 0x0c, 0x00, 0x00, 0x00, 0x07 } }, /* mode set main PKT */ { 1, { 0x00, 0x00, 0x00, 0x00, 0x05 } }, /* clar on */ { 1, { 0x00, 0x00, 0x00, 0x00, 0x85 } }, /* clar off */ { 0, { 0x00, 0x00, 0x00, 0x00, 0xf5 } }, /* set clar freq */ @@ -310,7 +310,7 @@ struct rig_caps ft817_caps = RIG_MODEL(RIG_MODEL_FT817), .model_name = "FT-817", .mfg_name = "Yaesu", - .version = "20241109.0", + .version = "20241112.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -460,7 +460,7 @@ struct rig_caps q900_caps = RIG_MODEL(RIG_MODEL_Q900), .model_name = "Q900", .mfg_name = "Guohe", - .version = "20241109.0", + .version = "20241112.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -610,7 +610,7 @@ struct rig_caps ft818_caps = RIG_MODEL(RIG_MODEL_FT818), .model_name = "FT-818", .mfg_name = "Yaesu", - .version = "20221109.0", + .version = "20221112.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, commit fbcd0f166748648d695e1cd966c0e6fa012f21d0 Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Nov 11 17:20:53 2024 -0600 Update async detection in icom.c diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 7223c3801..91771ca81 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -9130,7 +9130,7 @@ int icom_is_async_frame(RIG *rig, size_t frame_length, /* Spectrum scope data is not CI-V transceive data, but handled the same way as it is pushed by the rig */ // IC-7100 sends 0xe1 for broadcast frame? - return frame[2] == BCASTID || (frame[2] == CTRLID && frame[4] == C_CTL_SCP + return frame[2] == BCASTID || frame[2] == C_SND_MODE || (frame[2] == CTRLID && frame[4] == C_CTL_SCP && frame[5] == S_SCP_DAT); } commit 320daa975a441acae11c44be4dcdd95be498c380 Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Nov 11 17:14:56 2024 -0600 Ignore icom fe fe 01 packets diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index e2aef9411..7223c3801 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -9152,9 +9152,11 @@ int icom_process_async_frame(RIG *rig, size_t frame_length, * the rest is data * and don't forget one byte at the end for the EOM */ - if (frame[2] != 0x00) + if (frame[2] != 0x00 || frame[2] == 0x01) { - rig_debug(RIG_DEBUG_VERBOSE, "%s: 3rd byte not 0x00...not async\n", __func__); + // just ignoring 0x01 for now + // fe fe 01 94 1c 03 00 80 07 07 00 fd + rig_debug(RIG_DEBUG_VERBOSE, "%s: 3rd byte not 0x00 or is 0x01...not async\n", __func__); RETURNFUNC(RIG_OK); } commit 22c00013206b021d95606af67bee01bfb3253c8a Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Nov 11 17:01:11 2024 -0600 Another IC-PW2 change diff --git a/rigs/icom/frame.c b/rigs/icom/frame.c index 35f8cb197..a11a98867 100644 --- a/rigs/icom/frame.c +++ b/rigs/icom/frame.c @@ -347,7 +347,7 @@ again2: } // IC-PW2 was sending fe fe 94 aa 1c 03 - if (buf[3] == 0xaa) + if (buf[3] == 0xaa || buf[2] == 0xaa) { goto again2; } commit 3bd462308ceaef956ba0a40564e9529ea0aaa6f8 Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Nov 11 16:55:12 2024 -0600 Another IC-PW2 try diff --git a/rigs/icom/frame.c b/rigs/icom/frame.c index aefc23bb9..35f8cb197 100644 --- a/rigs/icom/frame.c +++ b/rigs/icom/frame.c @@ -347,7 +347,12 @@ again2: } // IC-PW2 was sending fe fe 94 aa 1c 03 - if (sendbuf[3] != buf[2] && buf[3] != 0xaa && buf[2] != 0xaa && buf[3] != 0xe0) + if (buf[3] == 0xaa) + { + goto again2; + } + + if (sendbuf[3] != buf[2]) { rig_debug(RIG_DEBUG_VERBOSE, "%s: unknown async? read again\n", __func__); hl_usleep(100); commit 356776f4bf56098c1afe1d59333c8b5c836513d4 Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Nov 11 16:48:54 2024 -0600 Another fix for IC-PW2 diff --git a/rigs/icom/frame.c b/rigs/icom/frame.c index 10e2b6df1..aefc23bb9 100644 --- a/rigs/icom/frame.c +++ b/rigs/icom/frame.c @@ -347,7 +347,7 @@ again2: } // IC-PW2 was sending fe fe 94 aa 1c 03 - if (sendbuf[3] != buf[2] && buf[3] != 0xaa && buf[3] != 0xe0) + if (sendbuf[3] != buf[2] && buf[3] != 0xaa && buf[2] != 0xaa && buf[3] != 0xe0) { rig_debug(RIG_DEBUG_VERBOSE, "%s: unknown async? read again\n", __func__); hl_usleep(100); commit 27643a9a0edb147a5fb8aa20b4bb5bfc8bbb2711 Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Nov 11 16:32:04 2024 -0600 Another fix for IC-PW2 diff --git a/rigs/icom/frame.c b/rigs/icom/frame.c index 6c2bbcea2..10e2b6df1 100644 --- a/rigs/icom/frame.c +++ b/rigs/icom/frame.c @@ -347,7 +347,7 @@ again2: } // IC-PW2 was sending fe fe 94 aa 1c 03 - if (sendbuf[3] != buf[2] && buf[3] != 0xaa) + if (sendbuf[3] != buf[2] && buf[3] != 0xaa && buf[3] != 0xe0) { rig_debug(RIG_DEBUG_VERBOSE, "%s: unknown async? read again\n", __func__); hl_usleep(100); commit 7a98365c151b6aa15e1940556575042e18c25d2c Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Nov 11 16:27:20 2024 -0600 Other file for IC-PW2 fix diff --git a/rigs/icom/frame.c b/rigs/icom/frame.c index 626724ecf..6c2bbcea2 100644 --- a/rigs/icom/frame.c +++ b/rigs/icom/frame.c @@ -346,7 +346,8 @@ again2: goto again2; } - if (sendbuf[3] != buf[2]) + // IC-PW2 was sending fe fe 94 aa 1c 03 + if (sendbuf[3] != buf[2] && buf[3] != 0xaa) { rig_debug(RIG_DEBUG_VERBOSE, "%s: unknown async? read again\n", __func__); hl_usleep(100); commit 473a77406e90db47ff6cfbd8b05038a55e67eb5b Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Nov 11 16:26:15 2024 -0600 Fix for async packet from IC-PW2 amplifier diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h index f7aa3a42c..2cf9259c0 100644 --- a/rigs/icom/icom.h +++ b/rigs/icom/icom.h @@ -35,7 +35,7 @@ #include <sys/time.h> #endif -#define BACKEND_VER "20241030" +#define BACKEND_VER "20241111" #define ICOM_IS_ID31 rig_is_model(rig, RIG_MODEL_ID31) #define ICOM_IS_ID51 rig_is_model(rig, RIG_MODEL_ID51) commit c22392e5cd8654874b9e18bdc99d80293c0f28a8 Author: Mike Black W9MDB <mdb...@ya...> Date: Sun Nov 10 09:53:35 2024 -0600 Update FLRig's model name with the connected rig in FLRig diff --git a/rigs/dummy/flrig.c b/rigs/dummy/flrig.c index c026c6aac..58b6e8692 100644 --- a/rigs/dummy/flrig.c +++ b/rigs/dummy/flrig.c @@ -143,7 +143,7 @@ struct rig_caps flrig_caps = RIG_MODEL(RIG_MODEL_FLRIG), .model_name = "", .mfg_name = "FLRig", - .version = "20240612.0", + .version = "20241110.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -850,6 +850,10 @@ static int flrig_open(RIG *rig) strncpy(priv->info, value, sizeof(priv->info)); rig_debug(RIG_DEBUG_VERBOSE, "Transceiver=%s\n", value); + char model_name[256]; + snprintf(model_name,sizeof(model_name), "%.248s(%s)", value, "FLRig"); + rig->caps->model_name = strdup(model_name); + rig->state.model_name = strdup(model_name); /* see if get_pwrmeter_scale is available */ retval = flrig_transaction(rig, "rig.get_pwrmeter_scale", NULL, value, commit 32e6b90f4abbea1da9fbf0f3f88327ae624e2a3e Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Nov 9 07:02:04 2024 -0600 Change FT817/FT818/Q900 to use 0x0a for digital mode and 0x0c for packet instead of 0x07 diff --git a/rigs/yaesu/ft817.c b/rigs/yaesu/ft817.c index ff15241ff..d492d46bc 100644 --- a/rigs/yaesu/ft817.c +++ b/rigs/yaesu/ft817.c @@ -186,8 +186,8 @@ static const yaesu_cmd_set_t ncmd[] = { 1, { 0x04, 0x00, 0x00, 0x00, 0x07 } }, /* mode set main AM */ { 1, { 0x08, 0x00, 0x00, 0x00, 0x07 } }, /* mode set main FM */ { 1, { 0x88, 0x00, 0x00, 0x00, 0x07 } }, /* mode set main FM-N */ - { 1, { 0x0a, 0x00, 0x00, 0x00, 0x07 } }, /* mode set main DIG */ - { 1, { 0x0c, 0x00, 0x00, 0x00, 0x07 } }, /* mode set main PKT */ + { 1, { 0x0a, 0x00, 0x00, 0x00, 0x0a } }, /* mode set main DIG */ + { 1, { 0x0c, 0x00, 0x00, 0x00, 0x0c } }, /* mode set main PKT */ { 1, { 0x00, 0x00, 0x00, 0x00, 0x05 } }, /* clar on */ { 1, { 0x00, 0x00, 0x00, 0x00, 0x85 } }, /* clar off */ { 0, { 0x00, 0x00, 0x00, 0x00, 0xf5 } }, /* set clar freq */ @@ -310,7 +310,7 @@ struct rig_caps ft817_caps = RIG_MODEL(RIG_MODEL_FT817), .model_name = "FT-817", .mfg_name = "Yaesu", - .version = "20241101.0", + .version = "20241109.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -460,7 +460,7 @@ struct rig_caps q900_caps = RIG_MODEL(RIG_MODEL_Q900), .model_name = "Q900", .mfg_name = "Guohe", - .version = "20241101.0", + .version = "20241109.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -610,7 +610,7 @@ struct rig_caps ft818_caps = RIG_MODEL(RIG_MODEL_FT818), .model_name = "FT-818", .mfg_name = "Yaesu", - .version = "20221101.0", + .version = "20221109.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, commit 6dcd60c2ac68bed9b5129befdac71f06d265cdce Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Nov 8 22:29:29 2024 -0600 Increate FT747GX post_write_delay from 5ms to 10ms Doing two commands at once via rigctld needed a little extra delay diff --git a/rigs/yaesu/ft747.c b/rigs/yaesu/ft747.c index 4c9373092..b8ad27ffa 100644 --- a/rigs/yaesu/ft747.c +++ b/rigs/yaesu/ft747.c @@ -301,7 +301,7 @@ struct rig_caps ft747_caps = RIG_MODEL(RIG_MODEL_FT747), .model_name = "FT-747GX", .mfg_name = "Yaesu", - .version = "20220819.1", + .version = "20241108.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_MOBILE, diff --git a/rigs/yaesu/ft747.h b/rigs/yaesu/ft747.h index 2df6513a1..a17692f8c 100644 --- a/rigs/yaesu/ft747.h +++ b/rigs/yaesu/ft747.h @@ -39,8 +39,9 @@ /* Sequential fast writes confuse my FT747 without this delay */ +/* Node Red combined "F 028074000 M USB 0" needed 10ms */ -#define FT747_POST_WRITE_DELAY 5 +#define FT747_POST_WRITE_DELAY 10 /* commit 84b733d028cd00cdb3210cd12d1e79e3dd558b54 Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Nov 7 08:12:46 2024 -0600 Add RIG_OP_TUNE for TS990S diff --git a/rigs/kenwood/ts990s.c b/rigs/kenwood/ts990s.c index e20edd031..6933581be 100644 --- a/rigs/kenwood/ts990s.c +++ b/rigs/kenwood/ts990s.c @@ -42,7 +42,7 @@ #define TS2000_LEVEL_ALL (RIG_LEVEL_PREAMP|RIG_LEVEL_ATT|RIG_LEVEL_VOXDELAY|RIG_LEVEL_AF|RIG_LEVEL_RF|RIG_LEVEL_SQL|RIG_LEVEL_CWPITCH|RIG_LEVEL_RFPOWER|RIG_LEVEL_MICGAIN|RIG_LEVEL_KEYSPD|RIG_LEVEL_COMP|RIG_LEVEL_AGC|RIG_LEVEL_BKINDL|RIG_LEVEL_METER|RIG_LEVEL_VOXGAIN|RIG_LEVEL_ANTIVOX|RIG_LEVEL_RAWSTR|RIG_LEVEL_STRENGTH|RIG_LEVEL_SWR) -#define TS990S_VFO_OP (RIG_OP_BAND_UP|RIG_OP_BAND_DOWN) +#define TS990S_VFO_OP (RIG_OP_BAND_UP|RIG_OP_BAND_DOWN|RIG_OP_TUNE) #define TS990S_SCAN_OP (RIG_SCAN_VFO) #define TS990S_ANTS (RIG_ANT_1|RIG_ANT_2|RIG_ANT_3|RIG_ANT_4) @@ -135,7 +135,7 @@ struct rig_caps ts990s_caps = RIG_MODEL(RIG_MODEL_TS990S), .model_name = "TS-990S", .mfg_name = "Kenwood", - .version = BACKEND_VER ".6", + .version = BACKEND_VER ".7", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, commit 0bd214f2c46131da04ac83ccdbab5bb8a99343df Merge: ec36b21f5 10292fd33 Author: Michael Black <mdb...@ya...> Date: Wed Nov 6 10:46:06 2024 -0600 Merge pull request #1628 from GeoBaltz/fix22 More commands for simts890.c commit ec36b21f5415c57b6135dc3cdd35d047e6a36bff Author: Mike Black W9MDB <mdb...@ya...> Date: Wed Nov 6 09:43:14 2024 -0600 Remove forcine Icom rigs to always set mode. If mode does not change then don't set it https://github.com/Hamlib/Hamlib/issues/1580 diff --git a/src/rig.c b/src/rig.c index beee71652..21948050c 100644 --- a/src/rig.c +++ b/src/rig.c @@ -2824,8 +2824,14 @@ int HAMLIB_API rig_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) retcode = caps->get_mode(rig, vfo, &mode_curr, &width_curr); // For Icom rigs we may need to force the filter so we always set mode +#if 0 + // This should not be necessary anymore with the new filter method for Icom rigs + // Hopefully fixes issue https://github.com/Hamlib/Hamlib/issues/1580 if (retcode == RIG_OK && mode == mode_curr && RIG_ICOM != RIG_BACKEND_NUM(rig->caps->rig_model)) +#else + if (retcode == RIG_OK && mode == mode_curr) +#endif { rig_debug(RIG_DEBUG_VERBOSE, "%s: mode already %s and bw change not requested\n", __func__, commit 10292fd3383ff28b384ab7c42c63c19733c0e121 Author: George Baltz N3GB <Geo...@gm...> Date: Wed Nov 6 10:19:40 2024 -0500 Astyle simts890.c Man, this is ugly! diff --git a/simulators/simts890.c b/simulators/simts890.c index e99107bf7..a3c513d21 100644 --- a/simulators/simts890.c +++ b/simulators/simts890.c @@ -70,7 +70,8 @@ int rl = 0; int is = 0; int sp = 0; // Split OFF/ON int split_op = 0; // Split frequency setting operation in progress -int rit=0, xit=0, rxit=0; // RIT off/on, XIT off/on, Offset freq(-9999<=rxit<=+9999) +int rit = 0, xit = 0, rxit = + 0; // RIT off/on, XIT off/on, Offset freq(-9999<=rxit<=+9999) int fine = 0; // Fine tuning - step size off=10hz, on=1hz // Clock data int autoset = 1; @@ -269,26 +270,26 @@ int main(int argc, char *argv[]) * This description is taken from the TS-590S/SG manual, with values * reflecting a real TS-890S. */ - char IFformat[] = "IF" // Output only - "%011d" // P1 freq(Hz) - " " // P2 ?? - "% 05d" // P3 RIT/XIT freq(Hz) - "%1d" // P4 RIT on/off - "%1d" // P5 XIT on/off - "000" // P6,P7 mem channel - "%1d" // P8 RX/TX - "%1X" // P9 Operating mode (See OM command) - "0" // P10 Function? - "0" // P11 Scan status? - "%1d" // P12 Simplex=0/Split=1 - "0" // P13 Tone/CTCSS (not on TS-890S) - "00" // P14 Tone/CTCSS freq (not on TS-890S) - "0;"; // P15 Always zero + const char IFformat[] = "IF" // Output only + "%011d" // P1 freq(Hz) + " " // P2 ?? + "% 05d" // P3 RIT/XIT freq(Hz) + "%1d" // P4 RIT on/off + "%1d" // P5 XIT on/off + "000" // P6,P7 mem channel + "%1d" // P8 RX/TX + "%1X" // P9 Operating mode (See OM command) + "0" // P10 Function? + "0" // P11 Scan status? + "%1d" // P12 Simplex=0/Split=1 + "0" // P13 Tone/CTCSS (not on TS-890S) + "00" // P14 Tone/CTCSS freq (not on TS-890S) + "0;"; // P15 Always zero #endif - char SFformat[] = "SF" // Input/Output - "%1d" // P1 VFOA/VFOB - "%011d" // P2 Freq(Hz) - "%1X;"; // P3 Mode + const char SFformat[] = "SF" // Input/Output + "%1d" // P1 VFOA/VFOB + "%011d" // P2 Freq(Hz) + "%1X;"; // P3 Mode /* Initialization */ for (int i = 0; i < NBANDS; i++) @@ -326,7 +327,8 @@ int main(int argc, char *argv[]) buf[1] = toupper(buf[1]); if (strcmp(buf, "IF;") == 0) - { // Reads the tranceiver status + { + // Reads the tranceiver status #if defined(LEGACY) char ifbuf[256]; hl_usleep(mysleep * 1000); @@ -958,7 +960,8 @@ int main(int argc, char *argv[]) } } else if (strncmp(buf, "MD", 2) == 0) - { // Sets and reads the operating mode status + { + // Sets and reads the operating mode status #if defined(LEGACY) if (buf[2] == ';') { @@ -969,6 +972,7 @@ int main(int argc, char *argv[]) { sscanf(buf, "MD%1X", &(*vfoLR[0])->mode); } + #else cmd_err = 1; #endif @@ -1128,7 +1132,8 @@ int main(int argc, char *argv[]) sscanf(buf, "RL1%d", &rl); } else if (strncmp(buf, "FS", 2) == 0) - { // FINE Function + { + // FINE Function if (buf[2] == ';') { snprintf(buf, sizeof buf, "FS%d%d;", fine, fine); // For now @@ -1137,19 +1142,22 @@ int main(int argc, char *argv[]) else { if (buf[2] == '0' || buf[2] == '1') - { fine = buf[2] - '0'; } + { fine = buf[2] - '0'; } else - { cmd_err = 1; } + { cmd_err = 1; } } } else if (strcmp(buf, "RC;") == 0) - { // RIT/XIT Frequency Clear + { + // RIT/XIT Frequency Clear rxit = 0; } - else if (buf[0] == 'R' && (buf[1] =='D' || buf[1] == 'U')) // RD/RU - { // RIT/XIT Frequency Up/Down + else if (buf[0] == 'R' && (buf[1] == 'D' || buf[1] == 'U')) // RD/RU + { + // RIT/XIT Frequency Up/Down int dir = buf[1] == 'D' ? -1 : +1; - int tempit; + int tempit; + if (buf[2] == ';') { tempit = rxit + (dir * (fine ? 1 : 10)); @@ -1158,43 +1166,55 @@ int main(int argc, char *argv[]) { tempit = rxit + dir * atoi(buf + 2); } + if (abs(tempit) > 9999) {cmd_err = 1; continue;} + /* Some weird rounding going on here - TBD */ rxit = tempit; } else if (strcmp(buf, "RF;") == 0) - { // RIT/XIT Frequency + { + // RIT/XIT Frequency snprintf(buf, sizeof buf, "RF%1d%04d;", rxit < 0 ? 1 : 0, abs(rxit)); OUTPUT(buf); } else if (strncmp(buf, "RT", 2) == 0) - { // RIT Function State, RIT Shift - switch(buf[2]) { + { + // RIT Function State, RIT Shift + switch (buf[2]) + { case ';': // Read snprintf(buf, sizeof buf, "RT%d;", rit); OUTPUT(buf); break; + case '0': // Set case '1': rit = buf[2] - '0'; break; + case '2': // Shift //TODO: set recv freq to vfo+rxit, clear rxit and rit break; + default: cmd_err = 1; } } else if (strncmp(buf, "XT", 2) == 0) - { // XIT Function State, XIT Shift - switch(buf[2]) { + { + // XIT Function State, XIT Shift + switch (buf[2]) + { case '0': // Set case '1': xit = buf[2] - '0'; break; + case '2': // Shift //TODO: set xmit freq to vfo+rxit(Which vfo?), set split, clear rxit and xit break; + default: cmd_err = 1; } commit dd9696cf2dc72d9397d290c3986d6b63a3cf7061 Author: George Baltz N3GB <Geo...@gm...> Date: Tue Nov 5 17:09:31 2024 -0500 Add RIT/XIT commands (FS, RC, RD/RU, RF, RT, XT) to simts890.c Add RIT/XIT data to IF command. FS probably affects more places, TBD Constify some strings diff --git a/simulators/simts890.c b/simulators/simts890.c index f1ab8f6c3..e99107bf7 100644 --- a/simulators/simts890.c +++ b/simulators/simts890.c @@ -70,6 +70,8 @@ int rl = 0; int is = 0; int sp = 0; // Split OFF/ON int split_op = 0; // Split frequency setting operation in progress +int rit=0, xit=0, rxit=0; // RIT off/on, XIT off/on, Offset freq(-9999<=rxit<=+9999) +int fine = 0; // Fine tuning - step size off=10hz, on=1hz // Clock data int autoset = 1; int tzs[2] = {36, 56}; // 0=primary(EST), 1=auxiliary(UTC) @@ -270,9 +272,9 @@ int main(int argc, char *argv[]) char IFformat[] = "IF" // Output only "%011d" // P1 freq(Hz) " " // P2 ?? - " 0000" // P3 RIT/XIT freq(Hz) - "0" // P4 RIT on/off - "0" // P5 XIT on/off + "% 05d" // P3 RIT/XIT freq(Hz) + "%1d" // P4 RIT on/off + "%1d" // P5 XIT on/off "000" // P6,P7 mem channel "%1d" // P8 RX/TX "%1X" // P9 Operating mode (See OM command) @@ -282,6 +284,7 @@ int main(int argc, char *argv[]) "0" // P13 Tone/CTCSS (not on TS-890S) "00" // P14 Tone/CTCSS freq (not on TS-890S) "0;"; // P15 Always zero +#endif char SFformat[] = "SF" // Input/Output "%1d" // P1 VFOA/VFOB "%011d" // P2 Freq(Hz) @@ -327,8 +330,9 @@ int main(int argc, char *argv[]) #if defined(LEGACY) char ifbuf[256]; hl_usleep(mysleep * 1000); - sprintf(ifbuf, IFformat, (*vfoLR[0])->freq, - (ptt + ptt_mic + ptt_data + ptt_tune) > 0 ? 1 : 0, (*vfoLR[0])->mode, sp); + sprintf(ifbuf, IFformat, (*vfoLR[0])->freq, rxit, rit, xit, + (ptt + ptt_mic + ptt_data + ptt_tune) > 0 ? 1 : 0, + (*vfoLR[0])->mode, sp); OUTPUT(ifbuf); #else cmd_err = 1; @@ -1123,6 +1127,78 @@ int main(int argc, char *argv[]) puts(buf); sscanf(buf, "RL1%d", &rl); } + else if (strncmp(buf, "FS", 2) == 0) + { // FINE Function + if (buf[2] == ';') + { + snprintf(buf, sizeof buf, "FS%d%d;", fine, fine); // For now + OUTPUT(buf); + } + else + { + if (buf[2] == '0' || buf[2] == '1') + { fine = buf[2] - '0'; } + else + { cmd_err = 1; } + } + } + else if (strcmp(buf, "RC;") == 0) + { // RIT/XIT Frequency Clear + rxit = 0; + } + else if (buf[0] == 'R' && (buf[1] =='D' || buf[1] == 'U')) // RD/RU + { // RIT/XIT Frequency Up/Down + int dir = buf[1] == 'D' ? -1 : +1; + int tempit; + if (buf[2] == ';') + { + tempit = rxit + (dir * (fine ? 1 : 10)); + } + else + { + tempit = rxit + dir * atoi(buf + 2); + } + if (abs(tempit) > 9999) {cmd_err = 1; continue;} + /* Some weird rounding going on here - TBD */ + rxit = tempit; + } + else if (strcmp(buf, "RF;") == 0) + { // RIT/XIT Frequency + snprintf(buf, sizeof buf, "RF%1d%04d;", rxit < 0 ? 1 : 0, abs(rxit)); + OUTPUT(buf); + } + else if (strncmp(buf, "RT", 2) == 0) + { // RIT Function State, RIT Shift + switch(buf[2]) { + case ';': // Read + snprintf(buf, sizeof buf, "RT%d;", rit); + OUTPUT(buf); + break; + case '0': // Set + case '1': + rit = buf[2] - '0'; + break; + case '2': // Shift + //TODO: set recv freq to vfo+rxit, clear rxit and rit + break; + default: + cmd_err = 1; + } + } + else if (strncmp(buf, "XT", 2) == 0) + { // XIT Function State, XIT Shift + switch(buf[2]) { + case '0': // Set + case '1': + xit = buf[2] - '0'; + break; + case '2': // Shift + //TODO: set xmit freq to vfo+rxit(Which vfo?), set split, clear rxit and xit + break; + default: + cmd_err = 1; + } + } else if (strncmp(buf, "CK", 2) == 0) { // All the clock functions commit d0b19252343ab4c584db3467b39de5dcce701309 Author: George Baltz N3GB <Geo...@gm...> Date: Mon Nov 4 16:09:24 2024 -0500 Annotate legacy (undocumented) commands in simts890.c Allow them to be disabled Relevant to issues #1380 and #899 diff --git a/simulators/simts890.c b/simulators/simts890.c index 8f41bff99..f1ab8f6c3 100644 --- a/simulators/simts890.c +++ b/simulators/simts890.c @@ -21,7 +21,16 @@ struct ip_mreq #include <time.h> //#include <hamlib/rig.h> +/* Definitions */ +/* The TS-890S has some undocumented commands, left over from older + * Kenwood models. They have newer counterparts with more functionality, + * but are still around for legacy software. If you want to see if your + * app is only using the latest-and-greatest, comment out the next define. + */ +#define LEGACY +// Size of command buffer #define BUFSIZE 256 +// Number of selectable bands #define NBANDS 11 /* Type we're emulating - K=The Americas(default), E=Europe */ #if !defined(TYPE) @@ -30,6 +39,7 @@ struct ip_mreq /* Define a macro for sending response back to the app * This will allow us to reroute output to a buffering routine * Needed to handle multiple commands in a single message + * Also makes it easy to trace */ #if defined(TRACE) #define OUTPUT(s) {printf("Resp:\"%s\"\n", s); write(fd, s, strlen(s)); } @@ -251,6 +261,7 @@ int main(int argc, char *argv[]) kvfop_t *const vfoAB[2] = {&vfoA, &vfoB}; // 0=A, 1=B, fixed kvfop_t *vfoLR[2] = {&vfoA, &vfoB}; // 0=Left, 1=Right, can change +#if defined(LEGACY) /* The IF command is not documented for the TS-890S, and is supposed * to be supplanted by SF. However, it is still there for legacy S/W. * This description is taken from the TS-590S/SG manual, with values @@ -312,12 +323,16 @@ int main(int argc, char *argv[]) buf[1] = toupper(buf[1]); if (strcmp(buf, "IF;") == 0) - { + { // Reads the tranceiver status +#if defined(LEGACY) char ifbuf[256]; hl_usleep(mysleep * 1000); sprintf(ifbuf, IFformat, (*vfoLR[0])->freq, (ptt + ptt_mic + ptt_data + ptt_tune) > 0 ? 1 : 0, (*vfoLR[0])->mode, sp); OUTPUT(ifbuf); +#else + cmd_err = 1; +#endif } else if (strncmp(buf, "AN", 2) == 0) { @@ -938,6 +953,22 @@ int main(int argc, char *argv[]) sscanf(&buf[3], "%1X", &(*vfoLR[idx])->mode); } } + else if (strncmp(buf, "MD", 2) == 0) + { // Sets and reads the operating mode status +#if defined(LEGACY) + if (buf[2] == ';') + { + snprintf(buf, sizeof(buf), "MD%X;", (*vfoLR[0])->mode); + OUTPUT(buf); + } + else + { + sscanf(buf, "MD%1X", &(*vfoLR[0])->mode); + } +#else + cmd_err = 1; +#endif + } else if (strncmp(buf, "RM", 2) == 0) { // Meter commit 27767fcfc1ce18ee06276d76f14decc569ba236c Author: George Baltz N3GB <Geo...@gm...> Date: Fri Nov 1 15:36:16 2024 -0400 Add traffic tracing to simts890.c diff --git a/simulators/simts890.c b/simulators/simts890.c index 58d39557e..8f41bff99 100644 --- a/simulators/simts890.c +++ b/simulators/simts890.c @@ -1,3 +1,4 @@ +//#define TRACE /* Full traffic trace if enabled */ // can run this using rigctl/rigctld and socat pty devices // gcc -o simts890 -l hamlib simts890.c #define _XOPEN_SOURCE 700 @@ -30,7 +31,11 @@ struct ip_mreq * This will allow us to reroute output to a buffering routine * Needed to handle multiple commands in a single message */ +#if defined(TRACE) +#define OUTPUT(s) {printf("Resp:\"%s\"\n", s); write(fd, s, strlen(s)); } +#else #define OUTPUT(s) write(fd, s, strlen(s)) +#endif int mysleep = 20; @@ -296,7 +301,9 @@ int main(int argc, char *argv[]) if (getmyline(fd, buf) > 0) { -// printf("Cmd:\"%s\"\n", buf); +#if defined(TRACE) + printf("Cmd:\"%s\"\n", buf); +#endif } // else { return 0; } commit 5c269964c28a32876dc04b715095e5d094b76055 Author: Mike Black W9MDB <mdb...@ya...> Date: Wed Nov 6 08:07:34 2024 -0600 astyle files in preparation for release 4.6 diff --git a/amplifiers/elecraft/kpa.c b/amplifiers/elecraft/kpa.c index e1acfba88..8ffbbe28e 100644 --- a/amplifiers/elecraft/kpa.c +++ b/amplifiers/elecraft/kpa.c @@ -67,7 +67,7 @@ int kpa_init(AMP *amp) } AMPSTATE(amp)->priv = (struct kpa_priv_data *) - calloc(1, sizeof(struct kpa_priv_data)); + calloc(1, sizeof(struct kpa_priv_data)); if (!AMPSTATE(amp)->priv) { diff --git a/amplifiers/expert/expert.c b/amplifiers/expert/expert.c index 48f88c871..7f4080cf8 100644 --- a/amplifiers/expert/expert.c +++ b/amplifiers/expert/expert.c @@ -69,7 +69,7 @@ int expert_init(AMP *amp) } AMPSTATE(amp)->priv = (struct expert_priv_data *) - calloc(1, sizeof(struct expert_priv_data)); + calloc(1, sizeof(struct expert_priv_data)); if (!AMPSTATE(amp)->priv) { diff --git a/amplifiers/gemini/gemini.c b/amplifiers/gemini/gemini.c index 41129fec1..5a154f52c 100644 --- a/amplifiers/gemini/gemini.c +++ b/amplifiers/gemini/gemini.c @@ -46,7 +46,7 @@ int gemini_init(AMP *amp) } AMPSTATE(amp)->priv = (struct gemini_priv_data *) - calloc(1, sizeof(struct gemini_priv_data)); + calloc(1, sizeof(struct gemini_priv_data)); if (!AMPSTATE(amp)->priv) { diff --git a/rigs/barrett/4100.c b/rigs/barrett/4100.c index 99004f6ac..02842e819 100644 --- a/rigs/barrett/4100.c +++ b/rigs/barrett/4100.c @@ -110,7 +110,9 @@ static int barrett4100_open(RIG *rig) ENTERFUNC; retval = barrett_transaction2(rig, "M:REMOTE SENTER2,1", 3, &response); - rig_debug(RIG_DEBUG_ERR, "%s: back from REMOTE SENTER2: got %d\n", __func__, retval); + rig_debug(RIG_DEBUG_ERR, "%s: back from REMOTE SENTER2: got %d\n", __func__, + retval); + if (response[0] != 's') { rig_debug(RIG_DEBUG_ERR, "%s: REMOTE SENTER2 error: got %s\n", __func__, @@ -159,6 +161,7 @@ int barrett4100_set_freq(RIG *rig, vfo_t vfo, freq_t freq) rig_debug(RIG_DEBUG_ERR, "%s: unable to parse s gRF\n", __func__); } } + retval = barrett_transaction2(rig, "M:FF STF%.0f GTF", freq, &response); if (retval != RIG_OK) @@ -196,10 +199,12 @@ int barrett4100_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) else { int n = sscanf(response, "gRF%lf", freq); + //int n = sscanf(response, "gRFA1,%*d,%lf,%*d", freq); if (n != 1) { - rig_debug(RIG_DEBUG_ERR, "%s(%d): unable to parse freq from '%s'\n", __func__, __LINE__, response); + rig_debug(RIG_DEBUG_ERR, "%s(%d): unable to parse freq from '%s'\n", __func__, + __LINE__, response); return -RIG_EPROTO; } } diff --git a/rigs/barrett/barrett.c b/rigs/barrett/barrett.c index 21757143c..17756ebcb 100644 --- a/rigs/barrett/barrett.c +++ b/rigs/barrett/barrett.c @@ -74,11 +74,13 @@ int barrett_transaction2(RIG *rig, char *cmd, int expected, char **result) SNPRINTF(cmd_buf, sizeof(cmd_buf), "%c%s%s", 0x0a, cmd, EOM); barrett_flush(rig); retval = write_block(rp, (unsigned char *) cmd_buf, strlen(cmd_buf)); + if (retval < 0) { rig_debug(RIG_DEBUG_ERR, "%s(%d): error in write_block\n", __func__, __LINE__); return retval; } + retval = read_block(RIGPORT(rig), (unsigned char *) priv->ret_data, expected); if (retval < 0) @@ -86,15 +88,19 @@ int barrett_transaction2(RIG *rig, char *cmd, int expected, char **result) rig_debug(RIG_DEBUG_ERR, "%s(%d): error in read_block\n", __func__, __LINE__); return retval; } - rig_debug(RIG_DEBUG_VERBOSE, "%s(%d): %d bytes read\n", __func__, __LINE__, retval); - if (priv->ret_data[0] == 0x13) // we'll return from the 1st good char - { - *result = &(priv->ret_data[1]); - } - else // some commands like IAL don't give XOFF but XON is there -- is this a bug? - { - *result = &(priv->ret_data[0]); - } + + rig_debug(RIG_DEBUG_VERBOSE, "%s(%d): %d bytes read\n", __func__, __LINE__, + retval); + + if (priv->ret_data[0] == 0x13) // we'll return from the 1st good char + { + *result = &(priv->ret_data[1]); + } + else // some commands like IAL don't give XOFF but XON is there -- is this a bug? + { + *result = &(priv->ret_data[0]); + } + return retval; } @@ -227,7 +233,7 @@ int barrett_init(RIG *rig) rig->caps->version); // cppcheck claims leak here but it's freed in cleanup STATE(rig)->priv = (struct barrett_priv_data *)calloc(1, - sizeof(struct barrett_priv_data)); + sizeof(struct barrett_priv_data)); if (!STATE(rig)->priv) { diff --git a/rigs/codan/codan.c b/rigs/codan/codan.c index 692cb4695..92b146709 100644 --- a/rigs/codan/codan.c +++ b/rigs/codan/codan.c @@ -138,7 +138,7 @@ int codan_init(RIG *rig) rig->caps->version); // cppcheck claims leak here but it's freed in cleanup STATE(rig)->priv = (struct codan_priv_data *)calloc(1, - sizeof(struct codan_priv_data)); + sizeof(struct codan_priv_data)); if (!STATE(rig)->priv) { diff --git a/rigs/commradio/commradio.c b/rigs/commradio/commradio.c index c73c7b6fe..d830e6eda 100644 --- a/rigs/commradio/commradio.c +++ b/rigs/commradio/commradio.c @@ -24,81 +24,86 @@ */ int commradio_transaction(RIG *rig, const unsigned char *cmd, int cmd_len, - unsigned char *data, int *data_len) + unsigned char *data, int *data_len) { - int ret = -RIG_EINTERNAL; - struct rig_state *rs; - hamlib_port_t *rp = RIGPORT(rig); - - ENTERFUNC; - - rs = STATE(rig); - rs->transaction_active = 1; - - /* - * Flush is needed until async mode is done. The CTX-10 sends frames every - * time the VFO changes. - */ - rig_flush(rp); - - int frame_len; - unsigned char frame[3+2*(cmd_len+2)]; - size_t rx_len = CR_FRAMELENGTH; - unsigned char rx[rx_len]; - frame_len = frame_message(frame, cmd, cmd_len); - ret = write_block(rp, frame, frame_len); - if (ret < RIG_OK) - { - goto transaction_quit; - } - - const char stopset[] = { CR_EOF }; - ret = read_string(rp, rx, rx_len-1, stopset, 1, 0, 1); - if (ret < RIG_OK) - { - goto transaction_quit; - } - ret = commradio_unpack_frame(data, rx, ret); - if (ret < RIG_OK) - { - goto transaction_quit; - } - *data_len = ret; - //TODO: check for error response 0x11 + int ret = -RIG_EINTERNAL; + struct rig_state *rs; + hamlib_port_t *rp = RIGPORT(rig); + + ENTERFUNC; + + rs = STATE(rig); + rs->transaction_active = 1; + + /* + * Flush is needed until async mode is done. The CTX-10 sends frames every + * time the VFO changes. + */ + rig_flush(rp); + + int frame_len; + unsigned char frame[3 + 2 * (cmd_len + 2)]; + size_t rx_len = CR_FRAMELENGTH; + unsigned char rx[rx_len]; + frame_len = frame_message(frame, cmd, cmd_len); + ret = write_block(rp, frame, frame_len); + + if (ret < RIG_OK) + { + goto transaction_quit; + } + + const char stopset[] = { CR_EOF }; + ret = read_string(rp, rx, rx_len - 1, stopset, 1, 0, 1); + + if (ret < RIG_OK) + { + goto transaction_quit; + } + + ret = commradio_unpack_frame(data, rx, ret); + + if (ret < RIG_OK) + { + goto transaction_quit; + } + + *data_len = ret; + //TODO: check for error response 0x11 transaction_quit: - rs->transaction_active = 0; - RETURNFUNC(ret); + rs->transaction_active = 0; + RETURNFUNC(ret); } int commradio_init(RIG *rig) { - ENTERFUNC; - // I can't think of anything that goes in here yet. - RETURNFUNC(RIG_OK); + ENTERFUNC; + // I can't think of anything that goes in here yet. + RETURNFUNC(RIG_OK); } int commradio_cleanup(RIG *rig) { - ENTERFUNC; - // dealloc stuff if it gets added to _init - RETURNFUNC(RIG_OK); + ENTERFUNC; + // dealloc stuff if it gets added to _init + RETURNFUNC(RIG_OK); } int commradio_rig_open(RIG *rig) { - ENTERFUNC; - // Possibly check if our serial port is configured right and we are not - // doing bad things to the GPIO lines - RETURNFUNC(RIG_OK); + ENTERFUNC; + // Possibly check if our serial port is configured right and we are not + // doing bad things to the GPIO lines + RETURNFUNC(RIG_OK); } int commradio_rig_close(RIG *rig) { - ENTERFUNC; - // i don't really know - RETURNFUNC(RIG_OK); + ENTERFUNC; + // i don't really know + RETURNFUNC(RIG_OK); } /* @@ -110,73 +115,79 @@ int commradio_rig_close(RIG *rig) int commradio_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) { - const unsigned char cmd[] = {0x32}; // Get frequency request - unsigned char data[CR_FRAMELENGTH]; - int data_len; - int ret = -RIG_EINTERNAL; - - ENTERFUNC; - - ret = commradio_transaction(rig, cmd, 1, data, &data_len); - if(data_len == 5 && (data[0] == 0x33 || data[0] == 0x34)) - { - *freq = (data[1] << 24 | data[2] << 16 | data[3] << 8 | data[4]); - ret = RIG_OK; - } - else - { - rig_debug(RIG_DEBUG_ERR, "%s: Unexpected response to 0x32\n", __func__); - } - RETURNFUNC(ret); + const unsigned char cmd[] = {0x32}; // Get frequency request + unsigned char data[CR_FRAMELENGTH]; + int data_len; + int ret = -RIG_EINTERNAL; + + ENTERFUNC; + + ret = commradio_transaction(rig, cmd, 1, data, &data_len); + + if (data_len == 5 && (data[0] == 0x33 || data[0] == 0x34)) + { + *freq = (data[1] << 24 | data[2] << 16 | data[3] << 8 | data[4]); + ret = RIG_OK; + } + else + { + rig_debug(RIG_DEBUG_ERR, "%s: Unexpected response to 0x32\n", __func__); + } + + RETURNFUNC(ret); } int commradio_set_freq(RIG *rig, vfo_t vfo, freq_t freq) { - unsigned char data[CR_FRAMELENGTH]; - int data_len; - int ret = -RIG_EINTERNAL; - - ENTERFUNC; - - if(freq < 150000 || freq > 30000000) - { - RETURNFUNC(-RIG_EINVAL); - } - uint32_t int_freq = freq; - rig_debug(RIG_DEBUG_VERBOSE, "%s: Got freq=%f, int_freq=%u\n", __func__, - freq, int_freq); - unsigned char cmd[] = - { - 0x30, // Set frequency request - 0xFF & (int_freq >> 24), - 0xFF & (int_freq >> 16), - 0xFF & (int_freq >> 8), - 0xFF & (int_freq) - }; - - ret = commradio_transaction(rig, cmd, 5, data, &data_len); - if(data_len == 5 && (data[0] == 0x31 || data[0] == 0x34)) - { - uint32_t new_freq = (data[1] << 24 | data[2] << 16 | data[3] << 8 | data[4]); - if(int_freq == new_freq) - { - RETURNFUNC(RIG_OK); - } - else - { - RETURNFUNC(-RIG_ERJCTED); - } - } - // CTX-10 returns 11 02 30 00 00 00 01 if we try to go out of its - // general-coverage frequency range 150kHz - 30MHz. I'm not sure why Hamlib - // even tries to do this, since its defined in the caps... - else - { - rig_debug(RIG_DEBUG_ERR, "%s: Unexpected response to 0x30\n", __func__); - ret = -RIG_ERJCTED; - } - RETURNFUNC(ret); + unsigned char data[CR_FRAMELENGTH]; + int data_len; + int ret = -RIG_EINTERNAL; + + ENTERFUNC; + + if (freq < 150000 || freq > 30000000) + { + RETURNFUNC(-RIG_EINVAL); + } + + uint32_t int_freq = freq; + rig_debug(RIG_DEBUG_VERBOSE, "%s: Got freq=%f, int_freq=%u\n", __func__, + freq, int_freq); + unsigned char cmd[] = + { + 0x30, // Set frequency request + 0xFF & (int_freq >> 24), + 0xFF & (int_freq >> 16), + 0xFF & (int_freq >> 8), + 0xFF & (int_freq) + }; + + ret = commradio_transaction(rig, cmd, 5, data, &data_len); + + if (data_len == 5 && (data[0] == 0x31 || data[0] == 0x34)) + { + uint32_t new_freq = (data[1] << 24 | data[2] << 16 | data[3] << 8 | data[4]); + + if (int_freq == new_freq) + { + RETURNFUNC(RIG_OK); + } + else + { + RETURNFUNC(-RIG_ERJCTED); + } + } + // CTX-10 returns 11 02 30 00 00 00 01 if we try to go out of its + // general-coverage frequency range 150kHz - 30MHz. I'm not sure why Hamlib + // even tries to do this, since its defined in the caps... + else + { + rig_debug(RIG_DEBUG_ERR, "%s: Unexpected response to 0x30\n", __func__); + ret = -RIG_ERJCTED; + } + + RETURNFUNC(ret); } /* @@ -184,13 +195,13 @@ int commradio_set_freq(RIG *rig, vfo_t vfo, freq_t freq) */ int commradio_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) { - return (RIG_OK); + return (RIG_OK); } int commradio_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) { - *mode = RIG_MODE_NONE; - return (RIG_OK); + *mode = RIG_MODE_NONE; + return (RIG_OK); } /* @@ -199,22 +210,22 @@ int commradio_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) */ int commradio_set_vfo(RIG *rig, vfo_t vfo) { - return (RIG_OK); + return (RIG_OK); } int commradio_get_vfo(RIG *rig, vfo_t *vfo) { - *vfo = RIG_VFO_A; - return (RIG_OK); + *vfo = RIG_VFO_A; + return (RIG_OK); } DECLARE_INITRIG_BACKEND(commradio) { - rig_debug(RIG_DEBUG_VERBOSE, "%s: _init called\n", __func__); - rig_register(&ctx10_caps); + rig_debug(RIG_DEBUG_VERBOSE, "%s: _init called\n", __func__); + rig_register(&ctx10_caps); - return (RIG_OK); + return (RIG_OK); } /* @@ -222,6 +233,6 @@ DECLARE_INITRIG_BACKEND(commradio) */ DECLARE_PROBERIG_BACKEND(commradio) { - return (RIG_MODEL_NONE); + return (RIG_MODEL_NONE); } diff --git a/rigs/commradio/ctx10.c b/rigs/commradio/ctx10.c index fc411ee41..ddaa0e617 100644 --- a/rigs/commradio/ctx10.c +++ b/rigs/commradio/ctx10.c @@ -17,79 +17,79 @@ struct rig_caps ctx10_caps = { - RIG_MODEL(RIG_MODEL_CTX10), - .model_name = "CTX-10", - .mfg_name = "Commradio", - .version = "20240809.0", - .copyright = "LGPL", - .status = RIG_STATUS_STABLE, - .rig_type = RIG_TYPE_TRANSCEIVER, - .ptt_type = RIG_PTT_NONE, - .dcd_type = RIG_DCD_NONE, - .port_type = RIG_PORT_SERIAL, - .serial_rate_min = 3000000, - .serial_rate_max = 3000000, - .serial_data_bits = 8, - .serial_stop_bits = 1, - .serial_parity = RIG_PARITY_NONE, - .serial_handshake = RIG_HANDSHAKE_NONE, - .write_delay = 0, - .post_write_delay = 0, - .timeout = 1000, - .retry = 3, - .has_get_func = RIG_FUNC_NONE, - .has_set_func = RIG_FUNC_NONE, - .has_get_level = RIG_LEVEL_NONE, - .has_set_level = RIG_LEVEL_NONE, - .has_get_parm = RIG_PARM_NONE, - .has_set_parm = RIG_PARM_NONE, -// .level_gran = {}, -// .parm_gran = {}, - .ctcss_list = NULL, - .dcs_list = NULL, -// .preamp = { RIG_DBLST_END, }, -// .attenuator = { RIG_DBLST_END, }, -// .max_rit = Hz(0), -// .max_xit = Hz(0), -// .max_ifshift = Hz(0), - .targetable_vfo = 0, - .vfo_ops = (RIG_OP_FROM_VFO|RIG_OP_TO_VFO), - .scan_ops = RIG_SCAN_NONE, - .transceive = RIG_TRN_OFF, - .bank_qty = 0, - .chan_desc_sz = 0, - .chan_list = { RIG_CHAN_END, }, - .rx_range_list1 = { - {kHz(150), MHz(30), CTX10_RX_MODES, -1, -1, CTX10_VFO, 0}, - RIG_FRNG_END, - }, - .tx_range_list1 = { - FRQ_RNG_80m_REGION2(CTX10_TX_MODES, W(1), W(10), CTX10_VFO, 0), - FRQ_RNG_60m_REGION2(CTX10_TX_MODES, W(1), W(10), CTX10_VFO, 0), - FRQ_RNG_40m_REGION2(CTX10_TX_MODES, W(1), W(10), CTX10_VFO, 0), - FRQ_RNG_30m_REGION2(CTX10_TX_MODES, W(1), W(10), CTX10_VFO, 0), - FRQ_RNG_20m_REGION2(CTX10_TX_MODES, W(1), W(10), CTX10_VFO, 0), - FRQ_RNG_17m_REGION2(CTX10_TX_MODES, W(1), W(10), CTX10_VFO, 0), - FRQ_RNG_15m_REGION2(CTX10_TX_MODES, W(1), W(10), CTX10_VFO, 0), - FRQ_RNG_12m_REGION2(CTX10_TX_MODES, W(1), W(10), CTX10_VFO, 0), - FRQ_RNG_10m_REGION2(CTX10_TX_MODES, W(1), W(10), CTX10_VFO, 0), - }, - .tuning_steps = { - {CTX10_RX_MODES, 10}, - RIG_TS_END, - }, -// .async_data_supported = 1, //TODO: R... [truncated message content] |