From 1532a7d8dc4baea6b00ceb6868d572e66c69d44d Mon Sep 17 00:00:00 2001 From: George Baltz N3GB Date: Thu, 18 Jan 2024 18:29:56 -0500 Subject: [PATCH] Convert rot_conf.c and amp_conf.c to pointers Consolidate some assignments to make deprecation easier. Issues #1445, #487 --- src/amp_conf.c | 112 +++++++++++++++++++++++------------------------ src/rot_conf.c | 115 ++++++++++++++++++++++++------------------------- 2 files changed, 110 insertions(+), 117 deletions(-) diff --git a/src/amp_conf.c b/src/amp_conf.c index 1ae86f905..e6a734a5a 100644 --- a/src/amp_conf.c +++ b/src/amp_conf.c @@ -18,6 +18,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ /** * \addtogroup amplifier @@ -108,6 +109,7 @@ static const struct confparams ampfrontend_serial_cfg_params[] = int frontamp_set_conf(AMP *amp, hamlib_token_t token, const char *val) { struct amp_state *rs; + hamlib_port_t *ampp = AMPPORT(amp); int val_i; rs = &->state; @@ -117,7 +119,7 @@ int frontamp_set_conf(AMP *amp, hamlib_token_t token, const char *val) switch (token) { case TOK_PATHNAME: - strncpy(rs->ampport.pathname, val, HAMLIB_FILPATHLEN - 1); + strncpy(ampp->pathname, val, HAMLIB_FILPATHLEN - 1); strncpy(rs->ampport_deprecated.pathname, val, HAMLIB_FILPATHLEN - 1); break; @@ -127,7 +129,7 @@ int frontamp_set_conf(AMP *amp, hamlib_token_t token, const char *val) return -RIG_EINVAL; } - rs->ampport.write_delay = val_i; + ampp->write_delay = val_i; rs->ampport_deprecated.write_delay = val_i; break; @@ -137,7 +139,7 @@ int frontamp_set_conf(AMP *amp, hamlib_token_t token, const char *val) return -RIG_EINVAL; } - rs->ampport.post_write_delay = val_i; + ampp->post_write_delay = val_i; rs->ampport_deprecated.post_write_delay = val_i; break; @@ -147,7 +149,7 @@ int frontamp_set_conf(AMP *amp, hamlib_token_t token, const char *val) return -RIG_EINVAL; } - rs->ampport.timeout = val_i; + ampp->timeout = val_i; rs->ampport_deprecated.timeout = val_i; break; @@ -157,12 +159,12 @@ int frontamp_set_conf(AMP *amp, hamlib_token_t token, const char *val) return -RIG_EINVAL; } - rs->ampport.retry = val_i; + ampp->retry = val_i; rs->ampport_deprecated.retry = val_i; break; case TOK_SERIAL_SPEED: - if (rs->ampport.type.rig != RIG_PORT_SERIAL) + if (ampp->type.rig != RIG_PORT_SERIAL) { return -RIG_EINVAL; } @@ -172,12 +174,12 @@ int frontamp_set_conf(AMP *amp, hamlib_token_t token, const char *val) return -RIG_EINVAL; } - rs->ampport.parm.serial.rate = val_i; + ampp->parm.serial.rate = val_i; rs->ampport_deprecated.parm.serial.rate = val_i; break; case TOK_DATA_BITS: - if (rs->ampport.type.rig != RIG_PORT_SERIAL) + if (ampp->type.rig != RIG_PORT_SERIAL) { return -RIG_EINVAL; } @@ -187,12 +189,12 @@ int frontamp_set_conf(AMP *amp, hamlib_token_t token, const char *val) return -RIG_EINVAL; } - rs->ampport.parm.serial.data_bits = val_i; + ampp->parm.serial.data_bits = val_i; rs->ampport_deprecated.parm.serial.data_bits = val_i; break; case TOK_STOP_BITS: - if (rs->ampport.type.rig != RIG_PORT_SERIAL) + if (ampp->type.rig != RIG_PORT_SERIAL) { return -RIG_EINVAL; } @@ -202,127 +204,123 @@ int frontamp_set_conf(AMP *amp, hamlib_token_t token, const char *val) return -RIG_EINVAL; } - rs->ampport.parm.serial.stop_bits = val_i; + ampp->parm.serial.stop_bits = val_i; rs->ampport_deprecated.parm.serial.stop_bits = val_i; break; case TOK_PARITY: - if (rs->ampport.type.rig != RIG_PORT_SERIAL) + if (ampp->type.rig != RIG_PORT_SERIAL) { return -RIG_EINVAL; } if (!strcmp(val, "None")) { - rs->ampport.parm.serial.parity = RIG_PARITY_NONE; - rs->ampport_deprecated.parm.serial.parity = RIG_PARITY_NONE; + val_i = RIG_PARITY_NONE; } else if (!strcmp(val, "Odd")) { - rs->ampport.parm.serial.parity = RIG_PARITY_ODD; - rs->ampport_deprecated.parm.serial.parity = RIG_PARITY_ODD; + val_i = RIG_PARITY_ODD; } else if (!strcmp(val, "Even")) { - rs->ampport.parm.serial.parity = RIG_PARITY_EVEN; - rs->ampport_deprecated.parm.serial.parity = RIG_PARITY_EVEN; + val_i = RIG_PARITY_EVEN; } else if (!strcmp(val, "Mark")) { - rs->ampport.parm.serial.parity = RIG_PARITY_MARK; - rs->ampport_deprecated.parm.serial.parity = RIG_PARITY_MARK; + val_i = RIG_PARITY_MARK; } else if (!strcmp(val, "Space")) { - rs->ampport.parm.serial.parity = RIG_PARITY_SPACE; - rs->ampport_deprecated.parm.serial.parity = RIG_PARITY_SPACE; + val_i = RIG_PARITY_SPACE; } else { return -RIG_EINVAL; } + ampp->parm.serial.parity = val_i; + rs->ampport_deprecated.parm.serial.parity = val_i; break; case TOK_HANDSHAKE: - if (rs->ampport.type.rig != RIG_PORT_SERIAL) + if (ampp->type.rig != RIG_PORT_SERIAL) { return -RIG_EINVAL; } if (!strcmp(val, "None")) { - rs->ampport.parm.serial.handshake = RIG_HANDSHAKE_NONE; + val_i = RIG_HANDSHAKE_NONE; } else if (!strcmp(val, "XONXOFF")) { - rs->ampport.parm.serial.handshake = RIG_HANDSHAKE_XONXOFF; + val_i = RIG_HANDSHAKE_XONXOFF; } else if (!strcmp(val, "Hardware")) { - rs->ampport.parm.serial.handshake = RIG_HANDSHAKE_HARDWARE; + val_i = RIG_HANDSHAKE_HARDWARE; } else { return -RIG_EINVAL; } + ampp->parm.serial.handshake = val_i; break; case TOK_RTS_STATE: - if (rs->ampport.type.rig != RIG_PORT_SERIAL) + if (ampp->type.rig != RIG_PORT_SERIAL) { return -RIG_EINVAL; } if (!strcmp(val, "Unset")) { - rs->ampport.parm.serial.rts_state = RIG_SIGNAL_UNSET; - rs->ampport_deprecated.parm.serial.rts_state = RIG_SIGNAL_UNSET; + val_i = RIG_SIGNAL_UNSET; } else if (!strcmp(val, "ON")) { - rs->ampport.parm.serial.rts_state = RIG_SIGNAL_ON; - rs->ampport_deprecated.parm.serial.rts_state = RIG_SIGNAL_ON; + val_i = RIG_SIGNAL_ON; } else if (!strcmp(val, "OFF")) { - rs->ampport.parm.serial.rts_state = RIG_SIGNAL_OFF; - rs->ampport_deprecated.parm.serial.rts_state = RIG_SIGNAL_OFF; + val_i = RIG_SIGNAL_OFF; } else { return -RIG_EINVAL; } + ampp->parm.serial.rts_state = val_i; + rs->ampport_deprecated.parm.serial.rts_state = val_i; break; case TOK_DTR_STATE: - if (rs->ampport.type.rig != RIG_PORT_SERIAL) + if (ampp->type.rig != RIG_PORT_SERIAL) { return -RIG_EINVAL; } if (!strcmp(val, "Unset")) { - rs->ampport.parm.serial.dtr_state = RIG_SIGNAL_UNSET; - rs->ampport_deprecated.parm.serial.dtr_state = RIG_SIGNAL_UNSET; + val_i = RIG_SIGNAL_UNSET; } else if (!strcmp(val, "ON")) { - rs->ampport.parm.serial.dtr_state = RIG_SIGNAL_ON; - rs->ampport_deprecated.parm.serial.dtr_state = RIG_SIGNAL_ON; + val_i = RIG_SIGNAL_ON; } else if (!strcmp(val, "OFF")) { - rs->ampport.parm.serial.dtr_state = RIG_SIGNAL_OFF; - rs->ampport_deprecated.parm.serial.dtr_state = RIG_SIGNAL_OFF; + val_i = RIG_SIGNAL_OFF; } else { return -RIG_EINVAL; } + ampp->parm.serial.dtr_state = val_i; + rs->ampport_deprecated.parm.serial.dtr_state = val_i; break; @@ -373,69 +371,67 @@ int frontamp_set_conf(AMP *amp, hamlib_token_t token, const char *val) */ int frontamp_get_conf2(AMP *amp, hamlib_token_t token, char *val, int val_len) { - struct amp_state *rs; + hamlib_port_t *ampp = AMPPORT(amp); const char *s; - rs = &->state; - amp_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); switch (token) { case TOK_PATHNAME: - strncpy(val, rs->ampport.pathname, val_len - 1); + strncpy(val, ampp->pathname, val_len - 1); break; case TOK_WRITE_DELAY: - SNPRINTF(val, val_len, "%d", rs->ampport.write_delay); + SNPRINTF(val, val_len, "%d", ampp->write_delay); break; case TOK_POST_WRITE_DELAY: - SNPRINTF(val, val_len, "%d", rs->ampport.post_write_delay); + SNPRINTF(val, val_len, "%d", ampp->post_write_delay); break; case TOK_TIMEOUT: - SNPRINTF(val, val_len, "%d", rs->ampport.timeout); + SNPRINTF(val, val_len, "%d", ampp->timeout); break; case TOK_RETRY: - SNPRINTF(val, val_len, "%d", rs->ampport.retry); + SNPRINTF(val, val_len, "%d", ampp->retry); break; case TOK_SERIAL_SPEED: - if (rs->ampport.type.rig != RIG_PORT_SERIAL) + if (ampp->type.rig != RIG_PORT_SERIAL) { return -RIG_EINVAL; } - SNPRINTF(val, val_len, "%d", rs->ampport.parm.serial.rate); + SNPRINTF(val, val_len, "%d", ampp->parm.serial.rate); break; case TOK_DATA_BITS: - if (rs->ampport.type.rig != RIG_PORT_SERIAL) + if (ampp->type.rig != RIG_PORT_SERIAL) { return -RIG_EINVAL; } - SNPRINTF(val, val_len, "%d", rs->ampport.parm.serial.data_bits); + SNPRINTF(val, val_len, "%d", ampp->parm.serial.data_bits); break; case TOK_STOP_BITS: - if (rs->ampport.type.rig != RIG_PORT_SERIAL) + if (ampp->type.rig != RIG_PORT_SERIAL) { return -RIG_EINVAL; } - SNPRINTF(val, val_len, "%d", rs->ampport.parm.serial.stop_bits); + SNPRINTF(val, val_len, "%d", ampp->parm.serial.stop_bits); break; case TOK_PARITY: - if (rs->ampport.type.rig != RIG_PORT_SERIAL) + if (ampp->type.rig != RIG_PORT_SERIAL) { return -RIG_EINVAL; } - switch (rs->ampport.parm.serial.parity) + switch (ampp->parm.serial.parity) { case RIG_PARITY_NONE: s = "None"; @@ -465,12 +461,12 @@ int frontamp_get_conf2(AMP *amp, hamlib_token_t token, char *val, int val_len) break; case TOK_HANDSHAKE: - if (rs->ampport.type.rig != RIG_PORT_SERIAL) + if (ampp->type.rig != RIG_PORT_SERIAL) { return -RIG_EINVAL; } - switch (rs->ampport.parm.serial.handshake) + switch (ampp->parm.serial.handshake) { case RIG_HANDSHAKE_NONE: s = "None"; diff --git a/src/rot_conf.c b/src/rot_conf.c index bc7fc20a4..89a616382 100644 --- a/src/rot_conf.c +++ b/src/rot_conf.c @@ -18,6 +18,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ /** * \addtogroup rotator @@ -139,6 +140,7 @@ static const struct confparams rotfrontend_serial_cfg_params[] = int frontrot_set_conf(ROT *rot, hamlib_token_t token, const char *val) { struct rot_state *rs; + hamlib_port_t *rotp = ROTPORT(rot); int val_i; rs = &rot->state; @@ -148,7 +150,7 @@ int frontrot_set_conf(ROT *rot, hamlib_token_t token, const char *val) switch (token) { case TOK_PATHNAME: - strncpy(rs->rotport.pathname, val, HAMLIB_FILPATHLEN - 1); + strncpy(rotp->pathname, val, HAMLIB_FILPATHLEN - 1); strncpy(rs->rotport_deprecated.pathname, val, HAMLIB_FILPATHLEN - 1); break; @@ -158,7 +160,7 @@ int frontrot_set_conf(ROT *rot, hamlib_token_t token, const char *val) return -RIG_EINVAL; } - rs->rotport.write_delay = val_i; + rotp->write_delay = val_i; rs->rotport_deprecated.write_delay = val_i; break; @@ -168,7 +170,7 @@ int frontrot_set_conf(ROT *rot, hamlib_token_t token, const char *val) return -RIG_EINVAL; } - rs->rotport.post_write_delay = val_i; + rotp->post_write_delay = val_i; rs->rotport_deprecated.post_write_delay = val_i; break; @@ -178,7 +180,7 @@ int frontrot_set_conf(ROT *rot, hamlib_token_t token, const char *val) return -RIG_EINVAL; } - rs->rotport.timeout = val_i; + rotp->timeout = val_i; rs->rotport_deprecated.timeout = val_i; break; @@ -188,12 +190,12 @@ int frontrot_set_conf(ROT *rot, hamlib_token_t token, const char *val) return -RIG_EINVAL; } - rs->rotport.retry = val_i; + rotp->retry = val_i; rs->rotport_deprecated.retry = val_i; break; case TOK_SERIAL_SPEED: - if (rs->rotport.type.rig != RIG_PORT_SERIAL) + if (rotp->type.rig != RIG_PORT_SERIAL) { return -RIG_EINVAL; } @@ -203,12 +205,12 @@ int frontrot_set_conf(ROT *rot, hamlib_token_t token, const char *val) return -RIG_EINVAL; } - rs->rotport.parm.serial.rate = val_i; + rotp->parm.serial.rate = val_i; rs->rotport_deprecated.parm.serial.rate = val_i; break; case TOK_DATA_BITS: - if (rs->rotport.type.rig != RIG_PORT_SERIAL) + if (rotp->type.rig != RIG_PORT_SERIAL) { return -RIG_EINVAL; } @@ -218,12 +220,12 @@ int frontrot_set_conf(ROT *rot, hamlib_token_t token, const char *val) return -RIG_EINVAL; } - rs->rotport.parm.serial.data_bits = val_i; + rotp->parm.serial.data_bits = val_i; rs->rotport_deprecated.parm.serial.data_bits = val_i; break; case TOK_STOP_BITS: - if (rs->rotport.type.rig != RIG_PORT_SERIAL) + if (rotp->type.rig != RIG_PORT_SERIAL) { return -RIG_EINVAL; } @@ -233,78 +235,74 @@ int frontrot_set_conf(ROT *rot, hamlib_token_t token, const char *val) return -RIG_EINVAL; } - rs->rotport.parm.serial.stop_bits = val_i; + rotp->parm.serial.stop_bits = val_i; rs->rotport_deprecated.parm.serial.stop_bits = val_i; break; case TOK_PARITY: - if (rs->rotport.type.rig != RIG_PORT_SERIAL) + if (rotp->type.rig != RIG_PORT_SERIAL) { return -RIG_EINVAL; } if (!strcmp(val, "None")) { - rs->rotport.parm.serial.parity = RIG_PARITY_NONE; - rs->rotport_deprecated.parm.serial.parity = RIG_PARITY_NONE; + val_i = RIG_PARITY_NONE; } else if (!strcmp(val, "Odd")) { - rs->rotport.parm.serial.parity = RIG_PARITY_ODD; - rs->rotport_deprecated.parm.serial.parity = RIG_PARITY_ODD; + val_i = RIG_PARITY_ODD; } else if (!strcmp(val, "Even")) { - rs->rotport.parm.serial.parity = RIG_PARITY_EVEN; - rs->rotport_deprecated.parm.serial.parity = RIG_PARITY_EVEN; + val_i = RIG_PARITY_EVEN; } else if (!strcmp(val, "Mark")) { - rs->rotport.parm.serial.parity = RIG_PARITY_MARK; - rs->rotport_deprecated.parm.serial.parity = RIG_PARITY_MARK; + val_i = RIG_PARITY_MARK; } else if (!strcmp(val, "Space")) { - rs->rotport.parm.serial.parity = RIG_PARITY_SPACE; - rs->rotport_deprecated.parm.serial.parity = RIG_PARITY_SPACE; + val_i = RIG_PARITY_SPACE; } else { return -RIG_EINVAL; } + rotp->parm.serial.parity = val_i; + rs->rotport_deprecated.parm.serial.parity = val_i; break; case TOK_HANDSHAKE: - if (rs->rotport.type.rig != RIG_PORT_SERIAL) + if (rotp->type.rig != RIG_PORT_SERIAL) { return -RIG_EINVAL; } if (!strcmp(val, "None")) { - rs->rotport.parm.serial.handshake = RIG_HANDSHAKE_NONE; - rs->rotport_deprecated.parm.serial.handshake = RIG_HANDSHAKE_NONE; + val_i = RIG_HANDSHAKE_NONE; } else if (!strcmp(val, "XONXOFF")) { - rs->rotport.parm.serial.handshake = RIG_HANDSHAKE_XONXOFF; - rs->rotport_deprecated.parm.serial.handshake = RIG_HANDSHAKE_XONXOFF; + val_i = RIG_HANDSHAKE_XONXOFF; } else if (!strcmp(val, "Hardware")) { - rs->rotport.parm.serial.handshake = RIG_HANDSHAKE_HARDWARE; - rs->rotport_deprecated.parm.serial.handshake = RIG_HANDSHAKE_HARDWARE; + val_i = RIG_HANDSHAKE_HARDWARE; } else { return -RIG_EINVAL; } + rotp->parm.serial.handshake = val_i; + rs->rotport_deprecated.parm.serial.handshake = val_i; break; case TOK_FLUSHX: - rs->rotport.flushx = atoi(val); + rotp->flushx = atoi(val); rs->rotport_deprecated.flushx = atoi(val); break; @@ -330,59 +328,57 @@ int frontrot_set_conf(ROT *rot, hamlib_token_t token, const char *val) case TOK_RTS_STATE: - if (rs->rotport.type.rig != RIG_PORT_SERIAL) + if (rotp->type.rig != RIG_PORT_SERIAL) { return -RIG_EINVAL; } if (!strcmp(val, "Unset")) { - rs->rotport.parm.serial.rts_state = RIG_SIGNAL_UNSET; - rs->rotport_deprecated.parm.serial.rts_state = RIG_SIGNAL_UNSET; + val_i = RIG_SIGNAL_UNSET; } else if (!strcmp(val, "ON")) { - rs->rotport.parm.serial.rts_state = RIG_SIGNAL_ON; - rs->rotport_deprecated.parm.serial.rts_state = RIG_SIGNAL_ON; + val_i = RIG_SIGNAL_ON; } else if (!strcmp(val, "OFF")) { - rs->rotport.parm.serial.rts_state = RIG_SIGNAL_OFF; - rs->rotport_deprecated.parm.serial.rts_state = RIG_SIGNAL_OFF; + val_i = RIG_SIGNAL_OFF; } else { return -RIG_EINVAL; } + rotp->parm.serial.rts_state = val_i; + rs->rotport_deprecated.parm.serial.rts_state = val_i; break; case TOK_DTR_STATE: - if (rs->rotport.type.rig != RIG_PORT_SERIAL) + if (rotp->type.rig != RIG_PORT_SERIAL) { return -RIG_EINVAL; } if (!strcmp(val, "Unset")) { - rs->rotport.parm.serial.dtr_state = RIG_SIGNAL_UNSET; - rs->rotport_deprecated.parm.serial.dtr_state = RIG_SIGNAL_UNSET; + val_i = RIG_SIGNAL_UNSET; } else if (!strcmp(val, "ON")) { - rs->rotport.parm.serial.dtr_state = RIG_SIGNAL_ON; - rs->rotport_deprecated.parm.serial.dtr_state = RIG_SIGNAL_ON; + val_i = RIG_SIGNAL_ON; } else if (!strcmp(val, "OFF")) { - rs->rotport.parm.serial.dtr_state = RIG_SIGNAL_OFF; - rs->rotport_deprecated.parm.serial.dtr_state = RIG_SIGNAL_OFF; + val_i = RIG_SIGNAL_OFF; } else { return -RIG_EINVAL; } + rotp->parm.serial.dtr_state = val_i; + rs->rotport_deprecated.parm.serial.dtr_state = val_i; break; @@ -413,6 +409,7 @@ int frontrot_set_conf(ROT *rot, hamlib_token_t token, const char *val) int frontrot_get_conf(ROT *rot, hamlib_token_t token, char *val, int val_len) { struct rot_state *rs; + hamlib_port_t *rotp = ROTPORT(rot); const char *s; rs = &rot->state; @@ -422,59 +419,59 @@ int frontrot_get_conf(ROT *rot, hamlib_token_t token, char *val, int val_len) switch (token) { case TOK_PATHNAME: - strncpy(val, rs->rotport.pathname, val_len - 1); + strncpy(val, rotp->pathname, val_len - 1); break; case TOK_WRITE_DELAY: - SNPRINTF(val, val_len, "%d", rs->rotport.write_delay); + SNPRINTF(val, val_len, "%d", rotp->write_delay); break; case TOK_POST_WRITE_DELAY: - SNPRINTF(val, val_len, "%d", rs->rotport.post_write_delay); + SNPRINTF(val, val_len, "%d", rotp->post_write_delay); break; case TOK_TIMEOUT: - SNPRINTF(val, val_len, "%d", rs->rotport.timeout); + SNPRINTF(val, val_len, "%d", rotp->timeout); break; case TOK_RETRY: - SNPRINTF(val, val_len, "%d", rs->rotport.retry); + SNPRINTF(val, val_len, "%d", rotp->retry); break; case TOK_SERIAL_SPEED: - if (rs->rotport.type.rig != RIG_PORT_SERIAL) + if (rotp->type.rig != RIG_PORT_SERIAL) { return -RIG_EINVAL; } - SNPRINTF(val, val_len, "%d", rs->rotport.parm.serial.rate); + SNPRINTF(val, val_len, "%d", rotp->parm.serial.rate); break; case TOK_DATA_BITS: - if (rs->rotport.type.rig != RIG_PORT_SERIAL) + if (rotp->type.rig != RIG_PORT_SERIAL) { return -RIG_EINVAL; } - SNPRINTF(val, val_len, "%d", rs->rotport.parm.serial.data_bits); + SNPRINTF(val, val_len, "%d", rotp->parm.serial.data_bits); break; case TOK_STOP_BITS: - if (rs->rotport.type.rig != RIG_PORT_SERIAL) + if (rotp->type.rig != RIG_PORT_SERIAL) { return -RIG_EINVAL; } - SNPRINTF(val, val_len, "%d", rs->rotport.parm.serial.stop_bits); + SNPRINTF(val, val_len, "%d", rotp->parm.serial.stop_bits); break; case TOK_PARITY: - if (rs->rotport.type.rig != RIG_PORT_SERIAL) + if (rotp->type.rig != RIG_PORT_SERIAL) { return -RIG_EINVAL; } - switch (rs->rotport.parm.serial.parity) + switch (rotp->parm.serial.parity) { case RIG_PARITY_NONE: s = "None"; @@ -504,12 +501,12 @@ int frontrot_get_conf(ROT *rot, hamlib_token_t token, char *val, int val_len) break; case TOK_HANDSHAKE: - if (rs->rotport.type.rig != RIG_PORT_SERIAL) + if (rotp->type.rig != RIG_PORT_SERIAL) { return -RIG_EINVAL; } - switch (rs->rotport.parm.serial.handshake) + switch (rotp->parm.serial.handshake) { case RIG_HANDSHAKE_NONE: s = "None";