[Hamlib-commits] Hamlib -- Ham radio control libraries branch master updated. 8d9f7378db8f8c8c71f97
Library to control radio transceivers and receivers
Brought to you by:
n0nb
From: Michael B. <mdb...@us...> - 2021-01-03 21:29:05
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Hamlib -- Ham radio control libraries". The branch, master has been updated via 8d9f7378db8f8c8c71f9790f9564060d130864e7 (commit) from ea6854844cd796bf565f62448d8c48307e479ce7 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 8d9f7378db8f8c8c71f9790f9564060d130864e7 Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Jan 3 15:27:25 2021 -0600 Add ft100_get_dcs_code and ft100_get_rptr_shift diff --git a/rigs/yaesu/ft100.c b/rigs/yaesu/ft100.c index c08ca643..31a5f993 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 ad913cd3..64c2dc58 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); ----------------------------------------------------------------------- Summary of changes: rigs/yaesu/ft100.c | 44 ++++++++++++++++++++++++++++++++++++++++++-- rigs/yaesu/ft100.h | 4 ++-- 2 files changed, 44 insertions(+), 4 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |