Merge pull request #796 from N0NB/Hamlib-4.3

Hamlib 4.3
Hamlib-4.3 4.3.1
Nate Bargmann 2021-09-13 18:27:43 -05:00 zatwierdzone przez GitHub
commit bacb20a029
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
20 zmienionych plików z 120 dodań i 26 usunięć

2
.gitignore vendored
Wyświetl plik

@ -60,3 +60,5 @@ tests/rotctld
src/hamlibdatetime.h src/hamlibdatetime.h
.gdbinit .gdbinit
build/ build/
libs/
obj/

Wyświetl plik

@ -48,3 +48,4 @@ include $(TOP_PATH)/rotators/sartek/Android.mk
include $(TOP_PATH)/rotators/satel/Android.mk include $(TOP_PATH)/rotators/satel/Android.mk
include $(TOP_PATH)/rotators/spid/Android.mk include $(TOP_PATH)/rotators/spid/Android.mk
include $(TOP_PATH)/rotators/ts7400/Android.mk include $(TOP_PATH)/rotators/ts7400/Android.mk
include $(TOP_PATH)/rotators/radant/Android.mk

22
NEWS
Wyświetl plik

@ -6,6 +6,28 @@ Copyright (C) 2000-2021 Michael Black W9MDB, and others
Please send Hamlib bug reports to hamlib-developer@lists.sourceforge.net Please send Hamlib bug reports to hamlib-developer@lists.sourceforge.net
Version 4.3.1
* 2021-09-14
* Bug fix release
- Do not do vfo_fixup on satmode rigs
- Fix compilation of misc.c with gmtime_r replacement function for
mingw
- Fix python build. For some reason casting tp vfo_t in the
RIG_VFO_N macro broke the swig parsing
- Append the missing information to build hamlib v4.3 for Android
NDK
- Change set_icom_set_mode_with_data to not change mode unless
necessary
- Since Icom rigs default to filter 2 if a filter is not selected
we will do the same when turning on data mode
- Fix segfault in kenwood_set_vfo
- scripts: Update example in readme, since 4.0 817 is 1020
- Make testlibusb.c compatible with libusb < 1.0.23
Note: On systems with libusb < 1.0.23 a warning will be emmitted
but compliation should proceed without error.
- Update testlibusb.c warning to "may be" instead of "will be"
- Change kenwood to only set VFOA default on 1st rig_open call
Version 4.3 Version 4.3
* 2021-09-01 * 2021-09-01
* libusb-1.0.23 or greater is now required or use --without-libusb * libusb-1.0.23 or greater is now required or use --without-libusb

Wyświetl plik

@ -25,3 +25,7 @@ Here is the list of the brave fellows:
* Chuck Ritola * Chuck Ritola
fclose of fsockin or fsockout when null fclose of fsockin or fsockout when null
https://github.com/Hamlib/Hamlib/issues/757 https://github.com/Hamlib/Hamlib/issues/757
* John Nelson G4KLA 09/2021
kenwood_set_vfo
https://github.com/Hamlib/Hamlib/issues/794

Wyświetl plik

@ -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 This is android port of hamlib
(C) 2012 Ladislav Vaiz <ok1zia@nagano.cz> (C) 2012 Ladislav Vaiz <ok1zia@nagano.cz>

Wyświetl plik

