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
*
*/
2024-01-06 15:55:49 +00:00
/* SPDX-License-Identifier: LGPL-2.1-or-later */
2006-10-15 00:27:52 +00:00
2000-10-08 21:15:28 +00:00
# ifndef _RIG_H
# define _RIG_H 1
2023-11-29 17:10:43 +00:00
// as of 2023-11-23 rig_caps is no longer constant
// this #define allows clients to test which declaration to use for backwards compatibility
# define RIGCAPS_NOT_CONST 1
2022-01-31 05:37:01 +00:00
# define BUILTINFUNC 0
2022-04-15 18:21:35 +00:00
// Our shared secret password
# define HAMLIB_SECRET_LENGTH 32
2024-01-13 14:27:37 +00:00
# define HAMLIB_TRACE rig_debug(RIG_DEBUG_TRACE,"%s%s(%d) trace\n",spaces(rig->state.depth-1), __FILE__, __LINE__)
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>
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>
2022-09-03 16:19:56 +00:00
2023-05-07 22:17:50 +00:00
// to stop warnings about including winsock2.h before windows.h
# if defined(_WIN32)
# include <winsock2.h>
2023-05-08 17:16:51 +00:00
# include <ws2tcpip.h>
# else
# include <sys/socket.h>
# include <netinet/in.h>
# include <arpa/inet.h>
2023-05-07 22:17:50 +00:00
# endif
2024-01-22 05:31:11 +00:00
// mingw64 still shows __TIMESIZE != 64
// need to do more testing
#if 0
2024-01-22 04:39:57 +00:00
# if __TIMESIZE != 64
2024-01-22 05:28:41 +00:00
# warning TIMESIZE != 64 -- Please report your OS system to hamlib-developer@lists.sourceforge.net
2024-01-22 04:39:57 +00:00
# endif
2024-01-22 05:31:11 +00:00
# endif
2024-01-22 04:39:57 +00:00
2022-09-03 16:19:56 +00:00
// For MSVC install the NUGet pthread package
2022-08-26 16:45:49 +00:00
# if defined(_MSC_VER)
2022-09-03 16:19:56 +00:00
# define HAVE_STRUCT_TIMESPEC
2022-08-26 16:35:39 +00:00
# endif
2022-09-03 16:19:56 +00:00
# include <pthread.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>
2023-05-09 17:00:53 +00:00
//#include <hamlib/config.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
2021-09-19 20:52:41 +00:00
/* But this appears to have been fixed so we'll use the correct one now
2019-08-18 13:21:14 +00:00
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
2023-07-09 21:51:33 +00:00
// FIFO currently used for send_morse queue
# define HAMLIB_FIFO_SIZE 1024
typedef struct
{
char data [ HAMLIB_FIFO_SIZE ] ;
int head ;
int tail ;
2023-07-09 22:04:39 +00:00
int flush ; // flush flag for stop_morse
2023-07-30 14:49:10 +00:00
# ifdef _PTHREAD_H
2023-07-30 12:55:28 +00:00
pthread_mutex_t mutex ;
# else
int mutex ;
# endif
2023-07-10 11:57:11 +00:00
} FIFO_RIG ;
2023-07-09 21:51:33 +00:00
2021-05-21 20:39:41 +00:00
/**
* \ brief size of cookie request buffer
* Minimum size of cookie buffer to pass to rig_cookie
*/
// cookie is 26-char time code plus 10-char (2^31-1) random number
# define HAMLIB_COOKIE_SIZE 37
2021-05-25 14:17:25 +00:00
extern int cookie_use ; // this is global as once one client requests it everybody needs to honor it
2023-12-18 21:26:46 +00:00
extern int skip_init ; // allow rigctl to skip any radio commands at startup
2021-05-21 20:39:41 +00:00
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
*/
2022-07-30 20:51:50 +00:00
/**
* @ { \ name Hamlib error codes
*/
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 */
2021-11-28 18:52:29 +00:00
RIG_EDOM , /*!< 17 Argument out of domain of func */
2022-04-29 22:17:43 +00:00
RIG_EDEPRECATED , /*!< 18 Function deprecated */
2022-07-15 20:41:23 +00:00
RIG_ESECURITY , /*!< 19 Security error */
2023-03-19 20:23:35 +00:00
RIG_EPOWER , /*!< 20 Rig not powered on */
2022-07-30 20:51:50 +00:00
RIG_EEND // MUST BE LAST ITEM IN LAST
2002-11-28 22:38:06 +00:00
} ;
2022-07-30 20:51:50 +00:00
/**
* @ }
*/
2000-10-08 21:15:28 +00:00
2021-03-16 21:39:35 +00:00
/**
* \ brief Determines if the given error code indicates a " soft " error
* Soft errors are caused by invalid parameters and software / hardware features
* and cannot be fixed by retries or by re - initializing hardware .
*/
# define RIG_IS_SOFT_ERRCODE(errcode) (errcode == RIG_EINVAL || errcode == RIG_ENIMPL || errcode == RIG_ERJCTED \
| | errcode = = RIG_ETRUNC | | errcode = = RIG_ENAVAIL | | errcode = = RIG_ENTARGET \
2022-08-22 21:10:25 +00:00
| | errcode = = RIG_EVFO | | errcode = = RIG_EDOM | | errcode = = RIG_EDEPRECATED \
| | errcode = = RIG_ESECURITY | | errcode = = RIG_EPOWER )
2021-03-16 21:39:35 +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 */
2021-03-26 15:51:00 +00:00
RIG_DEBUG_TRACE , /*!< tracing */
RIG_DEBUG_CACHE /*!< caching */
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
2021-03-06 18:37:53 +00:00
# define HAMLIB_RIGNAMSIZ 30
# define HAMLIB_RIGVERSIZ 8
# define HAMLIB_FILPATHLEN 512
# define HAMLIB_FRQRANGESIZ 30
# define HAMLIB_MAXCHANDESC 30 /* describe channel eg: "WWV 5Mhz" */
# define HAMLIB_TSLSTSIZ 20 /* max tuning step list size, zero ended */
# define HAMLIB_FLTLSTSIZ 60 /* max mode/filter list size, zero ended */
# define HAMLIB_MAXDBLSTSIZ 8 /* max preamp/att levels supported, zero ended */
# define HAMLIB_CHANLSTSIZ 16 /* max mem_list size, zero ended */
2021-05-26 20:40:53 +00:00
# define HAMLIB_MAX_AGC_LEVELS 8 /* max AGC levels supported */
# define HAMLIB_MAX_SPECTRUM_SCOPES 4 /* max number of spectrum scopes supported */
# define HAMLIB_MAX_SPECTRUM_MODES 5 /* max number of spectrum modes supported */
# define HAMLIB_MAX_SPECTRUM_AVG_MODES 12 /* max number of spectrum averaging modes supported */
# define HAMLIB_MAX_SPECTRUM_SPANS 20 /* max number of spectrum modes supported */
2021-11-30 07:25:51 +00:00
# define HAMLIB_MAX_SPECTRUM_DATA 2048 /* max number of data bytes in a single spectrum line */
2021-03-06 18:37:53 +00:00
# define HAMLIB_MAX_CAL_LENGTH 32 /* max calibration plots in cal_table_t */
# define HAMLIB_MAX_MODES 63
# define HAMLIB_MAX_VFOS 31
# define HAMLIB_MAX_ROTORS 63
# define HAMLIB_MAX_VFO_OPS 31
# define HAMLIB_MAX_RSCANS 31
2021-11-30 07:25:51 +00:00
# define HAMLIB_MAX_SNAPSHOT_PACKET_SIZE 16384 /* maximum number of bytes in a UDP snapshot packet */
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
*/
2021-04-29 15:49:29 +00:00
# define CTCSS_LIST_SIZE 60
# define DCS_LIST_SIZE 128
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
2023-12-18 13:53:55 +00:00
*
* Note : All rigs may use a network : port address ( e . g . tcp / serial adapter )
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 {
2022-11-14 22:02:28 +00:00
RIG_FLAG_RECEIVER = ( 1 < < 1 ) , /*!< Receiver 2 */
RIG_FLAG_TRANSMITTER = ( 1 < < 2 ) , /*!< Transmitter 4 */
RIG_FLAG_SCANNER = ( 1 < < 3 ) , /*!< Scanner 8 */
RIG_FLAG_MOBILE = ( 1 < < 4 ) , /*!< mobile sized 16 */
RIG_FLAG_HANDHELD = ( 1 < < 5 ) , /*!< handheld sized 32 */
RIG_FLAG_COMPUTER = ( 1 < < 6 ) , /*!< "Computer" rig 64 */
RIG_FLAG_TRUNKING = ( 1 < < 7 ) , /*!< has trunking 128 */
RIG_FLAG_APRS = ( 1 < < 8 ) , /*!< has APRS 256 */
RIG_FLAG_TNC = ( 1 < < 9 ) , /*!< has TNC 512 */
RIG_FLAG_DXCLUSTER = ( 1 < < 10 ) , /*!< has DXCluster 1024 */
RIG_FLAG_TUNER = ( 1 < < 11 ) /*!< dumb tuner 2048 */
2003-03-19 23:41:44 +00:00
} rig_type_t ;
2001-08-08 06:07:20 +00:00
2021-12-10 14:39:16 +00:00
/**
* \ brief AGC delay settings
*/
/* TODO: kill me, and replace by real AGC delay */
enum agc_level_e {
2023-01-06 22:21:58 +00:00
RIG_AGC_OFF = 0 ,
2021-12-10 14:39:16 +00:00
RIG_AGC_SUPERFAST ,
RIG_AGC_FAST ,
RIG_AGC_SLOW ,
2022-11-24 05:29:18 +00:00
RIG_AGC_USER , /*!< user selectable -- RIG_LEVEL_AGC to set USER level */
2021-12-10 14:39:16 +00:00
RIG_AGC_MEDIUM ,
2022-11-24 05:29:18 +00:00
RIG_AGC_AUTO ,
RIG_AGC_LONG ,
2023-03-19 20:23:35 +00:00
RIG_AGC_ON , /*!< Turns AGC ON -- Kenwood -- restores last level set */
RIG_AGC_NONE /*!< Rig does not have CAT AGC control */
2021-12-10 14:39:16 +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 {
2023-02-10 14:02:48 +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
*/
2021-05-08 17:47:10 +00:00
# define PRIfreq ".0f"
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
2021-09-11 04:29:32 +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)
2021-03-15 16:15:41 +00:00
/** \brief \c SubC -- alias for SUB_B */
# define RIG_VFO_SUB_C RIG_VFO_N(3)
2019-11-28 15:57:49 +00:00
/** \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)
2021-03-15 16:15:41 +00:00
/** \brief \c MainC -- alias for MAIN_C */
# define RIG_VFO_MAIN_C RIG_VFO_N(4)
2021-09-25 16:14:33 +00:00
/** \brief \c Other -- alias for OTHER -- e.g. Icom rigs without get_vfo capability */
# define RIG_VFO_OTHER RIG_VFO_N(5)
2019-11-28 15:57:49 +00:00
/** \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)
2021-03-15 16:15:41 +00:00
// we can 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
2023-04-08 18:31:40 +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 .
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)
2021-04-02 13:07:26 +00:00
# define RIG_TARGETABLE_MODE (1<<1) // mode by vfo or same mode on both vfos
2021-03-09 14:34:27 +00:00
# define RIG_TARGETABLE_PURE (1<<2) // deprecated -- not used -- reuse it
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)
2021-05-12 20:51:35 +00:00
# define RIG_TARGETABLE_ROOFING (1<<11) // roofing filter targetable by VFO
2021-05-26 20:40:53 +00:00
# define RIG_TARGETABLE_SPECTRUM (1<<12) // spectrum scope targetable by VFO
2023-04-06 19:21:04 +00:00
# define RIG_TARGETABLE_BAND (1<<13) // Band select -- e.g. Yaesu BS command
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)
2021-03-22 12:54:46 +00:00
# define VFO_HAS_DUAL ((rig->state.vfo_list & VFO_DUAL) == VFO_DUAL)
2020-05-21 13:51:41 +00:00
//! @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 ;
2022-11-04 15:49:14 +00:00
typedef float agc_time_t ;
2001-02-27 22:56:23 +00:00
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 ;
2022-01-29 22:08:43 +00:00
/**
* \ brief Band enumeration
*
* Some rig commands like Yaesu band select know about bands
*
* \ sa rig_set_level ( )
*/
2022-02-05 04:13:22 +00:00
typedef enum { // numbers here reflect the Yaesu values
RIG_BAND_160M = 0 , /*!< \c 160M */
RIG_BAND_80M = 1 , /*!< \c 80M */
RIG_BAND_60M = 2 , /*!< \c 60M */
RIG_BAND_40M = 3 , /*!< \c 40M */
RIG_BAND_30M = 4 , /*!< \c 30M */
RIG_BAND_20M = 5 , /*!< \c 20M */
RIG_BAND_17M = 6 , /*!< \c 17M */
RIG_BAND_15M = 7 , /*!< \c 15M */
RIG_BAND_12M = 8 , /*!< \c 12M */
RIG_BAND_10M = 9 , /*!< \c 10M */
RIG_BAND_6M = 10 , /*!< \c 6M */
RIG_BAND_GEN = 11 , /*!< \c 60M */
RIG_BAND_MW = 12 , /*!< \c Medium Wave */
RIG_BAND_UNUSED = 13 , /*!< \c Medium Wave */
RIG_BAND_AIR = 14 , /*!< \c Air band */
RIG_BAND_144MHZ = 15 , /*!< \c 144MHz */
RIG_BAND_430MHZ = 16 , /*!< \c 430MHz */
2022-02-01 15:12:36 +00:00
} hamlib_band_t ;
2022-01-29 22:08:43 +00:00
2024-02-03 18:44:48 +00:00
typedef enum { // numbers here reflect generic values -- need to map to rig values
2023-08-11 15:40:42 +00:00
RIG_BANDSELECT_UNUSED = CONSTANT_64BIT_FLAG ( 0 ) , /*!< \c Unused */
RIG_BANDSELECT_2200M = CONSTANT_64BIT_FLAG ( 1 ) , /*!< \c 160M */
RIG_BANDSELECT_600M = CONSTANT_64BIT_FLAG ( 2 ) , /*!< \c 160M */
RIG_BANDSELECT_160M = CONSTANT_64BIT_FLAG ( 3 ) , /*!< \c 160M */
RIG_BANDSELECT_80M = CONSTANT_64BIT_FLAG ( 4 ) , /*!< \c 80M */
RIG_BANDSELECT_60M = CONSTANT_64BIT_FLAG ( 5 ) , /*!< \c 60M */
RIG_BANDSELECT_40M = CONSTANT_64BIT_FLAG ( 6 ) , /*!< \c 40M */
RIG_BANDSELECT_30M = CONSTANT_64BIT_FLAG ( 7 ) , /*!< \c 30M */
RIG_BANDSELECT_20M = CONSTANT_64BIT_FLAG ( 8 ) , /*!< \c 20M */
RIG_BANDSELECT_17M = CONSTANT_64BIT_FLAG ( 9 ) , /*!< \c 17M */
RIG_BANDSELECT_15M = CONSTANT_64BIT_FLAG ( 10 ) , /*!< \c 15M */
RIG_BANDSELECT_12M = CONSTANT_64BIT_FLAG ( 11 ) , /*!< \c 12M */
RIG_BANDSELECT_10M = CONSTANT_64BIT_FLAG ( 12 ) , /*!< \c 10M */
RIG_BANDSELECT_6M = CONSTANT_64BIT_FLAG ( 13 ) , /*!< \c 6M */
RIG_BANDSELECT_WFM = CONSTANT_64BIT_FLAG ( 14 ) , /*!< \c IC705 74.8-108 */
RIG_BANDSELECT_GEN = CONSTANT_64BIT_FLAG ( 15 ) , /*!< \c 60M */
RIG_BANDSELECT_MW = CONSTANT_64BIT_FLAG ( 16 ) , /*!< \c Medium Wave */
RIG_BANDSELECT_AIR = CONSTANT_64BIT_FLAG ( 17 ) , /*!< \c Air band */
RIG_BANDSELECT_4M = CONSTANT_64BIT_FLAG ( 18 ) , /*!< \c 70MHz */
RIG_BANDSELECT_2M = CONSTANT_64BIT_FLAG ( 19 ) , /*!< \c 144MHz */
RIG_BANDSELECT_1_25M = CONSTANT_64BIT_FLAG ( 20 ) , /*!< \c 222MHz */
RIG_BANDSELECT_70CM = CONSTANT_64BIT_FLAG ( 21 ) , /*!< \c 420MHz */
RIG_BANDSELECT_33CM = CONSTANT_64BIT_FLAG ( 22 ) , /*!< \c 902MHz */
RIG_BANDSELECT_23CM = CONSTANT_64BIT_FLAG ( 23 ) , /*!< \c 1240MHz */
RIG_BANDSELECT_13CM = CONSTANT_64BIT_FLAG ( 24 ) , /*!< \c 2300MHz */
RIG_BANDSELECT_9CM = CONSTANT_64BIT_FLAG ( 25 ) , /*!< \c 3300MHz */
RIG_BANDSELECT_5CM = CONSTANT_64BIT_FLAG ( 26 ) , /*!< \c 5650MHz */
RIG_BANDSELECT_3CM = CONSTANT_64BIT_FLAG ( 27 ) , /*!< \c 10000MHz */
} hamlib_bandselect_t ;
# define RIG_BANDSELECT_ALL
# define RIG_BANDSELECT_LF (RIG_BANDSELECT_2200M | RIG_BANDSELECT_600M)
# define RIG_BANDSELECT_HF (RIG_BANDSELECT_160M | RIG_BANDSELECT_80M | RIG_BANDSELECT_60M | RIG_BANDSELECT_40M\
| RIG_BANDSELECT_30M | RIG_BANDSELECT_20M | RIG_BANDSELECT_17M | RIG_BANDSELECT_15M | RIG_BANDSELECT_12M \
RIG_BANDSELECT_10M | RIG_BANDSELECT_6M )
2023-10-02 16:47:33 +00:00
# define RIG_BANDSELECT_VHF (RIG_BANDSELECT_AIR | RIG_BANDSELECT_2M| RIG_BANDSELECT_1_25M(
# define RIG_BANDSELECT_UHF (RIG_BANDSELECT_70CM)
2023-08-11 15:40:42 +00:00
2003-03-19 23:41:44 +00:00
/**
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
*/
2024-01-22 05:11:55 +00:00
typedef long hamlib_token_t ;
2024-01-22 17:48:06 +00:00
# define token_t hamlib_token_t
2001-07-21 13:00:03 +00:00
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
2023-04-06 19:21:04 +00:00
* COMBO : val . i , starting from 0. Points to a table of strings or ASCII stored values .
2007-02-28 08:52:49 +00:00
* 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 */
2023-10-08 22:18:16 +00:00
RIG_CONF_BINARY , /*!< Binary buffer type */
RIG_CONF_INT /*!< Integer */
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 {
2024-01-22 05:11:55 +00:00
hamlib_token_t token ; /*!< Conf param token ID */
2017-08-07 13:04:25 +00:00
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
2021-09-19 20:52:41 +00:00
* No antenna set yet or unknown
2020-04-09 22:56:19 +00:00
*/
/**
* \ 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
2020-04-09 22:56:19 +00:00
//! @cond Doxygen_Suppress
2023-10-08 22:18:16 +00:00
# define RIG_AGC_LAST 99999
2020-04-09 22:56:19 +00:00
//! @endcond
2017-08-07 13:04:25 +00:00
2022-04-30 15:24:36 +00:00
# if 1 // deprecated
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 */
2022-04-28 15:08:17 +00:00
RIG_METER_TEMP = ( 1 < < 7 ) /*< Final Amp Temperature */
2001-04-28 12:47:54 +00:00
} ;
2022-04-30 15:24:36 +00:00
# endif
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 */
2023-05-08 17:16:51 +00:00
unsigned int u ; /*!< Unsigned integer */
2020-01-04 05:59:44 +00:00
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] */
2021-12-03 19:04:26 +00:00
# define RIG_LEVEL_IF CONSTANT_64BIT_FLAG(6) /*!< \c IF shift -- IF, arg int (+/-Hz) */
2021-01-03 14:19:16 +00:00
# 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] */
2021-04-23 07:42:43 +00:00
# define RIG_LEVEL_SLOPE_LOW CONSTANT_64BIT_FLAG(23) /*!< \c SLOPE_LOW -- Slope tune, low frequency cut, arg int (Hz) */
# define RIG_LEVEL_SLOPE_HIGH CONSTANT_64BIT_FLAG(24) /*!< \c SLOPE_HIGH -- Slope tune, high frequency cut, arg int (Hz) */
2021-01-03 14:19:16 +00:00
# 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
2022-11-01 14:14:19 +00:00
/*!< Some of these are not settable after this point */
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 */
2021-04-24 14:17:53 +00:00
//#define RIG_LEVEL_SQLSTAT CONSTANT_64BIT_FLAG(27) /*!< \c SQLSTAT -- SQL status, arg int (open=1/closed=0). Deprecated, use get_dcd instead */
2021-01-03 14:19:16 +00:00
# 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) */
2021-05-26 20:40:53 +00:00
# define RIG_LEVEL_SPECTRUM_MODE CONSTANT_64BIT_FLAG(40) /*!< \c SPECTRUM_MODE -- Spectrum scope mode, arg int (see enum rig_spectrum_mode_e). Supported modes defined in rig caps. */
# define RIG_LEVEL_SPECTRUM_SPAN CONSTANT_64BIT_FLAG(41) /*!< \c SPECTRUM_SPAN -- Spectrum scope span in center mode, arg int (Hz). Supported spans defined in rig caps. */
# define RIG_LEVEL_SPECTRUM_EDGE_LOW CONSTANT_64BIT_FLAG(42) /*!< \c SPECTRUM_EDGE_LOW -- Spectrum scope low edge in fixed mode, arg int (Hz) */
# define RIG_LEVEL_SPECTRUM_EDGE_HIGH CONSTANT_64BIT_FLAG(43) /*!< \c SPECTRUM_EDGE_HIGH -- Spectrum scope high edge in fixed mode, arg int (Hz) */
# define RIG_LEVEL_SPECTRUM_SPEED CONSTANT_64BIT_FLAG(44) /*!< \c SPECTRUM_SPEED -- Spectrum scope update speed, arg int (highest is fastest, define rig-specific granularity) */
# define RIG_LEVEL_SPECTRUM_REF CONSTANT_64BIT_FLAG(45) /*!< \c SPECTRUM_REF -- Spectrum scope reference display level, arg float (dB, define rig-specific granularity) */
# define RIG_LEVEL_SPECTRUM_AVG CONSTANT_64BIT_FLAG(46) /*!< \c SPECTRUM_AVG -- Spectrum scope averaging mode, arg int (see struct rig_spectrum_avg_mode). Supported averaging modes defined in rig caps. */
2021-05-27 07:12:01 +00:00
# define RIG_LEVEL_SPECTRUM_ATT CONSTANT_64BIT_FLAG(47) /*!< \c SPECTRUM_ATT -- Spectrum scope attenuator, arg int (dB). Supported attenuator values defined in rig caps. */
2022-04-30 18:44:09 +00:00
# define RIG_LEVEL_TEMP_METER CONSTANT_64BIT_FLAG(48) /*!< \c TEMP_METER -- arg float (C, centigrade) */
2022-01-29 22:08:43 +00:00
# define RIG_LEVEL_BAND_SELECT CONSTANT_64BIT_FLAG(49) /*!< \c BAND_SELECT -- arg enum BAND_ENUM */
2022-11-01 14:14:19 +00:00
# define RIG_LEVEL_USB_AF CONSTANT_64BIT_FLAG(50) /*!< \c ACC/USB AF output level */
2023-10-20 19:59:05 +00:00
# define RIG_LEVEL_USB_AF_INPUT CONSTANT_64BIT_FLAG(51) /*!< \c ACC/USB AF input level */
# define RIG_LEVEL_AGC_TIME CONSTANT_64BIT_FLAG(52) /*!< \c AGC_TIME -- in seconds, rig dependent */
2021-01-03 14:19:16 +00:00
# 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
2023-10-21 14:24:42 +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|RIG_LEVEL_SPECTRUM_REF|RIG_LEVEL_TEMP_METER|RIG_LEVEL_USB_AF|RIG_LEVEL_USB_AF_INPUT|RIG_LEVEL_AGC_TIME)
2019-06-12 21:23:15 +00:00
2023-04-18 05:02:18 +00:00
# define RIG_LEVEL_READONLY_LIST (RIG_LEVEL_SWR|RIG_LEVEL_ALC|RIG_LEVEL_STRENGTH|RIG_LEVEL_RAWSTR|RIG_LEVEL_COMP_METER|RIG_LEVEL_VD_METER|RIG_LEVEL_ID_METER|RIG_LEVEL_TEMP_METER|RIG_LEVEL_RFPOWER_METER|RIG_LEVEL_RFPOWER_METER_WATTS)
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 */
2022-04-25 15:15:54 +00:00
RIG_PARM_SCREENSAVER = ( 1 < < 8 ) , /*!< \c SCREENSAVER -- rig specific timeouts */
2023-08-11 15:40:42 +00:00
RIG_PARM_AFIF = ( 1 < < 9 ) , /*!< \c AFIF -- 0=AF audio, 1=IF audio -- see IC-7300/9700/705 */
2023-08-17 22:52:03 +00:00
RIG_PARM_BANDSELECT = ( 1 < < 10 ) , /*!< \c BANDSELECT -- e.g. BAND160M, BAND80M, BAND70CM, BAND2CM */
RIG_PARM_KEYERTYPE = ( 1 < < 11 ) /*!< \c KEYERTYPE -- 0,1,2 or STRAIGHT PADDLE BUG */
} ;
enum rig_keyertype_e {
RIG_KEYERTYPE_STRAIGHT = 0 ,
RIG_KEYERTYPE_BUG = ( 1 < < 0 ) ,
RIG_KEYERTYPE_PADDLE = ( 2 < < 0 )
2003-03-19 23:41:44 +00:00
} ;
2001-03-01 00:23:14 +00:00
2021-05-21 04:53:05 +00:00
/**
* \ brief Rig Cookie enumerations
*
* Cookies are used for a client to request exclusive control of the rig until the client releases the cookie
* Cookies will expire after 1 second unless renewed
* Normal flow would be cookie = rig_cookie ( NULL , RIG_COOKIE_GET ) , rig op , rig_cookie ( cookie , RIG_COOKIE_RENEW ) , rig op , etc . . . .
*
*/
enum cookie_e {
2021-09-19 20:52:41 +00:00
RIG_COOKIE_GET , /*!< Setup a cookie */
RIG_COOKIE_RELEASE , /*!< Release a cookie */
RIG_COOKIE_RENEW , /*!< Renew a cookie */
2021-05-21 04:53:05 +00:00
} ;
2021-05-23 12:40:08 +00:00
/**
* \ brief Multicast data items
* 3 different data item can be included in the multicast JSON
*/
enum multicast_item_e {
RIG_MULTICAST_POLL , // hamlib will be polling the rig for all rig items
RIG_MULTICAST_TRANSCEIVE , // transceive will be turned on and processed
RIG_MULTICAST_SPECTRUM // spectrum data will be included
} ;
2020-04-09 22:56:19 +00:00
//! @cond Doxygen_Suppress
2023-08-17 21:04:45 +00:00
# define RIG_PARM_FLOAT_LIST (RIG_PARM_BACKLIGHT|RIG_PARM_BAT|RIG_PARM_KEYLIGHT|RIG_PARM_BACKLIGHT)
2023-08-18 05:04:59 +00:00
# define RIG_PARM_STRING_LIST (RIG_PARM_BANDSELECT|RIG_PARM_KEYERTYPE)
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)
2023-08-11 15:40:42 +00:00
# define RIG_PARM_IS_STRING(l) ((l)&RIG_PARM_STRING_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
/**
2021-05-26 20:40:53 +00:00
* \ brief Transceive mode
2017-08-07 13:04:25 +00:00
* 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
2021-11-28 18:52:29 +00:00
* \ deprecated
2020-04-09 22:56:19 +00:00
* Turn it off
2021-05-26 20:40:53 +00:00
* \ brief Transceive mode
2020-04-09 22:56:19 +00:00
* \ def RIG_TRN_RIG
2021-11-28 18:52:29 +00:00
* \ deprecated
2021-05-26 20:40:53 +00:00
* RIG_TRN_RIG means the rig acts asynchronously
* \ brief Transceive mode
2020-04-09 22:56:19 +00:00
* \ def RIG_TRN_POLL
2021-11-28 18:52:29 +00:00
* \ deprecated
2020-04-09 22:56:19 +00:00
* 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.) */
2021-11-20 19:28:26 +00:00
# define RIG_FUNC_APF CONSTANT_64BIT_FLAG (11) /*!< \c APF -- Audio Peak Filter */
2018-12-27 21:10:10 +00:00
# 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 */
2023-07-17 22:42:34 +00:00
# define RIG_FUNC_SLICE CONSTANT_64BIT_FLAG (41) /*!< \c SLICE -- Rig slice selection -- Flex */
2021-05-26 20:40:53 +00:00
# define RIG_FUNC_TRANSCEIVE CONSTANT_64BIT_FLAG (42) /*!< \c TRANSCEIVE -- Send radio state changes automatically ON/OFF */
# define RIG_FUNC_SPECTRUM CONSTANT_64BIT_FLAG (43) /*!< \c SPECTRUM -- Spectrum scope data output ON/OFF */
# define RIG_FUNC_SPECTRUM_HOLD CONSTANT_64BIT_FLAG (44) /*!< \c SPECTRUM_HOLD -- Pause spectrum scope updates ON/OFF */
2022-11-05 04:31:51 +00:00
# define RIG_FUNC_SEND_MORSE CONSTANT_64BIT_FLAG (45) /*!< \c SEND_MORSE -- Send specified characters using CW */
# define RIG_FUNC_SEND_VOICE_MEM CONSTANT_64BIT_FLAG (46) /*!< \c SEND_VOICE_MEM -- Transmit in SSB message stored in memory */
# define RIG_FUNC_OVF_STATUS CONSTANT_64BIT_FLAG (47) /*!< \c OVF -- Read overflow status 0=Off, 1=On */
2024-01-18 13:56:30 +00:00
# define RIG_FUNC_SYNC CONSTANT_64BIT_FLAG (48) /*!< \c Synchronize VFOS -- FTDX101D/MP for now SY command */
2020-04-09 22:56:19 +00:00
# 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 */
2021-08-28 00:41:38 +00:00
# define RIG_MODE_CWN CONSTANT_64BIT_FLAG (36) /*!< \c CWN -- Narrow band CW (FT-736R) */
2021-10-19 04:01:38 +00:00
# define RIG_MODE_IQ CONSTANT_64BIT_FLAG (37) /*!< \c IQ mode for a couple of kit rigs */
2022-08-13 13:52:42 +00:00
# define RIG_MODE_ISBUSB CONSTANT_64BIT_FLAG (38) /*!< \c ISB mode monitoring USB */
# define RIG_MODE_ISBLSB CONSTANT_64BIT_FLAG (39) /*!< \c ISB mode monitoring LSB */
2024-02-23 18:27:55 +00:00
# define RIG_MODE_USBD1 CONSTANT_64BIT_FLAG (40) /*!< \c USB-D1 for some rigs */
# define RIG_MODE_USBD2 CONSTANT_64BIT_FLAG (41) /*!< \c USB-D2 for some rigs */
# define RIG_MODE_USBD3 CONSTANT_64BIT_FLAG (42) /*!< \c USB-D3 for some rigs */
# define RIG_MODE_LSBD1 CONSTANT_64BIT_FLAG (43) /*!< \c LSB-D1 for some rigs */
# define RIG_MODE_LSBD2 CONSTANT_64BIT_FLAG (44) /*!< \c LSB-D1 for some rigs */
# define RIG_MODE_LSBD3 CONSTANT_64BIT_FLAG (45) /*!< \c LSB-D1 for some rigs */
2020-04-09 22:56:19 +00:00
# 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 */
2022-11-14 22:02:28 +00:00
# define RIG_MODE_ALL (0xffffffff) /*!< any mode constant */
2018-12-27 21:10:10 +00:00
# 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
2023-04-14 21:25:29 +00:00
/**
* \ brief macro for backends , not to be used by rig_set_mode et al .
*/
# define RIG_MODE_PKTSSB (RIG_MODE_PKTUSB|RIG_MODE_PKTLSB)
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)
2022-05-23 16:40:05 +00:00
# define DEBUGMSGSAVE_SIZE 24000
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 {
2024-01-22 05:11:55 +00:00
hamlib_token_t token ; /*!< Token ID */
2017-08-07 13:04:25 +00:00
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 */
2021-03-06 18:37:53 +00:00
char channel_desc [ HAMLIB_MAXCHANDESC ] ; /*!< Name */
2017-08-07 13:04:25 +00:00
struct ext_list
* ext_levels ; /*!< Extension level value list, NULL ended. ext_levels can be NULL */
2023-09-08 22:05:34 +00:00
char tag [ 32 ] ; /*!< TAG ASCII for channel name, etc */
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 */
2023-09-08 22:05:34 +00:00
unsigned tag : 1 ; /*!< Has tag field e.g. FT991 */
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 */
2023-11-22 17:46:21 +00:00
RIG_MTYPE_PRIO , /*!< Priority channel */
RIG_MTYPE_VOICE , /*!< Stored Voice Message */
RIG_MTYPE_MORSE /*!< Morse Message */
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 {
2023-12-20 21:26:57 +00:00
int startc ; /*!< Starting memory channel \b number */
int endc ; /*!< Ending memory channel \b number */
chan_type_t type ; /*!< Memory type. see chan_type_t */
channel_cap_t mem_caps ; /*!< Definition of attributes that can be stored/retrieved */
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
*
2023-05-13 18:36:03 +00:00
* For float settings , if min . f = 0 and max . f = 0 ( and step . f ! = 0 ) , max . f is
2017-08-07 13:04:25 +00:00
* 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 */
2021-03-06 18:37:53 +00:00
} table [ HAMLIB_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 */
2021-03-06 18:37:53 +00:00
} table [ HAMLIB_MAX_CAL_LENGTH ] ; /*!< table of plots */
2019-05-30 06:37:49 +00:00
} ;
/**
* \ 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 }, } }
2022-11-14 22:37:20 +00:00
typedef int ( * chan_cb_t ) ( RIG * , vfo_t vfo , channel_t * * , int , const chan_t * , rig_ptr_t ) ;
2017-08-07 13:04:25 +00:00
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
2021-05-26 20:40:53 +00:00
/**
* \ brief Spectrum scope
*/
struct rig_spectrum_scope
{
int id ;
char * name ;
} ;
/**
* \ brief Spectrum scope modes
*/
enum rig_spectrum_mode_e {
RIG_SPECTRUM_MODE_NONE = 0 ,
RIG_SPECTRUM_MODE_CENTER , /*!< Spectrum scope centered around the VFO frequency */
RIG_SPECTRUM_MODE_FIXED , /*!< Spectrum scope edge frequencies are fixed */
RIG_SPECTRUM_MODE_CENTER_SCROLL , /*!< Spectrum scope edge frequencies are fixed, but identical to what the center mode would use. Scrolling is enabled. */
RIG_SPECTRUM_MODE_FIXED_SCROLL , /*!< Spectrum scope edge frequencies are fixed with scrolling enabled */
} ;
/**
* \ brief Spectrum scope averaging modes
*/
struct rig_spectrum_avg_mode
{
int id ;
char * name ;
} ;
/**
* \ brief Represents a single line of rig spectrum scope FFT data .
*
* The data levels specify the range of the spectrum scope FFT data .
* The minimum level should represent the lowest numeric value and the lowest signal level in dB .
* The maximum level should represent the highest numeric value and the highest signal level in dB .
* The data level values are assumed to represent the dB strength scale in a linear way .
*
* Note that the data level and signal strength ranges may change depending on the settings of the rig .
* At least on Kenwood the sub - scope provides different kind of data compared to the main scope .
*/
struct rig_spectrum_line
{
int id ; /*!< Numeric ID of the spectrum scope data stream identifying the VFO/receiver. First ID is zero. Rigs with multiple scopes usually have identifiers, such as 0 = Main, 1 = Sub. */
int data_level_min ; /*!< The numeric value that represents the minimum signal level. */
int data_level_max ; /*!< The numeric value that represents the maximum signal level. */
double signal_strength_min ; /*!< The strength of the minimum signal level in dB. */
double signal_strength_max ; /*!< The strength of the maximum signal level in dB. */
enum rig_spectrum_mode_e spectrum_mode ; /*!< Spectrum mode. */
freq_t center_freq ; /*!< Center frequency of the spectrum scope in Hz in RIG_SPECTRUM_CENTER mode. */
freq_t span_freq ; /*!< Span of the spectrum scope in Hz in RIG_SPECTRUM_CENTER mode. */
freq_t low_edge_freq ; /*!< Low edge frequency of the spectrum scope in Hz in RIG_SPECTRUM_FIXED mode. */
freq_t high_edge_freq ; /*!< High edge frequency of the spectrum scope in Hz in RIG_SPECTRUM_FIXED mode. */
2021-11-28 18:52:29 +00:00
size_t spectrum_data_length ; /*!< Number of bytes of 8-bit spectrum data in the data buffer. The amount of data may vary if the rig has multiple spectrum scopes, depending on the scope. */
2021-05-26 20:40:53 +00:00
unsigned char * spectrum_data ; /*!< 8-bit spectrum data covering bandwidth of either the span_freq in center mode or from low edge to high edge in fixed mode. A higher value represents higher signal strength. */
} ;
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
2022-01-01 05:49:29 +00:00
# define HAMLIB_CHECK_RIG_CAPS "HAMLIB_CHECK_RIG_CAPS"
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
2021-04-29 15:49:29 +00:00
tone_t * ctcss_list ; /*!< CTCSS tones list, zero ended */
tone_t * dcs_list ; /*!< DCS code list, zero ended */
2017-08-07 13:04:25 +00:00
2021-03-06 18:37:53 +00:00
int preamp [ HAMLIB_MAXDBLSTSIZ ] ; /*!< Preamp list in dB, 0 terminated */
2021-05-27 07:12:01 +00:00
int attenuator [ HAMLIB_MAXDBLSTSIZ ] ; /*!< Attenuator list in dB, 0 terminated */
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 */
2021-05-26 20:40:53 +00:00
int agc_level_count ; /*!< Number of supported AGC levels. Zero indicates all modes should be available (for backwards-compatibility). */
enum agc_level_e agc_levels [ HAMLIB_MAX_AGC_LEVELS ] ; /*!< Supported AGC levels */
2017-08-07 13:04:25 +00:00
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 */
2021-11-28 18:52:29 +00:00
int transceive ; /*!< \deprecated Use async_data_supported instead */
2017-08-07 13:04:25 +00:00
int bank_qty ; /*!< Number of banks */
int chan_desc_sz ; /*!< Max length of memory channel name */
2021-03-06 18:37:53 +00:00
chan_t chan_list [ HAMLIB_CHANLSTSIZ ] ; /*!< Channel list, zero ended */
2017-08-07 13:04:25 +00:00
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
2021-09-19 20:52:41 +00:00
// The the IC-9700 in ic7300.c for an example
2021-03-06 18:37:53 +00:00
freq_range_t rx_range_list1 [ HAMLIB_FRQRANGESIZ ] ; /*!< Receive frequency range list #1 */
freq_range_t tx_range_list1 [ HAMLIB_FRQRANGESIZ ] ; /*!< Transmit frequency range list #1 */
freq_range_t rx_range_list2 [ HAMLIB_FRQRANGESIZ ] ; /*!< Receive frequency range list #2 */
freq_range_t tx_range_list2 [ HAMLIB_FRQRANGESIZ ] ; /*!< Transmit frequency range list #2 */
freq_range_t rx_range_list3 [ HAMLIB_FRQRANGESIZ ] ; /*!< Receive frequency range list #3 */
freq_range_t tx_range_list3 [ HAMLIB_FRQRANGESIZ ] ; /*!< Transmit frequency range list #3 */
freq_range_t rx_range_list4 [ HAMLIB_FRQRANGESIZ ] ; /*!< Receive frequency range list #4 */
freq_range_t tx_range_list4 [ HAMLIB_FRQRANGESIZ ] ; /*!< Transmit frequency range list #4 */
freq_range_t rx_range_list5 [ HAMLIB_FRQRANGESIZ ] ; /*!< Receive frequency range list #5 */
freq_range_t tx_range_list5 [ HAMLIB_FRQRANGESIZ ] ; /*!< Transmit frequency range list #5 */
struct tuning_step_list tuning_steps [ HAMLIB_TSLSTSIZ ] ; /*!< Tuning step list */
struct filter_list filters [ HAMLIB_FLTLSTSIZ ] ; /*!< mode/filter table, at -6dB */
2017-08-07 13:04:25 +00:00
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
2021-05-26 20:40:53 +00:00
struct rig_spectrum_scope spectrum_scopes [ HAMLIB_MAX_SPECTRUM_SCOPES ] ; /*!< Supported spectrum scopes. The array index must match the scope ID. Last entry must have NULL name. */
enum rig_spectrum_mode_e spectrum_modes [ HAMLIB_MAX_SPECTRUM_MODES ] ; /*!< Supported spectrum scope modes. Last entry must be RIG_SPECTRUM_MODE_NONE. */
freq_t spectrum_spans [ HAMLIB_MAX_SPECTRUM_SPANS ] ; /*!< Supported spectrum scope frequency spans in Hz in center mode. Last entry must be 0. */
struct rig_spectrum_avg_mode spectrum_avg_modes [ HAMLIB_MAX_SPECTRUM_AVG_MODES ] ; /*!< Supported spectrum scope averaging modes. Last entry must have NULL name. */
2021-05-27 07:12:01 +00:00
int spectrum_attenuator [ HAMLIB_MAXDBLSTSIZ ] ; /*!< Spectrum attenuator list in dB, 0 terminated */
2021-05-26 20:40:53 +00:00
const struct confparams * cfgparams ; /*!< Configuration parameters. */
2017-08-07 13:04:25 +00:00
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
2024-01-22 05:11:55 +00:00
int ( * set_ext_level ) ( RIG * rig , vfo_t vfo , hamlib_token_t token , value_t val ) ;
int ( * get_ext_level ) ( RIG * rig , vfo_t vfo , hamlib_token_t token , value_t * val ) ;
2002-11-12 00:15:01 +00:00
2024-01-22 05:11:55 +00:00
int ( * set_ext_func ) ( RIG * rig , vfo_t vfo , hamlib_token_t token , int status ) ;
int ( * get_ext_func ) ( RIG * rig , vfo_t vfo , hamlib_token_t token , int * status ) ;
2020-02-11 09:48:13 +00:00
2024-01-22 05:11:55 +00:00
int ( * set_ext_parm ) ( RIG * rig , hamlib_token_t token , value_t val ) ;
int ( * get_ext_parm ) ( RIG * rig , hamlib_token_t token , value_t * val ) ;
2002-11-12 00:15:01 +00:00
2024-01-22 05:11:55 +00:00
int ( * set_conf ) ( RIG * rig , hamlib_token_t token , const char * val ) ;
int ( * get_conf ) ( RIG * rig , hamlib_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 ) ;
2023-08-18 21:49:35 +00:00
int ( * stop_voice_mem ) ( RIG * rig , vfo_t vfo ) ;
2020-02-06 00:00:34 +00:00
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 ,
2022-11-14 22:37:20 +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 ) ;
int ( * get_mem_all_cb ) ( RIG * rig ,
2022-11-14 22:37:20 +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 ) ;
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
2021-03-08 15:55:59 +00:00
int ( * rig_get_vfo_info ) ( RIG * rig ,
vfo_t vfo ,
freq_t * freq ,
rmode_t * mode ,
pbwidth_t * width ,
split_t * split ) ;
2021-12-01 17:50:33 +00:00
int ( * set_clock ) ( RIG * rig , int year , int month , int day , int hour , int min , int sec , double msec , int utc_offset ) ;
int ( * get_clock ) ( RIG * rig , int * year , int * month , int * day , int * hour , int * min , int * sec , double * msec , int * utc_offset ) ;
2020-05-27 17:21:41 +00:00
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 */
2021-11-20 19:33:29 +00:00
2021-11-28 18:52:29 +00:00
int async_data_supported ; /*!< Indicates that rig is capable of outputting asynchronous data updates, such as transceive state updates or spectrum data. 1 if true, 0 otherwise. */
2021-11-20 19:33:29 +00:00
int ( * read_frame_direct ) ( RIG * rig ,
size_t buffer_length ,
const unsigned char * buffer ) ;
int ( * is_async_frame ) ( RIG * rig ,
size_t frame_length ,
const unsigned char * frame ) ;
int ( * process_async_frame ) ( RIG * rig ,
size_t frame_length ,
const unsigned char * frame ) ;
2022-01-01 05:49:29 +00:00
// this will be used to check rigcaps structure is compatible with client
2022-01-18 23:28:53 +00:00
char * hamlib_check_rig_caps ; // a constant value we can check for hamlib integrity
2024-01-22 05:11:55 +00:00
int ( * get_conf2 ) ( RIG * rig , hamlib_token_t token , char * val , int val_len ) ;
2022-04-15 18:21:35 +00:00
int ( * password ) ( RIG * rig , const char * key1 ) ; /*< Send encrypted password if rigctld is secured with -A/--password */
2022-06-02 20:55:56 +00:00
int ( * set_lock_mode ) ( RIG * rig , int mode ) ;
int ( * get_lock_mode ) ( RIG * rig , int * mode ) ;
2023-06-07 12:26:39 +00:00
short timeout_retry ; /*!< number of retries to make in case of read timeout errors, some serial interfaces may require this, 0 to use default value, -1 to disable */
2023-08-19 17:36:07 +00:00
short morse_qsize ; /* max length of morse */
2023-08-11 15:40:42 +00:00
// int (*bandwidth2rig)(RIG *rig, enum bandwidth_t bandwidth);
// enum bandwidth_t (*rig2bandwidth)(RIG *rig, int rigbandwidth);
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
*
*/
// 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 ,
2021-12-19 23:30:24 +00:00
RIG_FUNCTION_SEND_VOICE_MEM ,
2021-01-01 05:31:27 +00:00
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 ,
2021-10-21 22:36:54 +00:00
RIG_FUNCTION_SET_VFO_OPT ,
2021-11-28 18:52:29 +00:00
RIG_FUNCTION_READ_FRAME_DIRECT ,
RIG_FUNCTION_IS_ASYNC_FRAME ,
RIG_FUNCTION_PROCESS_ASYNC_FRAME ,
2022-01-10 14:48:08 +00:00
RIG_FUNCTION_GET_CONF2 ,
2023-11-16 20:40:54 +00:00
RIG_FUNCTION_STOP_VOICE_MEM ,
2021-01-01 05:05:54 +00:00
} ;
/**
* \ brief Function to return pointer to rig_ * function
*
*/
2021-04-11 19:56:38 +00:00
extern HAMLIB_EXPORT ( 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
*
*/
// 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 ,
2023-11-16 20:40:54 +00:00
RIG_CAPS_HAS_GET_LEVEL ,
RIG_CAPS_HAS_SET_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
*/
2023-11-16 15:05:29 +00:00
extern HAMLIB_EXPORT ( uint64_t ) 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
*
*/
2021-04-11 19:56:38 +00:00
extern HAMLIB_EXPORT ( 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
2022-01-03 12:18:49 +00:00
struct hamlib_async_pipe ;
typedef struct hamlib_async_pipe hamlib_async_pipe_t ;
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
2022-01-27 12:42:05 +00:00
// DO NOT CHANGE THIS STRUCTURE ALL UNTIL 5.0
// Right now it is static inside rig structure
// 5.0 will change it to a pointer which can then be added to
Fix spelling errors
Fixed with:
codespell --summary --skip=.git,extra,,lib,macros,security --ignore-words-list="ans,ba,cant,develope,fo,get's,nin,numer,parm,parms,setts,som,statics,ths,ue,vektor,objext" --write-changes --interactive=2
and manual editing.
2022-07-07 19:25:58 +00:00
// At that point only add to the end of the structure
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
2021-03-06 18:37:53 +00:00
char pathname [ HAMLIB_FILPATHLEN ] ; /*!< Port pathname */
2017-08-07 13:04:25 +00:00
2022-01-24 23:52:21 +00:00
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 */
2023-05-14 08:52:48 +00:00
int client_port ; /*!< client socket port for tcp connection */
RIG * rig ; /*!< our parent RIG device */
2022-01-26 14:26:12 +00:00
int asyncio ; /*!< enable asynchronous data handling if true -- async collides with python keyword so _async is used */
2022-01-26 18:32:04 +00:00
# if defined(_WIN32)
hamlib_async_pipe_t * sync_data_pipe ; /*!< pipe data structure for synchronous data */
hamlib_async_pipe_t * sync_data_error_pipe ; /*!< pipe data structure for synchronous data error codes */
# else
int fd_sync_write ; /*!< file descriptor for writing synchronous data */
int fd_sync_read ; /*!< file descriptor for reading synchronous data */
int fd_sync_error_write ; /*!< file descriptor for writing synchronous data error codes */
int fd_sync_error_read ; /*!< file descriptor for reading synchronous data error codes */
# endif
2023-05-14 08:52:48 +00:00
short timeout_retry ; /*!< number of retries to make in case of read timeout errors, some serial interfaces may require this, 0 to disable */
2023-12-04 15:47:52 +00:00
// DO NOT ADD ANYTHING HERE UNTIL 5.0!!
2022-01-26 23:56:58 +00:00
} hamlib_port_t ;
2022-01-26 14:26:12 +00:00
2022-01-27 12:42:05 +00:00
// DO NOT CHANGE THIS STRUCTURE AT ALL
// Will be removed in 5.0
2022-01-26 14:26:12 +00:00
typedef struct hamlib_port_deprecated {
union {
rig_port_t rig ; /*!< Communication port type */
ptt_type_t ptt ; /*!< PTT port type */
dcd_type_t dcd ; /*!< DCD port type */
} type ;
int fd ; /*!< File descriptor */
void * handle ; /*!< handle for USB */
int write_delay ; /*!< Delay between each byte sent out, in mS */
int post_write_delay ; /*!< Delay between each commands send out, in mS */
struct {
int tv_sec , tv_usec ;
} post_write_date ; /*!< hamlib internal use */
int timeout ; /*!< Timeout, in mS */
short retry ; /*!< Maximum number of retries, 0 to disable */
short flushx ; /*!< If true flush is done with read instead of TCFLUSH - MicroHam */
char pathname [ HAMLIB_FILPATHLEN ] ; /*!< Port pathname */
union {
struct {
int rate ; /*!< Serial baud rate */
int data_bits ; /*!< Number of data bits */
int stop_bits ; /*!< Number of stop bits */
enum serial_parity_e parity ; /*!< Serial parity */
enum serial_handshake_e handshake ; /*!< Serial handshake */
enum serial_control_state_e rts_state ; /*!< RTS set state */
enum serial_control_state_e dtr_state ; /*!< DTR set state */
} serial ; /*!< serial attributes */
struct {
int pin ; /*!< Parallel port pin number */
} parallel ; /*!< parallel attributes */
struct {
int ptt_bitnum ; /*!< Bit number for CM108 GPIO PTT */
} cm108 ; /*!< CM108 attributes */
struct {
int vid ; /*!< Vendor ID */
int pid ; /*!< Product ID */
int conf ; /*!< Configuration */
int iface ; /*!< interface */
int alt ; /*!< alternate */
char * vendor_name ; /*!< Vendor name (opt.) */
char * product ; /*!< Product (opt.) */
} usb ; /*!< USB attributes */
struct {
int on_value ; /*!< GPIO: 1 == normal, GPION: 0 == inverted */
int value ; /*!< Toggle PTT ON or OFF */
} gpio ; /*!< GPIO attributes */
} parm ; /*!< Port parameter union */
int client_port ; /*!< client socket port for tcp connection */
RIG * rig ; /*!< our parent RIG device */
} hamlib_port_t_deprecated ;
2022-01-03 12:18:49 +00:00
//! @endcond
2005-03-26 23:33:39 +00:00
2005-03-28 09:41:43 +00:00
# if !defined(__APPLE__) || !defined(__cplusplus)
2022-01-26 14:26:12 +00:00
typedef hamlib_port_t_deprecated port_t_deprecated ;
2005-03-26 23:33:39 +00:00
typedef hamlib_port_t port_t ;
# endif
2000-10-08 21:15:28 +00:00
2024-01-06 15:55:49 +00:00
/* Macros to access data structures/pointers
2023-12-19 15:35:52 +00:00
* Make it easier to change location in preparation
* for moving them out of rig - > state .
* See https : //github.com/Hamlib/Hamlib/issues/1445
2024-01-06 15:55:49 +00:00
* https : //github.com/Hamlib/Hamlib/issues/1452
* https : //github.com/Hamlib/Hamlib/issues/1420
* https : //github.com/Hamlib/Hamlib/issues/536
* https : //github.com/Hamlib/Hamlib/issues/487
2023-12-19 15:35:52 +00:00
*/
// Note: Experimental, and subject to change!!
2023-12-20 19:49:35 +00:00
# if defined(IN_HAMLIB)
/* These are for internal use only */
2023-12-19 15:35:52 +00:00
# define RIGPORT(r) (&r->state.rigport)
# define PTTPORT(r) (&r->state.pttport)
# define DCDPORT(r) (&r->state.dcdport)
2024-01-06 15:55:49 +00:00
# define CACHE(r) (&r->state.cache)
2024-01-07 20:11:23 +00:00
# define AMPPORT(a) (&a->state.ampport)
# define ROTPORT(r) (&r->state.rotport)
2024-01-10 01:06:48 +00:00
# define ROTPORT2(r) (&r->state.rotport2)
2024-02-28 08:59:06 +00:00
# define STATE(r) (&r->state)
2024-01-06 15:55:49 +00:00
/* Then when the rigport address is stored as a pointer somewhere else(say,
* in the rig structure itself ) , the definition could be changed to
* # define RIGPORT ( r ) r - > somewhereelse
* and every reference is updated .
*/
2023-12-20 19:49:35 +00:00
# else
/* Define external unique names */
2024-01-14 20:08:18 +00:00
# define HAMLIB_RIGPORT(r) ((hamlib_port_t *)rig_data_pointer(r, RIG_PTRX_RIGPORT))
# define HAMLIB_PTTPORT(r) ((hamlib_port_t *)rig_data_pointer(r, RIG_PTRX_PTTPORT))
# define HAMLIB_DCDPORT(r) ((hamlib_port_t *)rig_data_pointer(r, RIG_PTRX_DCDPORT))
# define HAMLIB_CACHE(r) ((struct rig_cache *)rig_data_pointer(r, RIG_PTRX_CACHE))
# define HAMLIB_AMPPORT(a) ((hamlib_port_t *)amp_data_pointer(a, RIG_PTRX_AMPPORT))
# define HAMLIB_ROTPORT(r) ((hamlib_port_t *)rot_data_pointer(r, RIG_PTRX_ROTPORT))
# define HAMLIB_ROTPORT2(r) ((hamlib_port_t *)rot_data_pointer(r, RIG_PTRX_ROTPORT2))
2024-02-28 08:59:06 +00:00
# define HAMLIB_STATE(r) ((struct rig_state *)rig_data_pointer(r, RIG_PTRX_STATE))
2023-12-20 19:49:35 +00:00
# endif
2023-12-19 15:35:52 +00:00
2024-01-07 20:11:23 +00:00
typedef enum {
RIG_PTRX_NONE = 0 ,
RIG_PTRX_RIGPORT ,
RIG_PTRX_PTTPORT ,
RIG_PTRX_DCDPORT ,
RIG_PTRX_CACHE ,
RIG_PTRX_AMPPORT ,
RIG_PTRX_ROTPORT ,
2024-01-10 01:06:48 +00:00
RIG_PTRX_ROTPORT2 ,
2024-02-28 08:59:06 +00:00
RIG_PTRX_STATE ,
2024-01-07 20:11:23 +00:00
// New entries go directly above this line====================
RIG_PTRX_MAXIMUM
} rig_ptrx_t ;
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
2023-03-19 20:23:35 +00:00
# define HAMLIB_CACHE_ALWAYS (-1) /*!< value to set cache timeout to always use cache */
2021-12-02 22:44:39 +00:00
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 ,
2021-03-26 15:51:00 +00:00
HAMLIB_CACHE_SPLIT ,
HAMLIB_CACHE_WIDTH
2020-07-02 03:33:32 +00:00
} hamlib_cache_t ;
2020-05-01 17:03:54 +00:00
2021-04-15 16:47:58 +00:00
typedef enum {
TWIDDLE_OFF ,
TWIDDLE_ON
} twiddle_state_t ;
2020-05-01 17:03:54 +00:00
/**
* \ brief Rig cache data
2021-09-19 20:52:41 +00:00
*
2020-05-01 17:03:54 +00:00
* This struct contains all the items we cache at the highest level
2023-11-08 14:05:56 +00:00
* DO NOT MODIFY THIS STRUCTURE AT ALL - - we need a new cache that is a pointer rather than a structure
2020-05-01 17:03:54 +00:00
*/
struct rig_cache {
int timeout_ms ; // the cache timeout for invalidating itself
vfo_t vfo ;
2021-03-15 16:15:41 +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
2021-11-02 03:32:29 +00:00
freq_t freqCurr ; // Other VFO
freq_t freqOther ; // Other VFO
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-01-18 14:28:20 +00:00
freq_t freqMainC ; // VFO_C, VFO_MAINC
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-01-18 14:28:20 +00:00
freq_t freqSubC ; // VFO_SUBC -- only for rigs with 3 Sub VFOs
2021-09-19 20:52:41 +00:00
freq_t freqMem ; // VFO_MEM -- last MEM channel
2021-11-02 03:32:29 +00:00
rmode_t modeCurr ;
rmode_t modeOther ;
2021-03-15 16:15:41 +00:00
rmode_t modeMainA ;
rmode_t modeMainB ;
rmode_t modeMainC ;
rmode_t modeSubA ;
rmode_t modeSubB ;
rmode_t modeSubC ;
rmode_t modeMem ;
2021-11-02 03:32:29 +00:00
pbwidth_t widthCurr ; // if non-zero then rig has separate width for MainA
pbwidth_t widthOther ; // if non-zero then rig has separate width for MainA
2021-03-15 16:15:41 +00:00
pbwidth_t widthMainA ; // if non-zero then rig has separate width for MainA
pbwidth_t widthMainB ; // if non-zero then rig has separate width for MainB
pbwidth_t widthMainC ; // if non-zero then rig has separate width for MainC
pbwidth_t widthSubA ; // if non-zero then rig has separate width for SubA
pbwidth_t widthSubB ; // if non-zero then rig has separate width for SubB
pbwidth_t widthSubC ; // if non-zero then rig has separate width for SubC
pbwidth_t widthMem ; // if non-zero then rig has separate width for Mem
2020-05-01 17:03:54 +00:00
ptt_t ptt ;
split_t split ;
vfo_t split_vfo ; // split caches two values
2021-11-02 03:32:29 +00:00
struct timespec time_freqCurr ;
struct timespec time_freqOther ;
2020-06-04 15:58:22 +00:00
struct timespec time_freqMainA ;
struct timespec time_freqMainB ;
2020-10-18 04:42:57 +00:00
struct timespec time_freqMainC ;
2020-06-04 15:58:22 +00:00
struct timespec time_freqSubA ;
struct timespec time_freqSubB ;
2021-03-15 16:15:41 +00:00
struct timespec time_freqSubC ;
2021-02-07 21:03:43 +00:00
struct timespec time_freqMem ;
2020-05-01 17:03:54 +00:00
struct timespec time_vfo ;
2021-11-02 03:32:29 +00:00
struct timespec time_modeCurr ;
struct timespec time_modeOther ;
2021-03-15 16:15:41 +00:00
struct timespec time_modeMainA ;
struct timespec time_modeMainB ;
struct timespec time_modeMainC ;
struct timespec time_modeSubA ;
struct timespec time_modeSubB ;
struct timespec time_modeSubC ;
struct timespec time_modeMem ;
2021-11-02 03:32:29 +00:00
struct timespec time_widthCurr ;
struct timespec time_widthOther ;
2021-03-15 16:15:41 +00:00
struct timespec time_widthMainA ;
struct timespec time_widthMainB ;
struct timespec time_widthMainC ;
struct timespec time_widthSubA ;
struct timespec time_widthSubB ;
struct timespec time_widthSubC ;
struct timespec time_widthMem ;
2020-05-01 17:03:54 +00:00
struct timespec time_ptt ;
struct timespec time_split ;
2020-05-25 04:42:35 +00:00
int satmode ; // if rig is in satellite mode
2020-05-01 17:03:54 +00:00
} ;
2023-05-07 11:50:35 +00:00
/**
* \ brief Multicast data items the are unique per rig instantiation
* This is meant for internal Hamlib use only
*/
2023-05-09 16:46:54 +00:00
# include <hamlib/multicast.h>
2023-05-07 11:50:35 +00:00
struct multicast_s
{
int multicast_running ;
int sock ;
int seqnumber ;
int runflag ; // = 0;
pthread_t threadid ;
2023-05-13 19:54:43 +00:00
// this mutex is needed to control serial access
// as of 2023-05-13 we have main thread and multicast thread needing it
// eventually we should be able to use cached info only in the main thread to avoid contention
2023-05-13 13:11:50 +00:00
pthread_mutex_t mutex ;
int mutex_initialized ;
2023-05-07 22:17:50 +00:00
//#ifdef HAVE_ARPA_INET_H
2023-10-07 03:59:55 +00:00
//struct ip_mreq mreq; // = {0};
2023-05-07 11:50:35 +00:00
struct sockaddr_in dest_addr ; // = {0};
2023-09-14 13:55:21 +00:00
int port ;
2023-05-07 22:17:50 +00:00
//#endif
2023-05-07 11:50:35 +00:00
} ;
2002-11-12 00:15:01 +00:00
2023-11-05 22:42:02 +00:00
typedef unsigned int rig_comm_status_t ;
# define RIG_COMM_STATUS_OK 0x00
# define RIG_COMM_STATUS_CONNECTING 0x01
# define RIG_COMM_STATUS_DISCONNECTED 0x02
# define RIG_COMM_STATUS_TERMINATED 0x03
# define RIG_COMM_STATUS_WARNING 0x04
# define RIG_COMM_STATUS_ERROR 0x05
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 )
*
2021-03-03 14:21:52 +00:00
* It is NOT fine to move fields around as it can break share library offset
2024-03-03 18:23:33 +00:00
* As of 2024 - 03 - 03 freq_event_elapsed is the last known item being reference externally
2022-01-26 14:26:12 +00:00
* So any additions or changes to this structure must be at the end of the structure
2000-10-08 21:15:28 +00:00
*/
struct rig_state {
2022-01-26 14:26:12 +00:00
/********* ENSURE ANY NEW ITEMS ARE ADDED AT BOTTOM OF THIS STRUCTURE *********/
2017-08-07 13:04:25 +00:00
/*
* overridable fields
*/
2022-01-23 20:43:39 +00:00
// moving the hamlib_port_t to the end of rig_state and making it a pointer
// this should allow changes to hamlib_port_t without breaking shared libraries
Fix spelling errors
Fixed with:
codespell --summary --skip=.git,extra,,lib,macros,security --ignore-words-list="ans,ba,cant,develope,fo,get's,nin,numer,parm,parms,setts,som,statics,ths,ue,vektor,objext" --write-changes --interactive=2
and manual editing.
2022-07-07 19:25:58 +00:00
// these will maintain a copy of the new port_t for backwards compatibility
2022-01-26 14:26:12 +00:00
// to these offsets -- note these must stay until a major version update is done like 5.0
hamlib_port_t_deprecated rigport_deprecated ; /*!< Rig port (internal use). */
hamlib_port_t_deprecated pttport_deprecated ; /*!< PTT port (internal use). */
hamlib_port_t_deprecated dcdport_deprecated ; /*!< 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 */
2021-03-06 18:37:53 +00:00
freq_range_t rx_range_list [ HAMLIB_FRQRANGESIZ ] ; /*!< Receive frequency range list */
freq_range_t tx_range_list [ HAMLIB_FRQRANGESIZ ] ; /*!< Transmit frequency range list */
2001-12-26 23:38:24 +00:00
2021-03-06 18:37:53 +00:00
struct tuning_step_list tuning_steps [ HAMLIB_TSLSTSIZ ] ; /*!< Tuning step list */
2001-02-11 23:04:54 +00:00
2021-03-06 18:37:53 +00:00
struct filter_list filters [ HAMLIB_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
2021-03-06 18:37:53 +00:00
chan_t chan_list [ HAMLIB_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
2021-03-06 18:37:53 +00:00
int preamp [ HAMLIB_MAXDBLSTSIZ ] ; /*!< Preamp list in dB, 0 terminated */
int attenuator [ HAMLIB_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
2021-11-28 18:52:29 +00:00
int transaction_active ; /*!< set to 1 to inform the async reader thread that a synchronous command transaction is waiting for a response, otherwise 0 */
2017-08-07 13:04:25 +00:00
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
2022-01-05 17:12:43 +00:00
int async_data_enabled ; /*!< Whether async data mode is enabled */
2021-11-28 18:52:29 +00:00
int poll_interval ; /*!< Rig state polling period in milliseconds */
2017-08-07 13:04:25 +00:00
freq_t current_freq ; /*!< Frequency currently set */
rmode_t current_mode ; /*!< Mode currently set */
2021-03-02 17:11:12 +00:00
//rmode_t current_modeB; /*!< Mode currently set VFOB */
2017-08-07 13:04:25 +00:00
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 */
2021-09-19 20:52:41 +00:00
// mode_list is used by some
2021-03-03 14:21:52 +00:00
// so anything added to this structure must be below here
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? */
2021-03-02 19:02:13 +00:00
int auto_power_on ; /*!< Allow Hamlib to power on rig
automatically if supported */
int auto_power_off ; /*!< Allow Hamlib to power off rig
2020-07-04 22:23:39 +00:00
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-11-28 18:52:29 +00:00
unsigned char disable_yaesu_bandselect ; /*!< Disables Yaesu 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 */
2021-04-15 16:47:58 +00:00
int twiddle_state ; /*!< keeps track of twiddle status */
2021-11-13 04:56:33 +00:00
vfo_t rx_vfo ; /*!< Rx VFO currently set */
2021-11-28 18:52:29 +00:00
volatile unsigned int snapshot_packet_sequence_number ;
volatile int multicast_publisher_run ;
void * multicast_publisher_priv_data ;
volatile int async_data_handler_thread_run ;
void * async_data_handler_priv_data ;
volatile int poll_routine_thread_run ;
void * poll_routine_priv_data ;
2022-02-03 23:19:05 +00:00
pthread_mutex_t mutex_set_transaction ;
2022-02-05 23:03:46 +00:00
hamlib_port_t rigport ; /*!< Rig port (internal use). */
hamlib_port_t pttport ; /*!< PTT port (internal use). */
hamlib_port_t dcdport ; /*!< DCD port (internal use). */
2022-01-26 14:26:12 +00:00
/********* DO NOT ADD or CHANGE anything (or than to rename) ABOVE THIS LINE *********/
/********* ENSURE ANY NEW ITEMS ARE ADDED AFTER HERE *********/
2022-01-29 14:28:54 +00:00
/* flags instructing the rig_get routines to use cached values when asyncio is in use */
2023-03-19 20:23:35 +00:00
int use_cached_freq ; /*!< flag instructing rig_get_freq to use cached values when asyncio is in use */
int use_cached_mode ; /*!< flag instructing rig_get_mode to use cached values when asyncio is in use */
int use_cached_ptt ; /*!< flag instructing rig_get_ptt to use cached values when asyncio is in use */
int depth ; /*!< a depth counter to use for debug indentation and such */
int lock_mode ; /*!< flag that prevents mode changes if ~= 0 -- see set/get_lock_mode */
powerstat_t powerstat ; /*!< power status */
char * tuner_control_pathname ; /*!< Path to external tuner control program that get 0/1 (Off/On) argument */
2023-04-06 19:21:04 +00:00
char client_version [ 32 ] ; /*!<! Allow client to report version for compatibility checks/capability */
2023-03-19 20:23:35 +00:00
freq_t offset_vfoa ; /*!< Offset to apply to VFOA/Main set_freq */
freq_t offset_vfob ; /*!< Offset to apply to VFOB/Sub set_freq */
2023-05-31 12:27:34 +00:00
struct multicast_s * multicast ; /*!< Pointer to multicast server data */
2023-06-03 21:50:30 +00:00
// Adding a number of items so netrigctl can see the real rig information
// Eventually may want to add these so that rigctld can see more of the backend
// But that will come later if requested -- for now they just fill out dumpstate.c
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 */
int targetable_vfo ; /*!< Bit field list of direct VFO access commands */
int async_data_supported ; /*!< Indicates that rig is capable of outputting asynchronous data updates, such as transceive state updates or spectrum data. 1 if true, 0 otherwise. */
int agc_level_count ; /*!< Number of supported AGC levels. Zero indicates all modes should be available (for backwards-compatibility). */
enum agc_level_e agc_levels [ HAMLIB_MAX_AGC_LEVELS ] ; /*!< Supported AGC levels */
tone_t * ctcss_list ; /*!< CTCSS tones list, zero ended */
tone_t * dcs_list ; /*!< DCS code list, zero ended */
vfo_op_t vfo_ops ; /*!< VFO op bit field list */
scan_t scan_ops ; /*!< Scan bit field list */
int transceive ; /*!< \deprecated Use async_data_supported instead */
int bank_qty ; /*!< Number of banks */
int chan_desc_sz ; /*!< Max length of memory channel name */
freq_range_t rx_range_list1 [ HAMLIB_FRQRANGESIZ ] ; /*!< Receive frequency range list #1 */
freq_range_t tx_range_list1 [ HAMLIB_FRQRANGESIZ ] ; /*!< Transmit frequency range list #1 */
freq_range_t rx_range_list2 [ HAMLIB_FRQRANGESIZ ] ; /*!< Receive frequency range list #2 */
freq_range_t tx_range_list2 [ HAMLIB_FRQRANGESIZ ] ; /*!< Transmit frequency range list #2 */
freq_range_t rx_range_list3 [ HAMLIB_FRQRANGESIZ ] ; /*!< Receive frequency range list #3 */
freq_range_t tx_range_list3 [ HAMLIB_FRQRANGESIZ ] ; /*!< Transmit frequency range list #3 */
freq_range_t rx_range_list4 [ HAMLIB_FRQRANGESIZ ] ; /*!< Receive frequency range list #4 */
freq_range_t tx_range_list4 [ HAMLIB_FRQRANGESIZ ] ; /*!< Transmit frequency range list #4 */
freq_range_t rx_range_list5 [ HAMLIB_FRQRANGESIZ ] ; /*!< Receive frequency range list #5 */
freq_range_t tx_range_list5 [ HAMLIB_FRQRANGESIZ ] ; /*!< Transmit frequency range list #5 */
struct rig_spectrum_scope spectrum_scopes [ HAMLIB_MAX_SPECTRUM_SCOPES ] ; /*!< Supported spectrum scopes. The array index must match the scope ID. Last entry must have NULL name. */
enum rig_spectrum_mode_e spectrum_modes [ HAMLIB_MAX_SPECTRUM_MODES ] ; /*!< Supported spectrum scope modes. Last entry must be RIG_SPECTRUM_MODE_NONE. */
freq_t spectrum_spans [ HAMLIB_MAX_SPECTRUM_SPANS ] ; /*!< Supported spectrum scope frequency spans in Hz in center mode. Last entry must be 0. */
struct rig_spectrum_avg_mode spectrum_avg_modes [ HAMLIB_MAX_SPECTRUM_AVG_MODES ] ; /*!< Supported spectrum scope averaging modes. Last entry must have NULL name. */
int spectrum_attenuator [ HAMLIB_MAXDBLSTSIZ ] ; /*!< Spectrum attenuator list in dB, 0 terminated */
2023-07-08 03:34:45 +00:00
volatile int morse_data_handler_thread_run ;
void * morse_data_handler_priv_data ;
2023-07-10 11:57:11 +00:00
FIFO_RIG * fifo_morse ;
2023-10-31 22:34:31 +00:00
int doppler ; /*!< True if doppler changing detected */
2023-10-31 22:26:37 +00:00
char * multicast_data_addr ; /*!< Multicast data UDP address for publishing rig data and state */
int multicast_data_port ; /*!< Multicast data UDP port for publishing rig data and state */
char * multicast_cmd_addr ; /*!< Multicast command server UDP address for sending commands to rig */
int multicast_cmd_port ; /*!< Multicast command server UDP port for sending commands to rig */
volatile int multicast_receiver_run ;
void * multicast_receiver_priv_data ;
2023-11-05 22:42:02 +00:00
rig_comm_status_t comm_status ; /*!< Detailed rig control status */
char device_id [ HAMLIB_RIGNAMSIZ ] ;
2023-11-23 21:00:05 +00:00
int dual_watch ; /*!< Boolean DUAL_WATCH status */
2023-12-04 15:47:52 +00:00
int post_ptt_delay ; /*!< delay after PTT to allow for relays and such */
2024-03-03 18:23:33 +00:00
struct timespec freq_event_elapsed ;
2024-03-08 23:09:47 +00:00
int freq_skip ; /*!< allow frequency skip for gpredict RX/TX freq set */
2023-12-04 15:47:52 +00:00
// New rig_state items go before this line ============================================
2000-10-08 21:15:28 +00:00
} ;
2023-06-04 20:56:01 +00:00
/**
* \ brief Deprecated Rig state containing live data and customized fields .
* Due to DLL problems this remains in - place in the rig_caps structure but is no longer referred to
* A new rig_state has been added at the end of the structure instead of the middle
*
* This struct contains no data and is just a place holder for DLL alignment
*
* It is NOT fine to touch this struct AT ALL ! ! !
*/
struct rig_state_deprecated {
2023-12-04 15:47:52 +00:00
/********* ENSURE YOU DO NOT EVER MODIFY THIS STRUCTURE *********/
2023-06-06 20:12:52 +00:00
/********* It will remain forever to provide DLL backwards compatiblity ******/
2023-06-04 20:56:01 +00:00
/*
* overridable fields
*/
// moving the hamlib_port_t to the end of rig_state and making it a pointer
// this should allow changes to hamlib_port_t without breaking shared libraries
// these will maintain a copy of the new port_t for backwards compatibility
// to these offsets -- note these must stay until a major version update is done like 5.0
hamlib_port_t_deprecated rigport_deprecated ; /*!< Rig port (internal use). */
hamlib_port_t_deprecated pttport_deprecated ; /*!< PTT port (internal use). */
hamlib_port_t_deprecated dcdport_deprecated ; /*!< DCD port (internal use). */
double vfo_comp ; /*!< VFO compensation in PPM, 0.0 to disable */
int deprecated_itu_region ; /*!< ITU region to select among freq_range_t */
freq_range_t rx_range_list [ HAMLIB_FRQRANGESIZ ] ; /*!< Receive frequency range list */
freq_range_t tx_range_list [ HAMLIB_FRQRANGESIZ ] ; /*!< Transmit frequency range list */
struct tuning_step_list tuning_steps [ HAMLIB_TSLSTSIZ ] ; /*!< Tuning step list */
struct filter_list filters [ HAMLIB_FLTLSTSIZ ] ; /*!< Mode/filter table, at -6dB */
cal_table_t str_cal ; /*!< S-meter calibration table */
chan_t chan_list [ HAMLIB_CHANLSTSIZ ] ; /*!< Channel list, zero ended */
shortfreq_t max_rit ; /*!< max absolute RIT */
shortfreq_t max_xit ; /*!< max absolute XIT */
shortfreq_t max_ifshift ; /*!< max absolute IF-SHIFT */
ann_t announces ; /*!< Announces bit field list */
int preamp [ HAMLIB_MAXDBLSTSIZ ] ; /*!< Preamp list in dB, 0 terminated */
int attenuator [ HAMLIB_MAXDBLSTSIZ ] ; /*!< Preamp list in dB, 0 terminated */
setting_t has_get_func ; /*!< List of get functions */
setting_t has_set_func ; /*!< List of set functions */
setting_t has_get_level ; /*!< List of get level */
setting_t has_set_level ; /*!< List of set level */
setting_t has_get_parm ; /*!< List of get parm */
setting_t has_set_parm ; /*!< List of set parm */
gran_t level_gran [ RIG_SETTING_MAX ] ; /*!< level granularity */
gran_t parm_gran [ RIG_SETTING_MAX ] ; /*!< parm granularity */
/*
* non overridable fields , internal use
*/
int transaction_active ; /*!< set to 1 to inform the async reader thread that a synchronous command transaction is waiting for a response, otherwise 0 */
vfo_t current_vfo ; /*!< VFO currently set */
int vfo_list ; /*!< Complete list of VFO for this rig */
int comm_state ; /*!< Comm port state, opened/closed. */
rig_ptr_t priv ; /*!< Pointer to private rig state data. */
rig_ptr_t obj ; /*!< Internal use by hamlib++ for event handling. */
int async_data_enabled ; /*!< Whether async data mode is enabled */
int poll_interval ; /*!< Rig state polling period in milliseconds */
freq_t current_freq ; /*!< Frequency currently set */
rmode_t current_mode ; /*!< Mode currently set */
//rmode_t current_modeB; /*!< Mode currently set VFOB */
pbwidth_t current_width ; /*!< Passband width currently set */
vfo_t tx_vfo ; /*!< Tx VFO currently set */
rmode_t mode_list ; /*!< Complete list of modes for this rig */
// mode_list is used by some
// so anything added to this structure must be below here
int transmit ; /*!< rig should be transmitting i.e. hard
wired PTT asserted - used by rigs that
don ' t do CAT while in Tx */
freq_t lo_freq ; /*!< Local oscillator frequency of any transverter */
time_t twiddle_time ; /*!< time when vfo twiddling was detected */
int twiddle_timeout ; /*!< timeout to resume from twiddling */
// uplink allows gpredict to behave better by no reading the uplink VFO
int uplink ; /*!< uplink=1 will not read Sub, uplink=2 will not read Main */
struct rig_cache cache ;
int vfo_opt ; /*!< Is -o switch turned on? */
int auto_power_on ; /*!< Allow Hamlib to power on rig
automatically if supported */
int auto_power_off ; /*!< Allow Hamlib to power off rig
automatically if supported */
int auto_disable_screensaver ; /*!< Allow Hamlib to disable the
rig ' s screen saver automatically if
supported */
int ptt_share ; /*!< Share ptt port by open/close during get_ptt, set_ptt hogs the port while active */
int power_now ; /*!< Current RF power level in rig units */
int power_min ; /*!< Minimum RF power level in rig units */
int power_max ; /*!< Maximum RF power level in rig units */
unsigned char disable_yaesu_bandselect ; /*!< Disables Yaesu band select logic */
int twiddle_rit ; /*!< Suppresses VFOB reading (cached value used) so RIT control can be used */
int twiddle_state ; /*!< keeps track of twiddle status */
vfo_t rx_vfo ; /*!< Rx VFO currently set */
volatile unsigned int snapshot_packet_sequence_number ;
volatile int multicast_publisher_run ;
void * multicast_publisher_priv_data ;
volatile int async_data_handler_thread_run ;
void * async_data_handler_priv_data ;
volatile int poll_routine_thread_run ;
void * poll_routine_priv_data ;
pthread_mutex_t mutex_set_transaction ;
hamlib_port_t rigport ; /*!< Rig port (internal use). */
hamlib_port_t pttport ; /*!< PTT port (internal use). */
hamlib_port_t dcdport ; /*!< DCD port (internal use). */
/********* DO NOT ADD or CHANGE anything (or than to rename) ABOVE THIS LINE *********/
/********* ENSURE ANY NEW ITEMS ARE ADDED AFTER HERE *********/
/* flags instructing the rig_get routines to use cached values when asyncio is in use */
int use_cached_freq ; /*!< flag instructing rig_get_freq to use cached values when asyncio is in use */
int use_cached_mode ; /*!< flag instructing rig_get_mode to use cached values when asyncio is in use */
int use_cached_ptt ; /*!< flag instructing rig_get_ptt to use cached values when asyncio is in use */
int depth ; /*!< a depth counter to use for debug indentation and such */
int lock_mode ; /*!< flag that prevents mode changes if ~= 0 -- see set/get_lock_mode */
powerstat_t powerstat ; /*!< power status */
char * tuner_control_pathname ; /*!< Path to external tuner control program that get 0/1 (Off/On) argument */
char client_version [ 32 ] ; /*!<! Allow client to report version for compatibility checks/capability */
freq_t offset_vfoa ; /*!< Offset to apply to VFOA/Main set_freq */
freq_t offset_vfob ; /*!< Offset to apply to VFOB/Sub set_freq */
2023-06-06 20:12:52 +00:00
struct multicast_s * multicast ; /*!< Pointer to multicast server data */
2023-06-04 20:56:01 +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 ) ;
2021-05-26 20:40:53 +00:00
typedef int ( * spectrum_cb_t ) ( RIG * ,
struct rig_spectrum_line * ,
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
*/
2023-06-18 12:45:45 +00:00
// Do NOT add/remove from this structure -- it will break DLL backwards compatiblity
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 */
2021-05-26 20:40:53 +00:00
spectrum_cb_t spectrum_event ; /*!< Spectrum line reception event */
rig_ptr_t spectrum_arg ; /*!< Spectrum line reception argument */
2017-08-07 13:04:25 +00:00
/* 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) */
2023-06-04 20:56:01 +00:00
// Do not remove the deprecated structure -- it will mess up DLL backwards compatibility
struct rig_state_deprecated state_deprecated ; /*!< Deprecated Rig state */
2017-08-07 13:04:25 +00:00
struct rig_callbacks callbacks ; /*!< registered event callbacks */
2023-06-06 20:12:52 +00:00
// state should really be a pointer but that's a LOT of changes involved
2023-06-04 20:56:01 +00:00
struct rig_state state ; /*!< Rig state */
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
2023-05-12 21:04:37 +00:00
extern HAMLIB_EXPORT ( int )
rig_flush_force ( hamlib_port_t * port , int flush_async_data ) ;
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
2023-05-13 13:11:50 +00:00
extern HAMLIB_EXPORT ( void )
rig_lock ( RIG * rig , int lock ) ;
2022-01-31 05:37:01 +00:00
# if BUILTINFUNC
2023-06-08 22:34:39 +00:00
# define rig_set_freq(r,v,f) rig_set_freq(r,v,f,__builtin_FUNCTION())
extern HAMLIB_EXPORT ( int )
rig_set_freq HAMLIB_PARAMS ( ( RIG * rig ,
vfo_t vfo ,
freq_t freq , const char * ) ) ;
2022-01-31 05:37:01 +00:00
# else
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 ) ) ;
2022-01-31 05:37:01 +00:00
# endif
2023-06-08 22:34:39 +00:00
# if BUILTINFUNC
# define rig_get_freq(r,v,f) rig_get_freq(r,v,f,__builtin_FUNCTION())
extern HAMLIB_EXPORT ( int )
rig_get_freq HAMLIB_PARAMS ( ( RIG * rig ,
vfo_t vfo ,
freq_t * freq , const char * ) ) ;
# else
2017-08-07 13:04:25 +00:00
extern HAMLIB_EXPORT ( int )
rig_get_freq HAMLIB_PARAMS ( ( RIG * rig ,
vfo_t vfo ,
freq_t * freq ) ) ;
2023-06-08 22:34:39 +00:00
# endif
2017-08-07 13:04:25 +00:00
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 ) ) ;
2022-01-31 05:37:01 +00:00
# if BUILTINFUNC
2021-08-08 14:02:23 +00:00
# define rig_set_vfo(r,v) rig_set_vfo(r,v,__builtin_FUNCTION())
2017-08-07 13:04:25 +00:00
extern HAMLIB_EXPORT ( int )
rig_set_vfo HAMLIB_PARAMS ( ( RIG * rig ,
2021-08-08 14:02:23 +00:00
vfo_t vfo , const char * func ) ) ;
2021-08-08 17:35:24 +00:00
# else
2021-08-08 17:37:47 +00:00
extern HAMLIB_EXPORT ( int )
2021-08-08 17:35:24 +00:00
rig_set_vfo HAMLIB_PARAMS ( ( RIG * rig ,
2021-08-08 17:40:43 +00:00
vfo_t vfo ) ) ;
2021-08-08 17:35:24 +00:00
# endif
2017-08-07 13:04:25 +00:00
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 ,
2021-09-19 20:52:41 +00:00
vfo_t vfo ,
freq_t * freq ,
rmode_t * mode ,
pbwidth_t * width ,
2021-04-27 15:32:12 +00:00
split_t * split ,
int * satmode ) ) ;
2021-02-07 18:45:59 +00:00
2021-03-03 14:03:18 +00:00
extern HAMLIB_EXPORT ( int )
rig_get_vfo_list HAMLIB_PARAMS ( ( RIG * rig , char * buf , int buflen ) ) ;
2021-02-10 23:30:46 +00:00
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
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 ,
2024-01-22 05:11:55 +00:00
hamlib_token_t token ,
2017-08-07 13:04:25 +00:00
const char * val ) ) ;
2022-01-09 17:16:41 +00:00
// deprecating rig_get_conf
2017-08-07 13:04:25 +00:00
extern HAMLIB_EXPORT ( int )
rig_get_conf HAMLIB_PARAMS ( ( RIG * rig ,
2024-01-22 05:11:55 +00:00
hamlib_token_t token ,
2017-08-07 13:04:25 +00:00
char * val ) ) ;
2022-01-09 17:16:41 +00:00
extern HAMLIB_EXPORT ( int )
rig_get_conf2 HAMLIB_PARAMS ( ( RIG * rig ,
2024-01-22 05:11:55 +00:00
hamlib_token_t token ,
2022-01-09 17:16:41 +00:00
char * val ,
int val_len ) ) ;
2017-08-07 13:04:25 +00:00
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 ,
2024-01-22 05:11:55 +00:00
hamlib_token_t token ,
2017-08-07 13:04:25 +00:00
value_t val ) ) ;
extern HAMLIB_EXPORT ( int )
rig_get_ext_level HAMLIB_PARAMS ( ( RIG * rig ,
vfo_t vfo ,
2024-01-22 05:11:55 +00:00
hamlib_token_t token ,
2017-08-07 13:04:25 +00:00
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 ,
2024-01-22 05:11:55 +00:00
hamlib_token_t token ,
2020-02-11 09:48:13 +00:00
int status ) ) ;
extern HAMLIB_EXPORT ( int )
rig_get_ext_func HAMLIB_PARAMS ( ( RIG * rig ,
vfo_t vfo ,
2024-01-22 05:11:55 +00:00
hamlib_token_t token ,
2020-02-11 09:48:13 +00:00
int * status ) ) ;
2017-08-07 13:04:25 +00:00
extern HAMLIB_EXPORT ( int )
rig_set_ext_parm HAMLIB_PARAMS ( ( RIG * rig ,
2024-01-22 05:11:55 +00:00
hamlib_token_t token ,
2017-08-07 13:04:25 +00:00
value_t val ) ) ;
extern HAMLIB_EXPORT ( int )
rig_get_ext_parm HAMLIB_PARAMS ( ( RIG * rig ,
2024-01-22 05:11:55 +00:00
hamlib_token_t token ,
2017-08-07 13:04:25 +00:00
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 ,
2024-01-22 05:11:55 +00:00
hamlib_token_t token ) ) ;
extern HAMLIB_EXPORT ( hamlib_token_t )
2017-08-07 13:04:25 +00:00
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 ) ) ;
2024-01-22 05:11:55 +00:00
extern HAMLIB_EXPORT ( hamlib_token_t )
2017-08-07 13:04:25 +00:00
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 ) ) ;
2023-08-18 21:49:35 +00:00
extern HAMLIB_EXPORT ( int )
rig_stop_voice_mem HAMLIB_PARAMS ( ( RIG * rig ,
vfo_t vfo ) ) ;
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 )
2021-09-19 20:52:41 +00:00
rig_set_channel 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 ) ) ; /* mem */
extern HAMLIB_EXPORT ( int )
2021-09-19 20:52:41 +00:00
rig_get_channel HAMLIB_PARAMS ( ( RIG * rig ,
2020-11-30 05:32:14 +00:00
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 )
2021-09-19 20:52:41 +00:00
rig_set_chan_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 chans [ ] ) ) ;
extern HAMLIB_EXPORT ( int )
2021-09-19 20:52:41 +00:00
rig_get_chan_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 chans [ ] ) ) ;
extern HAMLIB_EXPORT ( int )
2021-09-19 20:52:41 +00:00
rig_set_chan_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 ,
rig_ptr_t ) ) ;
extern HAMLIB_EXPORT ( int )
2021-09-19 20:52:41 +00:00
rig_get_chan_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 ,
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 )
2021-09-19 20:52:41 +00:00
rig_get_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 )
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 ) ) ;
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 ) ) ;
2021-05-26 20:40:53 +00:00
extern HAMLIB_EXPORT ( int )
rig_set_spectrum_callback HAMLIB_PARAMS ( ( RIG * ,
spectrum_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 ) ) ;
2023-11-23 21:00:05 +00:00
extern HAMLIB_EXPORT ( struct rig_caps * )
2017-08-07 13:04:25 +00:00
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 ) ) ;
2022-06-04 13:53:44 +00:00
extern HAMLIB_EXPORT ( const char * )
rigerror2 HAMLIB_PARAMS ( ( int errnum ) ) ;
2017-08-07 13:04:25 +00:00
extern HAMLIB_EXPORT ( int )
rig_setting2idx HAMLIB_PARAMS ( ( setting_t s ) ) ;
2002-07-09 20:40:28 +00:00
2022-07-23 15:39:14 +00:00
# define HAMLIB_SETTINGS_FILE "hamlib_settings"
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
2023-06-04 20:56:01 +00:00
extern HAMLIB_EXPORT ( void )
rig_get_debug HAMLIB_PARAMS ( ( enum rig_debug_level_e * debug_level ) ) ;
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
2022-05-04 12:26:59 +00:00
extern HAMLIB_EXPORT ( void ) add2debugmsgsave ( const char * s ) ;
2022-05-23 16:40:05 +00:00
// this needs to be fairly big to avoid compiler warnings
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
2022-05-07 22:49:50 +00:00
// debugmsgsave3 is deprecated
2021-03-07 18:02:26 +00:00
extern HAMLIB_EXPORT_VAR ( char ) debugmsgsave3 [ DEBUGMSGSAVE_SIZE ] ; // last-2 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
2022-05-13 21:41:59 +00:00
# define rig_debug(debug_level,fmt,...) do { snprintf(debugmsgsave2,sizeof(debugmsgsave2),fmt,__VA_ARGS__);rig_debug(debug_level,fmt,##__VA_ARGS__); add2debugmsgsave(debugmsgsave2); } while(0)
2019-11-30 16:04:31 +00:00
# endif
# endif
2021-12-05 15:46:00 +00:00
// Measuring elapsed time -- local variable inside function when macro is used
# define ELAPSED1 struct timespec __begin; elapsed_ms(&__begin, HAMLIB_ELAPSED_SET);
2024-01-13 14:27:37 +00:00
# define ELAPSED2 rig_debug(RIG_DEBUG_VERBOSE, "%s%d:%s: elapsed=%.0lfms\n", spaces(rig->state.depth-1), rig->state.depth, __func__, elapsed_ms(&__begin, HAMLIB_ELAPSED_GET));
2021-12-05 15:46:00 +00:00
2022-01-10 05:38:51 +00:00
// use this instead of snprintf for automatic detection of buffer limit
2022-01-18 18:45:50 +00:00
# define SNPRINTF(s,n,...) { snprintf(s,n,##__VA_ARGS__);if (strlen(s) > n-1) fprintf(stderr,"****** %s(%d): buffer overflow ******\n", __func__, __LINE__); }
2022-01-10 05:38:51 +00:00
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 )
2023-11-23 21:00:05 +00:00
rig_register HAMLIB_PARAMS ( ( 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 )
2023-11-23 21:00:05 +00:00
rig_list_foreach HAMLIB_PARAMS ( ( int ( * cfunc ) ( struct rig_caps * , rig_ptr_t ) ,
2017-08-07 13:04:25 +00:00
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 ) ;
2021-05-26 20:40:53 +00:00
extern HAMLIB_EXPORT ( const char * ) rig_stragclevel ( enum agc_level_e level ) ;
2023-10-12 04:22:42 +00:00
extern HAMLIB_EXPORT ( enum agc_level_e ) rig_levelagcstr ( const char * agcString ) ;
2021-12-10 14:39:16 +00:00
extern HAMLIB_EXPORT ( enum agc_level_e ) rig_levelagcvalue ( int agcValue ) ;
2021-12-13 22:15:26 +00:00
extern HAMLIB_EXPORT ( value_t ) rig_valueagclevel ( enum agc_level_e agcLevel ) ;
2004-05-17 21:09:45 +00:00
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 ) ;
2021-05-26 20:40:53 +00:00
extern HAMLIB_EXPORT ( const char * ) rig_strspectrummode ( enum rig_spectrum_mode_e mode ) ;
2023-11-05 22:42:02 +00:00
extern HAMLIB_EXPORT ( const char * ) rig_strcommstatus ( rig_comm_status_t vfo ) ;
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
2022-05-22 11:45:29 +00:00
extern HAMLIB_EXPORT ( const char * ) rig_license HAMLIB_PARAMS ( ( void ) ) ;
extern HAMLIB_EXPORT ( const char * ) rig_version HAMLIB_PARAMS ( ( void ) ) ;
extern HAMLIB_EXPORT ( const char * ) rig_copyright HAMLIB_PARAMS ( ( void ) ) ;
2016-08-31 14:05:47 +00:00
2022-05-22 11:45:29 +00:00
extern HAMLIB_EXPORT ( void ) rig_no_restore_ai ( void ) ;
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-04-27 15:32:12 +00:00
extern HAMLIB_EXPORT ( int ) rig_get_vfo_info ( RIG * rig , vfo_t vfo , freq_t * freq , rmode_t * mode , pbwidth_t * width , split_t * split , int * satmode ) ;
2021-04-27 19:40:32 +00:00
extern HAMLIB_EXPORT ( int ) rig_get_rig_info ( RIG * rig , char * response , int max_response_len ) ;
2021-03-15 16:15:41 +00:00
extern HAMLIB_EXPORT ( int ) rig_get_cache ( RIG * rig , vfo_t vfo , freq_t * freq , int * cache_ms_freq , rmode_t * mode , int * cache_ms_mode , pbwidth_t * width , int * cache_ms_width ) ;
2022-12-18 15:01:27 +00:00
extern HAMLIB_EXPORT ( int ) rig_get_cache_freq ( RIG * rig , vfo_t vfo , freq_t * freq , int * cache_ms_freq ) ;
2020-05-27 17:21:41 +00:00
2021-12-01 17:50:33 +00:00
extern HAMLIB_EXPORT ( int ) rig_set_clock ( RIG * rig , int year , int month , int day , int hour , int min , int sec , double msec , int utc_offset ) ;
extern HAMLIB_EXPORT ( int ) rig_get_clock ( RIG * rig , int * year , int * month , int * day , int * hour , int * min , int * sec , double * msec , int * utc_offset ) ;
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
2021-05-21 20:39:41 +00:00
extern HAMLIB_EXPORT ( int ) rig_cookie ( RIG * rig , enum cookie_e cookie_cmd , char * cookie , int cookie_len ) ;
2021-05-21 04:53:05 +00:00
2022-04-15 18:21:35 +00:00
extern HAMLIB_EXPORT ( int ) rig_password ( RIG * rig , const char * key1 ) ;
2022-05-13 21:41:59 +00:00
extern HAMLIB_EXPORT ( void ) rig_password_generate_secret ( char * pass ,
char result [ HAMLIB_SECRET_LENGTH + 1 ] ) ;
2022-06-01 16:42:54 +00:00
extern HAMLIB_EXPORT ( int ) rig_send_raw ( RIG * rig , const unsigned char * send , int send_len , unsigned char * reply , int reply_len , unsigned char * term ) ;
2022-02-24 23:13:18 +00:00
2022-05-15 15:03:40 +00:00
extern HAMLIB_EXPORT ( int )
longlat2locator HAMLIB_PARAMS ( ( double longitude ,
2021-12-26 16:07:24 +00:00
double latitude ,
char * locator_res ,
int pair_count ) ) ;
2022-05-15 15:03:40 +00:00
extern HAMLIB_EXPORT ( int )
locator2longlat HAMLIB_PARAMS ( ( double * longitude ,
2021-12-26 16:07:24 +00:00
double * latitude ,
const char * locator ) ) ;
2022-04-16 11:48:41 +00:00
extern HAMLIB_EXPORT ( char * ) rig_make_md5 ( char * pass ) ;
2022-06-02 20:55:56 +00:00
extern HAMLIB_EXPORT ( int ) rig_set_lock_mode ( RIG * rig , int lock ) ;
extern HAMLIB_EXPORT ( int ) rig_get_lock_mode ( RIG * rig , int * lock ) ;
2023-01-02 17:30:52 +00:00
extern HAMLIB_EXPORT ( int ) rig_is_model ( RIG * rig , rig_model_t model ) ;
2023-05-22 14:32:04 +00:00
extern HAMLIB_EXPORT ( char * ) rig_date_strget ( char * buf , int buflen , int localtime ) ;
2023-07-22 15:32:25 +00:00
enum GPIO { GPIO1 , GPIO2 , GPIO3 , GPIO4 } ;
extern HAMLIB_EXPORT ( int ) rig_cm108_get_bit ( hamlib_port_t * p , enum GPIO gpio , int * bit ) ;
extern HAMLIB_EXPORT ( int ) rig_cm108_set_bit ( hamlib_port_t * p , enum GPIO gpio , int bit ) ;
2024-01-18 13:39:56 +00:00
extern HAMLIB_EXPORT ( int ) rig_band_changed ( RIG * rig , hamlib_bandselect_t band ) ;
2023-07-22 15:32:25 +00:00
2024-01-07 20:11:23 +00:00
extern HAMLIB_EXPORT ( void * ) rig_data_pointer ( RIG * rig , rig_ptrx_t idx ) ;
2021-12-26 16:07:24 +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
/*! @} */