kopia lustrzana https://github.com/Hamlib/Hamlib
Add help to N command in rigctl
rodzic
96fc685567
commit
882d22a50c
|
@ -852,6 +852,37 @@ int rig_sprintf_spectrum_avg_modes(char *str, int nlen,
|
|||
return len;
|
||||
}
|
||||
|
||||
int rig_sprintf_tuning_steps(char *str, int nlen, const struct tuning_step_list *tuning_step_list)
|
||||
{
|
||||
int i, len = 0;
|
||||
|
||||
*str = '\0';
|
||||
|
||||
for (i = 0; i < HAMLIB_TSLSTSIZ; i++)
|
||||
{
|
||||
int lentmp;
|
||||
|
||||
if (tuning_step_list[i].modes == RIG_MODE_NONE)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
lentmp = snprintf(str + len, nlen - len, "%s%d", i>0?", ":"", (int)tuning_step_list[i].ts);
|
||||
|
||||
if (len < 0 || lentmp >= nlen - len)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s(%d): overflowed str buffer\n", __FILE__, __LINE__);
|
||||
break;
|
||||
}
|
||||
|
||||
len += lentmp;
|
||||
check_buffer_overflow(str, len, nlen);
|
||||
}
|
||||
|
||||
return len;
|
||||
|
||||
}
|
||||
|
||||
char *get_rig_conf_type(enum rig_conf_e type)
|
||||
{
|
||||
switch (type)
|
||||
|
|
|
@ -51,6 +51,7 @@ extern HAMLIB_EXPORT( int ) rot_sprintf_status(char *str, int len, rot_status_t
|
|||
extern HAMLIB_EXPORT( int ) rig_sprintf_spectrum_modes(char *str, int nlen, const enum rig_spectrum_mode_e *modes);
|
||||
extern HAMLIB_EXPORT( int ) rig_sprintf_spectrum_spans(char *str, int nlen, const freq_t *spans);
|
||||
extern HAMLIB_EXPORT( int ) rig_sprintf_spectrum_avg_modes(char *str, int nlen, const struct rig_spectrum_avg_mode *avg_modes);
|
||||
extern HAMLIB_EXPORT( int ) rig_sprintf_tuning_steps(char *str, int nlen, const struct tuning_step_list *tuning_step_list);
|
||||
extern HAMLIB_EXPORT( char *) get_rig_conf_type(enum rig_conf_e type);
|
||||
extern HAMLIB_EXPORT( int ) print_ext_param(const struct confparams *cfp, rig_ptr_t ptr);
|
||||
|
||||
|
|
|
@ -3191,9 +3191,17 @@ declare_proto_rig(get_split_vfo)
|
|||
declare_proto_rig(set_ts)
|
||||
{
|
||||
unsigned long ts;
|
||||
char s[SPRINTF_MAX_SIZE];
|
||||
|
||||
ENTERFUNC2;
|
||||
|
||||
if (!strcmp(arg1, "?"))
|
||||
{
|
||||
rig_sprintf_tuning_steps(s, sizeof(s), rig->caps->tuning_steps);
|
||||
fprintf(fout, "%s\n", s);
|
||||
RETURNFUNC2(RIG_OK);
|
||||
}
|
||||
|
||||
CHKSCN1ARG(sscanf(arg1, "%lu", &ts));
|
||||
|
||||
RETURNFUNC2(rig_set_ts(rig, vfo, ts));
|
||||
|
|
Ładowanie…
Reference in New Issue