The D700 does not internally round the input frequency to the nearest

available frequency. Instead it returns an error code. This is an
issue for use with gpredict.  It is also inconsistent with other
backends, particularly the FT-857. (The rounding may occur in the radio
of the 857 but to the developer it appears transparent.)

This patch defines a simple wrapper around the th_set_freq call that
rounds the frequency to the nearest 5kHz.

Patch from Charles Suprin, AA1VS.


git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2977 7ae35d74-ebe9-4afe-98af-79ac388436b8
Hamlib-1.2.13
Stéphane Fillod, F8CFE 2010-09-13 07:46:21 +00:00
rodzic e417dd2dcd
commit 558b787b28
1 zmienionych plików z 12 dodań i 1 usunięć

Wyświetl plik

@ -72,6 +72,7 @@ static struct kenwood_priv_caps tmd700_priv_caps = {
};
static int tmd700_set_vfo (RIG *rig, vfo_t vfo);
static int tmd700_set_freq (RIG *rig, vfo_t vfo, freq_t freq);
/*
@ -185,7 +186,7 @@ const struct rig_caps tmd700_caps = {
.rig_init = kenwood_init,
.rig_cleanup = kenwood_cleanup,
.set_freq = th_set_freq,
.set_freq = tmd700_set_freq,
.get_freq = th_get_freq,
.set_mode = th_set_mode,
.get_mode = th_get_mode,
@ -271,4 +272,14 @@ int tmd700_set_vfo (RIG *rig, vfo_t vfo)
return RIG_OK;
}
static int tmd700_set_freq(RIG *rig, vfo_t vfo, freq_t freq){
/*make it so that the radio tunes to something close*/
/*the radio does not round internally so rounding it*/
/*to a raster before it passes to the radio is required*/
/*this may not be the completely correct raster as the*/
/*supports 6.25kHz channelization*/
freq_t freq2=round(freq/5000)*5000;
return th_set_freq(rig,vfo,freq2);
}
/* end of file */