From b4f196190c40a51a5ccd56c03c3df1eac9b3af01 Mon Sep 17 00:00:00 2001 From: PianetaRadio <78976006+PianetaRadio@users.noreply.github.com> Date: Sat, 12 Mar 2022 20:20:12 +0100 Subject: [PATCH] Add files via upload --- hamlib/amplifier.h | 446 ++++++ hamlib/amplist.h | 120 ++ hamlib/libhamlib.dll.a | Bin 0 -> 253054 bytes hamlib/rig.h | 3196 ++++++++++++++++++++++++++++++++++++++++ hamlib/rig_dll.h | 90 ++ hamlib/riglist.h | 662 +++++++++ hamlib/rotator.h | 805 ++++++++++ hamlib/rotlist.h | 637 ++++++++ 8 files changed, 5956 insertions(+) create mode 100644 hamlib/amplifier.h create mode 100644 hamlib/amplist.h create mode 100644 hamlib/libhamlib.dll.a create mode 100644 hamlib/rig.h create mode 100644 hamlib/rig_dll.h create mode 100644 hamlib/riglist.h create mode 100644 hamlib/rotator.h create mode 100644 hamlib/rotlist.h diff --git a/hamlib/amplifier.h b/hamlib/amplifier.h new file mode 100644 index 0000000..d123c70 --- /dev/null +++ b/hamlib/amplifier.h @@ -0,0 +1,446 @@ +/* + * Hamlib Interface - Amplifier API header + * Copyright (c) 2000-2005 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 _AMPLIFIER_H +#define _AMPLIFIER_H 1 + +#include +#include + +/** + * \addtogroup amplifier + * @{ + */ + +/** + * \brief Hamlib amplifier data structures. + * + * \file amplifier.h + * + * This file contains the data structures and declarations for the Hamlib + * amplifier Application Programming Interface (API). + * + * See the amplifier.c file for details on the amplifier API functions. + */ + + + +__BEGIN_DECLS + +/* Forward struct references */ + +struct amp; +struct amp_state; + + +/** + * \brief Main amplifier handle type definition. + * + * \typedef typedef struct amp AMP + * + * The #AMP handle is returned by amp_init() and is passed as a parameter to + * every amplifier specific API call. + * + * amp_cleanup() must be called when this handle is no longer needed. + */ +typedef struct amp AMP; + + +/** + * \brief Type definition for + * SWR (Standing Wave Ratio). + * + * \typedef typedef float swr_t + * + * The \a swr_t type is used as a parameter for the amp_get_swr() function. + * + * The unit of \a swr_t is 1.0 to the maximum value reported by the amplifier's + * internal antenna system tuner, i.e. + * transmatch, + * representing the ratio of 1.0:1 to Maximum:1. + */ +typedef float swr_t; + + +/** + * \brief Type definition for the + * transmatch + * tuning values of + * capacitance + * and + * inductance. + * + * \typedef typedef float tune_value_t + * + * The \a tune_value_t type is used as a parameter for amp_get_level(). + * + * The unit of \a tune_value_t is + * picoFarads (pF) + * or + * nanoHenrys (nH). + */ +typedef int tune_value_t; + + +/** + * \brief The token in the netampctl protocol for returning an error condition code. + */ +#define NETAMPCTL_RET "RPRT " + + +//! @cond Doxygen_Suppress +typedef enum +{ + AMP_RESET_MEM, // erase tuner memory + AMP_RESET_FAULT, // reset any fault + AMP_RESET_AMP // for kpa1500 +} amp_reset_t; +//! @endcond + +/** + * \brief Amplifier type flags + */ +typedef enum +{ + AMP_FLAG_1 = (1 << 1), /*!< TBD */ + AMP_FLAG_2 = (1 << 2) /*!< TBD */ +} amp_type_t; + +//! @cond Doxygen_Suppress +// TBD AMP_TYPE +#define AMP_TYPE_MASK (AMP_FLAG_1|AMP_FLAG_2) + +#define AMP_TYPE_OTHER 0 +#define AMP_TYPE_1 AMP_FLAG_1 +#define AMP_TYPE_2 AMP_FLAG_2 +#define AMP_TYPE_ALL (AMP_FLAG_1|AMP_FLAG_2) +//! @endcond + + +//! @cond Doxygen_Suppress +enum amp_level_e +{ + AMP_LEVEL_NONE = 0, /*!< '' -- No Level. */ + AMP_LEVEL_SWR = (1 << 0), /*!< \c SWR 1.0 or greater. */ + AMP_LEVEL_NH = (1 << 1), /*!< \c Tune setting in nanohenries. */ + AMP_LEVEL_PF = (1 << 2), /*!< \c Tune setting in picofarads. */ + AMP_LEVEL_PWR_INPUT = (1 << 3), /*!< \c Power reading from amplifier. */ + AMP_LEVEL_PWR_FWD = (1 << 4), /*!< \c Power reading forward. */ + AMP_LEVEL_PWR_REFLECTED = (1 << 5), /*!< \c Power reading reverse. */ + AMP_LEVEL_PWR_PEAK = (1 << 6), /*!< \c Power reading peak. */ + AMP_LEVEL_FAULT = (1 << 7) /*!< \c Fault code. */ +}; +//! @endcond + +//! @cond Doxygen_Suppress +#define AMP_LEVEL_FLOAT_LIST (AMP_LEVEL_SWR) +#define AMP_LEVEL_STRING_LIST (AMP_LEVEL_FAULT) +#define AMP_LEVEL_IS_FLOAT(l) ((l)&_LEVEL_FLOAT_LIST) +#define AMP_LEVEL_IS_STRING(l) ((l)&_LEVEL_STRING_LIST) +//! @endcond + +/* Basic amp type, can store some useful info about different amplifiers. Each + * lib must be able to populate this structure, so we can make useful + * enquiries about capabilities. + */ + +//! @cond Doxygen_Suppress +#define AMP_MODEL(arg) .amp_model=arg,.macro_name=#arg +//! @endcond + +/** + * \brief Amplifier capabilities. + * + * \struct amp_caps + * + * The main idea of this struct is that it will be defined by the backend + * amplifier driver and will remain read-only for the application. Fields + * that need to be modifiable by the application are copied into the + * amp_state structure, which is the private memory area of the #AMP instance. + * + * This way you can have several amplifiers running within the same + * application, sharing the amp_caps structure of the backend, while keeping + * their own customized data. + * + * \b Note: Don't move fields around and only add new fields at the end of the + * amp_caps structure. Shared libraries and DLLs depend on a constant + * structure to maintain compatibility. + */ +struct amp_caps +{ + amp_model_t amp_model; /*!< Amplifier model as defined in amplist.h. */ + const char *model_name; /*!< Model name, e.g. MM-5k. */ + const char *mfg_name; /*!< Manufacturer, e.g. Moonbeam. */ + const char *version; /*!< Driver version, typically in YYYYMMDD.x format. */ + const char *copyright; /*!< Copyright info (should be LGPL). */ + enum rig_status_e status; /*!< Driver status. */ + + int amp_type; /*!< Amplifier type. */ + enum rig_port_e port_type; /*!< Type of communication port (serial, ethernet, etc.). */ + + int serial_rate_min; /*!< Minimal serial speed. */ + int serial_rate_max; /*!< Maximal serial speed. */ + int serial_data_bits; /*!< Number of data bits. */ + int serial_stop_bits; /*!< Number of stop bits. */ + enum serial_parity_e serial_parity; /*!< Parity. */ + enum serial_handshake_e serial_handshake; /*!< Handshake. */ + + int write_delay; /*!< Write delay. */ + int post_write_delay; /*!< Post-write delay. */ + int timeout; /*!< Timeout. */ + int retry; /*!< Number of retries if a command fails. */ + + const struct confparams *cfgparams; /*!< Configuration parameters. */ + const rig_ptr_t priv; /*!< Private data. */ + const char *amp_model_macro_name; /*!< Model macro name. */ + + setting_t has_get_level; /*!< List of get levels. */ + setting_t has_set_level; /*!< List of set levels. */ + + gran_t level_gran[RIG_SETTING_MAX]; /*!< Level granularity. */ + gran_t parm_gran[RIG_SETTING_MAX]; /*!< Parameter granularity. */ + + /* + * Amp Admin API + * + */ + + int (*amp_init)(AMP *amp); /*!< Pointer to backend implementation of ::amp_init(). */ + int (*amp_cleanup)(AMP *amp); /*!< Pointer to backend implementation of ::amp_cleanup(). */ + int (*amp_open)(AMP *amp); /*!< Pointer to backend implementation of ::amp_open(). */ + int (*amp_close)(AMP *amp); /*!< Pointer to backend implementation of ::amp_close(). */ + + int (*set_freq)(AMP *amp, freq_t val); /*!< Pointer to backend implementation of ::amp_set_freq(). */ + int (*get_freq)(AMP *amp, freq_t *val); /*!< Pointer to backend implementation of ::amp_get_freq(). */ + + int (*set_conf)(AMP *amp, token_t token, const char *val); /*!< Pointer to backend implementation of ::amp_set_conf(). */ + int (*get_conf)(AMP *amp, token_t token, char *val); /*!< Pointer to backend implementation of ::amp_get_conf(). */ + + /* + * General API commands, from most primitive to least.. :() + * List Set/Get functions pairs + */ + + int (*reset)(AMP *amp, amp_reset_t reset); /*!< Pointer to backend implementation of ::amp_reset(). */ + int (*get_level)(AMP *amp, setting_t level, value_t *val); /*!< Pointer to backend implementation of ::amp_get_level(). */ + int (*get_ext_level)(AMP *amp, token_t level, value_t *val); /*!< Pointer to backend implementation of ::amp_get_ext_level(). */ + int (*set_powerstat)(AMP *amp, powerstat_t status); /*!< Pointer to backend implementation of ::amp_set_powerstat(). */ + int (*get_powerstat)(AMP *amp, powerstat_t *status); /*!< Pointer to backend implementation of ::amp_get_powerstat(). */ + + + /* get firmware info, etc. */ + const char *(*get_info)(AMP *amp); /*!< Pointer to backend implementation of ::amp_get_info(). */ + +//! @cond Doxygen_Suppress + setting_t levels; + unsigned ext_levels; +//! @endcond + const struct confparams *extlevels; /*!< Extension levels list. \sa extamp.c */ + const struct confparams *extparms; /*!< Extension parameters list. \sa extamp.c */ + + const char *macro_name; /*!< Amplifier model macro name. */ +}; + + +/** + * \brief Amplifier state structure. + * + * \struct amp_state + * + * This structure contains live data, as well as a copy of capability fields + * that may be updated, i.e. customized while the #AMP handle is instantiated. + * + * It is fine to move fields around, as this kind of struct should not be + * initialized like amp_caps are. + */ +struct amp_state +{ + /* + * overridable fields + */ + + /* + * non overridable fields, internal use + */ + hamlib_port_t ampport; /*!< Amplifier port (internal use). */ + + int comm_state; /*!< Comm port state, opened/closed. */ + rig_ptr_t priv; /*!< Pointer to private amplifier state data. */ + rig_ptr_t obj; /*!< Internal use by hamlib++ for event handling. */ + + setting_t has_get_level; /*!< List of get levels. */ + + gran_t level_gran[RIG_SETTING_MAX]; /*!< Level granularity. */ + gran_t parm_gran[RIG_SETTING_MAX]; /*!< Parameter granularity. */ +}; + + +/** + * \brief Master amplifier structure. + * + * \struct amp + * + * Master amplifier data structure acting as the #AMP handle for the + * controlled amplifier. A pointer to this structure is returned by the + * amp_init() API function and is passed as a parameter to every amplifier + * specific API call. + * + * \sa amp_init(), amp_caps, amp_state + */ +struct amp +{ + struct amp_caps *caps; /*!< Amplifier caps. */ + struct amp_state state; /*!< Amplifier state. */ +}; + + +//! @cond Doxygen_Suppress +/* --------------- API function prototypes -----------------*/ + +extern HAMLIB_EXPORT(AMP *) +amp_init HAMLIB_PARAMS((amp_model_t amp_model)); + +extern HAMLIB_EXPORT(int) +amp_open HAMLIB_PARAMS((AMP *amp)); + +extern HAMLIB_EXPORT(int) +amp_close HAMLIB_PARAMS((AMP *amp)); + +extern HAMLIB_EXPORT(int) +amp_cleanup HAMLIB_PARAMS((AMP *amp)); + +extern HAMLIB_EXPORT(int) +amp_set_conf HAMLIB_PARAMS((AMP *amp, + token_t token, + const char *val)); +extern HAMLIB_EXPORT(int) +amp_get_conf HAMLIB_PARAMS((AMP *amp, + token_t token, + char *val)); +extern HAMLIB_EXPORT(int) +amp_set_powerstat HAMLIB_PARAMS((AMP *amp, + powerstat_t status)); +extern HAMLIB_EXPORT(int) +amp_get_powerstat HAMLIB_PARAMS((AMP *amp, + powerstat_t *status)); + + +/* + * General API commands, from most primitive to least.. ) + * List Set/Get functions pairs + */ +extern HAMLIB_EXPORT(int) +amp_get_freq HAMLIB_PARAMS((AMP *amp, + freq_t *freq)); +extern HAMLIB_EXPORT(int) +amp_set_freq HAMLIB_PARAMS((AMP *amp, + freq_t freq)); + +extern HAMLIB_EXPORT(int) +amp_reset HAMLIB_PARAMS((AMP *amp, + amp_reset_t reset)); + +extern HAMLIB_EXPORT(const char *) +amp_get_info HAMLIB_PARAMS((AMP *amp)); + +extern HAMLIB_EXPORT(int) +amp_get_level HAMLIB_PARAMS((AMP *amp, setting_t level, value_t *val)); + +extern HAMLIB_EXPORT(int) +amp_register HAMLIB_PARAMS((const struct amp_caps *caps)); + +extern HAMLIB_EXPORT(int) +amp_unregister HAMLIB_PARAMS((amp_model_t amp_model)); + +extern HAMLIB_EXPORT(int) +amp_list_foreach HAMLIB_PARAMS((int (*cfunc)(const struct amp_caps *, + rig_ptr_t), + rig_ptr_t data)); + +extern HAMLIB_EXPORT(int) +amp_load_backend HAMLIB_PARAMS((const char *be_name)); + +extern HAMLIB_EXPORT(int) +amp_check_backend HAMLIB_PARAMS((amp_model_t amp_model)); + +extern HAMLIB_EXPORT(int) +amp_load_all_backends HAMLIB_PARAMS((void)); + +extern HAMLIB_EXPORT(amp_model_t) +amp_probe_all HAMLIB_PARAMS((hamlib_port_t *p)); + +extern HAMLIB_EXPORT(int) +amp_token_foreach HAMLIB_PARAMS((AMP *amp, + int (*cfunc)(const struct confparams *, + rig_ptr_t), + rig_ptr_t data)); + +extern HAMLIB_EXPORT(const struct confparams *) +amp_confparam_lookup HAMLIB_PARAMS((AMP *amp, + const char *name)); + +extern HAMLIB_EXPORT(token_t) +amp_token_lookup HAMLIB_PARAMS((AMP *amp, + const char *name)); + +extern HAMLIB_EXPORT(const struct amp_caps *) +amp_get_caps HAMLIB_PARAMS((amp_model_t amp_model)); + +extern HAMLIB_EXPORT(setting_t) +amp_has_get_level HAMLIB_PARAMS((AMP *amp, + setting_t level)); + +extern HAMLIB_EXPORT(const struct confparams *) +amp_ext_lookup HAMLIB_PARAMS((AMP *amp, + const char *name)); + +extern HAMLIB_EXPORT(int) +amp_get_ext_level HAMLIB_PARAMS((AMP *amp, + token_t token, + value_t *val)); + +extern HAMLIB_EXPORT(const char *) amp_strlevel(setting_t); + +extern HAMLIB_EXPORT(const struct confparams *) +rig_ext_lookup HAMLIB_PARAMS((RIG *rig, + const char *name)); + +extern HAMLIB_EXPORT(setting_t) amp_parse_level(const char *s); +extern HAMLIB_EXPORT(const char *) amp_strlevel(setting_t); + +//! @endcond + + +/** + * \brief Convenience macro for generating debugging messages. + * + * \def amp_debug + * + * This is an alias of the rig_debug() function call and is used in the same + * manner. + */ +#define amp_debug rig_debug + +__END_DECLS + +#endif /* _AMPLIFIER_H */ + +/** @} */ diff --git a/hamlib/amplist.h b/hamlib/amplist.h new file mode 100644 index 0000000..e52f66f --- /dev/null +++ b/hamlib/amplist.h @@ -0,0 +1,120 @@ +/* + * Hamlib Interface - list of known amplifiers + * Copyright (c) 2000-2011 by Stephane Fillod + * Copyright (c) 2000-2002 by Frank Singleton + * Copyright (C) 2019 by Michael Black W9MDB. Derived from rotlist.h + * + * + * 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 _AMPLIST_H +#define _AMPLIST_H 1 + +//! @cond Doxygen_Suppress +#define AMP_MAKE_MODEL(a,b) ((a)*100+(b)) +#define AMP_BACKEND_NUM(a) ((a)/100) +//! @endcond + + +/** + * \addtogroup amplifier + * @{ + */ + +/** + * \brief Hamlib amplifier model definitions. + * + * \file amplist.h + * + * This file contains amplifier model definitions for the Hamlib amplifier + * Application Programming Interface (API). Each distinct amplifier type has + * a unique model number (ID) and is used by Hamlib to identify and + * distinguish between the different hardware drivers. The exact model + * numbers can be acquired using the macros in this file. To obtain a list of + * supported amplifier branches, one can use the statically defined + * AMP_BACKEND_LIST macro (defined in configure.ac). To obtain a full list of + * supported amplifiers (including each model in every branch), the + * foreach_opened_amp() API function can be used. + * + * The model number, or ID, is used to tell Hamlib which amplifier the client + * wishes to use which is done with the amp_init() API call. + */ + + +/** + * \brief A macro that returns the model number for an unknown model. + * + * \def AMP_MODEL_NONE + * + * The none backend, as the name suggests, does nothing. It is mainly for + * internal use. + */ +#define AMP_MODEL_NONE 0 + + +/** + * \brief A macro that returns the model number for the DUMMY backend. + * + * \def AMP_MODEL_DUMMY + * + * The DUMMY backend, as the name suggests, is a backend which performs no + * hardware operations and always behaves as one would expect. It can be + * thought of as a hardware simulator and is very useful for testing client + * applications. + */ +/** + * \brief A macro that returns the model number for the NETAMPCTL backend. + * + * \def AMP_MODEL_NETAMPCTL + * + * The NETAMPCTL backend allows use of the `ampctld` daemon through the normal + * Hamlib API. + */ +//! @cond Doxygen_Suppress +#define AMP_DUMMY 0 +#define AMP_BACKEND_DUMMY "dummy" +//! @endcond +#define AMP_MODEL_DUMMY AMP_MAKE_MODEL(AMP_DUMMY, 1) +#define AMP_MODEL_NETAMPCTL AMP_MAKE_MODEL(AMP_DUMMY, 2) + + +/** + * \brief A macro that returns the model number of the KPA1500 backend. + * + * \def AMP_MODEL_ELECRAFT_KPA1500 + * + * The KPA1500 backend can be used with amplifiers that support the Elecraft + * KPA-1500 protocol. + */ +//! @cond Doxygen_Suppress +#define AMP_ELECRAFT 2 +#define AMP_BACKEND_ELECRAFT "elecraft" +//! @endcond +#define AMP_MODEL_ELECRAFT_KPA1500 AMP_MAKE_MODEL(AMP_ELECRAFT, 1) +//#define AMP_MODEL_ELECRAFT_KPA500 AMP_MAKE_MODEL(AMP_ELECRAFT, 2) + +/** + * \brief Convenience type definition for an amplifier model. + * + * \typedef typedef int amp_model_t + */ +typedef int amp_model_t; + + +#endif /* _AMPLIST_H */ + +/** @} */ diff --git a/hamlib/libhamlib.dll.a b/hamlib/libhamlib.dll.a new file mode 100644 index 0000000000000000000000000000000000000000..7942496a1d7239ef6a5b387c8281de0e58d091c6 GIT binary patch literal 253054 zcmeI53%F!gRiM|c+dyn%h!A54Av7^y2(hXA>b@Ogj1VIPj4?()P^#-zoqKQPR@JFg z)$Q&?L>__|Gfdfmv&>v!CbG?z8jF z_hon0uJ2n_b=KZ>>a27Av-aL=Kh6`bYL7d+S08-pA^X)dHu<~xe(2E3=8-kl96t!K z+yrkUZ~xmKUr8kbKuIEUmW!khDL} z(#8FgY+uc?I|d-RsZ7l7nWV0ktE2gzM%7s+exVR`+<03>fb&hn-=0FeCX@3Fk) z007BbuVZ=J9RMV6|0v5l8vrElI?VD@T>z4welyF@;4zZC??RUMKM#Q91Glq$5c84z z!mqIWG9E9(+mEdOu_faEiHT}bZ# zAj@a**hv02o-d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L z;p%*h?kq zH^LGd8&-L|O+Yj`jj4cxikkTtQ$f@?V=A<2HZ{%qG2~Rw0r(O{4X)BYCv|1QL|bD! z9YgP7C?Lw5JP*c0sTE9TeLlwJC`)W~PB$*684y`c)Zh$pMGY>{7eg!uL&FvQ5+Svm z4q4(*BUBz=6B0izub8!HedZ4r)CezL%$tdq9NE*U`y#66T^ZJBc1)#*p8B!ljkWU3 z&qeFadYGVx9663tXb+;FdnKQ)pb1i)exf()`l2_hWRd2moaCXYew;Zy^@qv|D#1Ga z94DQ}I#RIi$Wpe#z(!c*iRm;0;>l@sa~wCttYqyWP4RrMV<98rOz&o$Jvs0qT5jsj*6Uc-81&eBPZ<>uOHS();5uMWzv<~~ etF7(*VP}d@9i!Vg*0QQjec7>w0dkd<^!z`O#?bWu literal 0 HcmV?d00001 diff --git a/hamlib/rig.h b/hamlib/rig.h new file mode 100644 index 0000000..00d10b2 --- /dev/null +++ b/hamlib/rig.h @@ -0,0 +1,3196 @@ +/* + * Hamlib Interface - API header + * Copyright (c) 2000-2003 by Frank Singleton + * Copyright (c) 2000-2012 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 _RIG_H +#define _RIG_H 1 + +#define TRACE rig_debug(RIG_DEBUG_TRACE,"%s(%d) trace\n", __FILE__, __LINE__) +#define __FILENAME__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__) + +#include +#include +#include +#include +#include +#include + +/* Rig list is in a separate file so as not to mess up w/ this one */ +#include + +/** + * \addtogroup rig + * @{ + */ + +/*! \file rig.h + * \brief Hamlib rig data structures. + * + * This file contains the data structures and definitions for the Hamlib rig API. + * see the rig.c file for more details on the rig API. + */ + + +/* __BEGIN_DECLS should be used at the beginning of your declarations, + * so that C++ compilers don't mangle their names. Use __END_DECLS at + * the end of C declarations. */ +//! @cond Doxygen_Suppress +#undef __BEGIN_DECLS +#undef __END_DECLS +#ifdef __cplusplus +# define __BEGIN_DECLS extern "C" { +# define __END_DECLS } +#else +# define __BEGIN_DECLS /* empty */ +# define __END_DECLS /* empty */ +#endif +//! @endcond + +/* HAMLIB_PARAMS is a macro used to wrap function prototypes, so that compilers + * that don't understand ANSI C prototypes still work, and ANSI C + * compilers can issue warnings about type mismatches. */ +//! @cond Doxygen_Suppress +#undef HAMLIB_PARAMS +#if defined (__STDC__) \ + || defined (_AIX) \ + || (defined (__mips) && defined (_SYSTYPE_SVR4)) \ + || defined(__CYGWIN__) \ + || defined(_WIN32) \ + || defined(__cplusplus) +# define HAMLIB_PARAMS(protos) protos +# define rig_ptr_t void * +# define amp_ptr_t void * +#else +# define HAMLIB_PARAMS(protos) () +# define rig_ptr_t char * +# define amp_ptr_t char * +#endif +//! @endcond + +#include + +#ifndef SWIGLUA +//! @cond Doxygen_Suppress +#define CONSTANT_64BIT_FLAG(BIT) (1ull << (BIT)) +//! @endcond +#else +/* SWIG's older Lua generator doesn't grok ull due to Lua using a + double-precision floating point type internally for number + representations (max 53 bits of precision) so makes a string + constant from a constant number literal using ull */ +// #define CONSTANT_64BIT_FLAG(BIT) (1 << (BIT)) +// #define SWIGLUAHIDE +/* But this appears to have been fixed so we'll use the correct one now + If you have the older version of SWIG comment out this line and use + the two above */ +// This 1ul definition works on swig 4.0.1 and lua 5.3.5 +#define CONSTANT_64BIT_FLAG(BIT) (1ul << (BIT)) +#endif + +__BEGIN_DECLS + +/** + * \brief size of cookie request buffer + * Minimum size of cookie buffer to pass to rig_cookie + */ +// cookie is 26-char time code plus 10-char (2^31-1) random number +#define HAMLIB_COOKIE_SIZE 37 +extern int cookie_use; // this is global as once one client requests it everybody needs to honor it + +//! @cond Doxygen_Suppress +extern HAMLIB_EXPORT_VAR(const char) hamlib_version[]; +extern HAMLIB_EXPORT_VAR(const char) hamlib_copyright[]; +extern HAMLIB_EXPORT_VAR(const char *) hamlib_version2; +extern HAMLIB_EXPORT_VAR(const char *) hamlib_copyright2; +//! @endcond + +/** + * \brief Hamlib error codes + * Error code definition that can be returned by the Hamlib functions. + * Unless stated otherwise, Hamlib functions return the negative value + * of rig_errcode_e definitions in case of error, or 0 when successful. + */ +enum rig_errcode_e { + RIG_OK = 0, /*!< 0 No error, operation completed successfully */ + RIG_EINVAL, /*!< 1 invalid parameter */ + RIG_ECONF, /*!< 2 invalid configuration (serial,..) */ + RIG_ENOMEM, /*!< 3 memory shortage */ + RIG_ENIMPL, /*!< 4 function not implemented, but will be */ + RIG_ETIMEOUT, /*!< 5 communication timed out */ + RIG_EIO, /*!< 6 IO error, including open failed */ + RIG_EINTERNAL, /*!< 7 Internal Hamlib error, huh! */ + RIG_EPROTO, /*!< 8 Protocol error */ + RIG_ERJCTED, /*!< 9 Command rejected by the rig */ + RIG_ETRUNC, /*!< 10 Command performed, but arg truncated */ + RIG_ENAVAIL, /*!< 11 Function not available */ + RIG_ENTARGET, /*!< 12 VFO not targetable */ + RIG_BUSERROR, /*!< 13 Error talking on the bus */ + RIG_BUSBUSY, /*!< 14 Collision on the bus */ + RIG_EARG, /*!< 15 NULL RIG handle or any invalid pointer parameter in get arg */ + RIG_EVFO, /*!< 16 Invalid VFO */ + RIG_EDOM /*!< 17 Argument out of domain of func */ +}; + +/** + * \brief Determines if the given error code indicates a "soft" error + * Soft errors are caused by invalid parameters and software/hardware features + * and cannot be fixed by retries or by re-initializing hardware. + */ +#define RIG_IS_SOFT_ERRCODE(errcode) (errcode == RIG_EINVAL || errcode == RIG_ENIMPL || errcode == RIG_ERJCTED \ + || errcode == RIG_ETRUNC || errcode == RIG_ENAVAIL || errcode == RIG_ENTARGET \ + || errcode == RIG_EVFO || errcode == RIG_EDOM) + +/** + * \brief Token in the netrigctl protocol for returning error code + */ +#define NETRIGCTL_RET "RPRT " + + +/** + *\brief Hamlib debug levels + * + * NOTE: Numeric order matters for debug level + * + * \sa rig_set_debug() + */ +enum rig_debug_level_e { + RIG_DEBUG_NONE = 0, /*!< no bug reporting */ + RIG_DEBUG_BUG, /*!< serious bug */ + RIG_DEBUG_ERR, /*!< error case (e.g. protocol, memory allocation) */ + RIG_DEBUG_WARN, /*!< warning */ + RIG_DEBUG_VERBOSE, /*!< verbose */ + RIG_DEBUG_TRACE, /*!< tracing */ + RIG_DEBUG_CACHE /*!< caching */ +}; + + +/* --------------- Rig capabilities -----------------*/ + +/* Forward struct references */ + +struct rig; +struct rig_state; + +/** + * \brief Rig structure definition (see rig for details). + */ +typedef struct s_rig RIG; + +//! @cond Doxygen_Suppress +#define HAMLIB_RIGNAMSIZ 30 +#define HAMLIB_RIGVERSIZ 8 +#define HAMLIB_FILPATHLEN 512 +#define HAMLIB_FRQRANGESIZ 30 +#define HAMLIB_MAXCHANDESC 30 /* describe channel eg: "WWV 5Mhz" */ +#define HAMLIB_TSLSTSIZ 20 /* max tuning step list size, zero ended */ +#define HAMLIB_FLTLSTSIZ 60 /* max mode/filter list size, zero ended */ +#define HAMLIB_MAXDBLSTSIZ 8 /* max preamp/att levels supported, zero ended */ +#define HAMLIB_CHANLSTSIZ 16 /* max mem_list size, zero ended */ +#define HAMLIB_MAX_AGC_LEVELS 8 /* max AGC levels supported */ +#define HAMLIB_MAX_SPECTRUM_SCOPES 4 /* max number of spectrum scopes supported */ +#define HAMLIB_MAX_SPECTRUM_MODES 5 /* max number of spectrum modes supported */ +#define HAMLIB_MAX_SPECTRUM_AVG_MODES 12 /* max number of spectrum averaging modes supported */ +#define HAMLIB_MAX_SPECTRUM_SPANS 20 /* max number of spectrum modes supported */ +#define HAMLIB_MAX_CAL_LENGTH 32 /* max calibration plots in cal_table_t */ +#define HAMLIB_MAX_MODES 63 +#define HAMLIB_MAX_VFOS 31 +#define HAMLIB_MAX_ROTORS 63 +#define HAMLIB_MAX_VFO_OPS 31 +#define HAMLIB_MAX_RSCANS 31 +//! @endcond + + +/** + * \brief CTCSS and DCS type definition. + * + * Continuous Tone Controlled Squelch System (CTCSS) + * sub-audible tone frequency are expressed in \em tenth of Hz. + * For example, the subaudible tone of 88.5 Hz is represented within + * Hamlib by 885. + * + * Digitally-Coded Squelch codes are simple direct integers. + */ +#define CTCSS_LIST_SIZE 60 +#define DCS_LIST_SIZE 128 +typedef unsigned int tone_t; + + +/** + * \brief Port type + */ +typedef enum rig_port_e { + RIG_PORT_NONE = 0, /*!< No port */ + RIG_PORT_SERIAL, /*!< Serial */ + RIG_PORT_NETWORK, /*!< Network socket type */ + RIG_PORT_DEVICE, /*!< Device driver, like the WiNRADiO */ + RIG_PORT_PACKET, /*!< AX.25 network type, e.g. SV8CS protocol */ + RIG_PORT_DTMF, /*!< DTMF protocol bridge via another rig, eg. Kenwood Sky Cmd System */ + RIG_PORT_ULTRA, /*!< IrDA Ultra protocol! */ + RIG_PORT_RPC, /*!< RPC wrapper */ + RIG_PORT_PARALLEL, /*!< Parallel port */ + RIG_PORT_USB, /*!< USB port */ + RIG_PORT_UDP_NETWORK, /*!< UDP Network socket type */ + RIG_PORT_CM108, /*!< CM108 GPIO */ + RIG_PORT_GPIO, /*!< GPIO */ + RIG_PORT_GPION, /*!< GPIO inverted */ +} rig_port_t; + + +/** + * \brief Serial parity + */ +enum serial_parity_e { + RIG_PARITY_NONE = 0, /*!< No parity */ + RIG_PARITY_ODD, /*!< Odd */ + RIG_PARITY_EVEN, /*!< Even */ + RIG_PARITY_MARK, /*!< Mark */ + RIG_PARITY_SPACE /*!< Space */ +}; + + +/** + * \brief Serial handshake + */ +enum serial_handshake_e { + RIG_HANDSHAKE_NONE = 0, /*!< No handshake */ + RIG_HANDSHAKE_XONXOFF, /*!< Software XON/XOFF */ + RIG_HANDSHAKE_HARDWARE /*!< Hardware CTS/RTS */ +}; + + +/** + * \brief Serial control state + */ +enum serial_control_state_e { + RIG_SIGNAL_UNSET = 0, /*!< Unset or tri-state */ + RIG_SIGNAL_ON, /*!< ON */ + RIG_SIGNAL_OFF /*!< OFF */ +}; + + +/** + * \brief Rig type flags + */ +typedef enum { + RIG_FLAG_RECEIVER = (1 << 1), /*!< Receiver */ + RIG_FLAG_TRANSMITTER = (1 << 2), /*!< Transmitter */ + RIG_FLAG_SCANNER = (1 << 3), /*!< Scanner */ + RIG_FLAG_MOBILE = (1 << 4), /*!< mobile sized */ + RIG_FLAG_HANDHELD = (1 << 5), /*!< handheld sized */ + RIG_FLAG_COMPUTER = (1 << 6), /*!< "Computer" rig */ + RIG_FLAG_TRUNKING = (1 << 7), /*!< has trunking */ + RIG_FLAG_APRS = (1 << 8), /*!< has APRS */ + RIG_FLAG_TNC = (1 << 9), /*!< has TNC */ + RIG_FLAG_DXCLUSTER = (1 << 10), /*!< has DXCluster */ + RIG_FLAG_TUNER = (1 << 11) /*!< dumb tuner */ +} rig_type_t; + +//! @cond Doxygen_Suppress +#define RIG_FLAG_TRANSCEIVER (RIG_FLAG_RECEIVER|RIG_FLAG_TRANSMITTER) +#define RIG_TYPE_MASK (RIG_FLAG_TRANSCEIVER|RIG_FLAG_SCANNER|RIG_FLAG_MOBILE|RIG_FLAG_HANDHELD|RIG_FLAG_COMPUTER|RIG_FLAG_TRUNKING|RIG_FLAG_TUNER) + +#define RIG_TYPE_OTHER 0 +#define RIG_TYPE_TRANSCEIVER RIG_FLAG_TRANSCEIVER +#define RIG_TYPE_HANDHELD (RIG_FLAG_TRANSCEIVER|RIG_FLAG_HANDHELD) +#define RIG_TYPE_MOBILE (RIG_FLAG_TRANSCEIVER|RIG_FLAG_MOBILE) +#define RIG_TYPE_RECEIVER RIG_FLAG_RECEIVER +#define RIG_TYPE_PCRECEIVER (RIG_FLAG_COMPUTER|RIG_FLAG_RECEIVER) +#define RIG_TYPE_SCANNER (RIG_FLAG_SCANNER|RIG_FLAG_RECEIVER) +#define RIG_TYPE_TRUNKSCANNER (RIG_TYPE_SCANNER|RIG_FLAG_TRUNKING) +#define RIG_TYPE_COMPUTER (RIG_FLAG_TRANSCEIVER|RIG_FLAG_COMPUTER) +#define RIG_TYPE_TUNER RIG_FLAG_TUNER +//! @endcond + + +/** + * \brief Development status of the backend + */ +enum rig_status_e { + RIG_STATUS_ALPHA = 0, /*!< Alpha quality, i.e. development */ + RIG_STATUS_UNTESTED, /*!< Written from available specs, rig unavailable for test, feedback wanted! */ + RIG_STATUS_BETA, /*!< Beta quality */ + RIG_STATUS_STABLE, /*!< Stable */ + RIG_STATUS_BUGGY /*!< Was stable, but something broke it! */ + /* RIG_STATUS_NEW * *!< Initial release of code + * !! Use of RIG_STATUS_NEW is deprecated. Do not use it anymore */ +}; + +/** + * \brief Map all deprecated RIG_STATUS_NEW references to + * RIG_STATUS_UNTESTED for backward compatibility + */ +#define RIG_STATUS_NEW RIG_STATUS_UNTESTED + + +/** + * \brief Repeater shift type + */ +typedef enum { + RIG_RPT_SHIFT_NONE = 0, /*!< No repeater shift */ + RIG_RPT_SHIFT_MINUS, /*!< "-" shift */ + RIG_RPT_SHIFT_PLUS /*!< "+" shift */ +} rptr_shift_t; + + +/** + * \brief Split mode + */ +typedef enum { + RIG_SPLIT_OFF = 0, /*!< Split mode disabled */ + RIG_SPLIT_ON /*!< Split mode enabled */ +} split_t; + + +/** + * \brief Frequency type, + * + * Frequency type unit in Hz, able to hold SHF frequencies. + */ +typedef double freq_t; + +/** + * \brief printf(3) format to be used for freq_t type + */ +#define PRIfreq ".0f" + +/** + * \brief scanf(3) format to be used for freq_t type + */ +#define SCNfreq "lf" +/** + * \brief printf(3) format to be used for freq_t type + */ +#define FREQFMT SCNfreq + + +/** + * \brief Short frequency type + * + * Frequency in Hz restricted to 31bits, suitable for offsets, shifts, etc.. + */ +typedef signed long shortfreq_t; + +/** \brief \c Macro to return Hz when f=Hz */ +#define Hz(f) ((freq_t)(f)) +/** \brief \c Macro to return Hz when f=kHz */ +#define kHz(f) ((freq_t)((f)*(freq_t)1000)) +/** \brief \c Macro to return Hz when f=MHz */ +#define MHz(f) ((freq_t)((f)*(freq_t)1000000)) +/** \brief \c Macro to return Hz when f=GHz */ +#define GHz(f) ((freq_t)((f)*(freq_t)1000000000)) + +/** \brief \c Macro to return short Hz when f=Hz */ +#define s_Hz(f) ((shortfreq_t)(f)) +/** \brief \c Macro to return short Hz when f=kHz */ +#define s_kHz(f) ((shortfreq_t)((f)*(shortfreq_t)1000)) +/** \brief \c Macro to return short Hz when f=MHz */ +#define s_MHz(f) ((shortfreq_t)((f)*(shortfreq_t)1000000)) +/** \brief \c Macro to return short Hz when f=GHz */ +#define s_GHz(f) ((shortfreq_t)((f)*(shortfreq_t)1000000000)) + +/** \brief \c Frequency none -- used as default value for checking */ +#define RIG_FREQ_NONE Hz(0) + + +/** + * \brief VFO definition + * + * There are several ways of using a vfo_t. For most cases, using RIG_VFO_A, + * RIG_VFO_B, RIG_VFO_CURR, etc., as opaque macros should suffice. + * + * Strictly speaking a VFO is Variable Frequency Oscillator. + * Here, it is referred as a tunable channel, from the radio operator's + * point of view. The channel can be designated individually by its real + * number, or by using an alias. + * + * Aliases may or may not be honored by a backend and are defined using + * high significant bits, i.e. RIG_VFO_MEM, RIG_VFO_MAIN, etc. + */ +typedef unsigned int vfo_t; + +/** \brief '' -- used in caps */ + +#define RIG_VFO_N(n) (1u<<(n)) + +/** \brief \c VFONone -- vfo unknown */ +#define RIG_VFO_NONE 0 + +/** \brief \c VFOA -- VFO A */ +#define RIG_VFO_A RIG_VFO_N(0) + +/** \brief \c VFOB -- VFO B */ +#define RIG_VFO_B RIG_VFO_N(1) + +/** \brief \c VFOC -- VFO C */ +#define RIG_VFO_C RIG_VFO_N(2) + +// Any addition VFOS need to go from 3-20 +// To maintain backward compatibility these values cannot change + +/** \brief \c SubA -- alias for SUB_A */ +#define RIG_VFO_SUB_A RIG_VFO_N(21) + +/** \brief \c SubB -- alias for SUB_B */ +#define RIG_VFO_SUB_B RIG_VFO_N(22) + +/** \brief \c SubC -- alias for SUB_B */ +#define RIG_VFO_SUB_C RIG_VFO_N(3) + +/** \brief \c MainA -- alias for MAIN_A */ +#define RIG_VFO_MAIN_A RIG_VFO_N(23) + +/** \brief \c MainB -- alias for MAIN_B */ +#define RIG_VFO_MAIN_B RIG_VFO_N(24) + +/** \brief \c MainC -- alias for MAIN_C */ +#define RIG_VFO_MAIN_C RIG_VFO_N(4) + +/** \brief \c Other -- alias for OTHER -- e.g. Icom rigs without get_vfo capability */ +#define RIG_VFO_OTHER RIG_VFO_N(5) + +/** \brief \c Sub -- alias for SUB */ +#define RIG_VFO_SUB RIG_VFO_N(25) + +/** \brief \c Main -- alias for MAIN */ +#define RIG_VFO_MAIN RIG_VFO_N(26) + +/** \brief \c VFO -- means (last or any)VFO mode, with set_vfo */ +#define RIG_VFO_VFO RIG_VFO_N(27) + +/** \brief \c MEM -- means Memory mode, to be used with set_vfo */ +#define RIG_VFO_MEM RIG_VFO_N(28) + +/** \brief \c currVFO -- current "tunable channel"/VFO */ +#define RIG_VFO_CURR RIG_VFO_N(29) + +/** \brief \c Flag to set if VFO can transmit */ +#define RIG_VFO_TX_FLAG RIG_VFO_N(30) + +/** \brief \c Flag to set all VFOS */ +#define RIG_VFO_ALL RIG_VFO_N(31) + +// we can also use RIG_VFO_N(31) if needed + +// Misc VFO Macros + +/** \brief \c Macro to tell you if VFO can transmit */ +#define RIG_VFO_TX_VFO(v) ((v)|RIG_VFO_TX_FLAG) + +/** \brief \c TX -- alias for split tx or uplink, of VFO_CURR */ +#define RIG_VFO_TX RIG_VFO_TX_VFO(RIG_VFO_CURR) + +/** \brief \c RX -- alias for split rx or downlink */ +#define RIG_VFO_RX RIG_VFO_CURR + + +/* + * targetable bitfields, for internal use. + * In rig.c lack of a flag will case a VFO change if needed + * So setting this flag will mean the backend handles any VFO needs + * For many rigs RITXIT, PTT, MEM, and BANK are non-VFO commands so need these flags to avoid unnecessary VFO swapping + */ +//! @cond Doxygen_Suppress +#define RIG_TARGETABLE_NONE 0 +#define RIG_TARGETABLE_FREQ (1<<0) +#define RIG_TARGETABLE_MODE (1<<1) // mode by vfo or same mode on both vfos +#define RIG_TARGETABLE_PURE (1<<2) // deprecated -- not used -- reuse it +#define RIG_TARGETABLE_TONE (1<<3) +#define RIG_TARGETABLE_FUNC (1<<4) +#define RIG_TARGETABLE_LEVEL (1<<5) +#define RIG_TARGETABLE_RITXIT (1<<6) +#define RIG_TARGETABLE_PTT (1<<7) +#define RIG_TARGETABLE_MEM (1<<8) +#define RIG_TARGETABLE_BANK (1<<9) +#define RIG_TARGETABLE_ANT (1<<10) +#define RIG_TARGETABLE_ROOFING (1<<11) // roofing filter targetable by VFO +#define RIG_TARGETABLE_SPECTRUM (1<<12) // spectrum scope targetable by VFO +#define RIG_TARGETABLE_COMMON (RIG_TARGETABLE_RITXIT | RIG_TARGETABLE_PTT | RIG_TARGETABLE_MEM | RIG_TARGETABLE_BANK) +#define RIG_TARGETABLE_ALL 0x7fffffff +//! @endcond +// +// +// Newer Icoms like the 9700 and 910 have VFOA/B on both Main & Sub +// Compared to older rigs which have one or the other +// So we need to distinguish between them +//! @cond Doxygen_Suppress +#define VFO_HAS_A_B ((rig->state.vfo_list & (RIG_VFO_A|RIG_VFO_B)) == (RIG_VFO_A|RIG_VFO_B)) +#define VFO_HAS_MAIN_SUB ((rig->state.vfo_list & (RIG_VFO_MAIN|RIG_VFO_SUB)) == (RIG_VFO_MAIN|RIG_VFO_SUB)) +#define VFO_HAS_MAIN_SUB_ONLY ((!VFO_HAS_A_B) & VFO_HAS_MAIN_SUB) +#define VFO_HAS_MAIN_SUB_A_B_ONLY (VFO_HAS_A_B & VFO_HAS_MAIN_SUB) +#define VFO_HAS_A_B_ONLY (VFO_HAS_A_B & (!VFO_HAS_MAIN_SUB)) +#define VFO_DUAL (RIG_VFO_MAIN_A|RIG_VFO_MAIN_B|RIG_VFO_SUB_A|RIG_VFO_SUB_B) +#define VFO_HAS_DUAL ((rig->state.vfo_list & VFO_DUAL) == VFO_DUAL) +//! @endcond + +/** + * \brief Macro for bandpass to be set to normal + * \def RIG_PASSBAND_NORMAL + */ +#define RIG_PASSBAND_NORMAL s_Hz(0) + +/** + * \brief Macro for bandpass to be left alone + */ +#define RIG_PASSBAND_NOCHANGE s_Hz(-1) + +/** + * + * \sa rig_passband_normal(), rig_passband_narrow(), rig_passband_wide() + */ +typedef shortfreq_t pbwidth_t; + + +/** + * \brief DCD status + */ +typedef enum dcd_e { + RIG_DCD_OFF = 0, /*!< Squelch closed */ + RIG_DCD_ON /*!< Squelch open */ +} dcd_t; + + +/** + * \brief DCD type + * + * \sa rig_get_dcd() + */ +typedef enum { + RIG_DCD_NONE = 0, /*!< No DCD available */ + RIG_DCD_RIG, /*!< Rig has DCD status support, i.e. rig has get_dcd cap */ + RIG_DCD_SERIAL_DSR, /*!< DCD status from serial DSR signal */ + RIG_DCD_SERIAL_CTS, /*!< DCD status from serial CTS signal */ + RIG_DCD_SERIAL_CAR, /*!< DCD status from serial CD signal */ + RIG_DCD_PARALLEL, /*!< DCD status from parallel port pin */ + RIG_DCD_CM108, /*!< DCD status from CM108 vol dn pin */ + RIG_DCD_GPIO, /*!< DCD status from GPIO pin */ + RIG_DCD_GPION, /*!< DCD status from inverted GPIO pin */ +} dcd_type_t; + + +/** + * \brief PTT status + */ +typedef enum { + RIG_PTT_OFF = 0, /*!< PTT deactivated */ + RIG_PTT_ON, /*!< PTT activated */ + RIG_PTT_ON_MIC, /*!< PTT Mic only, fallbacks on RIG_PTT_ON if unavailable */ + RIG_PTT_ON_DATA /*!< PTT Data (Mic-muted), fallbacks on RIG_PTT_ON if unavailable */ +} ptt_t; + + +/** + * \brief PTT type + * + * \sa rig_get_ptt() + */ +typedef enum { + RIG_PTT_NONE = 0, /*!< No PTT available */ + RIG_PTT_RIG, /*!< Legacy PTT (CAT PTT) */ + RIG_PTT_SERIAL_DTR, /*!< PTT control through serial DTR signal */ + RIG_PTT_SERIAL_RTS, /*!< PTT control through serial RTS signal */ + RIG_PTT_PARALLEL, /*!< PTT control through parallel port */ + RIG_PTT_RIG_MICDATA, /*!< Legacy PTT (CAT PTT), supports RIG_PTT_ON_MIC/RIG_PTT_ON_DATA */ + RIG_PTT_CM108, /*!< PTT control through CM108 GPIO pin */ + RIG_PTT_GPIO, /*!< PTT control through GPIO pin */ + RIG_PTT_GPION, /*!< PTT control through inverted GPIO pin */ +} ptt_type_t; + + +/** + * \brief Radio power state + */ +typedef enum { + RIG_POWER_OFF = 0, /*!< Power off */ + RIG_POWER_ON = (1 << 0), /*!< Power on */ + RIG_POWER_STANDBY = (1 << 1), /*!< Standby */ + RIG_POWER_OPERATE = (1 << 2), /*!< Operate (from Standby) */ + RIG_POWER_UNKNOWN = (1 << 3) /*!< Unknown power status */ +} powerstat_t; + + +/** + * \brief Reset operation + */ +typedef enum { + RIG_RESET_NONE = 0, /*!< No reset */ + RIG_RESET_SOFT = (1 << 0), /*!< Software reset */ + RIG_RESET_VFO = (1 << 1), /*!< VFO reset */ + RIG_RESET_MCALL = (1 << 2), /*!< Memory clear */ + RIG_RESET_MASTER = (1 << 3) /*!< Master reset */ +} reset_t; + + +/** + * \brief VFO operation + * + * A VFO operation is an action on a VFO (or tunable memory). + * The difference with a function is that an action has no on/off + * status, it is performed at once. + * + * NOTE: the vfo argument for some vfo operation may be irrelevant, + * and thus will be ignored. + * + * The VFO/MEM "mode" is set by rig_set_vfo.\n + * \c STRING used in rigctl + * + * \sa rig_parse_vfo_op(), rig_strvfop() + */ +typedef enum { + RIG_OP_NONE = 0, /*!< '' No VFO_OP */ + RIG_OP_CPY = (1 << 0), /*!< \c CPY -- VFO A = VFO B */ + RIG_OP_XCHG = (1 << 1), /*!< \c XCHG -- Exchange VFO A/B */ + RIG_OP_FROM_VFO = (1 << 2), /*!< \c FROM_VFO -- VFO->MEM */ + RIG_OP_TO_VFO = (1 << 3), /*!< \c TO_VFO -- MEM->VFO */ + RIG_OP_MCL = (1 << 4), /*!< \c MCL -- Memory clear */ + RIG_OP_UP = (1 << 5), /*!< \c UP -- UP increment VFO freq by tuning step*/ + RIG_OP_DOWN = (1 << 6), /*!< \c DOWN -- DOWN decrement VFO freq by tuning step*/ + RIG_OP_BAND_UP = (1 << 7), /*!< \c BAND_UP -- Band UP */ + RIG_OP_BAND_DOWN = (1 << 8), /*!< \c BAND_DOWN -- Band DOWN */ + RIG_OP_LEFT = (1 << 9), /*!< \c LEFT -- LEFT */ + RIG_OP_RIGHT = (1 << 10), /*!< \c RIGHT -- RIGHT */ + RIG_OP_TUNE = (1 << 11), /*!< \c TUNE -- Start tune */ + RIG_OP_TOGGLE = (1 << 12) /*!< \c TOGGLE -- Toggle VFOA and VFOB */ +} vfo_op_t; + + +/** + * \brief Rig Scan operation + * + * Various scan operations supported by a rig.\n + * \c STRING used in rigctl + * + * \sa rig_parse_scan(), rig_strscan() + */ +typedef enum { + RIG_SCAN_NONE = 0, /*!< '' No-op value */ + RIG_SCAN_MEM = (1 << 0), /*!< \c MEM -- Scan all memory channels */ + RIG_SCAN_SLCT = (1 << 1), /*!< \c SLCT -- Scan all selected memory channels */ + RIG_SCAN_PRIO = (1 << 2), /*!< \c PRIO -- Priority watch (mem or call channel) */ + RIG_SCAN_PROG = (1 << 3), /*!< \c PROG -- Programmed(edge) scan */ + RIG_SCAN_DELTA = (1 << 4), /*!< \c DELTA -- delta-f scan */ + RIG_SCAN_VFO = (1 << 5), /*!< \c VFO -- most basic scan */ + RIG_SCAN_PLT = (1 << 6), /*!< \c PLT -- Scan using pipelined tuning */ + RIG_SCAN_STOP = (1 << 7) /*!< \c STOP -- Stop scanning */ +} scan_t; + + +/** + * \brief configuration token + */ +typedef long token_t; + + +//! @cond Doxygen_Suppress +#define RIG_CONF_END 0 +//! @endcond + + +/** + * \brief parameter types + * + * Used with configuration, parameter and extra-parm tables. + * + * Current internal implementation + * NUMERIC: val.f or val.i + * COMBO: val.i, starting from 0. Points to a table of strings or asci stored values. + * STRING: val.s or val.cs + * CHECKBUTTON: val.i 0/1 + * BINARY: val.b + */ + +/* strongly inspired from soundmodem. Thanks Thomas! */ +enum rig_conf_e { + RIG_CONF_STRING, /*!< String type */ + RIG_CONF_COMBO, /*!< Combo type */ + RIG_CONF_NUMERIC, /*!< Numeric type integer or real */ + RIG_CONF_CHECKBUTTON, /*!< on/off type */ + RIG_CONF_BUTTON, /*!< Button type */ + RIG_CONF_BINARY /*!< Binary buffer type */ +}; + +//! @cond Doxygen_Suppress +#define RIG_COMBO_MAX 16 +#define RIG_BIN_MAX 80 +//! @endcond + +/** + * \brief Configuration parameter structure. + */ +struct confparams { + token_t token; /*!< Conf param token ID */ + const char *name; /*!< Param name, no spaces allowed */ + const char *label; /*!< Human readable label */ + const char *tooltip; /*!< Hint on the parameter */ + const char *dflt; /*!< Default value */ + enum rig_conf_e type; /*!< Type of the parameter */ + union { /*!< */ + struct { /*!< */ + float min; /*!< Minimum value */ + float max; /*!< Maximum value */ + float step; /*!< Step */ + } n; /*!< Numeric type */ + struct { /*!< */ + const char *combostr[RIG_COMBO_MAX]; /*!< Combo list */ + } c; /*!< Combo type */ + } u; /*!< Type union */ +}; + + +/** + * \brief Announce + * + * Designate optional speech synthesizer. + */ +typedef enum { + RIG_ANN_NONE = 0, /*!< None */ + RIG_ANN_OFF = RIG_ANN_NONE, /*!< disable announces */ + RIG_ANN_FREQ = (1 << 0), /*!< Announce frequency */ + RIG_ANN_RXMODE = (1 << 1), /*!< Announce receive mode */ + RIG_ANN_CW = (1 << 2), /*!< CW */ + RIG_ANN_ENG = (1 << 3), /*!< English */ + RIG_ANN_JAP = (1 << 4) /*!< Japan */ +} ann_t; + + +/** + * \brief Antenna typedef + * \typedef ant_t + */ +/** + * \brief Antenna number + * \def RIG_ANT_NONE + * No antenna set yet or unknown + */ +/** + * \brief Antenna conversion macro + * \def RIG_ANT_N + * Convert antenna number to bit mask + */ +/** + * \brief Macro for Ant#1 + * \def RIG_ANT_1 + */ +/** + * \brief Macro for Ant#2 + * \def RIG_ANT_2 + */ +/** + * \brief Macro for Ant#3 + * \def RIG_ANT_3 + */ +/** + * \brief Macro for Ant#4 + * \def RIG_ANT_4 + */ +/** + * \brief Macro for Ant#5 + * \def RIG_ANT_5 + */ +/** + * \brief Antenna is on whatever "current" means + * \def RIG_ANT_CURR + */ +/** + * \brief Macro for unknown antenna + * \def RIG_ANT_UNKNOWN + */ +/** + * \brief Maximum antenna# + * \def RIG_ANT_MAX + */ +typedef unsigned int ant_t; + +#define RIG_ANT_NONE 0 +#define RIG_ANT_N(n) ((ant_t)1<<(n)) +#define RIG_ANT_1 RIG_ANT_N(0) +#define RIG_ANT_2 RIG_ANT_N(1) +#define RIG_ANT_3 RIG_ANT_N(2) +#define RIG_ANT_4 RIG_ANT_N(3) +#define RIG_ANT_5 RIG_ANT_N(4) + +#define RIG_ANT_UNKNOWN RIG_ANT_N(30) +#define RIG_ANT_CURR RIG_ANT_N(31) + +#define RIG_ANT_MAX 32 + + +/** + * \brief AGC delay settings + */ +/* TODO: kill me, and replace by real AGC delay */ +enum agc_level_e { + RIG_AGC_OFF = 0, + RIG_AGC_SUPERFAST, + RIG_AGC_FAST, + RIG_AGC_SLOW, + RIG_AGC_USER, /*!< user selectable */ + RIG_AGC_MEDIUM, + RIG_AGC_AUTO +}; + +//! @cond Doxygen_Suppress +#define RIG_AGC_LAST RIG_AGC_AUTO +//! @endcond + +/** + * \brief Level display meters + */ +enum meter_level_e { + RIG_METER_NONE = 0, /*< No display meter */ + RIG_METER_SWR = (1 << 0), /*< Stationary Wave Ratio */ + RIG_METER_COMP = (1 << 1), /*< Compression level */ + RIG_METER_ALC = (1 << 2), /*< ALC */ + RIG_METER_IC = (1 << 3), /*< IC */ + RIG_METER_DB = (1 << 4), /*< DB */ + RIG_METER_PO = (1 << 5), /*< Power Out */ + RIG_METER_VDD = (1 << 6), /*< Final Amp Voltage */ + RIG_METER_TEMP = (1 << 7) /*< Final Amp Voltage */ +}; + + +/** + * \brief Universal approach for passing values + * + * \sa rig_set_level(), rig_get_level(), rig_set_parm(), rig_get_parm() + */ +typedef union { + signed int i; /*!< Signed integer */ + float f; /*!< Single precision float */ + char *s; /*!< Pointer to char string */ + const char *cs; /*!< Pointer to constant char string */ +//! @cond Doxygen_Suppress + struct { + int l; /*!< Length of data */ + unsigned char *d; /* Pointer to data buffer */ + } b; +//! @endcond +} value_t; + + +/** + * \brief Rig Level Settings + * + * Various operating levels supported by a rig.\n + * \c STRING used in rigctl + * + * \sa rig_parse_level(), rig_strlevel() + */ +typedef uint64_t rig_level_e; +#define RIG_LEVEL_NONE 0 /*!< '' -- No Level */ +#define RIG_LEVEL_PREAMP CONSTANT_64BIT_FLAG(0) /*!< \c PREAMP -- Preamp, arg int (dB) */ +#define RIG_LEVEL_ATT CONSTANT_64BIT_FLAG(1) /*!< \c ATT -- Attenuator, arg int (dB) */ +#define RIG_LEVEL_VOXDELAY CONSTANT_64BIT_FLAG(2) /*!< \c VOXDELAY -- VOX delay, arg int (tenth of seconds) */ +#define RIG_LEVEL_AF CONSTANT_64BIT_FLAG(3) /*!< \c AF -- Volume, arg float [0.0 ... 1.0] */ +#define RIG_LEVEL_RF CONSTANT_64BIT_FLAG(4) /*!< \c RF -- RF gain (not TX power) arg float [0.0 ... 1.0] */ +#define RIG_LEVEL_SQL CONSTANT_64BIT_FLAG(5) /*!< \c SQL -- Squelch, arg float [0.0 ... 1.0] */ +#define RIG_LEVEL_IF CONSTANT_64BIT_FLAG(6) /*!< \c IF -- IF, arg int (Hz) */ +#define RIG_LEVEL_APF CONSTANT_64BIT_FLAG(7) /*!< \c APF -- Audio Peak Filter, arg float [0.0 ... 1.0] */ +#define RIG_LEVEL_NR CONSTANT_64BIT_FLAG(8) /*!< \c NR -- Noise Reduction, arg float [0.0 ... 1.0] */ +#define RIG_LEVEL_PBT_IN CONSTANT_64BIT_FLAG(9) /*!< \c PBT_IN -- Twin PBT (inside) arg float [0.0 ... 1.0] */ +#define RIG_LEVEL_PBT_OUT CONSTANT_64BIT_FLAG(10) /*!< \c PBT_OUT -- Twin PBT (outside) arg float [0.0 ... 1.0] */ +#define RIG_LEVEL_CWPITCH CONSTANT_64BIT_FLAG(11) /*!< \c CWPITCH -- CW pitch, arg int (Hz) */ +#define RIG_LEVEL_RFPOWER CONSTANT_64BIT_FLAG(12) /*!< \c RFPOWER -- RF Power, arg float [0.0 ... 1.0] */ +#define RIG_LEVEL_MICGAIN CONSTANT_64BIT_FLAG(13) /*!< \c MICGAIN -- MIC Gain, arg float [0.0 ... 1.0] */ +#define RIG_LEVEL_KEYSPD CONSTANT_64BIT_FLAG(14) /*!< \c KEYSPD -- Key Speed, arg int (WPM) */ +#define RIG_LEVEL_NOTCHF CONSTANT_64BIT_FLAG(15) /*!< \c NOTCHF -- Notch Freq., arg int (Hz) */ +#define RIG_LEVEL_COMP CONSTANT_64BIT_FLAG(16) /*!< \c COMP -- Compressor, arg float [0.0 ... 1.0] */ +#define RIG_LEVEL_AGC CONSTANT_64BIT_FLAG(17) /*!< \c AGC -- AGC, arg int (see enum agc_level_e) */ +#define RIG_LEVEL_BKINDL CONSTANT_64BIT_FLAG(18) /*!< \c BKINDL -- BKin Delay, arg int (tenth of dots) */ +#define RIG_LEVEL_BALANCE CONSTANT_64BIT_FLAG(19) /*!< \c BAL -- Balance (Dual Watch) arg float [0.0 ... 1.0] */ +#define RIG_LEVEL_METER CONSTANT_64BIT_FLAG(20) /*!< \c METER -- Display meter, arg int (see enum meter_level_e) */ +#define RIG_LEVEL_VOXGAIN CONSTANT_64BIT_FLAG(21) /*!< \c VOXGAIN -- VOX gain level, arg float [0.0 ... 1.0] */ +#define RIG_LEVEL_ANTIVOX CONSTANT_64BIT_FLAG(22) /*!< \c ANTIVOX -- anti-VOX level, arg float [0.0 ... 1.0] */ +#define RIG_LEVEL_SLOPE_LOW CONSTANT_64BIT_FLAG(23) /*!< \c SLOPE_LOW -- Slope tune, low frequency cut, arg int (Hz) */ +#define RIG_LEVEL_SLOPE_HIGH CONSTANT_64BIT_FLAG(24) /*!< \c SLOPE_HIGH -- Slope tune, high frequency cut, arg int (Hz) */ +#define RIG_LEVEL_BKIN_DLYMS CONSTANT_64BIT_FLAG(25) /*!< \c BKIN_DLYMS -- BKin Delay, arg int Milliseconds */ + + /*!< These are not settable */ +#define RIG_LEVEL_RAWSTR CONSTANT_64BIT_FLAG(26) /*!< \c RAWSTR -- Raw (A/D) value for signal strength, specific to each rig, arg int */ +//#define RIG_LEVEL_SQLSTAT CONSTANT_64BIT_FLAG(27) /*!< \c SQLSTAT -- SQL status, arg int (open=1/closed=0). Deprecated, use get_dcd instead */ +#define RIG_LEVEL_SWR CONSTANT_64BIT_FLAG(28) /*!< \c SWR -- SWR, arg float [0.0 ... infinite] */ +#define RIG_LEVEL_ALC CONSTANT_64BIT_FLAG(29) /*!< \c ALC -- ALC, arg float */ +#define RIG_LEVEL_STRENGTH CONSTANT_64BIT_FLAG(30) /*!< \c STRENGTH -- Effective (calibrated) signal strength relative to S9, arg int (dB) */ + /* RIG_LEVEL_BWC (1<<31) */ /*!< Bandwidth Control, arg int (Hz) */ +#define RIG_LEVEL_RFPOWER_METER CONSTANT_64BIT_FLAG(32) /*!< \c RFPOWER_METER -- RF power output meter, arg float [0.0 ... 1.0] (percentage of maximum power) */ +#define RIG_LEVEL_COMP_METER CONSTANT_64BIT_FLAG(33) /*!< \c COMP_METER -- Audio output level compression meter, arg float (dB) */ +#define RIG_LEVEL_VD_METER CONSTANT_64BIT_FLAG(34) /*!< \c VD_METER -- Input voltage level meter, arg float (V, volts) */ +#define RIG_LEVEL_ID_METER CONSTANT_64BIT_FLAG(35) /*!< \c ID_METER -- Current draw meter, arg float (A, amperes) */ + +#define RIG_LEVEL_NOTCHF_RAW CONSTANT_64BIT_FLAG(36) /*!< \c NOTCHF_RAW -- Notch Freq., arg float [0.0 ... 1.0] */ +#define RIG_LEVEL_MONITOR_GAIN CONSTANT_64BIT_FLAG(37) /*!< \c MONITOR_GAIN -- Monitor gain (level for monitoring of transmitted audio) arg float [0.0 ... 1.0] */ +#define RIG_LEVEL_NB CONSTANT_64BIT_FLAG(38) /*!< \c NB -- Noise Blanker level, arg float [0.0 ... 1.0] */ +#define RIG_LEVEL_RFPOWER_METER_WATTS CONSTANT_64BIT_FLAG(39) /*!< \c RFPOWER_METER_WATTS -- RF power output meter, arg float [0.0 ... MAX] (output power in watts) */ +#define RIG_LEVEL_SPECTRUM_MODE CONSTANT_64BIT_FLAG(40) /*!< \c SPECTRUM_MODE -- Spectrum scope mode, arg int (see enum rig_spectrum_mode_e). Supported modes defined in rig caps. */ +#define RIG_LEVEL_SPECTRUM_SPAN CONSTANT_64BIT_FLAG(41) /*!< \c SPECTRUM_SPAN -- Spectrum scope span in center mode, arg int (Hz). Supported spans defined in rig caps. */ +#define RIG_LEVEL_SPECTRUM_EDGE_LOW CONSTANT_64BIT_FLAG(42) /*!< \c SPECTRUM_EDGE_LOW -- Spectrum scope low edge in fixed mode, arg int (Hz) */ +#define RIG_LEVEL_SPECTRUM_EDGE_HIGH CONSTANT_64BIT_FLAG(43) /*!< \c SPECTRUM_EDGE_HIGH -- Spectrum scope high edge in fixed mode, arg int (Hz) */ +#define RIG_LEVEL_SPECTRUM_SPEED CONSTANT_64BIT_FLAG(44) /*!< \c SPECTRUM_SPEED -- Spectrum scope update speed, arg int (highest is fastest, define rig-specific granularity) */ +#define RIG_LEVEL_SPECTRUM_REF CONSTANT_64BIT_FLAG(45) /*!< \c SPECTRUM_REF -- Spectrum scope reference display level, arg float (dB, define rig-specific granularity) */ +#define RIG_LEVEL_SPECTRUM_AVG CONSTANT_64BIT_FLAG(46) /*!< \c SPECTRUM_AVG -- Spectrum scope averaging mode, arg int (see struct rig_spectrum_avg_mode). Supported averaging modes defined in rig caps. */ +#define RIG_LEVEL_SPECTRUM_ATT CONSTANT_64BIT_FLAG(47) /*!< \c SPECTRUM_ATT -- Spectrum scope attenuator, arg int (dB). Supported attenuator values defined in rig caps. */ +#define RIG_LEVEL_TEMP_METER CONSTANT_64BIT_FLAG(48) /*!< \c TEMP_METER -- arg int (C, centigrade) */ +#define RIG_LEVEL_48 CONSTANT_64BIT_FLAG(48) /*!< \c Future use */ +#define RIG_LEVEL_49 CONSTANT_64BIT_FLAG(49) /*!< \c Future use */ +#define RIG_LEVEL_50 CONSTANT_64BIT_FLAG(50) /*!< \c Future use */ +#define RIG_LEVEL_51 CONSTANT_64BIT_FLAG(51) /*!< \c Future use */ +#define RIG_LEVEL_52 CONSTANT_64BIT_FLAG(52) /*!< \c Future use */ +#define RIG_LEVEL_53 CONSTANT_64BIT_FLAG(53) /*!< \c Future use */ +#define RIG_LEVEL_54 CONSTANT_64BIT_FLAG(54) /*!< \c Future use */ +#define RIG_LEVEL_55 CONSTANT_64BIT_FLAG(55) /*!< \c Future use */ +#define RIG_LEVEL_56 CONSTANT_64BIT_FLAG(56) /*!< \c Future use */ +#define RIG_LEVEL_57 CONSTANT_64BIT_FLAG(57) /*!< \c Future use */ +#define RIG_LEVEL_58 CONSTANT_64BIT_FLAG(58) /*!< \c Future use */ +#define RIG_LEVEL_59 CONSTANT_64BIT_FLAG(59) /*!< \c Future use */ +#define RIG_LEVEL_60 CONSTANT_64BIT_FLAG(60) /*!< \c Future use */ +#define RIG_LEVEL_61 CONSTANT_64BIT_FLAG(61) /*!< \c Future use */ +#define RIG_LEVEL_62 CONSTANT_64BIT_FLAG(62) /*!< \c Future use */ +#define RIG_LEVEL_63 CONSTANT_64BIT_FLAG(63) /*!< \c Future use */ + +//! @cond Doxygen_Suppress +#define RIG_LEVEL_FLOAT_LIST (RIG_LEVEL_AF|RIG_LEVEL_RF|RIG_LEVEL_SQL|RIG_LEVEL_APF|RIG_LEVEL_NR|RIG_LEVEL_PBT_IN|RIG_LEVEL_PBT_OUT|RIG_LEVEL_RFPOWER|RIG_LEVEL_MICGAIN|RIG_LEVEL_COMP|RIG_LEVEL_BALANCE|RIG_LEVEL_SWR|RIG_LEVEL_ALC|RIG_LEVEL_VOXGAIN|RIG_LEVEL_ANTIVOX|RIG_LEVEL_RFPOWER_METER|RIG_LEVEL_RFPOWER_METER_WATTS|RIG_LEVEL_COMP_METER|RIG_LEVEL_VD_METER|RIG_LEVEL_ID_METER|RIG_LEVEL_NOTCHF_RAW|RIG_LEVEL_MONITOR_GAIN|RIG_LEVEL_NB|RIG_LEVEL_SPECTRUM_REF) + +#define RIG_LEVEL_READONLY_LIST (RIG_LEVEL_SWR|RIG_LEVEL_ALC|RIG_LEVEL_STRENGTH|RIG_LEVEL_RAWSTR|RIG_LEVEL_RFPOWER_METER|RIG_LEVEL_COMP_METER|RIG_LEVEL_VD_METER|RIG_LEVEL_ID_METER) + +#define RIG_LEVEL_IS_FLOAT(l) ((l)&RIG_LEVEL_FLOAT_LIST) +#define RIG_LEVEL_SET(l) ((l)&~RIG_LEVEL_READONLY_LIST) +//! @endcond + + +/** + * \brief Rig Parameters + * + * Parameters are settings that are not VFO specific.\n + * \c STRING used in rigctl + * + * \sa rig_parse_parm(), rig_strparm() + */ +enum rig_parm_e { + RIG_PARM_NONE = 0, /*!< '' -- No Parm */ + RIG_PARM_ANN = (1 << 0), /*!< \c ANN -- "Announce" level, see ann_t */ + RIG_PARM_APO = (1 << 1), /*!< \c APO -- Auto power off, int in minute */ + RIG_PARM_BACKLIGHT = (1 << 2), /*!< \c BACKLIGHT -- LCD light, float [0.0 ... 1.0] */ + RIG_PARM_BEEP = (1 << 4), /*!< \c BEEP -- Beep on keypressed, int (0,1) */ + RIG_PARM_TIME = (1 << 5), /*!< \c TIME -- hh:mm:ss, int in seconds from 00:00:00 */ + RIG_PARM_BAT = (1 << 6), /*!< \c BAT -- battery level, float [0.0 ... 1.0] */ + RIG_PARM_KEYLIGHT = (1 << 7), /*!< \c KEYLIGHT -- Button backlight, on/off */ + RIG_PARM_SCREENSAVER = (1 << 8) /*!< \c SCREENSAVER -- rig specific timeouts */ +}; + +/** + * \brief Rig Cookie enumerations + * + * Cookies are used for a client to request exclusive control of the rig until the client releases the cookie + * Cookies will expire after 1 second unless renewed + * Normal flow would be cookie=rig_cookie(NULL, RIG_COOKIE_GET), rig op, rig_cookie(cookie, RIG_COOKIE_RENEW), rig op, etc.... + * + */ +enum cookie_e { + RIG_COOKIE_GET, /*!< Setup a cookie */ + RIG_COOKIE_RELEASE, /*!< Release a cookie */ + RIG_COOKIE_RENEW, /*!< Renew a cookie */ +}; + +/** + * \brief Multicast data items + * 3 different data item can be included in the multicast JSON + */ +enum multicast_item_e { + RIG_MULTICAST_POLL, // hamlib will be polling the rig for all rig items + RIG_MULTICAST_TRANSCEIVE, // transceive will be turned on and processed + RIG_MULTICAST_SPECTRUM // spectrum data will be included +}; + +//! @cond Doxygen_Suppress +#define RIG_PARM_FLOAT_LIST (RIG_PARM_BACKLIGHT|RIG_PARM_BAT|RIG_PARM_KEYLIGHT) +#define RIG_PARM_READONLY_LIST (RIG_PARM_BAT) + +#define RIG_PARM_IS_FLOAT(l) ((l)&RIG_PARM_FLOAT_LIST) +#define RIG_PARM_SET(l) ((l)&~RIG_PARM_READONLY_LIST) +//! @endcond + +/** + * \brief Setting + * + * This can be a func, a level or a parm. + * Each bit designates one of them. + */ +typedef uint64_t setting_t; + +/** + * \brief Maximum # of rig settings + * + */ +#define RIG_SETTING_MAX 64 + +/** + * \brief Transceive mode + * The rig notifies the host of any event, like freq changed, mode changed, etc. + * \def RIG_TRN_OFF + * Turn it off + * \brief Transceive mode + * \def RIG_TRN_RIG + * RIG_TRN_RIG means the rig acts asynchronously + * \brief Transceive mode + * \def RIG_TRN_POLL + * RIG_TRN_POLL means we have to poll the rig + * + */ +#define RIG_TRN_OFF 0 +#define RIG_TRN_RIG 1 +#define RIG_TRN_POLL 2 + + +/** + * \brief Rig Function Settings + * + * Various operating functions supported by a rig.\n + * \c STRING used in rigctl/rigctld + * + * \sa rig_parse_func(), rig_strfunc() + */ +/* + * The C standard dictates that an enum constant is a 32 bit signed integer. + * Setting a constant's bit 31 created a negative value that on amd64 had the + * upper 32 bits set as well when assigned to the misc.c:rig_func_str structure. + * This caused misc.c:rig_strfunc() to fail its comparison for RIG_FUNC_XIT + * on amd64 (x86_64). To use bit 31 as an unsigned long, preprocessor macros + * have been used instead as a 'const unsigned long' which cannot be used to + * initialize the rig_func_str.func members. TNX KA6MAL, AC6SL. - N0NB + */ +#define RIG_FUNC_NONE 0 /*!< '' -- No Function */ +#define RIG_FUNC_FAGC CONSTANT_64BIT_FLAG (0) /*!< \c FAGC -- Fast AGC */ +#define RIG_FUNC_NB CONSTANT_64BIT_FLAG (1) /*!< \c NB -- Noise Blanker */ +#define RIG_FUNC_COMP CONSTANT_64BIT_FLAG (2) /*!< \c COMP -- Speech Compression */ +#define RIG_FUNC_VOX CONSTANT_64BIT_FLAG (3) /*!< \c VOX -- Voice Operated Relay */ +#define RIG_FUNC_TONE CONSTANT_64BIT_FLAG (4) /*!< \c TONE -- CTCSS Tone TX */ +#define RIG_FUNC_TSQL CONSTANT_64BIT_FLAG (5) /*!< \c TSQL -- CTCSS Activate/De-activate RX */ +#define RIG_FUNC_SBKIN CONSTANT_64BIT_FLAG (6) /*!< \c SBKIN -- Semi Break-in (CW mode) */ +#define RIG_FUNC_FBKIN CONSTANT_64BIT_FLAG (7) /*!< \c FBKIN -- Full Break-in (CW mode) */ +#define RIG_FUNC_ANF CONSTANT_64BIT_FLAG (8) /*!< \c ANF -- Automatic Notch Filter (DSP) */ +#define RIG_FUNC_NR CONSTANT_64BIT_FLAG (9) /*!< \c NR -- Noise Reduction (DSP) */ +#define RIG_FUNC_AIP CONSTANT_64BIT_FLAG (10) /*!< \c AIP -- RF pre-amp (AIP on Kenwood, IPO on Yaesu, etc.) */ +#define RIG_FUNC_APF CONSTANT_64BIT_FLAG (11) /*!< \c APF -- Audio Peak Filter */ +#define RIG_FUNC_MON CONSTANT_64BIT_FLAG (12) /*!< \c MON -- Monitor transmitted signal */ +#define RIG_FUNC_MN CONSTANT_64BIT_FLAG (13) /*!< \c MN -- Manual Notch */ +#define RIG_FUNC_RF CONSTANT_64BIT_FLAG (14) /*!< \c RF -- RTTY Filter */ +#define RIG_FUNC_ARO CONSTANT_64BIT_FLAG (15) /*!< \c ARO -- Auto Repeater Offset */ +#define RIG_FUNC_LOCK CONSTANT_64BIT_FLAG (16) /*!< \c LOCK -- Lock */ +#define RIG_FUNC_MUTE CONSTANT_64BIT_FLAG (17) /*!< \c MUTE -- Mute */ +#define RIG_FUNC_VSC CONSTANT_64BIT_FLAG (18) /*!< \c VSC -- Voice Scan Control */ +#define RIG_FUNC_REV CONSTANT_64BIT_FLAG (19) /*!< \c REV -- Reverse transmit and receive frequencies */ +#define RIG_FUNC_SQL CONSTANT_64BIT_FLAG (20) /*!< \c SQL -- Turn Squelch Monitor on/off */ +#define RIG_FUNC_ABM CONSTANT_64BIT_FLAG (21) /*!< \c ABM -- Auto Band Mode */ +#define RIG_FUNC_BC CONSTANT_64BIT_FLAG (22) /*!< \c BC -- Beat Canceller */ +#define RIG_FUNC_MBC CONSTANT_64BIT_FLAG (23) /*!< \c MBC -- Manual Beat Canceller */ +#define RIG_FUNC_RIT CONSTANT_64BIT_FLAG (24) /*!< \c RIT -- Receiver Incremental Tuning */ +#define RIG_FUNC_AFC CONSTANT_64BIT_FLAG (25) /*!< \c AFC -- Auto Frequency Control ON/OFF */ +#define RIG_FUNC_SATMODE CONSTANT_64BIT_FLAG (26) /*!< \c SATMODE -- Satellite mode ON/OFF */ +#define RIG_FUNC_SCOPE CONSTANT_64BIT_FLAG (27) /*!< \c SCOPE -- Simple bandscope ON/OFF */ +#define RIG_FUNC_RESUME CONSTANT_64BIT_FLAG (28) /*!< \c RESUME -- Scan auto-resume */ +#define RIG_FUNC_TBURST CONSTANT_64BIT_FLAG (29) /*!< \c TBURST -- 1750 Hz tone burst */ +#define RIG_FUNC_TUNER CONSTANT_64BIT_FLAG (30) /*!< \c TUNER -- Enable automatic tuner */ +#define RIG_FUNC_XIT CONSTANT_64BIT_FLAG (31) /*!< \c XIT -- Transmitter Incremental Tuning */ +#ifndef SWIGLUAHIDE +/* Hide the top 32 bits from the old Lua binding as they can't be represented */ +#define RIG_FUNC_NB2 CONSTANT_64BIT_FLAG (32) /*!< \c NB2 -- 2nd Noise Blanker */ +#define RIG_FUNC_CSQL CONSTANT_64BIT_FLAG (33) /*!< \c CSQL -- DCS Squelch setting */ +#define RIG_FUNC_AFLT CONSTANT_64BIT_FLAG (34) /*!< \c AFLT -- AF Filter setting */ +#define RIG_FUNC_ANL CONSTANT_64BIT_FLAG (35) /*!< \c ANL -- Noise limiter setting */ +#define RIG_FUNC_BC2 CONSTANT_64BIT_FLAG (36) /*!< \c BC2 -- 2nd Beat Cancel */ +#define RIG_FUNC_DUAL_WATCH CONSTANT_64BIT_FLAG (37) /*!< \c DUAL_WATCH -- Dual Watch / Sub Receiver */ +#define RIG_FUNC_DIVERSITY CONSTANT_64BIT_FLAG (38) /*!< \c DIVERSITY -- Diversity receive */ +#define RIG_FUNC_DSQL CONSTANT_64BIT_FLAG (39) /*!< \c DSQL -- Digital modes squelch */ +#define RIG_FUNC_SCEN CONSTANT_64BIT_FLAG (40) /*!< \c SCEN -- scrambler/encryption */ +#define RIG_FUNC_SLICE CONSTANT_64BIT_FLAG (41) /*!< \c Rig slice selection -- Flex */ +#define RIG_FUNC_TRANSCEIVE CONSTANT_64BIT_FLAG (42) /*!< \c TRANSCEIVE -- Send radio state changes automatically ON/OFF */ +#define RIG_FUNC_SPECTRUM CONSTANT_64BIT_FLAG (43) /*!< \c SPECTRUM -- Spectrum scope data output ON/OFF */ +#define RIG_FUNC_SPECTRUM_HOLD CONSTANT_64BIT_FLAG (44) /*!< \c SPECTRUM_HOLD -- Pause spectrum scope updates ON/OFF */ +#define RIG_FUNC_BIT45 CONSTANT_64BIT_FLAG (45) /*!< \c available for future RIG_FUNC items */ +#define RIG_FUNC_BIT46 CONSTANT_64BIT_FLAG (46) /*!< \c available for future RIG_FUNC items */ +#define RIG_FUNC_BIT47 CONSTANT_64BIT_FLAG (47) /*!< \c available for future RIG_FUNC items */ +#define RIG_FUNC_BIT48 CONSTANT_64BIT_FLAG (48) /*!< \c available for future RIG_FUNC items */ +#define RIG_FUNC_BIT49 CONSTANT_64BIT_FLAG (49) /*!< \c available for future RIG_FUNC items */ +#define RIG_FUNC_BIT50 CONSTANT_64BIT_FLAG (50) /*!< \c available for future RIG_FUNC items */ +#define RIG_FUNC_BIT51 CONSTANT_64BIT_FLAG (51) /*!< \c available for future RIG_FUNC items */ +#define RIG_FUNC_BIT52 CONSTANT_64BIT_FLAG (52) /*!< \c available for future RIG_FUNC items */ +#define RIG_FUNC_BIT53 CONSTANT_64BIT_FLAG (53) /*!< \c available for future RIG_FUNC items */ +#define RIG_FUNC_BIT54 CONSTANT_64BIT_FLAG (54) /*!< \c available for future RIG_FUNC items */ +#define RIG_FUNC_BIT55 CONSTANT_64BIT_FLAG (55) /*!< \c available for future RIG_FUNC items */ +#define RIG_FUNC_BIT56 CONSTANT_64BIT_FLAG (56) /*!< \c available for future RIG_FUNC items */ +#define RIG_FUNC_BIT57 CONSTANT_64BIT_FLAG (57) /*!< \c available for future RIG_FUNC items */ +#define RIG_FUNC_BIT58 CONSTANT_64BIT_FLAG (58) /*!< \c available for future RIG_FUNC items */ +#define RIG_FUNC_BIT59 CONSTANT_64BIT_FLAG (59) /*!< \c available for future RIG_FUNC items */ +#define RIG_FUNC_BIT60 CONSTANT_64BIT_FLAG (60) /*!< \c available for future RIG_FUNC items */ +#define RIG_FUNC_BIT61 CONSTANT_64BIT_FLAG (61) /*!< \c available for future RIG_FUNC items */ +#define RIG_FUNC_BIT62 CONSTANT_64BIT_FLAG (62) /*!< \c available for future RIG_FUNC items */ +#define RIG_FUNC_BIT63 CONSTANT_64BIT_FLAG (63) /*!< \c available for future RIG_FUNC items */ +/* 63 is this highest bit number that can be used */ +#endif + +/** + * \brief power unit macros + * \def mW + * Converts a power level integer to milliwatts. This is limited to 2 + * megawatts on 32 bit systems. + */ +#define mW(p) ((int)(p)) +/** + * \brief power unit macros + * \def Watts + * + * Converts a power level integer to watts. This is limited to 2 + * gigawatts on 32 bit systems. + */ +#define Watts(p) ((int)((p)*1000)) +/** + * \brief power unit macros + * \def W + * + * Same as Watts for the person who is too lazy to type Watts :-) + */ +#define W(p) Watts(p) +#if 0 // deprecating kW macro as this doesn't make sense +/** + * \brief power unit macros + * \def kW + * + * Same as Watts for the person who is too lazy to type Watts :-) + */ +#define kW(p) ((int)((p)*1000000L)) +#endif + + +/** + * \brief Radio mode + * + * Various modes supported by a rig.\n + * \c STRING used in rigctl + * + * \sa rig_parse_mode(), rig_strrmode() + * TODO: Add new 8600 modes to rig2icom_mode() and icom2rig_mode() in frame.c + */ +typedef uint64_t rmode_t; + +#define RIG_MODE_NONE 0 /*!< '' -- None */ +#define RIG_MODE_AM CONSTANT_64BIT_FLAG (0) /*!< \c AM -- Amplitude Modulation */ +#define RIG_MODE_CW CONSTANT_64BIT_FLAG (1) /*!< \c CW -- CW "normal" sideband */ +#define RIG_MODE_USB CONSTANT_64BIT_FLAG (2) /*!< \c USB -- Upper Side Band */ +#define RIG_MODE_LSB CONSTANT_64BIT_FLAG (3) /*!< \c LSB -- Lower Side Band */ +#define RIG_MODE_RTTY CONSTANT_64BIT_FLAG (4) /*!< \c RTTY -- Radio Teletype */ +#define RIG_MODE_FM CONSTANT_64BIT_FLAG (5) /*!< \c FM -- "narrow" band FM */ +#define RIG_MODE_WFM CONSTANT_64BIT_FLAG (6) /*!< \c WFM -- broadcast wide FM */ +#define RIG_MODE_CWR CONSTANT_64BIT_FLAG (7) /*!< \c CWR -- CW "reverse" sideband */ +#define RIG_MODE_RTTYR CONSTANT_64BIT_FLAG (8) /*!< \c RTTYR -- RTTY "reverse" sideband */ +#define RIG_MODE_AMS CONSTANT_64BIT_FLAG (9) /*!< \c AMS -- Amplitude Modulation Synchronous */ +#define RIG_MODE_PKTLSB CONSTANT_64BIT_FLAG (10) /*!< \c PKTLSB -- Packet/Digital LSB mode (dedicated port) */ +#define RIG_MODE_PKTUSB CONSTANT_64BIT_FLAG (11) /*!< \c PKTUSB -- Packet/Digital USB mode (dedicated port) */ +#define RIG_MODE_PKTFM CONSTANT_64BIT_FLAG (12) /*!< \c PKTFM -- Packet/Digital FM mode (dedicated port) */ +#define RIG_MODE_ECSSUSB CONSTANT_64BIT_FLAG (13) /*!< \c ECSSUSB -- Exalted Carrier Single Sideband USB */ +#define RIG_MODE_ECSSLSB CONSTANT_64BIT_FLAG (14) /*!< \c ECSSLSB -- Exalted Carrier Single Sideband LSB */ +#define RIG_MODE_FAX CONSTANT_64BIT_FLAG (15) /*!< \c FAX -- Facsimile Mode */ +#define RIG_MODE_SAM CONSTANT_64BIT_FLAG (16) /*!< \c SAM -- Synchronous AM double sideband */ +#define RIG_MODE_SAL CONSTANT_64BIT_FLAG (17) /*!< \c SAL -- Synchronous AM lower sideband */ +#define RIG_MODE_SAH CONSTANT_64BIT_FLAG (18) /*!< \c SAH -- Synchronous AM upper (higher) sideband */ +#define RIG_MODE_DSB CONSTANT_64BIT_FLAG (19) /*!< \c DSB -- Double sideband suppressed carrier */ +#define RIG_MODE_FMN CONSTANT_64BIT_FLAG (21) /*!< \c FMN -- FM Narrow Kenwood ts990s */ +#define RIG_MODE_PKTAM CONSTANT_64BIT_FLAG (22) /*!< \c PKTAM -- Packet/Digital AM mode e.g. IC7300 */ +#define RIG_MODE_P25 CONSTANT_64BIT_FLAG (23) /*!< \c P25 -- APCO/P25 VHF,UHF digital mode IC-R8600 */ +#define RIG_MODE_DSTAR CONSTANT_64BIT_FLAG (24) /*!< \c D-Star -- VHF,UHF digital mode IC-R8600 */ +#define RIG_MODE_DPMR CONSTANT_64BIT_FLAG (25) /*!< \c dPMR -- digital PMR, VHF,UHF digital mode IC-R8600 */ +#define RIG_MODE_NXDNVN CONSTANT_64BIT_FLAG (26) /*!< \c NXDN-VN -- VHF,UHF digital mode IC-R8600 */ +#define RIG_MODE_NXDN_N CONSTANT_64BIT_FLAG (27) /*!< \c NXDN-N -- VHF,UHF digital mode IC-R8600 */ +#define RIG_MODE_DCR CONSTANT_64BIT_FLAG (28) /*!< \c DCR -- VHF,UHF digital mode IC-R8600 */ +#define RIG_MODE_AMN CONSTANT_64BIT_FLAG (29) /*!< \c AM-N -- Narrow band AM mode IC-R30 */ +#define RIG_MODE_PSK CONSTANT_64BIT_FLAG (30) /*!< \c PSK - Kenwood PSK and others */ +#define RIG_MODE_PSKR CONSTANT_64BIT_FLAG (31) /*!< \c PSKR - Kenwood PSKR and others */ +#ifndef SWIGLUAHIDE +/* hide the top 32 bits from the Lua binding as they will not work */ +#define RIG_MODE_DD CONSTANT_64BIT_FLAG (32) /*!< \c DD Mode IC-9700 */ +#define RIG_MODE_C4FM CONSTANT_64BIT_FLAG (33) /*!< \c Yaesu C4FM mode */ +#define RIG_MODE_PKTFMN CONSTANT_64BIT_FLAG (34) /*!< \c Yaesu DATA-FM-N */ +#define RIG_MODE_SPEC CONSTANT_64BIT_FLAG (35) /*!< \c Unfiltered as in PowerSDR */ +#define RIG_MODE_CWN CONSTANT_64BIT_FLAG (36) /*!< \c CWN -- Narrow band CW (FT-736R) */ +#define RIG_MODE_IQ CONSTANT_64BIT_FLAG (37) /*!< \c IQ mode for a couple of kit rigs */ +#define RIG_MODE_BIT38 CONSTANT_64BIT_FLAG (38) /*!< \c reserved for future expansion */ +#define RIG_MODE_BIT39 CONSTANT_64BIT_FLAG (39) /*!< \c reserved for future expansion */ +#define RIG_MODE_BIT40 CONSTANT_64BIT_FLAG (40) /*!< \c reserved for future expansion */ +#define RIG_MODE_BIT41 CONSTANT_64BIT_FLAG (41) /*!< \c reserved for future expansion */ +#define RIG_MODE_BIT42 CONSTANT_64BIT_FLAG (42) /*!< \c reserved for future expansion */ +#define RIG_MODE_BIT43 CONSTANT_64BIT_FLAG (43) /*!< \c reserved for future expansion */ +#define RIG_MODE_BIT44 CONSTANT_64BIT_FLAG (44) /*!< \c reserved for future expansion */ +#define RIG_MODE_BIT45 CONSTANT_64BIT_FLAG (45) /*!< \c reserved for future expansion */ +#define RIG_MODE_BIT46 CONSTANT_64BIT_FLAG (46) /*!< \c reserved for future expansion */ +#define RIG_MODE_BIT47 CONSTANT_64BIT_FLAG (47) /*!< \c reserved for future expansion */ +#define RIG_MODE_BIT48 CONSTANT_64BIT_FLAG (48) /*!< \c reserved for future expansion */ +#define RIG_MODE_BIT49 CONSTANT_64BIT_FLAG (49) /*!< \c reserved for future expansion */ +#define RIG_MODE_BIT50 CONSTANT_64BIT_FLAG (50) /*!< \c reserved for future expansion */ +#define RIG_MODE_BIT51 CONSTANT_64BIT_FLAG (51) /*!< \c reserved for future expansion */ +#define RIG_MODE_BIT52 CONSTANT_64BIT_FLAG (52) /*!< \c reserved for future expansion */ +#define RIG_MODE_BIT53 CONSTANT_64BIT_FLAG (53) /*!< \c reserved for future expansion */ +#define RIG_MODE_BIT54 CONSTANT_64BIT_FLAG (54) /*!< \c reserved for future expansion */ +#define RIG_MODE_BIT55 CONSTANT_64BIT_FLAG (55) /*!< \c reserved for future expansion */ +#define RIG_MODE_BIT56 CONSTANT_64BIT_FLAG (56) /*!< \c reserved for future expansion */ +#define RIG_MODE_BIT57 CONSTANT_64BIT_FLAG (57) /*!< \c reserved for future expansion */ +#define RIG_MODE_BIT58 CONSTANT_64BIT_FLAG (58) /*!< \c reserved for future expansion */ +#define RIG_MODE_BIT59 CONSTANT_64BIT_FLAG (59) /*!< \c reserved for future expansion */ +#define RIG_MODE_BIT60 CONSTANT_64BIT_FLAG (60) /*!< \c reserved for future expansion */ +#define RIG_MODE_BIT61 CONSTANT_64BIT_FLAG (61) /*!< \c reserved for future expansion */ +#define RIG_MODE_BIT62 CONSTANT_64BIT_FLAG (62) /*!< \c reserved for future expansion */ +#define RIG_MODE_TESTS_MAX CONSTANT_64BIT_FLAG (63) /*!< \c last bit available for 64-bit enum MUST ALWAYS BE LAST, Max Count for dumpcaps.c */ +#endif + +/** + * \brief macro for backends, not to be used by rig_set_mode et al. + */ +#define RIG_MODE_SSB (RIG_MODE_USB|RIG_MODE_LSB) + +/** + * \brief macro for backends, not to be used by rig_set_mode et al. + */ +#define RIG_MODE_ECSS (RIG_MODE_ECSSUSB|RIG_MODE_ECSSLSB) + +//! @cond Doxygen_Suppress +#define RIG_DBLST_END 0 /* end marker in a preamp/att level list */ +#define RIG_IS_DBLST_END(d) ((d)==0) +//! @endcond + + +/** + * \brief Frequency range + * + * Put together a group of this struct in an array to define + * what frequencies your rig has access to. + */ +typedef struct freq_range_list { + freq_t startf; /*!< Start frequency */ + freq_t endf; /*!< End frequency */ + rmode_t modes; /*!< Bit field of RIG_MODE's */ + int low_power; /*!< Lower RF power in mW, -1 for no power (ie. rx list) */ + int high_power; /*!< Higher RF power in mW, -1 for no power (ie. rx list) */ + vfo_t vfo; /*!< VFO list equipped with this range */ + ant_t ant; /*!< Antenna list equipped with this range, 0 means all, RIG_ANT_CURR means dedicated to certain bands and automatically switches, no set_ant command */ + char *label; /*!< Label for this range that explains why. e.g. Icom rigs USA, EUR, ITR, TPE, KOR */ +} freq_range_t; + +//! @cond Doxygen_Suppress +#define RIG_FRNG_END {Hz(0),Hz(0),RIG_MODE_NONE,0,0,RIG_VFO_NONE} +#define RIG_IS_FRNG_END(r) ((r).startf == Hz(0) && (r).endf == Hz(0)) +//! @endcond + +/** + * \brief Tuning step definition + * + * Lists the tuning steps available for each mode. + * + * If a ts field in the list has RIG_TS_ANY value, this means the rig allows + * its tuning step to be set to any value ranging from the lowest to the + * highest (if any) value in the list for that mode. The tuning step must be + * sorted in the ascending order, and the RIG_TS_ANY value, if present, must + * be the last one in the list. + * + * Note also that the minimum frequency resolution of the rig is determined by + * the lowest value in the Tuning step list. + * + * \sa rig_set_ts(), rig_get_resolution() + */ +struct tuning_step_list { + rmode_t modes; /*!< Bit field of RIG_MODE's */ + shortfreq_t ts; /*!< Tuning step in Hz */ +}; + +//! @cond Doxygen_Suppress +#define RIG_TS_ANY 0 +#define RIG_TS_END {RIG_MODE_NONE, 0} +#define RIG_IS_TS_END(t) ((t).modes == RIG_MODE_NONE && (t).ts == 0) +//! @endcond + + +/** + * \brief Filter definition + * + * Lists the filters available for each mode. + * + * If more than one filter is available for a given mode, the first entry in + * the array will be the default filter to use for the normal passband of this + * mode. The first entry in the array below the default normal passband is + * the default narrow passband and the first entry in the array above the + * default normal passband is the default wide passband. Note: if there's no + * lower width or upper width, then narrow or respectively wide passband is + * equal to the default normal passband. + * + * If a width field in the list has RIG_FLT_ANY value, this means the rig + * allows its passband width to be set to any value ranging from the lowest to + * the highest value (if any) in the list for that mode. The RIG_FLT_ANY + * value, if present, must be the last one in the list. + * + * The width field is the narrowest passband in a transmit/receive chain with + * regard to different IF. + * + * \sa rig_set_mode(), rig_passband_normal(), rig_passband_narrow(), rig_passband_wide() + */ +struct filter_list { + rmode_t modes; /*!< Bit field of RIG_MODE's */ + pbwidth_t width; /*!< Passband width in Hz */ +}; +//! @cond Doxygen_Suppress +#define RIG_FLT_ANY 0 +#define RIG_FLT_END {RIG_MODE_NONE, 0} +#define RIG_IS_FLT_END(f) ((f).modes == RIG_MODE_NONE) +//! @endcond + + +/** + * \brief Empty channel_t.flags field + */ +#define RIG_CHFLAG_NONE 0 +/** + * \brief skip memory channel during scan (lock out), channel_t.flags + */ +#define RIG_CHFLAG_SKIP (1<<0) +/** + * \brief DATA port mode flag + */ +#define RIG_CHFLAG_DATA (1<<1) +/** + * \brief programmed skip (PSKIP) memory channel during scan (lock out), channel_t.flags + */ +#define RIG_CHFLAG_PSKIP (1<<2) + +/** + * \brief Extension attribute definition + * + */ +struct ext_list { + token_t token; /*!< Token ID */ + value_t val; /*!< Value */ +}; + +//! @cond Doxygen_Suppress +#define RIG_EXT_END {0, {.i=0}} +#define RIG_IS_EXT_END(x) ((x).token == 0) +//! @endcond + +/** + * \brief Channel structure + * + * The channel struct stores all the attributes peculiar to a VFO. + * + * \sa rig_set_channel(), rig_get_channel() + */ +struct channel { + int channel_num; /*!< Channel number */ + int bank_num; /*!< Bank number */ + vfo_t vfo; /*!< VFO */ + ant_t ant; /*!< Selected antenna */ + freq_t freq; /*!< Receive frequency */ + rmode_t mode; /*!< Receive mode */ + pbwidth_t width; /*!< Receive passband width associated with mode */ + + freq_t tx_freq; /*!< Transmit frequency */ + rmode_t tx_mode; /*!< Transmit mode */ + pbwidth_t tx_width; /*!< Transmit passband width associated with mode */ + + split_t split; /*!< Split mode */ + vfo_t tx_vfo; /*!< Split transmit VFO */ + + rptr_shift_t rptr_shift; /*!< Repeater shift */ + shortfreq_t rptr_offs; /*!< Repeater offset */ + shortfreq_t tuning_step; /*!< Tuning step */ + shortfreq_t rit; /*!< RIT */ + shortfreq_t xit; /*!< XIT */ + setting_t funcs; /*!< Function status */ + value_t levels[RIG_SETTING_MAX]; /*!< Level values */ + tone_t ctcss_tone; /*!< CTCSS tone */ + tone_t ctcss_sql; /*!< CTCSS squelch tone */ + tone_t dcs_code; /*!< DCS code */ + tone_t dcs_sql; /*!< DCS squelch code */ + int scan_group; /*!< Scan group */ + unsigned int flags; /*!< Channel flags, see RIG_CHFLAG's */ + char channel_desc[HAMLIB_MAXCHANDESC]; /*!< Name */ + struct ext_list + *ext_levels; /*!< Extension level value list, NULL ended. ext_levels can be NULL */ +}; + +/** + * \brief Channel structure typedef + */ +typedef struct channel channel_t; + +/** + * \brief Channel capability definition + * + * Definition of the attributes that can be stored/retrieved in/from memory + */ +struct channel_cap { + unsigned bank_num: 1; /*!< Bank number */ + unsigned vfo: 1; /*!< VFO */ + unsigned ant: 1; /*!< Selected antenna */ + unsigned freq: 1; /*!< Receive frequency */ + unsigned mode: 1; /*!< Receive mode */ + unsigned width: 1; /*!< Receive passband width associated with mode */ + + unsigned tx_freq: 1; /*!< Transmit frequency */ + unsigned tx_mode: 1; /*!< Transmit mode */ + unsigned tx_width: 1; /*!< Transmit passband width associated with mode */ + + unsigned split: 1; /*!< Split mode */ + unsigned tx_vfo: 1; /*!< Split transmit VFO */ + unsigned rptr_shift: 1; /*!< Repeater shift */ + unsigned rptr_offs: 1; /*!< Repeater offset */ + unsigned tuning_step: 1; /*!< Tuning step */ + unsigned rit: 1; /*!< RIT */ + unsigned xit: 1; /*!< XIT */ + setting_t funcs; /*!< Function status */ + setting_t levels; /*!< Level values */ + unsigned ctcss_tone: 1; /*!< CTCSS tone */ + unsigned ctcss_sql: 1; /*!< CTCSS squelch tone */ + unsigned dcs_code: 1; /*!< DCS code */ + unsigned dcs_sql: 1; /*!< DCS squelch code */ + unsigned scan_group: 1; /*!< Scan group */ + unsigned flags: 1; /*!< Channel flags */ + unsigned channel_desc: 1; /*!< Name */ + unsigned ext_levels: 1; /*!< Extension level value list */ +}; + +/** + * \brief Channel cap + */ +typedef struct channel_cap channel_cap_t; + + +/** + * \brief Memory channel type definition + * + * Definition of memory types. Depending on the type, the content + * of the memory channel has to be interpreted accordingly. + * For instance, a RIG_MTYPE_EDGE channel_t will hold only a start + * or stop frequency. + * + * \sa chan_list() + */ +typedef enum { + RIG_MTYPE_NONE = 0, /*!< None */ + RIG_MTYPE_MEM, /*!< Regular */ + RIG_MTYPE_EDGE, /*!< Scan edge */ + RIG_MTYPE_CALL, /*!< Call channel */ + RIG_MTYPE_MEMOPAD, /*!< Memory pad */ + RIG_MTYPE_SAT, /*!< Satellite */ + RIG_MTYPE_BAND, /*!< VFO/Band channel */ + RIG_MTYPE_PRIO /*!< Priority channel */ +} chan_type_t; + + +/** + * \brief Memory channel list definition + * + * Example for the Ic706MkIIG (99 memory channels, 2 scan edges, 2 call chans): +\code + chan_t chan_list[] = { + { 1, 99, RIG_MTYPE_MEM }, + { 100, 103, RIG_MTYPE_EDGE }, + { 104, 105, RIG_MTYPE_CALL }, + RIG_CHAN_END + } +\endcode + */ +struct chan_list { + int startc; /*!< Starting memory channel \b number */ + int endc; /*!< Ending memory channel \b number */ + chan_type_t type; /*!< Memory type. see chan_type_t */ + channel_cap_t + mem_caps; /*!< Definition of attributes that can be stored/retrieved */ +}; + +//! @cond Doxygen_Suppress +#define RIG_CHAN_END {0,0,RIG_MTYPE_NONE} +#define RIG_IS_CHAN_END(c) ((c).type == RIG_MTYPE_NONE) +//! @endcond + +/** + * \brief Special memory channel value to tell rig_lookup_mem_caps() to retrieve all the ranges + */ +#define RIG_MEM_CAPS_ALL -1 + +/** + * \brief chan_t type + */ +typedef struct chan_list chan_t; + + +/** + * \brief level/parm granularity definition + * + * The granularity is undefined if min = 0, max = 0, and step = 0. + * + * For float settings, if min.f = 0 and max.f = 0 (and step.f! = 0), max.f is + * assumed to be actually equal to 1.0. + * + * If step = 0 (and min and/or max are not null), then this means step can + * have maximum resolution, depending on type (int or float). + */ +struct gran { + value_t min; /*!< Minimum value */ + value_t max; /*!< Maximum value */ + value_t step; /*!< Step */ +}; + +/** + * \brief gran_t type + */ +typedef struct gran gran_t; + + +/** + * \brief Calibration table struct + */ +struct cal_table { + int size; /*!< number of plots in the table */ + struct { + int raw; /*!< raw (A/D) value, as returned by \a RIG_LEVEL_RAWSTR */ + int val; /*!< associated value, basically the measured dB value */ + } table[HAMLIB_MAX_CAL_LENGTH]; /*!< table of plots */ +}; + +/** + * \brief calibration table type + * + * cal_table_t is a data type suited to hold linear calibration. + * cal_table_t.size tells the number of plots cal_table_t.table contains. + * + * If a value is below or equal to cal_table_t.table[0].raw, + * rig_raw2val() will return cal_table_t.table[0].val. + * + * If a value is greater or equal to cal_table_t.table[cal_table_t.size-1].raw, + * rig_raw2val() will return cal_table_t.table[cal_table_t.size-1].val. + */ +typedef struct cal_table cal_table_t; + +//! @cond Doxygen_Suppress +#define EMPTY_STR_CAL { 0, { { 0, 0 }, } } +//! @endcond Doxygen_Suppress + + +/** + * \brief Calibration table struct for float values + */ +struct cal_table_float { + int size; /*!< number of plots in the table */ + struct { + int raw; /*!< raw (A/D) value */ + float val; /*!< associated value */ + } table[HAMLIB_MAX_CAL_LENGTH]; /*!< table of plots */ +}; + +/** + * \brief calibration table type for float values + * + * cal_table_float_t is a data type suited to hold linear calibration. + * cal_table_float_t.size tells the number of plots cal_table_float_t.table contains. + * + * If a value is below or equal to cal_table_float_t.table[0].raw, + * rig_raw2val_float() will return cal_table_float_t.table[0].val. + * + * If a value is greater or equal to cal_table_float_t.table[cal_table_float_t.size-1].raw, + * rig_raw2val_float() will return cal_table_float_t.table[cal_table_float_t.size-1].val. + */ +typedef struct cal_table_float cal_table_float_t; + +//! @cond Doxygen_Suppress +#define EMPTY_FLOAT_CAL { 0, { { 0, 0f }, } } + +typedef int (* chan_cb_t)(RIG *, channel_t **, int, const chan_t *, rig_ptr_t); +typedef int (* confval_cb_t)(RIG *, + const struct confparams *, + value_t *, + rig_ptr_t); +//! @endcond + +/** + * \brief Spectrum scope + */ +struct rig_spectrum_scope +{ + int id; + char *name; +}; + +/** + * \brief Spectrum scope modes + */ +enum rig_spectrum_mode_e { + RIG_SPECTRUM_MODE_NONE = 0, + RIG_SPECTRUM_MODE_CENTER, /*!< Spectrum scope centered around the VFO frequency */ + RIG_SPECTRUM_MODE_FIXED, /*!< Spectrum scope edge frequencies are fixed */ + RIG_SPECTRUM_MODE_CENTER_SCROLL, /*!< Spectrum scope edge frequencies are fixed, but identical to what the center mode would use. Scrolling is enabled. */ + RIG_SPECTRUM_MODE_FIXED_SCROLL, /*!< Spectrum scope edge frequencies are fixed with scrolling enabled */ +}; + +/** + * \brief Spectrum scope averaging modes + */ +struct rig_spectrum_avg_mode +{ + int id; + char *name; +}; + +/** + * \brief Represents a single line of rig spectrum scope FFT data. + * + * The data levels specify the range of the spectrum scope FFT data. + * The minimum level should represent the lowest numeric value and the lowest signal level in dB. + * The maximum level should represent the highest numeric value and the highest signal level in dB. + * The data level values are assumed to represent the dB strength scale in a linear way. + * + * Note that the data level and signal strength ranges may change depending on the settings of the rig. + * At least on Kenwood the sub-scope provides different kind of data compared to the main scope. + */ +struct rig_spectrum_line +{ + int id; /*!< Numeric ID of the spectrum scope data stream identifying the VFO/receiver. First ID is zero. Rigs with multiple scopes usually have identifiers, such as 0 = Main, 1 = Sub. */ + + int data_level_min; /*!< The numeric value that represents the minimum signal level. */ + int data_level_max; /*!< The numeric value that represents the maximum signal level. */ + double signal_strength_min; /*!< The strength of the minimum signal level in dB. */ + double signal_strength_max; /*!< The strength of the maximum signal level in dB. */ + + enum rig_spectrum_mode_e spectrum_mode; /*!< Spectrum mode. */ + + freq_t center_freq; /*!< Center frequency of the spectrum scope in Hz in RIG_SPECTRUM_CENTER mode. */ + freq_t span_freq; /*!< Span of the spectrum scope in Hz in RIG_SPECTRUM_CENTER mode. */ + + freq_t low_edge_freq; /*!< Low edge frequency of the spectrum scope in Hz in RIG_SPECTRUM_FIXED mode. */ + freq_t high_edge_freq; /*!< High edge frequency of the spectrum scope in Hz in RIG_SPECTRUM_FIXED mode. */ + + int spectrum_data_length; /*!< Number of bytes of 8-bit spectrum data in the data buffer. The amount of data may vary if the rig has multiple spectrum scopes, depending on the scope. */ + unsigned char *spectrum_data; /*!< 8-bit spectrum data covering bandwidth of either the span_freq in center mode or from low edge to high edge in fixed mode. A higher value represents higher signal strength. */ +}; + +/** + * \brief Rig data structure. + * + * Basic rig type, can store some useful info about different radios. Each + * backend must be able to populate this structure, so we can make useful + * inquiries about capabilities. + * + * The main idea of this struct is that it will be defined by the backend rig + * driver, and will remain readonly for the application. Fields that need to + * be modifiable by the application are copied into the struct rig_state, + * which is a kind of private storage of the RIG instance. + * + * This way, you can have several rigs running within the same application, + * sharing the struct rig_caps of the backend, while keeping their own + * customized data. + * + * mdblack: Don't move or add fields around without bumping the version numbers + * DLL or shared library replacement depends on order + */ +//! @cond Doxygen_Suppress +#define RIG_MODEL(arg) .rig_model=arg,.macro_name=#arg +struct rig_caps { + rig_model_t rig_model; /*!< Rig model. */ + const char *model_name; /*!< Model name. */ + const char *mfg_name; /*!< Manufacturer. */ + const char *version; /*!< Driver version. */ + const char *copyright; /*!< Copyright info. */ + enum rig_status_e status; /*!< Driver status. */ + + int rig_type; /*!< Rig type. */ + ptt_type_t ptt_type; /*!< Type of the PTT port. */ + dcd_type_t dcd_type; /*!< Type of the DCD port. */ + rig_port_t port_type; /*!< Type of communication port. */ + + int serial_rate_min; /*!< Minimum serial speed. */ + int serial_rate_max; /*!< Maximum serial speed. */ + int serial_data_bits; /*!< Number of data bits. */ + int serial_stop_bits; /*!< Number of stop bits. */ + enum serial_parity_e serial_parity; /*!< Parity. */ + enum serial_handshake_e serial_handshake; /*!< Handshake. */ + + int write_delay; /*!< Delay between each byte sent out, in mS */ + int post_write_delay; /*!< Delay between each commands send out, in mS */ + int timeout; /*!< Timeout, in mS */ + int retry; /*!< Maximum number of retries if command fails, 0 to disable */ + + setting_t has_get_func; /*!< List of get functions */ + setting_t has_set_func; /*!< List of set functions */ + setting_t has_get_level; /*!< List of get level */ + setting_t has_set_level; /*!< List of set level */ + setting_t has_get_parm; /*!< List of get parm */ + setting_t has_set_parm; /*!< List of set parm */ + + gran_t level_gran[RIG_SETTING_MAX]; /*!< level granularity (i.e. steps) */ + gran_t parm_gran[RIG_SETTING_MAX]; /*!< parm granularity (i.e. steps) */ + + const struct confparams *extparms; /*!< Extension parm list, \sa ext.c */ + const struct confparams *extlevels; /*!< Extension level list, \sa ext.c */ + const struct confparams *extfuncs; /*!< Extension func list, \sa ext.c */ + int *ext_tokens; /*!< Extension token list */ + + tone_t *ctcss_list; /*!< CTCSS tones list, zero ended */ + tone_t *dcs_list; /*!< DCS code list, zero ended */ + + int preamp[HAMLIB_MAXDBLSTSIZ]; /*!< Preamp list in dB, 0 terminated */ + int attenuator[HAMLIB_MAXDBLSTSIZ]; /*!< Attenuator list in dB, 0 terminated */ + shortfreq_t max_rit; /*!< max absolute RIT */ + shortfreq_t max_xit; /*!< max absolute XIT */ + shortfreq_t max_ifshift; /*!< max absolute IF-SHIFT */ + + int agc_level_count; /*!< Number of supported AGC levels. Zero indicates all modes should be available (for backwards-compatibility). */ + enum agc_level_e agc_levels[HAMLIB_MAX_AGC_LEVELS]; /*!< Supported AGC levels */ + + ann_t announces; /*!< Announces bit field list */ + + vfo_op_t vfo_ops; /*!< VFO op bit field list */ + scan_t scan_ops; /*!< Scan bit field list */ + int targetable_vfo; /*!< Bit field list of direct VFO access commands */ + int transceive; /*!< Supported transceive mode */ + + int bank_qty; /*!< Number of banks */ + int chan_desc_sz; /*!< Max length of memory channel name */ + + chan_t chan_list[HAMLIB_CHANLSTSIZ]; /*!< Channel list, zero ended */ + + // As of 2020-02-12 we know of 5 models from Icom USA, EUR, ITR, TPE, KOR for the IC-9700 + // So we currently have 5 ranges we need to deal with + // The backend for the model should fill in the label field to explain what model it is + // The the IC-9700 in ic7300.c for an example + freq_range_t rx_range_list1[HAMLIB_FRQRANGESIZ]; /*!< Receive frequency range list #1 */ + freq_range_t tx_range_list1[HAMLIB_FRQRANGESIZ]; /*!< Transmit frequency range list #1 */ + freq_range_t rx_range_list2[HAMLIB_FRQRANGESIZ]; /*!< Receive frequency range list #2 */ + freq_range_t tx_range_list2[HAMLIB_FRQRANGESIZ]; /*!< Transmit frequency range list #2 */ + freq_range_t rx_range_list3[HAMLIB_FRQRANGESIZ]; /*!< Receive frequency range list #3 */ + freq_range_t tx_range_list3[HAMLIB_FRQRANGESIZ]; /*!< Transmit frequency range list #3 */ + freq_range_t rx_range_list4[HAMLIB_FRQRANGESIZ]; /*!< Receive frequency range list #4 */ + freq_range_t tx_range_list4[HAMLIB_FRQRANGESIZ]; /*!< Transmit frequency range list #4 */ + freq_range_t rx_range_list5[HAMLIB_FRQRANGESIZ]; /*!< Receive frequency range list #5 */ + freq_range_t tx_range_list5[HAMLIB_FRQRANGESIZ]; /*!< Transmit frequency range list #5 */ + + struct tuning_step_list tuning_steps[HAMLIB_TSLSTSIZ]; /*!< Tuning step list */ + struct filter_list filters[HAMLIB_FLTLSTSIZ]; /*!< mode/filter table, at -6dB */ + + cal_table_t str_cal; /*!< S-meter calibration table */ + cal_table_float_t swr_cal; /*!< SWR meter calibration table */ + cal_table_float_t alc_cal; /*!< ALC meter calibration table */ + cal_table_float_t rfpower_meter_cal; /*!< RF power meter calibration table */ + cal_table_float_t comp_meter_cal; /*!< COMP meter calibration table */ + cal_table_float_t vd_meter_cal; /*!< Voltage meter calibration table */ + cal_table_float_t id_meter_cal; /*!< Current draw meter calibration table */ + + struct rig_spectrum_scope spectrum_scopes[HAMLIB_MAX_SPECTRUM_SCOPES]; /*!< Supported spectrum scopes. The array index must match the scope ID. Last entry must have NULL name. */ + enum rig_spectrum_mode_e spectrum_modes[HAMLIB_MAX_SPECTRUM_MODES]; /*!< Supported spectrum scope modes. Last entry must be RIG_SPECTRUM_MODE_NONE. */ + freq_t spectrum_spans[HAMLIB_MAX_SPECTRUM_SPANS]; /*!< Supported spectrum scope frequency spans in Hz in center mode. Last entry must be 0. */ + struct rig_spectrum_avg_mode spectrum_avg_modes[HAMLIB_MAX_SPECTRUM_AVG_MODES]; /*!< Supported spectrum scope averaging modes. Last entry must have NULL name. */ + int spectrum_attenuator[HAMLIB_MAXDBLSTSIZ]; /*!< Spectrum attenuator list in dB, 0 terminated */ + + const struct confparams *cfgparams; /*!< Configuration parameters. */ + const rig_ptr_t priv; /*!< Private data. */ + + /* + * Rig API + * + */ + + int (*rig_init)(RIG *rig); + int (*rig_cleanup)(RIG *rig); + int (*rig_open)(RIG *rig); + int (*rig_close)(RIG *rig); + + /* + * General API commands, from most primitive to least.. :() + * List Set/Get functions pairs + */ + + int (*set_freq)(RIG *rig, vfo_t vfo, freq_t freq); + int (*get_freq)(RIG *rig, vfo_t vfo, freq_t *freq); + + int (*set_mode)(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width); + int (*get_mode)(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width); + + int (*set_vfo)(RIG *rig, vfo_t vfo); + int (*get_vfo)(RIG *rig, vfo_t *vfo); + + int (*set_ptt)(RIG *rig, vfo_t vfo, ptt_t ptt); + int (*get_ptt)(RIG *rig, vfo_t vfo, ptt_t *ptt); + + int (*get_dcd)(RIG *rig, vfo_t vfo, dcd_t *dcd); + + int (*set_rptr_shift)(RIG *rig, vfo_t vfo, rptr_shift_t rptr_shift); + int (*get_rptr_shift)(RIG *rig, vfo_t vfo, rptr_shift_t *rptr_shift); + + int (*set_rptr_offs)(RIG *rig, vfo_t vfo, shortfreq_t offs); + int (*get_rptr_offs)(RIG *rig, vfo_t vfo, shortfreq_t *offs); + + int (*set_split_freq)(RIG *rig, vfo_t vfo, freq_t tx_freq); + int (*get_split_freq)(RIG *rig, vfo_t vfo, freq_t *tx_freq); + + int (*set_split_mode)(RIG *rig, + vfo_t vfo, + rmode_t tx_mode, + pbwidth_t tx_width); + int (*get_split_mode)(RIG *rig, + vfo_t vfo, + rmode_t *tx_mode, + pbwidth_t *tx_width); + + int (*set_split_freq_mode)(RIG *rig, + vfo_t vfo, + freq_t tx_freq, + rmode_t tx_mode, + pbwidth_t tx_width); + int (*get_split_freq_mode)(RIG *rig, + vfo_t vfo, + freq_t *tx_freq, + rmode_t *tx_mode, + pbwidth_t *tx_width); + + int (*set_split_vfo)(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo); + int (*get_split_vfo)(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo); + + int (*set_rit)(RIG *rig, vfo_t vfo, shortfreq_t rit); + int (*get_rit)(RIG *rig, vfo_t vfo, shortfreq_t *rit); + + int (*set_xit)(RIG *rig, vfo_t vfo, shortfreq_t xit); + int (*get_xit)(RIG *rig, vfo_t vfo, shortfreq_t *xit); + + int (*set_ts)(RIG *rig, vfo_t vfo, shortfreq_t ts); + int (*get_ts)(RIG *rig, vfo_t vfo, shortfreq_t *ts); + + int (*set_dcs_code)(RIG *rig, vfo_t vfo, tone_t code); + int (*get_dcs_code)(RIG *rig, vfo_t vfo, tone_t *code); + + int (*set_tone)(RIG *rig, vfo_t vfo, tone_t tone); + int (*get_tone)(RIG *rig, vfo_t vfo, tone_t *tone); + + int (*set_ctcss_tone)(RIG *rig, vfo_t vfo, tone_t tone); + int (*get_ctcss_tone)(RIG *rig, vfo_t vfo, tone_t *tone); + + int (*set_dcs_sql)(RIG *rig, vfo_t vfo, tone_t code); + int (*get_dcs_sql)(RIG *rig, vfo_t vfo, tone_t *code); + + int (*set_tone_sql)(RIG *rig, vfo_t vfo, tone_t tone); + int (*get_tone_sql)(RIG *rig, vfo_t vfo, tone_t *tone); + + int (*set_ctcss_sql)(RIG *rig, vfo_t vfo, tone_t tone); + int (*get_ctcss_sql)(RIG *rig, vfo_t vfo, tone_t *tone); + + int (*power2mW)(RIG *rig, + unsigned int *mwpower, + float power, + freq_t freq, + rmode_t mode); + int (*mW2power)(RIG *rig, + float *power, + unsigned int mwpower, + freq_t freq, + rmode_t mode); + + int (*set_powerstat)(RIG *rig, powerstat_t status); + int (*get_powerstat)(RIG *rig, powerstat_t *status); + + int (*reset)(RIG *rig, reset_t reset); + + int (*set_ant)(RIG *rig, vfo_t vfo, ant_t ant, value_t option); + int (*get_ant)(RIG *rig, vfo_t vfo, ant_t ant, value_t *option, ant_t *ant_curr, ant_t *ant_tx, ant_t *ant_rx); + + int (*set_level)(RIG *rig, vfo_t vfo, setting_t level, value_t val); + int (*get_level)(RIG *rig, vfo_t vfo, setting_t level, value_t *val); + + int (*set_func)(RIG *rig, vfo_t vfo, setting_t func, int status); + int (*get_func)(RIG *rig, vfo_t vfo, setting_t func, int *status); + + int (*set_parm)(RIG *rig, setting_t parm, value_t val); + int (*get_parm)(RIG *rig, setting_t parm, value_t *val); + + int (*set_ext_level)(RIG *rig, vfo_t vfo, token_t token, value_t val); + int (*get_ext_level)(RIG *rig, vfo_t vfo, token_t token, value_t *val); + + int (*set_ext_func)(RIG *rig, vfo_t vfo, token_t token, int status); + int (*get_ext_func)(RIG *rig, vfo_t vfo, token_t token, int *status); + + int (*set_ext_parm)(RIG *rig, token_t token, value_t val); + int (*get_ext_parm)(RIG *rig, token_t token, value_t *val); + + int (*set_conf)(RIG *rig, token_t token, const char *val); + int (*get_conf)(RIG *rig, token_t token, char *val); + + int (*send_dtmf)(RIG *rig, vfo_t vfo, const char *digits); + int (*recv_dtmf)(RIG *rig, vfo_t vfo, char *digits, int *length); + + int (*send_morse)(RIG *rig, vfo_t vfo, const char *msg); + int (*stop_morse)(RIG *rig, vfo_t vfo); + int (*wait_morse)(RIG *rig, vfo_t vfo); + + int (*send_voice_mem)(RIG *rig, vfo_t vfo, int ch); + + int (*set_bank)(RIG *rig, vfo_t vfo, int bank); + + int (*set_mem)(RIG *rig, vfo_t vfo, int ch); + int (*get_mem)(RIG *rig, vfo_t vfo, int *ch); + + int (*vfo_op)(RIG *rig, vfo_t vfo, vfo_op_t op); + + int (*scan)(RIG *rig, vfo_t vfo, scan_t scan, int ch); + + int (*set_trn)(RIG *rig, int trn); + int (*get_trn)(RIG *rig, int *trn); + + int (*decode_event)(RIG *rig); + + int (*set_channel)(RIG *rig, vfo_t vfo, const channel_t *chan); + int (*get_channel)(RIG *rig, vfo_t vfo, channel_t *chan, int read_only); + + const char * (*get_info)(RIG *rig); + + int (*set_chan_all_cb)(RIG *rig, vfo_t vfo, chan_cb_t chan_cb, rig_ptr_t); + int (*get_chan_all_cb)(RIG *rig, vfo_t vfo, chan_cb_t chan_cb, rig_ptr_t); + + int (*set_mem_all_cb)(RIG *rig, + chan_cb_t chan_cb, + confval_cb_t parm_cb, + rig_ptr_t); + int (*get_mem_all_cb)(RIG *rig, + chan_cb_t chan_cb, + confval_cb_t parm_cb, + rig_ptr_t); + + int (*set_vfo_opt)(RIG *rig, int status); // only for Net Rigctl device + int (*rig_get_vfo_info) (RIG *rig, + vfo_t vfo, + freq_t *freq, + rmode_t *mode, + pbwidth_t *width, + split_t *split); + int(*set_clock) (RIG *rig, int year, int month, int day, int hour, int min, int sec, double msec, int utc_offset); + int(*get_clock) (RIG *rig, int *year, int *month, int *day, int *hour, int *min, int *sec, double *msec, int *utc_offset); + + const char *clone_combo_set; /*!< String describing key combination to enter load cloning mode */ + const char *clone_combo_get; /*!< String describing key combination to enter save cloning mode */ + const char *macro_name; /*!< Rig model macro name */ +}; +//! @endcond + +/** + * \brief Enumeration of all rig_ functions + * + */ +//! @cond Doxygen_Suppress +// all functions enumerated for rig_get_function_ptr +enum rig_function_e { + RIG_FUNCTION_INIT, + RIG_FUNCTION_CLEANUP, + RIG_FUNCTION_OPEN, + RIG_FUNCTION_CLOSE, + RIG_FUNCTION_SET_FREQ, + RIG_FUNCTION_GET_FREQ, + RIG_FUNCTION_SET_MODE, + RIG_FUNCTION_GET_MODE, + RIG_FUNCTION_SET_VFO, + RIG_FUNCTION_GET_VFO, + RIG_FUNCTION_SET_PTT, + RIG_FUNCTION_GET_PTT, + RIG_FUNCTION_GET_DCD, + RIG_FUNCTION_SET_RPTR_SHIFT, + RIG_FUNCTION_GET_RPTR_SHIFT, + RIG_FUNCTION_SET_RPTR_OFFS, + RIG_FUNCTION_GET_RPTR_OFFS, + RIG_FUNCTION_SET_SPLIT_FREQ, + RIG_FUNCTION_GET_SPLIT_FREQ, + RIG_FUNCTION_SET_SPLIT_MODE, + RIG_FUNCTION_SET_SPLIT_FREQ_MODE, + RIG_FUNCTION_GET_SPLIT_FREQ_MODE, + RIG_FUNCTION_SET_SPLIT_VFO, + RIG_FUNCTION_GET_SPLIT_VFO, + RIG_FUNCTION_SET_RIT, + RIG_FUNCTION_GET_RIT, + RIG_FUNCTION_SET_XIT, + RIG_FUNCTION_GET_XIT, + RIG_FUNCTION_SET_TS, + RIG_FUNCTION_GET_TS, + RIG_FUNCTION_SET_DCS_CODE, + RIG_FUNCTION_GET_DCS_CODE, + RIG_FUNCTION_SET_TONE, + RIG_FUNCTION_GET_TONE, + RIG_FUNCTION_SET_CTCSS_TONE, + RIG_FUNCTION_GET_CTCSS_TONE, + RIG_FUNCTION_SET_DCS_SQL, + RIG_FUNCTION_GET_DCS_SQL, + RIG_FUNCTION_SET_TONE_SQL, + RIG_FUNCTION_GET_TONE_SQL, + RIG_FUNCTION_SET_CTCSS_SQL, + RIG_FUNCTION_GET_CTCSS_SQL, + RIG_FUNCTION_POWER2MW, + RIG_FUNCTION_MW2POWER, + RIG_FUNCTION_SET_POWERSTAT, + RIG_FUNCTION_GET_POWERSTAT, + RIG_FUNCTION_RESET, + RIG_FUNCTION_SET_ANT, + RIG_FUNCTION_GET_ANT, + RIG_FUNCTION_SET_LEVEL, + RIG_FUNCTION_GET_LEVEL, + RIG_FUNCTION_SET_FUNC, + RIG_FUNCTION_GET_FUNC, + RIG_FUNCTION_SET_PARM, + RIG_FUNCTION_GET_PARM, + RIG_FUNCTION_SET_EXT_LEVEL, + RIG_FUNCTION_GET_EXT_LEVEL, + RIG_FUNCTION_SET_EXT_FUNC, + RIG_FUNCTION_GET_EXT_FUNC, + RIG_FUNCTION_SET_EXT_PARM, + RIG_FUNCTION_GET_EXT_PARM, + RIG_FUNCTION_SET_CONF, + RIG_FUNCTION_GET_CONF, + RIG_FUNCTION_SEND_DTMF, + RIG_FUNCTION_SEND_MORSE, + RIG_FUNCTION_STOP_MORSE, + RIG_FUNCTION_WAIT_MORSE, + RIG_FUNCTION_SET_BANK, + RIG_FUNCTION_SET_MEM, + RIG_FUNCTION_GET_MEM, + RIG_FUNCTION_VFO_OP, + RIG_FUNCTION_SCAN, + RIG_FUNCTION_SET_TRN, + RIG_FUNCTION_GET_TRN, + RIG_FUNCTION_DECODE_EVENT, + RIG_FUNCTION_SET_CHANNEL, + RIG_FUNCTION_GET_CHANNEL, + RIG_FUNCTION_GET_INFO, + RIG_FUNCTION_SET_CHAN_ALL_CB, + RIG_FUNCTION_GET_CHAN_ALL_CB, + RIG_FUNCTION_SET_MEM_ALL_CB, + RIG_FUNCTION_GET_MEM_ALL_CB, + RIG_FUNCTION_SET_VFO_OPT, +}; + +/** + * \brief Function to return pointer to rig_* function + * + */ +//! @cond Doxygen_Suppress +extern HAMLIB_EXPORT (void *) rig_get_function_ptr(rig_model_t rig_model, enum rig_function_e rig_function); + +/** + * \brief Enumeration of rig->caps values + * + */ +//! @cond Doxygen_Suppress +// values enumerated for rig->caps values +enum rig_caps_int_e { + RIG_CAPS_TARGETABLE_VFO, + RIG_CAPS_RIG_MODEL, + RIG_CAPS_PORT_TYPE, + RIG_CAPS_PTT_TYPE, + RIG_CAPS_HAS_GET_LEVEL +}; + +enum rig_caps_cptr_e { + RIG_CAPS_VERSION_CPTR, + RIG_CAPS_MFG_NAME_CPTR, + RIG_CAPS_MODEL_NAME_CPTR, + RIG_CAPS_STATUS_CPTR +}; + +/** + * \brief Function to return int value from rig->caps + * Does not support > 32-bit rig_caps values + */ +//! @cond Doxygen_Suppress +extern HAMLIB_EXPORT (long long) rig_get_caps_int(rig_model_t rig_model, enum rig_caps_int_e rig_caps); + +/** + * \brief Function to return char pointer value from rig->caps + * + */ +//! @cond Doxygen_Suppress +extern HAMLIB_EXPORT (const char *) rig_get_caps_cptr(rig_model_t rig_model, enum rig_caps_cptr_e rig_caps); + +/** + * \brief Port definition + * + * Of course, looks like OO painstakingly programmed in C, sigh. + */ +//! @cond Doxygen_Suppress +typedef struct hamlib_port { + union { + rig_port_t rig; /*!< Communication port type */ + ptt_type_t ptt; /*!< PTT port type */ + dcd_type_t dcd; /*!< DCD port type */ + } type; + + int fd; /*!< File descriptor */ + void *handle; /*!< handle for USB */ + + int write_delay; /*!< Delay between each byte sent out, in mS */ + int post_write_delay; /*!< Delay between each commands send out, in mS */ + + struct { + int tv_sec, tv_usec; + } post_write_date; /*!< hamlib internal use */ + + int timeout; /*!< Timeout, in mS */ + short retry; /*!< Maximum number of retries, 0 to disable */ + short flushx; /*!< If true flush is done with read instead of TCFLUSH - MicroHam */ + + char pathname[HAMLIB_FILPATHLEN]; /*!< Port pathname */ + + union { + struct { + int rate; /*!< Serial baud rate */ + int data_bits; /*!< Number of data bits */ + int stop_bits; /*!< Number of stop bits */ + enum serial_parity_e parity; /*!< Serial parity */ + enum serial_handshake_e handshake; /*!< Serial handshake */ + enum serial_control_state_e rts_state; /*!< RTS set state */ + enum serial_control_state_e dtr_state; /*!< DTR set state */ + } serial; /*!< serial attributes */ + + struct { + int pin; /*!< Parallel port pin number */ + } parallel; /*!< parallel attributes */ + + struct { + int ptt_bitnum; /*!< Bit number for CM108 GPIO PTT */ + } cm108; /*!< CM108 attributes */ + + struct { + int vid; /*!< Vendor ID */ + int pid; /*!< Product ID */ + int conf; /*!< Configuration */ + int iface; /*!< interface */ + int alt; /*!< alternate */ + char *vendor_name; /*!< Vendor name (opt.) */ + char *product; /*!< Product (opt.) */ + } usb; /*!< USB attributes */ + + struct { + int on_value; /*!< GPIO: 1 == normal, GPION: 0 == inverted */ + int value; /*!< Toggle PTT ON or OFF */ + } gpio; /*!< GPIO attributes */ + } parm; /*!< Port parameter union */ + int client_port; /*!< client socket port for tcp connection */ + RIG *rig; /*!< our parent RIG device */ +} hamlib_port_t; +//! @endcond + +#if !defined(__APPLE__) || !defined(__cplusplus) +typedef hamlib_port_t port_t; +#endif + +#define HAMLIB_ELAPSED_GET 0 +#define HAMLIB_ELAPSED_SET 1 +#define HAMLIB_ELAPSED_INVALIDATE 2 + +#define HAMLIB_CACHE_ALWAYS -1 /*< value to set cache timeout to always use cache */ + +typedef enum { + HAMLIB_CACHE_ALL, // to set all cache timeouts at once + HAMLIB_CACHE_VFO, + HAMLIB_CACHE_FREQ, + HAMLIB_CACHE_MODE, + HAMLIB_CACHE_PTT, + HAMLIB_CACHE_SPLIT, + HAMLIB_CACHE_WIDTH +} hamlib_cache_t; + +typedef enum { + TWIDDLE_OFF, + TWIDDLE_ON +} twiddle_state_t; + +/** + * \brief Rig cache data + * + * This struct contains all the items we cache at the highest level + */ +struct rig_cache { + int timeout_ms; // the cache timeout for invalidating itself + vfo_t vfo; + //freq_t freq; // to be deprecated in 4.1 when full Main/Sub/A/B caching is implemented in 4.1 + // other abstraction here is based on dual vfo rigs and mapped to all others + // So we have four possible states of rig + // MainA, MainB, SubA, SubB + // Main is the Main VFO and Sub is for the 2nd VFO + // Most rigs have MainA and MainB + // Dual VFO rigs can have SubA and SubB too + // For dual VFO rigs simplex operations are all done on MainA/MainB -- ergo this abstraction + freq_t freqCurr; // Other VFO + freq_t freqOther; // Other VFO + freq_t freqMainA; // VFO_A, VFO_MAIN, and VFO_MAINA + freq_t freqMainB; // VFO_B, VFO_SUB, and VFO_MAINB + freq_t freqMainC; // VFO_C, VFO_MAINC + freq_t freqSubA; // VFO_SUBA -- only for rigs with dual Sub VFOs + freq_t freqSubB; // VFO_SUBB -- only for rigs with dual Sub VFOs + freq_t freqSubC; // VFO_SUBC -- only for rigs with 3 Sub VFOs + freq_t freqMem; // VFO_MEM -- last MEM channel + rmode_t modeCurr; + rmode_t modeOther; + rmode_t modeMainA; + rmode_t modeMainB; + rmode_t modeMainC; + rmode_t modeSubA; + rmode_t modeSubB; + rmode_t modeSubC; + rmode_t modeMem; + pbwidth_t widthCurr; // if non-zero then rig has separate width for MainA + pbwidth_t widthOther; // if non-zero then rig has separate width for MainA + pbwidth_t widthMainA; // if non-zero then rig has separate width for MainA + pbwidth_t widthMainB; // if non-zero then rig has separate width for MainB + pbwidth_t widthMainC; // if non-zero then rig has separate width for MainC + pbwidth_t widthSubA; // if non-zero then rig has separate width for SubA + pbwidth_t widthSubB; // if non-zero then rig has separate width for SubB + pbwidth_t widthSubC; // if non-zero then rig has separate width for SubC + pbwidth_t widthMem; // if non-zero then rig has separate width for Mem + ptt_t ptt; + split_t split; + vfo_t split_vfo; // split caches two values + struct timespec time_freqCurr; + struct timespec time_freqOther; + struct timespec time_freqMainA; + struct timespec time_freqMainB; + struct timespec time_freqMainC; + struct timespec time_freqSubA; + struct timespec time_freqSubB; + struct timespec time_freqSubC; + struct timespec time_freqMem; + struct timespec time_vfo; + struct timespec time_modeCurr; + struct timespec time_modeOther; + struct timespec time_modeMainA; + struct timespec time_modeMainB; + struct timespec time_modeMainC; + struct timespec time_modeSubA; + struct timespec time_modeSubB; + struct timespec time_modeSubC; + struct timespec time_modeMem; + struct timespec time_widthCurr; + struct timespec time_widthOther; + struct timespec time_widthMainA; + struct timespec time_widthMainB; + struct timespec time_widthMainC; + struct timespec time_widthSubA; + struct timespec time_widthSubB; + struct timespec time_widthSubC; + struct timespec time_widthMem; + struct timespec time_ptt; + struct timespec time_split; + int satmode; // if rig is in satellite mode +}; + + +/** + * \brief Rig state containing live data and customized fields. + * + * This struct contains live data, as well as a copy of capability fields + * that may be updated (ie. customized) + * + * It is NOT fine to move fields around as it can break share library offset + * As of 2021-03-03 vfo_list is the last known item being reference externally + * So any additions or changes to this structure must be after vfo_list. + */ +struct rig_state { + /* + * overridable fields + */ + hamlib_port_t rigport; /*!< Rig port (internal use). */ + hamlib_port_t pttport; /*!< PTT port (internal use). */ + hamlib_port_t dcdport; /*!< DCD port (internal use). */ + + double vfo_comp; /*!< VFO compensation in PPM, 0.0 to disable */ + + int deprecated_itu_region; /*!< ITU region to select among freq_range_t */ + freq_range_t rx_range_list[HAMLIB_FRQRANGESIZ]; /*!< Receive frequency range list */ + freq_range_t tx_range_list[HAMLIB_FRQRANGESIZ]; /*!< Transmit frequency range list */ + + struct tuning_step_list tuning_steps[HAMLIB_TSLSTSIZ]; /*!< Tuning step list */ + + struct filter_list filters[HAMLIB_FLTLSTSIZ]; /*!< Mode/filter table, at -6dB */ + + cal_table_t str_cal; /*!< S-meter calibration table */ + + chan_t chan_list[HAMLIB_CHANLSTSIZ]; /*!< Channel list, zero ended */ + + shortfreq_t max_rit; /*!< max absolute RIT */ + shortfreq_t max_xit; /*!< max absolute XIT */ + shortfreq_t max_ifshift; /*!< max absolute IF-SHIFT */ + + ann_t announces; /*!< Announces bit field list */ + + int preamp[HAMLIB_MAXDBLSTSIZ]; /*!< Preamp list in dB, 0 terminated */ + int attenuator[HAMLIB_MAXDBLSTSIZ]; /*!< Preamp list in dB, 0 terminated */ + + setting_t has_get_func; /*!< List of get functions */ + setting_t has_set_func; /*!< List of set functions */ + setting_t has_get_level; /*!< List of get level */ + setting_t has_set_level; /*!< List of set level */ + setting_t has_get_parm; /*!< List of get parm */ + setting_t has_set_parm; /*!< List of set parm */ + + gran_t level_gran[RIG_SETTING_MAX]; /*!< level granularity */ + gran_t parm_gran[RIG_SETTING_MAX]; /*!< parm granularity */ + + + /* + * non overridable fields, internal use + */ + + int hold_decode; /*!< set to 1 to hold the event decoder (async) otherwise 0 */ + vfo_t current_vfo; /*!< VFO currently set */ + int vfo_list; /*!< Complete list of VFO for this rig */ + int comm_state; /*!< Comm port state, opened/closed. */ + rig_ptr_t priv; /*!< Pointer to private rig state data. */ + rig_ptr_t obj; /*!< Internal use by hamlib++ for event handling. */ + + int transceive; /*!< Whether the transceive mode is on */ + int poll_interval; /*!< Event notification polling period in milliseconds */ + freq_t current_freq; /*!< Frequency currently set */ + rmode_t current_mode; /*!< Mode currently set */ + //rmode_t current_modeB; /*!< Mode currently set VFOB */ + pbwidth_t current_width; /*!< Passband width currently set */ + vfo_t tx_vfo; /*!< Tx VFO currently set */ + rmode_t mode_list; /*!< Complete list of modes for this rig */ + // mode_list is used by some + // so anything added to this structure must be below here + int transmit; /*!< rig should be transmitting i.e. hard + wired PTT asserted - used by rigs that + don't do CAT while in Tx */ + freq_t lo_freq; /*!< Local oscillator frequency of any transverter */ + time_t twiddle_time; /*!< time when vfo twiddling was detected */ + int twiddle_timeout; /*!< timeout to resume from twiddling */ + // uplink allows gpredict to behave better by no reading the uplink VFO + int uplink; /*!< uplink=1 will not read Sub, uplink=2 will not read Main */ + struct rig_cache cache; + int vfo_opt; /*!< Is -o switch turned on? */ + int auto_power_on; /*!< Allow Hamlib to power on rig + automatically if supported */ + int auto_power_off; /*!< Allow Hamlib to power off rig + automatically if supported */ + int auto_disable_screensaver; /*!< Allow Hamlib to disable the + rig's screen saver automatically if + supported */ + int ptt_share; /*!< Share ptt port by open/close during get_ptt, set_ptt hogs the port while active */ + int power_now; /*!< Current RF power level in rig units */ + int power_min; /*!< Minimum RF power level in rig units */ + int power_max; /*!< Maximum RF power level in rig units */ + unsigned char disable_yaesu_bandselect; /*!< Disables Yaeus band select logic */ + int twiddle_rit; /*!< Suppresses VFOB reading (cached value used) so RIT control can be used */ + int twiddle_state; /*!< keeps track of twiddle status */ + vfo_t rx_vfo; /*!< Rx VFO currently set */ +}; + +//! @cond Doxygen_Suppress +typedef int (*vprintf_cb_t)(enum rig_debug_level_e, + rig_ptr_t, + const char *, + va_list); + +typedef int (*freq_cb_t)(RIG *, vfo_t, freq_t, rig_ptr_t); +typedef int (*mode_cb_t)(RIG *, vfo_t, rmode_t, pbwidth_t, rig_ptr_t); +typedef int (*vfo_cb_t)(RIG *, vfo_t, rig_ptr_t); +typedef int (*ptt_cb_t)(RIG *, vfo_t, ptt_t, rig_ptr_t); +typedef int (*dcd_cb_t)(RIG *, vfo_t, dcd_t, rig_ptr_t); +typedef int (*pltune_cb_t)(RIG *, + vfo_t, freq_t *, + rmode_t *, + pbwidth_t *, + rig_ptr_t); +typedef int (*spectrum_cb_t)(RIG *, + struct rig_spectrum_line *, + rig_ptr_t); + +//! @endcond + +/** + * \brief Callback functions and args for rig event. + * + * Some rigs are able to notify the host computer the operator changed + * the freq/mode from the front panel, depressed a button, etc. + * + * Events from the rig are received through async io, + * so callback functions will be called from the SIGIO sighandler context. + * + * Don't set these fields directly, use rig_set_freq_callback et. al. instead. + * + * Callbacks suit event based programming very well, + * really appropriate in a GUI. + * + * \sa rig_set_freq_callback(), rig_set_mode_callback(), rig_set_vfo_callback(), + * rig_set_ptt_callback(), rig_set_dcd_callback() + */ +struct rig_callbacks { + freq_cb_t freq_event; /*!< Frequency change event */ + rig_ptr_t freq_arg; /*!< Frequency change argument */ + mode_cb_t mode_event; /*!< Mode change event */ + rig_ptr_t mode_arg; /*!< Mode change argument */ + vfo_cb_t vfo_event; /*!< VFO change event */ + rig_ptr_t vfo_arg; /*!< VFO change argument */ + ptt_cb_t ptt_event; /*!< PTT change event */ + rig_ptr_t ptt_arg; /*!< PTT change argument */ + dcd_cb_t dcd_event; /*!< DCD change event */ + rig_ptr_t dcd_arg; /*!< DCD change argument */ + pltune_cb_t pltune; /*!< Pipeline tuning module freq/mode/width callback */ + rig_ptr_t pltune_arg; /*!< Pipeline tuning argument */ + spectrum_cb_t spectrum_event; /*!< Spectrum line reception event */ + rig_ptr_t spectrum_arg; /*!< Spectrum line reception argument */ + /* etc.. */ +}; + + +/** + * \brief The Rig structure + * + * This is the master data structure, acting as a handle for the controlled + * rig. A pointer to this structure is returned by the rig_init() API + * function and is passed as a parameter to every rig specific API call. + * + * \sa rig_init(), rig_caps(), rig_state() + */ +struct s_rig { + struct rig_caps *caps; /*!< Pointer to rig capabilities (read only) */ + struct rig_state state; /*!< Rig state */ + struct rig_callbacks callbacks; /*!< registered event callbacks */ +}; + + + +/* --------------- API function prototypes -----------------*/ + +//! @cond Doxygen_Suppress + +extern HAMLIB_EXPORT(RIG *) rig_init HAMLIB_PARAMS((rig_model_t rig_model)); +extern HAMLIB_EXPORT(int) rig_open HAMLIB_PARAMS((RIG *rig)); + +/* + * General API commands, from most primitive to least.. :() + * List Set/Get functions pairs + */ + +extern HAMLIB_EXPORT(int) +rig_flush(hamlib_port_t *port); + +extern HAMLIB_EXPORT(int) +rig_set_freq HAMLIB_PARAMS((RIG *rig, + vfo_t vfo, + freq_t freq)); +extern HAMLIB_EXPORT(int) +rig_get_freq HAMLIB_PARAMS((RIG *rig, + vfo_t vfo, + freq_t *freq)); + +extern HAMLIB_EXPORT(int) +rig_set_mode HAMLIB_PARAMS((RIG *rig, + vfo_t vfo, + rmode_t mode, + pbwidth_t width)); +extern HAMLIB_EXPORT(int) +rig_get_mode HAMLIB_PARAMS((RIG *rig, + vfo_t vfo, + rmode_t *mode, + pbwidth_t *width)); + +#if 0 +#define rig_set_vfo(r,v) rig_set_vfo(r,v,__builtin_FUNCTION()) +extern HAMLIB_EXPORT(int) +rig_set_vfo HAMLIB_PARAMS((RIG *rig, + vfo_t vfo, const char *func)); +#else +extern HAMLIB_EXPORT(int) +rig_set_vfo HAMLIB_PARAMS((RIG *rig, + vfo_t vfo)); +#endif +extern HAMLIB_EXPORT(int) +rig_get_vfo HAMLIB_PARAMS((RIG *rig, + vfo_t *vfo)); + +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, + int *satmode)); + +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)); + +extern HAMLIB_EXPORT(int) +rig_set_ptt HAMLIB_PARAMS((RIG *rig, + vfo_t vfo, + ptt_t ptt)); +extern HAMLIB_EXPORT(int) +rig_get_ptt HAMLIB_PARAMS((RIG *rig, + vfo_t vfo, + ptt_t *ptt)); + +extern HAMLIB_EXPORT(int) +rig_get_dcd HAMLIB_PARAMS((RIG *rig, + vfo_t vfo, + dcd_t *dcd)); + +extern HAMLIB_EXPORT(int) +rig_set_rptr_shift HAMLIB_PARAMS((RIG *rig, + vfo_t vfo, + rptr_shift_t rptr_shift)); +extern HAMLIB_EXPORT(int) +rig_get_rptr_shift HAMLIB_PARAMS((RIG *rig, + vfo_t vfo, + rptr_shift_t *rptr_shift)); + +extern HAMLIB_EXPORT(int) +rig_set_rptr_offs HAMLIB_PARAMS((RIG *rig, + vfo_t vfo, + shortfreq_t rptr_offs)); +extern HAMLIB_EXPORT(int) +rig_get_rptr_offs HAMLIB_PARAMS((RIG *rig, + vfo_t vfo, + shortfreq_t *rptr_offs)); + +extern HAMLIB_EXPORT(int) +rig_set_ctcss_tone HAMLIB_PARAMS((RIG *rig, + vfo_t vfo, + tone_t tone)); +extern HAMLIB_EXPORT(int) +rig_get_ctcss_tone HAMLIB_PARAMS((RIG *rig, + vfo_t vfo, + tone_t *tone)); + +extern HAMLIB_EXPORT(int) +rig_set_dcs_code HAMLIB_PARAMS((RIG *rig, + vfo_t vfo, + tone_t code)); +extern HAMLIB_EXPORT(int) +rig_get_dcs_code HAMLIB_PARAMS((RIG *rig, + vfo_t vfo, + tone_t *code)); + +extern HAMLIB_EXPORT(int) +rig_set_ctcss_sql HAMLIB_PARAMS((RIG *rig, + vfo_t vfo, + tone_t tone)); +extern HAMLIB_EXPORT(int) +rig_get_ctcss_sql HAMLIB_PARAMS((RIG *rig, + vfo_t vfo, + tone_t *tone)); + +extern HAMLIB_EXPORT(int) +rig_set_dcs_sql HAMLIB_PARAMS((RIG *rig, + vfo_t vfo, + tone_t code)); +extern HAMLIB_EXPORT(int) +rig_get_dcs_sql HAMLIB_PARAMS((RIG *rig, + vfo_t vfo, + tone_t *code)); + +extern HAMLIB_EXPORT(int) +rig_set_split_freq HAMLIB_PARAMS((RIG *rig, + vfo_t vfo, + freq_t tx_freq)); +extern HAMLIB_EXPORT(int) +rig_get_split_freq HAMLIB_PARAMS((RIG *rig, + vfo_t vfo, + freq_t *tx_freq)); + +extern HAMLIB_EXPORT(int) +rig_set_split_mode HAMLIB_PARAMS((RIG *rig, + vfo_t vfo, + rmode_t tx_mode, + pbwidth_t tx_width)); +extern HAMLIB_EXPORT(int) +rig_get_split_mode HAMLIB_PARAMS((RIG *rig, + vfo_t vfo, + rmode_t *tx_mode, + pbwidth_t *tx_width)); + +extern HAMLIB_EXPORT(int) +rig_set_split_freq_mode HAMLIB_PARAMS((RIG *rig, + vfo_t vfo, + freq_t tx_freq, + rmode_t tx_mode, + pbwidth_t tx_width)); +extern HAMLIB_EXPORT(int) +rig_get_split_freq_mode HAMLIB_PARAMS((RIG *rig, + vfo_t vfo, + freq_t *tx_freq, + rmode_t *tx_mode, + pbwidth_t *tx_width)); + +extern HAMLIB_EXPORT(int) +rig_set_split_vfo HAMLIB_PARAMS((RIG *, + vfo_t rx_vfo, + split_t split, + vfo_t tx_vfo)); +extern HAMLIB_EXPORT(int) +rig_get_split_vfo HAMLIB_PARAMS((RIG *, + vfo_t rx_vfo, + split_t *split, + vfo_t *tx_vfo)); + +#define rig_set_split(r,v,s) rig_set_split_vfo((r),(v),(s),RIG_VFO_CURR) +#define rig_get_split(r,v,s) ({ vfo_t _tx_vfo; rig_get_split_vfo((r),(v),(s),&_tx_vfo); }) + +extern HAMLIB_EXPORT(int) +rig_set_rit HAMLIB_PARAMS((RIG *rig, + vfo_t vfo, + shortfreq_t rit)); +extern HAMLIB_EXPORT(int) +rig_get_rit HAMLIB_PARAMS((RIG *rig, + vfo_t vfo, + shortfreq_t *rit)); + +extern HAMLIB_EXPORT(int) +rig_set_xit HAMLIB_PARAMS((RIG *rig, + vfo_t vfo, + shortfreq_t xit)); +extern HAMLIB_EXPORT(int) +rig_get_xit HAMLIB_PARAMS((RIG *rig, + vfo_t vfo, + shortfreq_t *xit)); + +extern HAMLIB_EXPORT(int) +rig_set_ts HAMLIB_PARAMS((RIG *rig, + vfo_t vfo, + shortfreq_t ts)); +extern HAMLIB_EXPORT(int) +rig_get_ts HAMLIB_PARAMS((RIG *rig, + vfo_t vfo, + shortfreq_t *ts)); + +extern HAMLIB_EXPORT(int) +rig_power2mW HAMLIB_PARAMS((RIG *rig, + unsigned int *mwpower, + float power, + freq_t freq, + rmode_t mode)); +extern HAMLIB_EXPORT(int) +rig_mW2power HAMLIB_PARAMS((RIG *rig, + float *power, + unsigned int mwpower, + freq_t freq, + rmode_t mode)); + +extern HAMLIB_EXPORT(shortfreq_t) +rig_get_resolution HAMLIB_PARAMS((RIG *rig, + rmode_t mode)); + +extern HAMLIB_EXPORT(int) +rig_set_level HAMLIB_PARAMS((RIG *rig, + vfo_t vfo, + setting_t level, + value_t val)); +extern HAMLIB_EXPORT(int) +rig_get_level HAMLIB_PARAMS((RIG *rig, + vfo_t vfo, + setting_t level, + value_t *val)); + +#define rig_get_strength(r,v,s) rig_get_level((r),(v),RIG_LEVEL_STRENGTH, (value_t*)(s)) + +extern HAMLIB_EXPORT(int) +rig_set_parm HAMLIB_PARAMS((RIG *rig, + setting_t parm, + value_t val)); +extern HAMLIB_EXPORT(int) +rig_get_parm HAMLIB_PARAMS((RIG *rig, + setting_t parm, + value_t *val)); + +extern HAMLIB_EXPORT(int) +rig_set_conf HAMLIB_PARAMS((RIG *rig, + token_t token, + const char *val)); +extern HAMLIB_EXPORT(int) +rig_get_conf HAMLIB_PARAMS((RIG *rig, + token_t token, + char *val)); + +extern HAMLIB_EXPORT(int) +rig_set_powerstat HAMLIB_PARAMS((RIG *rig, + powerstat_t status)); +extern HAMLIB_EXPORT(int) +rig_get_powerstat HAMLIB_PARAMS((RIG *rig, + powerstat_t *status)); + +extern HAMLIB_EXPORT(int) +rig_reset HAMLIB_PARAMS((RIG *rig, + reset_t reset)); /* dangerous! */ + +extern HAMLIB_EXPORT(int) +rig_set_ext_level HAMLIB_PARAMS((RIG *rig, + vfo_t vfo, + token_t token, + value_t val)); +extern HAMLIB_EXPORT(int) +rig_get_ext_level HAMLIB_PARAMS((RIG *rig, + vfo_t vfo, + token_t token, + value_t *val)); + +extern HAMLIB_EXPORT(int) +rig_set_ext_func HAMLIB_PARAMS((RIG *rig, + vfo_t vfo, + token_t token, + int status)); +extern HAMLIB_EXPORT(int) +rig_get_ext_func HAMLIB_PARAMS((RIG *rig, + vfo_t vfo, + token_t token, + int *status)); + +extern HAMLIB_EXPORT(int) +rig_set_ext_parm HAMLIB_PARAMS((RIG *rig, + token_t token, + value_t val)); +extern HAMLIB_EXPORT(int) +rig_get_ext_parm HAMLIB_PARAMS((RIG *rig, + token_t token, + value_t *val)); + +extern HAMLIB_EXPORT(int) +rig_ext_func_foreach HAMLIB_PARAMS((RIG *rig, + int (*cfunc)(RIG *, + const struct confparams *, + rig_ptr_t), + rig_ptr_t data)); +extern HAMLIB_EXPORT(int) +rig_ext_level_foreach HAMLIB_PARAMS((RIG *rig, + int (*cfunc)(RIG *, + const struct confparams *, + rig_ptr_t), + rig_ptr_t data)); +extern HAMLIB_EXPORT(int) +rig_ext_parm_foreach HAMLIB_PARAMS((RIG *rig, + int (*cfunc)(RIG *, + const struct confparams *, + rig_ptr_t), + rig_ptr_t data)); + +extern HAMLIB_EXPORT(const struct confparams *) +rig_ext_lookup HAMLIB_PARAMS((RIG *rig, + const char *name)); + +extern HAMLIB_EXPORT(const struct confparams *) +rig_ext_lookup_tok HAMLIB_PARAMS((RIG *rig, + token_t token)); +extern HAMLIB_EXPORT(token_t) +rig_ext_token_lookup HAMLIB_PARAMS((RIG *rig, + const char *name)); + + +extern HAMLIB_EXPORT(int) +rig_token_foreach HAMLIB_PARAMS((RIG *rig, + int (*cfunc)(const struct confparams *, + rig_ptr_t), + rig_ptr_t data)); + +extern HAMLIB_EXPORT(const struct confparams *) +rig_confparam_lookup HAMLIB_PARAMS((RIG *rig, + const char *name)); +extern HAMLIB_EXPORT(token_t) +rig_token_lookup HAMLIB_PARAMS((RIG *rig, + const char *name)); + +extern HAMLIB_EXPORT(int) +rig_close HAMLIB_PARAMS((RIG *rig)); + +extern HAMLIB_EXPORT(int) +rig_cleanup HAMLIB_PARAMS((RIG *rig)); + +extern HAMLIB_EXPORT(int) +rig_set_ant HAMLIB_PARAMS((RIG *rig, + vfo_t vfo, + ant_t ant, /* antenna */ + value_t option)); /* optional ant info */ +extern HAMLIB_EXPORT(int) +rig_get_ant HAMLIB_PARAMS((RIG *rig, + vfo_t vfo, + ant_t ant, + value_t *option, + ant_t *ant_curr, + ant_t *ant_tx, + ant_t *ant_rx)); + +extern HAMLIB_EXPORT(setting_t) +rig_has_get_level HAMLIB_PARAMS((RIG *rig, + setting_t level)); +extern HAMLIB_EXPORT(setting_t) +rig_has_set_level HAMLIB_PARAMS((RIG *rig, + setting_t level)); + +extern HAMLIB_EXPORT(setting_t) +rig_has_get_parm HAMLIB_PARAMS((RIG *rig, + setting_t parm)); +extern HAMLIB_EXPORT(setting_t) +rig_has_set_parm HAMLIB_PARAMS((RIG *rig, + setting_t parm)); + +extern HAMLIB_EXPORT(setting_t) +rig_has_get_func HAMLIB_PARAMS((RIG *rig, + setting_t func)); +extern HAMLIB_EXPORT(setting_t) +rig_has_set_func HAMLIB_PARAMS((RIG *rig, + setting_t func)); + +extern HAMLIB_EXPORT(int) +rig_set_func HAMLIB_PARAMS((RIG *rig, + vfo_t vfo, + setting_t func, + int status)); +extern HAMLIB_EXPORT(int) +rig_get_func HAMLIB_PARAMS((RIG *rig, + vfo_t vfo, + setting_t func, + int *status)); + +extern HAMLIB_EXPORT(int) +rig_send_dtmf HAMLIB_PARAMS((RIG *rig, + vfo_t vfo, + const char *digits)); +extern HAMLIB_EXPORT(int) +rig_recv_dtmf HAMLIB_PARAMS((RIG *rig, + vfo_t vfo, + char *digits, + int *length)); + +extern HAMLIB_EXPORT(int) +rig_send_morse HAMLIB_PARAMS((RIG *rig, + vfo_t vfo, + const char *msg)); + +extern HAMLIB_EXPORT(int) +rig_stop_morse HAMLIB_PARAMS((RIG *rig, + vfo_t vfo)); + +extern HAMLIB_EXPORT(int) +rig_wait_morse HAMLIB_PARAMS((RIG *rig, + vfo_t vfo)); + +extern HAMLIB_EXPORT(int) +rig_send_voice_mem HAMLIB_PARAMS((RIG *rig, + vfo_t vfo, + int ch)); + +extern HAMLIB_EXPORT(int) +rig_set_bank HAMLIB_PARAMS((RIG *rig, + vfo_t vfo, + int bank)); + +extern HAMLIB_EXPORT(int) +rig_set_mem HAMLIB_PARAMS((RIG *rig, + vfo_t vfo, + int ch)); +extern HAMLIB_EXPORT(int) +rig_get_mem HAMLIB_PARAMS((RIG *rig, + vfo_t vfo, + int *ch)); + +extern HAMLIB_EXPORT(int) +rig_vfo_op HAMLIB_PARAMS((RIG *rig, + vfo_t vfo, + vfo_op_t op)); + +extern HAMLIB_EXPORT(vfo_op_t) +rig_has_vfo_op HAMLIB_PARAMS((RIG *rig, + vfo_op_t op)); + +extern HAMLIB_EXPORT(int) +rig_scan HAMLIB_PARAMS((RIG *rig, + vfo_t vfo, + scan_t scan, + int ch)); + +extern HAMLIB_EXPORT(scan_t) +rig_has_scan HAMLIB_PARAMS((RIG *rig, + scan_t scan)); + +extern HAMLIB_EXPORT(int) +rig_set_channel HAMLIB_PARAMS((RIG *rig, + vfo_t vfo, + const channel_t *chan)); /* mem */ +extern HAMLIB_EXPORT(int) +rig_get_channel HAMLIB_PARAMS((RIG *rig, + vfo_t vfo, + channel_t *chan, int read_only)); + +extern HAMLIB_EXPORT(int) +rig_set_chan_all HAMLIB_PARAMS((RIG *rig, + vfo_t vfo, + const channel_t chans[])); +extern HAMLIB_EXPORT(int) +rig_get_chan_all HAMLIB_PARAMS((RIG *rig, + vfo_t vfo, + channel_t chans[])); + +extern HAMLIB_EXPORT(int) +rig_set_chan_all_cb HAMLIB_PARAMS((RIG *rig, + vfo_t vfo, + chan_cb_t chan_cb, + rig_ptr_t)); +extern HAMLIB_EXPORT(int) +rig_get_chan_all_cb HAMLIB_PARAMS((RIG *rig, + vfo_t vfo, + chan_cb_t chan_cb, + rig_ptr_t)); + +extern HAMLIB_EXPORT(int) +rig_set_mem_all_cb HAMLIB_PARAMS((RIG *rig, + vfo_t vfo, + chan_cb_t chan_cb, + confval_cb_t parm_cb, + rig_ptr_t)); +extern HAMLIB_EXPORT(int) +rig_get_mem_all_cb HAMLIB_PARAMS((RIG *rig, + vfo_t vfo, + chan_cb_t chan_cb, + confval_cb_t parm_cb, + rig_ptr_t)); + +extern HAMLIB_EXPORT(int) +rig_set_mem_all HAMLIB_PARAMS((RIG *rig, + vfo_t vfo, + const channel_t *chan, + const struct confparams *, + const value_t *)); +extern HAMLIB_EXPORT(int) +rig_get_mem_all HAMLIB_PARAMS((RIG *rig, + vfo_t vfo, + channel_t *chan, + const struct confparams *, + value_t *)); + +extern HAMLIB_EXPORT(const chan_t *) +rig_lookup_mem_caps HAMLIB_PARAMS((RIG *rig, + int ch)); + +extern HAMLIB_EXPORT(int) +rig_mem_count HAMLIB_PARAMS((RIG *rig)); + +extern HAMLIB_EXPORT(int) +rig_set_trn HAMLIB_PARAMS((RIG *rig, + int trn)); +extern HAMLIB_EXPORT(int) +rig_get_trn HAMLIB_PARAMS((RIG *rig, + int *trn)); + +extern HAMLIB_EXPORT(int) +rig_set_freq_callback HAMLIB_PARAMS((RIG *, + freq_cb_t, + rig_ptr_t)); + +extern HAMLIB_EXPORT(int) +rig_set_mode_callback HAMLIB_PARAMS((RIG *, + mode_cb_t, + rig_ptr_t)); +extern HAMLIB_EXPORT(int) +rig_set_vfo_callback HAMLIB_PARAMS((RIG *, + vfo_cb_t, + rig_ptr_t)); + +extern HAMLIB_EXPORT(int) +rig_set_ptt_callback HAMLIB_PARAMS((RIG *, + ptt_cb_t, + rig_ptr_t)); + +extern HAMLIB_EXPORT(int) +rig_set_dcd_callback HAMLIB_PARAMS((RIG *, + dcd_cb_t, + rig_ptr_t)); + +extern HAMLIB_EXPORT(int) +rig_set_pltune_callback HAMLIB_PARAMS((RIG *, + pltune_cb_t, + rig_ptr_t)); + +extern HAMLIB_EXPORT(int) +rig_set_spectrum_callback HAMLIB_PARAMS((RIG *, + spectrum_cb_t, + rig_ptr_t)); + +extern HAMLIB_EXPORT(int) +rig_set_twiddle HAMLIB_PARAMS((RIG *rig, + int seconds)); + +extern HAMLIB_EXPORT(int) +rig_get_twiddle HAMLIB_PARAMS((RIG *rig, + int *seconds)); + +extern HAMLIB_EXPORT(int) +rig_set_uplink HAMLIB_PARAMS((RIG *rig, + int val)); + +extern HAMLIB_EXPORT(const char *) +rig_get_info HAMLIB_PARAMS((RIG *rig)); + +extern HAMLIB_EXPORT(const struct rig_caps *) +rig_get_caps HAMLIB_PARAMS((rig_model_t rig_model)); + +extern HAMLIB_EXPORT(const freq_range_t *) +rig_get_range HAMLIB_PARAMS((const freq_range_t *range_list, + freq_t freq, + rmode_t mode)); + +extern HAMLIB_EXPORT(pbwidth_t) +rig_passband_normal HAMLIB_PARAMS((RIG *rig, + rmode_t mode)); +extern HAMLIB_EXPORT(pbwidth_t) +rig_passband_narrow HAMLIB_PARAMS((RIG *rig, + rmode_t mode)); +extern HAMLIB_EXPORT(pbwidth_t) +rig_passband_wide HAMLIB_PARAMS((RIG *rig, + rmode_t mode)); + +extern HAMLIB_EXPORT(const char *) +rigerror HAMLIB_PARAMS((int errnum)); + +extern HAMLIB_EXPORT(int) +rig_setting2idx HAMLIB_PARAMS((setting_t s)); + +extern HAMLIB_EXPORT(setting_t) +rig_idx2setting(int i); +/* + * Even if these functions are prefixed with "rig_", they are not rig specific + * Maybe "hamlib_" would have been better. Let me know. --SF + */ +extern HAMLIB_EXPORT(void) +rig_set_debug HAMLIB_PARAMS((enum rig_debug_level_e debug_level)); + +extern HAMLIB_EXPORT(void) +rig_set_debug_time_stamp HAMLIB_PARAMS((int flag)); + +#define rig_set_debug_level(level) rig_set_debug(level) + +extern HAMLIB_EXPORT(int) +rig_need_debug HAMLIB_PARAMS((enum rig_debug_level_e debug_level)); + + +// this need to be fairly big to avoid compiler warnings +#define DEBUGMSGSAVE_SIZE 24000 +extern HAMLIB_EXPORT_VAR(char) debugmsgsave[DEBUGMSGSAVE_SIZE]; // last debug msg +extern HAMLIB_EXPORT_VAR(char) debugmsgsave2[DEBUGMSGSAVE_SIZE]; // last-1 debug msg +extern HAMLIB_EXPORT_VAR(char) debugmsgsave3[DEBUGMSGSAVE_SIZE]; // last-2 debug msg +#ifndef __cplusplus +#ifdef __GNUC__ +// doing the debug macro with a dummy sprintf allows gcc to check the format string +#define rig_debug(debug_level,fmt,...) do { strncpy(debugmsgsave3, debugmsgsave2,sizeof(debugmsgsave3));strncpy(debugmsgsave2, debugmsgsave, sizeof(debugmsgsave2));snprintf(debugmsgsave,sizeof(debugmsgsave),fmt,__VA_ARGS__);rig_debug(debug_level,fmt,##__VA_ARGS__); } while(0); +#endif +#endif +extern HAMLIB_EXPORT(void) +rig_debug HAMLIB_PARAMS((enum rig_debug_level_e debug_level, + const char *fmt, ...)); + +extern HAMLIB_EXPORT(vprintf_cb_t) +rig_set_debug_callback HAMLIB_PARAMS((vprintf_cb_t cb, + rig_ptr_t arg)); + +extern HAMLIB_EXPORT(FILE *) +rig_set_debug_file HAMLIB_PARAMS((FILE *stream)); + +extern HAMLIB_EXPORT(int) +rig_register HAMLIB_PARAMS((const struct rig_caps *caps)); + +extern HAMLIB_EXPORT(int) +rig_unregister HAMLIB_PARAMS((rig_model_t rig_model)); + +extern HAMLIB_EXPORT(int) +rig_list_foreach HAMLIB_PARAMS((int (*cfunc)(const struct rig_caps *, rig_ptr_t), + rig_ptr_t data)); + +extern HAMLIB_EXPORT(int) +rig_list_foreach_model HAMLIB_PARAMS((int (*cfunc)(const rig_model_t rig_model, rig_ptr_t), + rig_ptr_t data)); + +extern HAMLIB_EXPORT(int) +rig_load_backend HAMLIB_PARAMS((const char *be_name)); + +extern HAMLIB_EXPORT(int) +rig_check_backend HAMLIB_PARAMS((rig_model_t rig_model)); + +extern HAMLIB_EXPORT(int) +rig_load_all_backends HAMLIB_PARAMS((void)); + +typedef int (*rig_probe_func_t)(const hamlib_port_t *, rig_model_t, rig_ptr_t); + +extern HAMLIB_EXPORT(int) +rig_probe_all HAMLIB_PARAMS((hamlib_port_t *p, + rig_probe_func_t, + rig_ptr_t)); + +extern HAMLIB_EXPORT(rig_model_t) +rig_probe HAMLIB_PARAMS((hamlib_port_t *p)); + + +/* Misc calls */ +extern HAMLIB_EXPORT(const char *) rig_strrmode(rmode_t mode); +extern HAMLIB_EXPORT(int) rig_strrmodes(rmode_t modes, char *buf, int buflen); +extern HAMLIB_EXPORT(const char *) rig_strvfo(vfo_t vfo); +extern HAMLIB_EXPORT(const char *) rig_strfunc(setting_t); +extern HAMLIB_EXPORT(const char *) rig_strlevel(setting_t); +extern HAMLIB_EXPORT(const char *) rig_strparm(setting_t); +extern HAMLIB_EXPORT(const char *) rig_stragclevel(enum agc_level_e level); +extern HAMLIB_EXPORT(const char *) rig_strptrshift(rptr_shift_t); +extern HAMLIB_EXPORT(const char *) rig_strvfop(vfo_op_t op); +extern HAMLIB_EXPORT(const char *) rig_strscan(scan_t scan); +extern HAMLIB_EXPORT(const char *) rig_strstatus(enum rig_status_e status); +extern HAMLIB_EXPORT(const char *) rig_strmtype(chan_type_t mtype); +extern HAMLIB_EXPORT(const char *) rig_strspectrummode(enum rig_spectrum_mode_e mode); + +extern HAMLIB_EXPORT(rmode_t) rig_parse_mode(const char *s); +extern HAMLIB_EXPORT(vfo_t) rig_parse_vfo(const char *s); +extern HAMLIB_EXPORT(setting_t) rig_parse_func(const char *s); +extern HAMLIB_EXPORT(setting_t) rig_parse_level(const char *s); +extern HAMLIB_EXPORT(setting_t) rig_parse_parm(const char *s); +extern HAMLIB_EXPORT(vfo_op_t) rig_parse_vfo_op(const char *s); +extern HAMLIB_EXPORT(scan_t) rig_parse_scan(const char *s); +extern HAMLIB_EXPORT(rptr_shift_t) rig_parse_rptr_shift(const char *s); +extern HAMLIB_EXPORT(chan_type_t) rig_parse_mtype(const char *s); + +extern HAMLIB_EXPORT(const char *) rig_license HAMLIB_PARAMS(()); +extern HAMLIB_EXPORT(const char *) rig_version HAMLIB_PARAMS(()); +extern HAMLIB_EXPORT(const char *) rig_copyright HAMLIB_PARAMS(()); + +extern HAMLIB_EXPORT(void) rig_no_restore_ai(); + +extern HAMLIB_EXPORT(int) rig_get_cache_timeout_ms(RIG *rig, hamlib_cache_t selection); +extern HAMLIB_EXPORT(int) rig_set_cache_timeout_ms(RIG *rig, hamlib_cache_t selection, int ms); + +extern HAMLIB_EXPORT(int) rig_set_vfo_opt(RIG *rig, int status); +extern HAMLIB_EXPORT(int) rig_get_vfo_info(RIG *rig, vfo_t vfo, freq_t *freq, rmode_t *mode, pbwidth_t *width, split_t *split, int *satmode); +extern HAMLIB_EXPORT(int) rig_get_rig_info(RIG *rig, char *response, int max_response_len); +extern HAMLIB_EXPORT(int) rig_get_cache(RIG *rig, vfo_t vfo, freq_t *freq, int * cache_ms_freq, rmode_t *mode, int *cache_ms_mode, pbwidth_t *width, int *cache_ms_width); + +extern HAMLIB_EXPORT(int) rig_set_clock(RIG *rig, int year, int month, int day, int hour, int min, int sec, double msec, int utc_offset); +extern HAMLIB_EXPORT(int) rig_get_clock(RIG *rig, int *year, int *month, int *day, int *hour, int *min, int *sec, double *msec, int *utc_offset); + +typedef unsigned long rig_useconds_t; +extern HAMLIB_EXPORT(int) hl_usleep(rig_useconds_t msec); + +extern HAMLIB_EXPORT(int) rig_cookie(RIG *rig, enum cookie_e cookie_cmd, char *cookie, int cookie_len); + +//! @endcond + +__END_DECLS + +#endif /* _RIG_H */ + +/*! @} */ diff --git a/hamlib/rig_dll.h b/hamlib/rig_dll.h new file mode 100644 index 0000000..3a78801 --- /dev/null +++ b/hamlib/rig_dll.h @@ -0,0 +1,90 @@ +/* + * Hamlib Win32 DLL build definitions + * Copyright (c) 2001-2009 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 + * + */ + +/* + * Provide definitions to compile in Windows + * using C-friendly options, e.g. + * + * HAMLIB_API -> __cdecl + * HAMLIB_EXPORT, HAMLIB_EXPORT_VAR -> __declspec(dllexport) + * BACKEND_EXPORT, BACKEND_EXPORT_VAR -> __declspec(dllexport) + * + * No effect in non-Windows environments. + */ + +#if defined(_WIN32) && !defined(__CYGWIN__) +# undef HAMLIB_IMPEXP +# undef HAMLIB_CPP_IMPEXP +# undef HAMLIB_API +# undef HAMLIB_EXPORT +# undef HAMLIB_EXPORT_VAR +# undef BACKEND_EXPORT +# undef BACKEND_EXPORT_VAR +# undef HAMLIB_DLL_IMPORT +# undef HAMLIB_DLL_EXPORT + +# if defined (__BORLANDC__) +# define HAMLIB_DLL_IMPORT __import +# define HAMLIB_DLL_EXPORT __export +# else +# define HAMLIB_DLL_IMPORT __declspec(dllimport) +# define HAMLIB_DLL_EXPORT __declspec(dllexport) +# endif + +# ifdef DLL_EXPORT +/* HAMLIB_API may be set to __stdcall for VB, .. */ +# define HAMLIB_API __cdecl +# ifdef IN_HAMLIB +# define HAMLIB_CPP_IMPEXP HAMLIB_DLL_EXPORT +# define HAMLIB_IMPEXP HAMLIB_DLL_EXPORT +# else +# define HAMLIB_CPP_IMPEXP HAMLIB_DLL_IMPORT +# define HAMLIB_IMPEXP HAMLIB_DLL_IMPORT +# endif +# else +/* static build, only export the backend entry points for lt_dlsym */ +# define HAMLIB_CPP_IMPEXP HAMLIB_DLL_EXPORT +# endif +#endif + + +/* Take care of non-cygwin platforms */ +#if !defined(HAMLIB_IMPEXP) +# define HAMLIB_IMPEXP +#endif +#if !defined(HAMLIB_CPP_IMPEXP) +# define HAMLIB_CPP_IMPEXP +#endif +#if !defined(HAMLIB_API) +# define HAMLIB_API +#endif +#if !defined(HAMLIB_EXPORT) +# define HAMLIB_EXPORT(type) HAMLIB_IMPEXP type HAMLIB_API +#endif +#if !defined(HAMLIB_EXPORT_VAR) +# define HAMLIB_EXPORT_VAR(type) HAMLIB_IMPEXP type +#endif +#if !defined(BACKEND_EXPORT) +# define BACKEND_EXPORT(type) HAMLIB_CPP_IMPEXP type HAMLIB_API +#endif +#if !defined(BACKEND_EXPORT_VAR) +# define BACKEND_EXPORT_VAR(type) HAMLIB_CPP_IMPEXP type +#endif diff --git a/hamlib/riglist.h b/hamlib/riglist.h new file mode 100644 index 0000000..aeadfac --- /dev/null +++ b/hamlib/riglist.h @@ -0,0 +1,662 @@ +/* + * Hamlib Interface - list of known rigs + * Copyright (c) 2000-2003 by Frank Singleton + * Copyright (c) 2000-2015 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 _RIGLIST_H +#define _RIGLIST_H 1 + +//! @cond Doxygen_Suppress + +// The rig model number is designed to fit in a 32-bit int +// As of 2020-02-18 we have 33 backends defined +// With a max of 1000 models per backend we get total a model number range of 1001-33001 +// This MAX was 100 prior to 2020-02-18 and Icom was close to running out of the 100 range +#define MAX_MODELS_PER_BACKEND 1000 +#define RIG_MAKE_MODEL(a,b) ((a)*MAX_MODELS_PER_BACKEND+(b)) +#define RIG_BACKEND_NUM(a) ((a)/MAX_MODELS_PER_BACKEND) + +/*! \file riglist.h + * \brief Hamlib rig(radio) model definitions. + * + * This file contains rig model definitions for the Hamlib rig API. Each + * distinct rig type has a unique model number (ID) and is used by hamlib to + * identify and distinguish between the different hardware drivers. The + * exact model numbers can be acquired using the macros in this file. To + * obtain a list of supported rig branches, one can use the statically + * defined RIG_BACKEND_LIST macro. To obtain a full list of supported rig + * (including each model in every branch), the foreach_opened_rig() API + * function can be used. + * + * The model number, or ID, is used to tell hamlib, which rig the client + * whishes to use. It is done with the rig_init() API call. + */ + +#define RIG_MODEL_NONE 0 + +/*! \def RIG_MODEL_DUMMY + * \brief A macro that returns the model number for the dummy backend. + * + * The dummy backend, as the name suggests, is a backend which performs no + * hardware operations and always behaves as one would expect. It can be + * thought of as a hardware simulator and is very useful for testing client + * applications. + * + * It has also been expanded to provide support to "virtual" type of rigs + * such as the network rig control backend and W1HKJ's Flrig application. + */ +#define RIG_DUMMY 0 +#define RIG_BACKEND_DUMMY "dummy" +#define RIG_MODEL_DUMMY RIG_MAKE_MODEL(RIG_DUMMY, 1) +#define RIG_MODEL_NETRIGCTL RIG_MAKE_MODEL(RIG_DUMMY, 2) +#define RIG_MODEL_ARMSTRONG RIG_MAKE_MODEL(RIG_DUMMY, 3) +#define RIG_MODEL_FLRIG RIG_MAKE_MODEL(RIG_DUMMY, 4) +#define RIG_MODEL_TRXMANAGER_RIG RIG_MAKE_MODEL(RIG_DUMMY, 5) +#define RIG_MODEL_DUMMY_NOVFO RIG_MAKE_MODEL(RIG_DUMMY, 6) +#define RIG_MODEL_TCI1X RIG_MAKE_MODEL(RIG_DUMMY, 7) + + +/* + * Yaesu + */ +#define RIG_YAESU 1 +#define RIG_BACKEND_YAESU "yaesu" +#define RIG_MODEL_FT847 RIG_MAKE_MODEL(RIG_YAESU, 1) +#define RIG_MODEL_FT1000 RIG_MAKE_MODEL(RIG_YAESU, 2) +#define RIG_MODEL_FT1000D RIG_MAKE_MODEL(RIG_YAESU, 3) +#define RIG_MODEL_FT1000MPMKV RIG_MAKE_MODEL(RIG_YAESU, 4) +#define RIG_MODEL_FT747 RIG_MAKE_MODEL(RIG_YAESU, 5) +#define RIG_MODEL_FT757 RIG_MAKE_MODEL(RIG_YAESU, 6) +#define RIG_MODEL_FT757GXII RIG_MAKE_MODEL(RIG_YAESU, 7) +#define RIG_MODEL_FT575 RIG_MAKE_MODEL(RIG_YAESU, 8) +#define RIG_MODEL_FT767 RIG_MAKE_MODEL(RIG_YAESU, 9) +#define RIG_MODEL_FT736R RIG_MAKE_MODEL(RIG_YAESU, 10) +#define RIG_MODEL_FT840 RIG_MAKE_MODEL(RIG_YAESU, 11) +#define RIG_MODEL_FT820 RIG_MAKE_MODEL(RIG_YAESU, 12) +#define RIG_MODEL_FT900 RIG_MAKE_MODEL(RIG_YAESU, 13) +#define RIG_MODEL_FT920 RIG_MAKE_MODEL(RIG_YAESU, 14) +#define RIG_MODEL_FT890 RIG_MAKE_MODEL(RIG_YAESU, 15) +#define RIG_MODEL_FT990 RIG_MAKE_MODEL(RIG_YAESU, 16) +#define RIG_MODEL_FRG100 RIG_MAKE_MODEL(RIG_YAESU, 17) +#define RIG_MODEL_FRG9600 RIG_MAKE_MODEL(RIG_YAESU, 18) +#define RIG_MODEL_FRG8800 RIG_MAKE_MODEL(RIG_YAESU, 19) +#define RIG_MODEL_FT817 RIG_MAKE_MODEL(RIG_YAESU, 20) +#define RIG_MODEL_FT100 RIG_MAKE_MODEL(RIG_YAESU, 21) +#define RIG_MODEL_FT857 RIG_MAKE_MODEL(RIG_YAESU, 22) +#define RIG_MODEL_FT897 RIG_MAKE_MODEL(RIG_YAESU, 23) +#define RIG_MODEL_FT1000MP RIG_MAKE_MODEL(RIG_YAESU, 24) +#define RIG_MODEL_FT1000MPMKVFLD RIG_MAKE_MODEL(RIG_YAESU, 25) +#define RIG_MODEL_VR5000 RIG_MAKE_MODEL(RIG_YAESU, 26) +#define RIG_MODEL_FT450 RIG_MAKE_MODEL(RIG_YAESU, 27) +#define RIG_MODEL_FT950 RIG_MAKE_MODEL(RIG_YAESU, 28) +#define RIG_MODEL_FT2000 RIG_MAKE_MODEL(RIG_YAESU, 29) +#define RIG_MODEL_FT9000 RIG_MAKE_MODEL(RIG_YAESU, 30) +#define RIG_MODEL_FT980 RIG_MAKE_MODEL(RIG_YAESU, 31) +#define RIG_MODEL_FTDX5000 RIG_MAKE_MODEL(RIG_YAESU, 32) +#define RIG_MODEL_VX1700 RIG_MAKE_MODEL(RIG_YAESU, 33) +#define RIG_MODEL_FTDX1200 RIG_MAKE_MODEL(RIG_YAESU, 34) +#define RIG_MODEL_FT991 RIG_MAKE_MODEL(RIG_YAESU, 35) +#define RIG_MODEL_FT891 RIG_MAKE_MODEL(RIG_YAESU, 36) +#define RIG_MODEL_FTDX3000 RIG_MAKE_MODEL(RIG_YAESU, 37) +#define RIG_MODEL_FT847UNI RIG_MAKE_MODEL(RIG_YAESU, 38) +#define RIG_MODEL_FT600 RIG_MAKE_MODEL(RIG_YAESU, 39) +#define RIG_MODEL_FTDX101D RIG_MAKE_MODEL(RIG_YAESU, 40) +#define RIG_MODEL_FT818 RIG_MAKE_MODEL(RIG_YAESU, 41) +#define RIG_MODEL_FTDX10 RIG_MAKE_MODEL(RIG_YAESU, 42) +#define RIG_MODEL_FT897D RIG_MAKE_MODEL(RIG_YAESU, 43) +#define RIG_MODEL_FTDX101MP RIG_MAKE_MODEL(RIG_YAESU, 44) +#define RIG_MODEL_MCHFQRP RIG_MAKE_MODEL(RIG_YAESU, 45) + + +/* + * Kenwood + */ +#define RIG_KENWOOD 2 +#define RIG_BACKEND_KENWOOD "kenwood" +#define RIG_MODEL_TS50 RIG_MAKE_MODEL(RIG_KENWOOD, 1) +#define RIG_MODEL_TS440 RIG_MAKE_MODEL(RIG_KENWOOD, 2) +#define RIG_MODEL_TS450S RIG_MAKE_MODEL(RIG_KENWOOD, 3) +#define RIG_MODEL_TS570D RIG_MAKE_MODEL(RIG_KENWOOD, 4) +#define RIG_MODEL_TS690S RIG_MAKE_MODEL(RIG_KENWOOD, 5) +#define RIG_MODEL_TS711 RIG_MAKE_MODEL(RIG_KENWOOD, 6) +#define RIG_MODEL_TS790 RIG_MAKE_MODEL(RIG_KENWOOD, 7) +#define RIG_MODEL_TS811 RIG_MAKE_MODEL(RIG_KENWOOD, 8) +#define RIG_MODEL_TS850 RIG_MAKE_MODEL(RIG_KENWOOD, 9) +#define RIG_MODEL_TS870S RIG_MAKE_MODEL(RIG_KENWOOD, 10) +#define RIG_MODEL_TS940 RIG_MAKE_MODEL(RIG_KENWOOD, 11) +#define RIG_MODEL_TS950S RIG_MAKE_MODEL(RIG_KENWOOD, 12) +#define RIG_MODEL_TS950SDX RIG_MAKE_MODEL(RIG_KENWOOD, 13) +#define RIG_MODEL_TS2000 RIG_MAKE_MODEL(RIG_KENWOOD, 14) +#define RIG_MODEL_R5000 RIG_MAKE_MODEL(RIG_KENWOOD, 15) +#define RIG_MODEL_TS570S RIG_MAKE_MODEL(RIG_KENWOOD, 16) +#define RIG_MODEL_THD7A RIG_MAKE_MODEL(RIG_KENWOOD, 17) +#define RIG_MODEL_THD7AG RIG_MAKE_MODEL(RIG_KENWOOD, 18) +#define RIG_MODEL_THF6A RIG_MAKE_MODEL(RIG_KENWOOD, 19) +#define RIG_MODEL_THF7E RIG_MAKE_MODEL(RIG_KENWOOD, 20) +#define RIG_MODEL_K2 RIG_MAKE_MODEL(RIG_KENWOOD, 21) +#define RIG_MODEL_TS930 RIG_MAKE_MODEL(RIG_KENWOOD, 22) +#define RIG_MODEL_THG71 RIG_MAKE_MODEL(RIG_KENWOOD, 23) +#define RIG_MODEL_TS680S RIG_MAKE_MODEL(RIG_KENWOOD, 24) +#define RIG_MODEL_TS140S RIG_MAKE_MODEL(RIG_KENWOOD, 25) +#define RIG_MODEL_TMD700 RIG_MAKE_MODEL(RIG_KENWOOD, 26) +#define RIG_MODEL_TMV7 RIG_MAKE_MODEL(RIG_KENWOOD, 27) +#define RIG_MODEL_TS480 RIG_MAKE_MODEL(RIG_KENWOOD, 28) +#define RIG_MODEL_K3 RIG_MAKE_MODEL(RIG_KENWOOD, 29) +#define RIG_MODEL_TRC80 RIG_MAKE_MODEL(RIG_KENWOOD, 30) +#define RIG_MODEL_TS590S RIG_MAKE_MODEL(RIG_KENWOOD, 31) +#define RIG_MODEL_TRANSFOX RIG_MAKE_MODEL(RIG_KENWOOD, 32) /* SigFox Transfox */ +#define RIG_MODEL_THD72A RIG_MAKE_MODEL(RIG_KENWOOD, 33) +#define RIG_MODEL_TMD710 RIG_MAKE_MODEL(RIG_KENWOOD, 34) +#define RIG_MODEL_TMV71 RIG_MAKE_MODEL(RIG_KENWOOD, 35) +#define RIG_MODEL_F6K RIG_MAKE_MODEL(RIG_KENWOOD, 36) /* Flex 6000 Series */ +#define RIG_MODEL_TS590SG RIG_MAKE_MODEL(RIG_KENWOOD, 37) +#define RIG_MODEL_XG3 RIG_MAKE_MODEL(RIG_KENWOOD, 38) /* Elecraft XG-3 signal generator */ +#define RIG_MODEL_TS990S RIG_MAKE_MODEL(RIG_KENWOOD, 39) +#define RIG_MODEL_HPSDR RIG_MAKE_MODEL(RIG_KENWOOD, 40) /* OpenHPSDR, PiHPSDR */ +#define RIG_MODEL_TS890S RIG_MAKE_MODEL(RIG_KENWOOD, 41) +#define RIG_MODEL_THD74 RIG_MAKE_MODEL(RIG_KENWOOD, 42) +#define RIG_MODEL_K3S RIG_MAKE_MODEL(RIG_KENWOOD, 43) +#define RIG_MODEL_KX2 RIG_MAKE_MODEL(RIG_KENWOOD, 44) +#define RIG_MODEL_KX3 RIG_MAKE_MODEL(RIG_KENWOOD, 45) +#define RIG_MODEL_PT8000A RIG_MAKE_MODEL(RIG_KENWOOD, 46) +#define RIG_MODEL_K4 RIG_MAKE_MODEL(RIG_KENWOOD, 47) +#define RIG_MODEL_POWERSDR RIG_MAKE_MODEL(RIG_KENWOOD, 48) +#define RIG_MODEL_MALACHITE RIG_MAKE_MODEL(RIG_KENWOOD, 49) + +/* + * Icom + */ +#define RIG_ICOM 3 +#define RIG_BACKEND_ICOM "icom" +#define RIG_MODEL_IC1271 RIG_MAKE_MODEL(RIG_ICOM, 1) +#define RIG_MODEL_IC1275 RIG_MAKE_MODEL(RIG_ICOM, 2) +#define RIG_MODEL_IC271 RIG_MAKE_MODEL(RIG_ICOM, 3) +#define RIG_MODEL_IC275 RIG_MAKE_MODEL(RIG_ICOM, 4) +#define RIG_MODEL_IC375 RIG_MAKE_MODEL(RIG_ICOM, 5) +#define RIG_MODEL_IC471 RIG_MAKE_MODEL(RIG_ICOM, 6) +#define RIG_MODEL_IC475 RIG_MAKE_MODEL(RIG_ICOM, 7) +#define RIG_MODEL_IC575 RIG_MAKE_MODEL(RIG_ICOM, 8) +#define RIG_MODEL_IC706 RIG_MAKE_MODEL(RIG_ICOM, 9) +#define RIG_MODEL_IC706MKII RIG_MAKE_MODEL(RIG_ICOM, 10) +#define RIG_MODEL_IC706MKIIG RIG_MAKE_MODEL(RIG_ICOM, 11) +#define RIG_MODEL_IC707 RIG_MAKE_MODEL(RIG_ICOM, 12) +#define RIG_MODEL_IC718 RIG_MAKE_MODEL(RIG_ICOM, 13) +#define RIG_MODEL_IC725 RIG_MAKE_MODEL(RIG_ICOM, 14) +#define RIG_MODEL_IC726 RIG_MAKE_MODEL(RIG_ICOM, 15) +#define RIG_MODEL_IC728 RIG_MAKE_MODEL(RIG_ICOM, 16) +#define RIG_MODEL_IC729 RIG_MAKE_MODEL(RIG_ICOM, 17) +#define RIG_MODEL_IC731 RIG_MAKE_MODEL(RIG_ICOM, 18) +#define RIG_MODEL_IC735 RIG_MAKE_MODEL(RIG_ICOM, 19) +#define RIG_MODEL_IC736 RIG_MAKE_MODEL(RIG_ICOM, 20) +#define RIG_MODEL_IC737 RIG_MAKE_MODEL(RIG_ICOM, 21) +#define RIG_MODEL_IC738 RIG_MAKE_MODEL(RIG_ICOM, 22) +#define RIG_MODEL_IC746 RIG_MAKE_MODEL(RIG_ICOM, 23) +#define RIG_MODEL_IC751 RIG_MAKE_MODEL(RIG_ICOM, 24) +#define RIG_MODEL_IC751A RIG_MAKE_MODEL(RIG_ICOM, 25) +#define RIG_MODEL_IC756 RIG_MAKE_MODEL(RIG_ICOM, 26) +#define RIG_MODEL_IC756PRO RIG_MAKE_MODEL(RIG_ICOM, 27) +#define RIG_MODEL_IC761 RIG_MAKE_MODEL(RIG_ICOM, 28) +#define RIG_MODEL_IC765 RIG_MAKE_MODEL(RIG_ICOM, 29) +#define RIG_MODEL_IC775 RIG_MAKE_MODEL(RIG_ICOM, 30) +#define RIG_MODEL_IC781 RIG_MAKE_MODEL(RIG_ICOM, 31) +#define RIG_MODEL_IC820 RIG_MAKE_MODEL(RIG_ICOM, 32) +//#define RIG_MODEL_IC821 RIG_MAKE_MODEL(RIG_ICOM, 33) // not implemented and can be reused +#define RIG_MODEL_IC821H RIG_MAKE_MODEL(RIG_ICOM, 34) +#define RIG_MODEL_IC970 RIG_MAKE_MODEL(RIG_ICOM, 35) +#define RIG_MODEL_ICR10 RIG_MAKE_MODEL(RIG_ICOM, 36) +#define RIG_MODEL_ICR71 RIG_MAKE_MODEL(RIG_ICOM, 37) +#define RIG_MODEL_ICR72 RIG_MAKE_MODEL(RIG_ICOM, 38) +#define RIG_MODEL_ICR75 RIG_MAKE_MODEL(RIG_ICOM, 39) +#define RIG_MODEL_ICR7000 RIG_MAKE_MODEL(RIG_ICOM, 40) +#define RIG_MODEL_ICR7100 RIG_MAKE_MODEL(RIG_ICOM, 41) +#define RIG_MODEL_ICR8500 RIG_MAKE_MODEL(RIG_ICOM, 42) +#define RIG_MODEL_ICR9000 RIG_MAKE_MODEL(RIG_ICOM, 43) +#define RIG_MODEL_IC910 RIG_MAKE_MODEL(RIG_ICOM, 44) +#define RIG_MODEL_IC78 RIG_MAKE_MODEL(RIG_ICOM, 45) +#define RIG_MODEL_IC746PRO RIG_MAKE_MODEL(RIG_ICOM, 46) +#define RIG_MODEL_IC756PROII RIG_MAKE_MODEL(RIG_ICOM, 47) /* 48-53 defined below */ +#define RIG_MODEL_ICID1 RIG_MAKE_MODEL(RIG_ICOM, 54) +#define RIG_MODEL_IC703 RIG_MAKE_MODEL(RIG_ICOM, 55) +#define RIG_MODEL_IC7800 RIG_MAKE_MODEL(RIG_ICOM, 56) +#define RIG_MODEL_IC756PROIII RIG_MAKE_MODEL(RIG_ICOM, 57) +#define RIG_MODEL_ICR20 RIG_MAKE_MODEL(RIG_ICOM, 58) /* 59 defined below */ +#define RIG_MODEL_IC7000 RIG_MAKE_MODEL(RIG_ICOM, 60) +#define RIG_MODEL_IC7200 RIG_MAKE_MODEL(RIG_ICOM, 61) +#define RIG_MODEL_IC7700 RIG_MAKE_MODEL(RIG_ICOM, 62) +#define RIG_MODEL_IC7600 RIG_MAKE_MODEL(RIG_ICOM, 63) /* 64 defined below */ +#define RIG_MODEL_IC92D RIG_MAKE_MODEL(RIG_ICOM, 65) +#define RIG_MODEL_ICR9500 RIG_MAKE_MODEL(RIG_ICOM, 66) +#define RIG_MODEL_IC7410 RIG_MAKE_MODEL(RIG_ICOM, 67) +#define RIG_MODEL_IC9100 RIG_MAKE_MODEL(RIG_ICOM, 68) +#define RIG_MODEL_ICRX7 RIG_MAKE_MODEL(RIG_ICOM, 69) +#define RIG_MODEL_IC7100 RIG_MAKE_MODEL(RIG_ICOM, 70) +#define RIG_MODEL_ID5100 RIG_MAKE_MODEL(RIG_ICOM, 71) +#define RIG_MODEL_IC2730 RIG_MAKE_MODEL(RIG_ICOM, 72) +#define RIG_MODEL_IC7300 RIG_MAKE_MODEL(RIG_ICOM, 73) +#define RIG_MODEL_PERSEUS RIG_MAKE_MODEL(RIG_ICOM, 74) +#define RIG_MODEL_IC785x RIG_MAKE_MODEL(RIG_ICOM, 75) +#define RIG_MODEL_X108G RIG_MAKE_MODEL(RIG_ICOM, 76) /* Xiegu X108 */ +#define RIG_MODEL_ICR6 RIG_MAKE_MODEL(RIG_ICOM, 77) +#define RIG_MODEL_IC7610 RIG_MAKE_MODEL(RIG_ICOM, 78) +#define RIG_MODEL_ICR8600 RIG_MAKE_MODEL(RIG_ICOM, 79) +#define RIG_MODEL_ICR30 RIG_MAKE_MODEL(RIG_ICOM, 80) +#define RIG_MODEL_IC9700 RIG_MAKE_MODEL(RIG_ICOM, 81) +#define RIG_MODEL_ID4100 RIG_MAKE_MODEL(RIG_ICOM, 82) +#define RIG_MODEL_ID31 RIG_MAKE_MODEL(RIG_ICOM, 83) +#define RIG_MODEL_ID51 RIG_MAKE_MODEL(RIG_ICOM, 84) +#define RIG_MODEL_IC705 RIG_MAKE_MODEL(RIG_ICOM, 85) +/* next one is 86 */ + + +/* + * Optoelectronics (CI-V) + */ +#define RIG_MODEL_MINISCOUT RIG_MAKE_MODEL(RIG_ICOM, 48) +#define RIG_MODEL_XPLORER RIG_MAKE_MODEL(RIG_ICOM, 49) +#define RIG_MODEL_OS535 RIG_MAKE_MODEL(RIG_ICOM, 52) +#define RIG_MODEL_OS456 RIG_MAKE_MODEL(RIG_ICOM, 53) + + +/* + * TenTec (CI-V) + */ +#define RIG_MODEL_OMNIVI RIG_MAKE_MODEL(RIG_ICOM, 50) +#define RIG_MODEL_OMNIVIP RIG_MAKE_MODEL(RIG_ICOM, 51) /* OMNI-VI+ */ +#define RIG_MODEL_PARAGON2 RIG_MAKE_MODEL(RIG_ICOM, 59) +#define RIG_MODEL_DELTAII RIG_MAKE_MODEL(RIG_ICOM, 64) + + +/* + * Icom PCR + */ +#define RIG_PCR 4 +#define RIG_BACKEND_PCR "pcr" +#define RIG_MODEL_PCR1000 RIG_MAKE_MODEL(RIG_PCR, 1) +#define RIG_MODEL_PCR100 RIG_MAKE_MODEL(RIG_PCR, 2) +#define RIG_MODEL_PCR1500 RIG_MAKE_MODEL(RIG_PCR, 3) +#define RIG_MODEL_PCR2500 RIG_MAKE_MODEL(RIG_PCR, 4) + + +/* + * AOR + */ +#define RIG_AOR 5 +#define RIG_BACKEND_AOR "aor" +#define RIG_MODEL_AR8200 RIG_MAKE_MODEL(RIG_AOR, 1) +#define RIG_MODEL_AR8000 RIG_MAKE_MODEL(RIG_AOR, 2) +#define RIG_MODEL_AR7030 RIG_MAKE_MODEL(RIG_AOR, 3) +#define RIG_MODEL_AR5000 RIG_MAKE_MODEL(RIG_AOR, 4) +#define RIG_MODEL_AR3030 RIG_MAKE_MODEL(RIG_AOR, 5) +#define RIG_MODEL_AR3000A RIG_MAKE_MODEL(RIG_AOR, 6) +#define RIG_MODEL_AR3000 RIG_MAKE_MODEL(RIG_AOR, 7) +#define RIG_MODEL_AR2700 RIG_MAKE_MODEL(RIG_AOR, 8) +#define RIG_MODEL_AR2500 RIG_MAKE_MODEL(RIG_AOR, 9) +#define RIG_MODEL_AR16 RIG_MAKE_MODEL(RIG_AOR, 10) +#define RIG_MODEL_SDU5500 RIG_MAKE_MODEL(RIG_AOR, 11) +#define RIG_MODEL_SDU5000 RIG_MAKE_MODEL(RIG_AOR, 12) +#define RIG_MODEL_AR8600 RIG_MAKE_MODEL(RIG_AOR, 13) +#define RIG_MODEL_AR5000A RIG_MAKE_MODEL(RIG_AOR, 14) +#define RIG_MODEL_AR7030P RIG_MAKE_MODEL(RIG_AOR, 15) +#define RIG_MODEL_SR2200 RIG_MAKE_MODEL(RIG_AOR, 16) + + +/* + * JRC + */ +#define RIG_JRC 6 +#define RIG_BACKEND_JRC "jrc" +#define RIG_MODEL_JST145 RIG_MAKE_MODEL(RIG_JRC, 1) +#define RIG_MODEL_JST245 RIG_MAKE_MODEL(RIG_JRC, 2) +#define RIG_MODEL_CMH530 RIG_MAKE_MODEL(RIG_JRC, 3) +#define RIG_MODEL_NRD345 RIG_MAKE_MODEL(RIG_JRC, 4) +#define RIG_MODEL_NRD525 RIG_MAKE_MODEL(RIG_JRC, 5) +#define RIG_MODEL_NRD535 RIG_MAKE_MODEL(RIG_JRC, 6) +#define RIG_MODEL_NRD545 RIG_MAKE_MODEL(RIG_JRC, 7) + + +/* + * Radio Shack + * Actually, they might be either Icom or Uniden. TBC --SF + */ +#define RIG_RADIOSHACK 7 +#define RIG_BACKEND_RADIOSHACK "radioshack" +#define RIG_MODEL_RS64 RIG_MAKE_MODEL(RIG_RADIOSHACK, 1) /* PRO-64 */ +#define RIG_MODEL_RS2005 RIG_MAKE_MODEL(RIG_RADIOSHACK, 2) /* w/ OptoElectronics OS456 Board */ +#define RIG_MODEL_RS2006 RIG_MAKE_MODEL(RIG_RADIOSHACK, 3) /* w/ OptoElectronics OS456 Board */ +#define RIG_MODEL_RS2035 RIG_MAKE_MODEL(RIG_RADIOSHACK, 4) /* w/ OptoElectronics OS435 Board */ +#define RIG_MODEL_RS2042 RIG_MAKE_MODEL(RIG_RADIOSHACK, 5) /* w/ OptoElectronics OS435 Board */ +#define RIG_MODEL_RS2041 RIG_MAKE_MODEL(RIG_RADIOSHACK, 6) /* PRO-2041 */ + + +/* + * Uniden + */ +#define RIG_UNIDEN 8 +#define RIG_BACKEND_UNIDEN "uniden" +#define RIG_MODEL_BC780 RIG_MAKE_MODEL(RIG_UNIDEN, 1) /* Uniden BC780 - Trunk Tracker "Desktop Radio" */ +#define RIG_MODEL_BC245 RIG_MAKE_MODEL(RIG_UNIDEN, 2) +#define RIG_MODEL_BC895 RIG_MAKE_MODEL(RIG_UNIDEN, 3) +#define RIG_MODEL_PRO2052 RIG_MAKE_MODEL(RIG_UNIDEN, 4) /* Radio Shack PRO-2052 */ +#define RIG_MODEL_BC235 RIG_MAKE_MODEL(RIG_UNIDEN, 5) +#define RIG_MODEL_BC250 RIG_MAKE_MODEL(RIG_UNIDEN, 6) +#define RIG_MODEL_BC785 RIG_MAKE_MODEL(RIG_UNIDEN, 7) +#define RIG_MODEL_BC786 RIG_MAKE_MODEL(RIG_UNIDEN, 8) +#define RIG_MODEL_BCT8 RIG_MAKE_MODEL(RIG_UNIDEN, 9) +#define RIG_MODEL_BCD396T RIG_MAKE_MODEL(RIG_UNIDEN, 10) +#define RIG_MODEL_BCD996T RIG_MAKE_MODEL(RIG_UNIDEN, 11) +#define RIG_MODEL_BC898 RIG_MAKE_MODEL(RIG_UNIDEN, 12) + + +/* + * Drake + */ +#define RIG_DRAKE 9 +#define RIG_BACKEND_DRAKE "drake" +#define RIG_MODEL_DKR8 RIG_MAKE_MODEL(RIG_DRAKE, 1) +#define RIG_MODEL_DKR8A RIG_MAKE_MODEL(RIG_DRAKE, 2) +#define RIG_MODEL_DKR8B RIG_MAKE_MODEL(RIG_DRAKE, 3) + + +/* + * Lowe + */ +#define RIG_LOWE 10 +#define RIG_BACKEND_LOWE "lowe" +#define RIG_MODEL_HF150 RIG_MAKE_MODEL(RIG_LOWE, 1) +#define RIG_MODEL_HF225 RIG_MAKE_MODEL(RIG_LOWE, 2) +#define RIG_MODEL_HF250 RIG_MAKE_MODEL(RIG_LOWE, 3) +#define RIG_MODEL_HF235 RIG_MAKE_MODEL(RIG_LOWE, 4) + + +/* + * Racal + */ +#define RIG_RACAL 11 +#define RIG_BACKEND_RACAL "racal" +#define RIG_MODEL_RA3790 RIG_MAKE_MODEL(RIG_RACAL, 1) +#define RIG_MODEL_RA3720 RIG_MAKE_MODEL(RIG_RACAL, 2) +#define RIG_MODEL_RA6790 RIG_MAKE_MODEL(RIG_RACAL, 3) +#define RIG_MODEL_RA3710 RIG_MAKE_MODEL(RIG_RACAL, 4) +#define RIG_MODEL_RA3702 RIG_MAKE_MODEL(RIG_RACAL, 5) + + +/* + * Watkins-Johnson + */ +#define RIG_WJ 12 +#define RIG_BACKEND_WJ "wj" +#define RIG_MODEL_HF1000 RIG_MAKE_MODEL(RIG_WJ, 1) +#define RIG_MODEL_HF1000A RIG_MAKE_MODEL(RIG_WJ, 2) +#define RIG_MODEL_WJ8711 RIG_MAKE_MODEL(RIG_WJ, 3) +#define RIG_MODEL_WJ8888 RIG_MAKE_MODEL(RIG_WJ, 4) + + +/* + * Rohde & Schwarz--ek + */ +#define RIG_EK 13 +#define RIG_BACKEND_EK "ek" +#define RIG_MODEL_ESM500 RIG_MAKE_MODEL(RIG_EK, 1) +#define RIG_MODEL_EK890 RIG_MAKE_MODEL(RIG_EK, 2) +#define RIG_MODEL_EK891 RIG_MAKE_MODEL(RIG_EK, 3) +#define RIG_MODEL_EK895 RIG_MAKE_MODEL(RIG_EK, 4) +#define RIG_MODEL_EK070 RIG_MAKE_MODEL(RIG_EK, 5) + + +/* + * Skanti + */ +#define RIG_SKANTI 14 +#define RIG_BACKEND_SKANTI "skanti" +#define RIG_MODEL_TRP7000 RIG_MAKE_MODEL(RIG_SKANTI, 1) +#define RIG_MODEL_TRP8000 RIG_MAKE_MODEL(RIG_SKANTI, 2) +#define RIG_MODEL_TRP9000 RIG_MAKE_MODEL(RIG_SKANTI, 3) +#define RIG_MODEL_TRP8255 RIG_MAKE_MODEL(RIG_SKANTI, 4) + + +/* + * WiNRADiO/LinRADiO + */ +#define RIG_WINRADIO 15 +#define RIG_BACKEND_WINRADIO "winradio" +#define RIG_MODEL_WR1000 RIG_MAKE_MODEL(RIG_WINRADIO, 1) +#define RIG_MODEL_WR1500 RIG_MAKE_MODEL(RIG_WINRADIO, 2) +#define RIG_MODEL_WR1550 RIG_MAKE_MODEL(RIG_WINRADIO, 3) +#define RIG_MODEL_WR3100 RIG_MAKE_MODEL(RIG_WINRADIO, 4) +#define RIG_MODEL_WR3150 RIG_MAKE_MODEL(RIG_WINRADIO, 5) +#define RIG_MODEL_WR3500 RIG_MAKE_MODEL(RIG_WINRADIO, 6) +#define RIG_MODEL_WR3700 RIG_MAKE_MODEL(RIG_WINRADIO, 7) +#define RIG_MODEL_G303 RIG_MAKE_MODEL(RIG_WINRADIO, 8) +#define RIG_MODEL_G313 RIG_MAKE_MODEL(RIG_WINRADIO, 9) +#define RIG_MODEL_G305 RIG_MAKE_MODEL(RIG_WINRADIO, 10) +#define RIG_MODEL_G315 RIG_MAKE_MODEL(RIG_WINRADIO, 11) + + +/* + * Ten Tec + */ +#define RIG_TENTEC 16 +#define RIG_BACKEND_TENTEC "tentec" +#define RIG_MODEL_TT550 RIG_MAKE_MODEL(RIG_TENTEC, 1) /* Pegasus */ +#define RIG_MODEL_TT538 RIG_MAKE_MODEL(RIG_TENTEC, 2) /* Jupiter */ +#define RIG_MODEL_RX320 RIG_MAKE_MODEL(RIG_TENTEC, 3) +#define RIG_MODEL_RX340 RIG_MAKE_MODEL(RIG_TENTEC, 4) +#define RIG_MODEL_RX350 RIG_MAKE_MODEL(RIG_TENTEC, 5) +#define RIG_MODEL_TT526 RIG_MAKE_MODEL(RIG_TENTEC, 6) /* 6N2 */ +#define RIG_MODEL_TT516 RIG_MAKE_MODEL(RIG_TENTEC, 7) /* Argonaut V */ +#define RIG_MODEL_TT565 RIG_MAKE_MODEL(RIG_TENTEC, 8) /* Orion */ +#define RIG_MODEL_TT585 RIG_MAKE_MODEL(RIG_TENTEC, 9) /* Paragon */ +#define RIG_MODEL_TT588 RIG_MAKE_MODEL(RIG_TENTEC, 11) /* Omni-VII */ +#define RIG_MODEL_RX331 RIG_MAKE_MODEL(RIG_TENTEC, 12) +#define RIG_MODEL_TT599 RIG_MAKE_MODEL(RIG_TENTEC, 13) /* Eagle */ + + +/* + * Alinco + */ +#define RIG_ALINCO 17 +#define RIG_BACKEND_ALINCO "alinco" +#define RIG_MODEL_DX77 RIG_MAKE_MODEL(RIG_ALINCO, 1) +#define RIG_MODEL_DXSR8 RIG_MAKE_MODEL(RIG_ALINCO, 2) + + +/* + * Kachina + */ +#define RIG_KACHINA 18 +#define RIG_BACKEND_KACHINA "kachina" +#define RIG_MODEL_505DSP RIG_MAKE_MODEL(RIG_KACHINA, 1) + + +/* + * Gnuradio backend + */ +#define RIG_GNURADIO 20 +#define RIG_BACKEND_GNURADIO "gnuradio" +#define RIG_MODEL_GNURADIO RIG_MAKE_MODEL(RIG_GNURADIO, 1) /* dev model, Chirp source */ +#define RIG_MODEL_MC4020 RIG_MAKE_MODEL(RIG_GNURADIO, 2) /* MC4020 */ +#define RIG_MODEL_GRAUDIO RIG_MAKE_MODEL(RIG_GNURADIO, 3) /* Sound card source */ +#define RIG_MODEL_GRAUDIOIQ RIG_MAKE_MODEL(RIG_GNURADIO, 4) /* I&Q stereo sound card source */ +#define RIG_MODEL_USRP_G RIG_MAKE_MODEL(RIG_GNURADIO, 5) /* Universal Software Radio Peripheral */ + + +/* + * Microtune tuners + */ +#define RIG_MICROTUNE 21 +#define RIG_BACKEND_MICROTUNE "microtune" +#define RIG_MODEL_MICROTUNE_4937 RIG_MAKE_MODEL(RIG_MICROTUNE, 1) /* eval board */ +#define RIG_MODEL_MICROTUNE_4702 RIG_MAKE_MODEL(RIG_MICROTUNE, 2) /* Alan's */ +#define RIG_MODEL_MICROTUNE_4707 RIG_MAKE_MODEL(RIG_MICROTUNE, 3) + + +/* + * TAPR + */ +#define RIG_TAPR 22 +#define RIG_BACKEND_TAPR "tapr" +#define RIG_MODEL_DSP10 RIG_MAKE_MODEL(RIG_TAPR, 1) + + +/* + * Flex-radio + */ +#define RIG_FLEXRADIO 23 +#define RIG_BACKEND_FLEXRADIO "flexradio" +#define RIG_MODEL_SDR1000 RIG_MAKE_MODEL(RIG_FLEXRADIO, 1) +#define RIG_MODEL_SDR1000RFE RIG_MAKE_MODEL(RIG_FLEXRADIO, 2) +#define RIG_MODEL_DTTSP RIG_MAKE_MODEL(RIG_FLEXRADIO, 3) +#define RIG_MODEL_DTTSP_UDP RIG_MAKE_MODEL(RIG_FLEXRADIO, 4) + + +/* + * VEB Funkwerk Köpenick RFT + */ +#define RIG_RFT 24 +#define RIG_BACKEND_RFT "rft" +#define RIG_MODEL_EKD500 RIG_MAKE_MODEL(RIG_RFT, 1) + + +/* + * Various kits + */ +#define RIG_KIT 25 +#define RIG_BACKEND_KIT "kit" +#define RIG_MODEL_ELEKTOR304 RIG_MAKE_MODEL(RIG_KIT, 1) +#define RIG_MODEL_DRT1 RIG_MAKE_MODEL(RIG_KIT, 2) +#define RIG_MODEL_DWT RIG_MAKE_MODEL(RIG_KIT, 3) +#define RIG_MODEL_USRP0 RIG_MAKE_MODEL(RIG_KIT, 4) /* prototype */ +#define RIG_MODEL_USRP RIG_MAKE_MODEL(RIG_KIT, 5) +#define RIG_MODEL_DDS60 RIG_MAKE_MODEL(RIG_KIT, 6) +#define RIG_MODEL_ELEKTOR507 RIG_MAKE_MODEL(RIG_KIT, 7) /* Elektor SDR USB */ +#define RIG_MODEL_MINIVNA RIG_MAKE_MODEL(RIG_KIT, 8) +#define RIG_MODEL_SI570AVRUSB RIG_MAKE_MODEL(RIG_KIT, 9) /* SoftRock Si570 AVR */ +#define RIG_MODEL_PMSDR RIG_MAKE_MODEL(RIG_KIT, 10) +#define RIG_MODEL_SI570PICUSB RIG_MAKE_MODEL(RIG_KIT, 11) /* SoftRock Si570 PIC */ +#define RIG_MODEL_FIFISDR RIG_MAKE_MODEL(RIG_KIT, 12) /* FiFi-SDR USB */ +#define RIG_MODEL_FUNCUBEDONGLE RIG_MAKE_MODEL(RIG_KIT, 13) /* FunCUBE Dongle */ +#define RIG_MODEL_HIQSDR RIG_MAKE_MODEL(RIG_KIT, 14) /* HiQSDR */ +#define RIG_MODEL_FASDR RIG_MAKE_MODEL(RIG_KIT,15) /* Funkamateur Sdr */ +#define RIG_MODEL_SI570PEABERRY1 RIG_MAKE_MODEL(RIG_KIT, 16) /* Peaberry V1 */ +#define RIG_MODEL_SI570PEABERRY2 RIG_MAKE_MODEL(RIG_KIT, 17) /* Peaberry V2 */ +#define RIG_MODEL_FUNCUBEDONGLEPLUS RIG_MAKE_MODEL(RIG_KIT, 18) /* FunCUBE Dongle Pro+ */ +#define RIG_MODEL_RSHFIQ RIG_MAKE_MODEL(RIG_KIT, 19) /* RS-HFIQ */ + + +/* + * SW/FM/TV tuner cards supported by Video4Linux,*BSD, .. + */ +#define RIG_TUNER 26 +#define RIG_BACKEND_TUNER "tuner" +#define RIG_MODEL_V4L RIG_MAKE_MODEL(RIG_TUNER, 1) +#define RIG_MODEL_V4L2 RIG_MAKE_MODEL(RIG_TUNER, 2) + + +/* + * Rohde & Schwarz--rs + */ +#define RIG_RS 27 +#define RIG_BACKEND_RS "rs" +#define RIG_MODEL_ESMC RIG_MAKE_MODEL(RIG_RS, 1) +#define RIG_MODEL_EB200 RIG_MAKE_MODEL(RIG_RS, 2) +#define RIG_MODEL_XK2100 RIG_MAKE_MODEL(RIG_RS, 3) + + +/* + * Phillips/Simoco PRM80 + */ +#define RIG_PRM80 28 +#define RIG_BACKEND_PRM80 "prm80" +#define RIG_MODEL_PRM8060 RIG_MAKE_MODEL(RIG_PRM80, 1) +#define RIG_MODEL_PRM8070 RIG_MAKE_MODEL(RIG_PRM80, 2) + + +/* + * ADAT by HB9CBU + * + * ADDED: frgo (DG1SBG), 2012-01-01 + */ +#define RIG_ADAT 29 +#define RIG_BACKEND_ADAT "adat" +#define RIG_MODEL_ADT_200A RIG_MAKE_MODEL(RIG_ADAT, 1) + + +/* + * ICOM Marine + */ +#define RIG_ICMARINE 30 +#define RIG_BACKEND_ICMARINE "icmarine" +#define RIG_MODEL_IC_M700PRO RIG_MAKE_MODEL(RIG_ICMARINE, 1) +#define RIG_MODEL_IC_M802 RIG_MAKE_MODEL(RIG_ICMARINE, 2) +#define RIG_MODEL_IC_M710 RIG_MAKE_MODEL(RIG_ICMARINE, 3) +#define RIG_MODEL_IC_M803 RIG_MAKE_MODEL(RIG_ICMARINE, 4) + + +/* + * Dorji transceiver modules + */ +#define RIG_DORJI 31 +#define RIG_BACKEND_DORJI "dorji" +#define RIG_MODEL_DORJI_DRA818V RIG_MAKE_MODEL(RIG_DORJI, 1) +#define RIG_MODEL_DORJI_DRA818U RIG_MAKE_MODEL(RIG_DORJI, 2) + +/* + * Barrett + */ +#define RIG_BARRETT 32 +#define RIG_BACKEND_BARRETT "barrett" +#define RIG_MODEL_BARRETT_2050 RIG_MAKE_MODEL(RIG_BARRETT, 1) +#define RIG_MODEL_BARRETT_950 RIG_MAKE_MODEL(RIG_BARRETT, 2) + +/* + * Elad + */ +#define RIG_ELAD 33 +#define RIG_BACKEND_ELAD "elad" +#define RIG_MODEL_ELAD_FDM_DUO RIG_MAKE_MODEL(RIG_ELAD, 1) +//! @endcond + + +/* + * TODO: + RIG_MODEL_KWZ30, KNEISNER +DOERING + RIG_MODEL_E1800, DASA-Telefunken + etc. +*/ + + +/*! \typedef typedef int rig_model_t + \brief Convenience type definition for rig model. +*/ +typedef uint32_t rig_model_t; + + +/* + * struct rig_backend_list { + * rig_model_t model; + * const char *backend; + * } rig_backend_list[] = RIG_LIST; + * + * TODO: + * + { RIG_RADIOSHACK, RIG_BACKEND_RADIOSHACK }, \ + */ + +#endif /* _RIGLIST_H */ diff --git a/hamlib/rotator.h b/hamlib/rotator.h new file mode 100644 index 0000000..83f379e --- /dev/null +++ b/hamlib/rotator.h @@ -0,0 +1,805 @@ +/* + * Hamlib Interface - Rotator API header + * Copyright (c) 2000-2005 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 _ROTATOR_H +#define _ROTATOR_H 1 + +#include +#include + +/** + * \addtogroup rotator + * @{ + */ + +/** + * \file rotator.h + * \brief Hamlib rotator data structures. + * + * This file contains the data structures and declarations for the Hamlib + * rotator Application Programming Interface (API). + * + * See the rotator.c file for more details on the rotator API functions. + */ + + + +__BEGIN_DECLS + +/* Forward struct references */ + +struct rot; +struct rot_state; + + +/** + * \typedef typedef struct s_rot ROT + * \brief Main rotator handle type definition. + * + * The #ROT handle is returned by rot_init() and is passed as a parameter to + * every rotator specific API call. + * + * rot_cleanup() must be called when this handle is no longer needed. + */ +typedef struct s_rot ROT; + + +/** + * \typedef typedef float elevation_t + * \brief Type definition for elevation. + * + * The \a elevation_t type is used as parameter for the rot_set_position() and + * rot_get_position() functions. + * + * Unless specified otherwise, the unit of \a elevation_t is decimal degrees. + */ +typedef float elevation_t; + + +/** + * \typedef typedef float azimuth_t + * \brief Type definition for azimuth. + * + * The \a azimuth_t type is used as parameter for the rot_set_position() and + * rot_get_position() functions. + * + * Unless specified otherwise, the unit of \a azimuth_t is decimal degrees. + */ +typedef float azimuth_t; + + +/** + * \brief The token in the netrotctl protocol for returning an error condition code. + */ +#define NETROTCTL_RET "RPRT " + + +/** + * \def ROT_RESET_ALL + * \brief A macro that returns the flag for the \b reset operation. + * + * \sa rot_reset(), rot_reset_t + */ +#define ROT_RESET_ALL 1 + + +/** + * \typedef typedef int rot_reset_t + * \brief Type definition for rotator reset. + * + * The \a rot_reset_t type is used as parameter for the rot_reset() API + * function. + */ +typedef int rot_reset_t; + + +/** + * \brief Rotator type flags for bitmasks. + */ +typedef enum { + ROT_FLAG_AZIMUTH = (1 << 1), /*!< Azimuth */ + ROT_FLAG_ELEVATION = (1 << 2) /*!< Elevation */ +} rot_type_t; + +//! @cond Doxygen_Suppress +/* So far only used in ests/dumpcaps_rot.c. */ +#define ROT_TYPE_MASK (ROT_FLAG_AZIMUTH|ROT_FLAG_ELEVATION) +//! @endcond + +/** + * \def ROT_TYPE_OTHER + * \brief Other type of rotator. + * \def ROT_TYPE_AZIMUTH + * \brief Azimuth only rotator. + * \def ROT_TYPE_ELEVATION + * \brief Elevation only rotator. + * \def ROT_TYPE_AZEL + * \brief Combination azimuth/elevation rotator. + */ +#define ROT_TYPE_OTHER 0 +#define ROT_TYPE_AZIMUTH ROT_FLAG_AZIMUTH +#define ROT_TYPE_ELEVATION ROT_FLAG_ELEVATION +#define ROT_TYPE_AZEL (ROT_FLAG_AZIMUTH|ROT_FLAG_ELEVATION) + + +/** + * \def ROT_MOVE_UP + * \brief A macro that returns the flag for the \b UP direction. + * + * This macro defines the value of the \b UP direction which can be + * used with the rot_move() function. + * + * \sa rot_move(), ROT_MOVE_DOWN, ROT_MOVE_LEFT, ROT_MOVE_CCW, + * ROT_MOVE_RIGHT, ROT_MOVE_CW + */ +#define ROT_MOVE_UP (1<<1) + +/** + * \def ROT_MOVE_DOWN + * \brief A macro that returns the flag for the \b DOWN direction. + * + * This macro defines the value of the \b DOWN direction which can be + * used with the rot_move() function. + * + * \sa rot_move(), ROT_MOVE_UP, ROT_MOVE_LEFT, ROT_MOVE_CCW, ROT_MOVE_RIGHT, + * ROT_MOVE_CW +*/ +#define ROT_MOVE_DOWN (1<<2) + +/** + * \def ROT_MOVE_LEFT + * \brief A macro that returns the flag for the \b LEFT direction. + * + * This macro defines the value of the \b LEFT direction which can be + * used with the rot_move function. + * + * \sa rot_move(), ROT_MOVE_UP, ROT_MOVE_DOWN, ROT_MOVE_CCW, ROT_MOVE_RIGHT, + * ROT_MOVE_CW + */ +#define ROT_MOVE_LEFT (1<<3) + +/** + * \def ROT_MOVE_CCW + * \brief A macro that returns the flag for the \b counterclockwise direction. + * + * This macro defines the value of the \b counterclockwise direction which + * can be used with the rot_move() function. This value is equivalent to + * ROT_MOVE_LEFT. + * + * \sa rot_move(), ROT_MOVE_UP, ROT_MOVE_DOWN, ROT_MOVE_LEFT, ROT_MOVE_RIGHT, + * ROT_MOVE_CW + */ +#define ROT_MOVE_CCW ROT_MOVE_LEFT + +/** + * \def ROT_MOVE_RIGHT + * \brief A macro that returns the flag for the \b RIGHT direction. + * + * This macro defines the value of the \b RIGHT direction which can be used + * with the rot_move() function. + * + * \sa rot_move(), ROT_MOVE_UP, ROT_MOVE_DOWN, ROT_MOVE_LEFT, ROT_MOVE_CCW, + * ROT_MOVE_CW + */ +#define ROT_MOVE_RIGHT (1<<4) + +/** + * \def ROT_MOVE_CW + * \brief A macro that returns the flag for the \b clockwise direction. + * + * This macro defines the value of the \b clockwise direction which can be + * used with the rot_move() function. This value is equivalent to + * ROT_MOVE_RIGHT. + * + * \sa rot_move(), ROT_MOVE_UP, ROT_MOVE_DOWN, ROT_MOVE_LEFT, ROT_MOVE_CCW, + * ROT_MOVE_RIGHT + */ +#define ROT_MOVE_CW ROT_MOVE_RIGHT + + +/** + * \brief Rotator status flags + */ +typedef enum { + ROT_STATUS_NONE = 0, /*!< '' -- No status. */ + ROT_STATUS_BUSY = (1 << 0), /*!< Rotator is busy, not accepting commands. */ + ROT_STATUS_MOVING = (1 << 1), /*!< Rotator is currently moving (direction type not specified). */ + ROT_STATUS_MOVING_AZ = (1 << 2), /*!< Azimuth rotator is currently moving (direction not specified). */ + ROT_STATUS_MOVING_LEFT = (1 << 3), /*!< Azimuth rotator is currently moving left. */ + ROT_STATUS_MOVING_RIGHT = (1 << 4), /*!< Azimuth rotator is currently moving right. */ + ROT_STATUS_MOVING_EL = (1 << 5), /*!< Elevation rotator is currently moving (direction not specified). */ + ROT_STATUS_MOVING_UP = (1 << 6), /*!< Elevation rotator is currently moving up. */ + ROT_STATUS_MOVING_DOWN = (1 << 7), /*!< Elevation rotator is currently moving down. */ + ROT_STATUS_LIMIT_UP = (1 << 8), /*!< The elevation rotator has reached its limit to move up. */ + ROT_STATUS_LIMIT_DOWN = (1 << 9), /*!< The elevation rotator has reached its limit to move down.*/ + ROT_STATUS_LIMIT_LEFT = (1 << 10), /*!< The azimuth rotator has reached its limit to move left (CCW). */ + ROT_STATUS_LIMIT_RIGHT = (1 << 11), /*!< The azimuth rotator has reached its limit to move right (CW). */ + ROT_STATUS_OVERLAP_UP = (1 << 12), /*!< The elevation rotator has rotated up past 360 degrees. */ + ROT_STATUS_OVERLAP_DOWN = (1 << 13), /*!< The elevation rotator has rotated down past 0 degrees. */ + ROT_STATUS_OVERLAP_LEFT = (1 << 14), /*!< The azimuth rotator has rotated left (CCW) past 0 degrees. */ + ROT_STATUS_OVERLAP_RIGHT = (1 << 16), /*!< The azimuth rotator has rotated right (CW) past 360 degrees. */ +} rot_status_t; + +//! @cond Doxygen_Suppress +/* So far only used in tests/sprintflst.c. */ +#define ROT_STATUS_N(n) (1u<<(n)) +//! @endcond + +/** + * \brief Macro for not changing the rotator speed with move() function. + */ +#define ROT_SPEED_NOCHANGE (-1) + + +/** + * \brief Rotator Level Settings. + * + * Various operating levels supported by a rotator. + * + * \c STRING used in the \c rotctl and \c rotctld utilities. + * + * \sa rot_parse_level(), rot_strlevel() + */ +enum rot_level_e { + ROT_LEVEL_NONE = 0, /*!< '' -- No Level. */ + ROT_LEVEL_SPEED = (1 << 0), /*!< \c SPEED -- Rotation speed, arg int (default range 1-100 if not specified). */ + ROT_LEVEL_63 = CONSTANT_64BIT_FLAG(63), /*!< **Future use**, last level. */ +}; + + +//! @cond Doxygen_Suppress +#define ROT_LEVEL_FLOAT_LIST (0) + +#define ROT_LEVEL_READONLY_LIST (0) + +#define ROT_LEVEL_IS_FLOAT(l) ((l)&ROT_LEVEL_FLOAT_LIST) +#define ROT_LEVEL_SET(l) ((l)&~ROT_LEVEL_READONLY_LIST) +//! @endcond + + +/** @cond Doxygen_Suppress + * FIXME: The following needs more explanation about how STRING relates + * to this macro. + * @endcond + */ +/** + * \brief Rotator Parameters + * + * Parameters are settings that are not related to core rotator functionality, + * i.e. antenna rotation. + * + * \c STRING used in the \c rotctl and \c rotctld utilities. + * + * \sa rot_parse_parm(), rot_strparm() + */ +enum rot_parm_e { + ROT_PARM_NONE = 0, /*!< '' -- No Parm */ +}; + + +//! @cond Doxygen_Suppress +#define ROT_PARM_FLOAT_LIST (0) +#define ROT_PARM_READONLY_LIST (0) + +#define ROT_PARM_IS_FLOAT(l) ((l)&ROT_PARM_FLOAT_LIST) +#define ROT_PARM_SET(l) ((l)&~ROT_PARM_READONLY_LIST) +//! @endcond + + +/** @cond Doxygen_Suppress + * FIXME: The following needs more explanation about how STRING relates + * to these macros. + * @endcond + */ +/** + * \brief Rotator Function Settings. + * + * Various operating functions supported by a rotator. + * + * \c STRING used in the \c rotctl and \c rotctld utilities. + * + * \sa rot_parse_func(), rot_strfunc() + */ +#define ROT_FUNC_NONE 0 /*!< '' -- No Function */ +#ifndef SWIGLUAHIDE +/* Hide the top 32 bits from the old Lua binding as they can't be represented */ +#define ROT_FUNC_BIT63 CONSTANT_64BIT_FLAG (63) /*!< **Future use**, ROT_FUNC items. */ +/* 63 is this highest bit number that can be used */ +#endif + + +/* Basic rot type, can store some useful info about different rotators. Each + * lib must be able to populate this structure, so we can make useful + * enquiries about capabilities. + */ + +/** + * \struct rot_caps + * \brief Rotator capability data structure. + * + * The main idea of this structure is that it will be defined by the backend + * rotator driver, and will remain read-only for the application. Fields that + * need to be modifiable by the application are copied into the rot_state + * structure, which is the private memory area of the #ROT instance. + * + * This way, you can have several rotators running within the same + * application, sharing the rot_caps structure of the backend, while keeping + * their own customized data. + * + * \b Note: Don't move fields around and only add new fields at the end of the + * rot_caps structure. Shared libraries and DLLs depend on a constant + * structure to maintain compatibility. + */ +struct rot_caps { + rot_model_t rot_model; /*!< Rotator model as defined in rotlist.h. */ + const char *model_name; /*!< Model name, e.g. TT-360. */ + const char *mfg_name; /*!< Manufacturer, e.g. Tower Torquer. */ + const char *version; /*!< Driver version, typically in YYYYMMDD.x format. */ + const char *copyright; /*!< Copyright info (should be LGPL). */ + enum rig_status_e status; /*!< Driver status. */ + + int rot_type; /*!< Rotator type. */ + enum rig_port_e port_type; /*!< Type of communication port (serial, ethernet, etc.). */ + + int serial_rate_min; /*!< Minimal serial speed. */ + int serial_rate_max; /*!< Maximal serial speed. */ + int serial_data_bits; /*!< Number of data bits. */ + int serial_stop_bits; /*!< Number of stop bits. */ + enum serial_parity_e serial_parity; /*!< Parity. */ + enum serial_handshake_e serial_handshake; /*!< Handshake. */ + + int write_delay; /*!< Write delay. */ + int post_write_delay; /*!< Post-write delay. */ + int timeout; /*!< Timeout. */ + int retry; /*!< Number of retries if command fails. */ + + setting_t has_get_func; /*!< List of get functions. */ + setting_t has_set_func; /*!< List of set functions. */ + setting_t has_get_level; /*!< List of get levels. */ + setting_t has_set_level; /*!< List of set levels. */ + setting_t has_get_parm; /*!< List of get parameters. */ + setting_t has_set_parm; /*!< List of set parameters. */ + + rot_status_t has_status; /*!< Supported status flags. */ + + gran_t level_gran[RIG_SETTING_MAX]; /*!< level granularity (i.e. steps). */ + gran_t parm_gran[RIG_SETTING_MAX]; /*!< parm granularity (i.e. steps). */ + + const struct confparams *extparms; /*!< Extension parameters list, \sa rot_ext.c. */ + const struct confparams *extlevels; /*!< Extension levels list, \sa rot_ext.c. */ + const struct confparams *extfuncs; /*!< Extension functions list, \sa rot_ext.c. */ + int *ext_tokens; /*!< Extension token list. */ + + /* + * Movement range, az is relative to North + * negative values allowed for overlap + */ + azimuth_t min_az; /*!< Lower limit for azimuth (relative to North). */ + azimuth_t max_az; /*!< Upper limit for azimuth (relative to North). */ + elevation_t + min_el; /*!< Lower limit for elevation. */ + elevation_t + max_el; /*!< Upper limit for elevation. */ + + + const struct confparams *cfgparams; /*!< Configuration parameters. */ + const rig_ptr_t priv; /*!< Private data. */ + + /* + * Rot Admin API + * + */ + + int (*rot_init)(ROT *rot); /*!< Pointer to backend implementation of ::rot_init(). */ + int (*rot_cleanup)(ROT *rot); /*!< Pointer to backend implementation of ::rot_cleanup(). */ + int (*rot_open)(ROT *rot); /*!< Pointer to backend implementation of ::rot_open(). */ + int (*rot_close)(ROT *rot); /*!< Pointer to backend implementation of ::rot_close(). */ + + int (*set_conf)(ROT *rot, token_t token, const char *val); /*!< Pointer to backend implementation of ::rot_set_conf(). */ + int (*get_conf)(ROT *rot, token_t token, char *val); /*!< Pointer to backend implementation of ::rot_get_conf(). */ + + /* + * General API commands, from most primitive to least.. :() + * List Set/Get functions pairs + */ + + int (*set_position)(ROT *rot, azimuth_t azimuth, elevation_t elevation); /*!< Pointer to backend implementation of ::rot_set_position(). */ + int (*get_position)(ROT *rot, azimuth_t *azimuth, elevation_t *elevation); /*!< Pointer to backend implementation of ::rot_get_position(). */ + + int (*stop)(ROT *rot); /*!< Pointer to backend implementation of ::rot_stop(). */ + int (*park)(ROT *rot); /*!< Pointer to backend implementation of ::rot_park(). */ + int (*reset)(ROT *rot, rot_reset_t reset); /*!< Pointer to backend implementation of ::rot_reset(). */ + int (*move)(ROT *rot, int direction, int speed); /*!< Pointer to backend implementation of ::rot_move(). */ + + /* get firmware info, etc. */ + const char * (*get_info)(ROT *rot); /*!< Pointer to backend implementation of ::rot_get_info(). */ + + int (*set_level)(ROT *rot, setting_t level, value_t val); /*!< Pointer to backend implementation of ::rot_set_level(). */ + int (*get_level)(ROT *rot, setting_t level, value_t *val); /*!< Pointer to backend implementation of ::rot_get_level(). */ + + int (*set_func)(ROT *rot, setting_t func, int status); /*!< Pointer to backend implementation of ::rot_set_func(). */ + int (*get_func)(ROT *rot, setting_t func, int *status); /*!< Pointer to backend implementation of ::rot_get_func(). */ + + int (*set_parm)(ROT *rot, setting_t parm, value_t val); /*!< Pointer to backend implementation of ::rot_set_parm(). */ + int (*get_parm)(ROT *rot, setting_t parm, value_t *val); /*!< Pointer to backend implementation of ::rot_get_parm(). */ + + int (*set_ext_level)(ROT *rot, token_t token, value_t val); /*!< Pointer to backend implementation of ::rot_set_ext_level(). */ + int (*get_ext_level)(ROT *rot, token_t token, value_t *val); /*!< Pointer to backend implementation of ::rot_get_ext_level(). */ + + int (*set_ext_func)(ROT *rot, token_t token, int status); /*!< Pointer to backend implementation of ::rot_set_ext_func(). */ + int (*get_ext_func)(ROT *rot, token_t token, int *status); /*!< Pointer to backend implementation of ::rot_get_ext_func(). */ + + int (*set_ext_parm)(ROT *rot, token_t token, value_t val); /*!< Pointer to backend implementation of ::rot_set_ext_parm(). */ + int (*get_ext_parm)(ROT *rot, token_t token, value_t *val); /*!< Pointer to backend implementation of ::rot_get_ext_parm(). */ + + int (*get_status)(ROT *rot, rot_status_t *status); /*!< Pointer to backend implementation of ::rot_get_status(). */ + + const char *macro_name; /*!< Rotator model macro name. */ +}; +//! @cond Doxygen_Suppress +#define ROT_MODEL(arg) .rot_model=arg,.macro_name=#arg +//! @endcond + + +/** + * \struct rot_state + * \brief Rotator state structure + * + * This structure contains live data, as well as a copy of capability fields + * that may be updated, i.e. customized while the #ROT handle is instantiated. + * + * It is fine to move fields around, as this kind of structure should not be + * initialized like rot_caps are. + */ +struct rot_state { + /* + * overridable fields + */ + azimuth_t min_az; /*!< Lower limit for azimuth (overridable). */ + azimuth_t max_az; /*!< Upper limit for azimuth (overridable). */ + elevation_t min_el; /*!< Lower limit for elevation (overridable). */ + elevation_t max_el; /*!< Upper limit for elevation (overridable). */ + int south_zero; /*!< South is zero degrees. */ + azimuth_t az_offset; /*!< Offset to be applied to azimuth. */ + elevation_t el_offset; /*!< Offset to be applied to elevation. */ + + setting_t has_get_func; /*!< List of get functions. */ + setting_t has_set_func; /*!< List of set functions. */ + setting_t has_get_level; /*!< List of get levels. */ + setting_t has_set_level; /*!< List of set levels. */ + setting_t has_get_parm; /*!< List of get parameters. */ + setting_t has_set_parm; /*!< List of set parameters. */ + + rot_status_t has_status; /*!< Supported status flags. */ + + gran_t level_gran[RIG_SETTING_MAX]; /*!< Level granularity. */ + gran_t parm_gran[RIG_SETTING_MAX]; /*!< Parameter granularity. */ + + /* + * non overridable fields, internal use + */ + hamlib_port_t rotport; /*!< Rotator port (internal use). */ + hamlib_port_t rotport2; /*!< 2nd Rotator port (internal use). */ + + int comm_state; /*!< Comm port state, i.e. opened or closed. */ + rig_ptr_t priv; /*!< Pointer to private rotator state data. */ + rig_ptr_t obj; /*!< Internal use by hamlib++ for event handling. */ + + int current_speed; /*!< Current speed 1-100, to be used when no change to speed is requested. */ + /* etc... */ +}; + + +/** + * \struct s_rot + * \brief Master rotator structure. + * + * This is the master data structure acting as the #ROT handle for the + * controlled rotator. A pointer to this structure is returned by the + * rot_init() API function and is passed as a parameter to every rotator + * specific API call. + * + * \sa rot_init(), rot_caps, rot_state + */ +struct s_rot { + struct rot_caps *caps; /*!< Rotator caps. */ + struct rot_state state; /*!< Rotator state. */ +}; + + +//! @cond Doxygen_Suppress +/* --------------- API function prototypes -----------------*/ + +extern HAMLIB_EXPORT(ROT *) +rot_init HAMLIB_PARAMS((rot_model_t rot_model)); + +extern HAMLIB_EXPORT(int) +rot_open HAMLIB_PARAMS((ROT *rot)); + +extern HAMLIB_EXPORT(int) +rot_close HAMLIB_PARAMS((ROT *rot)); + +extern HAMLIB_EXPORT(int) +rot_cleanup HAMLIB_PARAMS((ROT *rot)); + +extern HAMLIB_EXPORT(int) +rot_set_conf HAMLIB_PARAMS((ROT *rot, + token_t token, + const char *val)); +extern HAMLIB_EXPORT(int) +rot_get_conf HAMLIB_PARAMS((ROT *rot, + token_t token, + char *val)); + +/* + * General API commands, from most primitive to least.. ) + * List Set/Get functions pairs + */ +extern HAMLIB_EXPORT(int) +rot_set_position HAMLIB_PARAMS((ROT *rot, + azimuth_t azimuth, + elevation_t elevation)); +extern HAMLIB_EXPORT(int) +rot_get_position HAMLIB_PARAMS((ROT *rot, + azimuth_t *azimuth, + elevation_t *elevation)); + +extern HAMLIB_EXPORT(int) +rot_stop HAMLIB_PARAMS((ROT *rot)); + +extern HAMLIB_EXPORT(int) +rot_park HAMLIB_PARAMS((ROT *rot)); + +extern HAMLIB_EXPORT(int) +rot_reset HAMLIB_PARAMS((ROT *rot, + rot_reset_t reset)); + +extern HAMLIB_EXPORT(int) +rot_move HAMLIB_PARAMS((ROT *rot, + int direction, + int speed)); + +extern HAMLIB_EXPORT(setting_t) +rot_has_get_level HAMLIB_PARAMS((ROT *rot, + setting_t level)); +extern HAMLIB_EXPORT(setting_t) +rot_has_set_level HAMLIB_PARAMS((ROT *rot, + setting_t level)); + +extern HAMLIB_EXPORT(setting_t) +rot_has_get_parm HAMLIB_PARAMS((ROT *rot, + setting_t parm)); +extern HAMLIB_EXPORT(setting_t) +rot_has_set_parm HAMLIB_PARAMS((ROT *rot, + setting_t parm)); + +extern HAMLIB_EXPORT(setting_t) +rot_has_get_func HAMLIB_PARAMS((ROT *rot, + setting_t func)); +extern HAMLIB_EXPORT(setting_t) +rot_has_set_func HAMLIB_PARAMS((ROT *rot, + setting_t func)); + +extern HAMLIB_EXPORT(int) +rot_set_func HAMLIB_PARAMS((ROT *rot, + setting_t func, + int status)); +extern HAMLIB_EXPORT(int) +rot_get_func HAMLIB_PARAMS((ROT *rot, + setting_t func, + int *status)); + +extern HAMLIB_EXPORT(int) +rot_set_level HAMLIB_PARAMS((ROT *rig, + setting_t level, + value_t val)); +extern HAMLIB_EXPORT(int) +rot_get_level HAMLIB_PARAMS((ROT *rig, + setting_t level, + value_t *val)); + +extern HAMLIB_EXPORT(int) +rot_set_parm HAMLIB_PARAMS((ROT *rig, + setting_t parm, + value_t val)); +extern HAMLIB_EXPORT(int) +rot_get_parm HAMLIB_PARAMS((ROT *rig, + setting_t parm, + value_t *val)); + +extern HAMLIB_EXPORT(int) +rot_set_ext_level HAMLIB_PARAMS((ROT *rig, + token_t token, + value_t val)); +extern HAMLIB_EXPORT(int) +rot_get_ext_level HAMLIB_PARAMS((ROT *rig, + token_t token, + value_t *val)); + +extern HAMLIB_EXPORT(int) +rot_set_ext_func HAMLIB_PARAMS((ROT *rig, + token_t token, + int status)); +extern HAMLIB_EXPORT(int) +rot_get_ext_func HAMLIB_PARAMS((ROT *rig, + token_t token, + int *status)); + +extern HAMLIB_EXPORT(int) +rot_set_ext_parm HAMLIB_PARAMS((ROT *rig, + token_t token, + value_t val)); +extern HAMLIB_EXPORT(int) +rot_get_ext_parm HAMLIB_PARAMS((ROT *rig, + token_t token, + value_t *val)); + +extern HAMLIB_EXPORT(const char *) +rot_get_info HAMLIB_PARAMS((ROT *rot)); + +extern HAMLIB_EXPORT(int) +rot_get_status HAMLIB_PARAMS((ROT *rot, + rot_status_t *status)); + +extern HAMLIB_EXPORT(int) +rot_register HAMLIB_PARAMS((const struct rot_caps *caps)); + +extern HAMLIB_EXPORT(int) +rot_unregister HAMLIB_PARAMS((rot_model_t rot_model)); + +extern HAMLIB_EXPORT(int) +rot_list_foreach HAMLIB_PARAMS((int (*cfunc)(const struct rot_caps *, + rig_ptr_t), + rig_ptr_t data)); + +extern HAMLIB_EXPORT(int) +rot_load_backend HAMLIB_PARAMS((const char *be_name)); + +extern HAMLIB_EXPORT(int) +rot_check_backend HAMLIB_PARAMS((rot_model_t rot_model)); + +extern HAMLIB_EXPORT(int) +rot_load_all_backends HAMLIB_PARAMS((void)); + +extern HAMLIB_EXPORT(rot_model_t) +rot_probe_all HAMLIB_PARAMS((hamlib_port_t *p)); + +extern HAMLIB_EXPORT(int) +rot_token_foreach HAMLIB_PARAMS((ROT *rot, + int (*cfunc)(const struct confparams *, + rig_ptr_t), + rig_ptr_t data)); + +extern HAMLIB_EXPORT(const struct confparams *) +rot_confparam_lookup HAMLIB_PARAMS((ROT *rot, + const char *name)); + +extern HAMLIB_EXPORT(token_t) +rot_token_lookup HAMLIB_PARAMS((ROT *rot, + const char *name)); + +extern HAMLIB_EXPORT(int) +rot_ext_func_foreach HAMLIB_PARAMS((ROT *rot, + int (*cfunc)(ROT *, + const struct confparams *, + rig_ptr_t), + rig_ptr_t data)); +extern HAMLIB_EXPORT(int) +rot_ext_level_foreach HAMLIB_PARAMS((ROT *rot, + int (*cfunc)(ROT *, + const struct confparams *, + rig_ptr_t), + rig_ptr_t data)); +extern HAMLIB_EXPORT(int) +rot_ext_parm_foreach HAMLIB_PARAMS((ROT *rot, + int (*cfunc)(ROT *, + const struct confparams *, + rig_ptr_t), + rig_ptr_t data)); + +extern HAMLIB_EXPORT(const struct confparams *) +rot_ext_lookup HAMLIB_PARAMS((ROT *rot, + const char *name)); + +extern HAMLIB_EXPORT(const struct confparams *) +rot_ext_lookup_tok HAMLIB_PARAMS((ROT *rot, + token_t token)); +extern HAMLIB_EXPORT(token_t) +rot_ext_token_lookup HAMLIB_PARAMS((ROT *rot, + const char *name)); + +extern HAMLIB_EXPORT(const struct rot_caps *) +rot_get_caps HAMLIB_PARAMS((rot_model_t rot_model)); + +extern HAMLIB_EXPORT(int) +qrb HAMLIB_PARAMS((double lon1, + double lat1, + double lon2, + double lat2, + double *distance, + double *azimuth)); + +extern HAMLIB_EXPORT(double) +distance_long_path HAMLIB_PARAMS((double distance)); + +extern HAMLIB_EXPORT(double) +azimuth_long_path HAMLIB_PARAMS((double azimuth)); + +extern HAMLIB_EXPORT(int) +longlat2locator HAMLIB_PARAMS((double longitude, + double latitude, + char *locator_res, + int pair_count)); + +extern HAMLIB_EXPORT(int) +locator2longlat HAMLIB_PARAMS((double *longitude, + double *latitude, + const char *locator)); + +extern HAMLIB_EXPORT(double) +dms2dec HAMLIB_PARAMS((int degrees, + int minutes, + double seconds, + int sw)); + +extern HAMLIB_EXPORT(int) +dec2dms HAMLIB_PARAMS((double dec, + int *degrees, + int *minutes, + double *seconds, + int *sw)); + +extern HAMLIB_EXPORT(int) +dec2dmmm HAMLIB_PARAMS((double dec, + int *degrees, + double *minutes, + int *sw)); + +extern HAMLIB_EXPORT(double) +dmmm2dec HAMLIB_PARAMS((int degrees, + double minutes, + double seconds, + int sw)); + +extern HAMLIB_EXPORT(setting_t) rot_parse_func(const char *s); +extern HAMLIB_EXPORT(setting_t) rot_parse_level(const char *s); +extern HAMLIB_EXPORT(setting_t) rot_parse_parm(const char *s); +extern HAMLIB_EXPORT(const char *) rot_strfunc(setting_t); +extern HAMLIB_EXPORT(const char *) rot_strlevel(setting_t); +extern HAMLIB_EXPORT(const char *) rot_strparm(setting_t); +extern HAMLIB_EXPORT(const char *) rot_strstatus(rot_status_t); + +//! @endcond + +/** + * \def rot_debug + * \brief Convenience macro for generating debugging messages. + * + * This is an alias of the rig_debug() function call and is used in the same + * manner. + */ +#define rot_debug rig_debug + +__END_DECLS + +#endif /* _ROTATOR_H */ + +/** @} */ diff --git a/hamlib/rotlist.h b/hamlib/rotlist.h new file mode 100644 index 0000000..338972a --- /dev/null +++ b/hamlib/rotlist.h @@ -0,0 +1,637 @@ +/* + * Hamlib Interface - list of known rotators + * Copyright (c) 2000-2011 by Stephane Fillod + * Copyright (c) 2000-2002 by Frank Singleton + * + * + * 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 _ROTLIST_H +#define _ROTLIST_H 1 + +//! @cond Doxygen_Suppress +#define ROT_MAKE_MODEL(a,b) ((a)*100+(b)) +#define ROT_BACKEND_NUM(a) ((a)/100) +//! @endcond + + +/** + * \addtogroup rotator + * @{ + */ + +/** + * \file rotlist.h + * \brief Hamlib rotator model definitions. + * + * This file contains rotator model definitions for the Hamlib rotator + * Application Programming Interface (API). Each distinct rotator type has a + * unique model number (ID) and is used by Hamlib to identify and distinguish + * between the different hardware drivers. The exact model numbers can be + * acquired using the macros in this file. To obtain a list of supported + * rotator branches, one can use the statically defined ROT_BACKEND_LIST macro + * (defined in configure.ac). To obtain a full list of supported rotators + * (including each model in every branch), the foreach_opened_rot() API + * function can be used. + * + * The model number, or ID, is used to tell Hamlib which rotator the client + * wishes to use which is done with the rot_init() API call. + */ + +/** + * \def ROT_MODEL_NONE + * \brief A macro that returns the model number for an unknown model. + * + * The none backend, as the name suggests, does nothing. It is mainly for + * internal use. + */ +#define ROT_MODEL_NONE 0 + + +/** + * \brief A macro that returns the model number for the DUMMY backend. + * + * \def ROT_MODEL_DUMMY + * + * The DUMMY backend, as the name suggests, is a backend which performs + * no hardware operations and always behaves as one would expect. It can + * be thought of as a hardware simulator and is very useful for testing + * client applications. + */ +/** + * \brief A macro that returns the model number for the NETROTCTL backend. + * + * \def ROT_MODEL_NETROTCTL + * + * The NETROTCTL backend allows use of the `rotctld` daemon through the normal + * Hamlib API. + */ +//! @cond Doxygen_Suppress +#define ROT_DUMMY 0 +#define ROT_BACKEND_DUMMY "dummy" +//! @endcond +#define ROT_MODEL_DUMMY ROT_MAKE_MODEL(ROT_DUMMY, 1) +#define ROT_MODEL_NETROTCTL ROT_MAKE_MODEL(ROT_DUMMY, 2) + + +/** + * \brief A macro that returns the model number of the EASYCOMM 1 backend. + * + * \def ROT_MODEL_EASYCOMM1 + * + * The EASYCOMM1 backend can be used with rotators that support the EASYCOMM + * I Standard. + */ +/** + * \brief A macro that returns the model number of the EASYCOMM 2 backend. + * + * \def ROT_MODEL_EASYCOMM2 + * + * The EASYCOMM2 backend can be used with rotators that support the EASYCOMM + * II Standard. + */ +/** + * \brief A macro that returns the model number of the EASYCOMM 3 backend. + * + * \def ROT_MODEL_EASYCOMM3 + * + * The EASYCOMM3 backend can be used with rotators that support the EASYCOMM + * III Standard. + */ +//! @cond Doxygen_Suppress +#define ROT_EASYCOMM 2 +#define ROT_BACKEND_EASYCOMM "easycomm" +//! @endcond +#define ROT_MODEL_EASYCOMM1 ROT_MAKE_MODEL(ROT_EASYCOMM, 1) +#define ROT_MODEL_EASYCOMM2 ROT_MAKE_MODEL(ROT_EASYCOMM, 2) +#define ROT_MODEL_EASYCOMM3 ROT_MAKE_MODEL(ROT_EASYCOMM, 4) + + +/** + * \brief A macro that returns the model number of the FODTRACK backend. + * + * \def ROT_MODEL_FODTRACK + * + * The FODTRACK backend can be used with rotators that support the FODTRACK + * Standard. + */ +//! @cond Doxygen_Suppress +#define ROT_FODTRACK 3 +#define ROT_BACKEND_FODTRACK "fodtrack" +//! @endcond +#define ROT_MODEL_FODTRACK ROT_MAKE_MODEL(ROT_FODTRACK, 1) + + +/** + * \brief A macro that returns the model number of the ROTOREZ backend. + * + * \def ROT_MODEL_ROTOREZ + * + * The ROTOREZ backend can be used with Hy-Gain rotators that support the + * extended DCU command set by the Idiom Press Rotor-EZ board. + */ +/** + * \brief A macro that returns the model number of the ROTORCARD backend. + * + * \def ROT_MODEL_ROTORCARD + * + * The ROTORCARD backend can be used with Yaesu rotators that support the + * extended DCU command set by the Idiom Press Rotor Card board. + */ +/** + * \brief A macro that returns the model number of the DCU backend. + * + * \def ROT_MODEL_DCU + * + * The DCU backend can be used with rotators that support the DCU command set + * by Hy-Gain (currently the DCU-1). + */ +/** + * \brief A macro that returns the model number of the ERC backend. + * + * \def ROT_MODEL_ERC + * + * The ERC backend can be used with rotators that support the DCU command set + * by DF9GR (currently the ERC). + */ +/** + * \brief A macro that returns the model number of the RT21 backend. + * + * \def ROT_MODEL_RT21 + * + * The RT21 backend can be used with rotators that support the DCU command set + * by Green Heron (currently the RT-21). + */ +//! @cond Doxygen_Suppress +#define ROT_ROTOREZ 4 +#define ROT_BACKEND_ROTOREZ "rotorez" +//! @endcond +#define ROT_MODEL_ROTOREZ ROT_MAKE_MODEL(ROT_ROTOREZ, 1) +#define ROT_MODEL_ROTORCARD ROT_MAKE_MODEL(ROT_ROTOREZ, 2) +#define ROT_MODEL_DCU ROT_MAKE_MODEL(ROT_ROTOREZ, 3) +#define ROT_MODEL_ERC ROT_MAKE_MODEL(ROT_ROTOREZ, 4) +#define ROT_MODEL_RT21 ROT_MAKE_MODEL(ROT_ROTOREZ, 5) + + +/** + * \brief A macro that returns the model number of the SARTEK1 backend. + * + * \def ROT_MODEL_SARTEK1 + * + * The SARTEK1 backend can be used with rotators that support the SARtek + * protocol. + */ +//! @cond Doxygen_Suppress +#define ROT_SARTEK 5 +#define ROT_BACKEND_SARTEK "sartek" +//! @endcond +#define ROT_MODEL_SARTEK1 ROT_MAKE_MODEL(ROT_SARTEK, 1) + + +/** + * \brief A macro that returns the model number of the GS232A backend. + * + * \def ROT_MODEL_GS232A + * + * The GS232A backend can be used with rotators that support the GS-232A + * protocol. + */ +/** + * \brief A macro that returns the model number of the GS232 backend. + * + * \def ROT_MODEL_GS232_GENERIC + * + * The GS232_GENERIC backend can be used with rotators that support the + * generic (even if not coded correctly) GS-232 protocol. + */ +/** + * \brief A macro that returns the model number of the GS232B backend. + * + * \def ROT_MODEL_GS232B + * + * The GS232B backend can be used with rotators that support the GS232B + * protocol. + */ +/** + * \brief A macro that returns the model number of the F1TETRACKER backend. + * + * \def ROT_MODEL_F1TETRACKER + * + * The F1TETRACKER backend can be used with rotators that support the F1TE + * Tracker protocol. + */ +/** + * \brief A macro that returns the model number of the GS23 backend. + * + * \def ROT_MODEL_GS23 + * + * The GS23 backend can be used with rotators that support the GS-23 protocol. + */ +/** + * \brief A macro that returns the model number of the GS232 backend. + * + * \def ROT_MODEL_GS232 + * + * The GS232 backend can be used with rotators that support the GS-232 + * protocol. + */ +/** + * \brief A macro that returns the model number of the LVB backend. + * + * \def ROT_MODEL_LVB + * + * The LVB backend can be used with rotators that support the G6LVB AMSAT LVB + * Tracker GS-232 based protocol. + */ +/** + * \brief A macro that returns the model number of the ST2 backend. + * + * \def ROT_MODEL_ST2 + * + * The ST2 backend can be used with rotators that support the Fox Delta ST2 + * GS-232 based protocol. + */ +/** + * \brief A macro that returns the model number of the GS232A_AZ Azimuth backend. + * + * \def ROT_MODEL_GS232A_AZ + * + * The GS232A_AZ backend can be used with azimuth rotators that support the + * GS-232A protocol. + */ +/** + * \brief A macro that returns the model number of the GS232A_EL Elevation backend. + * + * \def ROT_MODEL_GS232A_EL + * + * The GS232A_EL backend can be used with elevation rotators that support the + * GS-232A protocol. + */ +/** + * \brief A macro that returns the model number of the GS232B_AZ Azimuth backend. + * + * \def ROT_MODEL_GS232B_AZ + * + * The GS232B_AZ backend can be used with azimuth rotators that support the + * GS-232B protocol. + */ +/** + * \brief A macro that returns the model number of the GS232B_EL Elevation backend. + * + * \def ROT_MODEL_GS232B_EL + * + * The GS232B_EL backend can be used with elevation rotators that support the + * GS-232B protocol. + */ + +//! @cond Doxygen_Suppress +#define ROT_GS232A 6 +#define ROT_BACKEND_GS232A "gs232a" +//! @endcond +#define ROT_MODEL_GS232A ROT_MAKE_MODEL(ROT_GS232A, 1) +#define ROT_MODEL_GS232_GENERIC ROT_MAKE_MODEL(ROT_GS232A, 2) /* GENERIC */ +#define ROT_MODEL_GS232B ROT_MAKE_MODEL(ROT_GS232A, 3) +#define ROT_MODEL_F1TETRACKER ROT_MAKE_MODEL(ROT_GS232A, 4) +#define ROT_MODEL_GS23 ROT_MAKE_MODEL(ROT_GS232A, 5) +#define ROT_MODEL_GS232 ROT_MAKE_MODEL(ROT_GS232A, 6) /* Not A or B */ +#define ROT_MODEL_LVB ROT_MAKE_MODEL(ROT_GS232A, 7) +#define ROT_MODEL_ST2 ROT_MAKE_MODEL(ROT_GS232A, 8) +#define ROT_MODEL_GS232A_AZ ROT_MAKE_MODEL(ROT_GS232A, 9) +#define ROT_MODEL_GS232A_EL ROT_MAKE_MODEL(ROT_GS232A, 10) +#define ROT_MODEL_GS232B_AZ ROT_MAKE_MODEL(ROT_GS232A, 11) +#define ROT_MODEL_GS232B_EL ROT_MAKE_MODEL(ROT_GS232A, 12) + + +/** + * \brief A macro that returns the model number of the PCROTOR backend. + * + * \def ROT_MODEL_PCROTOR + * + * The PCROTOR backend is a member of the kit backend group that can be used + * with home brewed rotators. + */ +//! @cond Doxygen_Suppress +#define ROT_KIT 7 +#define ROT_BACKEND_KIT "kit" +//! @endcond +#define ROT_MODEL_PCROTOR ROT_MAKE_MODEL(ROT_KIT, 1) + + +/** + * \brief A macro that returns the model number of the HD1780 backend. + * + * \def ROT_MODEL_HD1780 + * + * The HD1780 backend can be used with rotators that support the Heathkit + * HD-1780 protocol. + */ +//! @cond Doxygen_Suppress +#define ROT_HEATHKIT 8 +#define ROT_BACKEND_HEATHKIT "heathkit" +//! @endcond +#define ROT_MODEL_HD1780 ROT_MAKE_MODEL(ROT_HEATHKIT, 1) + + +/** + * \brief A macro that returns the model number of the ROT2PROG backend. + * + * \def ROT_MODEL_SPID_ROT2PROG + * + * The SPID_ROT2PROG backend can be used with rotators that support the SPID + * azimuth and elevation protocol. + */ +/** + * \brief A macro that returns the model number of the ROT1PROG backend. + * + * \def ROT_MODEL_SPID_ROT1PROG + * + * The SPID_ROT1PROG backend can be used with rotators that support the SPID + * azimuth protocol. + */ +/** + * \brief A macro that returns the model number of the SPID_MD01_ROT2PROG backend. + * + * \def ROT_MODEL_SPID_MD01_ROT2PROG + * + * The SPID_MD01_ROT2PROG backend can be used with rotators that support the + * extended SPID ROT2PROG azimuth and elevation protocol. + */ +//! @cond Doxygen_Suppress +#define ROT_SPID 9 +#define ROT_BACKEND_SPID "spid" +//! @endcond +#define ROT_MODEL_SPID_ROT2PROG ROT_MAKE_MODEL(ROT_SPID, 1) +#define ROT_MODEL_SPID_ROT1PROG ROT_MAKE_MODEL(ROT_SPID, 2) +#define ROT_MODEL_SPID_MD01_ROT2PROG ROT_MAKE_MODEL(ROT_SPID, 3) + + +/** + * \brief A macro that returns the model number of the RC2800 backend. + * + * \def ROT_MODEL_RC2800 + * + * The RC2800 backend can be used with rotators that support the M2 (M + * Squared) RC2800 protocol. + */ +/** + * \brief A macro that returns the model number of the RC2800_EARLY_AZ + * backend. + * + * \def ROT_MODEL_RC2800_EARLY_AZ + * + * The RC2800_EARLY_AZ backend can be used with rotators that support the M2 + * (M Squared) RC2800 early azimuth protocol. + */ +/** + * \brief A macro that returns the model number of the RC2800_EARLY_AZEL + * backend. + * + * \def ROT_MODEL_RC2800_EARLY_AZEL + * + * The RC2800_EARLY_AZEL backend can be used with rotators that support the M2 + * (M Squared) RC2800 early azimuth and elevation protocol. + */ +//! @cond Doxygen_Suppress +#define ROT_M2 10 +#define ROT_BACKEND_M2 "m2" +//! @endcond +#define ROT_MODEL_RC2800 ROT_MAKE_MODEL(ROT_M2, 1) +#define ROT_MODEL_RC2800_EARLY_AZ ROT_MAKE_MODEL(ROT_M2, 2) +#define ROT_MODEL_RC2800_EARLY_AZEL ROT_MAKE_MODEL(ROT_M2, 3) + + +/** + * \brief A macro that returns the model number of the RCI_AZEL backend. + * + * \def ROT_MODEL_RCI_AZEL + * + * The RCI_AZEL backend can be used with rotators that support the ARS azimuth + * and elevation protocol. + */ +/** + * \brief A macro that returns the model number of the RCI_AZ backend. + * + * \def ROT_MODEL_RCI_AZ + * + * The RCI_AZ backend can be used with rotators that support the ARS azimuth + * protocol. + */ +//! @cond Doxygen_Suppress +#define ROT_ARS 11 +#define ROT_BACKEND_ARS "ars" +//! @endcond +#define ROT_MODEL_RCI_AZEL ROT_MAKE_MODEL(ROT_ARS, 1) +#define ROT_MODEL_RCI_AZ ROT_MAKE_MODEL(ROT_ARS, 2) + + +/** + * \brief A macro that returns the model number of the IF100 backend. + * + * \def ROT_MODEL_IF100 + * + * The IF100 backend can be used with rotators that support the AMSAT IF-100 + * interface. + */ +//! @cond Doxygen_Suppress +#define ROT_AMSAT 12 +#define ROT_BACKEND_AMSAT "amsat" +//! @endcond +#define ROT_MODEL_IF100 ROT_MAKE_MODEL(ROT_AMSAT, 1) + + +/** + * \brief A macro that returns the model number of the TS7400 backend. + * + * \def ROT_MODEL_TS7400 + * + * The TS7400 backend supports an embedded ARM board using the TS-7400 Linux + * board. More information is at https://www.embeddedarm.com + */ +//! @cond Doxygen_Suppress +#define ROT_TS7400 13 +#define ROT_BACKEND_TS7400 "ts7400" +//! @endcond +#define ROT_MODEL_TS7400 ROT_MAKE_MODEL(ROT_TS7400, 1) + + +/** + * \brief A macro that returns the model number of the NEXSTAR backend. + * + * \def ROT_MODEL_NEXSTAR + * + * The NEXSTAR backend can be used with rotators that support the Celestron + * NexStar protocol and alike. + */ +//! @cond Doxygen_Suppress +#define ROT_CELESTRON 14 +#define ROT_BACKEND_CELESTRON "celestron" +//! @endcond +#define ROT_MODEL_NEXSTAR ROT_MAKE_MODEL(ROT_CELESTRON, 1) + + +/** + * \brief A macro that returns the model number of the ETHER6 backend. + * + * \def ROT_MODEL_ETHER6 + * + * The ETHER6 backend can be used with rotators that support the Ether6 + * protocol. + */ +//! @cond Doxygen_Suppress +#define ROT_ETHER6 15 +#define ROT_BACKEND_ETHER6 "ether6" +//! @endcond +#define ROT_MODEL_ETHER6 ROT_MAKE_MODEL(ROT_ETHER6, 1) + + +/** + * \brief A macro that returns the model number of the CNCTRK backend. + * + * \def ROT_MODEL_CNCTRK + * + * The CNCTRK backend can be used with rotators that support the LinuxCNC + * running Axis GUI interface. + */ +//! @cond Doxygen_Suppress +#define ROT_CNCTRK 16 +#define ROT_BACKEND_CNCTRK "cnctrk" +//! @endcond +#define ROT_MODEL_CNCTRK ROT_MAKE_MODEL(ROT_CNCTRK, 1) + + +/** + * \brief A macro that returns the model number of the PROSISTEL_D_AZ backend. + * + * \def ROT_MODEL_PROSISTEL_D_AZ + * + * The PROSISTEL_D_AZ backend can be used with rotators that support the Prosistel + * azimuth protocol. + */ +/** + * \brief A macro that returns the model number of the PROSISTEL_D_EL backend. + * + * \def ROT_MODEL_PROSISTEL_D_EL + * + * The PROSISTEL_D_EL backend can be used with rotators that support the Prosistel + * elevation protocol. + */ +/** + * \brief A macro that returns the model number of the + * PROSISTEL_COMBI_TRACK_AZEL backend. + * + * \def ROT_MODEL_PROSISTEL_COMBI_TRACK_AZEL + * + * The PROSISTEL_AZEL_COMBI_TRACK_AZEL backend can be used with rotators that + * support the Prosistel combination azimuth and elevation protocol. + */ +//! @cond Doxygen_Suppress +#define ROT_PROSISTEL 17 +#define ROT_BACKEND_PROSISTEL "prosistel" +//! @endcond +#define ROT_MODEL_PROSISTEL_D_AZ ROT_MAKE_MODEL(ROT_PROSISTEL, 1) +#define ROT_MODEL_PROSISTEL_D_EL ROT_MAKE_MODEL(ROT_PROSISTEL, 2) +#define ROT_MODEL_PROSISTEL_COMBI_TRACK_AZEL ROT_MAKE_MODEL(ROT_PROSISTEL, 3) + + +/** + * \brief A macro that returns the model number of the MEADE backend. + * + * \def ROT_MODEL_MEADE + * + * The MEADE backend can be used with Meade telescope rotators like the + * DS-2000. + */ +//! @cond Doxygen_Suppress +#define ROT_MEADE 18 +#define ROT_BACKEND_MEADE "meade" +//! @endcond +#define ROT_MODEL_MEADE ROT_MAKE_MODEL(ROT_MEADE, 1) + +/** + * \brief A macro that returns the model number of the IOPTRON backend. + * + * \def ROT_MODEL_IOPTRON + * + * The IOPTRON backend can be used with IOPTRON telescope mounts. + */ +//! @cond Doxygen_Suppress +#define ROT_IOPTRON 19 +#define ROT_BACKEND_IOPTRON "ioptron" +//! @endcond +#define ROT_MODEL_IOPTRON ROT_MAKE_MODEL(ROT_IOPTRON, 1) + + +/** + * \brief A macro that returns the model number of the INDI backend. + * + * \def ROT_MODEL_INDI + * + * The INDI backend can be used with rotators that support the INDI interface. + */ +//! @cond Doxygen_Suppress +#define ROT_INDI 20 +#define ROT_BACKEND_INDI "indi" +//! @endcond +#define ROT_MODEL_INDI ROT_MAKE_MODEL(ROT_INDI, 1) + + +/** + * \brief A macro that returns the model number of the SATEL backend. + * + * \def ROT_MODEL_SATEL + * + * The SATEL backend can be used with rotators that support the VE5FP + * interface. + */ +//! @cond Doxygen_Suppress +#define ROT_SATEL 21 +#define ROT_BACKEND_SATEL "satel" +//! @endcond +#define ROT_MODEL_SATEL ROT_MAKE_MODEL(ROT_SATEL, 1) + + +/** + * \brief A macro that returns the model number of the RADANT backend. + * + * \def ROT_MODEL_RADANT + * + * The RADANT backend can be used with rotators that support the MS232 + * interface. + */ +//! @cond Doxygen_Suppress +#define ROT_RADANT 22 +#define ROT_BACKEND_RADANT "radant" +//! @endcond +#define ROT_MODEL_RADANT ROT_MAKE_MODEL(ROT_RADANT, 1) + + +#define ROT_ANDROIDSENSOR 23 +#define ROT_BACKEND_ANDROIDSENSOR "androidsensor" +#define ROT_MODEL_ANDROIDSENSOR ROT_MAKE_MODEL(ROT_ANDROIDSENSOR, 1) + + +/** + * \brief Convenience type definition for a rotator model. + * + * \typedef typedef int rot_model_t +*/ +typedef int rot_model_t; + + +#endif /* _ROTLIST_H */ + +/** @} */