[Hamlib-commits] Hamlib -- Ham radio control libraries branch master updated. ad53f2f1e3c5e06d52a21
Library to control radio transceivers and receivers
Brought to you by:
n0nb
|
From: Nate B. <n0...@us...> - 2021-08-21 17:35:06
|
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 ad53f2f1e3c5e06d52a21edcb0bbe499937eda83 (commit)
via c6151c711046b11ad725165bafd7213c12aebb88 (commit)
via df40151d65557a466c11a4946265aac1c614b969 (commit)
from 1f515458fee96be193db95d431813773c41eb08f (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 ad53f2f1e3c5e06d52a21edcb0bbe499937eda83
Author: Mike Black W9MDB <mdb...@ya...>
Date: Sat Aug 21 07:41:48 2021 -0500
Fix typo in serial.c
https://github.com/Hamlib/Hamlib/issues/768
diff --git a/src/serial.c b/src/serial.c
index 871a2a71..57d6eff7 100644
--- a/src/serial.c
+++ b/src/serial.c
@@ -720,7 +720,7 @@ int ser_open(hamlib_port_t *p)
* pathname is not uh_rig or uh_ptt: simply open()
*/
ret = OPEN(p->pathname, O_RDWR | O_NOCTTY | O_NDELAY);
- if (ret == 1) // some serial ports fail to open 1st time
+ if (ret == -1) // some serial ports fail to open 1st time
{
rig_debug(RIG_DEBUG_WARN, "%s(%d): open failed#1\n", __func__, __LINE__);
hl_usleep(500*1000);
commit c6151c711046b11ad725165bafd7213c12aebb88
Author: Mike Black W9MDB <mdb...@ya...>
Date: Fri Aug 20 22:31:11 2021 -0500
Fix error in serial.c
https://github.com/Hamlib/Hamlib/issues/768
diff --git a/src/serial.c b/src/serial.c
index ec28a796..871a2a71 100644
--- a/src/serial.c
+++ b/src/serial.c
@@ -722,7 +722,7 @@ int ser_open(hamlib_port_t *p)
ret = OPEN(p->pathname, O_RDWR | O_NOCTTY | O_NDELAY);
if (ret == 1) // some serial ports fail to open 1st time
{
- rig_debug(RIG_DEBUG_WARN, "%s(d): open failed#1\n", __func__, ___LINE__);
+ rig_debug(RIG_DEBUG_WARN, "%s(%d): open failed#1\n", __func__, __LINE__);
hl_usleep(500*1000);
ret = OPEN(p->pathname, O_RDWR | O_NOCTTY | O_NDELAY);
}
commit df40151d65557a466c11a4946265aac1c614b969
Author: Mike Black W9MDB <mdb...@ya...>
Date: Fri Aug 20 22:29:12 2021 -0500
Add additional attempts to open serial port
K4 was failing on 1st open for some unknown reason but succeeds on 2nd try
https://github.com/Hamlib/Hamlib/issues/768
diff --git a/src/serial.c b/src/serial.c
index dca8c78c..ec28a796 100644
--- a/src/serial.c
+++ b/src/serial.c
@@ -225,20 +225,23 @@ int HAMLIB_API serial_open(hamlib_port_t *rp)
* Open in Non-blocking mode. Watch for EAGAIN errors!
*/
fd = OPEN(rp->pathname, O_RDWR | O_NOCTTY | O_NDELAY);
- if (fd == -1)
- {
- rig_debug(RIG_DEBUG_WARN, "%s: open failed...trying withoud O_NOCTTY\n", __func__);
- fd = OPEN(rp->pathname, O_RDWR | O_NDELAY);
+ if (fd == -1) // some serial ports fail to open 1st time for some unknown reason
+ {
+ rig_debug(RIG_DEBUG_WARN, "%s(%d): open failed#1\n", __func__, __LINE__);
+ hl_usleep(500*1000);
+ fd = OPEN(rp->pathname, O_RDWR | O_NOCTTY | O_NDELAY);
}
if (fd == -1)
{
- rig_debug(RIG_DEBUG_WARN, "%s: open failed...trying withoud O_NDELAY\n", __func__);
- fd = OPEN(rp->pathname, O_RDWR | O_NOCTTY );
+ rig_debug(RIG_DEBUG_WARN, "%s(%d): open failed#2\n", __func__, __LINE__);
+ hl_usleep(500*1000);
+ fd = OPEN(rp->pathname, O_RDWR | O_NOCTTY | O_NDELAY);
}
if (fd == -1)
{
- rig_debug(RIG_DEBUG_WARN, "%s: open failed...trying withoud O_NDELAY and O_NOCTTY\n", __func__);
- fd = OPEN(rp->pathname, O_RDWR);
+ rig_debug(RIG_DEBUG_WARN, "%s(%d): open failed#3\n", __func__, __LINE__);
+ hl_usleep(500*1000);
+ fd = OPEN(rp->pathname, O_RDWR | O_NOCTTY | O_NDELAY);
}
if (fd == -1)
@@ -717,6 +720,12 @@ int ser_open(hamlib_port_t *p)
* pathname is not uh_rig or uh_ptt: simply open()
*/
ret = OPEN(p->pathname, O_RDWR | O_NOCTTY | O_NDELAY);
+ if (ret == 1) // some serial ports fail to open 1st time
+ {
+ rig_debug(RIG_DEBUG_WARN, "%s(d): open failed#1\n", __func__, ___LINE__);
+ hl_usleep(500*1000);
+ ret = OPEN(p->pathname, O_RDWR | O_NOCTTY | O_NDELAY);
+ }
}
}
-----------------------------------------------------------------------
Summary of changes:
src/serial.c | 25 +++++++++++++++++--------
1 file changed, 17 insertions(+), 8 deletions(-)
hooks/post-receive
--
Hamlib -- Ham radio control libraries
|