kopia lustrzana https://github.com/Hamlib/Hamlib
Fix Elecraft power2mW precision/accuracy
Should fix any others too https://github.com/Hamlib/Hamlib/issues/1205pull/1215/head
rodzic
5ebde1ca34
commit
00dce998ae
1
NEWS
1
NEWS
|
@ -26,6 +26,7 @@ Version 4.6
|
||||||
|
|
||||||
Version 4.5.5
|
Version 4.5.5
|
||||||
* Really fix CM108 ptt_bitnum usage
|
* Really fix CM108 ptt_bitnum usage
|
||||||
|
* Fix Elecraft power2mW precision/accuracy
|
||||||
|
|
||||||
Version 4.5.4
|
Version 4.5.4
|
||||||
* 2023-XX-XX
|
* 2023-XX-XX
|
||||||
|
|
|
@ -343,7 +343,7 @@ const struct rig_caps k3s_caps =
|
||||||
RIG_MODEL(RIG_MODEL_K3S),
|
RIG_MODEL(RIG_MODEL_K3S),
|
||||||
.model_name = "K3S",
|
.model_name = "K3S",
|
||||||
.mfg_name = "Elecraft",
|
.mfg_name = "Elecraft",
|
||||||
.version = BACKEND_VER ".19",
|
.version = BACKEND_VER ".20",
|
||||||
.copyright = "LGPL",
|
.copyright = "LGPL",
|
||||||
.status = RIG_STATUS_STABLE,
|
.status = RIG_STATUS_STABLE,
|
||||||
.rig_type = RIG_TYPE_TRANSCEIVER,
|
.rig_type = RIG_TYPE_TRANSCEIVER,
|
||||||
|
@ -495,7 +495,7 @@ const struct rig_caps k4_caps =
|
||||||
RIG_MODEL(RIG_MODEL_K4),
|
RIG_MODEL(RIG_MODEL_K4),
|
||||||
.model_name = "K4",
|
.model_name = "K4",
|
||||||
.mfg_name = "Elecraft",
|
.mfg_name = "Elecraft",
|
||||||
.version = BACKEND_VER ".25",
|
.version = BACKEND_VER ".26",
|
||||||
.copyright = "LGPL",
|
.copyright = "LGPL",
|
||||||
.status = RIG_STATUS_STABLE,
|
.status = RIG_STATUS_STABLE,
|
||||||
.rig_type = RIG_TYPE_TRANSCEIVER,
|
.rig_type = RIG_TYPE_TRANSCEIVER,
|
||||||
|
@ -646,7 +646,7 @@ const struct rig_caps kx3_caps =
|
||||||
RIG_MODEL(RIG_MODEL_KX3),
|
RIG_MODEL(RIG_MODEL_KX3),
|
||||||
.model_name = "KX3",
|
.model_name = "KX3",
|
||||||
.mfg_name = "Elecraft",
|
.mfg_name = "Elecraft",
|
||||||
.version = BACKEND_VER ".18",
|
.version = BACKEND_VER ".19",
|
||||||
.copyright = "LGPL",
|
.copyright = "LGPL",
|
||||||
.status = RIG_STATUS_STABLE,
|
.status = RIG_STATUS_STABLE,
|
||||||
.rig_type = RIG_TYPE_TRANSCEIVER,
|
.rig_type = RIG_TYPE_TRANSCEIVER,
|
||||||
|
@ -797,7 +797,7 @@ const struct rig_caps kx2_caps =
|
||||||
RIG_MODEL(RIG_MODEL_KX2),
|
RIG_MODEL(RIG_MODEL_KX2),
|
||||||
.model_name = "KX2",
|
.model_name = "KX2",
|
||||||
.mfg_name = "Elecraft",
|
.mfg_name = "Elecraft",
|
||||||
.version = BACKEND_VER ".17",
|
.version = BACKEND_VER ".18",
|
||||||
.copyright = "LGPL",
|
.copyright = "LGPL",
|
||||||
.status = RIG_STATUS_STABLE,
|
.status = RIG_STATUS_STABLE,
|
||||||
.rig_type = RIG_TYPE_TRANSCEIVER,
|
.rig_type = RIG_TYPE_TRANSCEIVER,
|
||||||
|
@ -1839,7 +1839,9 @@ int k3_power2mW(RIG *rig,
|
||||||
freq_t freq,
|
freq_t freq,
|
||||||
rmode_t mode)
|
rmode_t mode)
|
||||||
{
|
{
|
||||||
*mwpower = power * k3_get_maxpower(rig) * 1000;
|
char buf[32];
|
||||||
|
snprintf(buf, sizeof(buf), "%.0f", power * k3_get_maxpower(rig) * 1000);
|
||||||
|
*mwpower = atoi(buf);
|
||||||
return RIG_OK;
|
return RIG_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -281,7 +281,7 @@ int main(int argc, char *argv[])
|
||||||
}
|
}
|
||||||
else if (strncmp(buf, "PC;", 3) == 0)
|
else if (strncmp(buf, "PC;", 3) == 0)
|
||||||
{
|
{
|
||||||
SNPRINTF(buf, sizeof(buf), "PC0150;");
|
SNPRINTF(buf, sizeof(buf), "PC0980;");
|
||||||
n = write(fd, buf, strlen(buf));
|
n = write(fd, buf, strlen(buf));
|
||||||
}
|
}
|
||||||
else if (strlen(buf) > 0)
|
else if (strlen(buf) > 0)
|
||||||
|
|
|
@ -5845,6 +5845,7 @@ int HAMLIB_API rig_power2mW(RIG *rig,
|
||||||
rmode_t mode)
|
rmode_t mode)
|
||||||
{
|
{
|
||||||
const freq_range_t *txrange;
|
const freq_range_t *txrange;
|
||||||
|
char buf[32];
|
||||||
|
|
||||||
ENTERFUNC;
|
ENTERFUNC;
|
||||||
|
|
||||||
|
@ -5880,7 +5881,10 @@ int HAMLIB_API rig_power2mW(RIG *rig,
|
||||||
RETURNFUNC(-RIG_EINVAL);
|
RETURNFUNC(-RIG_EINVAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
*mwpower = (unsigned int)(power * txrange->high_power);
|
|
||||||
|
snprintf(buf, sizeof(buf), "%.0f", power * txrange->high_power);
|
||||||
|
*mwpower = atoi(buf);
|
||||||
|
//*mwpower = (unsigned int)(power * txrange->high_power);
|
||||||
|
|
||||||
RETURNFUNC(RIG_OK);
|
RETURNFUNC(RIG_OK);
|
||||||
}
|
}
|
||||||
|
|
Ładowanie…
Reference in New Issue