mirror of
https://github.com/Hamlib/Hamlib.git
synced 2024-09-21 02:17:21 +00:00
astyle files for 4.5 release
This commit is contained in:
parent
44ad5c6363
commit
a83eb3bf42
@ -207,20 +207,23 @@ int gemini_set_freq(AMP *amp, freq_t freq)
|
||||
char *cmd;
|
||||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
||||
if (freq < 1.0) cmd = "B472KHZ\n";
|
||||
else if (freq < 2.0) cmd = "B1.8MHZ\n";
|
||||
else if (freq < 4.0) cmd = "B3.5MHZ\n";
|
||||
else if (freq < 6.0) cmd = "B50MHZ\n";
|
||||
else if (freq < 9.0) cmd = "B70MHZ\n";
|
||||
else if (freq < 12.0) cmd = "B10MHZ\n";
|
||||
else if (freq < 16.0) cmd = "B14MHZ\n";
|
||||
else if (freq < 19.0) cmd = "B18MHZ\n";
|
||||
else if (freq < 22.0) cmd = "B21MHZ\n";
|
||||
else if (freq < 26.0) cmd = "B24MHZ\n";
|
||||
else cmd = "B50MHZ\n";
|
||||
|
||||
if (freq < 1.0) { cmd = "B472KHZ\n"; }
|
||||
else if (freq < 2.0) { cmd = "B1.8MHZ\n"; }
|
||||
else if (freq < 4.0) { cmd = "B3.5MHZ\n"; }
|
||||
else if (freq < 6.0) { cmd = "B50MHZ\n"; }
|
||||
else if (freq < 9.0) { cmd = "B70MHZ\n"; }
|
||||
else if (freq < 12.0) { cmd = "B10MHZ\n"; }
|
||||
else if (freq < 16.0) { cmd = "B14MHZ\n"; }
|
||||
else if (freq < 19.0) { cmd = "B18MHZ\n"; }
|
||||
else if (freq < 22.0) { cmd = "B21MHZ\n"; }
|
||||
else if (freq < 26.0) { cmd = "B24MHZ\n"; }
|
||||
else { cmd = "B50MHZ\n"; }
|
||||
|
||||
retval = gemini_transaction(amp, cmd, NULL, 0);
|
||||
|
||||
if (retval != RIG_OK) { return retval; }
|
||||
|
||||
return RIG_OK;
|
||||
}
|
||||
|
||||
|
@ -2656,6 +2656,7 @@ int netrigctl_set_lock_mode(RIG *rig, int lock)
|
||||
{
|
||||
return -RIG_EPROTO;
|
||||
}
|
||||
|
||||
return (RIG_OK);
|
||||
}
|
||||
|
||||
@ -2666,10 +2667,12 @@ int netrigctl_get_lock_mode(RIG *rig, int *lock)
|
||||
int ret;
|
||||
SNPRINTF(cmdbuf, sizeof(cmdbuf), "\\get_lock_mode\n");
|
||||
ret = netrigctl_transaction(rig, cmdbuf, strlen(cmdbuf), buf);
|
||||
|
||||
if (ret == 0)
|
||||
{
|
||||
return -RIG_EPROTO;
|
||||
}
|
||||
|
||||
sscanf(buf, "%d", lock);
|
||||
return (RIG_OK);
|
||||
}
|
||||
|
@ -917,9 +917,12 @@ int elad_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t txvfo)
|
||||
|
||||
if (split == tsplit)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: No change detected...ignoring request\n", __func__);
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: No change detected...ignoring request\n",
|
||||
__func__);
|
||||
}
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: Change detected requested split %d!=%d\n", __func__, split, tsplit);
|
||||
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: Change detected requested split %d!=%d\n",
|
||||
__func__, split, tsplit);
|
||||
|
||||
if (split)
|
||||
{
|
||||
|
@ -590,20 +590,24 @@ int rig2icom_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width,
|
||||
|
||||
case RIG_MODE_PKTUSB:
|
||||
icmode = S_USB;
|
||||
|
||||
if (rig->caps->rig_model == RIG_MODEL_IC7800)
|
||||
{
|
||||
icmode = S_PSK;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case RIG_MODE_LSB: icmode = S_LSB; break;
|
||||
|
||||
case RIG_MODE_PKTLSB:
|
||||
icmode = S_LSB;
|
||||
|
||||
if (rig->caps->rig_model == RIG_MODEL_IC7800)
|
||||
{
|
||||
icmode = S_PSKR;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case RIG_MODE_RTTY: icmode = S_RTTY; break;
|
||||
@ -747,18 +751,22 @@ void icom2rig_mode(RIG *rig, unsigned char md, int pd, rmode_t *mode,
|
||||
|
||||
case S_PSK:
|
||||
*mode = RIG_MODE_PSK;
|
||||
|
||||
if (rig->caps->rig_model == RIG_MODEL_IC7800)
|
||||
{
|
||||
*mode = RIG_MODE_PKTUSB;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case S_PSKR:
|
||||
*mode = RIG_MODE_PSKR;
|
||||
|
||||
if (rig->caps->rig_model == RIG_MODEL_IC7800)
|
||||
{
|
||||
*mode = RIG_MODE_PKTLSB;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case S_DSTAR: *mode = RIG_MODE_DSTAR; break;
|
||||
|
@ -932,9 +932,11 @@ static void icom_satmode_fix(RIG *rig, int satmode)
|
||||
{
|
||||
if (rig->caps->rig_model == RIG_MODEL_IC9700)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: toggling IC9700 targetable for satmode=%d\n", __func__, satmode);
|
||||
if (satmode) rig->caps->targetable_vfo = 0;
|
||||
else rig->caps->targetable_vfo = RIG_TARGETABLE_FREQ | RIG_TARGETABLE_MODE;
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: toggling IC9700 targetable for satmode=%d\n",
|
||||
__func__, satmode);
|
||||
|
||||
if (satmode) { rig->caps->targetable_vfo = 0; }
|
||||
else { rig->caps->targetable_vfo = RIG_TARGETABLE_FREQ | RIG_TARGETABLE_MODE; }
|
||||
}
|
||||
}
|
||||
|
||||
@ -2675,7 +2677,7 @@ int icom_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
|
||||
}
|
||||
}
|
||||
|
||||
if (*mode == RIG_MODE_FM) *width = 12000;
|
||||
if (*mode == RIG_MODE_FM) { *width = 12000; }
|
||||
|
||||
RETURNFUNC2(RIG_OK);
|
||||
}
|
||||
@ -5620,7 +5622,8 @@ int icom_get_split_freq(RIG *rig, vfo_t vfo, freq_t *tx_freq)
|
||||
rs->rigport.retry = 0;
|
||||
cmd = C_SEND_SEL_FREQ;
|
||||
// when transmitting in split mode the split VFO is active
|
||||
subcmd = (rig->state.cache.split && rig->state.cache.ptt)? 0x00 : 0x01; // get the unselected vfo
|
||||
subcmd = (rig->state.cache.split
|
||||
&& rig->state.cache.ptt) ? 0x00 : 0x01; // get the unselected vfo
|
||||
retval = icom_transaction(rig, cmd, subcmd, NULL, 0, ackbuf,
|
||||
&ack_len);
|
||||
|
||||
|
@ -489,7 +489,8 @@ transaction_read:
|
||||
|
||||
if (retry_read++ < rs->rigport.retry)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: Retrying shortly %d of %d\n", __func__, retry_read, rs->rigport.retry);
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: Retrying shortly %d of %d\n", __func__,
|
||||
retry_read, rs->rigport.retry);
|
||||
hl_usleep(rig->caps->timeout * 1000);
|
||||
goto transaction_write;
|
||||
}
|
||||
@ -1101,7 +1102,9 @@ int kenwood_set_vfo(RIG *rig, vfo_t vfo)
|
||||
struct kenwood_priv_data *priv = rig->state.priv;
|
||||
|
||||
ENTERFUNC;
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called vfo=%s, is_emulation=%d, curr_mode=%s\n", __func__, rig_strvfo(vfo), priv->is_emulation, rig_strrmode(priv->curr_mode));
|
||||
rig_debug(RIG_DEBUG_VERBOSE,
|
||||
"%s called vfo=%s, is_emulation=%d, curr_mode=%s\n", __func__, rig_strvfo(vfo),
|
||||
priv->is_emulation, rig_strrmode(priv->curr_mode));
|
||||
|
||||
|
||||
/* Emulations do not need to set VFO since VFOB is a copy of VFOA
|
||||
@ -1116,12 +1119,14 @@ int kenwood_set_vfo(RIG *rig, vfo_t vfo)
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
||||
if (rig->state.current_vfo == vfo)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: vfo already is %s...skipping\n", __func__,
|
||||
rig_strvfo(vfo));
|
||||
RETURNFUNC2(RIG_OK);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
switch (vfo)
|
||||
@ -1631,12 +1636,14 @@ int kenwood_get_split_vfo_if(RIG *rig, vfo_t rxvfo, split_t *split,
|
||||
if (rig->state.rx_vfo == RIG_VFO_A)
|
||||
{
|
||||
HAMLIB_TRACE;
|
||||
*txvfo = rig->state.tx_vfo = priv->tx_vfo = (*split && !transmitting) ? RIG_VFO_B : RIG_VFO_A;
|
||||
*txvfo = rig->state.tx_vfo = priv->tx_vfo = (*split
|
||||
&& !transmitting) ? RIG_VFO_B : RIG_VFO_A;
|
||||
}
|
||||
else if (rig->state.rx_vfo == RIG_VFO_B)
|
||||
{
|
||||
HAMLIB_TRACE;
|
||||
*txvfo = rig->state.tx_vfo = priv->tx_vfo = (*split && !transmitting) ? RIG_VFO_B : RIG_VFO_A;
|
||||
*txvfo = rig->state.tx_vfo = priv->tx_vfo = (*split
|
||||
&& !transmitting) ? RIG_VFO_B : RIG_VFO_A;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1958,6 +1965,7 @@ int kenwood_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: unsupported VFO %s\n", __func__, rig_strvfo(vfo));
|
||||
RETURNFUNC(-RIG_EINVAL);
|
||||
}
|
||||
|
||||
if (rig->caps->rig_model == RIG_MODEL_MALACHITE && vfo == RIG_VFO_B)
|
||||
{
|
||||
// Malachite does not have VFOB so we'll just return VFOA
|
||||
@ -2875,14 +2883,16 @@ static int kenwood_get_power_minmax(RIG *rig, int *power_now, int *power_min,
|
||||
expected_length = 18;
|
||||
}
|
||||
|
||||
retval = read_string(&rs->rigport, (unsigned char *) levelbuf, expected_length + 1,
|
||||
retval = read_string(&rs->rigport, (unsigned char *) levelbuf,
|
||||
expected_length + 1,
|
||||
NULL, 0, 0, 1);
|
||||
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: retval=%d\n", __func__, retval);
|
||||
|
||||
if (retval != expected_length)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: expected %d, got %d in '%s'\n", __func__, expected_length,
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: expected %d, got %d in '%s'\n", __func__,
|
||||
expected_length,
|
||||
retval,
|
||||
levelbuf);
|
||||
RETURNFUNC(-RIG_EPROTO);
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -481,7 +481,8 @@ pcr_init(RIG *rig)
|
||||
return -RIG_EINVAL;
|
||||
}
|
||||
|
||||
rig->state.priv = (struct pcr_priv_data *) calloc(1,sizeof(struct pcr_priv_data));
|
||||
rig->state.priv = (struct pcr_priv_data *) calloc(1,
|
||||
sizeof(struct pcr_priv_data));
|
||||
|
||||
if (!rig->state.priv)
|
||||
{
|
||||
|
@ -295,7 +295,8 @@ static int tt588_transaction(RIG *rig, const char *cmd, int cmd_len, char *data,
|
||||
{
|
||||
return RIG_OK;
|
||||
}
|
||||
if (retval == -RIG_ETIMEOUT) return retval;
|
||||
|
||||
if (retval == -RIG_ETIMEOUT) { return retval; }
|
||||
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: read_string failed, try#%d\n", __func__, i + 1);
|
||||
}
|
||||
|
@ -1210,7 +1210,9 @@ int tt565_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
|
||||
if (rig->caps->rig_model == RIG_MODEL_TT599)
|
||||
{
|
||||
ii = (int)(val.f * 10);
|
||||
if (ii > 9) ii=9; // cannot set NR level 10 apparently
|
||||
|
||||
if (ii > 9) { ii = 9; } // cannot set NR level 10 apparently
|
||||
|
||||
SNPRINTF(cmdbuf, sizeof(cmdbuf), "*RMNN%c" EOM, ii);
|
||||
}
|
||||
else
|
||||
@ -1224,6 +1226,7 @@ int tt565_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
|
||||
which_receiver(rig, vfo),
|
||||
(int)(val.f * 9));
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case RIG_LEVEL_VOXDELAY:
|
||||
@ -1692,6 +1695,7 @@ int tt565_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
||||
break;
|
||||
|
||||
case RIG_LEVEL_NR:
|
||||
|
||||
/* RIG_LEVEL_NR controls Orion NB setting - TEMP */
|
||||
if (rig->caps->rig_model == RIG_MODEL_TT599)
|
||||
{
|
||||
@ -1717,6 +1721,7 @@ int tt565_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
||||
__func__, lvlbuf);
|
||||
return -RIG_EPROTO;
|
||||
}
|
||||
|
||||
sscanf(lvlbuf + 5, "%f", &val->f);
|
||||
val->f /= 10.0;
|
||||
break;
|
||||
|
@ -730,7 +730,9 @@ int ft897_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
||||
}
|
||||
|
||||
int factor = 10;
|
||||
if (p->fm_status[3]==1) factor = 100;
|
||||
|
||||
if (p->fm_status[3] == 1) { factor = 100; }
|
||||
|
||||
*freq = from_bcd_be(p->fm_status, 8) * factor;
|
||||
|
||||
return RIG_OK;
|
||||
|
73
rigs/yaesu/ft990v12.c
Executable file → Normal file
73
rigs/yaesu/ft990v12.c
Executable file → Normal file
@ -117,14 +117,18 @@ static int ft990v12_open(RIG *rig);
|
||||
static int ft990v12_close(RIG *rig);
|
||||
static int ft990v12_set_freq(RIG *rig, vfo_t vfo, freq_t freq);
|
||||
static int ft990v12_get_freq(RIG *rig, vfo_t vfo, freq_t *freq);
|
||||
static int ft990v12_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width);
|
||||
static int ft990v12_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width);
|
||||
static int ft990v12_set_mode(RIG *rig, vfo_t vfo, rmode_t mode,
|
||||
pbwidth_t width);
|
||||
static int ft990v12_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode,
|
||||
pbwidth_t *width);
|
||||
static int ft990v12_set_vfo(RIG *rig, vfo_t vfo);
|
||||
static int ft990v12_get_vfo(RIG *rig, vfo_t *vfo);
|
||||
static int ft990v12_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt);
|
||||
static int ft990v12_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt);
|
||||
static int ft990v12_set_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t rptr_shift);
|
||||
static int ft990v12_get_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t *rptr_shift);
|
||||
static int ft990v12_set_rptr_shift(RIG *rig, vfo_t vfo,
|
||||
rptr_shift_t rptr_shift);
|
||||
static int ft990v12_get_rptr_shift(RIG *rig, vfo_t vfo,
|
||||
rptr_shift_t *rptr_shift);
|
||||
static int ft990v12_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t offs);
|
||||
static int ft990v12_set_split_vfo(RIG *rig, vfo_t vfo, split_t split,
|
||||
vfo_t tx_vfo);
|
||||
@ -137,7 +141,8 @@ static int ft990v12_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status);
|
||||
static int ft990v12_set_parm(RIG *rig, setting_t parm, value_t val);
|
||||
static int ft990v12_set_xit(RIG *rig, vfo_t vfo, shortfreq_t xit);
|
||||
static int ft990v12_get_xit(RIG *rig, vfo_t vfo, shortfreq_t *xit);
|
||||
static int ft990v12_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val);
|
||||
static int ft990v12_get_level(RIG *rig, vfo_t vfo, setting_t level,
|
||||
value_t *val);
|
||||
static int ft990v12_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op);
|
||||
static int ft990v12_set_mem(RIG *rig, vfo_t vfo, int ch);
|
||||
static int ft990v12_get_mem(RIG *rig, vfo_t vfo, int *ch);
|
||||
@ -150,7 +155,8 @@ static int ft990v12_get_channel(RIG *rig, vfo_t vfo, channel_t *chan,
|
||||
|
||||
|
||||
/* Private helper function prototypes */
|
||||
static int ft990v12_get_update_data(RIG *rig, unsigned char ci, unsigned short ch);
|
||||
static int ft990v12_get_update_data(RIG *rig, unsigned char ci,
|
||||
unsigned short ch);
|
||||
static int ft990v12_send_static_cmd(RIG *rig, unsigned char ci);
|
||||
static int ft990v12_send_dynamic_cmd(RIG *rig, unsigned char ci,
|
||||
unsigned char p1, unsigned char p2,
|
||||
@ -159,7 +165,8 @@ static int ft990v12_send_dial_freq(RIG *rig, unsigned char ci, freq_t freq);
|
||||
static int ft990v12_send_rit_freq(RIG *rig, unsigned char ci, shortfreq_t rit);
|
||||
|
||||
static const yaesu_cmd_set_t ncmd[] =
|
||||
{ /* ci */
|
||||
{
|
||||
/* ci */
|
||||
{ 1, { 0x00, 0x00, 0x00, 0x00, 0x01 } }, /* 00 00 Split (OFF) */
|
||||
{ 1, { 0x00, 0x00, 0x00, 0x01, 0x01 } }, /* 01 01 Split (On) */
|
||||
{ 0, { 0x00, 0x00, 0x00, 0x00, 0x02 } }, /* 02 02 Recall Memory */
|
||||
@ -473,7 +480,8 @@ int ft990v12_open(RIG *rig)
|
||||
rig_debug(RIG_DEBUG_TRACE,
|
||||
"%s: read pacing = %i\n", __func__, priv->pacing);
|
||||
|
||||
err = ft990v12_send_dynamic_cmd(rig, FT990_NATIVE_PACING, priv->pacing, 0, 0, 0);
|
||||
err = ft990v12_send_dynamic_cmd(rig, FT990_NATIVE_PACING, priv->pacing, 0, 0,
|
||||
0);
|
||||
|
||||
if (err != RIG_OK)
|
||||
{
|
||||
@ -619,9 +627,11 @@ int ft990v12_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
||||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: passed vfo = 0x%02x\n", __func__, vfo);
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: ft990uni_get_freq_state = 0x%02x\n", __func__, ft990uni_get_freq_state);
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: ft990uni_get_freq_state = 0x%02x\n", __func__,
|
||||
ft990uni_get_freq_state);
|
||||
|
||||
if (ft990uni_get_freq_state < 2) {
|
||||
if (ft990uni_get_freq_state < 2)
|
||||
{
|
||||
// M0EZP: UNI first call needs UPDATE_ALL
|
||||
ft990uni_get_freq_state = ft990uni_get_freq_state + 1;
|
||||
|
||||
@ -631,6 +641,7 @@ int ft990v12_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
||||
}
|
||||
|
||||
priv = (struct ft990v12_priv_data *)rig->state.priv;
|
||||
|
||||
if (vfo == RIG_VFO_CURR)
|
||||
{
|
||||
vfo = priv->current_vfo;
|
||||
@ -686,7 +697,9 @@ int ft990v12_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
||||
*freq = f;
|
||||
|
||||
return RIG_OK;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
// M0EZP: Uni use cache
|
||||
// *freq = vfo == RIG_VFO_A ? rig->state.cache.freqMainA : rig->state.cache.freqMainB;
|
||||
return (RIG_OK);
|
||||
@ -3031,7 +3044,8 @@ int ft990v12_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only)
|
||||
if (chan->split & RIG_SPLIT_ON)
|
||||
{
|
||||
// Get data for the transmit VFO
|
||||
p = (ft990v12_op_data_t *) &priv->update_data.current_front; /* M0EZP: was current_rear */
|
||||
p = (ft990v12_op_data_t *)
|
||||
&priv->update_data.current_front; /* M0EZP: was current_rear */
|
||||
|
||||
|
||||
/* FT1000D
|
||||
@ -3273,16 +3287,20 @@ int ft990v12_get_update_data(RIG *rig, unsigned char ci, unsigned short ch)
|
||||
case FT990_NATIVE_UPDATE_OP_DATA:
|
||||
case FT990_NATIVE_UPDATE_VFO_DATA:
|
||||
case FT990_NATIVE_UPDATE_MEM_CHNL_DATA:
|
||||
if (ft990uni_get_freq_state < 2) {
|
||||
if (ft990uni_get_freq_state < 2)
|
||||
{
|
||||
//
|
||||
if (ci == FT990_NATIVE_UPDATE_MEM_CHNL_DATA)
|
||||
// P4 = 0x01 to 0x5a for channel 1 - 90
|
||||
{
|
||||
/* err = ft990v12_send_dynamic_cmd(rig, ci, 4, 0, 0, ch);
|
||||
M0EZP: dont send command, rely on the assignment from memory below*/
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
// err = RIG_OK; K1MMI
|
||||
err = ft990v12_send_static_cmd(rig, ci); // K1MMI: only send for ALL DATA 1492 bytes or READ FLAGS 5 bytes
|
||||
err = ft990v12_send_static_cmd(rig,
|
||||
ci); // K1MMI: only send for ALL DATA 1492 bytes or READ FLAGS 5 bytes
|
||||
}
|
||||
|
||||
|
||||
@ -3295,7 +3313,8 @@ int ft990v12_get_update_data(RIG *rig, unsigned char ci, unsigned short ch)
|
||||
{
|
||||
case FT990_NATIVE_UPDATE_ALL_DATA:
|
||||
rl = FT990_ALL_DATA_LENGTH; // K1MMI: prepare to receive 1492 bytes back
|
||||
p = (unsigned char *)&priv->update_data; // K1MMI: This seems like 1492 will be saved here
|
||||
p = (unsigned char *)
|
||||
&priv->update_data; // K1MMI: This seems like 1492 will be saved here
|
||||
|
||||
n = read_block(&rig->state.rigport, p, rl); /* M0EZP: copied here from below */
|
||||
return RIG_OK;
|
||||
@ -3324,9 +3343,11 @@ int ft990v12_get_update_data(RIG *rig, unsigned char ci, unsigned short ch)
|
||||
p = (unsigned char *) &priv->update_data.channel[ch];
|
||||
rl = FT990_MEM_CHNL_DATA_LENGTH; // 16
|
||||
break;
|
||||
|
||||
default:
|
||||
// M0EZP: shouldn't be here!
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: Default clause ci 0x%02x\n", __func__, ci); // M0EZP
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: Default clause ci 0x%02x\n", __func__,
|
||||
ci); // M0EZP
|
||||
return -RIG_EINVAL;
|
||||
}
|
||||
|
||||
@ -3341,13 +3362,17 @@ int ft990v12_get_update_data(RIG *rig, unsigned char ci, unsigned short ch)
|
||||
|
||||
memcpy(&priv->update_data, p, FT990_ALL_DATA_LENGTH);
|
||||
return RIG_OK;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
return RIG_OK;
|
||||
}
|
||||
|
||||
case FT990_NATIVE_READ_FLAGS:
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: passed ci 0x%02x\n", __func__, ci);
|
||||
err = ft990v12_send_static_cmd(rig, ci); // K1MMI: only send for ALL DATA 1492 bytes
|
||||
err = ft990v12_send_static_cmd(rig,
|
||||
ci); // K1MMI: only send for ALL DATA 1492 bytes
|
||||
|
||||
if (err != RIG_OK)
|
||||
{
|
||||
return err;
|
||||
@ -3355,7 +3380,8 @@ int ft990v12_get_update_data(RIG *rig, unsigned char ci, unsigned short ch)
|
||||
|
||||
p = (unsigned char *)&priv->update_data;
|
||||
rl = FT990_STATUS_FLAGS_LENGTH; // 5
|
||||
n = read_block(&rig->state.rigport, (unsigned char*)&temp, rl); /* M0EZP: copied here from below */
|
||||
n = read_block(&rig->state.rigport, (unsigned char *)&temp,
|
||||
rl); /* M0EZP: copied here from below */
|
||||
|
||||
if (n < 0)
|
||||
{
|
||||
@ -3364,16 +3390,19 @@ int ft990v12_get_update_data(RIG *rig, unsigned char ci, unsigned short ch)
|
||||
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: read %i bytes\n", __func__, n);
|
||||
|
||||
memcpy(&priv->update_data, p, FT990_STATUS_FLAGS_LENGTH - 2); /* just overwrite first 3 bytes */
|
||||
memcpy(&priv->update_data, p,
|
||||
FT990_STATUS_FLAGS_LENGTH - 2); /* just overwrite first 3 bytes */
|
||||
|
||||
return RIG_OK;
|
||||
break;
|
||||
|
||||
default:
|
||||
// M0EZP: shouldn't be here!
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: Default clause ci 0x%02x\n", __func__, ci); // M0EZP
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: Default clause ci 0x%02x\n", __func__,
|
||||
ci); // M0EZP
|
||||
return -RIG_EINVAL;
|
||||
}
|
||||
|
||||
return RIG_OK;
|
||||
}
|
||||
|
||||
|
@ -414,7 +414,8 @@ ft991_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq)
|
||||
|
||||
if (rig->state.cache.freqMainB == tx_freq)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: freq %.0f already set on VFOB\n", __func__, tx_freq);
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: freq %.0f already set on VFOB\n", __func__,
|
||||
tx_freq);
|
||||
return RIG_OK;
|
||||
}
|
||||
|
||||
@ -590,7 +591,8 @@ static int ft991_set_split_mode(RIG *rig, vfo_t vfo, rmode_t tx_mode,
|
||||
|
||||
if (rig->state.cache.modeMainB == tx_mode)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: mode %s already set on VFOB\n", __func__, rig_strrmode(tx_mode));
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: mode %s already set on VFOB\n", __func__,
|
||||
rig_strrmode(tx_mode));
|
||||
return RIG_OK;
|
||||
}
|
||||
|
||||
|
@ -601,9 +601,11 @@ int newcat_open(RIG *rig)
|
||||
int err;
|
||||
// set the CAT TIME OUT TIMER to 100ms
|
||||
SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "EX0331");
|
||||
|
||||
if (RIG_OK != (err = newcat_set_cmd(rig)))
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: FTDX5000 CAT RATE error: %s\n", __func__, rigerror(err));
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: FTDX5000 CAT RATE error: %s\n", __func__,
|
||||
rigerror(err));
|
||||
}
|
||||
}
|
||||
|
||||
@ -750,9 +752,11 @@ int newcat_60m_exception(RIG *rig, freq_t freq)
|
||||
// can we improve this to set memory mode and pick the memory slot?
|
||||
if (is_ftdx10 && freq > 5.2 && freq < 5.5)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: 60M exception ignoring freq/mode commands\n", __func__);
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: 60M exception ignoring freq/mode commands\n",
|
||||
__func__);
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -767,7 +771,7 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
||||
|
||||
ENTERFUNC;
|
||||
|
||||
if (newcat_60m_exception(rig,freq)) RETURNFUNC(RIG_OK); // we don't set freq in this case
|
||||
if (newcat_60m_exception(rig, freq)) { RETURNFUNC(RIG_OK); } // we don't set freq in this case
|
||||
|
||||
if (!newcat_valid_command(rig, "FA"))
|
||||
{
|
||||
@ -1286,7 +1290,7 @@ int newcat_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
||||
|
||||
ENTERFUNC;
|
||||
|
||||
if (newcat_60m_exception(rig,rig->state.cache.freqMainA)) RETURNFUNC(RIG_OK); // we don't set mode in this case
|
||||
if (newcat_60m_exception(rig, rig->state.cache.freqMainA)) { RETURNFUNC(RIG_OK); } // we don't set mode in this case
|
||||
|
||||
if (!newcat_valid_command(rig, "MD"))
|
||||
{
|
||||
@ -1340,10 +1344,15 @@ int newcat_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
||||
{
|
||||
RETURNFUNC(err);
|
||||
}
|
||||
|
||||
if (vfo == RIG_VFO_A || vfo == RIG_VFO_MAIN)
|
||||
{
|
||||
rig->state.cache.modeMainA = mode;
|
||||
}
|
||||
else
|
||||
{
|
||||
rig->state.cache.modeMainB = mode;
|
||||
}
|
||||
|
||||
if (RIG_PASSBAND_NOCHANGE == width) { RETURNFUNC(err); }
|
||||
|
||||
@ -1701,11 +1710,13 @@ int newcat_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt)
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: cmd_str = %s\n", __func__, priv->cmd_str);
|
||||
err = newcat_set_cmd(rig);
|
||||
break;
|
||||
|
||||
case RIG_PTT_ON_DATA:
|
||||
SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "EX1031;");
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: cmd_str = %s\n", __func__, priv->cmd_str);
|
||||
err = newcat_set_cmd(rig);
|
||||
break;
|
||||
|
||||
case RIG_PTT_ON:
|
||||
/* Build the command string */
|
||||
SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "%s", txon);
|
||||
@ -2378,7 +2389,8 @@ int newcat_set_split_mode(RIG *rig, vfo_t vfo, rmode_t tx_mode,
|
||||
pbwidth_t tmp_width;
|
||||
int err;
|
||||
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: vfo=%s, tx_mode=%s, tx_width=%d\n", __func__, rig_strvfo(vfo), rig_strrmode(tx_mode), (int)tx_width);
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: vfo=%s, tx_mode=%s, tx_width=%d\n", __func__,
|
||||
rig_strvfo(vfo), rig_strrmode(tx_mode), (int)tx_width);
|
||||
err = newcat_get_mode(rig, RIG_VFO_B, &tmp_mode, &tmp_width);
|
||||
|
||||
if (err < 0)
|
||||
@ -2398,10 +2410,15 @@ int newcat_set_split_mode(RIG *rig, vfo_t vfo, rmode_t tx_mode,
|
||||
{
|
||||
RETURNFUNC(err);
|
||||
}
|
||||
|
||||
if (vfo == RIG_VFO_A || vfo == RIG_VFO_MAIN)
|
||||
{
|
||||
rig->state.cache.modeMainA = tx_mode;
|
||||
}
|
||||
else
|
||||
{
|
||||
rig->state.cache.modeMainB = tx_mode;
|
||||
}
|
||||
|
||||
|
||||
RETURNFUNC(-RIG_ENAVAIL);
|
||||
|
@ -147,7 +147,8 @@ ars_init(ROT *rot)
|
||||
return -RIG_EINVAL;
|
||||
}
|
||||
|
||||
rot->state.priv = (struct ars_priv_data *)calloc(1,sizeof(struct ars_priv_data));
|
||||
rot->state.priv = (struct ars_priv_data *)calloc(1,
|
||||
sizeof(struct ars_priv_data));
|
||||
|
||||
if (!rot->state.priv)
|
||||
{
|
||||
|
@ -108,6 +108,7 @@ int main(int argc, char *argv[])
|
||||
buf[0] = 0;
|
||||
|
||||
if (getmyline(fd, buf) > 0) { printf("Cmd:%s\n", buf); }
|
||||
|
||||
// else { return 0; }
|
||||
|
||||
if (strcmp(buf, "RM5;") == 0)
|
||||
|
@ -46,7 +46,8 @@ int rig_set_cache_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
||||
if (vfo == RIG_VFO_NONE || vfo == RIG_VFO_CURR) { vfo = RIG_VFO_A; }
|
||||
|
||||
if (vfo == RIG_VFO_SUB && rig->state.cache.satmode) { vfo = RIG_VFO_SUB_A; };
|
||||
if (vfo == RIG_VFO_OTHER) vfo = vfo_fixup(rig, vfo, rig->state.cache.split);
|
||||
|
||||
if (vfo == RIG_VFO_OTHER) { vfo = vfo_fixup(rig, vfo, rig->state.cache.split); }
|
||||
|
||||
switch (vfo)
|
||||
{
|
||||
|
@ -2094,6 +2094,7 @@ int HAMLIB_API rig_flush(hamlib_port_t *port)
|
||||
{
|
||||
return RIG_OK;
|
||||
}
|
||||
|
||||
if (port->type.rig == RIG_PORT_NETWORK
|
||||
|| port->type.rig == RIG_PORT_UDP_NETWORK)
|
||||
{
|
||||
|
@ -976,7 +976,8 @@ int network_multicast_publisher_start(RIG *rig, const char *multicast_addr,
|
||||
|
||||
ENTERFUNC;
|
||||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s(%d):multicast address=%s, port=%d\n", __FILE__, __LINE__,
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s(%d):multicast address=%s, port=%d\n", __FILE__,
|
||||
__LINE__,
|
||||
multicast_addr, multicast_port);
|
||||
|
||||
if (strcmp(multicast_addr, "0.0.0.0") == 0)
|
||||
|
@ -305,12 +305,14 @@ int HAMLIB_API rig_check_backend(rig_model_t rig_model)
|
||||
}
|
||||
|
||||
#if 0 // this stopped a 2nd rig_init call with a valid model to fail -- reversing
|
||||
|
||||
if (n > 1)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: rig model %u not found and rig count=%d\n",
|
||||
__func__, rig_model, n);
|
||||
return -RIG_ENAVAIL;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
be_idx = rig_lookup_backend(rig_model);
|
||||
|
26
src/rig.c
26
src/rig.c
@ -864,6 +864,7 @@ int HAMLIB_API rig_open(RIG *rig)
|
||||
char *xdgpath = getenv("XDG_CONFIG_HOME");
|
||||
|
||||
settings_file = "hamlib_settings";
|
||||
|
||||
if (xdgpath)
|
||||
{
|
||||
sprintf(path, "%s/%s/%s", xdgpath, cwd, settings_file);
|
||||
@ -1243,6 +1244,7 @@ int HAMLIB_API rig_open(RIG *rig)
|
||||
*/
|
||||
int retry_save = rs->rigport.retry;
|
||||
rs->rigport.retry = 1;
|
||||
|
||||
if (caps->rig_open != NULL)
|
||||
{
|
||||
status = caps->rig_open(rig);
|
||||
@ -1321,22 +1323,26 @@ int HAMLIB_API rig_open(RIG *rig)
|
||||
// prime the freq and mode settings
|
||||
// don't care about the return here -- if it doesn't work so be it
|
||||
freq_t freq;
|
||||
|
||||
if (rig->caps->get_freq)
|
||||
{
|
||||
int retval = rig_get_freq(rig, RIG_VFO_A, &freq);
|
||||
|
||||
if (retval == RIG_OK && rig->caps->rig_model != RIG_MODEL_F6K)
|
||||
{
|
||||
vfo_t tx_vfo;
|
||||
split_t split;
|
||||
rig_get_freq(rig, RIG_VFO_B, &freq);
|
||||
rig_get_split_vfo(rig, RIG_VFO_RX, &tx_vfo, &split);
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s(%d): Current split=%d, tx_vfo=%s\n", __func__, __LINE__, split, rig_strvfo(tx_vfo));
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s(%d): Current split=%d, tx_vfo=%s\n", __func__,
|
||||
__LINE__, split, rig_strvfo(tx_vfo));
|
||||
rmode_t mode;
|
||||
pbwidth_t width;
|
||||
rig_get_mode(rig, RIG_VFO_A, &mode, &width);
|
||||
rig_get_mode(rig, RIG_VFO_B, &mode, &width);
|
||||
}
|
||||
}
|
||||
|
||||
rs->rigport.retry = retry_save;
|
||||
|
||||
memcpy(&rs->rigport_deprecated, &rs->rigport, sizeof(hamlib_port_t_deprecated));
|
||||
@ -2198,6 +2204,7 @@ int HAMLIB_API rig_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
||||
}
|
||||
|
||||
rig_get_lock_mode(rig, &locked_mode);
|
||||
|
||||
if (locked_mode) { return (RIG_OK); }
|
||||
|
||||
// do not mess with mode while PTT is on
|
||||
@ -2256,7 +2263,8 @@ int HAMLIB_API rig_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
||||
}
|
||||
|
||||
curr_vfo = rig->state.current_vfo;
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s(%d): curr_vfo=%s, vfo=%s\n", __func__, __LINE__, rig_strvfo(curr_vfo), rig_strvfo(vfo));
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s(%d): curr_vfo=%s, vfo=%s\n", __func__,
|
||||
__LINE__, rig_strvfo(curr_vfo), rig_strvfo(vfo));
|
||||
HAMLIB_TRACE;
|
||||
retcode = caps->set_vfo(rig, vfo);
|
||||
|
||||
@ -4184,14 +4192,18 @@ int HAMLIB_API rig_set_split_mode(RIG *rig,
|
||||
|
||||
// we check both VFOs are in the same tx mode -- then we can ignore
|
||||
// this could be make more intelligent but this should cover all cases where we can skip this
|
||||
if (tx_mode == rig->state.cache.modeMainA && tx_mode == rig->state.cache.modeMainB)
|
||||
if (tx_mode == rig->state.cache.modeMainA
|
||||
&& tx_mode == rig->state.cache.modeMainB)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: mode already %s so no change required\n", __func__, rig_strrmode(tx_mode));
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: mode already %s so no change required\n",
|
||||
__func__, rig_strrmode(tx_mode));
|
||||
RETURNFUNC(RIG_OK);
|
||||
}
|
||||
else
|
||||
{
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: mode %s is different from A=%s and B=%s\n", __func__, rig_strrmode(tx_mode), rig_strrmode(rig->state.cache.modeMainA), rig_strrmode(rig->state.cache.modeMainB));
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: mode %s is different from A=%s and B=%s\n",
|
||||
__func__, rig_strrmode(tx_mode), rig_strrmode(rig->state.cache.modeMainA),
|
||||
rig_strrmode(rig->state.cache.modeMainB));
|
||||
}
|
||||
|
||||
// do not mess with mode while PTT is on
|
||||
@ -4347,9 +4359,13 @@ int HAMLIB_API rig_set_split_mode(RIG *rig,
|
||||
rig_set_split_vfo(rig, rx_vfo, RIG_SPLIT_ON, tx_vfo);
|
||||
|
||||
if (vfo == RIG_VFO_A || vfo == RIG_VFO_MAIN)
|
||||
{
|
||||
rig->state.cache.modeMainA = tx_mode;
|
||||
}
|
||||
else
|
||||
{
|
||||
rig->state.cache.modeMainB = tx_mode;
|
||||
}
|
||||
|
||||
|
||||
ELAPSED2;
|
||||
|
@ -1002,6 +1002,7 @@ HAMLIB_EXPORT(int) rig_settings_get_path(char *path, int pathlen)
|
||||
char *xdgpath = getenv("XDG_CONFIG_HOME");
|
||||
char *home = getenv("HOME");
|
||||
snprintf(path, pathlen, "%s/.config", home);
|
||||
|
||||
if (xdgpath)
|
||||
{
|
||||
snprintf(path, pathlen - 1, "%s/%s/%s", xdgpath, cwd, HAMLIB_SETTINGS_FILE);
|
||||
@ -1019,6 +1020,7 @@ HAMLIB_EXPORT(int) rig_settings_get_path(char *path, int pathlen)
|
||||
{
|
||||
snprintf(path, pathlen - 1, ".%s", HAMLIB_SETTINGS_FILE);
|
||||
}
|
||||
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: path=%s\n", __func__, path);
|
||||
return RIG_OK;
|
||||
}
|
||||
@ -1049,10 +1051,13 @@ HAMLIB_EXPORT(int) rig_settings_save(char *setting, void *value,
|
||||
|
||||
rig_settings_get_path(path, sizeof(path));
|
||||
fp = fopen(path, "r");
|
||||
if (fp == NULL) {
|
||||
|
||||
if (fp == NULL)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_WARN, "%s: %s not found\n", __func__, path);
|
||||
return -RIG_EIO;
|
||||
}
|
||||
|
||||
strcpy(template, "hamlib_settings_XXXXXX");
|
||||
|
||||
switch (valuetype)
|
||||
@ -1112,7 +1117,9 @@ HAMLIB_EXPORT(int) rig_settings_save(char *setting, void *value,
|
||||
{
|
||||
char *tmp = strdup(buf);
|
||||
char *s = strtok(tmp, "=");
|
||||
if (buf[0] == '#') {
|
||||
|
||||
if (buf[0] == '#')
|
||||
{
|
||||
fprintf(fptmp, "%s\n", buf);
|
||||
continue;
|
||||
}
|
||||
@ -1125,6 +1132,7 @@ HAMLIB_EXPORT(int) rig_settings_save(char *setting, void *value,
|
||||
fclose(fptmp);
|
||||
return -RIG_EINTERNAL;
|
||||
}
|
||||
|
||||
++n;
|
||||
|
||||
char *v = strtok(NULL, "\r\n");
|
||||
@ -1137,6 +1145,7 @@ HAMLIB_EXPORT(int) rig_settings_save(char *setting, void *value,
|
||||
fclose(fptmp);
|
||||
return -RIG_EINTERNAL;
|
||||
}
|
||||
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: parsing setting %s=%s\n", __func__, s, v);
|
||||
fprintf(fptmp, vformat, s, value);
|
||||
}
|
||||
@ -1161,18 +1170,21 @@ HAMLIB_EXPORT(int) rig_settings_load_all(char *settings_file)
|
||||
char buf[4096];
|
||||
char settingstmp[4096];
|
||||
|
||||
if (settings_file == NULL) {
|
||||
if (settings_file == NULL)
|
||||
{
|
||||
rig_settings_get_path(settingstmp, sizeof(settingstmp));
|
||||
settings_file = settingstmp;
|
||||
}
|
||||
|
||||
fp = fopen(settings_file, "r");
|
||||
|
||||
if (fp == NULL)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: settings_file (%s): %s\n", __func__,
|
||||
settings_file, strerror(errno));
|
||||
return -RIG_EINVAL;
|
||||
}
|
||||
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: opened %s\n", __func__, settings_file);
|
||||
|
||||
while (fgets(buf, sizeof(buf), fp))
|
||||
|
@ -1728,23 +1728,29 @@ readline_repeat:
|
||||
{
|
||||
if ((rig_powerstat == RIG_POWER_OFF || rig_powerstat == RIG_POWER_STANDBY))
|
||||
{
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: rig_powerstat is not on = %d\n", __func__, rig_powerstat);
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: rig_powerstat is not on = %d\n", __func__,
|
||||
rig_powerstat);
|
||||
// Update power status
|
||||
powerstat_t stat = RIG_POWER_ON;
|
||||
retcode = rig_get_powerstat(my_rig, &stat);
|
||||
if (retcode == RIG_OK) rig_powerstat = stat;
|
||||
|
||||
if (retcode == RIG_OK) { rig_powerstat = stat; }
|
||||
}
|
||||
|
||||
// only command allows when powered off is 0x87=set_powerstat
|
||||
if (retcode == RIG_OK && (rig_powerstat == RIG_POWER_OFF || rig_powerstat == RIG_POWER_STANDBY)
|
||||
if (retcode == RIG_OK && (rig_powerstat == RIG_POWER_OFF
|
||||
|| rig_powerstat == RIG_POWER_STANDBY)
|
||||
&& cmd_entry->cmd != 0x01 // dump_caps
|
||||
&& cmd_entry->cmd != 0xf0 // chk_vfo
|
||||
&& cmd_entry->cmd != 0x87) // set_powerstat
|
||||
{
|
||||
//rig_debug(RIG_DEBUG_WARN, "%s: %s - only \\set_powerstat can be run \n", __func__, rigerror(-RIG_EPOWER));
|
||||
rig_debug(RIG_DEBUG_WARN, "%s: only \\set_powerstat can be run when rig powered off\n", __func__);
|
||||
rig_debug(RIG_DEBUG_WARN,
|
||||
"%s: only \\set_powerstat can be run when rig powered off\n", __func__);
|
||||
retcode = -RIG_EPOWER;
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
retcode = (*cmd_entry->rig_routine)(my_rig,
|
||||
fout,
|
||||
fin,
|
||||
@ -2259,12 +2265,16 @@ declare_proto_rig(set_vfo)
|
||||
}
|
||||
|
||||
vfo = rig_parse_vfo(arg1);
|
||||
|
||||
if (vfo == RIG_VFO_NONE)
|
||||
{
|
||||
int c;
|
||||
|
||||
while ((c = fgetc(fin)) != '\n' && c != '\r' && c > 0);
|
||||
|
||||
return -RIG_EINVAL;
|
||||
}
|
||||
|
||||
retval = rig_set_vfo(rig, vfo);
|
||||
|
||||
#if 0 // see if we can make this dynamic
|
||||
|
@ -974,7 +974,9 @@ int main(int argc, char *argv[])
|
||||
/*
|
||||
* main loop accepting connections
|
||||
*/
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: rigctld listening on port %s\n", __func__, portno);
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: rigctld listening on port %s\n", __func__,
|
||||
portno);
|
||||
|
||||
do
|
||||
{
|
||||
fd_set set;
|
||||
@ -1239,12 +1241,15 @@ void *handle_socket(void *arg)
|
||||
handle_data_arg->use_password);
|
||||
|
||||
if (retcode != 0) { rig_debug(RIG_DEBUG_VERBOSE, "%s: rigctl_parse retcode=%d\n", __func__, retcode); }
|
||||
|
||||
// update our power stat in case power gets turned off
|
||||
if (retcode == -RIG_ETIMEOUT && my_rig->caps->get_powerstat) // if we get a timeout we might be powered off
|
||||
if (retcode == -RIG_ETIMEOUT
|
||||
&& my_rig->caps->get_powerstat) // if we get a timeout we might be powered off
|
||||
{
|
||||
rig_get_powerstat(my_rig, &powerstat);
|
||||
rig_powerstat = powerstat;
|
||||
if (powerstat == RIG_POWER_OFF) retcode = -RIG_EPOWER;
|
||||
|
||||
if (powerstat == RIG_POWER_OFF) { retcode = -RIG_EPOWER; }
|
||||
}
|
||||
}
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user