Fix kenwood AG command to use vfo+level format instead of just level

Some rigs say 0 is the default and need to find out if 1 causes an error
If it does we need to have rig exceptions -- hopefully it's ignored
https://github.com/Hamlib/Hamlib/issues/304
pull/312/head
Michael Black W9MDB 2020-06-15 09:45:58 -05:00
rodzic 362fa77cfd
commit 779cd69287
2 zmienionych plików z 10 dodań i 3 usunięć

Wyświetl plik

@ -724,6 +724,7 @@ int kenwood_open(RIG *rig)
rig_debug(RIG_DEBUG_TRACE, "%s: got PS0 so powerup\n", __func__);
rig_set_powerstat(rig, 1);
}
priv->poweron = 1;
err = RIG_OK; // reset our err back to OK for later checks
@ -2153,8 +2154,14 @@ int kenwood_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
break;
case RIG_LEVEL_AF:
snprintf(levelbuf, sizeof(levelbuf), "AG%03d", kenwood_val);
break;
{
// some rigs only recognize 0 for vfo_set
// hopefully they are asking for VFOA or Main otherwise this might not work
// https://github.com/Hamlib/Hamlib/issues/304
int vfo_set = vfo == RIG_VFO_A || vfo == RIG_VFO_MAIN ? 0 : 1;
snprintf(levelbuf, sizeof(levelbuf), "AG%1d%03d", vfo_set, kenwood_val);
}
break;
case RIG_LEVEL_RF:
/* XXX check level range */

Wyświetl plik

@ -27,7 +27,7 @@
#include <string.h>
#include "token.h"
#define BACKEND_VER "20200614"
#define BACKEND_VER "20200615"
#define EOM_KEN ';'
#define EOM_TH '\r'