Change TS440 to use ic10_get_mode

Add ic10_set_split_freq and ic10_get_split_freq to ic10.c and ts440.c
pull/224/head
Michael Black 2020-04-02 22:38:09 -05:00
rodzic f0bdabf569
commit e5c1fab00f
3 zmienionych plików z 25 dodań i 8 usunięć

Wyświetl plik

@ -158,8 +158,8 @@ static int get_ic10_if(RIG *rig, char *data)
*/
int ic10_set_vfo(RIG *rig, vfo_t vfo)
{
char ackbuf[64], cmdbuf[6];
int cmd_len, retval, ack_len;
char cmdbuf[6];
int cmd_len, retval;
char vfo_function;
switch (vfo)
@ -183,7 +183,7 @@ int ic10_set_vfo(RIG *rig, vfo_t vfo)
cmd_len = sprintf(cmdbuf, "FN%c;", vfo_function);
retval = ic10_transaction(rig, cmdbuf, cmd_len, ackbuf, &ack_len);
retval = ic10_transaction(rig, cmdbuf, cmd_len, NULL, 0);
return retval;
}
@ -238,6 +238,19 @@ int ic10_get_vfo(RIG *rig, vfo_t *vfo)
}
int ic10_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq)
{
rig_debug(RIG_DEBUG_VERBOSE, "%s: called vfo=%s tx_freq=%.0f\n", __func__,
rig_strvfo(vfo), tx_freq);
return ic10_set_freq(rig, RIG_VFO_B, tx_freq);
}
int ic10_get_split_freq(RIG *rig, vfo_t vfo, freq_t *tx_freq)
{
rig_debug(RIG_DEBUG_VERBOSE, "%s: called vfo=%s\n", __func__, rig_strvfo(vfo));
return ic10_get_freq(rig, RIG_VFO_B, tx_freq);
}
int ic10_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t txvfo)
{
rig_debug(RIG_DEBUG_VERBOSE, "%s: called\n", __func__);
@ -332,8 +345,8 @@ int ic10_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
*/
int ic10_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
{
char modebuf[6], ackbuf[64];
int mode_len, ack_len, retval;
char modebuf[6];
int mode_len, retval;
char mode_letter;
switch (mode)
@ -357,7 +370,7 @@ int ic10_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
}
mode_len = sprintf(modebuf, "MD%c;", mode_letter);
retval = ic10_transaction(rig, modebuf, mode_len, ackbuf, &ack_len);
retval = ic10_transaction(rig, modebuf, mode_len, NULL, 0);
return retval;
}

Wyświetl plik

@ -22,12 +22,14 @@
#ifndef _IC10_H
#define _IC10_H 1
#define IC10_VER "20200331"
#define IC10_VER "20200402"
int ic10_cmd_trim (char *data, int data_len);
int ic10_transaction (RIG *rig, const char *cmd, int cmd_len, char *data, int *data_len);
int ic10_set_vfo(RIG *rig, vfo_t vfo);
int ic10_get_vfo(RIG *rig, vfo_t *vfo);
int ic10_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq);
int ic10_get_split_freq(RIG *rig, vfo_t vfo, freq_t *tx_freq);
int ic10_set_split_vfo(RIG *rig, vfo_t vfo , split_t split, vfo_t txvfo);
int ic10_get_split_vfo(RIG *rig, vfo_t vfo , split_t *split, vfo_t *txvfo);
int ic10_get_freq(RIG *rig, vfo_t vfo, freq_t *freq);

Wyświetl plik

@ -155,10 +155,12 @@ const struct rig_caps ts440_caps =
.get_rit = kenwood_get_rit,
.set_xit = kenwood_set_xit,
.get_xit = kenwood_get_xit,
.set_mode = kenwood_set_mode,
.set_mode = ic10_set_mode,
.get_mode = ic10_get_mode,
.set_vfo = ic10_set_vfo,
.get_vfo = ic10_get_vfo,
.set_split_freq = ic10_set_split_freq,
.get_split_freq = ic10_get_split_freq,
.set_split_vfo = ic10_set_split_vfo,
.get_split_vfo = ic10_get_split_vfo,
.set_ptt = ic10_set_ptt,