@ -14,7 +14,7 @@ dnl Please do not use '-' in the version number, as package managers will fail,
dnl however, the use of '~' should be fine as apt (others?) will treat dnl however, the use of '~' should be fine as apt (others?) will treat
dnl it as an earlier version than the actual release. TNX KA6MAL dnl it as an earlier version than the actual release. TNX KA6MAL
dnl PACKAGE_NAME + " " + PACKAGE_VERSION must not exceed 20 chars! dnl PACKAGE_NAME + " " + PACKAGE_VERSION must not exceed 20 chars!
AC_INIT([Hamlib],[4.3],[hamlib-developer@lists.sourceforge.net],[hamlib],[http://www.hamlib.org]) AC_INIT([Hamlib],[4.3.1],[hamlib-developer@lists.sourceforge.net],[hamlib],[http://www.hamlib.org])
AC_CONFIG_SRCDIR([include/hamlib/rig.h]) AC_CONFIG_SRCDIR([include/hamlib/rig.h])
AC_CONFIG_MACRO_DIR([macros]) AC_CONFIG_MACRO_DIR([macros])

Wyświetl plik

@ -428,7 +428,7 @@ typedef unsigned int vfo_t;
/** \brief '' -- used in caps */ /** \brief '' -- used in caps */
#define RIG_VFO_N(n) ((vfo_t)(1u<<(n))) #define RIG_VFO_N(n) (1u<<(n))
/** \brief \c VFONone -- vfo unknown */ /** \brief \c VFONone -- vfo unknown */
#define RIG_VFO_NONE 0 #define RIG_VFO_NONE 0

Wyświetl plik

@ -1790,6 +1790,8 @@ int icom_set_mode_with_data(RIG *rig, vfo_t vfo, rmode_t mode,
unsigned char ackbuf[MAXFRAMELEN]; unsigned char ackbuf[MAXFRAMELEN];
int ack_len = sizeof(ackbuf); int ack_len = sizeof(ackbuf);
rmode_t icom_mode; rmode_t icom_mode;
rmode_t tmode;
pbwidth_t twidth;
//struct icom_priv_data *priv = (struct icom_priv_data *) rig->state.priv; //struct icom_priv_data *priv = (struct icom_priv_data *) rig->state.priv;
unsigned char dm_sub_cmd = unsigned char dm_sub_cmd =
rig->caps->rig_model == RIG_MODEL_IC7200 ? 0x04 : S_MEM_DATA_MODE; rig->caps->rig_model == RIG_MODEL_IC7200 ? 0x04 : S_MEM_DATA_MODE;
@ -1807,6 +1809,23 @@ int icom_set_mode_with_data(RIG *rig, vfo_t vfo, rmode_t mode,
ENTERFUNC; ENTERFUNC;
// if our current mode and width is not changing do nothing
retval = rig_get_mode(rig, vfo, &tmode, &twidth);
if (retval != RIG_OK)
{
rig_debug(RIG_DEBUG_ERR, "%s: get_mode failed: %s\n", __func__,
rigerror(retval));
RETURNFUNC(retval);
}
if (tmode == mode && width == RIG_PASSBAND_NOCHANGE)
{
rig_debug(RIG_DEBUG_TRACE, "%s: mode/width not changing\n", __func__);
RETURNFUNC(RIG_OK);
}
// looks like we need to change it
switch (mode) switch (mode)
{ {
@ -1864,12 +1883,12 @@ int icom_set_mode_with_data(RIG *rig, vfo_t vfo, rmode_t mode,
case RIG_MODE_PKTFM: case RIG_MODE_PKTFM:
case RIG_MODE_PKTAM: case RIG_MODE_PKTAM:
datamode[0] = 0x01; datamode[0] = 0x01;
datamode[1] = 0x01; // default to filter 1 datamode[1] = 0x02; // default to filter 2
break; break;
default: default:
datamode[0] = 0x00; datamode[0] = 0x00;
datamode[1] = 0x01; // default to filter 1 datamode[1] = 0x02; // default to filter 2
break; break;
} }

Wyświetl plik

@ -30,7 +30,7 @@
#include <sys/time.h> #include <sys/time.h>
#endif #endif
#define BACKEND_VER "20210828" #define BACKEND_VER "20210907"
#define ICOM_IS_SECONDARY_VFO(vfo) ((vfo) & (RIG_VFO_B | RIG_VFO_SUB | RIG_VFO_SUB_B | RIG_VFO_MAIN_B)) #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) #define ICOM_GET_VFO_NUMBER(vfo) (ICOM_IS_SECONDARY_VFO(vfo) ? 0x01 : 0x00)

Wyświetl plik

@ -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 \ 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 \ 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 \ 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_MODULE := kenwood
LOCAL_CFLAGS := -DHAVE_CONFIG_H LOCAL_CFLAGS := -DHAVE_CONFIG_H

Wyświetl plik

@ -962,10 +962,11 @@ int kenwood_open(RIG *rig)
rig->state.rigport.retry = retry_save; rig->state.rigport.retry = retry_save;
// Default to 1st VFO and split off // Default to 1st VFO and split off -- but only 1 time
if (rig->caps->set_vfo) if (rig->caps->set_vfo && priv->opened == 0)
{ {
rig_set_vfo(rig, vfo_fixup(rig, RIG_VFO_A, 0)); rig_set_vfo(rig, vfo_fixup(rig, RIG_VFO_A, 0));
priv->opened = 1;
} }
RETURNFUNC(RIG_OK); RETURNFUNC(RIG_OK);
@ -1053,7 +1054,7 @@ int kenwood_get_if(RIG *rig)
*/ */
int kenwood_set_vfo(RIG *rig, vfo_t vfo) int kenwood_set_vfo(RIG *rig, vfo_t vfo)
{ {
char cmdbuf[6]; char cmdbuf[12];
int retval; int retval;
char vfo_function; char vfo_function;
struct kenwood_priv_data *priv = rig->state.priv; struct kenwood_priv_data *priv = rig->state.priv;
@ -1231,7 +1232,7 @@ int kenwood_get_vfo_main_sub(RIG *rig, vfo_t *vfo)
int kenwood_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t txvfo) int kenwood_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t txvfo)
{ {
struct kenwood_priv_data *priv = rig->state.priv; struct kenwood_priv_data *priv = rig->state.priv;
char cmdbuf[6]; char cmdbuf[12];
int retval; int retval;
unsigned char vfo_function; unsigned char vfo_function;

Wyświetl plik

@ -28,7 +28,7 @@
#include "token.h" #include "token.h"
#include "misc.h" #include "misc.h"
#define BACKEND_VER "20210829" #define BACKEND_VER "20210911"
#define EOM_KEN ';' #define EOM_KEN ';'
#define EOM_TH '\r' #define EOM_TH '\r'
@ -165,6 +165,7 @@ struct kenwood_priv_data
int is_k4d; int is_k4d;
int is_k4hd; int is_k4hd;
int no_id; // if true will not send ID; with every set command 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
}; };

Wyświetl plik

@ -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)

Wyświetl plik

@ -129,9 +129,9 @@ directory.
In short, the command syntax is of the form: In short, the command syntax is of the form:
rigctl -m 120 -r COM1 -vvvvv rigctl -m 1020 -r COM1 -vvvvv
-m -> Radio model 120, or Yaesu FT-817 (use 'rigctl -l' for a list) -m -> Radio model 1020, or Yaesu FT-817 (use 'rigctl -l' for a list)
-r -> Radio device, in this case COM1 -r -> Radio device, in this case COM1
-v -> Verbosity level. For testing four or five v characters are required. -v -> Verbosity level. For testing four or five v characters are required.
Five 'v's set a debug level of TRACE which generates a lot of screen Five 'v's set a debug level of TRACE which generates a lot of screen

Wyświetl plik

@ -139,9 +139,9 @@ directory.
In short, the command syntax is of the form: In short, the command syntax is of the form:
rigctl -m 120 -r COM1 -vvvvv rigctl -m 1020 -r COM1 -vvvvv
-m -> Radio model 120, or Yaesu FT-817 (use 'rigctl -l' for a list) -m -> Radio model 1020, or Yaesu FT-817 (use 'rigctl -l' for a list)
-r -> Radio device, in this case COM1 -r -> Radio device, in this case COM1
-v -> Verbosity level. For testing four or five v characters are required. -v -> Verbosity level. For testing four or five v characters are required.
Five 'v's set a debug level of TRACE which generates a lot of screen Five 'v's set a debug level of TRACE which generates a lot of screen

Wyświetl plik

@ -129,9 +129,9 @@ directory.
In short, the command syntax is of the form: In short, the command syntax is of the form:
rigctl -m 120 -r COM1 -vvvvv rigctl -m 1020 -r COM1 -vvvvv
-m -> Radio model 120, or Yaesu FT-817 (use 'rigctl -l' for a list) -m -> Radio model 1020, or Yaesu FT-817 (use 'rigctl -l' for a list)
-r -> Radio device, in this case COM1 -r -> Radio device, in this case COM1
-v -> Verbosity level. For testing four or five v characters are required. -v -> Verbosity level. For testing four or five v characters are required.
Five 'v's set a debug level of TRACE which generates a lot of screen Five 'v's set a debug level of TRACE which generates a lot of screen

Wyświetl plik

@ -23,11 +23,12 @@ LOCAL_SRC_FILES := \
parallel.c \ parallel.c \
debug.c \ debug.c \
network.c \ network.c \
sleep.c \ sleep.c \
gpio.c \ gpio.c \
microham.c \ microham.c \
rot_ext.c \ rot_ext.c \
cm108.c cm108.c \
sprintflst.c
LOCAL_MODULE := libhamlib 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 \ gs232a heathkit icmarine icom ioptron jrc kachina kenwood kit \
lowe m2 meade pcr prm80 prosistel racal rft \ lowe m2 meade pcr prm80 prosistel racal rft \
rotorez rs sartek satel skanti spid tapr tentec ts7400 tuner \ rotorez rs sartek satel skanti spid tapr tentec ts7400 tuner \
uniden wj yaesu uniden wj yaesu radant
LOCAL_LDLIBS := -llog LOCAL_LDLIBS := -llog

Wyświetl plik

@ -2346,6 +2346,27 @@ uint32_t CRC32_function(uint8_t *buf, uint32_t len)
return crc ^ 0xFFFFFFFF; return crc ^ 0xFFFFFFFF;
} }
#if defined(_WIN32)
// gmtime_r can be defined by mingw
#ifndef gmtime_r
static struct tm *gmtime_r(const time_t *t, struct tm *r)
{
// gmtime is threadsafe in windows because it uses TLS
struct tm *theTm = gmtime(t);
if (theTm)
{
*r = *theTm;
return r;
}
else
{
return 0;
}
}
#endif // gmtime_r
#endif // _WIN32
//! @cond Doxygen_Suppress //! @cond Doxygen_Suppress
char *date_strget(char *buf, int buflen) char *date_strget(char *buf, int buflen)
{ {

Wyświetl plik

@ -4549,8 +4549,12 @@ int HAMLIB_API rig_set_split_vfo(RIG *rig,
RETURNFUNC(-RIG_ENAVAIL); RETURNFUNC(-RIG_ENAVAIL);
} }
rx_vfo = vfo_fixup(rig, rx_vfo, split); // We fix up vfos for non-satmode rigs
tx_vfo = vfo_fixup(rig, tx_vfo, split); if (!(rig->caps->has_get_func & RIG_FUNC_SATMODE))
{
rx_vfo = vfo_fixup(rig, rx_vfo, split);
tx_vfo = vfo_fixup(rig, tx_vfo, split);
}
// set rig to the the requested RX VFO // set rig to the the requested RX VFO
TRACE; TRACE;

Wyświetl plik

@ -218,7 +218,10 @@ static void print_device(libusb_device *dev, libusb_device_handle *handle)
case LIBUSB_SPEED_SUPER: speed = "5G"; break; case LIBUSB_SPEED_SUPER: speed = "5G"; break;
#if defined(LIBUSB_API_VERSION) && (LIBUSB_API_VERSION >= 0x01000107)
case LIBUSB_SPEED_SUPER_PLUS: speed = "10G"; break; case LIBUSB_SPEED_SUPER_PLUS: speed = "10G"; break;
#endif
default: speed = "Unknown"; default: speed = "Unknown";
} }
@ -340,7 +343,7 @@ static int test_wrapped_device(const char *device_name)
return 0; return 0;
} }
#else #else
#warning LIBUSB-1.0.23 will be required in Hamlib > 4.3 #warning LIBUSB-1.0.23 may be required in Hamlib > 4.3
static int test_wrapped_device(const char *device_name) static int test_wrapped_device(const char *device_name)
{ {
(void)device_name; (void)device_name;