kopia lustrzana https://github.com/Hamlib/Hamlib
Have icom rigs fallback to old get mode when x26 has beeen disabled
https://github.com/Hamlib/Hamlib/issues/1547pull/1551/head
rodzic
85d9d8d62c
commit
fd69cb0487
|
@ -2254,8 +2254,9 @@ static int icom_get_mode_x26(RIG *rig, vfo_t vfo, int *mode_len,
|
||||||
const struct icom_priv_caps *priv_caps = rig->caps->priv;
|
const struct icom_priv_caps *priv_caps = rig->caps->priv;
|
||||||
int retval;
|
int retval;
|
||||||
|
|
||||||
if (priv->x26cmdfails > 0 && !priv_caps->x25x26_always)
|
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;
|
return -RIG_ENAVAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2610,6 +2611,8 @@ static int icom_get_mode_without_data(RIG *rig, vfo_t vfo, rmode_t *mode,
|
||||||
{
|
{
|
||||||
retval = icom_get_mode_x26(rig, vfo, &mode_len, modebuf);
|
retval = icom_get_mode_x26(rig, vfo, &mode_len, modebuf);
|
||||||
|
|
||||||
|
if (retval == RIG_OK)
|
||||||
|
{
|
||||||
// mode_len=5, modebuf=26 01 01 01 01
|
// mode_len=5, modebuf=26 01 01 01 01
|
||||||
// last 3 bytes are mode, datamode, filter (1-3)
|
// last 3 bytes are mode, datamode, filter (1-3)
|
||||||
priv_data->datamode = modebuf[3];
|
priv_data->datamode = modebuf[3];
|
||||||
|
@ -2618,6 +2621,11 @@ static int icom_get_mode_without_data(RIG *rig, vfo_t vfo, rmode_t *mode,
|
||||||
modebuf[2] = modebuf[4]; // copy filter to 2-byte format
|
modebuf[2] = modebuf[4]; // copy filter to 2-byte format
|
||||||
mode_len = 2;
|
mode_len = 2;
|
||||||
}
|
}
|
||||||
|
else if (retval == -RIG_ENAVAIL) // In case it's been disabled
|
||||||
|
{
|
||||||
|
retval = icom_transaction(rig, C_RD_MODE, -1, NULL, 0, modebuf, &mode_len);
|
||||||
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
retval = icom_transaction(rig, C_RD_MODE, -1, NULL, 0, modebuf, &mode_len);
|
retval = icom_transaction(rig, C_RD_MODE, -1, NULL, 0, modebuf, &mode_len);
|
||||||
|
|
Ładowanie…
Reference in New Issue