various cleanup of old stuff (mv_ctl)

git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@614 7ae35d74-ebe9-4afe-98af-79ac388436b8
Hamlib-1.1.2
Stéphane Fillod, F8CFE 2001-08-08 06:04:49 +00:00
rodzic 3399ca1ad6
commit fe388a8784
7 zmienionych plików z 7 dodań i 173 usunięć

Wyświetl plik

@ -2,7 +2,7 @@
* Hamlib Dummy backend - main file
* Copyright (c) 2001 by Stephane Fillod
*
* $Id: dummy.c,v 1.15 2001-07-13 19:08:15 f4cfe Exp $
* $Id: dummy.c,v 1.16 2001-08-08 06:04:48 f4cfe Exp $
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as
@ -534,21 +534,12 @@ static int dummy_get_mem(RIG *rig, vfo_t vfo, int *ch)
}
#ifdef WANT_OLD_VFO_TO_BE_REMOVED
static int dummy_mv_ctl(RIG *rig, vfo_t vfo, mv_op_t op)
{
rig_debug(RIG_DEBUG_VERBOSE,__FUNCTION__ " called\n");
return RIG_OK;
}
#else
static int dummy_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op)
{
rig_debug(RIG_DEBUG_VERBOSE,__FUNCTION__ " called\n");
return RIG_OK;
}
#endif
static int dummy_set_channel(RIG *rig, const channel_t *chan)
{
@ -711,11 +702,7 @@ const struct rig_caps dummy_caps = {
set_bank: dummy_set_bank,
set_mem: dummy_set_mem,
get_mem: dummy_get_mem,
#ifdef WANT_OLD_VFO_TO_BE_REMOVED
mv_ctl: dummy_mv_ctl,
#else
vfo_op: dummy_vfo_op,
#endif
send_dtmf: dummy_send_dtmf,
recv_dtmf: dummy_recv_dtmf,
send_morse: dummy_send_morse,

Wyświetl plik

@ -2,7 +2,7 @@
* Hamlib CI-V backend - description of IC-706 and variations
* Copyright (c) 2000,2001 by Stephane Fillod
*
* $Id: ic706.c,v 1.25 2001-07-21 13:00:03 f4cfe Exp $
* $Id: ic706.c,v 1.26 2001-08-08 06:04:48 f4cfe Exp $
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as
@ -459,11 +459,7 @@ get_level: icom_get_level,
set_func: icom_set_func,
get_func: icom_get_func,
set_mem: icom_set_mem,
#ifdef WANT_OLD_VFO_TO_BE_REMOVED
mv_ctl: icom_mv_ctl,
#else
vfo_op: icom_vfo_op,
#endif
scan: icom_scan,
set_ptt: icom_set_ptt,
get_ptt: icom_get_ptt,

Wyświetl plik

@ -2,7 +2,7 @@
* Hamlib CI-V backend - Do it all Icom description for debugging
* Copyright (c) 2000,2001 by Stephane Fillod
*
* $Id: icall.c,v 1.7 2001-07-13 19:08:15 f4cfe Exp $
* $Id: icall.c,v 1.8 2001-08-08 06:04:48 f4cfe Exp $
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as
@ -188,11 +188,7 @@ get_func: icom_get_func,
set_channel: icom_set_channel,
get_channel: icom_get_channel,
set_mem: icom_set_mem,
#ifdef WANT_OLD_VFO_TO_BE_REMOVED
mv_ctl: icom_mv_ctl,
#else
vfo_op: icom_vfo_op,
#endif
set_ptt: icom_set_ptt,
get_ptt: icom_get_ptt,
get_dcd: icom_get_dcd,

Wyświetl plik

@ -2,7 +2,7 @@
* Hamlib CI-V backend - main file
* Copyright (c) 2000,2001 by Stephane Fillod
*
* $Id: icom.c,v 1.36 2001-07-21 13:00:03 f4cfe Exp $
* $Id: icom.c,v 1.37 2001-08-08 06:04:48 f4cfe Exp $
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as
@ -1993,82 +1993,6 @@ int icom_set_bank(RIG *rig, vfo_t vfo, int bank)
return RIG_OK;
}
#ifdef WANT_OLD_VFO_TO_BE_REMOVED
/*
* icom_mv_ctl, Mem/VFO operation
* Assumes rig!=NULL, rig->state.priv!=NULL
*/
int icom_mv_ctl(RIG *rig, vfo_t vfo, mv_op_t op)
{
struct icom_priv_data *priv;
struct rig_state *rs;
unsigned char mvbuf[16];
unsigned char ackbuf[16];
int mv_len, ack_len;
int mv_cn, mv_sc;
rs = &rig->state;
priv = (struct icom_priv_data*)rs->priv;
mv_len = 0;
switch(op) {
case RIG_MVOP_VFO_MODE:
mv_cn = C_SET_VFO;
mv_sc = -1;
break;
case RIG_MVOP_MEM_MODE:
mv_cn = C_SET_MEM;
mv_sc = -1;
break;
case RIG_MVOP_VFO_CPY:
mv_cn = C_SET_VFO;
mv_sc = S_BTOA;
break;
case RIG_MVOP_VFO_XCHG:
mv_cn = C_SET_VFO;
mv_sc = S_XCHNG;
break;
case RIG_MVOP_DUAL_OFF:
mv_cn = C_SET_VFO;
mv_sc = S_DUAL_OFF;
break;
case RIG_MVOP_DUAL_ON:
mv_cn = C_SET_VFO;
mv_sc = S_DUAL_ON;
break;
case RIG_MVOP_FROM_VFO:
mv_cn = C_WR_MEM;
mv_sc = -1;
break;
case RIG_MVOP_TO_VFO:
mv_cn = C_MEM2VFO;
mv_sc = -1;
break;
case RIG_MVOP_MCL:
mv_cn = C_CLR_MEM;
mv_sc = -1;
break;
default:
rig_debug(RIG_DEBUG_ERR,"Unsupported mem/vfo op %d", op);
return -RIG_EINVAL;
}
retval = icom_transaction (rig, mv_cn, mv_sc, mvbuf, mv_len,
ackbuf, &ack_len);
if (retval != RIG_OK)
return retval;
if (ack_len != 1 || ackbuf[0] != ACK) {
rig_debug(RIG_DEBUG_ERR,"icom_mv_ctl: ack NG (%#.2x), "
"len=%d\n", ackbuf[0], ack_len);
return -RIG_ERJCTED;
}
return RIG_OK;
}
#else
/*
* icom_vfo_op, Mem/VFO operation
* Assumes rig!=NULL, rig->state.priv!=NULL
@ -2146,7 +2070,6 @@ int icom_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op)
return RIG_OK;
}
#endif
/*
* icom_scan, scan operation

Wyświetl plik

@ -2,7 +2,7 @@
* Hamlib CI-V backend - main header
* Copyright (c) 2000,2001 by Stephane Fillod
*
* $Id: icom.h,v 1.26 2001-07-21 13:00:03 f4cfe Exp $
* $Id: icom.h,v 1.27 2001-08-08 06:04:48 f4cfe Exp $
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as
@ -89,11 +89,7 @@ int icom_set_ctcss_sql(RIG *rig, vfo_t vfo, tone_t tone);
int icom_get_ctcss_sql(RIG *rig, vfo_t vfo, tone_t *tone);
int icom_set_bank(RIG *rig, vfo_t vfo, int bank);
int icom_set_mem(RIG *rig, vfo_t vfo, int ch);
#ifdef WANT_OLD_VFO_TO_BE_REMOVED
int icom_mv_ctl(RIG *rig, vfo_t vfo, mv_op_t op);
#else
int icom_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op);
#endif
int icom_scan(RIG *rig, vfo_t vfo, scan_t scan, int ch);
int icom_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val);
int icom_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val);

Wyświetl plik

@ -2,7 +2,7 @@
* Hamlib CI-V backend - IC-R8500 description
* Copyright (c) 2000,2001 by Stephane Fillod
*
* $Id: icr8500.c,v 1.11 2001-07-13 19:08:15 f4cfe Exp $
* $Id: icr8500.c,v 1.12 2001-08-08 06:04:48 f4cfe Exp $
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as
@ -159,11 +159,7 @@ set_func: icom_set_func,
set_channel: icom_set_channel,
get_channel: icom_get_channel,
set_mem: icom_set_mem,
#ifdef WANT_OLD_VFO_TO_BE_REMOVED
mv_ctl: icom_mv_ctl,
#else
vfo_op: icom_vfo_op,
#endif
set_ts: icom_set_ts,
get_ts: icom_get_ts,
};

Wyświetl plik

@ -12,7 +12,7 @@
* Hamlib Interface - main file
* Copyright (c) 2000,2001 by Stephane Fillod and Frank Singleton
*
* $Id: rig.c,v 1.43 2001-07-25 21:59:55 f4cfe Exp $
* $Id: rig.c,v 1.44 2001-08-08 06:04:49 f4cfe Exp $
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as
@ -3133,53 +3133,6 @@ int rig_get_mem(RIG *rig, vfo_t vfo, int *ch)
return retcode;
}
#ifdef WANT_OLD_VFO_TO_BE_REMOVED
/**
* rig_mv_ctl - perform Memory/VFO operations
* \param rig The rig handle
* \param vfo The target VFO
* \param op The Memory/VFO operation to perform
*
* Performs Memory/VFO operation.
* See #mv_op_t for more information.
*
* \return RIG_OK if the operation has been sucessful, otherwise
* a negative value if an error occured (in which case, cause is
* set appropriately).
*
*/
int rig_mv_ctl(RIG *rig, vfo_t vfo, mv_op_t op)
{
const struct rig_caps *caps;
int retcode;
vfo_t curr_vfo;
if (!rig || !rig->caps)
return -RIG_EINVAL;
caps = rig->caps;
if (caps->mv_ctl == NULL)
return -RIG_ENAVAIL;
if (caps->targetable_vfo || vfo == RIG_VFO_CURR ||
vfo == rig->state.current_vfo)
return caps->mv_ctl(rig, vfo, op);
if (!caps->set_vfo)
return -RIG_ENTARGET;
curr_vfo = rig->state.current_vfo;
retcode = caps->set_vfo(rig, vfo);
if (retcode != RIG_OK)
return retcode;
retcode = caps->mv_ctl(rig, vfo, op);
caps->set_vfo(rig, curr_vfo);
return retcode;
}
#else
/**
* \brief check retrieval ability of VFO operations
* \param rig The rig handle
@ -3249,7 +3202,6 @@ int rig_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op)
caps->set_vfo(rig, curr_vfo);
return retcode;
}
#endif /* WANT_OLD_VFO_TO_BE_REMOVED */
/**
* \brief check availability of scaning functions
@ -3654,21 +3606,13 @@ int rig_set_channel(RIG *rig, const channel_t *chan)
*/
if (rig->caps->set_channel == NULL) {
rig_save_channel(rig, &curr_chan);
#ifdef WANT_OLD_VFO_TO_BE_REMOVED
rig_mv_ctl(rig, RIG_VFO_CURR, RIG_MVOP_MEM_MODE);
#else
curr_vfo = rig->state.current_vfo;
rig_set_vfo(rig, RIG_VFO_MEM);
#endif
rig_get_mem(rig, RIG_VFO_CURR, &curr_chan_num);
rig_set_mem(rig, RIG_VFO_CURR, chan->channel_num);
rig_set_mem(rig, RIG_VFO_CURR, curr_chan_num);
rig_restore_channel(rig, chan);
#ifdef WANT_OLD_VFO_TO_BE_REMOVED
rig_mv_ctl(rig, RIG_VFO_CURR, RIG_MVOP_VFO_MODE);
#else
rig_set_vfo(rig, curr_vfo);
#endif
rig_restore_channel(rig, &curr_chan);
return RIG_OK;
}
@ -3708,11 +3652,7 @@ int rig_get_channel(RIG *rig, channel_t *chan)
rig_save_channel(rig, &curr_chan);
#endif
#ifdef WANT_OLD_VFO_TO_BE_REMOVED
rig_mv_ctl(rig, RIG_VFO_CURR, RIG_MVOP_MEM_MODE);
#else
rig_set_vfo(rig, RIG_VFO_MEM);
#endif
#if 0
rig_get_mem(rig, RIG_VFO_CURR, &curr_chan_num);