From b062ddce22056cf2f7f3060cbcee132784ff621d Mon Sep 17 00:00:00 2001 From: Mikael Nousiainen Date: Sun, 6 Dec 2020 14:21:39 +0200 Subject: [PATCH] Do not expect a reply from GS-232B stop command. Fix GS-232B retry error code. --- rotators/gs232a/gs232b.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/rotators/gs232a/gs232b.c b/rotators/gs232a/gs232b.c index 8a5bf593e..b085a29ae 100644 --- a/rotators/gs232a/gs232b.c +++ b/rotators/gs232a/gs232b.c @@ -106,13 +106,12 @@ transaction_write: retval = read_string(&rs->rotport, data, data_len, REPLY_EOM, strlen(REPLY_EOM)); - if (strncmp(data, "\r\n", 2) == 0 - || strchr(data, '>')) + if (strncmp(data, "\r\n", 2) == 0 || strchr(data, '>')) { - rig_debug(RIG_DEBUG_ERR, "%s: wrong response nbytes=%d\n", __func__, - (int)strlen(data)); + rig_debug(RIG_DEBUG_ERR, "%s: Invalid response for '%s': '%s' (length=%d)\n", + __func__, cmdstr, data, (int) strlen(data)); dump_hex((unsigned char *)data, strlen(data)); - retval = -1; // force retry + retval = -RIG_EPROTO; // force retry } @@ -253,13 +252,12 @@ gs232b_rot_get_position(ROT *rot, azimuth_t *az, elevation_t *el) static int gs232b_rot_stop(ROT *rot) { - char buf[32]; int retval; rig_debug(RIG_DEBUG_TRACE, "%s called\n", __func__); /* All Stop */ - retval = gs232b_transaction(rot, "S" EOM, buf, sizeof(buf), 0); + retval = gs232b_transaction(rot, "S" EOM, NULL, 0, 0); if (retval != RIG_OK) {