Change get_vfo_info to also return split

Since this is still a new call in 4.2 not considering this an API breakage
since it shouldn't be in common use yet
pull/574/head
Michael Black W9MDB 2021-03-01 14:56:21 -06:00
rodzic a5b12a1222
commit 10fbe9bd4a
3 zmienionych plików z 9 dodań i 5 usunięć

Wyświetl plik

@ -2322,7 +2322,7 @@ rig_get_vfo HAMLIB_PARAMS((RIG *rig,
extern HAMLIB_EXPORT(int)
rig_get_vfo_info HAMLIB_PARAMS((RIG *rig,
vfo_t vfo, freq_t *freq, rmode_t *mode, pbwidth_t *width));
vfo_t vfo, freq_t *freq, rmode_t *mode, pbwidth_t *width, split_t *split));
extern HAMLIB_EXPORT(const char *)
rig_get_vfo_list HAMLIB_PARAMS((RIG *rig));
@ -2968,7 +2968,7 @@ extern HAMLIB_EXPORT(int) rig_get_cache_timeout_ms(RIG *rig, hamlib_cache_t sele
extern HAMLIB_EXPORT(int) rig_set_cache_timeout_ms(RIG *rig, hamlib_cache_t selection, int ms);
extern HAMLIB_EXPORT(int) rig_set_vfo_opt(RIG *rig, int status);
extern HAMLIB_EXPORT(int) rig_get_vfo_info(RIG *rig, vfo_t vfo, freq_t *freq, rmode_t *mode, pbwidth_t *width);
extern HAMLIB_EXPORT(int) rig_get_vfo_info(RIG *rig, vfo_t vfo, freq_t *freq, rmode_t *mode, pbwidth_t *width, split_t *split);
typedef unsigned long rig_useconds_t;

Wyświetl plik

@ -5739,7 +5739,7 @@ const char *HAMLIB_API rig_get_info(RIG *rig)
*
*/
int HAMLIB_API rig_get_vfo_info(RIG *rig, vfo_t vfo, freq_t *freq,
rmode_t *mode, pbwidth_t *width)
rmode_t *mode, pbwidth_t *width, split_t *split)
{
int retcode;
@ -5756,6 +5756,8 @@ int HAMLIB_API rig_get_vfo_info(RIG *rig, vfo_t vfo, freq_t *freq,
if (retcode != RIG_OK) { RETURNFUNC(retcode); }
retcode = rig_get_mode(rig, vfo, mode, width);
*split = rig->state.cache.split;
RETURNFUNC(retcode);
}

Wyświetl plik

@ -332,7 +332,7 @@ static struct test_table test_list[] =
{ 0x8f, "dump_state", ACTION(dump_state), ARG_OUT | ARG_NOVFO },
{ 0xf0, "chk_vfo", ACTION(chk_vfo), ARG_NOVFO, "ChkVFO" }, /* rigctld only--check for VFO mode */
{ 0xf2, "set_vfo_opt", ACTION(set_vfo_opt), ARG_NOVFO | ARG_IN, "Status" }, /* turn vfo option on/off */
{ 0xf3, "get_vfo_info", ACTION(get_vfo_info), ARG_NOVFO | ARG_IN1 | ARG_OUT3, "VFO", "Freq", "Mode", "Width" }, /* turn vfo option on/off */
{ 0xf3, "get_vfo_info", ACTION(get_vfo_info), ARG_NOVFO | ARG_IN1 | ARG_OUT3, "Freq", "Mode", "Width", "Split" }, /* get several vfo parameters at once */
{ 0xf4, "get_vfo_list", ACTION(get_vfo_list), ARG_OUT | ARG_NOVFO, "VFOs" },
{ 0xf1, "halt", ACTION(halt), ARG_NOVFO }, /* rigctld only--halt the daemon */
{ 0x8c, "pause", ACTION(pause), ARG_IN, "Seconds" },
@ -2205,7 +2205,8 @@ declare_proto_rig(get_vfo_info)
freq_t freq = 0;
rmode_t mode = RIG_MODE_NONE;
pbwidth_t width = 0;
retval = rig_get_vfo_info(rig, vfo, &freq, &mode, &width);
split_t split;
retval = rig_get_vfo_info(rig, vfo, &freq, &mode, &width, &split);
rig_debug(RIG_DEBUG_ERR, "%s: vfo=%s\n", __func__, rig_strvfo(vfo));
@ -2214,6 +2215,7 @@ declare_proto_rig(get_vfo_info)
fprintf(fout, "%s: %.0f\n", cmd->arg1, freq);
fprintf(fout, "%s: %s\n", cmd->arg2, rig_strrmode(mode));
fprintf(fout, "%s: %d\n", cmd->arg3, (int)width);
fprintf(fout, "%s: %d\n", cmd->arg4, (int)split);
}
else
{