Fix memory channgle in FTDX101 and FTDX101MP

Add tag  data to memsave.c
Fix  RVF error for Elecraft K3
pull/1389/head
Mike Black W9MDB 2023-09-08 17:05:34 -05:00
rodzic 256766c5b6
commit c07e40e18b
8 zmienionych plików z 49 dodań i 7 usunięć

Wyświetl plik

@ -1573,6 +1573,7 @@ struct channel {
char channel_desc[HAMLIB_MAXCHANDESC]; /*!< Name */
struct ext_list
*ext_levels; /*!< Extension level value list, NULL ended. ext_levels can be NULL */
char tag[32]; /*!< TAG ASCII for channel name, etc */
};
/**
@ -1614,6 +1615,7 @@ struct channel_cap {
unsigned flags: 1; /*!< Channel flags */
unsigned channel_desc: 1; /*!< Name */
unsigned ext_levels: 1; /*!< Extension level value list */
unsigned tag: 1; /*!< Has tag field e.g. FT991 */
};
/**

Wyświetl plik

@ -135,7 +135,7 @@ const struct rig_caps ftdx101d_caps =
RIG_MODEL(RIG_MODEL_FTDX101D),
.model_name = "FTDX-101D",
.mfg_name = "Yaesu",
.version = NEWCAT_VER ".19",
.version = NEWCAT_VER ".20",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
@ -190,6 +190,8 @@ const struct rig_caps ftdx101d_caps =
.swr_cal = FTDX101D_SWR_CAL,
.chan_list = {
{ 1, 99, RIG_MTYPE_MEM, NEWCAT_MEM_CAP },
{ 100, 117, RIG_MTYPE_MEM, NEWCAT_MEM_CAP }, // P1L-P9U PMS channels
{ 501, 510, RIG_MTYPE_MEM, NEWCAT_MEM_CAP }, // 5xx 5MHz band
RIG_CHAN_END,
},

Wyświetl plik

@ -73,7 +73,7 @@ const struct rig_caps ftdx101mp_caps =
RIG_MODEL(RIG_MODEL_FTDX101MP),
.model_name = "FTDX-101MP",
.mfg_name = "Yaesu",
.version = NEWCAT_VER ".10",
.version = NEWCAT_VER ".11",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
@ -126,6 +126,8 @@ const struct rig_caps ftdx101mp_caps =
.swr_cal = FTDX101D_SWR_CAL,
.chan_list = {
{ 1, 99, RIG_MTYPE_MEM, NEWCAT_MEM_CAP },
{ 100, 117, RIG_MTYPE_MEM, NEWCAT_MEM_CAP }, // P1L-P9U PMS channels
{ 501, 510, RIG_MTYPE_MEM, NEWCAT_MEM_CAP }, // 5xx 5MHz band
RIG_CHAN_END,
},

Wyświetl plik

@ -242,7 +242,7 @@ static ncboolean is_ftdx9000Old;
*/
static const yaesu_newcat_commands_t valid_commands[] =
{
/* Command FT-450 FT-950 FT-891 FT-991 FT-2000 FT-9000 FT-5000 FT-1200 FT-3000 FTDX101D FTDX10 FTDX101MP FT710 */
/* Command FT-450 FT-950 FT-891 FT-991 FT-2000 FT-9000 FT-5000 FT-1200 FT-3000 FTDX101D FTDX10 FTDX101MP FT710 FT9000Old*/
{"AB", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
{"AC", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
{"AG", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE },
@ -7527,8 +7527,14 @@ int newcat_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only)
rig_debug(RIG_DEBUG_TRACE, "sizeof(priv->cmd_str) = %d\n",
(int)sizeof(priv->cmd_str));
SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "MR%03d%c", chan->channel_num,
cat_term);
if (is_ftdx101d || is_ftdx101mp || is_ft991 || is_ft710)
{
SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "MT%03d%c", chan->channel_num, cat_term);
}
else
{
SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "MR%03d%c", chan->channel_num, cat_term);
}
rig_debug(RIG_DEBUG_TRACE, "%s: cmd_str = %s\n", __func__, priv->cmd_str);
@ -7646,6 +7652,15 @@ int newcat_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only)
retval = priv->ret_data + 5;
chan->freq = atof(retval);
chan->tag[0] = '?'; // assume nothing
if (priv->ret_data[28] != ';') // must have TAG data?
{
// get the TAG data
sscanf(&priv->ret_data[28],"%s",chan->tag);
char *p = strchr(chan->tag,';');
if(p) *p = 0;
}
if (!read_only)
{
// Set rig to channel values

Wyświetl plik

@ -50,7 +50,7 @@
typedef char ncboolean;
/* shared function version */
#define NEWCAT_VER "20230805"
#define NEWCAT_VER "20230907"
/* Hopefully large enough for future use, 128 chars plus '\0' */
#define NEWCAT_DATA_LEN 129

Wyświetl plik

@ -540,6 +540,11 @@ void dump_csv_name(const channel_cap_t *mem_caps, FILE *f)
fprintf(f, "flags%c", csv_sep);
}
if (mem_caps->tag)
{
fprintf(f, "tag%c", csv_sep);
}
fprintf(f, "\n");
}
@ -693,7 +698,14 @@ int dump_csv_chan(RIG *rig,
if (mem_caps->flags)
{
fprintf(f, "%x%c", chan.flags, csv_sep);
if (chan.tag[0] != 0) // then we need the seperator
fprintf(f, "%x%c", chan.flags, csv_sep);
else
fprintf(f, "%x", chan.flags);
}
if (chan.tag[0] != 0)
{
fprintf(f, "%s", chan.tag);
}
fprintf(f, "\n");

Wyświetl plik

@ -279,6 +279,12 @@ int dump_xml_chan(RIG *rig,
xmlNewProp(node, (unsigned char *) "flags", (unsigned char *) attrbuf);
}
if (mem_caps->tag[0] != 0)
{
SNPRINTF(attrbuf, sizeof(attrbuf), "%s", chan.tag);
xmlNewProp(node, (unsigned char *) "tag", (unsigned char *) attrbuf);
}
return 0;
}
#endif

Wyświetl plik

@ -29,6 +29,7 @@
#include <getopt.h>
#include <hamlib/rig.h>
#include <hamlib/config.h>
#include "riglist.h"
#define MAXNAMSIZ 32
@ -209,6 +210,7 @@ int main(int argc, char *argv[])
#ifdef HAVE_XML2
case 'x':
printf("xml\n");
xml++;
break;
#endif
@ -218,6 +220,7 @@ int main(int argc, char *argv[])
break;
default:
fprintf(stderr, "Unknown option '%c'\n", c);
usage(); /* unknown option? */
exit(1);
}