implemented set_conf, get_conf and Token fast_set_commands for max throughput

Hamlib-3.1
dh1tw 2016-06-05 16:26:21 +02:00
rodzic f5f35800ec
commit eff99058d6
3 zmienionych plików z 63 dodań i 19 usunięć

Wyświetl plik

@ -190,6 +190,8 @@ const struct rig_caps ft950_caps = {
.rig_open = newcat_open, /* port opened */
.rig_close = newcat_close, /* port closed */
.set_conf = newcat_set_conf,
.get_conf = newcat_get_conf,
.set_freq = newcat_set_freq,
.get_freq = newcat_get_freq,
.set_mode = newcat_set_mode,
@ -232,4 +234,3 @@ const struct rig_caps ft950_caps = {
.get_channel = newcat_get_channel,
};

Wyświetl plik

@ -235,7 +235,6 @@ static ncboolean newcat_valid_command(RIG *rig, char *command);
int newcat_get_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->current_mem = NC_MEM_CHANNEL_NONE;
priv->fast_set_commands = FALSE;
return RIG_OK;
}
@ -354,6 +354,48 @@ int newcat_close(RIG *rig) {
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
*
@ -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)
{
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;
int retry_count = 0;
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 */
char const * const verify_cmd = RIG_MODEL_FT9000 == rig->caps->rig_model ? "AI;" : "ID;";

Wyświetl plik

@ -34,6 +34,7 @@
#define _NEWCAT_H 1
#include <tones.h>
#include <token.h>
/* Handy constants */
@ -49,7 +50,7 @@
typedef char ncboolean;
/* shared function version */
#define NEWCAT_VER "0.22"
#define NEWCAT_VER "0.23"
/* Hopefully large enough for future use, 128 chars plus '\0' */
#define NEWCAT_DATA_LEN 129
@ -85,6 +86,7 @@ struct newcat_priv_data {
int width_frequency; /* width of FA/FB freq response */
int offset_rit; /* offset of rit in response */
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.
@ -126,6 +134,9 @@ int newcat_cleanup(RIG *rig);
int newcat_open(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_get_freq(RIG *rig, vfo_t vfo, freq_t *freq);