From 0bacb35f06b5d8a0677491879e8f6d5fb8769fa1 Mon Sep 17 00:00:00 2001 From: Mike Black W9MDB Date: Fri, 18 Nov 2022 15:53:34 -0600 Subject: [PATCH] Make kenwood a bit more robust to discern between no reply and corrupted/unexpected reply This logic should be usable to use AI mode eventually or share serial splitter line --- rigs/kenwood/kenwood.c | 10 +++++++++- rigs/kenwood/kenwood.h | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index 400a3164f..8b4a8f9f5 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -525,7 +525,15 @@ transaction_read: if (retry_read++ < rs->rigport.retry) { - goto transaction_write; + if (strlen(buffer) == 0) + { + goto transaction_write; // didn't get an answer so send again + } + else + { + // should be able to handle transceive mode here + goto transaction_read; // might be an async or corrupt reply so we'll read until timeout + } } retval = -RIG_EPROTO; diff --git a/rigs/kenwood/kenwood.h b/rigs/kenwood/kenwood.h index a7d76d772..28687a08c 100644 --- a/rigs/kenwood/kenwood.h +++ b/rigs/kenwood/kenwood.h @@ -29,7 +29,7 @@ #include "misc.h" #include "idx_builtin.h" -#define BACKEND_VER "20221021" +#define BACKEND_VER "20221118" #define EOM_KEN ';' #define EOM_TH '\r'