[Hamlib-commits] Hamlib -- Ham radio control libraries branch master updated. 0f2a92b2de7118f303215
Library to control radio transceivers and receivers
Brought to you by:
n0nb
From: Nate B. <n0...@us...> - 2021-09-13 23:41:27
|
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, master has been updated via 0f2a92b2de7118f303215cccd1188199711a4b4d (commit) via ad2418577a21f9b0f5f422c9113390fdb34e68cf (commit) via e26afead852ce03b5cfd9220ac963e5505cf6f39 (commit) via 5f8be97e267e8e527f106c901c147b7fa7e10f6b (commit) via 846e12ce6145877a06dc3ba8fb0b42d90df46d49 (commit) via 6a13d40b9a4ef253cc7c4b80180f3e6d82737901 (commit) via cc886b46f599d49d32d0da0c6aff639467da075e (commit) via 6216d8a2b8692ddced2c0b85389e694f97c51c39 (commit) via e88ef72003fa875cfe827b966fffcb3010f5055d (commit) via b02ea818de7fd6f9f93fbab15ab261140862a871 (commit) via 6a79eb3d9a1856a8118a6064a15223ca88ec50cc (commit) via ebc3a592236e5dc48c33d522d565c5a4b22acd80 (commit) via bee3548df23d4635b83d35b897990c34017c9c0d (commit) via 699151851f7ba8ec8b34b0328fb3a7ff9aced8fd (commit) via dcb85aa52aec2db2d9e031267882b7f813f224f1 (commit) via 90cb1239d17f99368719f1742b8de34727b60dd3 (commit) via 86a8e6baf5456185ae642e8becf36838d52c78e2 (commit) via d9db709963bf70706f469b32160c8f3ad0cb613b (commit) via 7bae5bbd3d78cd057c45a7e69095cd274fc49032 (commit) via 9b15316bd1c5c3cffe908019fc00c11400e4cb39 (commit) via f852b1c6458ba8d8ab1580e1683d7214583bdcc8 (commit) via a7ac90e76e6cf54049d559bb0692de4107b3bd0f (commit) via 1b3b5b70c15e75f20e3b12765bcd870dbc9457aa (commit) via c3f9f20aa8b278dbd69991b74d9ec90aff9d01fa (commit) via ecea9da84727d2054f3ada057b047a6ff9724663 (commit) via ec2d5387a745e6eb94210faed12afb55cdeb8d88 (commit) via 02f0ae986f97c3ad1fbd5e82229d106a0383bd77 (commit) via 644c640da41ee177d2132eaa340d2a48c60d511c (commit) via a85d6891c7fd1ca90d581284131ea0a546619b49 (commit) via 6e5bc09b2750025885a24d008da8e8ec8fbc0de9 (commit) via 2706cca64982330322d527544dc9ded95439f32f (commit) via a5064bc5d98cabe6b3384df988e0e19ca996b596 (commit) via e21e9b3304c2f5748e83f8beb9005168df8c4a60 (commit) via d39daab0df7416dfc3928666f78aab11c302a7ad (commit) via 04b0e6e40c1d71d84b04ff38585317eb504dff37 (commit) via 196884e3b1674ca323af0eb6b1d3d416bba001ce (commit) via e911471eae1eb348a4ecd774c30531eff32b6380 (commit) via b5bd1f4036bb42ae8b5c05900f51cec60bf2502e (commit) via 84807bc95e3b1e46c3b14ebe49ab3ceb3e24ab59 (commit) from 2b3ec3f4bd7d7c80a16cfc5aa2bedf7340fd21a9 (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 0f2a92b2de7118f303215cccd1188199711a4b4d Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Sep 13 13:13:12 2021 -0500 Change kenwood to only set VFOA default on 1st rig_open call https://github.com/Hamlib/Hamlib/issues/797 diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index 7b5ef5ec..b4e981f8 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -962,10 +962,11 @@ int kenwood_open(RIG *rig) rig->state.rigport.retry = retry_save; - // Default to 1st VFO and split off - if (rig->caps->set_vfo) + // Default to 1st VFO and split off -- but only 1 time + if (rig->caps->set_vfo && priv->opened == 0) { rig_set_vfo(rig, vfo_fixup(rig, RIG_VFO_A, 0)); + priv->opened = 1; } RETURNFUNC(RIG_OK); diff --git a/rigs/kenwood/kenwood.h b/rigs/kenwood/kenwood.h index e0973afc..801fdb1b 100644 --- a/rigs/kenwood/kenwood.h +++ b/rigs/kenwood/kenwood.h @@ -28,7 +28,7 @@ #include "token.h" #include "misc.h" -#define BACKEND_VER "20210829" +#define BACKEND_VER "20210911" #define EOM_KEN ';' #define EOM_TH '\r' @@ -165,6 +165,7 @@ struct kenwood_priv_data int is_k4d; int is_k4hd; int no_id; // if true will not send ID; with every set command + int opened; // true once rig_open is called to avoid setting VFOA every open call }; commit ad2418577a21f9b0f5f422c9113390fdb34e68cf Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Sep 13 08:54:27 2021 -0500 Fix compile warning in ft1000mp.c diff --git a/rigs/yaesu/ft1000mp.c b/rigs/yaesu/ft1000mp.c index cf861651..4460867a 100644 --- a/rigs/yaesu/ft1000mp.c +++ b/rigs/yaesu/ft1000mp.c @@ -310,7 +310,7 @@ const struct rig_caps ft1000mp_caps = RIG_MODEL(RIG_MODEL_FT1000MP), .model_name = "FT-1000MP", .mfg_name = "Yaesu", - .version = "20210318.0", + .version = "20210913.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -1320,8 +1320,8 @@ static int ft1000mp_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) default: rig_debug(RIG_DEBUG_ERR, "%s: Unsupported set_func %s", __func__, rig_strfunc(func)); - RETURNFUNC(-RIG_EINVAL); } + RETURNFUNC(-RIG_EINVAL); } static int ft1000mp_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status) commit e26afead852ce03b5cfd9220ac963e5505cf6f39 Author: Mike Black W9MDB <mdb...@ya...> Date: Sun Sep 12 23:27:32 2021 -0500 Add testlibusb to .gitignore diff --git a/.gitignore b/.gitignore index f0c6221a..040f0708 100644 --- a/.gitignore +++ b/.gitignore @@ -57,6 +57,7 @@ tests/rigsmtr tests/rigswr tests/rotctl tests/rotctld +tests/testlibusb src/hamlibdatetime.h .gdbinit build/ commit 5f8be97e267e8e527f106c901c147b7fa7e10f6b Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Sep 11 11:38:44 2021 -0500 Fix rot_strstatus to use ulong instead of int in sprintflst.c diff --git a/src/sprintflst.c b/src/sprintflst.c index faa5dea6..3e3e8ad1 100644 --- a/src/sprintflst.c +++ b/src/sprintflst.c @@ -702,7 +702,8 @@ int rig_sprintf_scan(char *str, int nlen, scan_t rscan) int rot_sprintf_status(char *str, int nlen, rot_status_t status) { - int i, len = 0; + int len = 0; + unsigned long i; rig_debug(RIG_DEBUG_TRACE, "%s: status=%08x\n", __func__, status); *str = '\0'; commit 846e12ce6145877a06dc3ba8fb0b42d90df46d49 Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Sep 11 11:29:00 2021 -0500 Fix debug statement in register.c diff --git a/src/register.c b/src/register.c index 6d56b130..cbe08764 100644 --- a/src/register.c +++ b/src/register.c @@ -302,7 +302,7 @@ int HAMLIB_API rig_check_backend(rig_model_t rig_model) if (n > 1) { - rig_debug(RIG_DEBUG_ERR, "%s: rig model %d not found and rig count=%d\n", + rig_debug(RIG_DEBUG_ERR, "%s: rig model %u not found and rig count=%d\n", __func__, rig_model, n); return -RIG_ENAVAIL; } commit 6a13d40b9a4ef253cc7c4b80180f3e6d82737901 Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Sep 11 11:24:12 2021 -0500 Reduce scope of var in network.c diff --git a/src/network.c b/src/network.c index 591dd635..e6432ea5 100644 --- a/src/network.c +++ b/src/network.c @@ -126,10 +126,10 @@ int network_init() { #ifdef __MINGW32__ WSADATA wsadata; - int ret; if (wsstarted == 0) { + int ret; ret = WSAStartup(MAKEWORD(1, 1), &wsadata); if (ret == 0) commit cc886b46f599d49d32d0da0c6aff639467da075e Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Sep 11 11:13:23 2021 -0500 Make parse_hoststr delcaration match implementation diff --git a/src/misc.h b/src/misc.h index 4b8f5fc4..a685384a 100644 --- a/src/misc.h +++ b/src/misc.h @@ -108,7 +108,7 @@ extern HAMLIB_EXPORT(double) elapsed_ms(struct timespec *start, int start_flag); extern HAMLIB_EXPORT(vfo_t) vfo_fixup(RIG *rig, vfo_t vfo, split_t split); -extern HAMLIB_EXPORT(int) parse_hoststr(char *host, char hoststr[256], char port[6]); +extern HAMLIB_EXPORT(int) parse_hoststr(char *hoststr, char host[256], char port[6]); extern HAMLIB_EXPORT(uint32_t) CRC32_function(uint8_t *buf, uint32_t len); commit 6216d8a2b8692ddced2c0b85389e694f97c51c39 Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Sep 11 11:10:30 2021 -0500 Add some const declarations to microham.c diff --git a/src/microham.c b/src/microham.c index d393e488..e757f685 100644 --- a/src/microham.c +++ b/src/microham.c @@ -404,7 +404,7 @@ static int incontrol = 0; static unsigned char controlstring[256]; static int numcontrolbytes = 0; -static void parseFrame(unsigned char *frame) +static void parseFrame(const unsigned char *frame) { unsigned char byte; FRAME("RCV frame %02x %02x %02x %02x\n", frame[0], frame[1], frame[2], @@ -519,7 +519,7 @@ static void parseFrame(unsigned char *frame) // // Send radio bytes to microHam device // -static void writeRadio(unsigned char *bytes, int len) +static void writeRadio(const unsigned char *bytes, int len) { unsigned char seq[4]; int i; @@ -606,7 +606,7 @@ static void writeFlags() // // Send bytes to the WinKeyer within microHam device // -static void writeWkey(unsigned char *bytes, int len) +static void writeWkey(const unsigned char *bytes, int len) { unsigned char seq[12]; int i; @@ -665,7 +665,7 @@ static void writeWkey(unsigned char *bytes, int len) // // Write a control string to the microHam device // -static void writeControl(unsigned char *data, int len) +static void writeControl(const unsigned char *data, int len) { int i; unsigned char seq[8]; @@ -1078,7 +1078,7 @@ static void start_thread() return; } - TRACE("Started daemonized thread reading microHam\n"); + //TRACE("Started daemonized thread reading microHam\n"); #endif // if we do not have pthreads, this function does nothing. } commit e88ef72003fa875cfe827b966fffcb3010f5055d Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Sep 11 11:04:13 2021 -0500 Reduce scope of var in misc.c diff --git a/src/misc.c b/src/misc.c index 76121037..c4a6e0c0 100644 --- a/src/misc.c +++ b/src/misc.c @@ -2326,13 +2326,14 @@ void errmsg(int err, char *s, const char *func, const char *file, int line) uint32_t CRC32_function(uint8_t *buf, uint32_t len) { - uint32_t val, crc; + uint32_t crc; uint8_t i; crc = 0xFFFFFFFF; while (len--) { + uint32_t val; val = (crc^*buf++) & 0xFF; for (i = 0; i < 8; i++) commit b02ea818de7fd6f9f93fbab15ab261140862a871 Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Sep 11 10:44:28 2021 -0500 Add const declaration to amplifier.c diff --git a/src/amplifier.c b/src/amplifier.c index c56364e0..c6e05694 100644 --- a/src/amplifier.c +++ b/src/amplifier.c @@ -103,7 +103,7 @@ static int add_opened_amp(AMP *amp) } -static int remove_opened_amp(AMP *amp) +static int remove_opened_amp(const AMP *amp) { struct opened_amp_l *p, *q; q = NULL; commit 6a79eb3d9a1856a8118a6064a15223ca88ec50cc Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Sep 11 10:43:36 2021 -0500 Remove duplicate line from simyaesu.c diff --git a/simulators/simyaesu.c b/simulators/simyaesu.c index ed0080c6..1e24d0fe 100644 --- a/simulators/simyaesu.c +++ b/simulators/simyaesu.c @@ -142,7 +142,6 @@ int main(int argc, char *argv[]) usleep(50 * 1000); int id = NC_RIGID_FTDX3000; snprintf(buf, sizeof(buf), "ID%03d;", id); - n = snprintf(buf, sizeof(buf), "ID%03d;", id); n = write(fd, buf, strlen(buf)); printf("n=%d\n", n); commit ebc3a592236e5dc48c33d522d565c5a4b22acd80 Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Sep 11 10:42:48 2021 -0500 Remove unused vars from simkenwood.c diff --git a/simulators/simkenwood.c b/simulators/simkenwood.c index e90360c1..1879bfb0 100644 --- a/simulators/simkenwood.c +++ b/simulators/simkenwood.c @@ -97,7 +97,6 @@ int main(int argc, char *argv[]) int n; int fd = openPort(argv[1]); int freqa = 14074000, freqb = 140735000; - int modea = 0, modeb = 0; while (1) { commit bee3548df23d4635b83d35b897990c34017c9c0d Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Sep 11 10:41:44 2021 -0500 Remove duplicate line in simkenwood.c diff --git a/simulators/simkenwood.c b/simulators/simkenwood.c index 9343bb6e..e90360c1 100644 --- a/simulators/simkenwood.c +++ b/simulators/simkenwood.c @@ -143,7 +143,6 @@ int main(int argc, char *argv[]) usleep(50 * 1000); int id = 24; snprintf(buf, sizeof(buf), "ID%03d;", id); - n = snprintf(buf, sizeof(buf), "ID%03d;", id); n = write(fd, buf, strlen(buf)); printf("n=%d\n", n); commit 699151851f7ba8ec8b34b0328fb3a7ff9aced8fd Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Sep 11 10:41:01 2021 -0500 Remove duplicate line in simelecraft.c diff --git a/simulators/simelecraft.c b/simulators/simelecraft.c index 2762c4ee..3b0d859c 100644 --- a/simulators/simelecraft.c +++ b/simulators/simelecraft.c @@ -143,7 +143,6 @@ int main(int argc, char *argv[]) usleep(50 * 1000); int id = 24; snprintf(buf, sizeof(buf), "ID%03d;", id); - n = snprintf(buf, sizeof(buf), "ID%03d;", id); n = write(fd, buf, strlen(buf)); printf("n=%d\n", n); commit dcb85aa52aec2db2d9e031267882b7f813f224f1 Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Sep 11 10:39:51 2021 -0500 Fix debug print in ft817.c diff --git a/rigs/yaesu/ft817.c b/rigs/yaesu/ft817.c index 6fc58d71..eda35747 100644 --- a/rigs/yaesu/ft817.c +++ b/rigs/yaesu/ft817.c @@ -303,7 +303,7 @@ const struct rig_caps ft817_caps = RIG_MODEL(RIG_MODEL_FT817), .model_name = "FT-817", .mfg_name = "Yaesu", - .version = "20201015.0", + .version = "20210911.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -1197,7 +1197,7 @@ static int ft818_817_get_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t *option, break; default: - rig_debug(RIG_DEBUG_ERR, "%s: Unsupported VFO %d!\n", + rig_debug(RIG_DEBUG_ERR, "%s: Unsupported VFO %0x!\n", __func__, vfo); return -RIG_EINTERNAL; } commit 90cb1239d17f99368719f1742b8de34727b60dd3 Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Sep 11 10:36:32 2021 -0500 Remove unneeded RETURNFUNC in ft1000mp.c diff --git a/rigs/yaesu/ft1000mp.c b/rigs/yaesu/ft1000mp.c index 2f5b1390..cf861651 100644 --- a/rigs/yaesu/ft1000mp.c +++ b/rigs/yaesu/ft1000mp.c @@ -834,7 +834,7 @@ static int ft1000mp_set_freq(RIG *rig, vfo_t vfo, freq_t freq) RETURNFUNC(-RIG_ENIMPL); default: - rig_debug(RIG_DEBUG_WARN, "%s: unknown VFO %d\n", __func__, vfo); + rig_debug(RIG_DEBUG_WARN, "%s: unknown VFO %0x\n", __func__, vfo); RETURNFUNC(-RIG_EINVAL); } @@ -1322,9 +1322,8 @@ static int ft1000mp_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) rig_strfunc(func)); RETURNFUNC(-RIG_EINVAL); } - - RETURNFUNC(-RIG_EINVAL); } + static int ft1000mp_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status) { int retval; commit 86a8e6baf5456185ae642e8becf36838d52c78e2 Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Sep 11 10:24:42 2021 -0500 Bump version in rx331.c diff --git a/rigs/tentec/rx331.c b/rigs/tentec/rx331.c index e9aa8b6f..b476696c 100644 --- a/rigs/tentec/rx331.c +++ b/rigs/tentec/rx331.c @@ -99,7 +99,7 @@ const struct rig_caps rx331_caps = RIG_MODEL(RIG_MODEL_RX331), .model_name = "RX-331", .mfg_name = "Ten-Tec", - .version = "20200323.0", + .version = "20200911.0", .copyright = "LGPL", .status = RIG_STATUS_BETA, .rig_type = RIG_TYPE_RECEIVER, commit d9db709963bf70706f469b32160c8f3ad0cb613b Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Sep 11 10:24:07 2021 -0500 Remove overlapping union references in rx331.c diff --git a/rigs/tentec/rx331.c b/rigs/tentec/rx331.c index 3161ad71..e9aa8b6f 100644 --- a/rigs/tentec/rx331.c +++ b/rigs/tentec/rx331.c @@ -646,6 +646,7 @@ int rx331_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) int rx331_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) { int retval, lvl_len; + double f; char lvlbuf[BUFSZ]; switch (level) @@ -779,8 +780,8 @@ int rx331_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) { return -RIG_EPROTO; } - - val->f = 1.0 - (float)(val->i / 120.0); + f = val->i / 120.0; + val->f = 1.0 - f; break; @@ -805,7 +806,8 @@ int rx331_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) return -RIG_EPROTO; } - val->i = (int)(val->f * 1000.0); + f = val->f * 1000.0; + val->i = (int)f; break; @@ -830,7 +832,8 @@ int rx331_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) return -RIG_EPROTO; } - val->f = 1.0 - (val->i / 120.0); + f = val->i / 120.0; + val->f = 1.0 - f; break; @@ -855,7 +858,8 @@ int rx331_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) return -RIG_EPROTO; } - val->i = (val->f * 1000.0); + f = val->f * 1000.0; + val->i = f; break; @@ -880,7 +884,8 @@ int rx331_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) return -RIG_EPROTO; } - val->i = (val->f * 1000.0); + f = val->f * 1000.0; + val->i = f; break; commit 7bae5bbd3d78cd057c45a7e69095cd274fc49032 Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Sep 11 10:15:44 2021 -0500 Add const declaration to omnivii.c diff --git a/rigs/tentec/omnivii.c b/rigs/tentec/omnivii.c index ec877faf..7a9902ba 100644 --- a/rigs/tentec/omnivii.c +++ b/rigs/tentec/omnivii.c @@ -129,7 +129,7 @@ const struct rig_caps tt588_caps = RIG_MODEL(RIG_MODEL_TT588), .model_name = "TT-588 Omni VII", .mfg_name = "Ten-Tec", - .version = "20200113.0", + .version = "20200911.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -258,7 +258,7 @@ static int tt588_rxFilter[] = sometimes get things going again, hence this hack, er, function. */ /* Note: data should be at least data_len+1 long for null byte insertion */ static int tt588_transaction(RIG *rig, const char *cmd, int cmd_len, char *data, - int *data_len) + const int *data_len) { int i, retval = -RIG_EINTERNAL; struct rig_state *rs = &rig->state; commit 9b15316bd1c5c3cffe908019fc00c11400e4cb39 Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Sep 11 10:11:54 2021 -0500 Remove unneeded clause and add const declaration in jupiter.c diff --git a/rigs/tentec/jupiter.c b/rigs/tentec/jupiter.c index 43808be3..a69fe382 100644 --- a/rigs/tentec/jupiter.c +++ b/rigs/tentec/jupiter.c @@ -512,7 +512,7 @@ int tt538_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) unsigned char cmdbuf[16], respbuf[32]; char ttmode; /* Find bandwidth according to response from table. */ - static int pbwidth[39] = + const static int pbwidth[39] = { 8000, 6000, 5700, 5400, 5100, 4800, 4500, 4200, 3900, 3600, 3300, 3000, 2850, 2700, 2550, 2400, @@ -594,7 +594,7 @@ int tt538_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) rpb = respbuf[1]; - if (rpb >= 0 && rpb <= 38) + if (rpb <= 38) { *width = pbwidth[rpb]; } commit f852b1c6458ba8d8ab1580e1683d7214583bdcc8 Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Sep 11 10:09:17 2021 -0500 Remove unneeded clause from ra37xx.c diff --git a/rigs/racal/ra37xx.c b/rigs/racal/ra37xx.c index 6d186621..caca6701 100644 --- a/rigs/racal/ra37xx.c +++ b/rigs/racal/ra37xx.c @@ -143,8 +143,7 @@ static int ra37xx_one_transaction(RIG *rig, const char *cmd, char *data, } /* drop other receiver id, and "pause" (empty) packets */ - if ((priv->receiver_id != -1 && (respbuf[1] - '0') != priv->receiver_id) || - retval == pkt_header_len + 1) + if ((priv->receiver_id != -1 && (respbuf[1] - '0') != priv->receiver_id)) { if (!rig_check_cache_timeout(&tv, rs->rigport.timeout)) { diff --git a/rigs/racal/ra37xx.h b/rigs/racal/ra37xx.h index e62ab35e..217e22b8 100644 --- a/rigs/racal/ra37xx.h +++ b/rigs/racal/ra37xx.h @@ -26,7 +26,7 @@ #undef BACKEND_VER -#define BACKEND_VER "20200114" +#define BACKEND_VER "20210911" extern const struct confparams ra37xx_cfg_params[]; commit a7ac90e76e6cf54049d559bb0692de4107b3bd0f Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Sep 11 09:59:39 2021 -0500 Add needed return in ts890s.c diff --git a/rigs/kenwood/ts890s.c b/rigs/kenwood/ts890s.c index 1ee86627..09ea0410 100644 --- a/rigs/kenwood/ts890s.c +++ b/rigs/kenwood/ts890s.c @@ -224,6 +224,7 @@ int kenwood_ts890_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) default: return kenwood_get_level(rig, vfo, level, val); } + return -RIG_EINTERNAL; } static struct kenwood_priv_caps ts890s_priv_caps = commit 1b3b5b70c15e75f20e3b12765bcd870dbc9457aa Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Sep 11 09:58:24 2021 -0500 Remove overlapping union reference in flex6xxx.c diff --git a/rigs/kenwood/flex6xxx.c b/rigs/kenwood/flex6xxx.c index 231ee1f9..1938821c 100644 --- a/rigs/kenwood/flex6xxx.c +++ b/rigs/kenwood/flex6xxx.c @@ -919,8 +919,8 @@ int powersdr_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) __func__, lvlbuf); return -RIG_EPROTO; } - - val->f = (val->i + 20.0) / (120.0 - -20.0); + n = val->i; + val->f = (n + 20.0) / (120.0 - -20.0); break; @@ -1083,7 +1083,7 @@ const struct rig_caps f6k_caps = RIG_MODEL(RIG_MODEL_F6K), .model_name = "6xxx", .mfg_name = "FlexRadio", - .version = "20210527.0", + .version = "20210911.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, commit c3f9f20aa8b278dbd69991b74d9ec90aff9d01fa Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Sep 11 09:56:52 2021 -0500 Make var const in optoscan.c diff --git a/rigs/icom/optoscan.c b/rigs/icom/optoscan.c index 5d844044..85f40852 100644 --- a/rigs/icom/optoscan.c +++ b/rigs/icom/optoscan.c @@ -244,7 +244,7 @@ int optoscan_recv_dtmf(RIG *rig, vfo_t vfo, char *digits, int *length) { unsigned char dtmfbuf[MAXFRAMELEN], digit; int len, digitpos; - unsigned char xlate[] = {'0', '1', '2', '3', '4', '5', '6', + const unsigned char xlate[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', '*', '#' }; commit ecea9da84727d2054f3ada057b047a6ff9724663 Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Sep 11 09:54:19 2021 -0500 Remove unused value set in icom.c diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 86cda0bc..60daccfa 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -859,7 +859,7 @@ icom_rig_open(RIG *rig) int icom_rig_close(RIG *rig) { - int retval = RIG_OK; + int retval; // Nothing to do yet struct rig_state *rs = &rig->state; struct icom_priv_data *priv = (struct icom_priv_data *) rs->priv; commit ec2d5387a745e6eb94210faed12afb55cdeb8d88 Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Sep 11 09:53:17 2021 -0500 Remove shadowed declaration from icom.c diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index eb437f46..86cda0bc 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -751,7 +751,6 @@ int icom_get_usb_echo_off(RIG *rig) if (ack_len == 1) // then we got an echo of the cmd { - struct rig_state *rs = &rig->state; unsigned char buf[16]; priv->serial_USB_echo_off = 0; rig_debug(RIG_DEBUG_VERBOSE, "%s: USB echo on detected\n", __func__); commit 02f0ae986f97c3ad1fbd5e82229d106a0383bd77 Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Sep 11 09:48:36 2021 -0500 Remove always true clause from icom.c diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 0b95757b..eb437f46 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -8247,7 +8247,7 @@ static int icom_parse_spectrum_frame(RIG *rig, int length, // The first byte indicates spectrum scope ID/VFO: 0 = Main, 1 = Sub int spectrum_id = frame_data[0]; - if (spectrum_id < 0 || spectrum_id >= priv->spectrum_scope_count) + if (spectrum_id >= priv->spectrum_scope_count) { rig_debug(RIG_DEBUG_ERR, "%s: invalid spectrum scope ID from CI-V frame: %d\n", __func__, spectrum_id); commit 644c640da41ee177d2132eaa340d2a48c60d511c Merge: a85d6891 196884e3 Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Sep 11 08:14:41 2021 -0500 Merge branch 'master' of https://github.com/Hamlib/Hamlib commit a85d6891c7fd1ca90d581284131ea0a546619b49 Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Sep 11 05:43:19 2021 -0500 Fix return path in icom.c diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 733a7910..0b95757b 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -6948,6 +6948,7 @@ int icom_set_parm(RIG *rig, setting_t parm, value_t val) rig_strparm(parm)); RETURNFUNC(-RIG_EINVAL); } + RETURNFUNC(-RIG_EINVAL); } /* commit 6e5bc09b2750025885a24d008da8e8ec8fbc0de9 Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Sep 11 05:41:25 2021 -0500 Fix potential buffer underflow in icom.c diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index d889ca57..733a7910 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -1824,6 +1824,7 @@ int icom_set_mode_with_data(RIG *rig, vfo_t vfo, rmode_t mode, rig_debug(RIG_DEBUG_TRACE, "%s: mode/width not changing\n", __func__); RETURNFUNC(RIG_OK); } + // looks like we need to change it switch (mode) @@ -8494,6 +8495,13 @@ int icom_decode_event(RIG *rig) frm_len = retval; + if (frm_len < 1) + { + rig_debug(RIG_DEBUG_ERR, "Unexpected frame len=%d\n", frm_len); + RETURNFUNC(-RIG_EPROTO); + } + + switch (buf[frm_len - 1]) { case COL: diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h index 96637003..9127b6e2 100644 --- a/rigs/icom/icom.h +++ b/rigs/icom/icom.h @@ -30,7 +30,7 @@ #include <sys/time.h> #endif -#define BACKEND_VER "20210907" +#define BACKEND_VER "20210911" #define ICOM_IS_SECONDARY_VFO(vfo) ((vfo) & (RIG_VFO_B | RIG_VFO_SUB | RIG_VFO_SUB_B | RIG_VFO_MAIN_B)) #define ICOM_GET_VFO_NUMBER(vfo) (ICOM_IS_SECONDARY_VFO(vfo) ? 0x01 : 0x00) commit 2706cca64982330322d527544dc9ded95439f32f Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Sep 11 05:38:25 2021 -0500 Fix potential buffer underflow in icom frame.c diff --git a/rigs/icom/frame.c b/rigs/icom/frame.c index 6880df8a..79c67c7c 100644 --- a/rigs/icom/frame.c +++ b/rigs/icom/frame.c @@ -294,6 +294,12 @@ read_another_frame: frm_len = retval; + if (frm_len < 1) + { + rig_debug(RIG_DEBUG_ERR, "Unexpected frame len=%d\n", frm_len); + RETURNFUNC(-RIG_EPROTO); + } + switch (buf[frm_len - 1]) { case COL: commit a5064bc5d98cabe6b3384df988e0e19ca996b596 Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Sep 11 05:35:05 2021 -0500 Fix shadow variable in flrig.c diff --git a/rigs/dummy/netrigctl.c b/rigs/dummy/netrigctl.c index 672c5f7b..af065b60 100644 --- a/rigs/dummy/netrigctl.c +++ b/rigs/dummy/netrigctl.c @@ -756,7 +756,6 @@ static int netrigctl_open(RIG *rig) } else if (strcmp(setting, "ctcss_list") == 0) { - int i; int n; double ctcss[CTCSS_LIST_SIZE]; rig->caps->ctcss_list = calloc(CTCSS_LIST_SIZE, sizeof(tone_t)); @@ -768,7 +767,6 @@ static int netrigctl_open(RIG *rig) } else if (strcmp(setting, "dcs_list") == 0) { - int i; int n; int dcs[DCS_LIST_SIZE + 1]; rig->caps->dcs_list = calloc(DCS_LIST_SIZE, sizeof(tone_t)); commit e21e9b3304c2f5748e83f8beb9005168df8c4a60 Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Sep 11 05:33:22 2021 -0500 Reduce if clause in flrig.c diff --git a/rigs/dummy/flrig.c b/rigs/dummy/flrig.c index 49cd998f..d5864d92 100644 --- a/rigs/dummy/flrig.c +++ b/rigs/dummy/flrig.c @@ -144,7 +144,7 @@ const struct rig_caps flrig_caps = RIG_MODEL(RIG_MODEL_FLRIG), .model_name = "FLRig", .mfg_name = "FLRig", - .version = "202100814", + .version = "202100911", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -804,7 +804,7 @@ static int flrig_open(RIG *rig) int v1, v2, v3, v4; sscanf(value, "%d.%d.%d.%d", &v1, &v2, &v3, &v4); - if (v1 >= 1 || (v1 >= 1 && v2 >= 3) || (v1 >= 1 && v2 >= 3 && v3 >= 54)) + if (v1 >= 1 && v2 >= 3 && v3 >= 54) { priv->has_verify_cmds = 1; rig_debug(RIG_DEBUG_VERBOSE, "%s: verify set_vfoA/ptt is available\n", commit d39daab0df7416dfc3928666f78aab11c302a7ad Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Sep 11 05:13:40 2021 -0500 Remove unused function in ar7030p_utils.c diff --git a/rigs/aor/ar7030p_utils.c b/rigs/aor/ar7030p_utils.c index 47249152..ba44b277 100644 --- a/rigs/aor/ar7030p_utils.c +++ b/rigs/aor/ar7030p_utils.c @@ -947,39 +947,6 @@ int bcd2Int(const unsigned char bcd) return (rc); } -#ifdef XXREMOVEDXX -// this function is not referenced anywhere -/* - * \brief Convert int into 2 digit BCD number - * - * \param int Integer value (0-99) - * - * \return 2 digit BCD equivalent (0-99), 0xff on failure - */ -unsigned char int2BCD(const unsigned int val) -{ - unsigned char rc = (unsigned char) 0xff; - unsigned char tens = (unsigned char)(val / 10); - unsigned char ones = (unsigned char)(val % 10); - - if ((unsigned char) 10 > tens) - { - rc = (tens << 4); - - if ((unsigned char) 10 > ones) - { - rc = rc | ones; - } - else - { - rc = (unsigned char) 0xff; - } - } - - return (rc); -} -#endif - /* * \brief Convert raw AGC value to calibrated level in dBm * commit 04b0e6e40c1d71d84b04ff38585317eb504dff37 Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Sep 11 05:10:07 2021 -0500 Fix responsebuf usage in kpa.c diff --git a/amplifiers/elecraft/kpa.c b/amplifiers/elecraft/kpa.c index fa0ed55a..ac14ef0a 100644 --- a/amplifiers/elecraft/kpa.c +++ b/amplifiers/elecraft/kpa.c @@ -106,7 +106,6 @@ int kpa_transaction(AMP *amp, const char *cmd, char *response, int response_len) struct amp_state *rs; int err; int len = 0; - char responsebuf[KPABUFSZ]; int loop; rig_debug(RIG_DEBUG_VERBOSE, "%s called, cmd=%s\n", __func__, cmd); @@ -127,11 +126,11 @@ int kpa_transaction(AMP *amp, const char *cmd, char *response, int response_len) if (err != RIG_OK) { return err; } - len = read_string(&rs->ampport, responsebuf, KPABUFSZ, ";", 1); + len = read_string(&rs->ampport, response, response_len, ";", 1); if (len < 0) { return len; } } - while (--loop > 0 && (len != 1 || responsebuf[0] != ';')); + while (--loop > 0 && (len != 1 || response[0] != ';')); // Now send our command err = write_block(&rs->ampport, cmd, strlen(cmd)); @@ -140,8 +139,8 @@ int kpa_transaction(AMP *amp, const char *cmd, char *response, int response_len) if (response) // if response expected get it { - responsebuf[0] = 0; - len = read_string(&rs->ampport, responsebuf, KPABUFSZ, ";", 1); + response[0] = 0; + len = read_string(&rs->ampport, response, response_len, ";", 1); if (len < 0) { @@ -151,10 +150,12 @@ int kpa_transaction(AMP *amp, const char *cmd, char *response, int response_len) } rig_debug(RIG_DEBUG_VERBOSE, "%s called, response='%s'\n", __func__, - responsebuf); + response); } else // if no response expected try to get one { + char responsebuf[KPABUFSZ]; + responsebuf[0] = 0; loop = 3; do commit 196884e3b1674ca323af0eb6b1d3d416bba001ce Merge: 6d3046e0 e911471e Author: Michael Black <mdb...@ya...> Date: Fri Sep 10 23:31:51 2021 -0500 Merge pull request #790 from AuroraRAS/keepgoingndk Fix compile-time errors in Android NDK environment commit e911471eae1eb348a4ecd774c30531eff32b6380 Author: 小光 <ch...@gm...> Date: Tue Sep 7 23:07:41 2021 +0800 Update README.android diff --git a/android/README.android b/android/README.android index 3c6a6228..5d7c94c7 100644 --- a/android/README.android +++ b/android/README.android @@ -1,3 +1,6 @@ +Update Note: +These Android NDK scripts can compile the 4.3 version of hamlib normally, but they may be corrupted as the master branch code is updated. If you encounter compile-time errors, please try to fix them, or choose to recompile with version 4.3. + This is android port of hamlib (C) 2012 Ladislav Vaiz <ok...@na...> commit b5bd1f4036bb42ae8b5c05900f51cec60bf2502e Author: AuroraRAS <ch...@gm...> Date: Tue Sep 7 21:30:09 2021 +0800 Append the missing information to build hamlib v4.3 for Android NDK The following errors were fixed in this commit: error: undefined symbol: rig_sprintf_vfo error: undefined symbol: initrots2_radant error: undefined symbol: ts890s_caps diff --git a/Android.mk b/Android.mk index 8b507a90..e59ea0b8 100644 --- a/Android.mk +++ b/Android.mk @@ -48,3 +48,4 @@ include $(TOP_PATH)/rotators/sartek/Android.mk include $(TOP_PATH)/rotators/satel/Android.mk include $(TOP_PATH)/rotators/spid/Android.mk include $(TOP_PATH)/rotators/ts7400/Android.mk +include $(TOP_PATH)/rotators/radant/Android.mk diff --git a/rigs/kenwood/Android.mk b/rigs/kenwood/Android.mk index 80d20a12..9a7d39c9 100644 --- a/rigs/kenwood/Android.mk +++ b/rigs/kenwood/Android.mk @@ -8,7 +8,7 @@ LOCAL_SRC_FILES := ts850.c ts870s.c ts570.c ts450s.c ts950.c ts50s.c \ ts440.c ts940.c ts711.c ts811.c r5000.c \ thd7.c thf7.c thg71.c tmd700.c tmv7.c thf6a.c thd72.c tmd710.c \ kenwood.c th.c ic10.c elecraft.c transfox.c flex6xxx.c ts990s.c \ - xg3.c thd74.c flex.c pihpsdr.c + xg3.c thd74.c flex.c pihpsdr.c ts890s.c LOCAL_MODULE := kenwood LOCAL_CFLAGS := -DHAVE_CONFIG_H diff --git a/rotators/radant/Android.mk b/rotators/radant/Android.mk new file mode 100644 index 00000000..f66b69e9 --- /dev/null +++ b/rotators/radant/Android.mk @@ -0,0 +1,12 @@ +LOCAL_PATH:= $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := radant.c +LOCAL_MODULE := radant + +LOCAL_CFLAGS := -DHAVE_CONFIG_H +LOCAL_C_INCLUDES := android include src +LOCAL_LDLIBS := -lhamlib -Lobj/local/armeabi + +include $(BUILD_STATIC_LIBRARY) diff --git a/src/Android.mk b/src/Android.mk index 21102426..d4a1f315 100644 --- a/src/Android.mk +++ b/src/Android.mk @@ -23,11 +23,12 @@ LOCAL_SRC_FILES := \ parallel.c \ debug.c \ network.c \ - sleep.c \ - gpio.c \ - microham.c \ - rot_ext.c \ - cm108.c + sleep.c \ + gpio.c \ + microham.c \ + rot_ext.c \ + cm108.c \ + sprintflst.c LOCAL_MODULE := libhamlib @@ -38,7 +39,7 @@ LOCAL_STATIC_LIBRARIES := adat alinco amsat aor ars barrett celestron cnctrk \ gs232a heathkit icmarine icom ioptron jrc kachina kenwood kit \ lowe m2 meade pcr prm80 prosistel racal rft \ rotorez rs sartek satel skanti spid tapr tentec ts7400 tuner \ - uniden wj yaesu + uniden wj yaesu radant LOCAL_LDLIBS := -llog commit 84807bc95e3b1e46c3b14ebe49ab3ceb3e24ab59 Author: AuroraRAS <ch...@gm...> Date: Tue Sep 7 21:12:49 2021 +0800 Prepare .gitignore file for NDK build diff --git a/.gitignore b/.gitignore index 3a47008c..f0c6221a 100644 --- a/.gitignore +++ b/.gitignore @@ -60,3 +60,5 @@ tests/rotctld src/hamlibdatetime.h .gdbinit build/ +libs/ +obj/ ----------------------------------------------------------------------- Summary of changes: .gitignore | 3 +++ Android.mk | 1 + amplifiers/elecraft/kpa.c | 13 +++++++------ android/README.android | 3 +++ rigs/aor/ar7030p_utils.c | 33 --------------------------------- rigs/dummy/flrig.c | 4 ++-- rigs/dummy/netrigctl.c | 2 -- rigs/icom/frame.c | 6 ++++++ rigs/icom/icom.c | 14 +++++++++++--- rigs/icom/icom.h | 2 +- rigs/icom/optoscan.c | 2 +- rigs/kenwood/Android.mk | 2 +- rigs/kenwood/flex6xxx.c | 6 +++--- rigs/kenwood/kenwood.c | 5 +++-- rigs/kenwood/kenwood.h | 3 ++- rigs/kenwood/ts890s.c | 1 + rigs/racal/ra37xx.c | 3 +-- rigs/racal/ra37xx.h | 2 +- rigs/tentec/jupiter.c | 4 ++-- rigs/tentec/omnivii.c | 4 ++-- rigs/tentec/rx331.c | 19 ++++++++++++------- rigs/yaesu/ft1000mp.c | 7 +++---- rigs/yaesu/ft817.c | 4 ++-- rotators/{amsat => radant}/Android.mk | 4 ++-- simulators/simelecraft.c | 1 - simulators/simkenwood.c | 2 -- simulators/simyaesu.c | 1 - src/Android.mk | 13 +++++++------ src/amplifier.c | 2 +- src/microham.c | 10 +++++----- src/misc.c | 3 ++- src/misc.h | 2 +- src/network.c | 2 +- src/register.c | 2 +- src/sprintflst.c | 3 ++- 35 files changed, 90 insertions(+), 98 deletions(-) copy rotators/{amsat => radant}/Android.mk (79%) hooks/post-receive -- Hamlib -- Ham radio control libraries |