kopia lustrzana https://github.com/Hamlib/Hamlib
implemented set_conf, get_conf and Token fast_set_commands for max throughput
rodzic
f5f35800ec
commit
eff99058d6
|
@ -190,6 +190,8 @@ const struct rig_caps ft950_caps = {
|
||||||
.rig_open = newcat_open, /* port opened */
|
.rig_open = newcat_open, /* port opened */
|
||||||
.rig_close = newcat_close, /* port closed */
|
.rig_close = newcat_close, /* port closed */
|
||||||
|
|
||||||
|
.set_conf = newcat_set_conf,
|
||||||
|
.get_conf = newcat_get_conf,
|
||||||
.set_freq = newcat_set_freq,
|
.set_freq = newcat_set_freq,
|
||||||
.get_freq = newcat_get_freq,
|
.get_freq = newcat_get_freq,
|
||||||
.set_mode = newcat_set_mode,
|
.set_mode = newcat_set_mode,
|
||||||
|
@ -232,4 +234,3 @@ const struct rig_caps ft950_caps = {
|
||||||
.get_channel = newcat_get_channel,
|
.get_channel = newcat_get_channel,
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -235,7 +235,6 @@ static ncboolean newcat_valid_command(RIG *rig, char *command);
|
||||||
int newcat_get_cmd(RIG * rig);
|
int newcat_get_cmd(RIG * rig);
|
||||||
int newcat_set_cmd (RIG *rig);
|
int newcat_set_cmd (RIG *rig);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ************************************
|
* ************************************
|
||||||
*
|
*
|
||||||
|
@ -272,6 +271,7 @@ int newcat_init(RIG *rig) {
|
||||||
|
|
||||||
priv->rig_id = NC_RIGID_NONE;
|
priv->rig_id = NC_RIGID_NONE;
|
||||||
priv->current_mem = NC_MEM_CHANNEL_NONE;
|
priv->current_mem = NC_MEM_CHANNEL_NONE;
|
||||||
|
priv->fast_set_commands = FALSE;
|
||||||
|
|
||||||
return RIG_OK;
|
return RIG_OK;
|
||||||
}
|
}
|
||||||
|
@ -354,6 +354,48 @@ int newcat_close(RIG *rig) {
|
||||||
return RIG_OK;
|
return RIG_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int newcat_set_conf(RIG *rig, token_t token, const char *val){
|
||||||
|
int ret = RIG_OK;
|
||||||
|
|
||||||
|
if (rig == NULL){
|
||||||
|
return -RIG_EARG;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct newcat_priv_data *priv = rig->state.priv;
|
||||||
|
switch (token) {
|
||||||
|
case TOK_FAST_SET_CMD:
|
||||||
|
priv->fast_set_commands = (int)val;
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
ret = -RIG_EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
int newcat_get_conf(RIG *rig, token_t token, char *val){
|
||||||
|
int ret = RIG_OK;
|
||||||
|
|
||||||
|
if (rig == NULL) {
|
||||||
|
return -RIG_EARG;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct newcat_priv_data *priv = rig->state.priv;
|
||||||
|
switch (token) {
|
||||||
|
case TOK_FAST_SET_CMD:
|
||||||
|
val = (char*)priv->fast_set_commands;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
ret = -RIG_EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* rig_set_freq
|
* rig_set_freq
|
||||||
*
|
*
|
||||||
|
@ -2684,22 +2726,6 @@ int newcat_get_ext_parm(RIG *rig, token_t token, value_t *val)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int newcat_set_conf(RIG * rig, token_t token, const char *val)
|
|
||||||
{
|
|
||||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
|
||||||
|
|
||||||
return -RIG_ENAVAIL;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int newcat_get_conf(RIG * rig, token_t token, char *val)
|
|
||||||
{
|
|
||||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
|
||||||
|
|
||||||
return -RIG_ENAVAIL;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int newcat_send_dtmf(RIG * rig, vfo_t vfo, const char *digits)
|
int newcat_send_dtmf(RIG * rig, vfo_t vfo, const char *digits)
|
||||||
{
|
{
|
||||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
||||||
|
@ -4349,6 +4375,12 @@ int newcat_set_cmd (RIG *rig)
|
||||||
struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
|
struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
|
||||||
int retry_count = 0;
|
int retry_count = 0;
|
||||||
int rc = -RIG_EPROTO;
|
int rc = -RIG_EPROTO;
|
||||||
|
|
||||||
|
/* skip validation if high throughput is needed */
|
||||||
|
if (priv->fast_set_commands == 1){
|
||||||
|
return RIG_OK;
|
||||||
|
}
|
||||||
|
|
||||||
/* pick a basic quick query command for verification */
|
/* pick a basic quick query command for verification */
|
||||||
char const * const verify_cmd = RIG_MODEL_FT9000 == rig->caps->rig_model ? "AI;" : "ID;";
|
char const * const verify_cmd = RIG_MODEL_FT9000 == rig->caps->rig_model ? "AI;" : "ID;";
|
||||||
|
|
||||||
|
|
|
@ -34,6 +34,7 @@
|
||||||
#define _NEWCAT_H 1
|
#define _NEWCAT_H 1
|
||||||
|
|
||||||
#include <tones.h>
|
#include <tones.h>
|
||||||
|
#include <token.h>
|
||||||
|
|
||||||
/* Handy constants */
|
/* Handy constants */
|
||||||
|
|
||||||
|
@ -49,7 +50,7 @@
|
||||||
typedef char ncboolean;
|
typedef char ncboolean;
|
||||||
|
|
||||||
/* shared function version */
|
/* shared function version */
|
||||||
#define NEWCAT_VER "0.22"
|
#define NEWCAT_VER "0.23"
|
||||||
|
|
||||||
/* Hopefully large enough for future use, 128 chars plus '\0' */
|
/* Hopefully large enough for future use, 128 chars plus '\0' */
|
||||||
#define NEWCAT_DATA_LEN 129
|
#define NEWCAT_DATA_LEN 129
|
||||||
|
@ -85,6 +86,7 @@ struct newcat_priv_data {
|
||||||
int width_frequency; /* width of FA/FB freq response */
|
int width_frequency; /* width of FA/FB freq response */
|
||||||
int offset_rit; /* offset of rit in response */
|
int offset_rit; /* offset of rit in response */
|
||||||
int trn_state; /* AI state found at startup */
|
int trn_state; /* AI state found at startup */
|
||||||
|
int fast_set_commands; /* do not check for ACK/NAK; needed for high throughput > 100 commands/s */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -115,6 +117,12 @@ struct newcat_priv_data {
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* configuration Tokens
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define TOK_FAST_SET_CMD TOKEN_BACKEND(1)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* newcat function definitions.
|
* newcat function definitions.
|
||||||
|
@ -126,6 +134,9 @@ int newcat_cleanup(RIG *rig);
|
||||||
int newcat_open(RIG *rig);
|
int newcat_open(RIG *rig);
|
||||||
int newcat_close(RIG *rig);
|
int newcat_close(RIG *rig);
|
||||||
|
|
||||||
|
int newcat_set_conf(RIG *, token_t, const char *val);
|
||||||
|
int newcat_get_conf(RIG *, token_t, char *val);
|
||||||
|
|
||||||
int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq);
|
int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq);
|
||||||
int newcat_get_freq(RIG *rig, vfo_t vfo, freq_t *freq);
|
int newcat_get_freq(RIG *rig, vfo_t vfo, freq_t *freq);
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue