Porównaj commity

...

10 Commity

Autor SHA1 Wiadomość Data
Mike Black W9MDB 55d5f8b64a Really fix FLRig get_bwA return code 2024-03-26 16:59:57 -05:00
Mike Black W9MDB 0a0118b797 Fix FLrig get_bwA and get_bwB to return cached value if FLRig returns empty value 2024-03-26 16:25:20 -05:00
Mike Black W9MDB 896230beed Fix bandwidth set for FLRig 2024-03-25 22:26:58 -05:00
Mike Black W9MDB 8ebffd20b6 Fix get_vfo_info compatibility with Log4OM
https://github.com/Hamlib/Hamlib/issues/1531
2024-03-25 17:50:39 -05:00
Mike Black W9MDB dc375c6d00 Fix rig_get_split_vfo -- was almost always using cache 2024-03-25 14:46:26 -05:00
Mike Black W9MDB 624e00dcb4 Fix FLRig reading of bandwith when FIXED or "k" is read back 2024-03-25 11:29:18 -05:00
Mike Black W9MDB 31ea63b2f3 Fix IC7300 bandwidth reading for AM/BM ....still need to fix setting bandwidth for AM/FM 2024-03-25 10:23:40 -05:00
Mike Black W9MDB c3429084fb Allow FLRig to use "k" values for bandwidth 2024-03-25 10:22:48 -05:00
Michael Black 12ae80c0c5
Merge pull request #1529 from DJ3CE/k3kx3_swr
Add SWR get_level to K3 (KX3, KX2)
2024-03-24 22:36:03 -05:00
Cedric DJ3CE 7a7b52b89c Add SWR get_level to K3 (KX3, KX2)
Capabilities, level_gran and k3_get_level
2024-03-25 01:49:02 +01:00
8 zmienionych plików z 103 dodań i 24 usunięć

Wyświetl plik

