kopia lustrzana https://github.com/Hamlib/Hamlib
Merge branch 'master' into rp12
commit
a2aecdcf02
|
@ -722,6 +722,12 @@ typedef enum {
|
|||
RIG_RESET_MASTER = (1 << 3) /*!< Master reset */
|
||||
} reset_t;
|
||||
|
||||
typedef enum {
|
||||
RIG_CLIENT_UNKNOWN,
|
||||
RIG_CLIENT_WSJTX,
|
||||
RIG_CLIENT_GPREDICT
|
||||
} client_t;
|
||||
|
||||
|
||||
/**
|
||||
* \brief VFO operation
|
||||
|
@ -2877,6 +2883,7 @@ struct rig_state {
|
|||
int post_ptt_delay; /*!< delay after PTT to allow for relays and such */
|
||||
struct timespec freq_event_elapsed;
|
||||
int freq_skip; /*!< allow frequency skip for gpredict RX/TX freq set */
|
||||
client_t client;
|
||||
// New rig_state items go before this line ============================================
|
||||
};
|
||||
|
||||
|
@ -3746,6 +3753,7 @@ extern HAMLIB_EXPORT_VAR(char) debugmsgsave[DEBUGMSGSAVE_SIZE]; // last debug m
|
|||
extern HAMLIB_EXPORT_VAR(char) debugmsgsave2[DEBUGMSGSAVE_SIZE]; // last-1 debug msg
|
||||
// debugmsgsave3 is deprecated
|
||||
extern HAMLIB_EXPORT_VAR(char) debugmsgsave3[DEBUGMSGSAVE_SIZE]; // last-2 debug msg
|
||||
#define rig_debug_clear() { debugmsgsave[0] = debugmsgsave2[0] = debugmsgsave3[0] = 0; };
|
||||
#ifndef __cplusplus
|
||||
#ifdef __GNUC__
|
||||
// doing the debug macro with a dummy sprintf allows gcc to check the format string
|
||||
|
|
61
src/conf.c
61
src/conf.c
|
@ -225,6 +225,11 @@ static const struct confparams frontend_cfg_params[] =
|
|||
"True enables skipping setting the TX_VFO when RX_VFO is receiving and skips RX_VFO when TX_VFO is transmitting",
|
||||
"0", RIG_CONF_CHECKBUTTON, { }
|
||||
},
|
||||
{
|
||||
TOK_CLIENT, "client", "Set client name for special handling",
|
||||
"Knows about WSJTX and GPREDICT as of 20240702",
|
||||
"0", RIG_CONF_CHECKBUTTON, { }
|
||||
},
|
||||
|
||||
{ RIG_CONF_END, NULL, }
|
||||
};
|
||||
|
@ -256,16 +261,22 @@ static int frontend_set_conf(RIG *rig, hamlib_token_t token, const char *val)
|
|||
{
|
||||
case TOK_PATHNAME:
|
||||
strncpy(rp->pathname, val, HAMLIB_FILPATHLEN - 1);
|
||||
if (strstr(rig->caps->model_name,"SmartSDR Slice"))
|
||||
|
||||
if (strstr(rig->caps->model_name, "SmartSDR Slice"))
|
||||
{
|
||||
// override any port selection to prevent user errors/questions
|
||||
char *val2 = strdup(val);
|
||||
char *p = strchr(val2,':'); // port in here?
|
||||
if (p) {
|
||||
char *p = strchr(val2, ':'); // port in here?
|
||||
|
||||
if (p)
|
||||
{
|
||||
*p = 0; // terminate it
|
||||
rig_debug(RIG_DEBUG_WARN, "%s: overriding port and changing to 4992\n", __func__);
|
||||
rig_debug(RIG_DEBUG_WARN, "%s: overriding port and changing to 4992\n",
|
||||
__func__);
|
||||
}
|
||||
|
||||
sprintf(rs->rigport_deprecated.pathname, "%s:%s", val2, "4992");
|
||||
|
||||
strcpy(rp->pathname, rs->rigport_deprecated.pathname);
|
||||
rig_debug(RIG_DEBUG_WARN, "%s: pathname=%s\n", __func__, rp->pathname);
|
||||
free(val2);
|
||||
|
@ -274,6 +285,7 @@ static int frontend_set_conf(RIG *rig, hamlib_token_t token, const char *val)
|
|||
{
|
||||
strncpy(rs->rigport_deprecated.pathname, val, HAMLIB_FILPATHLEN - 1);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case TOK_WRITE_DELAY:
|
||||
|
@ -850,6 +862,19 @@ static int frontend_set_conf(RIG *rig, hamlib_token_t token, const char *val)
|
|||
rs->freq_skip = val_i != 0;
|
||||
break;
|
||||
|
||||
case TOK_CLIENT:
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: Client claims to be %s\n", __func__, val);
|
||||
|
||||
if (strcasecmp(val, "WSJTX") == 0) { rig->state.client = RIG_CLIENT_WSJTX; }
|
||||
else if (strcasecmp(val, "GPREDICT") == 0) { rig->state.client = RIG_CLIENT_GPREDICT; }
|
||||
else
|
||||
{
|
||||
rig->state.client = RIG_CLIENT_UNKNOWN;
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: unknown client=%s\n", __func__, val);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
return -RIG_EINVAL;
|
||||
}
|
||||
|
@ -862,7 +887,8 @@ static int frontend_set_conf(RIG *rig, hamlib_token_t token, const char *val)
|
|||
* frontend_get_conf
|
||||
* assumes rig!=NULL, val!=NULL
|
||||
*/
|
||||
static int frontend_get_conf2(RIG *rig, hamlib_token_t token, char *val, int val_len)
|
||||
static int frontend_get_conf2(RIG *rig, hamlib_token_t token, char *val,
|
||||
int val_len)
|
||||
{
|
||||
struct rig_state *rs;
|
||||
const char *s = "";
|
||||
|
@ -898,6 +924,28 @@ static int frontend_get_conf2(RIG *rig, hamlib_token_t token, char *val, int val
|
|||
SNPRINTF(val, val_len, "%d", rp->retry);
|
||||
break;
|
||||
|
||||
case TOK_CLIENT:
|
||||
{
|
||||
char *client;
|
||||
|
||||
switch (rig->state.client)
|
||||
{
|
||||
case RIG_CLIENT_UNKNOWN: client = "UNKNOWN"; break;
|
||||
|
||||
case RIG_CLIENT_WSJTX: client = "WSJTX"; break;
|
||||
|
||||
case RIG_CLIENT_GPREDICT: client = "GPREDICT"; break;
|
||||
|
||||
default:
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: Unknown client=%d\n", __func__,
|
||||
rig->state.client);
|
||||
rig->state.client = RIG_CLIENT_UNKNOWN;
|
||||
}
|
||||
|
||||
SNPRINTF(val, val_len, "%s", client);
|
||||
}
|
||||
break;
|
||||
|
||||
#if 0 // needs to be replace?
|
||||
|
||||
case TOK_ITU_REGION:
|
||||
|
@ -1471,7 +1519,8 @@ int HAMLIB_API rig_get_conf(RIG *rig, hamlib_token_t token, char *val)
|
|||
return rig_get_conf2(rig, token, val, 128);
|
||||
}
|
||||
|
||||
int HAMLIB_API rig_get_conf2(RIG *rig, hamlib_token_t token, char *val, int val_len)
|
||||
int HAMLIB_API rig_get_conf2(RIG *rig, hamlib_token_t token, char *val,
|
||||
int val_len)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
||||
|
||||
|
|
14
src/rig.c
14
src/rig.c
|
@ -1065,6 +1065,20 @@ int HAMLIB_API rig_open(RIG *rig)
|
|||
rp->pathname);
|
||||
rp->type.rig = RIG_PORT_NETWORK;
|
||||
|
||||
if (rig->caps->rig_model == RIG_MODEL_SMARTSDR_A
|
||||
|| rig->caps->rig_model == RIG_MODEL_SMARTSDR_B
|
||||
|| rig->caps->rig_model == RIG_MODEL_SMARTSDR_C
|
||||
|| rig->caps->rig_model == RIG_MODEL_SMARTSDR_D
|
||||
|| rig->caps->rig_model == RIG_MODEL_SMARTSDR_E
|
||||
|| rig->caps->rig_model == RIG_MODEL_SMARTSDR_F
|
||||
|| rig->caps->rig_model == RIG_MODEL_SMARTSDR_G
|
||||
|| rig->caps->rig_model == RIG_MODEL_SMARTSDR_H
|
||||
)
|
||||
{
|
||||
rig_debug_clear();
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: Do not use 127.0.0.1 for SmartSDR. Network Server entry needs to be the Radio's IP address, no port necessary\n", __func__);
|
||||
return -RIG_EINVAL;
|
||||
}
|
||||
if (RIG_BACKEND_NUM(rig->caps->rig_model) == RIG_ICOM)
|
||||
{
|
||||
// Xiegu X6100 does TCP and does not support UDP spectrum that I know of
|
||||
|
|
|
@ -143,6 +143,8 @@
|
|||
#define TOK_MULTICAST_CMD_PORT TOKEN_FRONTEND(135)
|
||||
/** \brief rig: Skip setting freq on opposite VFO when in split mode */
|
||||
#define TOK_FREQ_SKIP TOKEN_FRONTEND(136)
|
||||
/** \brief rig: Client ID of WSJTX or GPREDICT */
|
||||
#define TOK_CLIENT TOKEN_FRONTEND(137)
|
||||
|
||||
/*
|
||||
* rotator specific tokens
|
||||
|
|
Ładowanie…
Reference in New Issue