kopia lustrzana https://github.com/Hamlib/Hamlib
Fix cppcheck warning in xg3.c
rodzic
e108de4515
commit
26b6113203
|
@ -511,20 +511,21 @@ int xg3_get_powerstat(RIG *rig, powerstat_t *status)
|
||||||
struct rig_state *rs = &rig->state;
|
struct rig_state *rs = &rig->state;
|
||||||
struct xg3_priv_data *priv = (struct xg3_priv_data *)rig->state.priv;
|
struct xg3_priv_data *priv = (struct xg3_priv_data *)rig->state.priv;
|
||||||
|
|
||||||
retval = read_string(&rs->rigport, reply, sizeof(reply), ";", 1);
|
|
||||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
||||||
|
|
||||||
if (retval != RIG_OK)
|
if (retval == RIG_OK)
|
||||||
|
{
|
||||||
|
retval = read_string(&rs->rigport, reply, sizeof(reply), ";", 1);
|
||||||
|
*status = RIG_POWER_ON;
|
||||||
|
priv->powerstat = RIG_POWER_ON;
|
||||||
|
}
|
||||||
|
|
||||||
|
else if (retval != RIG_OK)
|
||||||
{
|
{
|
||||||
*status = RIG_POWER_OFF; // Error indicates power is off
|
*status = RIG_POWER_OFF; // Error indicates power is off
|
||||||
rig_debug(RIG_DEBUG_VERBOSE, "%s read_string failed\n", __func__);
|
rig_debug(RIG_DEBUG_VERBOSE, "%s read_string failed\n", __func__);
|
||||||
priv->powerstat = RIG_POWER_OFF;
|
priv->powerstat = RIG_POWER_OFF;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
*status = RIG_POWER_ON;
|
|
||||||
priv->powerstat = RIG_POWER_ON;
|
|
||||||
}
|
|
||||||
|
|
||||||
return RIG_OK; // Always OK since it's a binary state
|
return RIG_OK; // Always OK since it's a binary state
|
||||||
}
|
}
|
||||||
|
|
Ładowanie…
Reference in New Issue