Fix parsing of SH command in newcat.c

Remove get_vfo from FT-891
https://github.com/Hamlib/Hamlib/issues/455

(cherry picked from commit 15958c8aab)
Hamlib-4.0
Michael Black W9MDB 2020-12-06 22:54:47 -06:00 zatwierdzone przez Nate Bargmann
rodzic 4b34316dc6
commit 058cf38b87
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: F72625E2EDBED598
4 zmienionych plików z 8 dodań i 23 usunięć

Wyświetl plik

@ -50,7 +50,7 @@ const struct rig_caps ft891_caps =
RIG_MODEL(RIG_MODEL_FT891),
.model_name = "FT-891",
.mfg_name = "Yaesu",
.version = NEWCAT_VER ".1",
.version = NEWCAT_VER ".2",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
@ -192,7 +192,7 @@ const struct rig_caps ft891_caps =
.get_freq = newcat_get_freq,
.set_mode = ft891_set_mode,
.get_mode = newcat_get_mode,
.get_vfo = newcat_get_vfo,
// .get_vfo = newcat_get_vfo,
.set_ptt = newcat_set_ptt,
.get_ptt = newcat_get_ptt,
.set_split_vfo = ft891_set_split_vfo,

Wyświetl plik

@ -7593,25 +7593,10 @@ 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%3d;", &w) != 1 &&
sscanf(priv->ret_data, "SH0%3d;", &w) != 1)
{
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;
err = -RIG_EPROTO;
}
if (err != RIG_OK)

Wyświetl plik

@ -50,7 +50,7 @@
typedef char ncboolean;
/* shared function version */
#define NEWCAT_VER "20201206"
#define NEWCAT_VER "20201207"
/* Hopefully large enough for future use, 128 chars plus '\0' */
#define NEWCAT_DATA_LEN 129

Wyświetl plik

@ -12,8 +12,8 @@
#include <string.h>
#include <hamlib/rig.h>
#include <hamlib/riglist.h>
#include <hamlib/rotator.h>
#include "sprintflst.h"
#include <hamlib/rotator.h>
#if 0
#define MODEL RIG_MODEL_DUMMY
@ -131,7 +131,7 @@ int main()
if (range)
{
char vfolist[256];
sprintf_vfo(vfolist, my_rig->state.vfo_list);
rig_sprintf_vfo(vfolist, my_rig->state.vfo_list);
printf("Range start=%"PRIfreq", end=%"PRIfreq", low_power=%d, high_power=%d, vfos=%s\n",
range->startf, range->endf, range->low_power, range->high_power, vfolist);
}