Merge pull request #314 from hiteki/hiteki_313

uniden_get_freq_2 to use SG<cr> instead of RF<cr> for bc780xlt #313
pull/316/head
Michael Black 2020-06-20 15:51:22 -05:00 zatwierdzone przez GitHub
commit 805b4aa269
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
3 zmienionych plików z 31 dodań i 1 usunięć

Wyświetl plik

@ -129,7 +129,7 @@ const struct rig_caps bc780_caps =
.priv = NULL,
.set_freq = uniden_set_freq,
.get_freq = uniden_get_freq,
.get_freq = uniden_get_freq_2,
.set_mode = uniden_set_mode,
.get_mode = uniden_get_mode,
.set_mem = uniden_set_mem,

Wyświetl plik

@ -318,6 +318,35 @@ int uniden_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
return RIG_OK;
}
/*
* uniden_get_freq
* Assumes rig!=NULL
*/
int uniden_get_freq_2(RIG *rig, vfo_t vfo, freq_t *freq)
{
char freqbuf[BUFSZ];
size_t freq_len = BUFSZ;
int ret;
ret = uniden_transaction(rig, "SG" EOM, 3, "S", freqbuf, &freq_len);
if (ret != RIG_OK)
{
return ret;
}
if (freq_len < 10)
{
return -RIG_EPROTO;
}
sscanf(freqbuf + 6, "%"SCNfreq, freq);
/* returned freq in hundreds of Hz */
*freq *= 100;
return RIG_OK;
}
int uniden_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
{
const char *modebuf;

Wyświetl plik

@ -58,6 +58,7 @@ int uniden_transaction (RIG *rig, const char *cmdstr, int cmd_len,
const char *replystr, char *data, size_t *datasize);
int uniden_set_freq(RIG *rig, vfo_t vfo, freq_t freq);
int uniden_get_freq(RIG *rig, vfo_t vfo, freq_t *freq);
int uniden_get_freq_2(RIG *rig, vfo_t vfo, freq_t *freq);
int uniden_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width);
int uniden_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width);
int uniden_set_mem(RIG *rig, vfo_t vfo, int ch);