Michael Black W9MDB 2021-03-27 15:17:52 -05:00
rodzic 3bcdb1c005
commit 753cd792d3
1 zmienionych plików z 19 dodań i 16 usunięć

Wyświetl plik

@ -64,8 +64,8 @@ int HAMLIB_API port_open(hamlib_port_t *p)
{ {
int status; int status;
int want_state_delay = 0; int want_state_delay = 0;
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); ENTERFUNC;
p->fd = -1; p->fd = -1;
@ -76,7 +76,8 @@ int HAMLIB_API port_open(hamlib_port_t *p)
if (status < 0) 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 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) 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) 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) 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) if (status < 0)
{ {
return status; RETURNFUNC(status);
} }
break; break;
@ -130,7 +133,7 @@ int HAMLIB_API port_open(hamlib_port_t *p)
if (status < 0) if (status < 0)
{ {
return status; RETURNFUNC(status);
} }
break; break;
@ -140,7 +143,7 @@ int HAMLIB_API port_open(hamlib_port_t *p)
if (status < 0) if (status < 0)
{ {
return -RIG_EIO; RETURNFUNC(-RIG_EIO);
} }
p->fd = status; p->fd = status;
@ -153,7 +156,7 @@ int HAMLIB_API port_open(hamlib_port_t *p)
if (status < 0) if (status < 0)
{ {
return status; RETURNFUNC(status);
} }
break; break;
@ -170,16 +173,16 @@ int HAMLIB_API port_open(hamlib_port_t *p)
if (status < 0) if (status < 0)
{ {
return status; RETURNFUNC(status);
} }
break; break;
default: 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; int ret = RIG_OK;
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); ENTERFUNC;
if (p->fd != -1) 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; 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)) 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) 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 else if (p->type.rig == RIG_PORT_NETWORK
|| p->type.rig == RIG_PORT_UDP_NETWORK) || p->type.rig == RIG_PORT_UDP_NETWORK)