kopia lustrzana https://github.com/Hamlib/Hamlib
Merge branch 'master' of github.com:Hamlib/Hamlib
commit
d35637d523
|
@ -23,9 +23,9 @@ $ ./configure
|
||||||
|
|
||||||
Then compile the hamlib files
|
Then compile the hamlib files
|
||||||
|
|
||||||
$ ./make
|
$ make
|
||||||
|
|
||||||
Hint: "./make -jx" with x for the amount of CPU cores will speed up the
|
Hint: "make -jx" with x for the amount of CPU cores will speed up the
|
||||||
compilation
|
compilation
|
||||||
|
|
||||||
Install hamlib
|
Install hamlib
|
||||||
|
@ -33,4 +33,4 @@ Install hamlib
|
||||||
|
|
||||||
Install the Hamlib libraries and executables
|
Install the Hamlib libraries and executables
|
||||||
|
|
||||||
$ sudo ./make install
|
$ sudo make install
|
||||||
|
|
194
dummy/dummy.c
194
dummy/dummy.c
|
@ -280,7 +280,15 @@ static int dummy_init(RIG *rig)
|
||||||
init_chan(rig, RIG_VFO_A, &priv->vfo_a);
|
init_chan(rig, RIG_VFO_A, &priv->vfo_a);
|
||||||
init_chan(rig, RIG_VFO_B, &priv->vfo_b);
|
init_chan(rig, RIG_VFO_B, &priv->vfo_b);
|
||||||
priv->curr = &priv->vfo_a;
|
priv->curr = &priv->vfo_a;
|
||||||
priv->curr_vfo = priv->last_vfo = RIG_VFO_A;
|
|
||||||
|
if (rig->caps->rig_model == RIG_MODEL_DUMMY_NOVFO)
|
||||||
|
{
|
||||||
|
priv->curr_vfo = priv->last_vfo = RIG_VFO_CURR;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
priv->curr_vfo = priv->last_vfo = RIG_VFO_A;
|
||||||
|
}
|
||||||
|
|
||||||
priv->magic_conf = strdup("DX");
|
priv->magic_conf = strdup("DX");
|
||||||
|
|
||||||
|
@ -318,6 +326,15 @@ static int dummy_open(RIG *rig)
|
||||||
{
|
{
|
||||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
||||||
|
|
||||||
|
if (rig->caps->rig_model == RIG_MODEL_DUMMY_NOVFO)
|
||||||
|
{
|
||||||
|
// then we emulate a rig without set_vfo or get_vfo
|
||||||
|
rig_debug(RIG_DEBUG_VERBOSE, "%s: Emulating rig without get_vfo or set_vfo\n",
|
||||||
|
__func__);
|
||||||
|
rig->caps->set_vfo = NULL;
|
||||||
|
rig->caps->get_vfo = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
usleep(CMDSLEEP);
|
usleep(CMDSLEEP);
|
||||||
|
|
||||||
return RIG_OK;
|
return RIG_OK;
|
||||||
|
@ -406,13 +423,19 @@ static int dummy_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
||||||
{
|
{
|
||||||
struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv;
|
struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv;
|
||||||
|
|
||||||
if (vfo == RIG_VFO_CURR) { vfo = priv->curr_vfo; }
|
if (vfo == RIG_VFO_CURR && rig->caps->rig_model != RIG_MODEL_DUMMY_NOVFO) { vfo = priv->curr_vfo; }
|
||||||
|
|
||||||
usleep(CMDSLEEP);
|
usleep(CMDSLEEP);
|
||||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called: %s\n", __func__, rig_strvfo(vfo));
|
rig_debug(RIG_DEBUG_VERBOSE, "%s called: %s\n", __func__, rig_strvfo(vfo));
|
||||||
|
|
||||||
if (vfo == RIG_VFO_A) { *freq = priv->freq_vfoa; }
|
switch (vfo)
|
||||||
else if (vfo == RIG_VFO_B) { *freq = priv->freq_vfob; }
|
{
|
||||||
|
case RIG_VFO_A: *freq = priv->freq_vfoa; break;
|
||||||
|
|
||||||
|
case RIG_VFO_B: *freq = priv->freq_vfob; break;
|
||||||
|
|
||||||
|
default: return -RIG_EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
rig_debug(RIG_DEBUG_TRACE, "%s: freq=%.0f\n", __func__, *freq);
|
rig_debug(RIG_DEBUG_TRACE, "%s: freq=%.0f\n", __func__, *freq);
|
||||||
return RIG_OK;
|
return RIG_OK;
|
||||||
|
@ -2091,6 +2114,168 @@ struct rig_caps dummy_caps =
|
||||||
.mW2power = dummy_mW2power,
|
.mW2power = dummy_mW2power,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct rig_caps dummy_no_vfo_caps =
|
||||||
|
{
|
||||||
|
RIG_MODEL(RIG_MODEL_DUMMY_NOVFO),
|
||||||
|
.model_name = "Dummy No VFO",
|
||||||
|
.mfg_name = "Hamlib",
|
||||||
|
.version = "20200603.0",
|
||||||
|
.copyright = "LGPL",
|
||||||
|
.status = RIG_STATUS_STABLE,
|
||||||
|
.rig_type = RIG_TYPE_OTHER,
|
||||||
|
.targetable_vfo = 0,
|
||||||
|
.ptt_type = RIG_PTT_RIG,
|
||||||
|
.dcd_type = RIG_DCD_RIG,
|
||||||
|
.port_type = RIG_PORT_NONE,
|
||||||
|
.has_get_func = DUMMY_FUNC,
|
||||||
|
.has_set_func = DUMMY_FUNC,
|
||||||
|
.has_get_level = DUMMY_LEVEL,
|
||||||
|
.has_set_level = RIG_LEVEL_SET(DUMMY_LEVEL),
|
||||||
|
.has_get_parm = DUMMY_PARM,
|
||||||
|
.has_set_parm = RIG_PARM_SET(DUMMY_PARM),
|
||||||
|
.level_gran = { [LVL_CWPITCH] = { .step = { .i = 10 } } },
|
||||||
|
.ctcss_list = common_ctcss_list,
|
||||||
|
.dcs_list = full_dcs_list,
|
||||||
|
.chan_list = {
|
||||||
|
{ 0, 18, RIG_MTYPE_MEM, DUMMY_MEM_CAP },
|
||||||
|
{ 19, 19, RIG_MTYPE_CALL },
|
||||||
|
{ 20, NB_CHAN - 1, RIG_MTYPE_EDGE },
|
||||||
|
RIG_CHAN_END,
|
||||||
|
},
|
||||||
|
.scan_ops = DUMMY_SCAN,
|
||||||
|
.vfo_ops = DUMMY_VFO_OP,
|
||||||
|
.transceive = RIG_TRN_OFF,
|
||||||
|
.attenuator = { 10, 20, 30, RIG_DBLST_END, },
|
||||||
|
.preamp = { 10, RIG_DBLST_END, },
|
||||||
|
.rx_range_list1 = { {
|
||||||
|
.startf = kHz(150), .endf = MHz(1500), .modes = DUMMY_MODES,
|
||||||
|
.low_power = -1, .high_power = -1, DUMMY_VFOS, RIG_ANT_1 | RIG_ANT_2 | RIG_ANT_3 | RIG_ANT_4,
|
||||||
|
.label = "Dummy#1"
|
||||||
|
},
|
||||||
|
RIG_FRNG_END,
|
||||||
|
},
|
||||||
|
.tx_range_list1 = { {
|
||||||
|
.startf = kHz(150), .endf = MHz(1500), .modes = DUMMY_MODES,
|
||||||
|
.low_power = W(5), .high_power = W(100), DUMMY_VFOS, RIG_ANT_1 | RIG_ANT_2 | RIG_ANT_3 | RIG_ANT_4,
|
||||||
|
.label = "Dummy#1"
|
||||||
|
},
|
||||||
|
RIG_FRNG_END,
|
||||||
|
},
|
||||||
|
.rx_range_list2 = { {
|
||||||
|
.startf = kHz(150), .endf = MHz(1500), .modes = DUMMY_MODES,
|
||||||
|
.low_power = -1, .high_power = -1, DUMMY_VFOS, RIG_ANT_1 | RIG_ANT_2 | RIG_ANT_3 | RIG_ANT_4,
|
||||||
|
.label = "Dummy#2"
|
||||||
|
},
|
||||||
|
RIG_FRNG_END,
|
||||||
|
},
|
||||||
|
.tx_range_list2 = { RIG_FRNG_END, },
|
||||||
|
.tuning_steps = { {DUMMY_MODES, 1}, {DUMMY_MODES, RIG_TS_ANY}, RIG_TS_END, },
|
||||||
|
.filters = {
|
||||||
|
{RIG_MODE_SSB, kHz(2.4)},
|
||||||
|
{RIG_MODE_SSB, kHz(1.8)},
|
||||||
|
{RIG_MODE_SSB, kHz(3.0)},
|
||||||
|
{RIG_MODE_SSB, RIG_FLT_ANY},
|
||||||
|
{RIG_MODE_CW, Hz(500)},
|
||||||
|
{RIG_MODE_CW, kHz(2.4)},
|
||||||
|
{RIG_MODE_CW, Hz(50)},
|
||||||
|
{RIG_MODE_CW, RIG_FLT_ANY},
|
||||||
|
{RIG_MODE_RTTY, Hz(300)},
|
||||||
|
{RIG_MODE_RTTY, kHz(2.4)},
|
||||||
|
{RIG_MODE_RTTY, Hz(50)},
|
||||||
|
{RIG_MODE_RTTY, RIG_FLT_ANY},
|
||||||
|
{RIG_MODE_AM, kHz(8)},
|
||||||
|
{RIG_MODE_AM, kHz(2.4)},
|
||||||
|
{RIG_MODE_AM, kHz(10)},
|
||||||
|
{RIG_MODE_FM, kHz(15)},
|
||||||
|
{RIG_MODE_FM, kHz(8)},
|
||||||
|
{RIG_MODE_WFM, kHz(230)},
|
||||||
|
RIG_FLT_END,
|
||||||
|
},
|
||||||
|
.max_rit = 9990,
|
||||||
|
.max_xit = 9990,
|
||||||
|
.max_ifshift = 10000,
|
||||||
|
.priv = NULL, /* priv */
|
||||||
|
|
||||||
|
.extlevels = dummy_ext_levels,
|
||||||
|
.extparms = dummy_ext_parms,
|
||||||
|
.cfgparams = dummy_cfg_params,
|
||||||
|
|
||||||
|
.rig_init = dummy_init,
|
||||||
|
.rig_cleanup = dummy_cleanup,
|
||||||
|
.rig_open = dummy_open,
|
||||||
|
.rig_close = dummy_close,
|
||||||
|
|
||||||
|
.set_conf = dummy_set_conf,
|
||||||
|
.get_conf = dummy_get_conf,
|
||||||
|
|
||||||
|
.set_freq = dummy_set_freq,
|
||||||
|
.get_freq = dummy_get_freq,
|
||||||
|
.set_mode = dummy_set_mode,
|
||||||
|
.get_mode = dummy_get_mode,
|
||||||
|
.set_vfo = dummy_set_vfo,
|
||||||
|
.get_vfo = dummy_get_vfo,
|
||||||
|
|
||||||
|
.set_powerstat = dummy_set_powerstat,
|
||||||
|
.get_powerstat = dummy_get_powerstat,
|
||||||
|
.set_level = dummy_set_level,
|
||||||
|
.get_level = dummy_get_level,
|
||||||
|
.set_func = dummy_set_func,
|
||||||
|
.get_func = dummy_get_func,
|
||||||
|
.set_parm = dummy_set_parm,
|
||||||
|
.get_parm = dummy_get_parm,
|
||||||
|
.set_ext_level = dummy_set_ext_level,
|
||||||
|
.get_ext_level = dummy_get_ext_level,
|
||||||
|
.set_ext_parm = dummy_set_ext_parm,
|
||||||
|
.get_ext_parm = dummy_get_ext_parm,
|
||||||
|
|
||||||
|
.get_info = dummy_get_info,
|
||||||
|
|
||||||
|
|
||||||
|
.set_ptt = dummy_set_ptt,
|
||||||
|
.get_ptt = dummy_get_ptt,
|
||||||
|
.get_dcd = dummy_get_dcd,
|
||||||
|
.set_rptr_shift = dummy_set_rptr_shift,
|
||||||
|
.get_rptr_shift = dummy_get_rptr_shift,
|
||||||
|
.set_rptr_offs = dummy_set_rptr_offs,
|
||||||
|
.get_rptr_offs = dummy_get_rptr_offs,
|
||||||
|
.set_ctcss_tone = dummy_set_ctcss_tone,
|
||||||
|
.get_ctcss_tone = dummy_get_ctcss_tone,
|
||||||
|
.set_dcs_code = dummy_set_dcs_code,
|
||||||
|
.get_dcs_code = dummy_get_dcs_code,
|
||||||
|
.set_ctcss_sql = dummy_set_ctcss_sql,
|
||||||
|
.get_ctcss_sql = dummy_get_ctcss_sql,
|
||||||
|
.set_dcs_sql = dummy_set_dcs_sql,
|
||||||
|
.get_dcs_sql = dummy_get_dcs_sql,
|
||||||
|
.set_split_freq = dummy_set_split_freq,
|
||||||
|
.get_split_freq = dummy_get_split_freq,
|
||||||
|
.set_split_mode = dummy_set_split_mode,
|
||||||
|
.get_split_mode = dummy_get_split_mode,
|
||||||
|
.set_split_vfo = dummy_set_split_vfo,
|
||||||
|
.get_split_vfo = dummy_get_split_vfo,
|
||||||
|
.set_rit = dummy_set_rit,
|
||||||
|
.get_rit = dummy_get_rit,
|
||||||
|
.set_xit = dummy_set_xit,
|
||||||
|
.get_xit = dummy_get_xit,
|
||||||
|
.set_ts = dummy_set_ts,
|
||||||
|
.get_ts = dummy_get_ts,
|
||||||
|
.set_ant = dummy_set_ant,
|
||||||
|
.get_ant = dummy_get_ant,
|
||||||
|
.set_bank = dummy_set_bank,
|
||||||
|
.set_mem = dummy_set_mem,
|
||||||
|
.get_mem = dummy_get_mem,
|
||||||
|
.vfo_op = dummy_vfo_op,
|
||||||
|
.scan = dummy_scan,
|
||||||
|
.send_dtmf = dummy_send_dtmf,
|
||||||
|
.recv_dtmf = dummy_recv_dtmf,
|
||||||
|
.send_morse = dummy_send_morse,
|
||||||
|
.set_channel = dummy_set_channel,
|
||||||
|
.get_channel = dummy_get_channel,
|
||||||
|
.set_trn = dummy_set_trn,
|
||||||
|
.get_trn = dummy_get_trn,
|
||||||
|
.power2mW = dummy_power2mW,
|
||||||
|
.mW2power = dummy_mW2power,
|
||||||
|
};
|
||||||
|
|
||||||
DECLARE_INITRIG_BACKEND(dummy)
|
DECLARE_INITRIG_BACKEND(dummy)
|
||||||
{
|
{
|
||||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: _init called\n", __func__);
|
rig_debug(RIG_DEBUG_VERBOSE, "%s: _init called\n", __func__);
|
||||||
|
@ -2099,6 +2284,7 @@ DECLARE_INITRIG_BACKEND(dummy)
|
||||||
rig_register(&netrigctl_caps);
|
rig_register(&netrigctl_caps);
|
||||||
rig_register(&flrig_caps);
|
rig_register(&flrig_caps);
|
||||||
rig_register(&trxmanager_caps);
|
rig_register(&trxmanager_caps);
|
||||||
|
rig_register(&dummy_no_vfo_caps);
|
||||||
|
|
||||||
return RIG_OK;
|
return RIG_OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,6 +39,7 @@
|
||||||
|
|
||||||
|
|
||||||
extern struct rig_caps dummy_caps;
|
extern struct rig_caps dummy_caps;
|
||||||
|
extern struct rig_caps dummy_no_vfo_caps;
|
||||||
extern struct rig_caps netrigctl_caps;
|
extern struct rig_caps netrigctl_caps;
|
||||||
extern const struct rig_caps flrig_caps;
|
extern const struct rig_caps flrig_caps;
|
||||||
extern const struct rig_caps trxmanager_caps;
|
extern const struct rig_caps trxmanager_caps;
|
||||||
|
|
|
@ -121,24 +121,24 @@ extern HAMLIB_EXPORT_VAR(const char *) hamlib_copyright2;
|
||||||
* of rig_errcode_e definitions in case of error, or 0 when successful.
|
* of rig_errcode_e definitions in case of error, or 0 when successful.
|
||||||
*/
|
*/
|
||||||
enum rig_errcode_e {
|
enum rig_errcode_e {
|
||||||
RIG_OK = 0, /*!< No error, operation completed successfully */
|
RIG_OK = 0, /*!< 0 No error, operation completed successfully */
|
||||||
RIG_EINVAL, /*!< invalid parameter */
|
RIG_EINVAL, /*!< 1 invalid parameter */
|
||||||
RIG_ECONF, /*!< invalid configuration (serial,..) */
|
RIG_ECONF, /*!< 2 invalid configuration (serial,..) */
|
||||||
RIG_ENOMEM, /*!< memory shortage */
|
RIG_ENOMEM, /*!< 3 memory shortage */
|
||||||
RIG_ENIMPL, /*!< function not implemented, but will be */
|
RIG_ENIMPL, /*!< 4 function not implemented, but will be */
|
||||||
RIG_ETIMEOUT, /*!< communication timed out */
|
RIG_ETIMEOUT, /*!< 5 communication timed out */
|
||||||
RIG_EIO, /*!< IO error, including open failed */
|
RIG_EIO, /*!< 6 IO error, including open failed */
|
||||||
RIG_EINTERNAL, /*!< Internal Hamlib error, huh! */
|
RIG_EINTERNAL, /*!< 7 Internal Hamlib error, huh! */
|
||||||
RIG_EPROTO, /*!< Protocol error */
|
RIG_EPROTO, /*!< 8 Protocol error */
|
||||||
RIG_ERJCTED, /*!< Command rejected by the rig */
|
RIG_ERJCTED, /*!< 9 Command rejected by the rig */
|
||||||
RIG_ETRUNC, /*!< Command performed, but arg truncated */
|
RIG_ETRUNC, /*!< 10 Command performed, but arg truncated */
|
||||||
RIG_ENAVAIL, /*!< function not available */
|
RIG_ENAVAIL, /*!< 11 Function not available */
|
||||||
RIG_ENTARGET, /*!< VFO not targetable */
|
RIG_ENTARGET, /*!< 12 VFO not targetable */
|
||||||
RIG_BUSERROR, /*!< Error talking on the bus */
|
RIG_BUSERROR, /*!< 13 Error talking on the bus */
|
||||||
RIG_BUSBUSY, /*!< Collision on the bus */
|
RIG_BUSBUSY, /*!< 14 Collision on the bus */
|
||||||
RIG_EARG, /*!< NULL RIG handle or any invalid pointer parameter in get arg */
|
RIG_EARG, /*!< 15 NULL RIG handle or any invalid pointer parameter in get arg */
|
||||||
RIG_EVFO, /*!< Invalid VFO */
|
RIG_EVFO, /*!< 16 Invalid VFO */
|
||||||
RIG_EDOM /*!< Argument out of domain of func */
|
RIG_EDOM /*!< 17 Argument out of domain of func */
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -69,6 +69,7 @@
|
||||||
#define RIG_MODEL_ARMSTRONG RIG_MAKE_MODEL(RIG_DUMMY, 3)
|
#define RIG_MODEL_ARMSTRONG RIG_MAKE_MODEL(RIG_DUMMY, 3)
|
||||||
#define RIG_MODEL_FLRIG RIG_MAKE_MODEL(RIG_DUMMY, 4)
|
#define RIG_MODEL_FLRIG RIG_MAKE_MODEL(RIG_DUMMY, 4)
|
||||||
#define RIG_MODEL_TRXMANAGER_RIG RIG_MAKE_MODEL(RIG_DUMMY, 5)
|
#define RIG_MODEL_TRXMANAGER_RIG RIG_MAKE_MODEL(RIG_DUMMY, 5)
|
||||||
|
#define RIG_MODEL_DUMMY_NOVFO RIG_MAKE_MODEL(RIG_DUMMY, 6)
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -491,6 +491,7 @@ dec2dmmm HAMLIB_PARAMS((double dec,
|
||||||
extern HAMLIB_EXPORT(double)
|
extern HAMLIB_EXPORT(double)
|
||||||
dmmm2dec HAMLIB_PARAMS((int degrees,
|
dmmm2dec HAMLIB_PARAMS((int degrees,
|
||||||
double minutes,
|
double minutes,
|
||||||
|
double seconds,
|
||||||
int sw));
|
int sw));
|
||||||
|
|
||||||
//! @endcond
|
//! @endcond
|
||||||
|
|
|
@ -1057,7 +1057,7 @@ int icom_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
||||||
rs = &rig->state;
|
rs = &rig->state;
|
||||||
priv = (struct icom_priv_data *) rs->priv;
|
priv = (struct icom_priv_data *) rs->priv;
|
||||||
|
|
||||||
if (rig->caps->rig_model == RIG_MODEL_IC910)
|
if (rig->caps->rig_model == RIG_MODEL_IC910 || rig->caps->rig_model == RIG_MODEL_FTDX101D)
|
||||||
{
|
{
|
||||||
ptt_t ptt;
|
ptt_t ptt;
|
||||||
retval = rig_get_ptt(rig, RIG_VFO_CURR, &ptt);
|
retval = rig_get_ptt(rig, RIG_VFO_CURR, &ptt);
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define BACKEND_VER "20200601"
|
#define BACKEND_VER "20200603"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* defines used by comp_cal_str in rig.c
|
* defines used by comp_cal_str in rig.c
|
||||||
|
|
|
@ -358,8 +358,8 @@ static int meade_get_position(ROT *rot, azimuth_t *az, elevation_t *el)
|
||||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: az=%03d:%02d:%02d, el=%03d:%02d:%02d\n",
|
rig_debug(RIG_DEBUG_VERBOSE, "%s: az=%03d:%02d:%02d, el=%03d:%02d:%02d\n",
|
||||||
__func__, az_degrees, az_minutes, az_seconds, el_degrees, el_minutes,
|
__func__, az_degrees, az_minutes, az_seconds, el_degrees, el_minutes,
|
||||||
el_seconds);
|
el_seconds);
|
||||||
*az = dmmm2dec(az_degrees, az_minutes, az_seconds);
|
*az = dmmm2dec(az_degrees, az_minutes, az_seconds, az_seconds);
|
||||||
*el = dmmm2dec(el_degrees, el_minutes, el_seconds);
|
*el = dmmm2dec(el_degrees, el_minutes, el_seconds, el_seconds);
|
||||||
return RIG_OK;
|
return RIG_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -287,7 +287,6 @@ AMP *HAMLIB_API amp_init(amp_model_t amp_model)
|
||||||
* set appropriately).
|
* set appropriately).
|
||||||
*
|
*
|
||||||
* \retval RIG_EINVAL \a amp is NULL or unconsistent.
|
* \retval RIG_EINVAL \a amp is NULL or unconsistent.
|
||||||
* \retval RIG_ENIMPL port type communication is not implemented yet.
|
|
||||||
*
|
*
|
||||||
* \sa amp_init(), amp_close()
|
* \sa amp_init(), amp_close()
|
||||||
*/
|
*/
|
||||||
|
@ -652,7 +651,7 @@ int HAMLIB_API amp_get_level(AMP *amp, setting_t level, value_t *val)
|
||||||
|
|
||||||
if (amp->caps->get_level == NULL)
|
if (amp->caps->get_level == NULL)
|
||||||
{
|
{
|
||||||
return -RIG_ENIMPL;
|
return -RIG_ENAVAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
return amp->caps->get_level(amp, level, val);
|
return amp->caps->get_level(amp, level, val);
|
||||||
|
@ -671,7 +670,7 @@ int HAMLIB_API amp_get_ext_level(AMP *amp, token_t level, value_t *val)
|
||||||
|
|
||||||
if (amp->caps->get_ext_level == NULL)
|
if (amp->caps->get_ext_level == NULL)
|
||||||
{
|
{
|
||||||
return -RIG_ENIMPL;
|
return -RIG_ENAVAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
return amp->caps->get_ext_level(amp, level, val);
|
return amp->caps->get_ext_level(amp, level, val);
|
||||||
|
@ -705,7 +704,7 @@ int HAMLIB_API amp_set_powerstat(AMP *amp, powerstat_t status)
|
||||||
|
|
||||||
if (amp->caps->set_powerstat == NULL)
|
if (amp->caps->set_powerstat == NULL)
|
||||||
{
|
{
|
||||||
return -RIG_ENIMPL;
|
return -RIG_ENAVAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
return amp->caps->set_powerstat(amp, status);
|
return amp->caps->set_powerstat(amp, status);
|
||||||
|
@ -723,7 +722,7 @@ int HAMLIB_API amp_get_powerstat(AMP *amp, powerstat_t *status)
|
||||||
|
|
||||||
if (amp->caps->get_powerstat == NULL)
|
if (amp->caps->get_powerstat == NULL)
|
||||||
{
|
{
|
||||||
return -RIG_ENIMPL;
|
return -RIG_ENAVAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
return amp->caps->get_powerstat(amp, status);
|
return amp->caps->get_powerstat(amp, status);
|
||||||
|
|
|
@ -193,7 +193,7 @@ double HAMLIB_API dms2dec(int degrees, int minutes, double seconds, int sw)
|
||||||
*
|
*
|
||||||
* \sa dec2dmmm()
|
* \sa dec2dmmm()
|
||||||
*/
|
*/
|
||||||
double HAMLIB_API dmmm2dec(int degrees, double minutes, int sw)
|
double HAMLIB_API dmmm2dec(int degrees, double minutes, double seconds, int sw)
|
||||||
{
|
{
|
||||||
double st;
|
double st;
|
||||||
|
|
||||||
|
@ -209,7 +209,7 @@ double HAMLIB_API dmmm2dec(int degrees, double minutes, int sw)
|
||||||
minutes = fabs(minutes);
|
minutes = fabs(minutes);
|
||||||
}
|
}
|
||||||
|
|
||||||
st = (double)degrees + minutes / 60.;
|
st = (double)degrees + (minutes / 60) + (seconds / 3600);
|
||||||
|
|
||||||
if (sw == 1)
|
if (sw == 1)
|
||||||
{
|
{
|
||||||
|
|
59
src/rig.c
59
src/rig.c
|
@ -219,10 +219,12 @@ static vfo_t vfo_fixup(RIG *rig, vfo_t vfo)
|
||||||
// Icom's lack of get_vfo is problematic in this respect
|
// Icom's lack of get_vfo is problematic in this respect
|
||||||
// If we cache vfo or others than twiddling the rig may cause problems
|
// If we cache vfo or others than twiddling the rig may cause problems
|
||||||
retval = rig_get_split(rig, vfo, &split);
|
retval = rig_get_split(rig, vfo, &split);
|
||||||
|
|
||||||
if (retval != RIG_OK)
|
if (retval != RIG_OK)
|
||||||
{
|
{
|
||||||
split = rig->state.cache.split;
|
split = rig->state.cache.split;
|
||||||
}
|
}
|
||||||
|
|
||||||
int satmode = rig->state.cache.satmode;
|
int satmode = rig->state.cache.satmode;
|
||||||
vfo = RIG_VFO_A;
|
vfo = RIG_VFO_A;
|
||||||
|
|
||||||
|
@ -240,6 +242,7 @@ static vfo_t vfo_fixup(RIG *rig, vfo_t vfo)
|
||||||
"%s: RIG_VFO_TX changed to %s, split=%d, satmode=%d\n", __func__,
|
"%s: RIG_VFO_TX changed to %s, split=%d, satmode=%d\n", __func__,
|
||||||
rig_strvfo(vfo), split, satmode);
|
rig_strvfo(vfo), split, satmode);
|
||||||
}
|
}
|
||||||
|
|
||||||
rig_debug(RIG_DEBUG_TRACE, "%s: final vfo=%s\n", __func__, rig_strvfo(vfo));
|
rig_debug(RIG_DEBUG_TRACE, "%s: final vfo=%s\n", __func__, rig_strvfo(vfo));
|
||||||
return vfo;
|
return vfo;
|
||||||
}
|
}
|
||||||
|
@ -927,8 +930,27 @@ int HAMLIB_API rig_open(RIG *rig)
|
||||||
}
|
}
|
||||||
else // vfo fails so set some sensible defaults
|
else // vfo fails so set some sensible defaults
|
||||||
{
|
{
|
||||||
rs->current_vfo = RIG_VFO_CURR;
|
int backend_num = RIG_BACKEND_NUM(rig->caps->rig_model);
|
||||||
rs->tx_vfo = RIG_VFO_TX;
|
rs->tx_vfo = RIG_VFO_TX;
|
||||||
|
rs->current_vfo = RIG_VFO_CURR;
|
||||||
|
|
||||||
|
if (backend_num == RIG_ICOM)
|
||||||
|
{
|
||||||
|
rig_debug(RIG_DEBUG_TRACE, "%s: Icom rig so default vfo = %s\n", __func__,
|
||||||
|
rig_strvfo(rs->current_vfo));
|
||||||
|
}
|
||||||
|
else if (rig->caps->set_vfo == NULL)
|
||||||
|
{
|
||||||
|
// for non-Icom rigs if there's no set_vfo then we need to set one
|
||||||
|
rs->current_vfo = vfo_fixup(rig, RIG_VFO_A);
|
||||||
|
rig_debug(RIG_DEBUG_TRACE, "%s: No set_vfo function rig so default vfo = %s\n",
|
||||||
|
__func__, rig_strvfo(rs->current_vfo));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
rig_debug(RIG_DEBUG_TRACE, "%s: default vfo = %s\n", __func__,
|
||||||
|
rig_strvfo(rs->current_vfo));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// try to turn off the screensaver if possible
|
// try to turn off the screensaver if possible
|
||||||
|
@ -1402,6 +1424,30 @@ int HAMLIB_API rig_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
||||||
|
|
||||||
vfo = vfo_fixup(rig, vfo);
|
vfo = vfo_fixup(rig, vfo);
|
||||||
|
|
||||||
|
// there are some rigs that can't get VFOA freq while VFOB is transmitting
|
||||||
|
// so we'll return the cached VFOA freq for them
|
||||||
|
// should we use the cached ptt maybe?
|
||||||
|
if (vfo == RIG_VFO_A && rig->state.cache.split &&
|
||||||
|
(rig->caps->rig_model == RIG_MODEL_FTDX101D || rig->caps->rig_model == RIG_MODEL_IC910))
|
||||||
|
{ // if we're in PTT don't get VFOA freq -- otherwise we interrupt transmission
|
||||||
|
ptt_t ptt;
|
||||||
|
retcode = rig_get_ptt(rig, RIG_VFO_CURR, &ptt);
|
||||||
|
|
||||||
|
if (retcode != RIG_OK)
|
||||||
|
{
|
||||||
|
return retcode;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ptt)
|
||||||
|
{
|
||||||
|
rig_debug(RIG_DEBUG_TRACE, "%s: split is on so returning VFOA last known freq\n",
|
||||||
|
__func__);
|
||||||
|
*freq = rig->state.cache.freq;
|
||||||
|
return RIG_OK;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
cache_ms = elapsed_ms(&rig->state.cache.time_freq, ELAPSED_GET);
|
cache_ms = elapsed_ms(&rig->state.cache.time_freq, ELAPSED_GET);
|
||||||
rig_debug(RIG_DEBUG_TRACE, "%s: cache check age=%dms\n", __func__, cache_ms);
|
rig_debug(RIG_DEBUG_TRACE, "%s: cache check age=%dms\n", __func__, cache_ms);
|
||||||
|
|
||||||
|
@ -1431,6 +1477,14 @@ int HAMLIB_API rig_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
||||||
|| vfo == RIG_VFO_CURR || vfo == rig->state.current_vfo
|
|| vfo == RIG_VFO_CURR || vfo == rig->state.current_vfo
|
||||||
|| rig->state.vfo_opt == 1)
|
|| rig->state.vfo_opt == 1)
|
||||||
{
|
{
|
||||||
|
// If rig does not have set_vfo we need to change vfo
|
||||||
|
if (vfo == RIG_VFO_CURR && caps->set_vfo == NULL)
|
||||||
|
{
|
||||||
|
vfo = vfo_fixup(rig, RIG_VFO_A);
|
||||||
|
rig_debug(RIG_DEBUG_TRACE, "%s: no set_vfo so vfo=%s\n", __func__,
|
||||||
|
rig_strvfo(vfo));
|
||||||
|
}
|
||||||
|
|
||||||
retcode = caps->get_freq(rig, vfo, freq);
|
retcode = caps->get_freq(rig, vfo, freq);
|
||||||
|
|
||||||
if (retcode == RIG_OK)
|
if (retcode == RIG_OK)
|
||||||
|
@ -1997,7 +2051,8 @@ int HAMLIB_API rig_get_vfo(RIG *rig, vfo_t *vfo)
|
||||||
rig->state.cache.vfo = *vfo;
|
rig->state.cache.vfo = *vfo;
|
||||||
cache_ms = elapsed_ms(&rig->state.cache.time_vfo, ELAPSED_SET);
|
cache_ms = elapsed_ms(&rig->state.cache.time_vfo, ELAPSED_SET);
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
cache_ms = elapsed_ms(&rig->state.cache.time_vfo, ELAPSED_INVALIDATE);
|
cache_ms = elapsed_ms(&rig->state.cache.time_vfo, ELAPSED_INVALIDATE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2155,7 +2155,7 @@ declare_proto_rot(d_mm2dec)
|
||||||
CHKSCN1ARG(sscanf(arg2, "%lf", &min));
|
CHKSCN1ARG(sscanf(arg2, "%lf", &min));
|
||||||
CHKSCN1ARG(sscanf(arg3, "%d", &sw));
|
CHKSCN1ARG(sscanf(arg3, "%d", &sw));
|
||||||
|
|
||||||
dec_deg = dmmm2dec(deg, min, sw);
|
dec_deg = dmmm2dec(deg, min, sw, 0.0); // we'll add real seconds when somebody asks for it
|
||||||
|
|
||||||
if ((interactive && prompt) || (interactive && !prompt && ext_resp))
|
if ((interactive && prompt) || (interactive && !prompt && ext_resp))
|
||||||
{
|
{
|
||||||
|
|
Ładowanie…
Reference in New Issue