kopia lustrzana https://github.com/Hamlib/Hamlib
If get_powerstat fails in any way then always return RIG_POWER_ON
https://github.com/Hamlib/Hamlib/issues/1189pull/1191/head
rodzic
d1fffb7c84
commit
eb03592d00
|
@ -2051,23 +2051,22 @@ static int netrigctl_get_powerstat(RIG *rig, powerstat_t *status)
|
||||||
|
|
||||||
ret = netrigctl_transaction(rig, cmd, strlen(cmd), buf);
|
ret = netrigctl_transaction(rig, cmd, strlen(cmd), buf);
|
||||||
|
|
||||||
if (ret == 1)
|
if (ret == 0)
|
||||||
|
{
|
||||||
|
*status = atoi(buf);
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
// was causing problems with sdr++ since it does not have PS command
|
// was causing problems with sdr++ since it does not have PS command
|
||||||
// a return of 1 should indicate there is no powerstat command available
|
// a return of 1 should indicate there is no powerstat command available
|
||||||
// so we fake the ON status
|
// so we fake the ON status
|
||||||
|
// also a problem with Flex 6xxx and Log4OM not working due to lack of PS command
|
||||||
|
rig_debug(RIG_DEBUG_VERBOSE,
|
||||||
|
"%s: PS command failed (ret=%d) so returning RIG_POWER_ON\n", __func__, ret);
|
||||||
*status = RIG_POWER_ON;
|
*status = RIG_POWER_ON;
|
||||||
return RIG_OK;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ret <= 0)
|
return RIG_OK; // always return RIG_OK
|
||||||
{
|
|
||||||
return (ret < 0) ? ret : -RIG_EPROTO;
|
|
||||||
}
|
|
||||||
|
|
||||||
*status = atoi(buf);
|
|
||||||
|
|
||||||
return RIG_OK;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -2734,7 +2733,7 @@ struct rig_caps netrigctl_caps =
|
||||||
RIG_MODEL(RIG_MODEL_NETRIGCTL),
|
RIG_MODEL(RIG_MODEL_NETRIGCTL),
|
||||||
.model_name = "NET rigctl",
|
.model_name = "NET rigctl",
|
||||||
.mfg_name = "Hamlib",
|
.mfg_name = "Hamlib",
|
||||||
.version = "20221212.0",
|
.version = "20221214.0",
|
||||||
.copyright = "LGPL",
|
.copyright = "LGPL",
|
||||||
.status = RIG_STATUS_STABLE,
|
.status = RIG_STATUS_STABLE,
|
||||||
.rig_type = RIG_TYPE_OTHER,
|
.rig_type = RIG_TYPE_OTHER,
|
||||||
|
|
Ładowanie…
Reference in New Issue