From 3f59e962e1060e517a10f25310cecff2ccca53d9 Mon Sep 17 00:00:00 2001 From: Mike Black W9MDB Date: Fri, 26 Jul 2024 07:35:19 -0500 Subject: [PATCH 1/6] Update simic7100 --- simulators/simic7100.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/simulators/simic7100.c b/simulators/simic7100.c index afeae7de2..213940684 100644 --- a/simulators/simic7100.c +++ b/simulators/simic7100.c @@ -25,6 +25,7 @@ struct ip_mreq #include #include +#undef ECHO #define BUFSIZE 256 #define X25 @@ -61,7 +62,7 @@ void dumphex(const unsigned char *buf, int n) int frameGet(int fd, unsigned char *buf) { - int i = 0, n; + int i = 0; memset(buf, 0, BUFSIZE); unsigned char c; @@ -77,10 +78,10 @@ again: char mytime[256]; date_strget(mytime, sizeof(mytime), 1); printf("%s:", mytime); dumphex(buf, i); +#ifdef ECHO // echo n = write(fd, buf, i); - - if (n != i) { printf("%s: error on write: %s\n", __func__, strerror(errno)); } +#endif return i; } @@ -146,6 +147,13 @@ void frameParse(int fd, unsigned char *frame, int len) if (powerstat) { + unsigned char frame2[11]; + memcpy(frame2,frame,11); + frame2[2] = 0xe1; + frame2[3] = 0x88; + dump_hex(frame2,11); + n = write(fd, frame2, 11); + dump_hex(frame,11); n = write(fd, frame, 11); } @@ -223,8 +231,9 @@ void frameParse(int fd, unsigned char *frame, int len) if (frame[5] == 0xfd) { printf("get split %d\n", 1); - frame[7] = 0xfd; - n = write(fd, frame, 8); + frame[5] = split; + frame[6] = 0xfd; + n = write(fd, frame, 7); } else { From 647b477dc95d3d688e352a125e77993c1f46d652 Mon Sep 17 00:00:00 2001 From: Mike Black W9MDB Date: Fri, 26 Jul 2024 15:48:44 -0500 Subject: [PATCH 2/6] Fix x26cmdfails in icom.c --- rigs/icom/icom.c | 2 +- rigs/icom/icom.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 44b90e225..5bc76736d 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -2256,7 +2256,7 @@ static int icom_get_mode_x26(RIG *rig, vfo_t vfo, int *mode_len, const struct icom_priv_caps *priv_caps = rig->caps->priv; int retval; - if (priv->x26cmdfails != 0 && priv_caps->x25x26_always==0) + if (priv->x26cmdfails > 0 && priv_caps->x25x26_always==0) { rig_debug(RIG_DEBUG_WARN, "%s: x26cmdfails=%d, x25x26_always=%d\n", __func__, priv->x26cmdfails, priv_caps->x25x26_always); return -RIG_ENAVAIL; diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h index 370e4c19b..a0477319a 100644 --- a/rigs/icom/icom.h +++ b/rigs/icom/icom.h @@ -35,7 +35,7 @@ #include #endif -#define BACKEND_VER "20240725" +#define BACKEND_VER "20240726" #define ICOM_IS_ID31 rig_is_model(rig, RIG_MODEL_ID31) #define ICOM_IS_ID51 rig_is_model(rig, RIG_MODEL_ID51) From 5ec0b8464572ee7290fe65d11b95e60bb5b76cd3 Mon Sep 17 00:00:00 2001 From: Mike Black W9MDB Date: Sun, 28 Jul 2024 06:57:54 -0500 Subject: [PATCH 3/6] Update SWR values for FT817 thanks to Christian WA4YA, DL4YA --- rigs/yaesu/ft817.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/rigs/yaesu/ft817.c b/rigs/yaesu/ft817.c index 0b0066b42..42bc48ca9 100644 --- a/rigs/yaesu/ft817.c +++ b/rigs/yaesu/ft817.c @@ -282,10 +282,25 @@ enum ft817_digi { 0x05, 100 } \ } } +// SWR values from Christian WA4YA, DL4YA #define FT817_SWR_CAL { 2, \ { \ - { 0, 0 }, \ - { 15, 100 } \ + { 0, 1.0f }, \ + { 1, 1.4f }, \ + { 2, 1.8f }, \ + { 3, 2.13f }, \ + { 4, 2.25f }, \ + { 5, 3.7f }, \ + { 6, 6.0f }, \ + { 7, 7.0f }, \ + { 8, 8.0f }, \ + { 9, 9.0f }, \ + { 10, 10.0f }, \ + { 11, 10.0f }, \ + { 12, 10.0f }, \ + { 13, 10.0f }, \ + { 14, 10.0f }, \ + { 15, 10.0f } \ } } @@ -294,7 +309,7 @@ struct rig_caps ft817_caps = RIG_MODEL(RIG_MODEL_FT817), .model_name = "FT-817", .mfg_name = "Yaesu", - .version = "20240520.0", + .version = "20240728.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, From ae39040fb12d2366a4c2dca33c5361e271d9a250 Mon Sep 17 00:00:00 2001 From: Mike Black W9MDB Date: Sun, 28 Jul 2024 16:56:15 -0500 Subject: [PATCH 4/6] Adjust PWR table for FT817 --- rigs/yaesu/ft817.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/rigs/yaesu/ft817.c b/rigs/yaesu/ft817.c index 42bc48ca9..744107b10 100644 --- a/rigs/yaesu/ft817.c +++ b/rigs/yaesu/ft817.c @@ -261,15 +261,15 @@ enum ft817_digi // Thanks to Olivier Schmitt sc.olivier@gmail.com for these tables #define FT817_PWR_CAL { 9, \ { \ - { 0x00, 0 }, \ - { 0x01, 10 }, \ - { 0x02, 14 }, \ - { 0x03, 20 }, \ - { 0x04, 34 }, \ - { 0x05, 50 }, \ - { 0x06, 66 }, \ - { 0x07, 82 }, \ - { 0x08, 100 } \ + { 0x00, 0.ss }, \ + { 0x01, 0.5f }, \ + { 0x02, 0.75f }, \ + { 0x03, 1.0f }, \ + { 0x04, 1.7f }, \ + { 0x05, 2.5f }, \ + { 0x06, 3.3f }, \ + { 0x07, 4.1f }, \ + { 0x08, 5.0f } \ } } #define FT817_ALC_CAL { 6, \ @@ -283,7 +283,7 @@ enum ft817_digi } } // SWR values from Christian WA4YA, DL4YA -#define FT817_SWR_CAL { 2, \ +#define FT817_SWR_CAL { 16, \ { \ { 0, 1.0f }, \ { 1, 1.4f }, \ @@ -309,7 +309,7 @@ struct rig_caps ft817_caps = RIG_MODEL(RIG_MODEL_FT817), .model_name = "FT-817", .mfg_name = "Yaesu", - .version = "20240728.0", + .version = "20240728.2", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -1193,7 +1193,7 @@ static int ft817_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt) } } - *ptt = ((p->tx_status & 0x80) == 0); + *ptt = ((p->tx_status & 0x20) == 0x20); return RIG_OK; } From 2668605fbd0968dce8126bcbd5357eade65fb9a9 Mon Sep 17 00:00:00 2001 From: Mike Black W9MDB Date: Sun, 28 Jul 2024 16:58:48 -0500 Subject: [PATCH 5/6] Fix boo-boo on ft817.c --- rigs/yaesu/ft817.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rigs/yaesu/ft817.c b/rigs/yaesu/ft817.c index 744107b10..802f5672b 100644 --- a/rigs/yaesu/ft817.c +++ b/rigs/yaesu/ft817.c @@ -261,7 +261,7 @@ enum ft817_digi // Thanks to Olivier Schmitt sc.olivier@gmail.com for these tables #define FT817_PWR_CAL { 9, \ { \ - { 0x00, 0.ss }, \ + { 0x00, 0.0f }, \ { 0x01, 0.5f }, \ { 0x02, 0.75f }, \ { 0x03, 1.0f }, \ From 2b10a3078e98682a0eeb689f8761bbf037f5f498 Mon Sep 17 00:00:00 2001 From: Mike Black W9MDB Date: Sun, 28 Jul 2024 17:30:37 -0500 Subject: [PATCH 6/6] Allow FT817 to return prior SWR value when not in transmit --- rigs/yaesu/ft817.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/rigs/yaesu/ft817.c b/rigs/yaesu/ft817.c index 802f5672b..590af3d48 100644 --- a/rigs/yaesu/ft817.c +++ b/rigs/yaesu/ft817.c @@ -128,6 +128,7 @@ struct ft817_priv_data /* Digi mode is not part of regular fm_status response. * So keep track of it in a separate variable. */ unsigned char dig_mode; + float swr; }; static int ft817_init(RIG *rig); @@ -309,7 +310,7 @@ struct rig_caps ft817_caps = RIG_MODEL(RIG_MODEL_FT817), .model_name = "FT-817", .mfg_name = "Yaesu", - .version = "20240728.2", + .version = "20240728.3", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -1227,8 +1228,9 @@ static int ft817_get_tx_level(RIG *rig, value_t *val, unsigned char *tx_level, if (ptt == RIG_PTT_OFF) { - rig_debug(RIG_DEBUG_VERBOSE, "%s: rig not keyed\n", __func__); - return -RIG_ERJCTED; //Or return OK? + val->f = p->swr; + //rig_debug(RIG_DEBUG_VERBOSE, "%s: rig not keyed\n", __func__); + return RIG_OK; // use known prior value } n = ft817_get_status(rig, FT817_NATIVE_CAT_GET_TX_METERING); @@ -1240,6 +1242,7 @@ static int ft817_get_tx_level(RIG *rig, value_t *val, unsigned char *tx_level, } val->f = rig_raw2val_float(*tx_level, cal); + p->swr = val->f; rig_debug(RIG_DEBUG_VERBOSE, "%s: level %f\n", __func__, val->f); return RIG_OK;