[Hamlib-commits] Hamlib -- Ham radio control libraries branch master updated. 6cc8e5a20fd1d50b80af7
Library to control radio transceivers and receivers
Brought to you by:
n0nb
From: Michael B. <mdb...@us...> - 2021-03-27 22:42:24
|
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 6cc8e5a20fd1d50b80af720a627e72fe978d1c95 (commit) via 753cd792d34ae966fc2b0507540c739ccdd25cf2 (commit) via 3bcdb1c005061cc2fdf678f47660d41d2029a057 (commit) from c0d11bc8b65ff8a23f914b6198d2d7ffbab5091e (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 6cc8e5a20fd1d50b80af720a627e72fe978d1c95 Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Mar 27 15:35:12 2021 -0500 Change LIBUSB definitions to cover both conditions https://github.com/Hamlib/Hamlib/issues/634 diff --git a/src/iofunc.c b/src/iofunc.c index 722b629e..aefa48df 100644 --- a/src/iofunc.c +++ b/src/iofunc.c @@ -149,7 +149,7 @@ int HAMLIB_API port_open(hamlib_port_t *p) p->fd = status; break; -#ifdef HAVE_LIBUSB_H +#if defined(HAVE_LIBUSB_H) || defined (HAVE_LIBUSB_1_0_LIBUSB_H) case RIG_PORT_USB: status = usb_port_open(p); @@ -206,7 +206,7 @@ int HAMLIB_API port_close(hamlib_port_t *p, rig_port_t port_type) ret = ser_close(p); break; -#ifdef HAVE_LIBUSB_H +#if defined(HAVE_LIBUSB_H) || defined (HAVE_LIBUSB_1_0_LIBUSB_H) case RIG_PORT_USB: ret = usb_port_close(p); @@ -255,7 +255,7 @@ static ssize_t port_read(hamlib_port_t *p, void *buf, size_t count) */ if (is_uh_radio_fd(p->fd)) { - return( read(p->fd, buf, count); + return read(p->fd, buf, count); } if (p->type.rig == RIG_PORT_SERIAL) @@ -273,7 +273,7 @@ static ssize_t port_read(hamlib_port_t *p, void *buf, size_t count) } } - RETURNFUNC( ret; + RETURNFUNC(ret); } else if (p->type.rig == RIG_PORT_NETWORK || p->type.rig == RIG_PORT_UDP_NETWORK) diff --git a/src/rotator.c b/src/rotator.c index 51787ea7..aec502e0 100644 --- a/src/rotator.c +++ b/src/rotator.c @@ -61,7 +61,7 @@ #include <hamlib/rotator.h> #include "serial.h" #include "parallel.h" -#ifdef HAVE_LIBUSB_H +#if defined(HAVE_LIB_USB_H) || defined(HAMB_LIBUSB_1_0_LIBUSB_H) #include "usb_port.h" #endif #include "network.h" @@ -418,7 +418,7 @@ int HAMLIB_API rot_open(ROT *rot) rs->rotport.fd = status; break; -#ifdef HAVE_LIBUSB_H +#if defined(HAVE_LIB_USB_H) || defined(HAMB_LIBUSB_1_0_LIBUSB_H) case RIG_PORT_USB: status = usb_port_open(&rs->rotport); @@ -531,7 +531,7 @@ int HAMLIB_API rot_close(ROT *rot) par_close(&rs->rotport); break; -#ifdef HAVE_LIBUSB_H +#if defined(HAVE_LIB_USB_H) || defined(HAMB_LIBUSB_1_0_LIBUSB_H) case RIG_PORT_USB: usb_port_close(&rs->rotport); commit 753cd792d34ae966fc2b0507540c739ccdd25cf2 Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Mar 27 15:17:52 2021 -0500 Add debug to iofunc.c https://github.com/Hamlib/Hamlib/issues/635 diff --git a/src/iofunc.c b/src/iofunc.c index b79bcd5c..722b629e 100644 --- a/src/iofunc.c +++ b/src/iofunc.c @@ -64,8 +64,8 @@ int HAMLIB_API port_open(hamlib_port_t *p) { int status; int want_state_delay = 0; - - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + + ENTERFUNC; p->fd = -1; @@ -76,7 +76,8 @@ int HAMLIB_API port_open(hamlib_port_t *p) if (status < 0) { - return status; + rig_debug(RIG_DEBUG_ERR, "%s: serial_open status=%d\n", __func__, status); + RETURNFUNC(status); } if (p->parm.serial.rts_state != RIG_SIGNAL_UNSET @@ -89,7 +90,8 @@ int HAMLIB_API port_open(hamlib_port_t *p) if (status != 0) { - return status; + rig_debug(RIG_DEBUG_ERR, "%s: set_rts status=%d\n", __func__, status); + RETURNFUNC(status); } if (p->parm.serial.dtr_state != RIG_SIGNAL_UNSET) @@ -101,7 +103,8 @@ int HAMLIB_API port_open(hamlib_port_t *p) if (status != 0) { - return status; + rig_debug(RIG_DEBUG_ERR, "%s: set_dtr status=%d\n", __func__, status); + RETURNFUNC(status); } /* @@ -120,7 +123,7 @@ int HAMLIB_API port_open(hamlib_port_t *p) if (status < 0) { - return status; + RETURNFUNC(status); } break; @@ -130,7 +133,7 @@ int HAMLIB_API port_open(hamlib_port_t *p) if (status < 0) { - return status; + RETURNFUNC(status); } break; @@ -140,7 +143,7 @@ int HAMLIB_API port_open(hamlib_port_t *p) if (status < 0) { - return -RIG_EIO; + RETURNFUNC(-RIG_EIO); } p->fd = status; @@ -153,7 +156,7 @@ int HAMLIB_API port_open(hamlib_port_t *p) if (status < 0) { - return status; + RETURNFUNC(status); } break; @@ -170,16 +173,16 @@ int HAMLIB_API port_open(hamlib_port_t *p) if (status < 0) { - return status; + RETURNFUNC(status); } break; default: - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } - return RIG_OK; + RETURNFUNC(RIG_OK); } @@ -193,7 +196,7 @@ int HAMLIB_API port_close(hamlib_port_t *p, rig_port_t port_type) { int ret = RIG_OK; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; if (p->fd != -1) { @@ -227,7 +230,7 @@ int HAMLIB_API port_close(hamlib_port_t *p, rig_port_t port_type) p->fd = -1; } - return ret; + RETURNFUNC(ret); } @@ -252,7 +255,7 @@ static ssize_t port_read(hamlib_port_t *p, void *buf, size_t count) */ if (is_uh_radio_fd(p->fd)) { - return read(p->fd, buf, count); + return( read(p->fd, buf, count); } if (p->type.rig == RIG_PORT_SERIAL) @@ -270,7 +273,7 @@ static ssize_t port_read(hamlib_port_t *p, void *buf, size_t count) } } - return ret; + RETURNFUNC( ret; } else if (p->type.rig == RIG_PORT_NETWORK || p->type.rig == RIG_PORT_UDP_NETWORK) commit 3bcdb1c005061cc2fdf678f47660d41d2029a057 Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Mar 27 14:55:38 2021 -0500 FIx RFPOWER in kenwood.c so read scale matches input scale https://github.com/Hamlib/Hamlib/issues/630 diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index ece488e2..93d556eb 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -2805,7 +2805,7 @@ int kenwood_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) retval = kenwood_get_power_minmax(rig, &power_now, &power_min, &power_max, 1); if (retval != RIG_OK) { RETURNFUNC(retval); } - + power_min = 0; // our return scale is 0-max to match the input scale val->f = (power_now - power_min) / (float)(power_max - power_min); RETURNFUNC(RIG_OK); ----------------------------------------------------------------------- Summary of changes: rigs/kenwood/kenwood.c | 2 +- src/iofunc.c | 37 ++++++++++++++++++++----------------- src/rotator.c | 6 +++--- 3 files changed, 24 insertions(+), 21 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |