kopia lustrzana https://github.com/Hamlib/Hamlib
Change Barrett 4050 to channelized frequency method.
The TC command is not implemented yet in the 4050. Barrett said eeprom is good for 1,000,000 writes https://github.com/Hamlib/Hamlib/issues/923pull/928/head
rodzic
acf682c498
commit
b2254a5667
|
@ -47,6 +47,7 @@
|
|||
|
||||
#define BARRETT4050_FUNCTIONS (RIG_FUNC_TUNER)
|
||||
|
||||
extern int barret950_get_freq(RIG *rig, vfo_t vfo, freq_t freq);
|
||||
|
||||
/*
|
||||
* barrett4050_get_level
|
||||
|
@ -85,6 +86,7 @@ static int barrett4050_open(RIG *rig)
|
|||
{
|
||||
int retval;
|
||||
char *response;
|
||||
struct barrett_priv_data *priv = rig->state.priv;
|
||||
ENTERFUNC;
|
||||
barrett4050_get_info(rig);
|
||||
retval = barrett_transaction(rig, "IDC9999", 0, &response);
|
||||
|
@ -92,6 +94,7 @@ static int barrett4050_open(RIG *rig)
|
|||
if (retval == RIG_OK)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: channel 9999 info=%s\n", __func__, response);
|
||||
priv->channel_base = 9990;
|
||||
}
|
||||
|
||||
retval = barrett_transaction(rig, "XC9999", 0, &response);
|
||||
|
@ -116,9 +119,9 @@ const struct rig_caps barrett4050_caps =
|
|||
RIG_MODEL(RIG_MODEL_BARRETT_4050),
|
||||
.model_name = "4050",
|
||||
.mfg_name = "Barrett",
|
||||
.version = BACKEND_VER ".0c",
|
||||
.version = BACKEND_VER ".0d",
|
||||
.copyright = "LGPL",
|
||||
.status = RIG_STATUS_STABLE,
|
||||
.status = RIG_STATUS_BETA,
|
||||
.rig_type = RIG_TYPE_TRANSCEIVER,
|
||||
.targetable_vfo = RIG_TARGETABLE_FREQ | RIG_TARGETABLE_MODE,
|
||||
.ptt_type = RIG_PTT_RIG,
|
||||
|
@ -165,7 +168,9 @@ const struct rig_caps barrett4050_caps =
|
|||
.rig_cleanup = barrett_cleanup,
|
||||
.rig_open = barrett4050_open,
|
||||
|
||||
.set_freq = barrett_set_freq,
|
||||
// Barrett said eeprom is good for 1M writes so channelized should be OK for a long time
|
||||
// TC command was not implemented as of 2022-01-12 which would be better
|
||||
.set_freq = barrett950_set_freq,
|
||||
.get_freq = barrett_get_freq,
|
||||
.set_mode = barrett_set_mode,
|
||||
.get_mode = barrett_get_mode,
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
#define BARRETT950_LEVELS (RIG_LEVEL_NONE)
|
||||
|
||||
|
||||
static int barrett950_set_freq(RIG *rig, vfo_t vfo, freq_t freq);
|
||||
int barrett950_set_freq(RIG *rig, vfo_t vfo, freq_t freq);
|
||||
|
||||
static int barrett950_get_level(RIG *rig, vfo_t vfo, setting_t level,
|
||||
value_t *val);
|
||||
|
@ -158,6 +158,7 @@ int barrett950_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
|||
freq_t freq_rx, freq_tx;
|
||||
freq_t freq_MHz;
|
||||
char *response = NULL;
|
||||
struct barrett_priv_data *priv = rig->state.priv;
|
||||
//struct barrett_priv_data *priv = rig->state.priv;
|
||||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: vfo=%s freq=%.0f\n", __func__,
|
||||
|
@ -175,7 +176,8 @@ int barrett950_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
|||
{
|
||||
if (freq_MHz >= chan_map[i].lo && freq_MHz <= chan_map[i].hi)
|
||||
{
|
||||
chan = CHANNEL_BASE + chan_map[i].chan_offset;
|
||||
int channel_base = priv->channel_base;
|
||||
chan = channel_base + chan_map[i].chan_offset;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -260,6 +260,7 @@ int barrett_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
|||
}
|
||||
|
||||
|
||||
// TC command does not work on 4050 -- not implemented as of 2022-01-12
|
||||
/*
|
||||
* barrett_set_freq
|
||||
* assumes rig!=NULL, rig->state.priv!=NULL
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
#include <sys/time.h>
|
||||
#endif
|
||||
|
||||
#define BACKEND_VER "20220109"
|
||||
#define BACKEND_VER "20220112"
|
||||
|
||||
#define EOM "\x0d"
|
||||
#define TRUE 1
|
||||
|
@ -46,8 +46,9 @@ extern const struct rig_caps barrett4050_caps;
|
|||
|
||||
struct barrett_priv_data {
|
||||
char cmd_str[BARRETT_DATA_LEN]; /* command string buffer */
|
||||
char ret_data[BARRETT_RET_LEN]; /* returned data--max value, most are less */
|
||||
char ret_data[BARRETT_RET_LEN]; /* returned data--max value, most are less */
|
||||
char split; /* split on/off */
|
||||
int channel_base; /* base channel for 0-9 10-channel assignment if needed */
|
||||
};
|
||||
|
||||
extern int barrett_transaction(RIG *rig, char *cmd, int expected, char **result);
|
||||
|
@ -55,7 +56,7 @@ extern int barrett_transaction(RIG *rig, char *cmd, int expected, char **result)
|
|||
extern int barrett_init(RIG *rig);
|
||||
extern int barrett_cleanup(RIG *rig);
|
||||
extern int barrett_open(RIG *rig);
|
||||
extern int barrett_set_freq(RIG *rig, vfo_t vfo, freq_t freq);
|
||||
extern int barrett950_set_freq(RIG *rig, vfo_t vfo, freq_t freq);
|
||||
extern int barrett_get_freq(RIG *rig, vfo_t vfo, freq_t *freq);
|
||||
extern int barrett_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width);
|
||||
extern int barrett_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode,
|
||||
|
|
Ładowanie…
Reference in New Issue