kopia lustrzana https://github.com/Hamlib/Hamlib
Some more change to bring rigctld dump_caps into line with rigctl dump_caps
https://github.com/Hamlib/Hamlib/issues/659pull/680/head
rodzic
e0a3f8deac
commit
9231c2f7e5
|
@ -402,7 +402,7 @@ static int netrigctl_open(RIG *rig)
|
|||
return (ret < 0) ? ret : -RIG_EPROTO;
|
||||
}
|
||||
|
||||
rs->max_rit = atol(buf);
|
||||
rig->caps->max_rit = rs->max_rit = atol(buf);
|
||||
|
||||
ret = read_string(&rig->state.rigport, buf, BUF_MAX, "\n", 1);
|
||||
|
||||
|
@ -411,7 +411,7 @@ static int netrigctl_open(RIG *rig)
|
|||
return (ret < 0) ? ret : -RIG_EPROTO;
|
||||
}
|
||||
|
||||
rs->max_xit = atol(buf);
|
||||
rig->caps->max_xit = rs->max_xit = atol(buf);
|
||||
|
||||
ret = read_string(&rig->state.rigport, buf, BUF_MAX, "\n", 1);
|
||||
|
||||
|
@ -420,7 +420,7 @@ static int netrigctl_open(RIG *rig)
|
|||
return (ret < 0) ? ret : -RIG_EPROTO;
|
||||
}
|
||||
|
||||
rs->max_ifshift = atol(buf);
|
||||
rig->caps->max_ifshift = rs->max_ifshift = atol(buf);
|
||||
|
||||
ret = read_string(&rig->state.rigport, buf, BUF_MAX, "\n", 1);
|
||||
|
||||
|
@ -443,13 +443,20 @@ static int netrigctl_open(RIG *rig)
|
|||
&rs->preamp[2], &rs->preamp[3],
|
||||
&rs->preamp[4], &rs->preamp[5],
|
||||
&rs->preamp[6]);
|
||||
rig->caps->preamp[0] = rs->preamp[0];
|
||||
rig->caps->preamp[1] = rs->preamp[1];
|
||||
rig->caps->preamp[2] = rs->preamp[2];
|
||||
rig->caps->preamp[3] = rs->preamp[3];
|
||||
rig->caps->preamp[4] = rs->preamp[4];
|
||||
rig->caps->preamp[5] = rs->preamp[5];
|
||||
rig->caps->preamp[6] = rs->preamp[6];
|
||||
|
||||
if (ret < 0 || ret >= HAMLIB_MAXDBLSTSIZ)
|
||||
{
|
||||
ret = 0;
|
||||
}
|
||||
|
||||
rs->preamp[ret] = RIG_DBLST_END;
|
||||
rig->caps->preamp[ret] = rs->preamp[ret] = RIG_DBLST_END;
|
||||
|
||||
ret = read_string(&rig->state.rigport, buf, BUF_MAX, "\n", 1);
|
||||
|
||||
|
@ -463,13 +470,20 @@ static int netrigctl_open(RIG *rig)
|
|||
&rs->attenuator[2], &rs->attenuator[3],
|
||||
&rs->attenuator[4], &rs->attenuator[5],
|
||||
&rs->attenuator[6]);
|
||||
rig->caps->attenuator[0] = rs->attenuator[0];
|
||||
rig->caps->attenuator[1] = rs->attenuator[1];
|
||||
rig->caps->attenuator[2] = rs->attenuator[2];
|
||||
rig->caps->attenuator[3] = rs->attenuator[3];
|
||||
rig->caps->attenuator[4] = rs->attenuator[4];
|
||||
rig->caps->attenuator[5] = rs->attenuator[5];
|
||||
rig->caps->attenuator[6] = rs->attenuator[6];
|
||||
|
||||
if (ret < 0 || ret >= HAMLIB_MAXDBLSTSIZ)
|
||||
{
|
||||
ret = 0;
|
||||
}
|
||||
|
||||
rs->attenuator[ret] = RIG_DBLST_END;
|
||||
rig->caps->attenuator[ret] = rs->attenuator[ret] = RIG_DBLST_END;
|
||||
|
||||
ret = read_string(&rig->state.rigport, buf, BUF_MAX, "\n", 1);
|
||||
|
||||
|
|
|
@ -522,6 +522,19 @@ int main(int argc, char *argv[])
|
|||
*/
|
||||
if (dump_caps_opt)
|
||||
{
|
||||
|
||||
// if rigctld then we need to open to get the rig caps
|
||||
if (my_model == RIG_MODEL_NETRIGCTL) {
|
||||
int ret;
|
||||
rig_set_debug(verbose);
|
||||
my_rig = rig_init(my_model);
|
||||
if((ret=rig_open(my_rig)) != RIG_OK)
|
||||
{
|
||||
fprintf(stderr,"Unable to open rigctld: %s\n", rigerror(ret));
|
||||
exit(1);
|
||||
}
|
||||
rig_close(my_rig);
|
||||
}
|
||||
dumpcaps(my_rig, stdout);
|
||||
rig_cleanup(my_rig); /* if you care about memory */
|
||||
exit(0);
|
||||
|
|
Ładowanie…
Reference in New Issue