More work on SATMODE for rigctlcom.c

https://github.com/Hamlib/Hamlib/issues/620
pull/649/head
Michael Black W9MDB 2021-03-20 11:21:11 -05:00
rodzic 80e199b302
commit bb43078b25
2 zmienionych plików z 26 dodań i 3 usunięć

Wyświetl plik

@ -2227,7 +2227,11 @@ declare_proto_rig(get_vfo_info)
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));
if (retval != RIG_OK)
{
rig_debug(RIG_DEBUG_ERR, "%s: vfo=%s\n", __func__, rig_strvfo(vfo));
}
rig_debug(RIG_DEBUG_ERR, "%s: vfo=%s, freq=%.0f, mode=%s, width=%d\n", __func__, rig_strvfo(vfo), freq, rig_strrmode(mode), (int)width);
if ((interactive && prompt) || (interactive && !prompt && ext_resp))
{

Wyświetl plik

@ -878,9 +878,28 @@ static int handle_ts2000(void *arg)
return write_block2((void *)__func__, &my_com, response, strlen(response));
}
// Now some commands to set things
else if (strncmp(arg,"SA",2) == 0)
else if (strncmp(arg, "SA", 2) == 0)
{
// todo -- make rigs changes based on TS-2000 bit flags
if (strcmp(arg, "SA;") == 0)
{
// should we silently fail with RIG_OK instead? TBD
RETURNFUNC(-RIG_ENIMPL);
}
if (strlen(arg) > 3 && ((char *)arg)[2] == '1')
{
if (my_rig->caps->has_set_func)
{
int retval = rig_set_func(my_rig, RIG_VFO_CURR, RIG_FUNC_SATMODE,
((char *)arg)[2] == '1' ? 1 : 0);
return retval;
}
else
{
RETURNFUNC(-RIG_ENAVAIL);
}
}
return RIG_OK;
}
else if (strcmp(arg, "TX;") == 0)