kopia lustrzana https://github.com/Hamlib/Hamlib
astyle files
rodzic
4177dde4e0
commit
5e801fd2b5
|
@ -410,12 +410,14 @@ static int dummy_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
|||
|
||||
if (vfo == RIG_VFO_A) { priv->curr->freq = freq; }
|
||||
else if (vfo == RIG_VFO_B) { priv->curr->tx_freq = freq; }
|
||||
|
||||
if (!priv->split)
|
||||
{
|
||||
priv->curr->tx_freq = freq;
|
||||
}
|
||||
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: curr->freq=%.0f, curr->tx_freq=%.0f\n", __func__,
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: curr->freq=%.0f, curr->tx_freq=%.0f\n",
|
||||
__func__,
|
||||
priv->curr->freq, priv->curr->tx_freq);
|
||||
return RIG_OK;
|
||||
}
|
||||
|
|
|
@ -327,7 +327,8 @@ transaction_write:
|
|||
// Seems some rigs (like TS-480) return "?" when RX is done while PTT=OFF
|
||||
// So we'll skip the checks just on this one command for now
|
||||
// The TS-480 PC Control says RX; should return RX0; but it doesn't
|
||||
if (retval == RIG_OK && strncmp(cmdstr, "RX", 2) == 0) goto transaction_quit;
|
||||
// We may eventually want to verify PTT with rig_get_ptt instead
|
||||
if (retval == RIG_OK && strncmp(cmdstr, "RX", 2) == 0) { goto transaction_quit; }
|
||||
|
||||
if (!datasize)
|
||||
{
|
||||
|
@ -668,6 +669,7 @@ int kenwood_init(RIG *rig)
|
|||
priv = rig->state.priv;
|
||||
|
||||
memset(priv, 0x00, sizeof(struct kenwood_priv_data));
|
||||
|
||||
if (RIG_IS_XG3)
|
||||
{
|
||||
priv->verify_cmd[0] = caps->cmdtrm;
|
||||
|
@ -680,6 +682,7 @@ int kenwood_init(RIG *rig)
|
|||
priv->verify_cmd[2] = caps->cmdtrm;
|
||||
priv->verify_cmd[3] = '\0';
|
||||
}
|
||||
|
||||
priv->split = RIG_SPLIT_OFF;
|
||||
priv->trn_state = -1;
|
||||
priv->curr_mode = 0;
|
||||
|
@ -731,7 +734,8 @@ int kenwood_open(RIG *rig)
|
|||
rig_debug(RIG_DEBUG_TRACE, "%s: got ID so try PS\n", __func__);
|
||||
err = rig_get_powerstat(rig, &powerstat);
|
||||
|
||||
if (err == RIG_OK && powerstat == 0 && priv->poweron == 0 && rig->state.auto_power_on)
|
||||
if (err == RIG_OK && powerstat == 0 && priv->poweron == 0
|
||||
&& rig->state.auto_power_on)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: got PS0 so powerup\n", __func__);
|
||||
rig_set_powerstat(rig, 1);
|
||||
|
@ -741,6 +745,7 @@ int kenwood_open(RIG *rig)
|
|||
|
||||
err = RIG_OK; // reset our err back to OK for later checks
|
||||
}
|
||||
|
||||
if (err == -RIG_ETIMEOUT && rig->state.auto_power_on)
|
||||
{
|
||||
// Ensure rig is on
|
||||
|
@ -748,6 +753,7 @@ int kenwood_open(RIG *rig)
|
|||
/* Try get id again */
|
||||
err = kenwood_get_id(rig, id);
|
||||
}
|
||||
|
||||
if (RIG_OK != err)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR,
|
||||
|
@ -879,6 +885,7 @@ int kenwood_open(RIG *rig)
|
|||
vfo_t tx_vfo;
|
||||
/* get current AI state so it can be restored */
|
||||
kenwood_get_trn(rig, &priv->trn_state); /* ignore errors */
|
||||
|
||||
/* Currently we cannot cope with AI mode so turn it off in
|
||||
case last client left it on */
|
||||
if (priv->trn_state != RIG_TRN_OFF)
|
||||
|
@ -891,10 +898,12 @@ int kenwood_open(RIG *rig)
|
|||
{
|
||||
// call get_split to fill in current split and tx_vfo status
|
||||
retval = kenwood_get_split_vfo_if(rig, RIG_VFO_A, &split, &tx_vfo);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: %s\n", __func__, rigerror(retval));
|
||||
}
|
||||
|
||||
priv->tx_vfo = tx_vfo;
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: priv->tx_vfo=%s\n", __func__,
|
||||
rig_strvfo(priv->tx_vfo));
|
||||
|
@ -3438,7 +3447,8 @@ int kenwood_set_trn(RIG *rig, int trn)
|
|||
|
||||
case RIG_MODEL_THD7A:
|
||||
case RIG_MODEL_THD74:
|
||||
return kenwood_transaction(rig, (trn == RIG_TRN_RIG) ? "AI 1" : "AI 0", buf, sizeof buf);
|
||||
return kenwood_transaction(rig, (trn == RIG_TRN_RIG) ? "AI 1" : "AI 0", buf,
|
||||
sizeof buf);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
|
@ -474,10 +474,12 @@ th_set_vfo(RIG *rig, vfo_t vfo)
|
|||
case RIG_VFO_MEM:
|
||||
strncpy(cmd, "BC", sizeof cmd);
|
||||
retval = kenwood_transaction(rig, cmd, cmd, sizeof cmd);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
return retval;
|
||||
}
|
||||
|
||||
if (rig->caps->rig_model == RIG_MODEL_THF7E ||
|
||||
rig->caps->rig_model == RIG_MODEL_THF6A)
|
||||
{
|
||||
|
@ -1583,7 +1585,9 @@ th_set_dcs_sql(RIG *rig, vfo_t vfo, tone_t code)
|
|||
}
|
||||
|
||||
snprintf(codebuf, sizeof codebuf, "DCS 1");
|
||||
if ((retval = kenwood_transaction(rig, codebuf, codebuf, sizeof codebuf)) != RIG_OK)
|
||||
|
||||
if ((retval = kenwood_transaction(rig, codebuf, codebuf,
|
||||
sizeof codebuf)) != RIG_OK)
|
||||
{
|
||||
return retval;
|
||||
}
|
||||
|
@ -1801,7 +1805,8 @@ th_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt)
|
|||
{
|
||||
char buf[3];
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: called\n", __func__);
|
||||
return kenwood_transaction(rig, (ptt == RIG_PTT_ON) ? "TX" : "RX", buf, sizeof buf);
|
||||
return kenwood_transaction(rig, (ptt == RIG_PTT_ON) ? "TX" : "RX", buf,
|
||||
sizeof buf);
|
||||
}
|
||||
|
||||
int th_get_dcd(RIG *rig, vfo_t vfo, dcd_t *dcd)
|
||||
|
|
|
@ -850,52 +850,72 @@ int ft1000mp_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
{
|
||||
case RIG_MODE_AM:
|
||||
cmd_index = FT1000MP_NATIVE_MODE_SET_AM;
|
||||
if (vfo == RIG_VFO_B) cmd_index = FT1000MP_NATIVE_MODE_SET_AM_B;
|
||||
|
||||
if (vfo == RIG_VFO_B) { cmd_index = FT1000MP_NATIVE_MODE_SET_AM_B; }
|
||||
|
||||
break;
|
||||
|
||||
case RIG_MODE_CW:
|
||||
cmd_index = FT1000MP_NATIVE_MODE_SET_CWR;
|
||||
if (vfo == RIG_VFO_B) cmd_index = FT1000MP_NATIVE_MODE_SET_CWR_B;
|
||||
|
||||
if (vfo == RIG_VFO_B) { cmd_index = FT1000MP_NATIVE_MODE_SET_CWR_B; }
|
||||
|
||||
break;
|
||||
|
||||
case RIG_MODE_CWR:
|
||||
cmd_index = FT1000MP_NATIVE_MODE_SET_CW;
|
||||
if (vfo == RIG_VFO_B) cmd_index = FT1000MP_NATIVE_MODE_SET_CW_B;
|
||||
|
||||
if (vfo == RIG_VFO_B) { cmd_index = FT1000MP_NATIVE_MODE_SET_CW_B; }
|
||||
|
||||
break;
|
||||
|
||||
case RIG_MODE_USB:
|
||||
cmd_index = FT1000MP_NATIVE_MODE_SET_USB;
|
||||
if (vfo == RIG_VFO_B) cmd_index = FT1000MP_NATIVE_MODE_SET_USB_B;
|
||||
|
||||
if (vfo == RIG_VFO_B) { cmd_index = FT1000MP_NATIVE_MODE_SET_USB_B; }
|
||||
|
||||
break;
|
||||
|
||||
case RIG_MODE_LSB:
|
||||
cmd_index = FT1000MP_NATIVE_MODE_SET_LSB;
|
||||
if (vfo == RIG_VFO_B) cmd_index = FT1000MP_NATIVE_MODE_SET_LSB_B;
|
||||
|
||||
if (vfo == RIG_VFO_B) { cmd_index = FT1000MP_NATIVE_MODE_SET_LSB_B; }
|
||||
|
||||
break;
|
||||
|
||||
case RIG_MODE_FM:
|
||||
cmd_index = FT1000MP_NATIVE_MODE_SET_FM;
|
||||
if (vfo == RIG_VFO_B) cmd_index = FT1000MP_NATIVE_MODE_SET_FM_B;
|
||||
|
||||
if (vfo == RIG_VFO_B) { cmd_index = FT1000MP_NATIVE_MODE_SET_FM_B; }
|
||||
|
||||
break;
|
||||
|
||||
case RIG_MODE_RTTY:
|
||||
cmd_index = FT1000MP_NATIVE_MODE_SET_RTTY_LSB;
|
||||
if (vfo == RIG_VFO_B) cmd_index = FT1000MP_NATIVE_MODE_SET_RTTY_LSB_B;
|
||||
|
||||
if (vfo == RIG_VFO_B) { cmd_index = FT1000MP_NATIVE_MODE_SET_RTTY_LSB_B; }
|
||||
|
||||
break;
|
||||
|
||||
case RIG_MODE_RTTYR:
|
||||
cmd_index = FT1000MP_NATIVE_MODE_SET_RTTY_USB;
|
||||
if (vfo == RIG_VFO_B) cmd_index = FT1000MP_NATIVE_MODE_SET_RTTY_USB_B;
|
||||
|
||||
if (vfo == RIG_VFO_B) { cmd_index = FT1000MP_NATIVE_MODE_SET_RTTY_USB_B; }
|
||||
|
||||
break;
|
||||
|
||||
case RIG_MODE_PKTLSB:
|
||||
cmd_index = FT1000MP_NATIVE_MODE_SET_DATA_LSB;
|
||||
if (vfo == RIG_VFO_B) cmd_index = FT1000MP_NATIVE_MODE_SET_DATA_LSB_B;
|
||||
|
||||
if (vfo == RIG_VFO_B) { cmd_index = FT1000MP_NATIVE_MODE_SET_DATA_LSB_B; }
|
||||
|
||||
break;
|
||||
|
||||
case RIG_MODE_PKTFM:
|
||||
cmd_index = FT1000MP_NATIVE_MODE_SET_DATA_FM;
|
||||
if (vfo == RIG_VFO_B) cmd_index = FT1000MP_NATIVE_MODE_SET_FM_B;
|
||||
|
||||
if (vfo == RIG_VFO_B) { cmd_index = FT1000MP_NATIVE_MODE_SET_FM_B; }
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
|
@ -227,8 +227,10 @@ gs232b_rot_get_position(ROT *rot, azimuth_t *az, elevation_t *el)
|
|||
*/
|
||||
// There's a 12PR1A rotor that only returns AZ so we may only get AZ=xxx
|
||||
if (sscanf(posbuf, "AZ=%d EL=%d", &int_az, &int_el) == 0)
|
||||
{ // only give error if we didn't parse anything
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: wrong reply '%s', expected AZ=xxx EL=xxx\n", __func__,
|
||||
{
|
||||
// only give error if we didn't parse anything
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: wrong reply '%s', expected AZ=xxx EL=xxx\n",
|
||||
__func__,
|
||||
posbuf);
|
||||
return -RIG_EPROTO;
|
||||
}
|
||||
|
|
|
@ -567,6 +567,7 @@ static int frontend_set_conf(RIG *rig, token_t token, const char *val)
|
|||
{
|
||||
return -RIG_EINVAL; //value format error
|
||||
}
|
||||
|
||||
rs->auto_power_on = val_i ? 1 : 0;
|
||||
break;
|
||||
|
||||
|
@ -575,6 +576,7 @@ static int frontend_set_conf(RIG *rig, token_t token, const char *val)
|
|||
{
|
||||
return -RIG_EINVAL; //value format error
|
||||
}
|
||||
|
||||
rs->auto_disable_screensaver = val_i ? 1 : 0;
|
||||
break;
|
||||
|
||||
|
|
|
@ -1313,7 +1313,8 @@ int HAMLIB_API rig_get_cache_timeout_ms(RIG *rig, hamlib_cache_t selection)
|
|||
return rig->state.cache.timeout_ms;
|
||||
}
|
||||
|
||||
int HAMLIB_API rig_set_cache_timeout_ms(RIG *rig, hamlib_cache_t selection, int ms)
|
||||
int HAMLIB_API rig_set_cache_timeout_ms(RIG *rig, hamlib_cache_t selection,
|
||||
int ms)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: called selection=%d, ms=%d\n", __func__,
|
||||
selection, ms);
|
||||
|
|
|
@ -1054,5 +1054,6 @@ int find_on_list(char **list, char *what)
|
|||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
return i;
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue