kopia lustrzana https://github.com/Hamlib/Hamlib
Fix channel reading for civ_731 icom rigs
I assume this is true on all such rigs that they return 5 bytes Writing and reading a channel should confirm it by returning the correct freq https://github.com/Hamlib/Hamlib/issues/217pull/234/head
rodzic
7dcb0ae88e
commit
acc468fcfd
|
@ -1016,6 +1016,7 @@ int icom_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
|||
int freq_len, retval;
|
||||
int cmd, subcmd;
|
||||
int ack_len = sizeof(ackbuf);
|
||||
int civ_731_mode = 0; // even these rigs have 5-byte channels
|
||||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called for %s\n", __func__,
|
||||
rig_strvfo(vfo));
|
||||
|
@ -1034,6 +1035,14 @@ int icom_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
|||
cmd = C_RD_FREQ;
|
||||
subcmd = -1;
|
||||
|
||||
if (vfo == RIG_VFO_MEM && priv->civ_731_mode)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: VFO=MEM so turning off civ_731\n", __func__);
|
||||
civ_731_mode = 1;
|
||||
priv->civ_731_mode = 0;
|
||||
|
||||
}
|
||||
|
||||
// Pick the appropriate VFO when VFO_TX is requested
|
||||
if (vfo == RIG_VFO_TX)
|
||||
{
|
||||
|
@ -1070,6 +1079,8 @@ int icom_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
|||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
if (vfo == RIG_VFO_MEM && civ_731_mode) { priv->civ_731_mode = 1; }
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
@ -1088,6 +1099,8 @@ int icom_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
|||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
if (vfo == RIG_VFO_MEM && civ_731_mode) { priv->civ_731_mode = 1; }
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
@ -1103,6 +1116,8 @@ int icom_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
|||
{
|
||||
*freq = RIG_FREQ_NONE;
|
||||
|
||||
if (vfo == RIG_VFO_MEM && civ_731_mode) { priv->civ_731_mode = 1; }
|
||||
|
||||
return RIG_OK;
|
||||
}
|
||||
|
||||
|
@ -1110,6 +1125,9 @@ int icom_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
|||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: wrong frame len=%d\n",
|
||||
__func__, freq_len);
|
||||
|
||||
if (vfo == RIG_VFO_MEM && civ_731_mode) { priv->civ_731_mode = 1; }
|
||||
|
||||
return -RIG_ERJCTED;
|
||||
}
|
||||
|
||||
|
@ -1124,6 +1142,8 @@ int icom_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
|||
*/
|
||||
*freq = from_bcd(freqbuf + 1, freq_len * 2);
|
||||
|
||||
if (vfo == RIG_VFO_MEM && civ_731_mode) { priv->civ_731_mode = 1; }
|
||||
|
||||
return RIG_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
#include <sys/time.h>
|
||||
#endif
|
||||
|
||||
#define BACKEND_VER "20200423"
|
||||
#define BACKEND_VER "20200426"
|
||||
|
||||
/*
|
||||
* defines used by comp_cal_str in rig.c
|
||||
|
|
Ładowanie…
Reference in New Issue