Skip to content

Commit

Permalink
Stop mapping MICDATA ptt to PTT -- there should be no reason to do th…
Browse files Browse the repository at this point in the history
…is and it was interfering with rigctld and MICDATA rigs TS480/590/890/990

#998
  • Loading branch information
mdblack98 committed May 15, 2022
1 parent ecd78e7 commit 4d8e64a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/rig.c
Original file line number Diff line number Diff line change
Expand Up @@ -2751,10 +2751,12 @@ int HAMLIB_API rig_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt)
switch (rig->state.pttport.type.ptt)
{
case RIG_PTT_RIG:
#if 0 // https://github.com/Hamlib/Hamlib/issues/998 -- this is interfering with rigctld and MICDATA rigs
if (ptt == RIG_PTT_ON_MIC || ptt == RIG_PTT_ON_DATA)
{
ptt = RIG_PTT_ON;
}
#endif

/* fall through */
case RIG_PTT_RIG_MICDATA:
Expand Down
9 changes: 8 additions & 1 deletion tests/rigctl_parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -2448,6 +2448,7 @@ declare_proto_rig(set_ptt)

CHKSCN1ARG(sscanf(arg1, "%d", &scr));
ptt = scr;
rig_debug(RIG_DEBUG_VERBOSE, "%s: set_ptt ptt=%d\n", __func__, ptt);

/*
* We allow RIG_PTT_ON_MIC and RIG_PTT_ON_DATA arriving from netrigctl.
Expand All @@ -2462,11 +2463,16 @@ declare_proto_rig(set_ptt)
case RIG_PTT_ON_MIC:
case RIG_PTT_ON_DATA:

// No longer map this -- is confusing rigctld and MICDATA rigs
// https://github.com/Hamlib/Hamlib/issues/998
#if 0
// map to a legal value
if (rig->state.pttport.type.ptt != RIG_PTT_RIG_MICDATA)
if (rig->caps->ptt_type != RIG_PTT_RIG_MICDATA)
{
rig_debug(RIG_DEBUG_ERR, "%s: pttport.type.ptt=%d\n", __func__, rig->state.pttport.type.ptt);
ptt = RIG_PTT_ON;
}
#endif

break;

Expand All @@ -2482,6 +2488,7 @@ declare_proto_rig(set_ptt)
RETURNFUNC(-RIG_EINVAL);
}

rig_debug(RIG_DEBUG_ERR, "%s: ptt=%d\n", __func__, ptt);
RETURNFUNC(rig_set_ptt(rig, vfo, ptt));
}

Expand Down

0 comments on commit 4d8e64a

Please sign in to comment.