[Hamlib-commits] Hamlib -- Ham radio control libraries branch Hamlib-4.0 updated. 058cf38b87e1130eb
Library to control radio transceivers and receivers
Brought to you by:
n0nb
From: Nate B. <n0...@us...> - 2020-12-07 13:21:37
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Hamlib -- Ham radio control libraries". The branch, Hamlib-4.0 has been updated via 058cf38b87e1130eb7d6768fb25434047d0dcc36 (commit) via 4b34316dc685ab4dd0659009f277c180ad487e3e (commit) from da275881623af0ec34ffce32d3e95c3b7fdc1d25 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 058cf38b87e1130eb7d6768fb25434047d0dcc36 Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Dec 6 22:54:47 2020 -0600 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 15958c8aab8dfcadecb2cc27c13d948b2a6d8764) diff --git a/rigs/yaesu/ft891.c b/rigs/yaesu/ft891.c index d2131d84..74120e4a 100644 --- a/rigs/yaesu/ft891.c +++ b/rigs/yaesu/ft891.c @@ -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, diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 57226e4f..3ebcd754 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -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) diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h index 02d121af..39cf2b88 100644 --- a/rigs/yaesu/newcat.h +++ b/rigs/yaesu/newcat.h @@ -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 diff --git a/tests/example.c b/tests/example.c index 4d895d09..86b8bc67 100644 --- a/tests/example.c +++ b/tests/example.c @@ -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); } commit 4b34316dc685ab4dd0659009f277c180ad487e3e Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Dec 6 15:04:51 2020 -0600 Add version check for lutest to only to 64-bit when 5.4 or greater (cherry picked from commit 30389216555cb3dce8f1897ee97ae48b11e14b48) diff --git a/bindings/luatest.lua b/bindings/luatest.lua index dd768745..3d097920 100755 --- a/bindings/luatest.lua +++ b/bindings/luatest.lua @@ -5,6 +5,16 @@ Hamlib = require("Hamliblua") -- you can see the Hamlib properties: -- for key,value in pairs(Hamlib) do print(key,value) end +function version() + ver = string.sub(_VERSION,4) + -- should only get one match to this + for ver2 in string.gmatch(ver,"%d.%d") do + ver = tonumber(ver2) + end + return ver +end + + function doStartup() print(string.format("%s test, %s\n", _VERSION, Hamlib.hamlib_version)) @@ -107,9 +117,13 @@ function doStartup() if sw2 > 0 then D = 'S' else D = 'N' end print(string.format("Latitude:\t%4.4f, %4.0f° %.0f' %2.0f\" %1s\trecoded: %9.4f", lat1, deg2, mins2, sec2, D, lat3)) - print(string.format("The next two lines should show 0x8000000000000000")); - print(string.format("RIG_MODE_TESTS_MAX: 0x%08x", Hamlib.RIG_MODE_TESTS_MAX)); - print(string.format("RIG_FUNC_BIT63: 0x%08x", Hamlib.RIG_FUNC_BIT63)); + if (version() >= 5.4) then + -- older version may not handle 64-bit values + -- not sure when this was fixed...might have been 5.3 somehwere + print(string.format("The next two lines should show 0x8000000000000000")); + print(string.format("RIG_MODE_TESTS_MAX: 0x%08x", Hamlib.RIG_MODE_TESTS_MAX)); + print(string.format("RIG_FUNC_BIT63: 0x%08x", Hamlib.RIG_FUNC_BIT63)); + end end ----------------------------------------------------------------------- Summary of changes: bindings/luatest.lua | 20 +++++++++++++++++--- rigs/yaesu/ft891.c | 4 ++-- rigs/yaesu/newcat.c | 21 +++------------------ rigs/yaesu/newcat.h | 2 +- tests/example.c | 4 ++-- 5 files changed, 25 insertions(+), 26 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |