From 697904c882d91c61cf571e3dafa56c0f2e376542 Mon Sep 17 00:00:00 2001 From: George Baltz N3GB Date: Sat, 15 Jun 2024 11:03:58 -0400 Subject: [PATCH] Finish all port initialization before allowing I/O. --- src/rotator.c | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/src/rotator.c b/src/rotator.c index 1968796d6..5e43c1e1d 100644 --- a/src/rotator.c +++ b/src/rotator.c @@ -521,6 +521,27 @@ int HAMLIB_API rot_open(ROT *rot) add_opened_rot(rot); + if (rotp->type.rig != RIG_PORT_NETWORK && rotp->type.rig != RIG_PORT_UDP_NETWORK) + { + if (rotp->parm.serial.dtr_state == RIG_SIGNAL_ON) + { + ser_set_dtr(rotp, 1); + } + else + { + ser_set_dtr(rotp, 0); + } + + if (rotp->parm.serial.rts_state == RIG_SIGNAL_ON) + { + ser_set_rts(rotp, 1); + } + else + { + ser_set_rts(rotp, 0); + } + } + rs->comm_state = 1; /* @@ -555,27 +576,6 @@ int HAMLIB_API rot_open(ROT *rot) } } - if (rotp->type.rig != RIG_PORT_NETWORK && rotp->type.rig != RIG_PORT_UDP_NETWORK) - { - if (rotp->parm.serial.dtr_state == RIG_SIGNAL_ON) - { - ser_set_dtr(rotp, 1); - } - else - { - ser_set_dtr(rotp, 0); - } - - if (rotp->parm.serial.rts_state == RIG_SIGNAL_ON) - { - ser_set_rts(rotp, 1); - } - else - { - ser_set_rts(rotp, 0); - } - } - memcpy(&rs->rotport_deprecated, rotp, sizeof(rs->rotport_deprecated));