kopia lustrzana https://github.com/Hamlib/Hamlib
Fix SH command for FTDX101D and fix parsing of SH for different response lengths in newcat.c
https://github.com/Hamlib/Hamlib/issues/402pull/412/head
rodzic
8760d2576b
commit
c479244fc1
|
@ -5875,7 +5875,14 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
|
||||
/* end else */
|
||||
|
||||
if (is_ft101)
|
||||
{
|
||||
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SH%c0%02d;", main_sub_vfo, w);
|
||||
}
|
||||
else
|
||||
{
|
||||
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SH%c%02d;", main_sub_vfo, w);
|
||||
}
|
||||
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: cmd_str = %s\n", __func__, priv->cmd_str);
|
||||
|
||||
|
@ -5972,7 +5979,21 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width)
|
|||
return err;
|
||||
}
|
||||
|
||||
if (strlen(priv->ret_data) == 7)
|
||||
{
|
||||
if (sscanf(priv->ret_data, "SH%*1d0%3d", &w) != 1)
|
||||
err = -RIG_EPROTO;
|
||||
}
|
||||
else if (strlen(priv->ret_data) == 6)
|
||||
{
|
||||
if (sscanf(priv->ret_data, "SH%*1d%3d", &w) != 1)
|
||||
err = -RIG_EPROTO;
|
||||
}
|
||||
else {
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: unknown SH response='%s'\n", __func__, priv->ret_data);
|
||||
return -RIG_EPROTO;
|
||||
}
|
||||
if (err != RIG_OK)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: unable to parse width from '%s'\n", __func__,
|
||||
priv->ret_data);
|
||||
|
|
Ładowanie…
Reference in New Issue