2001-07-13 19:08:15 +00:00
/*
* Hamlib Interface - API header
2009-01-25 16:23:06 +00:00
* Copyright ( c ) 2000 - 2003 by Frank Singleton
2012-01-06 08:28:24 +00:00
* Copyright ( c ) 2000 - 2012 by Stephane Fillod
2000-10-08 21:15:28 +00:00
*
*
2011-08-21 01:54:17 +00:00
* 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 .
2000-10-08 21:15:28 +00:00
*
2011-08-21 01:54:17 +00:00
* This library is distributed in the hope that it will be useful ,
2001-07-13 19:08:15 +00:00
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
2011-08-21 01:54:17 +00:00
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the GNU
* Lesser General Public License for more details .
2000-10-08 21:15:28 +00:00
*
2011-08-21 01:54:17 +00:00
* You should have received a copy of the GNU Lesser General Public
2001-07-13 19:08:15 +00:00
* License along with this library ; if not , write to the Free Software
2011-08-21 01:54:17 +00:00
* Foundation , Inc . , 51 Franklin Street , Fifth Floor , Boston , MA 02110 - 1301 USA
2000-10-08 21:15:28 +00:00
*
*/
2006-10-15 00:27:52 +00:00
2000-10-08 21:15:28 +00:00
# ifndef _RIG_H
# define _RIG_H 1
2021-01-28 20:25:26 +00:00
# define __FILENAME__ (strrchr(__FILE__, ' / ') ? strrchr(__FILE__, ' / ') + 1 : __FILE__)
2005-04-06 21:27:28 +00:00
# include <stdio.h>
# include <stdarg.h>
2021-02-10 23:30:46 +00:00
# include <string.h>
2018-12-23 04:56:30 +00:00
# include <inttypes.h>
2020-02-23 14:28:19 +00:00
# include <time.h>
2005-04-06 21:27:28 +00:00
2017-08-07 13:04:25 +00:00
/* Rig list is in a separate file so as not to mess up w/ this one */
# include <hamlib/riglist.h>
2000-10-08 21:15:28 +00:00
2006-10-15 00:27:52 +00:00
/**
* \ addtogroup rig
* @ {
*/
2002-11-12 00:15:01 +00:00
/*! \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 .
*/
2001-06-11 00:41:28 +00:00
/* __BEGIN_DECLS should be used at the beginning of your declarations,
2001-06-12 23:59:21 +00:00
* so that C + + compilers don ' t mangle their names . Use __END_DECLS at
* the end of C declarations . */
2020-04-09 22:56:19 +00:00
//! @cond Doxygen_Suppress
2001-06-11 00:41:28 +00:00
# undef __BEGIN_DECLS
# undef __END_DECLS
2001-05-24 22:24:18 +00:00
# ifdef __cplusplus
2017-08-07 13:04:25 +00:00
# define __BEGIN_DECLS extern "C" {
# define __END_DECLS }
2001-06-11 00:41:28 +00:00
# else
2017-08-07 13:04:25 +00:00
# define __BEGIN_DECLS /* empty */
# define __END_DECLS /* empty */
2001-06-11 00:41:28 +00:00
# endif
2020-04-09 22:56:19 +00:00
//! @endcond
2001-06-11 00:41:28 +00:00
2001-06-12 23:59:21 +00:00
/* 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 . */
2020-04-09 22:56:19 +00:00
//! @cond Doxygen_Suppress
2001-06-12 23:59:21 +00:00
# undef HAMLIB_PARAMS
2017-08-07 13:04:25 +00:00
# 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 *
2019-06-12 20:52:35 +00:00
# define amp_ptr_t void *
2001-06-11 00:41:28 +00:00
# else
2017-08-07 13:04:25 +00:00
# define HAMLIB_PARAMS(protos) ()
# define rig_ptr_t char *
2019-06-12 20:52:35 +00:00
# define amp_ptr_t char *
2001-05-24 22:24:18 +00:00
# endif
2020-04-09 22:56:19 +00:00
//! @endcond
2001-05-24 22:24:18 +00:00
2001-06-12 23:59:21 +00:00
# include <hamlib/rig_dll.h>
2018-12-27 21:10:10 +00:00
# ifndef SWIGLUA
2020-04-09 22:56:19 +00:00
//! @cond Doxygen_Suppress
2018-12-27 21:10:10 +00:00
# define CONSTANT_64BIT_FLAG(BIT) (1ull << (BIT))
2020-04-09 22:56:19 +00:00
//! @endcond
2018-12-27 21:10:10 +00:00
# else
2019-08-18 13:21:14 +00:00
/* SWIG's older Lua generator doesn't grok ull due to Lua using a
2018-12-27 21:10:10 +00:00
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 */
2020-01-19 17:15:44 +00:00
// #define CONSTANT_64BIT_FLAG(BIT) (1 << (BIT))
// #define SWIGLUAHIDE
2019-08-18 13:21:14 +00:00
/* 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
2020-01-19 17:15:44 +00:00
the two above */
// This 1ul definition works on swig 4.0.1 and lua 5.3.5
# define CONSTANT_64BIT_FLAG(BIT) (1ul << (BIT))
2018-12-27 21:10:10 +00:00
# endif
2001-06-11 00:41:28 +00:00
2002-07-08 22:20:15 +00:00
__BEGIN_DECLS
2020-04-09 22:56:19 +00:00
//! @cond Doxygen_Suppress
2002-07-08 22:20:15 +00:00
extern HAMLIB_EXPORT_VAR ( const char ) hamlib_version [ ] ;
2001-07-20 11:07:11 +00:00
extern HAMLIB_EXPORT_VAR ( const char ) hamlib_copyright [ ] ;
2016-08-31 14:05:47 +00:00
extern HAMLIB_EXPORT_VAR ( const char * ) hamlib_version2 ;
extern HAMLIB_EXPORT_VAR ( const char * ) hamlib_copyright2 ;
2020-04-09 22:56:19 +00:00
//! @endcond
2001-02-09 23:02:56 +00:00
2003-04-27 22:15:06 +00:00
/**
* \ brief Hamlib error codes
2009-01-25 16:23:06 +00:00
* 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 .
2000-10-08 21:15:28 +00:00
*/
2002-11-28 22:38:06 +00:00
enum rig_errcode_e {
2020-06-03 03:29:25 +00:00
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 */
2002-11-28 22:38:06 +00:00
} ;
2000-10-08 21:15:28 +00:00
2017-08-07 13:04:25 +00:00
/**
* \ brief Token in the netrigctl protocol for returning error code
*/
2008-10-27 22:23:36 +00:00
# define NETRIGCTL_RET "RPRT "
2017-08-07 13:04:25 +00:00
2002-11-12 00:15:01 +00:00
/**
* \ brief Hamlib debug levels
*
2017-08-07 13:04:25 +00:00
* NOTE : Numeric order matters for debug level
2002-11-12 00:15:01 +00:00
*
2017-08-07 13:04:25 +00:00
* \ sa rig_set_debug ( )
2002-11-12 00:15:01 +00:00
*/
enum rig_debug_level_e {
2017-08-07 13:04:25 +00:00
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 */
2002-11-12 00:15:01 +00:00
} ;
2017-08-07 13:04:25 +00:00
2002-11-12 00:15:01 +00:00
/* --------------- Rig capabilities -----------------*/
2000-10-08 21:15:28 +00:00
/* Forward struct references */
struct rig ;
struct rig_state ;
2017-08-07 13:04:25 +00:00
/**
2002-11-12 00:15:01 +00:00
* \ brief Rig structure definition ( see rig for details ) .
*/
2020-03-14 04:55:44 +00:00
typedef struct s_rig RIG ;
2000-10-08 21:15:28 +00:00
2020-04-09 22:56:19 +00:00
//! @cond Doxygen_Suppress
2001-06-02 17:50:14 +00:00
# define RIGNAMSIZ 30
# define RIGVERSIZ 8
2018-04-22 20:20:51 +00:00
# define FILPATHLEN 512
2001-06-02 17:50:14 +00:00
# define FRQRANGESIZ 30
2017-08-07 13:04:25 +00:00
# define MAXCHANDESC 30 /* describe channel eg: "WWV 5Mhz" */
# define TSLSTSIZ 20 /* max tuning step list size, zero ended */
# define FLTLSTSIZ 60 /* max mode/filter list size, zero ended */
# define MAXDBLSTSIZ 8 /* max preamp/att levels supported, zero ended */
# define CHANLSTSIZ 16 /* max mem_list size, zero ended */
# define MAX_CAL_LENGTH 32 /* max calibration plots in cal_table_t */
2020-04-09 22:56:19 +00:00
//! @endcond
2000-10-08 21:15:28 +00:00
2002-11-12 00:15:01 +00:00
/**
* \ brief CTCSS and DCS type definition .
2002-11-28 22:38:06 +00:00
*
* 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 .
2000-10-08 21:15:28 +00:00
*/
2002-11-12 00:15:01 +00:00
typedef unsigned int tone_t ;
2000-10-08 21:15:28 +00:00
2017-08-07 13:04:25 +00:00
2002-11-12 00:15:01 +00:00
/**
* \ brief Port type
2000-10-08 21:15:28 +00:00
*/
2003-03-19 23:41:44 +00:00
typedef enum rig_port_e {
2017-08-07 13:04:25 +00:00
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 */
2003-03-19 23:41:44 +00:00
} rig_port_t ;
2000-10-08 21:15:28 +00:00
2017-08-07 13:04:25 +00:00
2002-11-12 00:15:01 +00:00
/**
* \ brief Serial parity
*/
2000-10-08 21:15:28 +00:00
enum serial_parity_e {
2017-08-07 13:04:25 +00:00
RIG_PARITY_NONE = 0 , /*!< No parity */
RIG_PARITY_ODD , /*!< Odd */
RIG_PARITY_EVEN , /*!< Even */
RIG_PARITY_MARK , /*!< Mark */
RIG_PARITY_SPACE /*!< Space */
2000-10-08 21:15:28 +00:00
} ;
2017-08-07 13:04:25 +00:00
2002-11-12 00:15:01 +00:00
/**
* \ brief Serial handshake
*/
2000-10-08 21:15:28 +00:00
enum serial_handshake_e {
2017-08-07 13:04:25 +00:00
RIG_HANDSHAKE_NONE = 0 , /*!< No handshake */
RIG_HANDSHAKE_XONXOFF , /*!< Software XON/XOFF */
RIG_HANDSHAKE_HARDWARE /*!< Hardware CTS/RTS */
2000-10-08 21:15:28 +00:00
} ;
2003-02-23 22:34:54 +00:00
/**
* \ brief Serial control state
*/
enum serial_control_state_e {
2017-08-07 13:04:25 +00:00
RIG_SIGNAL_UNSET = 0 , /*!< Unset or tri-state */
RIG_SIGNAL_ON , /*!< ON */
RIG_SIGNAL_OFF /*!< OFF */
2003-02-23 22:34:54 +00:00
} ;
2017-08-07 13:04:25 +00:00
/**
* \ brief Rig type flags
*/
2003-03-19 23:41:44 +00:00
typedef enum {
2017-08-07 13:04:25 +00:00
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 */
2003-03-19 23:41:44 +00:00
} rig_type_t ;
2001-08-08 06:07:20 +00:00
2020-04-09 22:56:19 +00:00
//! @cond Doxygen_Suppress
2001-08-08 06:07:20 +00:00
# define RIG_FLAG_TRANSCEIVER (RIG_FLAG_RECEIVER|RIG_FLAG_TRANSMITTER)
2002-11-28 22:38:06 +00:00
# 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)
2001-08-08 06:07:20 +00:00
2017-08-07 13:04:25 +00:00
# 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
2020-04-09 22:56:19 +00:00
//! @endcond
2001-08-08 06:07:20 +00:00
2000-10-08 21:15:28 +00:00
2002-11-12 00:15:01 +00:00
/**
* \ brief Development status of the backend
2000-10-08 21:15:28 +00:00
*/
enum rig_status_e {
2017-08-07 13:04:25 +00:00
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 */
2000-10-08 21:15:28 +00:00
} ;
2017-08-07 13:04:25 +00:00
/**
* \ brief Map all deprecated RIG_STATUS_NEW references to
* RIG_STATUS_UNTESTED for backward compatibility
*/
# define RIG_STATUS_NEW RIG_STATUS_UNTESTED
2008-10-25 11:36:02 +00:00
2002-11-12 00:15:01 +00:00
/**
2003-03-19 23:41:44 +00:00
* \ brief Repeater shift type
2002-11-12 00:15:01 +00:00
*/
2003-03-19 23:41:44 +00:00
typedef enum {
2017-08-07 13:04:25 +00:00
RIG_RPT_SHIFT_NONE = 0 , /*!< No repeater shift */
RIG_RPT_SHIFT_MINUS , /*!< "-" shift */
RIG_RPT_SHIFT_PLUS /*!< "+" shift */
2003-03-19 23:41:44 +00:00
} rptr_shift_t ;
2000-10-08 21:15:28 +00:00
2017-08-07 13:04:25 +00:00
2002-11-12 00:15:01 +00:00
/**
* \ brief Split mode
*/
2003-03-19 23:41:44 +00:00
typedef enum {
2017-08-07 13:04:25 +00:00
RIG_SPLIT_OFF = 0 , /*!< Split mode disabled */
RIG_SPLIT_ON /*!< Split mode enabled */
2003-03-19 23:41:44 +00:00
} split_t ;
2000-10-10 22:09:54 +00:00
2017-08-07 13:04:25 +00:00
2002-11-12 00:15:01 +00:00
/**
* \ brief Frequency type ,
2017-08-07 13:04:25 +00:00
*
2004-01-15 23:04:52 +00:00
* Frequency type unit in Hz , able to hold SHF frequencies .
2003-03-19 23:41:44 +00:00
*/
2004-01-15 23:04:52 +00:00
typedef double freq_t ;
2017-08-07 13:04:25 +00:00
/**
* \ brief printf ( 3 ) format to be used for freq_t type
*/
2005-01-24 23:04:35 +00:00
# define PRIfreq "f"
2017-08-07 13:04:25 +00:00
/**
* \ brief scanf ( 3 ) format to be used for freq_t type
*/
2005-01-24 23:04:35 +00:00
# define SCNfreq "lf"
2020-04-09 22:56:19 +00:00
/**
* \ brief printf ( 3 ) format to be used for freq_t type
*/
2005-01-24 23:04:35 +00:00
# define FREQFMT SCNfreq
2003-03-19 23:41:44 +00:00
2017-08-07 13:04:25 +00:00
2002-11-12 00:15:01 +00:00
/**
* \ brief Short frequency type
2017-08-07 13:04:25 +00:00
*
2007-11-01 01:13:30 +00:00
* Frequency in Hz restricted to 31 bits , suitable for offsets , shifts , etc . .
2002-11-12 00:15:01 +00:00
*/
2001-04-22 13:54:48 +00:00
typedef signed long shortfreq_t ;
2020-04-09 22:56:19 +00:00
/** \brief \c Macro to return Hz when f=Hz */
2017-08-07 13:04:25 +00:00
# define Hz(f) ((freq_t)(f))
2020-04-09 22:56:19 +00:00
/** \brief \c Macro to return Hz when f=kHz */
2017-08-07 13:04:25 +00:00
# define kHz(f) ((freq_t)((f)*(freq_t)1000))
2020-04-09 22:56:19 +00:00
/** \brief \c Macro to return Hz when f=MHz */
2017-08-07 13:04:25 +00:00
# define MHz(f) ((freq_t)((f)*(freq_t)1000000))
2020-04-09 22:56:19 +00:00
/** \brief \c Macro to return Hz when f=GHz */
2017-08-07 13:04:25 +00:00
# define GHz(f) ((freq_t)((f)*(freq_t)1000000000))
2001-04-22 13:54:48 +00:00
2020-04-09 22:56:19 +00:00
/** \brief \c Macro to return short Hz when f=Hz */
2017-08-07 13:04:25 +00:00
# define s_Hz(f) ((shortfreq_t)(f))
2020-04-09 22:56:19 +00:00
/** \brief \c Macro to return short Hz when f=kHz */
2017-08-07 13:04:25 +00:00
# define s_kHz(f) ((shortfreq_t)((f)*(shortfreq_t)1000))
2020-04-09 22:56:19 +00:00
/** \brief \c Macro to return short Hz when f=MHz */
2017-08-07 13:04:25 +00:00
# define s_MHz(f) ((shortfreq_t)((f)*(shortfreq_t)1000000))
2020-04-09 22:56:19 +00:00
/** \brief \c Macro to return short Hz when f=GHz */
2017-08-07 13:04:25 +00:00
# define s_GHz(f) ((shortfreq_t)((f)*(shortfreq_t)1000000000))
2003-10-20 22:15:02 +00:00
2020-04-09 22:56:19 +00:00
/** \brief \c Frequency none -- used as default value for checking */
2001-04-22 13:54:48 +00:00
# define RIG_FREQ_NONE Hz(0)
2002-07-08 22:20:15 +00:00
2002-11-12 00:15:01 +00:00
/**
* \ brief VFO definition
*
2007-11-01 01:13:30 +00:00
* There are several ways of using a vfo_t . For most cases , using RIG_VFO_A ,
2002-11-12 00:15:01 +00:00
* RIG_VFO_B , RIG_VFO_CURR , etc . , as opaque macros should suffice .
*
* Strictly speaking a VFO is Variable Frequency Oscillator .
2007-11-01 01:13:30 +00:00
* 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 .
2002-11-12 00:15:01 +00:00
*/
2019-12-02 20:46:41 +00:00
typedef unsigned int vfo_t ;
2002-11-12 00:15:01 +00:00
2007-11-26 20:54:12 +00:00
/** \brief '' -- used in caps */
2019-11-28 15:57:49 +00:00
2020-03-23 15:13:02 +00:00
# define RIG_VFO_N(n) (1u<<(n))
2019-11-28 15:57:49 +00:00
2020-04-09 22:56:19 +00:00
/** \brief \c VFONone -- vfo unknown */
2017-08-07 13:04:25 +00:00
# define RIG_VFO_NONE 0
2002-11-28 22:38:06 +00:00
2019-11-28 15:57:49 +00:00
/** \brief \c VFOA -- VFO A */
# define RIG_VFO_A RIG_VFO_N(0)
2003-03-10 08:40:13 +00:00
2019-11-28 15:57:49 +00:00
/** \brief \c VFOB -- VFO B */
# define RIG_VFO_B RIG_VFO_N(1)
2003-02-23 22:34:54 +00:00
2019-11-28 15:57:49 +00:00
/** \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 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 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)
2002-11-28 22:38:06 +00:00
2007-11-26 20:54:12 +00:00
/** \brief \c VFO -- means (last or any)VFO mode, with set_vfo */
2019-11-28 15:57:49 +00:00
# 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)
2020-04-09 22:56:19 +00:00
/** \brief \c Flag to set if VFO can transmit */
2019-11-28 15:57:49 +00:00
# define RIG_VFO_TX_FLAG RIG_VFO_N(30)
2021-02-09 21:41:33 +00:00
/** \brief \c Flag to set all VFOS */
# define RIG_VFO_ALL RIG_VFO_N(31)
2019-12-02 20:46:41 +00:00
// we and also use RIG_VFO_N(31) if needed
2019-11-28 15:57:49 +00:00
// Misc VFO Macros
2002-11-28 22:38:06 +00:00
2020-04-09 22:56:19 +00:00
/** \brief \c Macro to tell you if VFO can transmit */
2017-08-07 13:04:25 +00:00
# define RIG_VFO_TX_VFO(v) ((v)|RIG_VFO_TX_FLAG)
2002-11-28 22:38:06 +00:00
2007-11-26 20:54:12 +00:00
/** \brief \c TX -- alias for split tx or uplink, of VFO_CURR */
2017-08-07 13:04:25 +00:00
# define RIG_VFO_TX RIG_VFO_TX_VFO(RIG_VFO_CURR)
2002-07-08 22:20:15 +00:00
2007-11-26 20:54:12 +00:00
/** \brief \c RX -- alias for split rx or downlink */
2017-08-07 13:04:25 +00:00
# define RIG_VFO_RX RIG_VFO_CURR
2002-07-08 22:20:15 +00:00
2001-02-27 22:56:23 +00:00
2005-04-03 22:33:08 +00:00
/*
* targetable bitfields , for internal use .
* RIG_TARGETABLE_PURE means a pure targetable radio on every command
2020-10-31 22:19:08 +00:00
* 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
2020-11-01 13:48:52 +00:00
* For many rigs RITXIT , PTT , MEM , and BANK are non - VFO commands so need these flags to avoid unnecessary VFO swapping
2005-04-03 22:33:08 +00:00
*/
2020-04-09 22:56:19 +00:00
//! @cond Doxygen_Suppress
2005-04-03 22:33:08 +00:00
# define RIG_TARGETABLE_NONE 0
# define RIG_TARGETABLE_FREQ (1<<0)
# define RIG_TARGETABLE_MODE (1<<1)
# define RIG_TARGETABLE_PURE (1<<2)
2010-03-05 18:48:40 +00:00
# define RIG_TARGETABLE_TONE (1<<3)
# define RIG_TARGETABLE_FUNC (1<<4)
2020-10-12 14:41:12 +00:00
# define RIG_TARGETABLE_LEVEL (1<<5)
2020-10-31 22:19:08 +00:00
# define RIG_TARGETABLE_RITXIT (1<<6)
# define RIG_TARGETABLE_PTT (1<<7)
2020-11-01 13:48:52 +00:00
# define RIG_TARGETABLE_MEM (1<<8)
# define RIG_TARGETABLE_BANK (1<<9)
2021-01-08 13:16:45 +00:00
# define RIG_TARGETABLE_ANT (1<<10)
2020-11-01 23:00:44 +00:00
# define RIG_TARGETABLE_COMMON (RIG_TARGETABLE_RITXIT | RIG_TARGETABLE_PTT | RIG_TARGETABLE_MEM | RIG_TARGETABLE_BANK)
2005-04-03 22:33:08 +00:00
# define RIG_TARGETABLE_ALL 0x7fffffff
2020-04-09 22:56:19 +00:00
//! @endcond
2020-05-21 13:51:41 +00:00
//
//
// 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
2000-10-16 21:58:03 +00:00
2020-04-09 22:56:19 +00:00
/**
* \ brief Macro for bandpass to be set to normal
* \ def RIG_PASSBAND_NORMAL
*/
2020-11-10 20:17:15 +00:00
# define RIG_PASSBAND_NORMAL s_Hz(0)
2020-10-07 04:10:45 +00:00
2020-04-09 22:56:19 +00:00
/**
* \ brief Macro for bandpass to be left alone
*/
2017-08-07 13:04:25 +00:00
# define RIG_PASSBAND_NOCHANGE s_Hz(-1)
2020-11-10 20:17:15 +00:00
2002-11-12 00:15:01 +00:00
/**
2017-08-07 13:04:25 +00:00
*
* \ sa rig_passband_normal ( ) , rig_passband_narrow ( ) , rig_passband_wide ( )
2001-02-27 22:56:23 +00:00
*/
typedef shortfreq_t pbwidth_t ;
2002-11-12 00:15:01 +00:00
/**
* \ brief DCD status
*/
2003-03-19 23:41:44 +00:00
typedef enum dcd_e {
2017-08-07 13:04:25 +00:00
RIG_DCD_OFF = 0 , /*!< Squelch closed */
RIG_DCD_ON /*!< Squelch open */
2003-03-19 23:41:44 +00:00
} dcd_t ;
2001-02-14 23:51:44 +00:00
2017-08-07 13:04:25 +00:00
2002-11-12 00:15:01 +00:00
/**
* \ brief DCD type
2017-08-07 13:04:25 +00:00
*
* \ sa rig_get_dcd ( )
2002-11-12 00:15:01 +00:00
*/
2003-03-19 23:41:44 +00:00
typedef enum {
2017-08-07 13:04:25 +00:00
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 */
2018-03-29 21:55:25 +00:00
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 */
2003-03-19 23:41:44 +00:00
} dcd_type_t ;
2001-02-14 23:51:44 +00:00
2002-11-12 00:15:01 +00:00
/**
* \ brief PTT status
*/
2003-03-19 23:41:44 +00:00
typedef enum {
Fix spelling errors
Fixed using the following command:
codespell --write-changes --summary --skip=*.m4 --ignore-words-list="develope,get's,quitt,setts,som,ue,vektor"
codespell --write-changes --summary --skip=aclocal.m4,lib --ignore-words-list="develope,get's,quitt,setts,som,ue,vektor"
Codespell home page: https://github.com/codespell-project/codespell
2020-07-24 07:02:12 +00:00
RIG_PTT_OFF = 0 , /*!< PTT deactivated */
2017-08-07 13:04:25 +00:00
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 */
2003-03-19 23:41:44 +00:00
} ptt_t ;
2000-10-08 21:15:28 +00:00
2017-08-07 13:04:25 +00:00
2002-11-12 00:15:01 +00:00
/**
* \ brief PTT type
2017-08-07 13:04:25 +00:00
*
* \ sa rig_get_ptt ( )
2002-11-12 00:15:01 +00:00
*/
2003-03-19 23:41:44 +00:00
typedef enum {
2017-08-07 13:04:25 +00:00
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 */
2003-03-19 23:41:44 +00:00
} ptt_type_t ;
2000-10-08 21:15:28 +00:00
2017-08-07 13:04:25 +00:00
2002-11-12 00:15:01 +00:00
/**
* \ brief Radio power state
*/
2003-03-19 23:41:44 +00:00
typedef enum {
2017-08-07 13:04:25 +00:00
RIG_POWER_OFF = 0 , /*!< Power off */
RIG_POWER_ON = ( 1 < < 0 ) , /*!< Power on */
2019-06-12 20:52:35 +00:00
RIG_POWER_STANDBY = ( 1 < < 1 ) , /*!< Standby */
RIG_POWER_OPERATE = ( 1 < < 2 ) , /*!< Operate (from Standby) */
RIG_POWER_UNKNOWN = ( 1 < < 3 ) /*!< Unknown power status */
2003-03-19 23:41:44 +00:00
} powerstat_t ;
2001-03-02 18:46:27 +00:00
2017-08-07 13:04:25 +00:00
2002-11-12 00:15:01 +00:00
/**
* \ brief Reset operation
*/
2003-03-19 23:41:44 +00:00
typedef enum {
2017-08-07 13:04:25 +00:00
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 */
2003-03-19 23:41:44 +00:00
} reset_t ;
2001-03-04 23:06:30 +00:00
2000-10-16 21:58:03 +00:00
2002-11-12 00:15:01 +00:00
/**
* \ brief VFO operation
2007-11-01 01:13:30 +00:00
*
* A VFO operation is an action on a VFO ( or tunable memory ) .
2002-11-12 00:15:01 +00:00
* The difference with a function is that an action has no on / off
2003-03-19 23:41:44 +00:00
* status , it is performed at once .
2002-11-12 00:15:01 +00:00
*
2017-08-07 13:04:25 +00:00
* NOTE : the vfo argument for some vfo operation may be irrelevant ,
2002-11-12 00:15:01 +00:00
* and thus will be ignored .
2003-03-19 23:41:44 +00:00
*
2007-11-26 20:54:12 +00:00
* The VFO / MEM " mode " is set by rig_set_vfo . \ n
* \ c STRING used in rigctl
*
2017-08-07 13:04:25 +00:00
* \ sa rig_parse_vfo_op ( ) , rig_strvfop ( )
2002-11-12 00:15:01 +00:00
*/
2003-03-19 23:41:44 +00:00
typedef enum {
2017-08-07 13:04:25 +00:00
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 */
2003-03-19 23:41:44 +00:00
} vfo_op_t ;
/**
2007-11-26 20:54:12 +00:00
* \ brief Rig Scan operation
*
* Various scan operations supported by a rig . \ n
* \ c STRING used in rigctl
*
2017-08-07 13:04:25 +00:00
* \ sa rig_parse_scan ( ) , rig_strscan ( )
2003-03-19 23:41:44 +00:00
*/
typedef enum {
2017-08-07 13:04:25 +00:00
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 */
2003-03-19 23:41:44 +00:00
} scan_t ;
2001-06-26 20:55:29 +00:00
2017-08-07 13:04:25 +00:00
2002-11-28 22:38:06 +00:00
/**
2007-11-01 01:13:30 +00:00
* \ brief configuration token
2001-07-21 13:00:03 +00:00
*/
typedef long token_t ;
2017-08-07 13:04:25 +00:00
2020-04-09 22:56:19 +00:00
//! @cond Doxygen_Suppress
2001-07-21 13:00:03 +00:00
# define RIG_CONF_END 0
2020-04-09 22:56:19 +00:00
//! @endcond
2001-07-21 13:00:03 +00:00
2017-08-07 13:04:25 +00:00
2006-10-12 16:41:22 +00:00
/**
2007-11-01 01:13:30 +00:00
* \ brief parameter types
2007-02-28 08:52:49 +00:00
*
* Used with configuration , parameter and extra - parm tables .
2011-08-21 01:54:17 +00:00
*
2007-02-28 08:52:49 +00:00
* 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
2020-01-04 05:59:44 +00:00
* BINARY : val . b
2001-07-21 13:00:03 +00:00
*/
2007-02-28 08:52:49 +00:00
2007-11-01 01:13:30 +00:00
/* strongly inspired from soundmodem. Thanks Thomas! */
2003-03-19 23:41:44 +00:00
enum rig_conf_e {
2017-08-07 13:04:25 +00:00
RIG_CONF_STRING , /*!< String type */
RIG_CONF_COMBO , /*!< Combo type */
RIG_CONF_NUMERIC , /*!< Numeric type integer or real */
RIG_CONF_CHECKBUTTON , /*!< on/off type */
2020-01-04 05:59:44 +00:00
RIG_CONF_BUTTON , /*!< Button type */
RIG_CONF_BINARY /*!< Binary buffer type */
2003-03-19 23:41:44 +00:00
} ;
2001-07-21 13:00:03 +00:00
2020-04-09 22:56:19 +00:00
//! @cond Doxygen_Suppress
2018-03-29 21:55:25 +00:00
# define RIG_COMBO_MAX 16
2020-01-04 05:59:44 +00:00
# define RIG_BIN_MAX 80
2020-04-09 22:56:19 +00:00
//! @endcond
2001-12-20 07:42:57 +00:00
2002-11-12 00:15:01 +00:00
/**
* \ brief Configuration parameter structure .
*/
2001-07-21 13:00:03 +00:00
struct confparams {
2017-08-07 13:04:25 +00:00
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 */
2001-07-21 13:00:03 +00:00
} ;
2001-06-26 20:55:29 +00:00
2017-08-07 13:04:25 +00:00
/**
* \ brief Announce
2007-11-01 01:13:30 +00:00
*
2003-03-19 23:41:44 +00:00
* Designate optional speech synthesizer .
2001-03-01 00:23:14 +00:00
*/
2003-03-19 23:41:44 +00:00
typedef enum {
2017-08-07 13:04:25 +00:00
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 */
2003-03-19 23:41:44 +00:00
} ann_t ;
2001-05-04 22:34:33 +00:00
2001-02-11 23:04:54 +00:00
2020-04-09 22:56:19 +00:00
/**
* \ brief Antenna typedef
* \ typedef ant_t
*/
2007-11-01 01:13:30 +00:00
/**
* \ brief Antenna number
2020-04-09 22:56:19 +00:00
* \ 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
2007-11-01 01:13:30 +00:00
*/
2020-02-02 14:38:10 +00:00
typedef unsigned int ant_t ;
2000-10-16 21:58:03 +00:00
2017-08-07 13:04:25 +00:00
# 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)
2020-02-18 12:31:18 +00:00
# define RIG_ANT_UNKNOWN RIG_ANT_N(30)
2020-02-02 14:38:10 +00:00
# define RIG_ANT_CURR RIG_ANT_N(31)
2019-05-30 06:37:49 +00:00
# define RIG_ANT_MAX 32
2002-11-28 22:38:06 +00:00
2006-10-12 16:41:22 +00:00
/**
* \ brief AGC delay settings
*/
2002-11-12 00:15:01 +00:00
/* TODO: kill me, and replace by real AGC delay */
2000-10-16 21:58:03 +00:00
enum agc_level_e {
2017-08-07 13:04:25 +00:00
RIG_AGC_OFF = 0 ,
RIG_AGC_SUPERFAST ,
RIG_AGC_FAST ,
RIG_AGC_SLOW ,
RIG_AGC_USER , /*!< user selectable */
RIG_AGC_MEDIUM ,
RIG_AGC_AUTO
2000-10-16 21:58:03 +00:00
} ;
2020-04-09 22:56:19 +00:00
//! @cond Doxygen_Suppress
2019-06-01 06:51:17 +00:00
# define RIG_AGC_LAST RIG_AGC_AUTO
2020-04-09 22:56:19 +00:00
//! @endcond
2017-08-07 13:04:25 +00:00
2002-11-12 00:15:01 +00:00
/**
* \ brief Level display meters
*/
2001-04-28 12:47:54 +00:00
enum meter_level_e {
2017-08-07 13:04:25 +00:00
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 */
2020-11-11 14:21:38 +00:00
RIG_METER_VDD = ( 1 < < 6 ) , /*< Final Amp Voltage */
RIG_METER_TEMP = ( 1 < < 7 ) /*< Final Amp Voltage */
2001-04-28 12:47:54 +00:00
} ;
2017-08-07 13:04:25 +00:00
2002-11-12 00:15:01 +00:00
/**
* \ brief Universal approach for passing values
2017-08-07 13:04:25 +00:00
*
* \ sa rig_set_level ( ) , rig_get_level ( ) , rig_set_parm ( ) , rig_get_parm ( )
2000-10-16 21:58:03 +00:00
*/
2003-03-19 23:41:44 +00:00
typedef union {
2020-01-04 05:59:44 +00:00
signed int i ; /*!< Signed integer */
float f ; /*!< Single precision float */
char * s ; /*!< Pointer to char string */
const char * cs ; /*!< Pointer to constant char string */
2020-04-09 22:56:19 +00:00
//! @cond Doxygen_Suppress
2020-01-04 05:59:44 +00:00
struct {
int l ; /*!< Length of data */
unsigned char * d ; /* Pointer to data buffer */
} b ;
2020-04-09 22:56:19 +00:00
//! @endcond
2003-03-19 23:41:44 +00:00
} value_t ;
2017-08-07 13:04:25 +00:00
/**
* \ brief Rig Level Settings
2007-11-26 20:54:12 +00:00
*
* Various operating levels supported by a rig . \ n
* \ c STRING used in rigctl
*
2017-08-07 13:04:25 +00:00
* \ sa rig_parse_level ( ) , rig_strlevel ( )
2007-11-26 20:54:12 +00:00
*/
2021-01-03 14:19:16 +00:00
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, */
# define RIG_LEVEL_SLOPE_HIGH CONSTANT_64BIT_FLAG(24) /*!< \c SLOPE_HIGH -- Slope tune, high frequency cut, */
# define RIG_LEVEL_BKIN_DLYMS CONSTANT_64BIT_FLAG(25) /*!< \c BKIN_DLYMS -- BKin Delay, arg int Milliseconds */
2017-08-07 13:04:25 +00:00
/*!< These are not settable */
2021-01-03 14:19:16 +00:00
# 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_40 CONSTANT_64BIT_FLAG(40) /*!< \c Future use */
# define RIG_LEVEL_41 CONSTANT_64BIT_FLAG(41) /*!< \c Future use */
# define RIG_LEVEL_42 CONSTANT_64BIT_FLAG(42) /*!< \c Future use */
# define RIG_LEVEL_43 CONSTANT_64BIT_FLAG(43) /*!< \c Future use */
# define RIG_LEVEL_44 CONSTANT_64BIT_FLAG(44) /*!< \c Future use */
# define RIG_LEVEL_45 CONSTANT_64BIT_FLAG(45) /*!< \c Future use */
# define RIG_LEVEL_46 CONSTANT_64BIT_FLAG(46) /*!< \c Future use */
# define RIG_LEVEL_47 CONSTANT_64BIT_FLAG(47) /*!< \c Future use */
# 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 */
2000-10-16 21:58:03 +00:00
2020-04-09 22:56:19 +00:00
//! @cond Doxygen_Suppress
2020-12-16 23:47:49 +00:00
# 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)
2019-06-12 21:23:15 +00:00
2019-05-30 06:37:49 +00:00
# define RIG_LEVEL_READONLY_LIST (RIG_LEVEL_SQLSTAT|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)
2001-03-02 18:46:27 +00:00
2001-02-25 23:06:18 +00:00
# define RIG_LEVEL_IS_FLOAT(l) ((l)&RIG_LEVEL_FLOAT_LIST)
2001-03-02 18:46:27 +00:00
# define RIG_LEVEL_SET(l) ((l)&~RIG_LEVEL_READONLY_LIST)
2020-04-09 22:56:19 +00:00
//! @endcond
2001-02-25 23:06:18 +00:00
2003-03-19 23:41:44 +00:00
/**
2007-11-26 20:54:12 +00:00
* \ brief Rig Parameters
*
* Parameters are settings that are not VFO specific . \ n
* \ c STRING used in rigctl
*
2017-08-07 13:04:25 +00:00
* \ sa rig_parse_parm ( ) , rig_strparm ( )
2001-03-01 00:23:14 +00:00
*/
2003-03-19 23:41:44 +00:00
enum rig_parm_e {
2017-08-07 13:04:25 +00:00
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] */
2020-02-23 15:48:21 +00:00
RIG_PARM_KEYLIGHT = ( 1 < < 7 ) , /*!< \c KEYLIGHT -- Button backlight, on/off */
RIG_PARM_SCREENSAVER = ( 1 < < 8 ) /*!< \c SCREENSAVER -- rig specific timeouts */
2003-03-19 23:41:44 +00:00
} ;
2001-03-01 00:23:14 +00:00
2020-04-09 22:56:19 +00:00
//! @cond Doxygen_Suppress
2018-12-16 21:20:06 +00:00
# define RIG_PARM_FLOAT_LIST (RIG_PARM_BACKLIGHT|RIG_PARM_BAT|RIG_PARM_KEYLIGHT)
2001-05-04 22:34:33 +00:00
# define RIG_PARM_READONLY_LIST (RIG_PARM_BAT)
2001-03-01 00:23:14 +00:00
# define RIG_PARM_IS_FLOAT(l) ((l)&RIG_PARM_FLOAT_LIST)
2001-05-04 22:34:33 +00:00
# define RIG_PARM_SET(l) ((l)&~RIG_PARM_READONLY_LIST)
2020-04-09 22:56:19 +00:00
//! @endcond
2001-03-01 00:23:14 +00:00
2002-11-28 22:38:06 +00:00
/**
* \ brief Setting
*
* This can be a func , a level or a parm .
2007-11-26 20:54:12 +00:00
* Each bit designates one of them .
2002-11-28 22:38:06 +00:00
*/
2018-12-23 04:56:30 +00:00
typedef uint64_t setting_t ;
2000-10-16 21:58:03 +00:00
2020-04-09 22:56:19 +00:00
/**
* \ brief Maximum # of rig settings
*
*/
2019-06-12 20:52:35 +00:00
# define RIG_SETTING_MAX 64
2017-08-07 13:04:25 +00:00
/**
* \ brief Tranceive mode
* The rig notifies the host of any event , like freq changed , mode changed , etc .
2020-04-09 22:56:19 +00:00
* \ def RIG_TRN_OFF
* Turn it off
* \ brief Tranceive mode
* \ def RIG_TRN_RIG
* RIG_TRN_RIG means the rig acts asynchrousnly
* \ brief Tranceive mode
* \ def RIG_TRN_POLL
* RIG_TRN_POLL means we have to poll the rig
*
2000-10-08 21:15:28 +00:00
*/
2017-08-07 13:04:25 +00:00
# define RIG_TRN_OFF 0
# define RIG_TRN_RIG 1
# define RIG_TRN_POLL 2
2000-10-08 21:15:28 +00:00
2003-03-19 23:41:44 +00:00
/**
2007-11-26 20:54:12 +00:00
* \ brief Rig Function Settings
*
* Various operating functions supported by a rig . \ n
2013-02-01 00:00:50 +00:00
* \ c STRING used in rigctl / rigctld
2007-11-26 20:54:12 +00:00
*
2017-08-07 13:04:25 +00:00
* \ sa rig_parse_func ( ) , rig_strfunc ( )
2000-10-08 21:15:28 +00:00
*/
2013-02-01 00:00:50 +00:00
/*
* 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
2020-11-24 19:51:10 +00:00
* upper 32 bits set as well when assigned to the misc . c : rig_func_str structure .
2013-02-01 00:00:50 +00:00
* 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
2020-11-24 19:51:10 +00:00
* initialize the rig_func_str . func members . TNX KA6MAL , AC6SL . - N0NB
2013-02-01 00:00:50 +00:00
*/
2018-12-27 21:10:10 +00:00
# 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 */
2020-11-11 14:21:38 +00:00
# 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 */
2018-12-27 21:10:10 +00:00
# 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 -- Auto Passband/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 */
2020-01-19 17:15:44 +00:00
# ifndef SWIGLUAHIDE
/* Hide the top 32 bits from the old Lua binding as they can't be represented */
2018-12-27 21:10:10 +00:00
# define RIG_FUNC_NB2 CONSTANT_64BIT_FLAG (32) /*!< \c NB2 -- 2nd Noise Blanker */
2019-12-09 05:33:20 +00:00
# define RIG_FUNC_CSQL CONSTANT_64BIT_FLAG (33) /*!< \c CSQL -- DCS Squelch setting */
2018-12-27 21:10:10 +00:00
# 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 */
2019-01-01 18:33:22 +00:00
# define RIG_FUNC_BC2 CONSTANT_64BIT_FLAG (36) /*!< \c BC2 -- 2nd Beat Cancel */
2019-05-30 06:37:49 +00:00
# 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 */
2019-12-09 05:33:20 +00:00
# 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 */
2021-02-26 21:22:41 +00:00
# define RIG_FUNC_SLICE CONSTANT_64BIT_FLAG (41) /*!< \c Rig slice selection -- Flex */
2020-04-09 22:56:19 +00:00
# define RIG_FUNC_BIT42 CONSTANT_64BIT_FLAG (42) /*!< \c available for future RIG_FUNC items */
# define RIG_FUNC_BIT43 CONSTANT_64BIT_FLAG (43) /*!< \c available for future RIG_FUNC items */
# define RIG_FUNC_BIT44 CONSTANT_64BIT_FLAG (44) /*!< \c available for future RIG_FUNC items */
# 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 */
2018-12-21 17:39:20 +00:00
/* 63 is this highest bit number that can be used */
2018-12-27 21:10:10 +00:00
# endif
2000-10-08 21:15:28 +00:00
2017-08-07 13:04:25 +00:00
/**
* \ brief power unit macros
2020-04-09 22:56:19 +00:00
* \ def mW
2017-08-07 13:04:25 +00:00
* Converts a power level integer to milliwatts . This is limited to 2
2020-04-09 22:56:19 +00:00
* megawatts on 32 bit systems .
2000-10-08 21:15:28 +00:00
*/
2017-08-07 13:04:25 +00:00
# define mW(p) ((int)(p))
2020-04-09 22:56:19 +00:00
/**
* \ brief power unit macros
* \ def Watts
*
* Converts a power level integer to watts . This is limited to 2
* gigawatts on 32 bit systems .
*/
2017-08-07 13:04:25 +00:00
# define Watts(p) ((int)((p)*1000))
2020-04-09 22:56:19 +00:00
/**
* \ brief power unit macros
* \ def W
*
* Same as Watts for the person who is too lazy to type Watts : - )
*/
2017-08-07 13:04:25 +00:00
# define W(p) Watts(p)
2020-04-09 22:56:19 +00:00
#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 : - )
*/
2017-08-07 13:04:25 +00:00
# define kW(p) ((int)((p)*1000000L))
2020-04-09 22:56:19 +00:00
# endif
2017-08-07 13:04:25 +00:00
2000-10-08 21:15:28 +00:00
2003-03-19 23:41:44 +00:00
/**
* \ brief Radio mode
2007-11-26 20:54:12 +00:00
*
* Various modes supported by a rig . \ n
* \ c STRING used in rigctl
*
2017-08-07 13:04:25 +00:00
* \ sa rig_parse_mode ( ) , rig_strrmode ( )
2018-12-16 21:20:06 +00:00
* TODO : Add new 8600 modes to rig2icom_mode ( ) and icom2rig_mode ( ) in frame . c
2002-11-28 22:38:06 +00:00
*/
2018-12-23 04:56:30 +00:00
typedef uint64_t rmode_t ;
2018-12-27 21:10:10 +00:00
# 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 */
2020-01-19 17:15:44 +00:00
# ifndef SWIGLUAHIDE
2018-12-27 21:10:10 +00:00
/* hide the top 32 bits from the Lua binding as they will not work */
2020-01-15 14:15:29 +00:00
# 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 */
2020-10-05 17:53:56 +00:00
# define RIG_MODE_PKTFMN CONSTANT_64BIT_FLAG (34) /*!< \c Yaesu DATA-FM-N */
2020-12-27 20:53:39 +00:00
# define RIG_MODE_SPEC CONSTANT_64BIT_FLAG (35) /*!< \c Unfiltered as in PowerSDR */
2020-04-09 22:56:19 +00:00
# define RIG_MODE_BIT36 CONSTANT_64BIT_FLAG (36) /*!< \c reserved for future expansion */
# define RIG_MODE_BIT37 CONSTANT_64BIT_FLAG (37) /*!< \c reserved for future expansion */
# 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 */
2018-12-27 21:10:10 +00:00
# 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
2009-01-03 14:08:00 +00:00
2017-08-07 13:04:25 +00:00
/**
* \ brief macro for backends , not to be used by rig_set_mode et al .
*/
# define RIG_MODE_SSB (RIG_MODE_USB|RIG_MODE_LSB)
2000-10-08 21:15:28 +00:00
2017-08-07 13:04:25 +00:00
/**
* \ brief macro for backends , not to be used by rig_set_mode et al .
*/
2004-08-08 19:42:59 +00:00
# define RIG_MODE_ECSS (RIG_MODE_ECSSUSB|RIG_MODE_ECSSLSB)
2020-04-09 22:56:19 +00:00
//! @cond Doxygen_Suppress
2017-08-07 13:04:25 +00:00
# define RIG_DBLST_END 0 /* end marker in a preamp/att level list */
2001-06-02 17:50:14 +00:00
# define RIG_IS_DBLST_END(d) ((d)==0)
2020-04-09 22:56:19 +00:00
//! @endcond
2001-06-02 17:50:14 +00:00
2017-08-07 13:04:25 +00:00
2002-11-12 00:15:01 +00:00
/**
* \ brief Frequency range
*
2007-11-01 01:13:30 +00:00
* Put together a group of this struct in an array to define
2002-11-12 00:15:01 +00:00
* what frequencies your rig has access to .
2002-02-28 11:00:57 +00:00
*/
2003-03-19 23:41:44 +00:00
typedef struct freq_range_list {
2019-08-18 04:20:48 +00:00
freq_t startf ; /*!< Start frequency */
freq_t endf ; /*!< End frequency */
2017-08-07 13:04:25 +00:00
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 */
2020-02-12 21:00:10 +00:00
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 */
2020-02-17 12:45:10 +00:00
char * label ; /*!< Label for this range that explains why. e.g. Icom rigs USA, EUR, ITR, TPE, KOR */
2003-03-19 23:41:44 +00:00
} freq_range_t ;
2000-10-08 21:15:28 +00:00
2020-04-09 22:56:19 +00:00
//! @cond Doxygen_Suppress
2017-08-07 13:04:25 +00:00
# define RIG_FRNG_END {Hz(0),Hz(0),RIG_MODE_NONE,0,0,RIG_VFO_NONE}
2019-08-18 04:20:48 +00:00
# define RIG_IS_FRNG_END(r) ((r).startf == Hz(0) && (r).endf == Hz(0))
2020-04-09 22:56:19 +00:00
//! @endcond
2017-08-07 13:04:25 +00:00
2002-11-12 00:15:01 +00:00
/**
* \ brief Tuning step definition
*
2003-02-23 22:34:54 +00:00
* Lists the tuning steps available for each mode .
*
2017-08-07 13:04:25 +00:00
* 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
2003-02-23 22:34:54 +00:00
* be the last one in the list .
2002-11-12 00:15:01 +00:00
*
2017-08-07 13:04:25 +00:00
* Note also that the minimum frequency resolution of the rig is determined by
* the lowest value in the Tuning step list .
2003-02-23 22:34:54 +00:00
*
2017-08-07 13:04:25 +00:00
* \ sa rig_set_ts ( ) , rig_get_resolution ( )
2000-10-08 21:15:28 +00:00
*/
struct tuning_step_list {
2017-08-07 13:04:25 +00:00
rmode_t modes ; /*!< Bit field of RIG_MODE's */
shortfreq_t ts ; /*!< Tuning step in Hz */
2000-10-08 21:15:28 +00:00
} ;
2020-04-09 22:56:19 +00:00
//! @cond Doxygen_Suppress
2017-08-07 13:04:25 +00:00
# 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)
2020-04-09 22:56:19 +00:00
//! @endcond
2017-08-07 13:04:25 +00:00
2000-10-08 21:15:28 +00:00
2002-11-12 00:15:01 +00:00
/**
* \ brief Filter definition
*
* Lists the filters available for each mode .
*
2017-08-07 13:04:25 +00:00
* 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 .
2003-02-23 22:34:54 +00:00
*
2017-08-07 13:04:25 +00:00
* The width field is the narrowest passband in a transmit / receive chain with
* regard to different IF .
2011-08-21 01:54:17 +00:00
*
2017-08-07 13:04:25 +00:00
* \ sa rig_set_mode ( ) , rig_passband_normal ( ) , rig_passband_narrow ( ) , rig_passband_wide ( )
2001-02-14 23:51:44 +00:00
*/
struct filter_list {
2017-08-07 13:04:25 +00:00
rmode_t modes ; /*!< Bit field of RIG_MODE's */
pbwidth_t width ; /*!< Passband width in Hz */
2001-02-14 23:51:44 +00:00
} ;
2020-04-09 22:56:19 +00:00
//! @cond Doxygen_Suppress
2017-08-07 13:04:25 +00:00
# define RIG_FLT_ANY 0
# define RIG_FLT_END {RIG_MODE_NONE, 0}
# define RIG_IS_FLT_END(f) ((f).modes == RIG_MODE_NONE)
2020-04-09 22:56:19 +00:00
//! @endcond
2001-02-14 23:51:44 +00:00
2000-10-08 21:15:28 +00:00
2017-08-07 13:04:25 +00:00
/**
* \ 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)
2018-12-16 21:20:06 +00:00
/**
* \ brief programmed skip ( PSKIP ) memory channel during scan ( lock out ) , channel_t . flags
*/
# define RIG_CHFLAG_PSKIP (1<<2)
2002-07-08 22:20:15 +00:00
2002-11-12 00:15:01 +00:00
/**
* \ brief Extension attribute definition
*
*/
2002-07-09 20:40:28 +00:00
struct ext_list {
2017-08-07 13:04:25 +00:00
token_t token ; /*!< Token ID */
value_t val ; /*!< Value */
2002-07-09 20:40:28 +00:00
} ;
2020-04-09 22:56:19 +00:00
//! @cond Doxygen_Suppress
2002-11-12 00:15:01 +00:00
# define RIG_EXT_END {0, {.i=0}}
2017-08-07 13:04:25 +00:00
# define RIG_IS_EXT_END(x) ((x).token == 0)
2020-04-09 22:56:19 +00:00
//! @endcond
2002-07-09 20:40:28 +00:00
2002-11-12 00:15:01 +00:00
/**
2003-03-19 23:41:44 +00:00
* \ brief Channel structure
2002-11-12 00:15:01 +00:00
*
* The channel struct stores all the attributes peculiar to a VFO .
*
2017-08-07 13:04:25 +00:00
* \ sa rig_set_channel ( ) , rig_get_channel ( )
2000-10-08 21:15:28 +00:00
*/
struct channel {
2017-08-07 13:04:25 +00:00
int channel_num ; /*!< Channel number */
int bank_num ; /*!< Bank number */
vfo_t vfo ; /*!< VFO */
2020-02-02 14:38:10 +00:00
ant_t ant ; /*!< Selected antenna */
2017-08-07 13:04:25 +00:00
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 */
2020-03-23 15:13:02 +00:00
unsigned int flags ; /*!< Channel flags, see RIG_CHFLAG's */
2017-08-07 13:04:25 +00:00
char channel_desc [ MAXCHANDESC ] ; /*!< Name */
struct ext_list
* ext_levels ; /*!< Extension level value list, NULL ended. ext_levels can be NULL */
2000-10-08 21:15:28 +00:00
} ;
2017-08-07 13:04:25 +00:00
/**
* \ brief Channel structure typedef
*/
2000-10-08 21:15:28 +00:00
typedef struct channel channel_t ;
2002-11-12 00:15:01 +00:00
/**
* \ brief Channel capability definition
*
2007-11-01 01:13:30 +00:00
* Definition of the attributes that can be stored / retrieved in / from memory
2002-11-04 22:32:09 +00:00
*/
struct channel_cap {
2017-08-07 13:04:25 +00:00
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 */
2002-11-04 22:32:09 +00:00
} ;
2017-08-07 13:04:25 +00:00
/**
* \ brief Channel cap
*/
2002-11-04 22:32:09 +00:00
typedef struct channel_cap channel_cap_t ;
2002-11-12 00:15:01 +00:00
/**
* \ brief Memory channel type definition
*
* Definition of memory types . Depending on the type , the content
* of the memory channel has to be interpreted accordingly .
2011-08-21 01:54:17 +00:00
* For instance , a RIG_MTYPE_EDGE channel_t will hold only a start
2002-11-12 00:15:01 +00:00
* or stop frequency .
*
2017-08-07 13:04:25 +00:00
* \ sa chan_list ( )
2001-03-01 00:23:14 +00:00
*/
2003-03-19 23:41:44 +00:00
typedef enum {
2017-08-07 13:04:25 +00:00
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 */
2003-03-19 23:41:44 +00:00
} chan_type_t ;
2001-03-01 00:23:14 +00:00
2017-08-07 13:04:25 +00:00
2002-11-12 00:15:01 +00:00
/**
* \ brief Memory channel list definition
*
* Example for the Ic706MkIIG ( 99 memory channels , 2 scan edges , 2 call chans ) :
\ code
2017-08-07 13:04:25 +00:00
chan_t chan_list [ ] = {
{ 1 , 99 , RIG_MTYPE_MEM } ,
{ 100 , 103 , RIG_MTYPE_EDGE } ,
{ 104 , 105 , RIG_MTYPE_CALL } ,
RIG_CHAN_END
}
2002-11-12 00:15:01 +00:00
\ endcode
*/
2001-03-01 00:23:14 +00:00
struct chan_list {
2019-08-18 04:20:48 +00:00
int startc ; /*!< Starting memory channel \b number */
int endc ; /*!< Ending memory channel \b number */
2017-08-07 13:04:25 +00:00
chan_type_t type ; /*!< Memory type. see chan_type_t */
channel_cap_t
mem_caps ; /*!< Definition of attributes that can be stored/retrieved */
2001-03-01 00:23:14 +00:00
} ;
2020-04-09 22:56:19 +00:00
//! @cond Doxygen_Suppress
2017-08-07 13:04:25 +00:00
# define RIG_CHAN_END {0,0,RIG_MTYPE_NONE}
# define RIG_IS_CHAN_END(c) ((c).type == RIG_MTYPE_NONE)
2020-04-09 22:56:19 +00:00
//! @endcond
2001-03-01 00:23:14 +00:00
2017-08-07 13:04:25 +00:00
/**
* \ 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
*/
2001-03-01 00:23:14 +00:00
typedef struct chan_list chan_t ;
2017-08-07 13:04:25 +00:00
2003-11-16 17:36:15 +00:00
/**
* \ brief level / parm granularity definition
*
2017-08-07 13:04:25 +00:00
* The granularity is undefined if min = 0 , max = 0 , and step = 0.
2003-11-16 17:36:15 +00:00
*
2017-08-07 13:04:25 +00:00
* 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 .
2003-11-16 17:36:15 +00:00
*
2017-08-07 13:04:25 +00:00
* 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 ) .
2003-11-16 17:36:15 +00:00
*/
struct gran {
2017-08-07 13:04:25 +00:00
value_t min ; /*!< Minimum value */
value_t max ; /*!< Maximum value */
value_t step ; /*!< Step */
2003-11-16 17:36:15 +00:00
} ;
2017-08-07 13:04:25 +00:00
/**
* \ brief gran_t type
*/
typedef struct gran gran_t ;
2003-11-16 17:36:15 +00:00
2017-08-07 13:04:25 +00:00
/**
* \ brief Calibration table struct
*/
2003-11-16 17:36:15 +00:00
struct cal_table {
2017-08-07 13:04:25 +00:00
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 [ MAX_CAL_LENGTH ] ; /*!< table of plots */
2003-11-16 17:36:15 +00:00
} ;
/**
* \ brief calibration table type
*
* cal_table_t is a data type suited to hold linear calibration .
2007-11-01 01:13:30 +00:00
* cal_table_t . size tells the number of plots cal_table_t . table contains .
2003-11-16 17:36:15 +00:00
*
2011-08-21 01:54:17 +00:00
* If a value is below or equal to cal_table_t . table [ 0 ] . raw ,
2003-11-16 17:36:15 +00:00
* rig_raw2val ( ) will return cal_table_t . table [ 0 ] . val .
*
2011-08-21 01:54:17 +00:00
* If a value is greater or equal to cal_table_t . table [ cal_table_t . size - 1 ] . raw ,
2003-11-16 17:36:15 +00:00
* rig_raw2val ( ) will return cal_table_t . table [ cal_table_t . size - 1 ] . val .
*/
typedef struct cal_table cal_table_t ;
2020-04-09 22:56:19 +00:00
//! @cond Doxygen_Suppress
2003-11-16 17:36:15 +00:00
# define EMPTY_STR_CAL { 0, { { 0, 0 }, } }
2020-04-09 22:56:19 +00:00
//! @endcond Doxygen_Suppress
2001-03-01 00:23:14 +00:00
2000-10-08 21:15:28 +00:00
2019-05-30 06:37:49 +00:00
/**
* \ 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 [ 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 ;
2020-04-09 22:56:19 +00:00
//! @cond Doxygen_Suppress
2019-05-30 06:37:49 +00:00
# define EMPTY_FLOAT_CAL { 0, { { 0, 0f }, } }
2017-08-07 13:04:25 +00:00
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 ) ;
2020-04-09 22:56:19 +00:00
//! @endcond
2017-08-07 13:04:25 +00:00
2005-04-20 14:44:04 +00:00
2002-11-12 00:15:01 +00:00
/**
* \ brief Rig data structure .
*
2017-08-07 13:04:25 +00:00
* 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 .
2002-11-12 00:15:01 +00:00
*
2000-10-08 21:15:28 +00:00
* 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 .
2017-08-07 13:04:25 +00:00
*
2020-03-08 13:39:11 +00:00
* mdblack : Don ' t move or add fields around without bumping the version numbers
* DLL or shared library replacement depends on order
2000-10-08 21:15:28 +00:00
*/
2020-04-09 22:56:19 +00:00
//! @cond Doxygen_Suppress
2020-03-06 05:48:14 +00:00
# define RIG_MODEL(arg) .rig_model=arg,.macro_name=#arg
2000-10-08 21:15:28 +00:00
struct rig_caps {
2017-08-07 13:04:25 +00:00
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 */
2020-02-11 09:48:13 +00:00
const struct confparams * extfuncs ; /*!< Extension func list, \sa ext.c */
2020-01-06 19:54:09 +00:00
int * ext_tokens ; /*!< Extension token list */
2017-08-07 13:04:25 +00:00
const tone_t * ctcss_list ; /*!< CTCSS tones list, zero ended */
const tone_t * dcs_list ; /*!< DCS code list, zero ended */
int preamp [ MAXDBLSTSIZ ] ; /*!< Preamp list in dB, 0 terminated */
int attenuator [ MAXDBLSTSIZ ] ; /*!< Preamp 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 */
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 [ CHANLSTSIZ ] ; /*!< Channel list, zero ended */
2020-02-17 12:45:10 +00:00
// As of 2020-02-12 we know of 5 models from Icom USA, EUR, ITR, TPE, KOR for the IC-9700
2020-02-18 12:31:18 +00:00
// 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
2020-02-17 12:45:10 +00:00
freq_range_t rx_range_list1 [ FRQRANGESIZ ] ; /*!< Receive frequency range list #1 */
freq_range_t tx_range_list1 [ FRQRANGESIZ ] ; /*!< Transmit frequency range list #1 */
freq_range_t rx_range_list2 [ FRQRANGESIZ ] ; /*!< Receive frequency range list #2 */
freq_range_t tx_range_list2 [ FRQRANGESIZ ] ; /*!< Transmit frequency range list #2 */
2020-02-18 12:31:18 +00:00
freq_range_t rx_range_list3 [ FRQRANGESIZ ] ; /*!< Receive frequency range list #3 */
freq_range_t tx_range_list3 [ FRQRANGESIZ ] ; /*!< Transmit frequency range list #3 */
freq_range_t rx_range_list4 [ FRQRANGESIZ ] ; /*!< Receive frequency range list #4 */
freq_range_t tx_range_list4 [ FRQRANGESIZ ] ; /*!< Transmit frequency range list #4 */
freq_range_t rx_range_list5 [ FRQRANGESIZ ] ; /*!< Receive frequency range list #5 */
freq_range_t tx_range_list5 [ FRQRANGESIZ ] ; /*!< Transmit frequency range list #5 */
2017-08-07 13:04:25 +00:00
struct tuning_step_list tuning_steps [ TSLSTSIZ ] ; /*!< Tuning step list */
struct filter_list filters [ FLTLSTSIZ ] ; /*!< mode/filter table, at -6dB */
2019-05-30 06:37:49 +00:00
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 */
2017-08-07 13:04:25 +00:00
const struct confparams * cfgparams ; /*!< Configuration parametres. */
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 ) ;
2020-01-21 23:53:12 +00:00
int ( * set_ant ) ( RIG * rig , vfo_t vfo , ant_t ant , value_t option ) ;
2020-02-18 12:31:18 +00:00
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 ) ;
2017-08-07 13:04:25 +00:00
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 ) ;
2003-03-19 23:41:44 +00:00
2017-08-07 13:04:25 +00:00
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 ) ;
2002-11-12 00:15:01 +00:00
2020-02-11 09:48:13 +00:00
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 ) ;
2017-08-07 13:04:25 +00:00
int ( * set_ext_parm ) ( RIG * rig , token_t token , value_t val ) ;
int ( * get_ext_parm ) ( RIG * rig , token_t token , value_t * val ) ;
2002-11-12 00:15:01 +00:00
2017-08-07 13:04:25 +00:00
int ( * set_conf ) ( RIG * rig , token_t token , const char * val ) ;
int ( * get_conf ) ( RIG * rig , token_t token , char * val ) ;
2002-11-12 00:15:01 +00:00
2017-08-07 13:04:25 +00:00
int ( * send_dtmf ) ( RIG * rig , vfo_t vfo , const char * digits ) ;
int ( * recv_dtmf ) ( RIG * rig , vfo_t vfo , char * digits , int * length ) ;
2002-11-12 00:15:01 +00:00
2017-08-07 13:04:25 +00:00
int ( * send_morse ) ( RIG * rig , vfo_t vfo , const char * msg ) ;
2020-10-16 13:41:57 +00:00
int ( * stop_morse ) ( RIG * rig , vfo_t vfo ) ;
2020-10-18 17:34:36 +00:00
int ( * wait_morse ) ( RIG * rig , vfo_t vfo ) ;
2002-11-12 00:15:01 +00:00
2020-02-06 00:00:34 +00:00
int ( * send_voice_mem ) ( RIG * rig , vfo_t vfo , int ch ) ;
2017-08-07 13:04:25 +00:00
int ( * set_bank ) ( RIG * rig , vfo_t vfo , int bank ) ;
2000-10-08 21:15:28 +00:00
2017-08-07 13:04:25 +00:00
int ( * set_mem ) ( RIG * rig , vfo_t vfo , int ch ) ;
int ( * get_mem ) ( RIG * rig , vfo_t vfo , int * ch ) ;
2000-10-08 21:15:28 +00:00
2017-08-07 13:04:25 +00:00
int ( * vfo_op ) ( RIG * rig , vfo_t vfo , vfo_op_t op ) ;
2001-02-11 23:04:54 +00:00
2017-08-07 13:04:25 +00:00
int ( * scan ) ( RIG * rig , vfo_t vfo , scan_t scan , int ch ) ;
2000-10-16 21:58:03 +00:00
2017-08-07 13:04:25 +00:00
int ( * set_trn ) ( RIG * rig , int trn ) ;
int ( * get_trn ) ( RIG * rig , int * trn ) ;
2000-10-08 21:15:28 +00:00
2017-08-07 13:04:25 +00:00
int ( * decode_event ) ( RIG * rig ) ;
2000-10-08 21:15:28 +00:00
2020-11-30 05:32:14 +00:00
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 ) ;
2000-10-08 21:15:28 +00:00
2017-08-07 13:04:25 +00:00
const char * ( * get_info ) ( RIG * rig ) ;
2000-10-08 21:15:28 +00:00
2020-11-30 05:32:14 +00:00
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 ) ;
2005-04-20 14:44:04 +00:00
2017-08-07 13:04:25 +00:00
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 ) ;
2005-04-20 14:44:04 +00:00
2020-05-27 17:21:41 +00:00
int ( * set_vfo_opt ) ( RIG * rig , int status ) ; // only for Net Rigctl device
2017-08-07 13:04:25 +00:00
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 */
2020-03-08 13:39:11 +00:00
const char * macro_name ; /*!< Rig model macro name */
2000-10-08 21:15:28 +00:00
} ;
2020-04-09 22:56:19 +00:00
//! @endcond
2000-10-08 21:15:28 +00:00
2021-01-01 05:05:54 +00:00
/**
* \ brief Enumeration of all rig_ functions
*
*/
//! @cond Doxygen_Suppress
// all functions enumerated for rig_get_function_ptr
enum rig_function_e {
2021-01-01 05:31:27 +00:00
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_SEND_VOICE_MEM ,
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
2021-01-01 05:05:54 +00:00
} ;
/**
* \ brief Function to return pointer to rig_ * function
*
*/
//! @cond Doxygen_Suppress
2021-01-02 15:22:02 +00:00
extern void * rig_get_function_ptr ( rig_model_t rig_model , enum rig_function_e rig_function ) ;
2017-08-07 13:04:25 +00:00
2021-01-01 16:59:36 +00:00
/**
* \ 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 ,
2021-02-07 12:56:48 +00:00
RIG_CAPS_PTT_TYPE ,
RIG_CAPS_HAS_GET_LEVEL
2021-01-01 16:59:36 +00:00
} ;
enum rig_caps_cptr_e {
2021-01-01 21:12:31 +00:00
RIG_CAPS_VERSION_CPTR ,
RIG_CAPS_MFG_NAME_CPTR ,
2021-01-03 15:16:20 +00:00
RIG_CAPS_MODEL_NAME_CPTR ,
RIG_CAPS_STATUS_CPTR
2021-01-01 16:59:36 +00:00
} ;
/**
* \ brief Function to return int value from rig - > caps
2021-02-28 14:59:57 +00:00
* Does not support > 32 - bit rig_caps values
*/
//! @cond Doxygen_Suppress
extern long long rig_get_caps_int ( rig_model_t rig_model , enum rig_caps_int_e rig_caps ) ;
2021-01-01 16:59:36 +00:00
/**
* \ brief Function to return char pointer value from rig - > caps
*
*/
//! @cond Doxygen_Suppress
2021-01-02 15:22:02 +00:00
extern const char * rig_get_caps_cptr ( rig_model_t rig_model , enum rig_caps_cptr_e rig_caps ) ;
2021-01-01 16:59:36 +00:00
2002-11-12 00:15:01 +00:00
/**
* \ brief Port definition
*
* Of course , looks like OO painstakingly programmed in C , sigh .
2001-06-04 17:01:21 +00:00
*/
2020-04-09 22:56:19 +00:00
//! @cond Doxygen_Suppress
2014-08-13 15:05:05 +00:00
typedef struct hamlib_port {
2017-08-07 13:04:25 +00:00
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 */
2021-01-10 13:46:07 +00:00
short retry ; /*!< Maximum number of retries, 0 to disable */
short flushx ; /*!< If true flush is done with read instead of TCFLUSH - MicroHam */
2017-08-07 13:04:25 +00:00
char pathname [ 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 */
2005-03-26 23:33:39 +00:00
} hamlib_port_t ;
2020-04-09 22:56:19 +00:00
//! @endcond
2005-03-26 23:33:39 +00:00
2005-03-28 09:41:43 +00:00
# if !defined(__APPLE__) || !defined(__cplusplus)
2005-03-26 23:33:39 +00:00
typedef hamlib_port_t port_t ;
# endif
2000-10-08 21:15:28 +00:00
2020-07-02 03:33:32 +00:00
# define HAMLIB_ELAPSED_GET 0
# define HAMLIB_ELAPSED_SET 1
# define HAMLIB_ELAPSED_INVALIDATE 2
2020-05-01 17:03:54 +00:00
typedef enum {
2020-07-02 15:23:41 +00:00
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
2020-07-02 03:33:32 +00:00
} hamlib_cache_t ;
2020-05-01 17:03:54 +00:00
/**
* \ 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 ;
2020-10-18 03:47:57 +00:00
freq_t freq ; // to be deprecated in 4.1 when full Main/Sub/A/B caching is implemented in 4.1
Fix spelling errors
Fixed using the following command:
codespell --write-changes --summary --skip=*.m4 --ignore-words-list="develope,get's,quitt,setts,som,ue,vektor"
codespell --write-changes --summary --skip=aclocal.m4,lib --ignore-words-list="develope,get's,quitt,setts,som,ue,vektor"
Codespell home page: https://github.com/codespell-project/codespell
2020-07-24 07:02:12 +00:00
// other abstraction here is based on dual vfo rigs and mapped to all others
2020-06-04 15:58:22 +00:00
// 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
Fix spelling errors
Fixed using the following command:
codespell --write-changes --summary --skip=*.m4 --ignore-words-list="develope,get's,quitt,setts,som,ue,vektor"
codespell --write-changes --summary --skip=aclocal.m4,lib --ignore-words-list="develope,get's,quitt,setts,som,ue,vektor"
Codespell home page: https://github.com/codespell-project/codespell
2020-07-24 07:02:12 +00:00
// For dual VFO rigs simplex operations are all done on MainA/MainB -- ergo this abstraction
2020-10-18 17:06:27 +00:00
freq_t freqCurr ; // VFO_CURR
2020-06-04 15:58:22 +00:00
freq_t freqMainA ; // VFO_A, VFO_MAIN, and VFO_MAINA
freq_t freqMainB ; // VFO_B, VFO_SUB, and VFO_MAINB
2021-02-08 18:54:33 +00:00
#if 0
2021-01-18 14:28:20 +00:00
freq_t freqMainC ; // VFO_C, VFO_MAINC
2021-02-08 18:54:33 +00:00
# endif
2020-10-18 04:42:57 +00:00
freq_t freqSubA ; // VFO_SUBA -- only for rigs with dual Sub VFOs
freq_t freqSubB ; // VFO_SUBB -- only for rigs with dual Sub VFOs
2021-02-07 21:03:43 +00:00
freq_t freqMem ; // VFO_MEM -- last MEM channel
2021-01-18 14:28:20 +00:00
#if 0 // future
freq_t freqSubC ; // VFO_SUBC -- only for rigs with 3 Sub VFOs
# endif
2020-05-01 17:03:54 +00:00
rmode_t mode ;
pbwidth_t width ;
ptt_t ptt ;
split_t split ;
vfo_t split_vfo ; // split caches two values
struct timespec time_freq ;
2020-10-20 03:22:59 +00:00
struct timespec time_freqCurr ;
2020-06-04 15:58:22 +00:00
struct timespec time_freqMainA ;
struct timespec time_freqMainB ;
2021-02-08 18:54:33 +00:00
#if 0
2020-10-18 04:42:57 +00:00
struct timespec time_freqMainC ;
2021-02-08 18:54:33 +00:00
# endif
2020-06-04 15:58:22 +00:00
struct timespec time_freqSubA ;
struct timespec time_freqSubB ;
2021-02-07 21:03:43 +00:00
struct timespec time_freqMem ;
2020-05-01 17:03:54 +00:00
struct timespec time_vfo ;
struct timespec time_mode ;
struct timespec time_ptt ;
struct timespec time_split ;
vfo_t vfo_freq ; // last vfo cached
vfo_t vfo_mode ; // last vfo cached
2020-05-25 04:42:35 +00:00
int satmode ; // if rig is in satellite mode
2020-05-01 17:03:54 +00:00
} ;
2002-11-12 00:15:01 +00:00
2011-08-21 01:54:17 +00:00
/**
2002-11-12 00:15:01 +00:00
* \ brief Rig state containing live data and customized fields .
2001-02-11 23:04:54 +00:00
*
* This struct contains live data , as well as a copy of capability fields
* that may be updated ( ie . customized )
*
* It is fine to move fields around , as this kind of struct should
* not be initialized like caps are .
2000-10-08 21:15:28 +00:00
*/
struct rig_state {
2017-08-07 13:04:25 +00:00
/*
* 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). */
2001-06-04 17:01:21 +00:00
2017-08-07 13:04:25 +00:00
double vfo_comp ; /*!< VFO compensation in PPM, 0.0 to disable */
2001-02-11 23:04:54 +00:00
2020-07-24 19:23:38 +00:00
int deprecated_itu_region ; /*!< ITU region to select among freq_range_t */
2017-08-07 13:04:25 +00:00
freq_range_t rx_range_list [ FRQRANGESIZ ] ; /*!< Receive frequency range list */
freq_range_t tx_range_list [ FRQRANGESIZ ] ; /*!< Transmit frequency range list */
2001-12-26 23:38:24 +00:00
2017-08-07 13:04:25 +00:00
struct tuning_step_list tuning_steps [ TSLSTSIZ ] ; /*!< Tuning step list */
2001-02-11 23:04:54 +00:00
2017-08-07 13:04:25 +00:00
struct filter_list filters [ FLTLSTSIZ ] ; /*!< Mode/filter table, at -6dB */
2001-02-14 23:51:44 +00:00
2017-08-07 13:04:25 +00:00
cal_table_t str_cal ; /*!< S-meter calibration table */
2003-11-16 17:36:15 +00:00
2017-08-07 13:04:25 +00:00
chan_t chan_list [ CHANLSTSIZ ] ; /*!< Channel list, zero ended */
2001-05-04 22:34:33 +00:00
2017-08-07 13:04:25 +00:00
shortfreq_t max_rit ; /*!< max absolute RIT */
shortfreq_t max_xit ; /*!< max absolute XIT */
shortfreq_t max_ifshift ; /*!< max absolute IF-SHIFT */
2001-02-11 23:04:54 +00:00
2017-08-07 13:04:25 +00:00
ann_t announces ; /*!< Announces bit field list */
2001-02-27 22:56:23 +00:00
2017-08-07 13:04:25 +00:00
int preamp [ MAXDBLSTSIZ ] ; /*!< Preamp list in dB, 0 terminated */
int attenuator [ MAXDBLSTSIZ ] ; /*!< Preamp list in dB, 0 terminated */
2001-12-26 23:38:24 +00:00
2017-08-07 13:04:25 +00:00
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 */
2001-02-11 23:04:54 +00:00
2017-08-07 13:04:25 +00:00
gran_t level_gran [ RIG_SETTING_MAX ] ; /*!< level granularity */
gran_t parm_gran [ RIG_SETTING_MAX ] ; /*!< parm granularity */
2001-05-04 22:34:33 +00:00
2002-06-30 10:17:03 +00:00
2017-08-07 13:04:25 +00:00
/*
* non overridable fields , internal use
*/
2001-12-26 23:38:24 +00:00
2017-08-07 13:04:25 +00:00
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. */
2001-06-15 06:59:47 +00:00
2017-08-07 13:04:25 +00:00
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 */
pbwidth_t current_width ; /*!< Passband width currently set */
vfo_t tx_vfo ; /*!< Tx VFO currently set */
2019-07-31 20:48:35 +00:00
rmode_t mode_list ; /*!< Complete list of modes for this rig */
2017-08-07 13:39:57 +00:00
int transmit ; /*!< rig should be transmitting i.e. hard
wired PTT asserted - used by rigs that
don ' t do CAT while in Tx */
2020-02-23 14:28:19 +00:00
freq_t lo_freq ; /*!< Local oscillator frequency of any transverter */
2020-02-24 15:34:02 +00:00
time_t twiddle_time ; /*!< time when vfo twiddling was detected */
int twiddle_timeout ; /*!< timeout to resume from twiddling */
2020-10-23 16:34:42 +00:00
// 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 */
2020-05-01 17:03:54 +00:00
struct rig_cache cache ;
2020-05-25 04:42:35 +00:00
int vfo_opt ; /*!< Is -o switch turned on? */
2020-07-04 22:23:39 +00:00
int auto_power_on ; /*!< Allow Hamlib to power rig
automatically if supported */
2020-07-04 16:26:54 +00:00
int auto_disable_screensaver ; /*!< Allow Hamlib to disable the
rig ' s screen saver automatically if
supported */
2020-10-13 04:27:13 +00:00
int ptt_share ; /*!< Share ptt port by open/close during get_ptt, set_ptt hogs the port while active */
2020-10-07 17:40:59 +00:00
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 */
2021-01-20 17:34:30 +00:00
unsigned char disable_yaesu_bandselect ; /*!< Disables Yaeus band select logic */
2021-02-18 12:57:40 +00:00
int twiddle_rit ; /*!< Suppresses VFOB reading (cached value used) so RIT control can be used */
2000-10-08 21:15:28 +00:00
} ;
2020-04-09 22:56:19 +00:00
//! @cond Doxygen_Suppress
2017-08-07 13:04:25 +00:00
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 ) ;
2005-04-06 21:27:28 +00:00
2020-04-09 22:56:19 +00:00
//! @endcond
2002-02-27 23:22:31 +00:00
2002-11-12 00:15:01 +00:00
/**
* \ brief Callback functions and args for rig event .
*
2011-08-21 01:54:17 +00:00
* Some rigs are able to notify the host computer the operator changed
2002-11-12 00:15:01 +00:00
* the freq / mode from the front panel , depressed a button , etc .
*
2007-11-01 01:13:30 +00:00
* Events from the rig are received through async io ,
2002-11-12 00:15:01 +00:00
* so callback functions will be called from the SIGIO sighandler context .
*
2007-11-01 01:13:30 +00:00
* Don ' t set these fields directly , use rig_set_freq_callback et . al . instead .
2002-11-12 00:15:01 +00:00
*
2011-08-21 01:54:17 +00:00
* Callbacks suit event based programming very well ,
2002-11-12 00:15:01 +00:00
* really appropriate in a GUI .
*
2017-08-07 13:04:25 +00:00
* \ sa rig_set_freq_callback ( ) , rig_set_mode_callback ( ) , rig_set_vfo_callback ( ) ,
* rig_set_ptt_callback ( ) , rig_set_dcd_callback ( )
2002-11-12 00:15:01 +00:00
*/
2000-10-08 21:15:28 +00:00
struct rig_callbacks {
2017-08-07 13:04:25 +00:00
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 */
/* etc.. */
2000-10-08 21:15:28 +00:00
} ;
2017-08-07 13:04:25 +00:00
2002-11-12 00:15:01 +00:00
/**
2003-03-19 23:41:44 +00:00
* \ brief The Rig structure
2002-11-12 00:15:01 +00:00
*
* 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 .
*
2017-08-07 13:04:25 +00:00
* \ sa rig_init ( ) , rig_caps ( ) , rig_state ( )
2000-10-08 21:15:28 +00:00
*/
2020-03-14 04:55:44 +00:00
struct s_rig {
2017-08-07 13:04:25 +00:00
struct rig_caps * caps ; /*!< Pointer to rig capabilities (read only) */
struct rig_state state ; /*!< Rig state */
struct rig_callbacks callbacks ; /*!< registered event callbacks */
2000-10-08 21:15:28 +00:00
} ;
/* --------------- API function prototypes -----------------*/
2020-04-09 22:56:19 +00:00
//! @cond Doxygen_Suppress
2002-07-08 22:20:15 +00:00
extern HAMLIB_EXPORT ( RIG * ) rig_init HAMLIB_PARAMS ( ( rig_model_t rig_model ) ) ;
extern HAMLIB_EXPORT ( int ) rig_open HAMLIB_PARAMS ( ( RIG * rig ) ) ;
2000-10-08 21:15:28 +00:00
2017-08-07 13:04:25 +00:00
/*
* General API commands , from most primitive to least . . : ( )
* List Set / Get functions pairs
*/
2002-07-08 22:20:15 +00:00
2020-06-23 04:54:11 +00:00
extern HAMLIB_EXPORT ( int )
2020-06-23 13:27:45 +00:00
rig_flush ( hamlib_port_t * port ) ;
2020-06-23 04:54:11 +00:00
2017-08-07 13:04:25 +00:00
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 ) ) ;
extern HAMLIB_EXPORT ( int )
rig_set_vfo HAMLIB_PARAMS ( ( RIG * rig ,
vfo_t vfo ) ) ;
extern HAMLIB_EXPORT ( int )
rig_get_vfo HAMLIB_PARAMS ( ( RIG * rig ,
vfo_t * vfo ) ) ;
2021-02-07 18:45:59 +00:00
extern HAMLIB_EXPORT ( int )
rig_get_vfo_info HAMLIB_PARAMS ( ( RIG * rig ,
vfo_t vfo , freq_t * freq , rmode_t * mode , pbwidth_t * width ) ) ;
2021-02-10 23:30:46 +00:00
extern HAMLIB_EXPORT ( const char * )
rig_get_vfo_list HAMLIB_PARAMS ( ( RIG * rig ) ) ;
2019-02-08 13:28:50 +00:00
extern HAMLIB_EXPORT ( int )
netrigctl_get_vfo_mode HAMLIB_PARAMS ( ( RIG * rig ) ) ;
2017-08-07 13:04:25 +00:00
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 ) ) ;
2002-07-08 22:20:15 +00:00
2003-04-06 18:40:36 +00:00
# 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); })
2002-07-08 22:20:15 +00:00
2017-08-07 13:04:25 +00:00
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 ) ) ;
2000-10-16 21:58:03 +00:00
2000-12-05 22:01:03 +00:00
# define rig_get_strength(r,v,s) rig_get_level((r),(v),RIG_LEVEL_STRENGTH, (value_t*)(s))
2000-10-16 21:58:03 +00:00
2017-08-07 13:04:25 +00:00
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 ) ) ;
2020-02-11 09:48:13 +00:00
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 ) ) ;
2017-08-07 13:04:25 +00:00
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 )
2020-09-16 15:10:35 +00:00
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 )
2017-08-07 13:04:25 +00:00
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 ,
2020-01-21 23:53:12 +00:00
ant_t ant , /* antenna */
value_t option ) ) ; /* optional ant info */
2017-08-07 13:04:25 +00:00
extern HAMLIB_EXPORT ( int )
rig_get_ant HAMLIB_PARAMS ( ( RIG * rig ,
vfo_t vfo ,
2020-02-02 14:38:10 +00:00
ant_t ant ,
2020-02-18 12:31:18 +00:00
value_t * option ,
2020-02-02 14:38:10 +00:00
ant_t * ant_curr ,
2020-02-18 12:31:18 +00:00
ant_t * ant_tx ,
ant_t * ant_rx ) ) ;
2017-08-07 13:04:25 +00:00
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 ) ) ;
2020-10-16 13:41:57 +00:00
extern HAMLIB_EXPORT ( int )
rig_stop_morse HAMLIB_PARAMS ( ( RIG * rig ,
vfo_t vfo ) ) ;
2020-10-18 17:34:36 +00:00
extern HAMLIB_EXPORT ( int )
rig_wait_morse HAMLIB_PARAMS ( ( RIG * rig ,
vfo_t vfo ) ) ;
2020-02-06 00:00:34 +00:00
extern HAMLIB_EXPORT ( int )
rig_send_voice_mem HAMLIB_PARAMS ( ( RIG * rig ,
vfo_t vfo ,
int ch ) ) ;
2017-08-07 13:04:25 +00:00
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 )
2020-11-30 05:32:14 +00:00
rig_set_channel HAMLIB_PARAMS ( ( RIG * rig ,
vfo_t vfo ,
2017-08-07 13:04:25 +00:00
const channel_t * chan ) ) ; /* mem */
extern HAMLIB_EXPORT ( int )
2020-11-30 05:32:14 +00:00
rig_get_channel HAMLIB_PARAMS ( ( RIG * rig ,
vfo_t vfo ,
2020-04-26 19:37:03 +00:00
channel_t * chan , int read_only ) ) ;
2017-08-07 13:04:25 +00:00
extern HAMLIB_EXPORT ( int )
2020-11-30 05:32:14 +00:00
rig_set_chan_all HAMLIB_PARAMS ( ( RIG * rig ,
vfo_t vfo ,
2017-08-07 13:04:25 +00:00
const channel_t chans [ ] ) ) ;
extern HAMLIB_EXPORT ( int )
2020-11-30 05:32:14 +00:00
rig_get_chan_all HAMLIB_PARAMS ( ( RIG * rig ,
vfo_t vfo ,
2017-08-07 13:04:25 +00:00
channel_t chans [ ] ) ) ;
extern HAMLIB_EXPORT ( int )
2020-11-30 05:32:14 +00:00
rig_set_chan_all_cb HAMLIB_PARAMS ( ( RIG * rig ,
vfo_t vfo ,
2017-08-07 13:04:25 +00:00
chan_cb_t chan_cb ,
rig_ptr_t ) ) ;
extern HAMLIB_EXPORT ( int )
2020-11-30 05:32:14 +00:00
rig_get_chan_all_cb HAMLIB_PARAMS ( ( RIG * rig ,
vfo_t vfo ,
2017-08-07 13:04:25 +00:00
chan_cb_t chan_cb ,
rig_ptr_t ) ) ;
extern HAMLIB_EXPORT ( int )
rig_set_mem_all_cb HAMLIB_PARAMS ( ( RIG * rig ,
2020-11-30 05:32:14 +00:00
vfo_t vfo ,
2017-08-07 13:04:25 +00:00
chan_cb_t chan_cb ,
confval_cb_t parm_cb ,
rig_ptr_t ) ) ;
extern HAMLIB_EXPORT ( int )
2020-11-30 05:32:14 +00:00
rig_get_mem_all_cb HAMLIB_PARAMS ( ( RIG * rig ,
vfo_t vfo ,
2017-08-07 13:04:25 +00:00
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 ,
2020-11-30 05:32:14 +00:00
vfo_t vfo ,
2017-08-07 13:04:25 +00:00
const channel_t * chan ,
const struct confparams * ,
const value_t * ) ) ;
extern HAMLIB_EXPORT ( int )
rig_get_mem_all HAMLIB_PARAMS ( ( RIG * rig ,
2020-11-30 05:32:14 +00:00
vfo_t vfo ,
2017-08-07 13:04:25 +00:00
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 ) ) ;
2021-02-07 18:45:59 +00:00
extern HAMLIB_EXPORT ( int )
rig_get_vfo_info_callback HAMLIB_PARAMS ( ( RIG * ,
vfo_cb_t ,
rig_ptr_t ) ) ;
2017-08-07 13:04:25 +00:00
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 ) ) ;
2020-02-24 15:34:02 +00:00
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 ) ) ;
2020-10-23 16:34:42 +00:00
extern HAMLIB_EXPORT ( int )
rig_set_uplink HAMLIB_PARAMS ( ( RIG * rig ,
int val ) ) ;
2017-08-07 13:04:25 +00:00
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 * )
2020-03-05 14:44:18 +00:00
rig_get_range HAMLIB_PARAMS ( ( const freq_range_t * range_list ,
2017-08-07 13:04:25 +00:00
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 ) ) ;
2002-07-09 20:40:28 +00:00
2020-03-26 04:07:42 +00:00
extern HAMLIB_EXPORT ( setting_t )
rig_idx2setting ( int i ) ;
2017-08-07 13:04:25 +00:00
/*
* 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 ) ) ;
2002-07-08 22:20:15 +00:00
2018-04-14 22:20:28 +00:00
extern HAMLIB_EXPORT ( void )
rig_set_debug_time_stamp HAMLIB_PARAMS ( ( int flag ) ) ;
2017-08-07 13:04:25 +00:00
# define rig_set_debug_level(level) rig_set_debug(level)
2002-07-08 22:20:15 +00:00
2017-08-07 13:04:25 +00:00
extern HAMLIB_EXPORT ( int )
rig_need_debug HAMLIB_PARAMS ( ( enum rig_debug_level_e debug_level ) ) ;
2002-07-08 22:20:15 +00:00
2019-11-30 16:04:31 +00:00
2021-01-30 17:03:08 +00:00
// this need to be fairly big to avoid compiler warnings
# define DEBUGMSGSAVE_SIZE 24000
2021-01-31 18:20:44 +00:00
extern HAMLIB_EXPORT_VAR ( char ) debugmsgsave [ DEBUGMSGSAVE_SIZE ] ; // last debug msg
2021-02-10 23:30:46 +00:00
extern HAMLIB_EXPORT_VAR ( char ) debugmsgsave2 [ DEBUGMSGSAVE_SIZE ] ; // last-1 debug msg
2019-11-30 16:04:31 +00:00
# ifndef __cplusplus
# ifdef __GNUC__
// doing the debug macro with a dummy sprintf allows gcc to check the format string
2021-01-29 15:35:46 +00:00
//#define rig_debug(debug_level,fmt,...) { char xxxbuf[16384]="";snprintf(xxxbuf,sizeof(xxxbuf),fmt,__VA_ARGS__);rig_debug(debug_level,fmt,##__VA_ARGS__); }
2021-02-10 23:30:46 +00:00
# define rig_debug(debug_level,fmt,...) { strcpy(debugmsgsave2, debugmsgsave);snprintf(debugmsgsave,sizeof(debugmsgsave),fmt,__VA_ARGS__);rig_debug(debug_level,fmt,##__VA_ARGS__); }
2019-11-30 16:04:31 +00:00
# endif
# endif
2017-08-07 13:04:25 +00:00
extern HAMLIB_EXPORT ( void )
rig_debug HAMLIB_PARAMS ( ( enum rig_debug_level_e debug_level ,
const char * fmt , . . . ) ) ;
2002-07-08 22:20:15 +00:00
2017-08-07 13:04:25 +00:00
extern HAMLIB_EXPORT ( vprintf_cb_t )
rig_set_debug_callback HAMLIB_PARAMS ( ( vprintf_cb_t cb ,
rig_ptr_t arg ) ) ;
2005-04-20 14:44:04 +00:00
2017-08-07 13:04:25 +00:00
extern HAMLIB_EXPORT ( FILE * )
rig_set_debug_file HAMLIB_PARAMS ( ( FILE * stream ) ) ;
2008-04-27 09:46:35 +00:00
2017-08-07 13:04:25 +00:00
extern HAMLIB_EXPORT ( int )
rig_register HAMLIB_PARAMS ( ( const struct rig_caps * caps ) ) ;
2005-04-20 14:44:04 +00:00
2017-08-07 13:04:25 +00:00
extern HAMLIB_EXPORT ( int )
rig_unregister HAMLIB_PARAMS ( ( rig_model_t rig_model ) ) ;
2002-07-08 22:20:15 +00:00
2017-08-07 13:04:25 +00:00
extern HAMLIB_EXPORT ( int )
rig_list_foreach HAMLIB_PARAMS ( ( int ( * cfunc ) ( const struct rig_caps * , rig_ptr_t ) ,
rig_ptr_t data ) ) ;
2002-07-08 22:20:15 +00:00
2021-01-03 05:37:54 +00:00
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 ) ) ;
2017-08-07 13:04:25 +00:00
extern HAMLIB_EXPORT ( int )
rig_load_backend HAMLIB_PARAMS ( ( const char * be_name ) ) ;
2002-07-08 22:20:15 +00:00
2017-08-07 13:04:25 +00:00
extern HAMLIB_EXPORT ( int )
rig_check_backend HAMLIB_PARAMS ( ( rig_model_t rig_model ) ) ;
2002-07-08 22:20:15 +00:00
2017-08-07 13:04:25 +00:00
extern HAMLIB_EXPORT ( int )
rig_load_all_backends HAMLIB_PARAMS ( ( void ) ) ;
2002-07-08 22:20:15 +00:00
2017-08-07 13:04:25 +00:00
typedef int ( * rig_probe_func_t ) ( const hamlib_port_t * , rig_model_t , rig_ptr_t ) ;
2001-05-04 22:34:33 +00:00
2017-08-07 13:04:25 +00:00
extern HAMLIB_EXPORT ( int )
rig_probe_all HAMLIB_PARAMS ( ( hamlib_port_t * p ,
rig_probe_func_t ,
rig_ptr_t ) ) ;
2003-03-10 08:40:13 +00:00
2017-08-07 13:04:25 +00:00
extern HAMLIB_EXPORT ( rig_model_t )
rig_probe HAMLIB_PARAMS ( ( hamlib_port_t * p ) ) ;
2001-06-04 21:13:11 +00:00
2000-10-08 21:15:28 +00:00
2004-05-17 21:09:45 +00:00
/* Misc calls */
extern HAMLIB_EXPORT ( const char * ) rig_strrmode ( rmode_t mode ) ;
2019-12-12 15:13:30 +00:00
extern HAMLIB_EXPORT ( int ) rig_strrmodes ( rmode_t modes , char * buf , int buflen ) ;
2004-05-17 21:09:45 +00:00
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_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 ) ;
2008-04-27 09:46:35 +00:00
extern HAMLIB_EXPORT ( const char * ) rig_strmtype ( chan_type_t mtype ) ;
2004-05-17 21:09:45 +00:00
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 ) ;
2008-04-27 09:46:35 +00:00
extern HAMLIB_EXPORT ( chan_type_t ) rig_parse_mtype ( const char * s ) ;
2004-05-17 21:09:45 +00:00
2016-08-31 14:05:47 +00:00
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 ( ( ) ) ;
2020-03-20 12:51:32 +00:00
extern HAMLIB_EXPORT ( void ) rig_no_restore_ai ( ) ;
2004-05-17 21:09:45 +00:00
2020-07-02 03:33:32 +00:00
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 ) ;
2020-05-01 17:03:54 +00:00
2020-05-27 17:21:41 +00:00
extern HAMLIB_EXPORT ( int ) rig_set_vfo_opt ( RIG * rig , int status ) ;
2021-02-07 18:45:59 +00:00
extern HAMLIB_EXPORT ( int ) rig_get_vfo_info ( RIG * rig , vfo_t vfo , freq_t * freq , rmode_t * mode , pbwidth_t * width ) ;
2020-05-27 17:21:41 +00:00
2020-06-12 13:28:05 +00:00
2020-06-13 22:40:47 +00:00
typedef unsigned long rig_useconds_t ;
extern HAMLIB_EXPORT ( int ) hl_usleep ( rig_useconds_t msec ) ;
2020-01-08 05:18:56 +00:00
2020-04-09 22:56:19 +00:00
//! @endcond
2001-06-11 00:41:28 +00:00
__END_DECLS
2002-07-08 22:20:15 +00:00
# endif /* _RIG_H */
2006-10-15 00:27:52 +00:00
/*! @} */