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/1189Hamlib-4.5.2
rodzic
9edbc9e4b0
commit
2dd31355fc
|
@ -2052,23 +2052,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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -2735,7 +2734,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