From 8d9f7378db8f8c8c71f9790f9564060d130864e7 Mon Sep 17 00:00:00 2001 From: Michael Black W9MDB Date: Sun, 3 Jan 2021 15:27:25 -0600 Subject: [PATCH] Add ft100_get_dcs_code and ft100_get_rptr_shift --- rigs/yaesu/ft100.c | 44 ++++++++++++++++++++++++++++++++++++++++++-- rigs/yaesu/ft100.h | 4 ++-- 2 files changed, 44 insertions(+), 4 deletions(-) diff --git a/rigs/yaesu/ft100.c b/rigs/yaesu/ft100.c index c08ca6438..31a5f993a 100644 --- a/rigs/yaesu/ft100.c +++ b/rigs/yaesu/ft100.c @@ -286,7 +286,7 @@ const struct rig_caps ft100_caps = .get_ptt = ft100_get_ptt, .get_dcd = NULL, .set_rptr_shift = ft100_set_rptr_shift, - .get_rptr_shift = NULL, + .get_rptr_shift = ft100_get_rptr_shift, .set_rptr_offs = NULL, .get_rptr_offs = NULL, .set_split_freq = NULL, @@ -302,7 +302,7 @@ const struct rig_caps ft100_caps = .set_ts = NULL, .get_ts = NULL, .set_dcs_code = ft100_set_dcs_code, - .get_dcs_code = NULL, + .get_dcs_code = ft100_get_dcs_code, .set_ctcss_tone = ft100_set_ctcss_tone, .get_ctcss_tone = ft100_get_ctcss_tone, .set_dcs_sql = NULL, @@ -1008,6 +1008,28 @@ int ft100_set_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t shift) return ft100_send_priv_cmd(rig, cmd_index); } +int ft100_get_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t *shift) +{ + int ret; + struct ft100_priv_data *priv = (struct ft100_priv_data *)rig->state.priv; + + ret = ft100_read_status(rig); + + if (ret != RIG_OK) + { + return ret; + } + + *shift = RIG_RPT_SHIFT_NONE; + + if (priv->status.flag1 && 1 << 2) { *shift = RIG_RPT_SHIFT_MINUS; } + else if (priv->status.flag1 && 1 << 3) { *shift = RIG_RPT_SHIFT_PLUS; } + + rig_debug(RIG_DEBUG_VERBOSE, "%s: flag1=0x%02x\n", __func__, + priv->status.flag1); + + return RIG_OK; +} /* @@ -1048,6 +1070,24 @@ int ft100_set_dcs_code(RIG *rig, vfo_t vfo, tone_t code) return write_block(&rig_s->rigport, (char *) p_cmd, YAESU_CMD_LENGTH); } +int ft100_get_dcs_code(RIG *rig, vfo_t vfo, tone_t *code) +{ + int ret; + struct ft100_priv_data *priv = (struct ft100_priv_data *)rig->state.priv; + + ret = ft100_read_status(rig); + + if (ret != RIG_OK) + { + return ret; + } + + *code = ft100_dcs_list[priv->status.dcs]; + rig_debug(RIG_DEBUG_VERBOSE, "%s: P1=0x%02x, code=%d\n", __func__, + priv->status.dcs, *code); + + return RIG_OK; +} /* * TODO: enable/disable encoding/decoding diff --git a/rigs/yaesu/ft100.h b/rigs/yaesu/ft100.h index ad913cd3f..64c2dc582 100644 --- a/rigs/yaesu/ft100.h +++ b/rigs/yaesu/ft100.h @@ -165,10 +165,10 @@ static int ft100_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo) static int ft100_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo); static int ft100_set_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t shift); -//static int ft100_get_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t *shift); +static int ft100_get_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t *shift); static int ft100_set_dcs_code(RIG *rig, vfo_t vfo, tone_t code); -//static int ft100_get_dcs_code(RIG *rig, vfo_t vfo, tone_t *code); +static int ft100_get_dcs_code(RIG *rig, vfo_t vfo, tone_t *code); static int ft100_set_ctcss_tone(RIG *rig, vfo_t vfo, tone_t tone); static int ft100_get_ctcss_tone(RIG *rig, vfo_t vfo, tone_t *tone);