Deal with remote PTT type at the client end

Remote   PTT   must   always    be   either   RIG_PTT_RIG_MICDATA   or
RIG_PTT_NONE. Also take care not to  override any locally set PTT type
as it is feasible  to use a local hardware PTT at  the client end with
remote  CAT control.   Maybe an  odd arrangement  but Hamlib  does not
preclude it.  This is all  done while  preserving the accuracy  of the
ptt_type value in dump_state requests.
pull/281/head
Bill Somerville 2020-06-01 12:21:48 +01:00
rodzic 5802ccdefe
commit d9ab62445c
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: D864B06D1E81618F
2 zmienionych plików z 12 dodań i 5 usunięć

Wyświetl plik

@ -539,9 +539,17 @@ static int netrigctl_open(RIG *rig)
}
else if (strcmp(setting, "ptt_type") == 0)
{
rig->caps->ptt_type = strtol(value, NULL, 0);
rig->state.pttport.type.ptt = rig->caps->ptt_type;
rig_debug(RIG_DEBUG_TRACE, "%s: %s set to %d\n", __func__, setting, rig->caps->ptt_type);
ptt_type_t temp = (ptt_type_t)strtol(value, NULL, 0);
if (RIG_PTT_RIG_MICDATA == rig->state.pttport.type.ptt && RIG_PTT_NONE == temp)
{
/*
* remote PTT must always be RIG_PTT_RIG_MICDATA
* if there is any PTT capability and we have not
* locally overridden it
*/
rig->state.pttport.type.ptt = temp;
rig_debug(RIG_DEBUG_TRACE, "%s: %s set to %d\n", __func__, setting, rig->state.pttport.type.ptt);
}
}
else
{

Wyświetl plik

@ -4080,8 +4080,7 @@ declare_proto_rig(dump_state)
// protocol 1 fields can be multi-line -- just write the thing to allow for it
// backward compatible as new values will just generate warnings
fprintf(fout, "vfo_ops=0x%x\n", rig->caps->vfo_ops);
fprintf(fout, "ptt_type=0x%x\n",
rig->caps->ptt_type == RIG_PTT_NONE ? RIG_PTT_NONE : RIG_PTT_RIG_MICDATA);
fprintf(fout, "ptt_type=0x%x\n", rig->state.pttport.type.ptt);
fprintf(fout, "done\n");
#if 0 // why isn't this implemented? Does anybody care?