kopia lustrzana https://github.com/Hamlib/Hamlib
Restore backwards compatibility of rigctld
Need to figure out how to make "F" command with VFO backwards compatible probably by dynamic detection of newer rigctld https://github.com/Hamlib/Hamlib/issues/246pull/252/head
rodzic
baf0ee7169
commit
ee5af14b13
|
@ -578,11 +578,15 @@ static int netrigctl_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
|||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
||||
|
||||
#if 0 // implement set_freq VFO later if it can be detected
|
||||
ret = netrigctl_vfostr(rig, vfostr, sizeof(vfostr), vfo);
|
||||
|
||||
if (ret != RIG_OK) { return ret; }
|
||||
|
||||
len = sprintf(cmd, "F%s %"FREQFMT"\n", vfostr, freq);
|
||||
#else
|
||||
len = sprintf(cmd, "F %"FREQFMT"\n", freq);
|
||||
#endif
|
||||
|
||||
ret = netrigctl_transaction(rig, cmd, len, buf);
|
||||
|
||||
|
@ -621,6 +625,7 @@ static int netrigctl_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
|||
|
||||
CHKSCN1ARG(num_sscanf(buf, "%"SCNfreq, freq));
|
||||
|
||||
#if 0 // implement set_freq VFO later if it can be detected
|
||||
ret = read_string(&rig->state.rigport, buf, BUF_MAX, "\n", 1);
|
||||
|
||||
if (ret <= 0)
|
||||
|
@ -629,6 +634,7 @@ static int netrigctl_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
|||
}
|
||||
|
||||
*vfotmp = rig_parse_vfo(buf);
|
||||
#endif
|
||||
|
||||
return RIG_OK;
|
||||
}
|
||||
|
|
|
@ -241,7 +241,11 @@ declare_proto_rig(pause);
|
|||
*/
|
||||
static struct test_table test_list[] =
|
||||
{
|
||||
{ 'F', "set_freq", ACTION(set_freq), ARG_IN1 | ARG_OUT1, "Frequency" },
|
||||
#if 0 // implement set_freq VFO later if it can be detected
|
||||
// { 'F', "set_freq", ACTION(set_freq), ARG_IN1 | ARG_OUT1, "Frequency" },
|
||||
#else
|
||||
{ 'F', "set_freq", ACTION(set_freq), ARG_IN1, "Frequency" },
|
||||
#endif
|
||||
{ 'f', "get_freq", ACTION(get_freq), ARG_OUT, "Frequency", "VFO" },
|
||||
{ 'M', "set_mode", ACTION(set_mode), ARG_IN, "Mode", "Passband" },
|
||||
{ 'm', "get_mode", ACTION(get_mode), ARG_OUT, "Mode", "Passband" },
|
||||
|
@ -1923,15 +1927,17 @@ declare_proto_rig(set_freq)
|
|||
{
|
||||
freq_t freq;
|
||||
int retval;
|
||||
#if 0 // implement set_freq VFO later if it can be detected
|
||||
char *fmt = "%"PRIll"%c";
|
||||
#endif
|
||||
|
||||
CHKSCN1ARG(sscanf(arg1, "%"SCNfreq, &freq));
|
||||
retval = rig_set_freq(rig, vfo, freq);
|
||||
|
||||
if (retval == RIG_OK)
|
||||
{
|
||||
fprintf(fout, "%s%c", rig_strvfo(vfo), resp_sep);
|
||||
fprintf(fout, fmt, (int64_t)freq, resp_sep);
|
||||
//fprintf(fout, "%s%c", rig_strvfo(vfo), resp_sep);
|
||||
//fprintf(fout, fmt, (int64_t)freq, resp_sep);
|
||||
|
||||
}
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue