kopia lustrzana https://github.com/Hamlib/Hamlib
Phase 1 of changing sprintflst functions to use buffer length
https://github.com/Hamlib/Hamlib/issues/580pull/574/head
rodzic
41bfd57eb3
commit
82126a4f09
|
@ -1,6 +1,6 @@
|
|||
|
||||
lib_LTLIBRARIES = libhamlib++.la
|
||||
libhamlib___la_SOURCES = rigclass.cc rotclass.cc
|
||||
libhamlib___la_SOURCES = rigclass.cc rotclass.cc ampclass.cc
|
||||
libhamlib___la_LDFLAGS = -no-undefined -version-info $(ABI_VERSION):$(ABI_REVISION):$(ABI_AGE) $(LDFLAGS)
|
||||
libhamlib___la_LIBADD = $(top_builddir)/src/libhamlib.la
|
||||
AM_CXXFLAGS=$(CXXFLAGS)
|
||||
|
|
|
@ -38,6 +38,11 @@ public:
|
|||
|
||||
virtual ~Amplifier();
|
||||
|
||||
Amplifier(const Amplifier&) = default;
|
||||
Amplifier(Amplifier&&) = default;
|
||||
Amplifier& operator=(const Amplifier&) = default;
|
||||
Amplifier& operator=(Amplifier&&) = default;
|
||||
|
||||
const struct amp_caps *caps;
|
||||
|
||||
// This method opens the communication port to the amp
|
||||
|
|
|
@ -2329,8 +2329,8 @@ extern HAMLIB_EXPORT(int)
|
|||
rig_get_vfo_info HAMLIB_PARAMS((RIG *rig,
|
||||
vfo_t vfo, freq_t *freq, rmode_t *mode, pbwidth_t *width, split_t *split));
|
||||
|
||||
extern HAMLIB_EXPORT(const char *)
|
||||
rig_get_vfo_list HAMLIB_PARAMS((RIG *rig));
|
||||
extern HAMLIB_EXPORT(int)
|
||||
rig_get_vfo_list HAMLIB_PARAMS((RIG *rig, char *buf, int buflen));
|
||||
|
||||
extern HAMLIB_EXPORT(int)
|
||||
netrigctl_get_vfo_mode HAMLIB_PARAMS((RIG *rig));
|
||||
|
|
|
@ -38,6 +38,11 @@ public:
|
|||
|
||||
virtual ~Rig();
|
||||
|
||||
Rig(const Rig&) = default;
|
||||
Rig(Rig&&) = default;
|
||||
Rig& operator=(const Rig&) = default;
|
||||
Rig& operator=(Rig&&) = default;
|
||||
|
||||
const struct rig_caps *caps;
|
||||
|
||||
// This method opens the communication port to the rig
|
||||
|
|
|
@ -38,6 +38,11 @@ public:
|
|||
|
||||
virtual ~Rotator();
|
||||
|
||||
Rotator(const Rotator&) = default;
|
||||
Rotator(Rotator&&) = default;
|
||||
Rotator& operator=(const Rotator&) = default;
|
||||
Rotator& operator=(Rotator&&) = default;
|
||||
|
||||
const struct rot_caps *caps;
|
||||
|
||||
// This method opens the communication port to the rot
|
||||
|
|
|
@ -389,7 +389,7 @@ static int dummy_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
|||
if (vfo == RIG_VFO_CURR) { vfo = priv->curr_vfo; }
|
||||
|
||||
usleep(CMDSLEEP);
|
||||
sprintf_freq(fstr, freq);
|
||||
sprintf_freq(fstr, sizeof(fstr), freq);
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called: %s %s\n", __func__,
|
||||
rig_strvfo(vfo), fstr);
|
||||
|
||||
|
@ -451,7 +451,7 @@ static int dummy_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
|
||||
ENTERFUNC;
|
||||
usleep(CMDSLEEP);
|
||||
sprintf_freq(buf, width);
|
||||
sprintf_freq(buf, sizeof(buf), width);
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called: %s %s %s\n", __func__,
|
||||
rig_strvfo(vfo), rig_strrmode(mode), buf);
|
||||
|
||||
|
|
|
@ -694,7 +694,7 @@ int dttsp_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
|||
|
||||
max_delta = priv->sample_rate / 2 - kHz(2);
|
||||
|
||||
sprintf_freq(fstr, freq);
|
||||
sprintf_freq(fstr, sizeof(fstr), freq);
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s called: %s %s\n",
|
||||
__func__, rig_strvfo(vfo), fstr);
|
||||
|
||||
|
@ -730,7 +730,7 @@ int dttsp_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
|||
|
||||
priv->rx_delta_f = freq - tuner_freq;
|
||||
|
||||
sprintf_freq(fstr, tuner_freq);
|
||||
sprintf_freq(fstr, sizeof(fstr), tuner_freq);
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: tuner=%s, rx_delta=%d Hz\n",
|
||||
__func__, fstr, priv->rx_delta_f);
|
||||
|
||||
|
@ -802,7 +802,7 @@ int dttsp_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
width = rig_passband_normal(rig, mode);
|
||||
}
|
||||
|
||||
sprintf_freq(buf, width);
|
||||
sprintf_freq(buf, sizeof(buf), width);
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called: %s %s\n",
|
||||
__func__, rig_strrmode(mode), buf);
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ static int miniVNA_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
|||
char cmdstr[40];
|
||||
int retval;
|
||||
|
||||
sprintf_freq(fstr, freq);
|
||||
sprintf_freq(fstr, sizeof(fstr), freq);
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s called: %s %s\n", __func__,
|
||||
rig_strvfo(vfo), fstr);
|
||||
|
||||
|
|
|
@ -2,10 +2,12 @@
|
|||
|
||||
RIGSRC = rig.c serial.c serial.h misc.c misc.h register.c register.h event.c \
|
||||
event.h cal.c cal.h conf.c tones.c tones.h rotator.c locator.c rot_reg.c \
|
||||
rot_conf.c rot_conf.h rot_settings.c rot_ext.c iofunc.c iofunc.h ext.c mem.c settings.c \
|
||||
parallel.c parallel.h usb_port.c usb_port.h debug.c network.c network.h \
|
||||
cm108.c cm108.h gpio.c gpio.h idx_builtin.h token.h par_nt.h microham.c microham.h \
|
||||
amplifier.c amp_reg.c amp_conf.c amp_conf.h amp_settings.c extamp.c sleep.c sleep.h
|
||||
rot_conf.c rot_conf.h rot_settings.c rot_ext.c iofunc.c iofunc.h ext.c \
|
||||
mem.c settings.c parallel.c parallel.h usb_port.c usb_port.h debug.c \
|
||||
network.c network.h cm108.c cm108.h gpio.c gpio.h idx_builtin.h token.h \
|
||||
par_nt.h microham.c microham.h amplifier.c amp_reg.c amp_conf.c \
|
||||
amp_conf.h amp_settings.c extamp.c sleep.c sleep.h sprintflst.c \
|
||||
sprintflst.h
|
||||
|
||||
lib_LTLIBRARIES = libhamlib.la
|
||||
libhamlib_la_SOURCES = $(RIGSRC)
|
||||
|
|
|
@ -347,7 +347,7 @@ int millis_to_dot10ths(int millis, int wpm)
|
|||
* pretty print frequencies
|
||||
* str must be long enough. max can be as long as 17 chars
|
||||
*/
|
||||
int HAMLIB_API sprintf_freq(char *str, freq_t freq)
|
||||
int HAMLIB_API sprintf_freq(char *str, int nlen, freq_t freq)
|
||||
{
|
||||
double f;
|
||||
char *hz;
|
||||
|
|
|
@ -76,7 +76,7 @@ extern HAMLIB_EXPORT(double) morse_code_dot_to_millis(int wpm);
|
|||
extern HAMLIB_EXPORT(int) dot10ths_to_millis(int dot10ths, int wpm);
|
||||
extern HAMLIB_EXPORT(int) millis_to_dot10ths(int millis, int wpm);
|
||||
|
||||
extern HAMLIB_EXPORT(int) sprintf_freq(char *str, freq_t);
|
||||
extern HAMLIB_EXPORT(int) sprintf_freq(char *str, int len, freq_t);
|
||||
|
||||
/* flag that determines if AI mode should be restored on exit on
|
||||
applicable rigs - See rig_no_restore_ai() */
|
||||
|
|
13
src/rig.c
13
src/rig.c
|
@ -71,6 +71,7 @@
|
|||
#include "cm108.h"
|
||||
#include "gpio.h"
|
||||
#include "misc.h"
|
||||
#include "sprintflst.h"
|
||||
|
||||
/**
|
||||
* \brief Hamlib release number
|
||||
|
@ -5801,23 +5802,29 @@ int HAMLIB_API rig_get_vfo_info(RIG *rig, vfo_t vfo, freq_t *freq,
|
|||
/**
|
||||
* \brief get list of available vfos
|
||||
* \param rig The rig handle
|
||||
* \param char* char buffer[SPRINTF_MAX_SIZE] to hold result
|
||||
* \param len max length of char buffer
|
||||
*
|
||||
* Retrieves all usable vfo entries for the rig
|
||||
*
|
||||
* \return a pointer to a string, e.g. "VFOA VFOB Mem"
|
||||
* if the operation has been successful, otherwise NULL if an error occurred
|
||||
*/
|
||||
const char *HAMLIB_API rig_get_vfo_list(RIG *rig)
|
||||
int HAMLIB_API rig_get_vfo_list(RIG *rig, char *buf, int buflen)
|
||||
{
|
||||
ENTERFUNC;
|
||||
|
||||
// to be completed
|
||||
if (CHECK_RIG_ARG(rig))
|
||||
{
|
||||
RETURNFUNC(NULL);
|
||||
RETURNFUNC(-RIG_EINVAL);
|
||||
}
|
||||
|
||||
RETURNFUNC(NULL);
|
||||
char s[256];
|
||||
rig_sprintf_vfo(s, sizeof(s), rig->state.vfo_list);
|
||||
|
||||
|
||||
RETURNFUNC(RIG_OK);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
/* #define DUMMY_ALL 0x7ffffffffffffffLL */
|
||||
#define DUMMY_ALL ((setting_t)-1)
|
||||
|
||||
int rig_sprintf_vfo(char *str, vfo_t vfo)
|
||||
int rig_sprintf_vfo(char *str, int nlen, vfo_t vfo)
|
||||
{
|
||||
unsigned int i, len = 0;
|
||||
|
||||
|
@ -64,7 +64,7 @@ int rig_sprintf_vfo(char *str, vfo_t vfo)
|
|||
}
|
||||
|
||||
|
||||
int rig_sprintf_mode(char *str, rmode_t mode)
|
||||
int rig_sprintf_mode(char *str, int nlen, rmode_t mode)
|
||||
{
|
||||
uint64_t i, len = 0;
|
||||
|
||||
|
@ -93,7 +93,7 @@ int rig_sprintf_mode(char *str, rmode_t mode)
|
|||
}
|
||||
|
||||
|
||||
int rig_sprintf_ant(char *str, ant_t ant)
|
||||
int rig_sprintf_ant(char *str, int nlen, ant_t ant)
|
||||
{
|
||||
int i, len = 0;
|
||||
char *ant_name;
|
||||
|
@ -140,7 +140,7 @@ int rig_sprintf_ant(char *str, ant_t ant)
|
|||
}
|
||||
|
||||
|
||||
int rig_sprintf_func(char *str, setting_t func)
|
||||
int rig_sprintf_func(char *str, int nlen, setting_t func)
|
||||
{
|
||||
uint64_t i, len = 0;
|
||||
|
||||
|
@ -169,7 +169,7 @@ int rig_sprintf_func(char *str, setting_t func)
|
|||
}
|
||||
|
||||
|
||||
int rot_sprintf_func(char *str, setting_t func)
|
||||
int rot_sprintf_func(char *str, int nlen, setting_t func)
|
||||
{
|
||||
uint64_t i, len = 0;
|
||||
|
||||
|
@ -198,7 +198,7 @@ int rot_sprintf_func(char *str, setting_t func)
|
|||
}
|
||||
|
||||
|
||||
int rig_sprintf_level(char *str, setting_t level)
|
||||
int rig_sprintf_level(char *str, int nlen, setting_t level)
|
||||
{
|
||||
int i, len = 0;
|
||||
|
||||
|
@ -227,7 +227,7 @@ int rig_sprintf_level(char *str, setting_t level)
|
|||
}
|
||||
|
||||
|
||||
int rot_sprintf_level(char *str, setting_t level)
|
||||
int rot_sprintf_level(char *str, int nlen, setting_t level)
|
||||
{
|
||||
int i, len = 0;
|
||||
|
||||
|
@ -256,7 +256,7 @@ int rot_sprintf_level(char *str, setting_t level)
|
|||
}
|
||||
|
||||
|
||||
int amp_sprintf_level(char *str, setting_t level)
|
||||
int amp_sprintf_level(char *str, int nlen, setting_t level)
|
||||
{
|
||||
int i, len = 0;
|
||||
|
||||
|
@ -285,7 +285,7 @@ int amp_sprintf_level(char *str, setting_t level)
|
|||
}
|
||||
|
||||
|
||||
int sprintf_level_ext(char *str, const struct confparams *extlevels)
|
||||
int sprintf_level_ext(char *str, int nlen, const struct confparams *extlevels)
|
||||
{
|
||||
int len = 0;
|
||||
|
||||
|
@ -325,7 +325,7 @@ int sprintf_level_ext(char *str, const struct confparams *extlevels)
|
|||
}
|
||||
|
||||
|
||||
int rig_sprintf_level_gran(char *str, setting_t level, const gran_t *gran)
|
||||
int rig_sprintf_level_gran(char *str, int nlen, setting_t level, const gran_t *gran)
|
||||
{
|
||||
int i, len = 0;
|
||||
|
||||
|
@ -381,7 +381,7 @@ int rig_sprintf_level_gran(char *str, setting_t level, const gran_t *gran)
|
|||
}
|
||||
|
||||
|
||||
int rot_sprintf_level_gran(char *str, setting_t level, const gran_t *gran)
|
||||
int rot_sprintf_level_gran(char *str, int nlen, setting_t level, const gran_t *gran)
|
||||
{
|
||||
int i, len = 0;
|
||||
|
||||
|
@ -437,7 +437,7 @@ int rot_sprintf_level_gran(char *str, setting_t level, const gran_t *gran)
|
|||
}
|
||||
|
||||
|
||||
int rig_sprintf_parm(char *str, setting_t parm)
|
||||
int rig_sprintf_parm(char *str, int nlen, setting_t parm)
|
||||
{
|
||||
int i, len = 0;
|
||||
|
||||
|
@ -466,7 +466,7 @@ int rig_sprintf_parm(char *str, setting_t parm)
|
|||
}
|
||||
|
||||
|
||||
int rot_sprintf_parm(char *str, setting_t parm)
|
||||
int rot_sprintf_parm(char *str, int nlen, setting_t parm)
|
||||
{
|
||||
int i, len = 0;
|
||||
|
||||
|
@ -495,7 +495,7 @@ int rot_sprintf_parm(char *str, setting_t parm)
|
|||
}
|
||||
|
||||
|
||||
int rig_sprintf_parm_gran(char *str, setting_t parm, const gran_t *gran)
|
||||
int rig_sprintf_parm_gran(char *str, int nlen, setting_t parm, const gran_t *gran)
|
||||
{
|
||||
int i, len = 0;
|
||||
|
||||
|
@ -551,7 +551,7 @@ int rig_sprintf_parm_gran(char *str, setting_t parm, const gran_t *gran)
|
|||
}
|
||||
|
||||
|
||||
int rot_sprintf_parm_gran(char *str, setting_t parm, const gran_t *gran)
|
||||
int rot_sprintf_parm_gran(char *str, int nlen, setting_t parm, const gran_t *gran)
|
||||
{
|
||||
int i, len = 0;
|
||||
|
||||
|
@ -607,7 +607,7 @@ int rot_sprintf_parm_gran(char *str, setting_t parm, const gran_t *gran)
|
|||
}
|
||||
|
||||
|
||||
int rig_sprintf_vfop(char *str, vfo_op_t op)
|
||||
int rig_sprintf_vfop(char *str, int nlen, vfo_op_t op)
|
||||
{
|
||||
int i, len = 0;
|
||||
|
||||
|
@ -636,7 +636,7 @@ int rig_sprintf_vfop(char *str, vfo_op_t op)
|
|||
}
|
||||
|
||||
|
||||
int rig_sprintf_scan(char *str, scan_t rscan)
|
||||
int rig_sprintf_scan(char *str, int nlen, scan_t rscan)
|
||||
{
|
||||
int i, len = 0;
|
||||
|
||||
|
@ -665,7 +665,7 @@ int rig_sprintf_scan(char *str, scan_t rscan)
|
|||
}
|
||||
|
||||
|
||||
int rot_sprintf_status(char *str, rot_status_t status)
|
||||
int rot_sprintf_status(char *str, int nlen, rot_status_t status)
|
||||
{
|
||||
int i, len = 0;
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
/*
|
||||
* Hamlib Interface - sprintf toolbox header
|
||||
* Copyright (c) 2003-2008 by Stephane Fillod
|
||||
*
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _SPRINTFLST_H
|
||||
#define _SPRINTFLST_H 1
|
||||
|
||||
#include <hamlib/rig.h>
|
||||
#include <hamlib/rotator.h>
|
||||
|
||||
#define SPRINTF_MAX_SIZE 512
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
extern int rig_sprintf_mode(char *str, int len, rmode_t mode);
|
||||
extern int rig_sprintf_vfo(char *str, int len, vfo_t vfo);
|
||||
extern int rig_sprintf_ant(char *str, int len, ant_t ant);
|
||||
extern int rig_sprintf_func(char *str, int len, setting_t func);
|
||||
extern int rot_sprintf_func(char *str, int len, setting_t func);
|
||||
extern int rig_sprintf_level(char *str, int len, setting_t level);
|
||||
extern int rot_sprintf_level(char *str, int len, setting_t level);
|
||||
extern int amp_sprintf_level(char *str, int len, setting_t level);
|
||||
extern int sprintf_level_ext(char *str, int len, const struct confparams *extlevels);
|
||||
extern int rig_sprintf_level_gran(char *str, int len, setting_t level, const gran_t *gran);
|
||||
extern int rot_sprintf_level_gran(char *str, int len, setting_t level, const gran_t *gran);
|
||||
extern int rig_sprintf_parm(char *str, int len, setting_t parm);
|
||||
extern int rot_sprintf_parm(char *str, int len, setting_t parm);
|
||||
extern int rig_sprintf_parm_gran(char *str, int len, setting_t parm, const gran_t *gran);
|
||||
extern int rot_sprintf_parm_gran(char *str, int len, setting_t parm, const gran_t *gran);
|
||||
extern int rig_sprintf_vfop(char *str, int len, vfo_op_t op);
|
||||
extern int rig_sprintf_scan(char *str, int len, scan_t rscan);
|
||||
extern int rot_sprintf_status(char *str, int len, rot_status_t status);
|
||||
extern char *get_rig_conf_type(enum rig_conf_e type);
|
||||
int print_ext_param(const struct confparams *cfp, rig_ptr_t ptr);
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* _SPRINTFLST_H */
|
|
@ -12,9 +12,9 @@ bin_PROGRAMS = rigctl rigctld rigmem rigsmtr rigswr rotctl rotctld rigctlcom amp
|
|||
|
||||
check_PROGRAMS = dumpmem testrig testrigopen testrigcaps testtrn testbcd testfreq listrigs testloc rig_bench cachetest cachetest2
|
||||
|
||||
RIGCOMMONSRC = rigctl_parse.c rigctl_parse.h dumpcaps.c sprintflst.c sprintflst.h uthash.h hamlibdatetime.h
|
||||
ROTCOMMONSRC = rotctl_parse.c rotctl_parse.h dumpcaps_rot.c sprintflst.c sprintflst.h uthash.h hamlibdatetime.h
|
||||
AMPCOMMONSRC = ampctl_parse.c ampctl_parse.h dumpcaps_amp.c sprintflst.c sprintflst.h uthash.h hamlibdatetime.h
|
||||
RIGCOMMONSRC = rigctl_parse.c rigctl_parse.h dumpcaps.c uthash.h hamlibdatetime.h
|
||||
ROTCOMMONSRC = rotctl_parse.c rotctl_parse.h dumpcaps_rot.c uthash.h hamlibdatetime.h
|
||||
AMPCOMMONSRC = ampctl_parse.c ampctl_parse.h dumpcaps_amp.c uthash.h hamlibdatetime.h
|
||||
|
||||
rigctl_SOURCES = rigctl.c $(RIGCOMMONSRC)
|
||||
rigctld_SOURCES = rigctld.c $(RIGCOMMONSRC)
|
||||
|
@ -25,7 +25,7 @@ ampctl_SOURCES = ampctl.c $(AMPCOMMONSRC)
|
|||
ampctld_SOURCES = ampctld.c $(AMPCOMMONSRC)
|
||||
rigswr_SOURCES = rigswr.c
|
||||
rigsmtr_SOURCES = rigsmtr.c
|
||||
rigmem_SOURCES = rigmem.c memsave.c memload.c memcsv.c sprintflst.c sprintflst.h
|
||||
rigmem_SOURCES = rigmem.c memsave.c memload.c memcsv.c
|
||||
|
||||
# include generated include files ahead of any in sources
|
||||
rigctl_CPPFLAGS = -I$(builddir)/tests -I$(srcdir) $(AM_CPPFLAGS)
|
||||
|
|
|
@ -1674,13 +1674,13 @@ declare_proto_amp(get_level)
|
|||
if (!strcmp(arg1, "?"))
|
||||
{
|
||||
char s[SPRINTF_MAX_SIZE];
|
||||
amp_sprintf_level(s, amp->state.has_get_level);
|
||||
amp_sprintf_level(s, sizeof(s), amp->state.has_get_level);
|
||||
|
||||
fputs(s, fout);
|
||||
|
||||
if (amp->caps->get_ext_level)
|
||||
{
|
||||
sprintf_level_ext(s, amp->caps->extlevels);
|
||||
sprintf_level_ext(s, sizeof(s), amp->caps->extlevels);
|
||||
fputs(s, fout);
|
||||
}
|
||||
|
||||
|
|
|
@ -331,16 +331,16 @@ int dumpcaps(RIG *rig, FILE *fout)
|
|||
|
||||
fprintf(fout, "\n");
|
||||
|
||||
rig_sprintf_func(prntbuf, caps->has_get_func);
|
||||
rig_sprintf_func(prntbuf, sizeof(prntbuf), caps->has_get_func);
|
||||
fprintf(fout, "Get functions: %s\n", prntbuf);
|
||||
|
||||
rig_sprintf_func(prntbuf, caps->has_set_func);
|
||||
rig_sprintf_func(prntbuf, sizeof(prntbuf), caps->has_set_func);
|
||||
fprintf(fout, "Set functions: %s\n", prntbuf);
|
||||
|
||||
fprintf(fout, "Extra functions:\n");
|
||||
rig_ext_func_foreach(rig, print_ext, fout);
|
||||
|
||||
rig_sprintf_level_gran(prntbuf, caps->has_get_level, caps->level_gran);
|
||||
rig_sprintf_level_gran(prntbuf, sizeof(prntbuf), caps->has_get_level, caps->level_gran);
|
||||
fprintf(fout, "Get level: %s\n", prntbuf);
|
||||
|
||||
if ((caps->has_get_level & RIG_LEVEL_SQLSTAT))
|
||||
|
@ -359,7 +359,7 @@ int dumpcaps(RIG *rig, FILE *fout)
|
|||
backend_warnings++;
|
||||
}
|
||||
|
||||
rig_sprintf_level_gran(prntbuf, caps->has_set_level, caps->level_gran);
|
||||
rig_sprintf_level_gran(prntbuf, sizeof(prntbuf), caps->has_set_level, caps->level_gran);
|
||||
fprintf(fout, "Set level: %s\n", prntbuf);
|
||||
|
||||
if (caps->has_set_level & RIG_LEVEL_READONLY_LIST)
|
||||
|
@ -371,10 +371,10 @@ int dumpcaps(RIG *rig, FILE *fout)
|
|||
fprintf(fout, "Extra levels:\n");
|
||||
rig_ext_level_foreach(rig, print_ext, fout);
|
||||
|
||||
rig_sprintf_parm_gran(prntbuf, caps->has_get_parm, caps->parm_gran);
|
||||
rig_sprintf_parm_gran(prntbuf, sizeof(prntbuf), caps->has_get_parm, caps->parm_gran);
|
||||
fprintf(fout, "Get parameters: %s\n", prntbuf);
|
||||
|
||||
rig_sprintf_parm_gran(prntbuf, caps->has_set_parm, caps->parm_gran);
|
||||
rig_sprintf_parm_gran(prntbuf, sizeof(prntbuf), caps->has_set_parm, caps->parm_gran);
|
||||
fprintf(fout, "Set parameters: %s\n", prntbuf);
|
||||
|
||||
if (caps->has_set_parm & RIG_PARM_READONLY_LIST)
|
||||
|
@ -389,7 +389,7 @@ int dumpcaps(RIG *rig, FILE *fout)
|
|||
|
||||
if (rig->state.mode_list != 0)
|
||||
{
|
||||
rig_sprintf_mode(prntbuf, rig->state.mode_list);
|
||||
rig_sprintf_mode(prntbuf, sizeof(prntbuf), rig->state.mode_list);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -401,7 +401,7 @@ int dumpcaps(RIG *rig, FILE *fout)
|
|||
|
||||
if (rig->state.vfo_list != 0)
|
||||
{
|
||||
rig_sprintf_vfo(prntbuf, rig->state.vfo_list);
|
||||
rig_sprintf_vfo(prntbuf, sizeof(prntbuf), rig->state.vfo_list);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -411,10 +411,10 @@ int dumpcaps(RIG *rig, FILE *fout)
|
|||
|
||||
fprintf(fout, "VFO list: %s\n", prntbuf);
|
||||
|
||||
rig_sprintf_vfop(prntbuf, caps->vfo_ops);
|
||||
rig_sprintf_vfop(prntbuf, sizeof(prntbuf), caps->vfo_ops);
|
||||
fprintf(fout, "VFO Ops: %s\n", prntbuf);
|
||||
|
||||
rig_sprintf_scan(prntbuf, caps->scan_ops);
|
||||
rig_sprintf_scan(prntbuf, sizeof(prntbuf), caps->scan_ops);
|
||||
fprintf(fout, "Scan Ops: %s\n", prntbuf);
|
||||
|
||||
fprintf(fout, "Number of banks:\t%d\n", caps->bank_qty);
|
||||
|
@ -610,10 +610,10 @@ int dumpcaps(RIG *rig, FILE *fout)
|
|||
}
|
||||
else
|
||||
{
|
||||
sprintf_freq(freqbuf, caps->tuning_steps[i].ts);
|
||||
sprintf_freq(freqbuf, sizeof(freqbuf), caps->tuning_steps[i].ts);
|
||||
}
|
||||
|
||||
rig_sprintf_mode(prntbuf, caps->tuning_steps[i].modes);
|
||||
rig_sprintf_mode(prntbuf, sizeof(prntbuf), caps->tuning_steps[i].modes);
|
||||
fprintf(fout, "\n\t%s: \t%s", freqbuf, prntbuf);
|
||||
}
|
||||
|
||||
|
@ -642,10 +642,10 @@ int dumpcaps(RIG *rig, FILE *fout)
|
|||
}
|
||||
else
|
||||
{
|
||||
sprintf_freq(freqbuf, caps->filters[i].width);
|
||||
sprintf_freq(freqbuf, sizeof(freqbuf), caps->filters[i].width);
|
||||
}
|
||||
|
||||
rig_sprintf_mode(prntbuf, caps->filters[i].modes);
|
||||
rig_sprintf_mode(prntbuf, sizeof(prntbuf), caps->filters[i].modes);
|
||||
fprintf(fout, "\n\t%s: \t%s", freqbuf, prntbuf);
|
||||
}
|
||||
|
||||
|
@ -668,13 +668,13 @@ int dumpcaps(RIG *rig, FILE *fout)
|
|||
continue;
|
||||
}
|
||||
|
||||
sprintf_freq(freqbuf, pbnorm);
|
||||
sprintf_freq(freqbuf, sizeof(freqbuf), pbnorm);
|
||||
fprintf(fout, "\n\t%s\tNormal: %s,\t", rig_strrmode(i), freqbuf);
|
||||
|
||||
sprintf_freq(freqbuf, rig_passband_narrow(rig, i));
|
||||
sprintf_freq(freqbuf, sizeof(freqbuf), rig_passband_narrow(rig, i));
|
||||
fprintf(fout, "Narrow: %s,\t", freqbuf);
|
||||
|
||||
sprintf_freq(freqbuf, rig_passband_wide(rig, i));
|
||||
sprintf_freq(freqbuf, sizeof(freqbuf), rig_passband_wide(rig, i));
|
||||
fprintf(fout, "Wide: %s", freqbuf);
|
||||
}
|
||||
|
||||
|
@ -851,17 +851,17 @@ void range_print(FILE *fout, const struct freq_range_list range_list[], int rx)
|
|||
range_list[i].endf);
|
||||
|
||||
fprintf(fout, "\t\tVFO list: ");
|
||||
rig_sprintf_vfo(prntbuf, range_list[i].vfo);
|
||||
rig_sprintf_vfo(prntbuf, sizeof(prntbuf), range_list[i].vfo);
|
||||
fprintf(fout, "%s", prntbuf);
|
||||
fprintf(fout, "\n");
|
||||
|
||||
fprintf(fout, "\t\tMode list: ");
|
||||
rig_sprintf_mode(prntbuf, range_list[i].modes);
|
||||
rig_sprintf_mode(prntbuf, sizeof(prntbuf), range_list[i].modes);
|
||||
fprintf(fout, "%s", prntbuf);
|
||||
fprintf(fout, "\n");
|
||||
|
||||
fprintf(fout, "\t\tAntenna list: ");
|
||||
rig_sprintf_ant(prntbuf, range_list[i].ant);
|
||||
rig_sprintf_ant(prntbuf, sizeof(prntbuf), range_list[i].ant);
|
||||
fprintf(fout, "%s", prntbuf);
|
||||
fprintf(fout, "\n");
|
||||
|
||||
|
|
|
@ -131,7 +131,7 @@ int dumpcaps_amp(AMP *amp, FILE *fout)
|
|||
|
||||
fprintf(fout, "Has priv data:\t\t%c\n", caps->priv != NULL ? 'Y' : 'N');
|
||||
|
||||
amp_sprintf_level(prntbuf, caps->has_get_level);
|
||||
amp_sprintf_level(prntbuf, sizeof(prntbuf), caps->has_get_level);
|
||||
fprintf(fout, "Get level: %s\n", prntbuf);
|
||||
|
||||
/*
|
||||
|
|
|
@ -148,7 +148,7 @@ int dumpcaps_rot(ROT *rot, FILE *fout)
|
|||
|
||||
if (rot->state.has_status != 0)
|
||||
{
|
||||
rot_sprintf_status(prntbuf, rot->state.has_status);
|
||||
rot_sprintf_status(prntbuf, sizeof(prntbuf), rot->state.has_status);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -157,16 +157,16 @@ int dumpcaps_rot(ROT *rot, FILE *fout)
|
|||
|
||||
fprintf(fout, "Status flags: %s\n", prntbuf);
|
||||
|
||||
rot_sprintf_func(prntbuf, caps->has_get_func);
|
||||
rot_sprintf_func(prntbuf, sizeof(prntbuf), caps->has_get_func);
|
||||
fprintf(fout, "Get functions: %s\n", prntbuf);
|
||||
|
||||
rot_sprintf_func(prntbuf, caps->has_set_func);
|
||||
rot_sprintf_func(prntbuf, sizeof(prntbuf), caps->has_set_func);
|
||||
fprintf(fout, "Set functions: %s\n", prntbuf);
|
||||
|
||||
fprintf(fout, "Extra functions:\n");
|
||||
rot_ext_func_foreach(rot, print_ext, fout);
|
||||
|
||||
rot_sprintf_level_gran(prntbuf, caps->has_get_level, caps->level_gran);
|
||||
rot_sprintf_level_gran(prntbuf, sizeof(prntbuf), caps->has_get_level, caps->level_gran);
|
||||
fprintf(fout, "Get level: %s\n", prntbuf);
|
||||
|
||||
if ((caps->has_get_level & RIG_LEVEL_SQLSTAT))
|
||||
|
@ -175,7 +175,7 @@ int dumpcaps_rot(ROT *rot, FILE *fout)
|
|||
backend_warnings++;
|
||||
}
|
||||
|
||||
rot_sprintf_level_gran(prntbuf, caps->has_set_level, caps->level_gran);
|
||||
rot_sprintf_level_gran(prntbuf, sizeof(prntbuf), caps->has_set_level, caps->level_gran);
|
||||
fprintf(fout, "Set level: %s\n", prntbuf);
|
||||
|
||||
if (caps->has_set_level & ROT_LEVEL_READONLY_LIST)
|
||||
|
@ -187,10 +187,10 @@ int dumpcaps_rot(ROT *rot, FILE *fout)
|
|||
fprintf(fout, "Extra levels:\n");
|
||||
rot_ext_level_foreach(rot, print_ext, fout);
|
||||
|
||||
rot_sprintf_parm_gran(prntbuf, caps->has_get_parm, caps->parm_gran);
|
||||
rot_sprintf_parm_gran(prntbuf, sizeof(prntbuf), caps->has_get_parm, caps->parm_gran);
|
||||
fprintf(fout, "Get parameters: %s\n", prntbuf);
|
||||
|
||||
rot_sprintf_parm_gran(prntbuf, caps->has_set_parm, caps->parm_gran);
|
||||
rot_sprintf_parm_gran(prntbuf, sizeof(prntbuf), caps->has_set_parm, caps->parm_gran);
|
||||
fprintf(fout, "Set parameters: %s\n", prntbuf);
|
||||
|
||||
if (caps->has_set_parm & ROT_PARM_READONLY_LIST)
|
||||
|
|
|
@ -175,35 +175,35 @@ int dump_chan(RIG *rig, int chan_num)
|
|||
|
||||
printf("Channel: %d\n", chan.channel_num);
|
||||
|
||||
sprintf_freq(freqbuf, chan.freq);
|
||||
sprintf_freq(freqbuf, sizeof(freqbuf), chan.freq);
|
||||
printf("Frequency: %s\n", freqbuf);
|
||||
printf("Mode: %s\n", decode_modes(chan.mode));
|
||||
|
||||
sprintf_freq(freqbuf, chan.width);
|
||||
sprintf_freq(freqbuf, sizeof(freqbuf), chan.width);
|
||||
printf("Width: %s\n", freqbuf);
|
||||
printf("VFO: %s\n", rig_strvfo(chan.vfo));
|
||||
|
||||
printf("Split: %d\n", chan.split);
|
||||
sprintf_freq(freqbuf, chan.tx_freq);
|
||||
sprintf_freq(freqbuf, sizeof(freqbuf), chan.tx_freq);
|
||||
printf("TXFrequency: %s\n", freqbuf);
|
||||
printf("TXMode: %s\n", decode_modes(chan.tx_mode));
|
||||
|
||||
sprintf_freq(freqbuf, chan.tx_width);
|
||||
sprintf_freq(freqbuf, sizeof(freqbuf), chan.tx_width);
|
||||
printf("TXWidth: %s\n", freqbuf);
|
||||
|
||||
printf("Shift: %s\n", rig_strptrshift(chan.rptr_shift));
|
||||
sprintf_freq(freqbuf, chan.rptr_offs);
|
||||
sprintf_freq(freqbuf, sizeof(freqbuf), chan.rptr_offs);
|
||||
printf("Offset: %s%s\n", chan.rptr_offs > 0 ? "+" : "", freqbuf);
|
||||
|
||||
printf("Antenna: %u\n", chan.ant);
|
||||
|
||||
sprintf_freq(freqbuf, chan.tuning_step);
|
||||
sprintf_freq(freqbuf, sizeof(freqbuf), chan.tuning_step);
|
||||
printf("Step: %s\n", freqbuf);
|
||||
|
||||
sprintf_freq(freqbuf, chan.rit);
|
||||
sprintf_freq(freqbuf, sizeof(freqbuf), chan.rit);
|
||||
printf("RIT: %s%s\n", chan.rit > 0 ? "+" : "", freqbuf);
|
||||
|
||||
sprintf_freq(freqbuf, chan.xit);
|
||||
sprintf_freq(freqbuf, sizeof(freqbuf), chan.xit);
|
||||
printf("XIT: %s%s\n", chan.xit > 0 ? "+" : "", freqbuf);
|
||||
printf("CTCSS: %u.%uHz\n", chan.ctcss_tone / 10, chan.ctcss_tone % 10);
|
||||
printf("CTCSSsql: %u.%uHz\n", chan.ctcss_sql / 10, chan.ctcss_sql % 10);
|
||||
|
|
|
@ -131,7 +131,7 @@ int main()
|
|||
if (range)
|
||||
{
|
||||
char vfolist[256];
|
||||
rig_sprintf_vfo(vfolist, my_rig->state.vfo_list);
|
||||
rig_sprintf_vfo(vfolist, sizeof(vfo_list), my_rig->state.vfo_list);
|
||||
printf("Range start=%"PRIfreq", end=%"PRIfreq", low_power=%d, high_power=%d, vfos=%s\n",
|
||||
range->startf, range->endf, range->low_power, range->high_power, vfolist);
|
||||
}
|
||||
|
|
|
@ -2081,7 +2081,7 @@ declare_proto_rig(set_mode)
|
|||
if (!strcmp(arg1, "?"))
|
||||
{
|
||||
char s[SPRINTF_MAX_SIZE];
|
||||
rig_sprintf_mode(s, rig->state.mode_list);
|
||||
rig_sprintf_mode(s, sizeof(s), rig->state.mode_list);
|
||||
fprintf(fout, "%s\n", s);
|
||||
return RIG_OK;
|
||||
}
|
||||
|
@ -2132,7 +2132,7 @@ declare_proto_rig(set_vfo)
|
|||
if (!strcmp(arg1, "?"))
|
||||
{
|
||||
char s[SPRINTF_MAX_SIZE];
|
||||
rig_sprintf_vfo(s, rig->state.vfo_list);
|
||||
rig_sprintf_vfo(s, sizeof(s), rig->state.vfo_list);
|
||||
fprintf(fout, "%s\n", s);
|
||||
return RIG_OK;
|
||||
}
|
||||
|
@ -2196,7 +2196,7 @@ declare_proto_rig(get_vfo_info)
|
|||
if (!strcmp(arg1, "?"))
|
||||
{
|
||||
char s[SPRINTF_MAX_SIZE];
|
||||
rig_sprintf_vfo(s, rig->state.vfo_list);
|
||||
rig_sprintf_vfo(s, sizeof(s), rig->state.vfo_list);
|
||||
fprintf(fout, "%s\n", s);
|
||||
return RIG_OK;
|
||||
}
|
||||
|
@ -2230,7 +2230,7 @@ declare_proto_rig(get_vfo_list)
|
|||
{
|
||||
static char prntbuf[256];
|
||||
|
||||
rig_sprintf_vfo(prntbuf, rig->state.vfo_list);
|
||||
rig_sprintf_vfo(prntbuf, sizeof(prntbuf), rig->state.vfo_list);
|
||||
|
||||
if ((interactive && prompt) || (interactive && !prompt && ext_resp))
|
||||
{
|
||||
|
@ -2588,7 +2588,7 @@ declare_proto_rig(set_split_mode)
|
|||
if (!strcmp(arg1, "?"))
|
||||
{
|
||||
char s[SPRINTF_MAX_SIZE];
|
||||
rig_sprintf_mode(s, rig->state.mode_list);
|
||||
rig_sprintf_mode(s, sizeof(s), rig->state.mode_list);
|
||||
fprintf(fout, "%s\n", s);
|
||||
return RIG_OK;
|
||||
}
|
||||
|
@ -2643,7 +2643,7 @@ declare_proto_rig(set_split_freq_mode)
|
|||
if (!strcmp(arg1, "?"))
|
||||
{
|
||||
char s[SPRINTF_MAX_SIZE];
|
||||
rig_sprintf_mode(s, rig->state.mode_list);
|
||||
rig_sprintf_mode(s, sizeof(s), rig->state.mode_list);
|
||||
fprintf(fout, "%s\n", s);
|
||||
return RIG_OK;
|
||||
}
|
||||
|
@ -2707,7 +2707,7 @@ declare_proto_rig(set_split_vfo)
|
|||
if (!strcmp(arg2, "?"))
|
||||
{
|
||||
char s[SPRINTF_MAX_SIZE];
|
||||
rig_sprintf_vfo(s, rig->state.vfo_list);
|
||||
rig_sprintf_vfo(s, sizeof(s), rig->state.vfo_list);
|
||||
fprintf(fout, "%s\n", s);
|
||||
return RIG_OK;
|
||||
}
|
||||
|
@ -2868,12 +2868,12 @@ declare_proto_rig(set_level)
|
|||
if (!strcmp(arg1, "?"))
|
||||
{
|
||||
char s[SPRINTF_MAX_SIZE];
|
||||
rig_sprintf_level(s, rig->state.has_set_level);
|
||||
rig_sprintf_level(s, sizeof(s), rig->state.has_set_level);
|
||||
fputs(s, fout);
|
||||
|
||||
if (rig->caps->set_ext_level)
|
||||
{
|
||||
sprintf_level_ext(s, rig->caps->extlevels);
|
||||
sprintf_level_ext(s, sizeof(s), rig->caps->extlevels);
|
||||
fputs(s, fout);
|
||||
}
|
||||
|
||||
|
@ -2949,12 +2949,12 @@ declare_proto_rig(get_level)
|
|||
if (!strcmp(arg1, "?"))
|
||||
{
|
||||
char s[SPRINTF_MAX_SIZE];
|
||||
rig_sprintf_level(s, rig->state.has_get_level);
|
||||
rig_sprintf_level(s, sizeof(s), rig->state.has_get_level);
|
||||
fputs(s, fout);
|
||||
|
||||
if (rig->caps->get_ext_level)
|
||||
{
|
||||
sprintf_level_ext(s, rig->caps->extlevels);
|
||||
sprintf_level_ext(s, sizeof(s), rig->caps->extlevels);
|
||||
fputs(s, fout);
|
||||
}
|
||||
|
||||
|
@ -3047,7 +3047,7 @@ declare_proto_rig(set_func)
|
|||
if (!strcmp(arg1, "?"))
|
||||
{
|
||||
char s[SPRINTF_MAX_SIZE];
|
||||
rig_sprintf_func(s, rig->state.has_set_func);
|
||||
rig_sprintf_func(s, sizeof(s), rig->state.has_set_func);
|
||||
fprintf(fout, "%s\n", s);
|
||||
return RIG_OK;
|
||||
}
|
||||
|
@ -3085,7 +3085,7 @@ declare_proto_rig(get_func)
|
|||
if (!strcmp(arg1, "?"))
|
||||
{
|
||||
char s[SPRINTF_MAX_SIZE];
|
||||
rig_sprintf_func(s, rig->state.has_get_func);
|
||||
rig_sprintf_func(s, sizeof(s), rig->state.has_get_func);
|
||||
fprintf(fout, "%s\n", s);
|
||||
return RIG_OK;
|
||||
}
|
||||
|
@ -3147,7 +3147,7 @@ declare_proto_rig(set_parm)
|
|||
if (!strcmp(arg1, "?"))
|
||||
{
|
||||
char s[SPRINTF_MAX_SIZE];
|
||||
rig_sprintf_parm(s, rig->state.has_set_parm);
|
||||
rig_sprintf_parm(s, sizeof(s), rig->state.has_set_parm);
|
||||
fprintf(fout, "%s\n", s);
|
||||
return RIG_OK;
|
||||
}
|
||||
|
@ -3220,7 +3220,7 @@ declare_proto_rig(get_parm)
|
|||
if (!strcmp(arg1, "?"))
|
||||
{
|
||||
char s[SPRINTF_MAX_SIZE];
|
||||
rig_sprintf_parm(s, rig->state.has_get_parm);
|
||||
rig_sprintf_parm(s, sizeof(s), rig->state.has_get_parm);
|
||||
fprintf(fout, "%s\n", s);
|
||||
return RIG_OK;
|
||||
}
|
||||
|
@ -3375,7 +3375,7 @@ declare_proto_rig(vfo_op)
|
|||
if (!strcmp(arg1, "?"))
|
||||
{
|
||||
char s[SPRINTF_MAX_SIZE];
|
||||
rig_sprintf_vfop(s, rig->caps->vfo_ops);
|
||||
rig_sprintf_vfop(s, sizeof(s), rig->caps->vfo_ops);
|
||||
fprintf(fout, "%s\n", s);
|
||||
return RIG_OK;
|
||||
}
|
||||
|
@ -3400,7 +3400,7 @@ declare_proto_rig(scan)
|
|||
if (!strcmp(arg1, "?"))
|
||||
{
|
||||
char s[SPRINTF_MAX_SIZE];
|
||||
rig_sprintf_scan(s, rig->caps->scan_ops);
|
||||
rig_sprintf_scan(s, sizeof(s), rig->caps->scan_ops);
|
||||
fprintf(fout, "%s\n", s);
|
||||
return RIG_OK;
|
||||
}
|
||||
|
@ -3925,34 +3925,34 @@ int dump_chan(FILE *fout, RIG *rig, channel_t *chan)
|
|||
chan->ant,
|
||||
chan->split == RIG_SPLIT_ON ? "ON" : "OFF");
|
||||
|
||||
sprintf_freq(freqbuf, chan->freq);
|
||||
sprintf_freq(widthbuf, chan->width);
|
||||
sprintf_freq(freqbuf, sizeof(freqbuf), chan->freq);
|
||||
sprintf_freq(widthbuf, sizeof(widthbuf), chan->width);
|
||||
fprintf(fout,
|
||||
"Freq: %s\tMode: %s\tWidth: %s\n",
|
||||
freqbuf,
|
||||
rig_strrmode(chan->mode),
|
||||
widthbuf);
|
||||
|
||||
sprintf_freq(freqbuf, chan->tx_freq);
|
||||
sprintf_freq(widthbuf, chan->tx_width);
|
||||
sprintf_freq(freqbuf, sizeof(freqbuf), chan->tx_freq);
|
||||
sprintf_freq(widthbuf, sizeof(widthbuf), chan->tx_width);
|
||||
fprintf(fout,
|
||||
"txFreq: %s\ttxMode: %s\ttxWidth: %s\n",
|
||||
freqbuf,
|
||||
rig_strrmode(chan->tx_mode),
|
||||
widthbuf);
|
||||
|
||||
sprintf_freq(freqbuf, chan->rptr_offs);
|
||||
sprintf_freq(freqbuf, sizeof(freqbuf), chan->rptr_offs);
|
||||
fprintf(fout,
|
||||
"Shift: %s, Offset: %s%s, ",
|
||||
rig_strptrshift(chan->rptr_shift),
|
||||
chan->rptr_offs > 0 ? "+" : "",
|
||||
freqbuf);
|
||||
|
||||
sprintf_freq(freqbuf, chan->tuning_step);
|
||||
sprintf_freq(freqbuf, sizeof(freqbuf), chan->tuning_step);
|
||||
fprintf(fout, "Step: %s, ", freqbuf);
|
||||
sprintf_freq(freqbuf, chan->rit);
|
||||
sprintf_freq(freqbuf, sizeof(freqbuf), chan->rit);
|
||||
fprintf(fout, "RIT: %s%s, ", chan->rit > 0 ? "+" : "", freqbuf);
|
||||
sprintf_freq(freqbuf, chan->xit);
|
||||
sprintf_freq(freqbuf, sizeof(freqbuf), chan->xit);
|
||||
fprintf(fout, "XIT: %s%s\n", chan->xit > 0 ? "+" : "", freqbuf);
|
||||
|
||||
fprintf(fout, "CTCSS: %u.%uHz, ", chan->ctcss_tone / 10, chan->ctcss_tone % 10);
|
||||
|
@ -3964,7 +3964,7 @@ int dump_chan(FILE *fout, RIG *rig, channel_t *chan)
|
|||
fprintf(fout, "DCS: %u.%u, ", chan->dcs_code / 10, chan->dcs_code % 10);
|
||||
fprintf(fout, "DCSsql: %u.%u\n", chan->dcs_sql / 10, chan->dcs_sql % 10);
|
||||
|
||||
rig_sprintf_func(prntbuf, chan->funcs);
|
||||
rig_sprintf_func(prntbuf, sizeof(prntbuf), chan->funcs);
|
||||
fprintf(fout, "Functions: %s\n", prntbuf);
|
||||
|
||||
fprintf(fout, "Levels:");
|
||||
|
@ -4241,7 +4241,7 @@ declare_proto_rig(get_ant)
|
|||
fprintf(fout, "%s: ", cmd->arg1);
|
||||
}
|
||||
|
||||
rig_sprintf_ant(antbuf, ant_curr);
|
||||
rig_sprintf_ant(antbuf, sizeof(antbuf), ant_curr);
|
||||
fprintf(fout, "%s%c", antbuf, resp_sep);
|
||||
//fprintf(fout, "%d%c", rig_setting2idx(ant_curr)+1, resp_sep);
|
||||
|
||||
|
@ -4257,7 +4257,7 @@ declare_proto_rig(get_ant)
|
|||
fprintf(fout, "%s: ", cmd->arg3);
|
||||
}
|
||||
|
||||
rig_sprintf_ant(antbuf, ant_tx);
|
||||
rig_sprintf_ant(antbuf, sizeof(antbuf), ant_tx);
|
||||
fprintf(fout, "%s%c", antbuf, resp_sep);
|
||||
//fprintf(fout, "%d%c", rig_setting2idx(ant_tx)+1, resp_sep);
|
||||
|
||||
|
@ -4266,7 +4266,7 @@ declare_proto_rig(get_ant)
|
|||
fprintf(fout, "%s: ", cmd->arg4);
|
||||
}
|
||||
|
||||
rig_sprintf_ant(antbuf, ant_rx);
|
||||
rig_sprintf_ant(antbuf, sizeof(antbuf), ant_rx);
|
||||
fprintf(fout, "%s%c", antbuf, resp_sep);
|
||||
//fprintf(fout, "%d%c", rig_setting2idx(ant_rx)+1, resp_sep);
|
||||
|
||||
|
|
|
@ -1828,7 +1828,7 @@ declare_proto_rot(get_status)
|
|||
fprintf(fout, "%s: ", cmd->arg1);
|
||||
}
|
||||
|
||||
rot_sprintf_status(s, status);
|
||||
rot_sprintf_status(s, sizeof(s), status);
|
||||
fprintf(fout, "%s%c", s, resp_sep);
|
||||
|
||||
return RIG_OK;
|
||||
|
@ -1878,12 +1878,12 @@ declare_proto_rot(set_level)
|
|||
if (!strcmp(arg1, "?"))
|
||||
{
|
||||
char s[SPRINTF_MAX_SIZE];
|
||||
rot_sprintf_level(s, rot->state.has_set_level);
|
||||
rot_sprintf_level(s, sizeof(s), rot->state.has_set_level);
|
||||
fputs(s, fout);
|
||||
|
||||
if (rot->caps->set_ext_level)
|
||||
{
|
||||
sprintf_level_ext(s, rot->caps->extlevels);
|
||||
sprintf_level_ext(s, sizeof(s), rot->caps->extlevels);
|
||||
fputs(s, fout);
|
||||
}
|
||||
|
||||
|
@ -1954,12 +1954,12 @@ declare_proto_rot(get_level)
|
|||
if (!strcmp(arg1, "?"))
|
||||
{
|
||||
char s[SPRINTF_MAX_SIZE];
|
||||
rot_sprintf_level(s, rot->state.has_get_level);
|
||||
rot_sprintf_level(s, sizeof(s), rot->state.has_get_level);
|
||||
fputs(s, fout);
|
||||
|
||||
if (rot->caps->get_ext_level)
|
||||
{
|
||||
sprintf_level_ext(s, rot->caps->extlevels);
|
||||
sprintf_level_ext(s, sizeof(s), rot->caps->extlevels);
|
||||
fputs(s, fout);
|
||||
}
|
||||
|
||||
|
@ -2052,7 +2052,7 @@ declare_proto_rot(set_func)
|
|||
if (!strcmp(arg1, "?"))
|
||||
{
|
||||
char s[SPRINTF_MAX_SIZE];
|
||||
rot_sprintf_func(s, rot->state.has_set_func);
|
||||
rot_sprintf_func(s, sizeof(s), rot->state.has_set_func);
|
||||
fprintf(fout, "%s\n", s);
|
||||
return RIG_OK;
|
||||
}
|
||||
|
@ -2090,7 +2090,7 @@ declare_proto_rot(get_func)
|
|||
if (!strcmp(arg1, "?"))
|
||||
{
|
||||
char s[SPRINTF_MAX_SIZE];
|
||||
rot_sprintf_func(s, rot->state.has_get_func);
|
||||
rot_sprintf_func(s, sizeof(s), rot->state.has_get_func);
|
||||
fprintf(fout, "%s\n", s);
|
||||
return RIG_OK;
|
||||
}
|
||||
|
@ -2152,7 +2152,7 @@ declare_proto_rot(set_parm)
|
|||
if (!strcmp(arg1, "?"))
|
||||
{
|
||||
char s[SPRINTF_MAX_SIZE];
|
||||
rot_sprintf_parm(s, rot->state.has_set_parm);
|
||||
rot_sprintf_parm(s, sizeof(s), rot->state.has_set_parm);
|
||||
fprintf(fout, "%s\n", s);
|
||||
return RIG_OK;
|
||||
}
|
||||
|
@ -2225,7 +2225,7 @@ declare_proto_rot(get_parm)
|
|||
if (!strcmp(arg1, "?"))
|
||||
{
|
||||
char s[SPRINTF_MAX_SIZE];
|
||||
rot_sprintf_parm(s, rot->state.has_get_parm);
|
||||
rot_sprintf_parm(s, sizeof(s), rot->state.has_get_parm);
|
||||
fprintf(fout, "%s\n", s);
|
||||
return RIG_OK;
|
||||
}
|
||||
|
|
|
@ -1,55 +0,0 @@
|
|||
/*
|
||||
* Hamlib Interface - sprintf toolbox header
|
||||
* Copyright (c) 2003-2008 by Stephane Fillod
|
||||
*
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _SPRINTFLST_H
|
||||
#define _SPRINTFLST_H 1
|
||||
|
||||
#include <hamlib/rig.h>
|
||||
#include <hamlib/rotator.h>
|
||||
|
||||
#define SPRINTF_MAX_SIZE 512
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
extern int rig_sprintf_mode(char *str, rmode_t mode);
|
||||
extern int rig_sprintf_vfo(char *str, vfo_t vfo);
|
||||
extern int rig_sprintf_ant(char *str, ant_t ant);
|
||||
extern int rig_sprintf_func(char *str, setting_t func);
|
||||
extern int rot_sprintf_func(char *str, setting_t func);
|
||||
extern int rig_sprintf_level(char *str, setting_t level);
|
||||
extern int rot_sprintf_level(char *str, setting_t level);
|
||||
extern int amp_sprintf_level(char *str, setting_t level);
|
||||
extern int sprintf_level_ext(char *str, const struct confparams *extlevels);
|
||||
extern int rig_sprintf_level_gran(char *str, setting_t level, const gran_t *gran);
|
||||
extern int rot_sprintf_level_gran(char *str, setting_t level, const gran_t *gran);
|
||||
extern int rig_sprintf_parm(char *str, setting_t parm);
|
||||
extern int rot_sprintf_parm(char *str, setting_t parm);
|
||||
extern int rig_sprintf_parm_gran(char *str, setting_t parm, const gran_t *gran);
|
||||
extern int rot_sprintf_parm_gran(char *str, setting_t parm, const gran_t *gran);
|
||||
extern int rig_sprintf_vfop(char *str, vfo_op_t op);
|
||||
extern int rig_sprintf_scan(char *str, scan_t rscan);
|
||||
extern int rot_sprintf_status(char *str, rot_status_t status);
|
||||
extern char *get_rig_conf_type(enum rig_conf_e type);
|
||||
int print_ext_param(const struct confparams *cfp, rig_ptr_t ptr);
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* _SPRINTFLST_H */
|
Ładowanie…
Reference in New Issue