Change kenwood_set_mode to only change mode if necessary by reading it first

https://github.com/Hamlib/Hamlib/issues/726
pull/739/head
Mike Black W9MDB 2021-06-15 22:35:05 -05:00
rodzic 763e18fa42
commit 3b2715463d
2 zmienionych plików z 8 dodań i 3 usunięć

Wyświetl plik

@ -2046,8 +2046,13 @@ int kenwood_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
}
else
{
snprintf(buf, sizeof(buf), "MD%c", c);
err = kenwood_transaction(rig, buf, NULL, 0);
pbwidth_t twidth;
err = rig_get_mode(rig, vfo, &priv->curr_mode, &twidth);
// only change mode if needed
if (priv->curr_mode != mode) {
snprintf(buf, sizeof(buf), "MD%c", c);
err = kenwood_transaction(rig, buf, NULL, 0);
}
}
if (err != RIG_OK) { RETURNFUNC(err); }

Wyświetl plik

@ -28,7 +28,7 @@
#include "token.h"
#include "misc.h"
#define BACKEND_VER "20210427"
#define BACKEND_VER "20210615"
#define EOM_KEN ';'
#define EOM_TH '\r'