diff --git a/rigs/kenwood/ic10.c b/rigs/kenwood/ic10.c index b5a62c076..b8411a7a3 100644 --- a/rigs/kenwood/ic10.c +++ b/rigs/kenwood/ic10.c @@ -79,6 +79,7 @@ int ic10_transaction(RIG *rig, const char *cmd, int cmd_len, char *data, int *data_len) { int retval; + int retry_cmd = 0; struct rig_state *rs; rig_debug(RIG_DEBUG_TRACE, @@ -87,6 +88,7 @@ int ic10_transaction(RIG *rig, const char *cmd, int cmd_len, char *data, rs = &rig->state; +transaction: serial_flush(&rs->rigport); retval = write_block(&rs->rigport, cmd, cmd_len); @@ -110,6 +112,13 @@ int ic10_transaction(RIG *rig, const char *cmd, int cmd_len, char *data, // this should be the ID response retval = read_string(&rs->rigport, buffer, sizeof(buffer), ";", 1); + // might be ?; too + if (buffer[0] == '?' && retry_cmd++ < rs->rigport.retry) + { + rig_debug(RIG_DEBUG_ERR, "%s: retrying cmd #%d\n", __func__, retry_cmd); + goto transaction; + } + if (strncmp("ID", buffer, 2)) { rig_debug(RIG_DEBUG_ERR, "%s: expected ID reponse and got %s\n", __func__, diff --git a/rigs/kenwood/ic10.h b/rigs/kenwood/ic10.h index ed4d5c5cb..b4f09a398 100644 --- a/rigs/kenwood/ic10.h +++ b/rigs/kenwood/ic10.h @@ -22,7 +22,7 @@ #ifndef _IC10_H #define _IC10_H 1 -#define IC10_VER "20200405" +#define IC10_VER "20200406" int ic10_cmd_trim (char *data, int data_len); int ic10_transaction (RIG *rig, const char *cmd, int cmd_len, char *data, int *data_len);