@ -143,7 +143,7 @@ struct rig_caps flrig_caps =
RIG_MODEL(RIG_MODEL_FLRIG),
.model_name = "",
.mfg_name = "FLRig",
.version = "20240302.0",
.version = "20240325.0",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
@ -1602,14 +1602,18 @@ static int flrig_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
"<params><param><value><i4>%ld</i4></value></param></params>",
width);
if (vfo == RIG_VFO_A)
if (priv->has_set_bwA && vfo == RIG_VFO_A)
{
retval = flrig_transaction(rig, "rig.set_bwA", cmd_arg, NULL, 0);
}
else
else if (priv->has_set_bwB && vfo == RIG_VFO_B)
{
retval = flrig_transaction(rig, "rig.set_bwB", cmd_arg, NULL, 0);
}
else
{
retval = flrig_transaction(rig, "rig.set_bandwidth", cmd_arg, NULL, 0);
}
if (retval < 0)
{
@ -1765,11 +1769,19 @@ static int flrig_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
cmdp = "rig.get_bwA";
retval = flrig_transaction(rig, cmdp, NULL, value, sizeof(value));
if (strlen(value) == 0) // sometimes we get a null reply here -- OK...deal with it
{
rig_debug(RIG_DEBUG_WARN, "%s: empty value return cached bandwidth\n", __func__);
*width = rig->state.cache.widthMainA;
RETURNFUNC(RIG_OK);
}
if (retval == RIG_OK && strstr(value, "NONE"))
{
priv->has_get_bwA = priv->has_get_bwB = 0;
*width = 0;
rig_debug(RIG_DEBUG_VERBOSE, "%s: does not have rig.get_bwA/B\n", __func__);
RETURNFUNC(RIG_OK);
}
if (retval != RIG_OK || strstr(value, "NONE"))
@ -1783,6 +1795,12 @@ static int flrig_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
cmdp = "rig.get_bwB";
retval = flrig_transaction(rig, cmdp, NULL, value, sizeof(value));
if (strlen(value) == 0)
{
rig_debug(RIG_DEBUG_WARN, "%s: empty value return cached bandwidth\n", __func__);
*width = rig->state.cache.widthMainA;
RETURNFUNC(RIG_OK);
}
if (retval == RIG_OK && strlen(value) == 0)
{
rig_debug(RIG_DEBUG_VERBOSE, "%s: does not have rig.get_bwB\n", __func__);
@ -1808,15 +1826,21 @@ static int flrig_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
/* we might get two values and then we want the 2nd one */
if (strchr(value, '|') != NULL) { p = strchr(value, '|') + 1; }
*width = atoi(p);
if (strcmp(p, "FIXED"))
if (strstr(p, "k")) { *width = *width * 1000; }
rig_debug(RIG_DEBUG_ERR, "%s: p=%s, *width=%d\n", __func__, p, (int)(*width));
if (strcmp(p, "FIXED") == 0)
{
switch(*mode)
switch (*mode)
{
case RIG_MODE_PKTAM:
case RIG_MODE_AM:
case RIG_MODE_PKTFM:
case RIG_MODE_FM: *width = 10000;break;
case RIG_MODE_PKTAM:
case RIG_MODE_AM:
case RIG_MODE_PKTFM:
case RIG_MODE_FM: *width = 10000; break;
}
}
}

Wyświetl plik

@ -50,11 +50,11 @@ int ic9700_get_clock(RIG *rig, int *year, int *month, int *day,
int ic9700_set_vfo(RIG *rig, vfo_t vfo);
#define IC7300_ALL_RX_MODES (RIG_MODE_FM|RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|RIG_MODE_RTTY|RIG_MODE_RTTYR|RIG_MODE_PKTLSB|RIG_MODE_PKTUSB|RIG_MODE_PKTFM|RIG_MODE_PKTAM)
#define IC7300_ALL_RX_MODES (RIG_MODE_FM|RIG_MODE_PKTFM|RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|RIG_MODE_RTTY|RIG_MODE_RTTYR|RIG_MODE_PKTLSB|RIG_MODE_PKTUSB|RIG_MODE_PKTFM|RIG_MODE_PKTAM)
#define IC7300_1HZ_TS_MODES (RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|RIG_MODE_RTTY|RIG_MODE_RTTYR|RIG_MODE_PKTLSB|RIG_MODE_PKTUSB|RIG_MODE_PKTFM|RIG_MODE_PKTAM)
#define IC7300_NOT_TS_MODES (IC7300_ALL_RX_MODES &~IC7300_1HZ_TS_MODES)
#define IC7300_OTHER_TX_MODES (RIG_MODE_FM|RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|RIG_MODE_RTTY|RIG_MODE_RTTYR)
#define IC7300_OTHER_TX_MODES (RIG_MODE_FM|RIG_MODE_PKTFM|RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|RIG_MODE_RTTY|RIG_MODE_RTTYR)
#define IC7300_AM_TX_MODES (RIG_MODE_AM|RIG_MODE_PKTAM)
#define IC7300_FUNCS (RIG_FUNC_NB|RIG_FUNC_COMP|RIG_FUNC_VOX|RIG_FUNC_TONE|RIG_FUNC_TSQL|RIG_FUNC_SBKIN|RIG_FUNC_FBKIN|RIG_FUNC_NR|RIG_FUNC_MON|RIG_FUNC_MN|RIG_FUNC_ANF|RIG_FUNC_LOCK|RIG_FUNC_RIT|RIG_FUNC_XIT|RIG_FUNC_SCOPE|RIG_FUNC_TUNER|RIG_FUNC_TRANSCEIVE|RIG_FUNC_SPECTRUM|RIG_FUNC_SPECTRUM_HOLD|RIG_FUNC_SEND_MORSE|RIG_FUNC_SEND_VOICE_MEM|RIG_FUNC_OVF_STATUS)

Wyświetl plik

@ -440,6 +440,7 @@ struct icom_addr
#define TOK_FILTER_USBD TOKEN_BACKEND(5)
#define TOK_FILTER_USB TOKEN_BACKEND(6)
#define TOK_FILTER_CW TOKEN_BACKEND(7)
#define TOK_FILTER_FM TOKEN_BACKEND(8)
const struct confparams icom_cfg_params[] =
{
@ -474,6 +475,10 @@ const struct confparams icom_cfg_params[] =
TOK_FILTER_CW, "filter_cw", "Filter to use CW", "Filter to use for CW/CWR when setting mode",
"0", RIG_CONF_NUMERIC, {.n = {0, 3, 1}}
},
{
TOK_FILTER_FM, "filter_fm", "Filter to use FM", "Filter to use for FM/PKTFM when setting mode",
"0", RIG_CONF_NUMERIC, {.n = {0, 3, 1}}
},
{RIG_CONF_END, NULL,}
};
@ -1977,9 +1982,9 @@ pbwidth_t icom_get_dsp_flt(RIG *rig, rmode_t mode)
}
// TODO: Skip for Xiegu G90 too????
if (mode == RIG_MODE_FM || mode == RIG_MODE_FMN
|| RIG_MODEL_X108G == rig->caps->rig_model
|| RIG_MODEL_X5105 == rig->caps->rig_model)
if (RIG_MODEL_X108G == rig->caps->rig_model
|| RIG_MODEL_X5105 == rig->caps->rig_model
|| RIG_MODEL_G90 == rig->caps->rig_model)
{
priv->no_1a_03_cmd = ENUM_1A_03_NO;
}
@ -1992,7 +1997,7 @@ pbwidth_t icom_get_dsp_flt(RIG *rig, rmode_t mode)
retval = icom_transaction(rig, C_CTL_MEM, fw_sub_cmd, 0, 0,
resbuf, &res_len);
if (-RIG_ERJCTED == retval)
if (-RIG_ERJCTED == retval && !RIG_IS_IC7300)
{
if (priv->no_1a_03_cmd == ENUM_1A_03_UNK)
{
@ -2108,6 +2113,13 @@ int icom_set_dsp_flt(RIG *rig, rmode_t mode, pbwidth_t width)
flt_idx =
width <= 500 ? ((width + 49) / 50) - 1 : ((width + 99) / 100) + 4;
}
else if (mode & (RIG_MODE_FM | RIG_MODE_PKTFM))
{
if (width <= 7000) width = 7000;
else if (width <= 10000) width = 10000;
else width=15000;
RETURNFUNC(RIG_OK);
}
else
{
rig_debug(RIG_DEBUG_VERBOSE, "%s: unknown mode=%s\n", __func__,
@ -2311,17 +2323,22 @@ static int icom_set_mode_x26(RIG *rig, vfo_t vfo, rmode_t mode,
buf[2] = priv->filter_usbd;
}
if (priv->filter_usb > 0 && (mode == RIG_MODE_USB || mode == RIG_MODE_LSB))
else if (priv->filter_usb > 0 && (mode == RIG_MODE_USB || mode == RIG_MODE_LSB))
{
rig_debug(RIG_DEBUG_TRACE, "%s: filter usb=%d\n", __func__, priv->filter_usb);
buf[2] = priv->filter_usb;
}
if (priv->filter_cw > 0 && (mode == RIG_MODE_CW || mode == RIG_MODE_CWR))
else if (priv->filter_cw > 0 && (mode == RIG_MODE_CW || mode == RIG_MODE_CWR))
{
rig_debug(RIG_DEBUG_TRACE, "%s: filter cw=%d\n", __func__, priv->filter_cw);
buf[2] = priv->filter_cw;
}
else if (priv->filter_fm > 0 && (mode == RIG_MODE_FM || mode == RIG_MODE_PKTFM))
{
rig_debug(RIG_DEBUG_TRACE, "%s: filter fm=%d\n", __func__, priv->filter_fm);
buf[2] = priv->filter_fm;
}
int vfo_number = icom_get_vfo_number_x25x26(rig, vfo);
@ -2532,7 +2549,7 @@ int icom_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
}
if (((width != RIG_PASSBAND_NOCHANGE) && (width != current_width))
|| (priv->filter_usbd > 0 || priv->filter_usb > 0 || priv->filter_cw > 0))
|| (priv->filter_usbd > 0 || priv->filter_usb > 0 || priv->filter_cw > 0 || priv->filter_fm > 0))
{
icom_set_dsp_flt(rig, mode, width);
}
@ -2609,7 +2626,7 @@ static int icom_get_mode_without_data(RIG *rig, vfo_t vfo, rmode_t *mode,
{
priv_data->filter = 0;
if (mode_len == 2) { priv_data->filter = modebuf[2]; }
if (mode_len == 1) { priv_data->filter = modebuf[2]; }
rig_debug(RIG_DEBUG_TRACE,
"%s(%d): modebuf[0]=0x%02x, modebuf[1]=0x%02x, mode_len=%d\n", __func__,
@ -2683,7 +2700,16 @@ static int icom_get_mode_without_data(RIG *rig, vfo_t vfo, rmode_t *mode,
*width = filter_width;
if (*mode == RIG_MODE_FM) { *width = 12000; }
if (*mode == RIG_MODE_FM)
{
*width = 12000; // some default to 12000
if (RIG_IS_IC7300)
{
if (priv_data->filter == 1) *width = 15000;
else if (priv_data->filter == 2) *width = 10000;
else if (priv_data->filter == 3) *width = 7000;
}
}
RETURNFUNC2(RIG_OK);
}
@ -5089,6 +5115,15 @@ int icom_set_conf(RIG *rig, hamlib_token_t token, const char *val)
break;
case TOK_FILTER_FM:
priv->filter_fm = atoi(val);
if (priv->filter_fm > 3) { priv->filter_fm = 3; }
if (priv->filter_fm < 1) { priv->filter_fm = 1; }
break;
default:
RETURNFUNC(-RIG_EINVAL);
}

Wyświetl plik

@ -296,6 +296,7 @@ struct icom_priv_data
int filter_usbd; /*!< Filter number to use for USBD/LSBD when setting mode */
int filter_usb; /*!< Filter number to use for USB/LSB when setting mode */
int filter_cw; /*!< Filter number to use for CW/CWR when setting mode */
int filter_fm; /*!< Filter number to use for CW/CWR when setting mode */
};
extern const struct ts_sc_list r8500_ts_sc_list[];

Wyświetl plik

@ -63,7 +63,8 @@
#define KX3_LEVEL_ALL (RIG_LEVEL_ATT|RIG_LEVEL_PREAMP|RIG_LEVEL_AGC|RIG_LEVEL_SQL|\
RIG_LEVEL_STRENGTH|RIG_LEVEL_RFPOWER|RIG_LEVEL_KEYSPD|\
RIG_LEVEL_AF|RIG_LEVEL_RF|RIG_LEVEL_MICGAIN|RIG_LEVEL_COMP|\
RIG_LEVEL_NR|RIG_LEVEL_MONITOR_GAIN|RIG_LEVEL_RAWSTR|RIG_LEVEL_RFPOWER_METER|RIG_LEVEL_RFPOWER_METER_WATTS)
RIG_LEVEL_NR|RIG_LEVEL_MONITOR_GAIN|RIG_LEVEL_RAWSTR|RIG_LEVEL_RFPOWER_METER|\
RIG_LEVEL_RFPOWER_METER_WATTS|RIG_LEVEL_SWR)
/*
* Elecraft K3/K3S extra level definitions
@ -2313,6 +2314,18 @@ int k3_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
break;
case RIG_LEVEL_SWR:
retval = kenwood_safe_transaction(rig, "SW", levelbuf, sizeof(levelbuf), 5);
if (retval != RIG_OK)
{
return retval;
}
sscanf(levelbuf + 2, "%d", &val->i);
val->f = (float) val->i / 10.0f;
break;
default:
return kenwood_get_level(rig, vfo, level, val);
}

Wyświetl plik

@ -27,4 +27,5 @@
[LVL_COMP] = { .min = { .f = .0 }, .max = { .f = 1 }, .step = { .f = 1.0f/100.0f } },
[LVL_VOXGAIN] = { .min = { .f = .0 }, .max = { .f = 1 }, .step = { .f = 1.0f/100.0f } },
[LVL_ALC] = { .min = { .f = .0 }, .max = { .f = 1 }, .step = { .f = 1.0f/100.0f } },
[LVL_SWR] = { .min = { .f = 1.0 }, .max = { .f = 99.9 }, .step = { .f = 1.0f/10.0f } },

Wyświetl plik

@ -5825,7 +5825,7 @@ int HAMLIB_API rig_get_split_vfo(RIG *rig,
struct rig_cache *cachep = CACHE(rig);
int retcode;
int cache_ms;
int use_cache;
int use_cache = 0;
if (CHECK_RIG_ARG(rig))
{
@ -5854,6 +5854,7 @@ int HAMLIB_API rig_get_split_vfo(RIG *rig,
if (caps->get_split_vfo == NULL || use_cache)
{
rig_debug(RIG_DEBUG_TRACE, "%s: ?get_split_vfo=%d use_cache=%d\n", __func__, caps->get_split_vfo != NULL, use_cache);
// if we can't get the vfo we will return whatever we have cached
*split = cachep->split;
*tx_vfo = cachep->split_vfo;

Wyświetl plik

@ -1736,8 +1736,12 @@ readline_repeat:
" %s",
rig_strvfo(vfo));
p1 == NULL ? a1[0] = '\0' : snprintf(a1, sizeof(a1), "%c%s",
*vfo_opt ? ',' : ' ', p1);
// exception for get_vfo_info cmd which fails with log4om otherwise
if (*vfo_opt && cmd != 0xf3)
p1 == NULL ? a1[0] = '\0' : snprintf(a1, sizeof(a1), ":%s", p1);
else
p1 == NULL ? a1[0] = '\0' : snprintf(a1, sizeof(a1), " %s", p1);
p2 == NULL ? a2[0] = '\0' : snprintf(a2, sizeof(a2), " %s", p2);
p3 == NULL ? a3[0] = '\0' : snprintf(a3, sizeof(a3), " %s", p3);