kopia lustrzana https://github.com/Hamlib/Hamlib
Fix caching of bad IF response for Kenwood rigs
Update cache calls to use the enum values in kenwood.cpull/544/head
rodzic
a23a3b4882
commit
cfaa761c83
|
@ -260,7 +260,7 @@ int kenwood_transaction(RIG *rig, const char *cmdstr, char *data,
|
|||
{
|
||||
int cache_age_ms;
|
||||
|
||||
cache_age_ms = elapsed_ms(&priv->cache_start, 0);
|
||||
cache_age_ms = elapsed_ms(&priv->cache_start, HAMLIB_ELAPSED_GET);
|
||||
|
||||
if (cache_age_ms < 500) // 500ms cache time
|
||||
{
|
||||
|
@ -548,7 +548,7 @@ transaction_quit:
|
|||
// update the cache
|
||||
if (retval == RIG_OK && strcmp(cmdstr, "IF") == 0)
|
||||
{
|
||||
elapsed_ms(&priv->cache_start, 1);
|
||||
elapsed_ms(&priv->cache_start, HAMLIB_ELAPSED_SET);
|
||||
strncpy(priv->last_if_response, buffer, caps->if_len);
|
||||
}
|
||||
|
||||
|
@ -613,10 +613,12 @@ int kenwood_safe_transaction(RIG *rig, const char *cmd, char *buf,
|
|||
if (checklen && length != expected) /* worth retrying as some rigs
|
||||
occasionally send short results */
|
||||
{
|
||||
struct kenwood_priv_data *priv = rig->state.priv;
|
||||
rig_debug(RIG_DEBUG_ERR,
|
||||
"%s: wrong answer; len for cmd %s: expected = %d, got %d\n",
|
||||
__func__, cmd, (int)expected, (int)length);
|
||||
err = -RIG_EPROTO;
|
||||
elapsed_ms(&priv->cache_start, HAMLIB_ELAPSED_INVALIDATE);
|
||||
hl_usleep(50 * 1000); // let's do a short wait
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
#include <string.h>
|
||||
#include "token.h"
|
||||
|
||||
#define BACKEND_VER "20201231"
|
||||
#define BACKEND_VER "20210209"
|
||||
|
||||
#define EOM_KEN ';'
|
||||
#define EOM_TH '\r'
|
||||
|
|
Ładowanie…
Reference in New Issue