Have Barret rigs use channel 9999 for temporary frequency changes

pull/928/head
Mike Black W9MDB 2022-01-08 07:09:07 -06:00
rodzic 088b718305
commit 4cb1a35a91
3 zmienionych plików z 56 dodań i 42 usunięć

Wyświetl plik

@ -48,19 +48,63 @@
#define BARRETT4050_FUNCTIONS (RIG_FUNC_TUNER) #define BARRETT4050_FUNCTIONS (RIG_FUNC_TUNER)
/*
* barrett4050_get_level
*/
static int barrett4050_get_level(RIG *rig, vfo_t vfo, setting_t level, static int barrett4050_get_level(RIG *rig, vfo_t vfo, setting_t level,
value_t *val); value_t *val)
{
return -RIG_ENIMPL;
}
static const char *barrett4050_get_info(RIG *rig); /*
* barrett4050_get_info
*/
static const char *barrett4050_get_info(RIG *rig)
{
char *response = NULL;
int retval;
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
retval = barrett_transaction(rig, "IV", 0, &response);
if (retval == RIG_OK)
{
rig_debug(RIG_DEBUG_ERR, "%s: result=%s\n", __func__, response);
}
else
{
rig_debug(RIG_DEBUG_VERBOSE, "Software Version %s\n", response);
}
return response;
}
static int barrett4050_open(RIG *rig)
{
int retval;
char *response;
ENTERFUNC;
barrett4050_get_info(rig);
retval = barrett_transaction(rig, "IDFS", 0, &response);
if (retval == RIG_OK)
{
rig_debug(RIG_DEBUG_ERR, "%s: result=%s\n", __func__, response);
}
RETURNFUNC(RIG_OK);
}
const struct rig_caps barrett4050_caps = const struct rig_caps barrett4050_caps =
{ {
RIG_MODEL(RIG_MODEL_BARRETT_4050), RIG_MODEL(RIG_MODEL_BARRETT_4050),
.model_name = "4050", .model_name = "4050",
.mfg_name = "Barrett", .mfg_name = "Barrett",
.version = BACKEND_VER ".0b", .version = BACKEND_VER ".0c",
.copyright = "LGPL", .copyright = "LGPL",
.status = RIG_STATUS_ALPHA, .status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER, .rig_type = RIG_TYPE_TRANSCEIVER,
.targetable_vfo = RIG_TARGETABLE_FREQ | RIG_TARGETABLE_MODE, .targetable_vfo = RIG_TARGETABLE_FREQ | RIG_TARGETABLE_MODE,
.ptt_type = RIG_PTT_RIG, .ptt_type = RIG_PTT_RIG,
@ -74,7 +118,7 @@ const struct rig_caps barrett4050_caps =
.serial_handshake = RIG_HANDSHAKE_XONXOFF, .serial_handshake = RIG_HANDSHAKE_XONXOFF,
.write_delay = 0, .write_delay = 0,
.post_write_delay = 0, .post_write_delay = 0,
.timeout = 1000, .timeout = 500,
.retry = 3, .retry = 3,
.has_get_func = BARRETT4050_FUNCTIONS, .has_get_func = BARRETT4050_FUNCTIONS,
@ -105,7 +149,7 @@ const struct rig_caps barrett4050_caps =
.rig_init = barrett_init, .rig_init = barrett_init,
.rig_cleanup = barrett_cleanup, .rig_cleanup = barrett_cleanup,
.rig_open = barrett_open, .rig_open = barrett4050_open,
.set_freq = barrett_set_freq, .set_freq = barrett_set_freq,
.get_freq = barrett_get_freq, .get_freq = barrett_get_freq,
@ -122,35 +166,3 @@ const struct rig_caps barrett4050_caps =
.get_split_vfo = barrett_get_split_vfo, .get_split_vfo = barrett_get_split_vfo,
.hamlib_check_rig_caps = "HAMLIB_CHECK_RIG_CAPS" .hamlib_check_rig_caps = "HAMLIB_CHECK_RIG_CAPS"
}; };
/*
* barrett4050_get_level
*/
int barrett4050_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
{
return -RIG_ENIMPL;
}
/*
* barrett4050_get_info
*/
const char *barrett4050_get_info(RIG *rig)
{
char *response = NULL;
int retval;
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
retval = barrett_transaction(rig, "IV", 0, &response);
if (retval == RIG_OK)
{
rig_debug(RIG_DEBUG_ERR, "%s: result=%s\n", __func__, response);
}
else
{
rig_debug(RIG_DEBUG_VERBOSE, "Software Version %s\n", response);
}
return response;
}

Wyświetl plik

@ -277,7 +277,7 @@ int barrett_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
if (vfo != RIG_VFO_B) if (vfo != RIG_VFO_B)
{ {
char *response = NULL; char *response = NULL;
sprintf((char *) cmd_buf, "PR%08.0f", freq); sprintf((char *) cmd_buf, "TC9999R%08.0f", freq);
retval = barrett_transaction(rig, cmd_buf, 0, &response); retval = barrett_transaction(rig, cmd_buf, 0, &response);
if (retval < 0) if (retval < 0)
@ -299,7 +299,7 @@ int barrett_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
{ {
char *response = NULL; char *response = NULL;
sprintf((char *) cmd_buf, "PT%08.0f", freq); sprintf((char *) cmd_buf, "TC9999T%08.0f", freq);
retval = barrett_transaction(rig, cmd_buf, 0, &response); retval = barrett_transaction(rig, cmd_buf, 0, &response);
if (retval < 0) if (retval < 0)

Wyświetl plik

@ -28,7 +28,7 @@
#include <sys/time.h> #include <sys/time.h>
#endif #endif
#define BACKEND_VER "20220107" #define BACKEND_VER "20220108"
#define EOM "\x0d" #define EOM "\x0d"
#define TRUE 1 #define TRUE 1
@ -37,6 +37,8 @@
// This will need a lot more room for some channel commands like IDFA which return all channels // This will need a lot more room for some channel commands like IDFA which return all channels
// But that would 9999*41 or 406KB so didn't do that right now // But that would 9999*41 or 406KB so didn't do that right now
#define BARRETT_DATA_LEN 64 #define BARRETT_DATA_LEN 64
// RET_LEN is # of max channels times the per-channel response length
#define BARRETT_RET_LEN 24*1000
extern const struct rig_caps barrett_caps; extern const struct rig_caps barrett_caps;
extern const struct rig_caps barrett950_caps; extern const struct rig_caps barrett950_caps;
@ -44,7 +46,7 @@ extern const struct rig_caps barrett4050_caps;
struct barrett_priv_data { struct barrett_priv_data {
char cmd_str[BARRETT_DATA_LEN]; /* command string buffer */ char cmd_str[BARRETT_DATA_LEN]; /* command string buffer */
char ret_data[BARRETT_DATA_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 */ char split; /* split on/off */
}; };