Hamlib  4.6~git
rig.h
Go to the documentation of this file.
1 /*
2  * Hamlib Interface - API header
3  * Copyright (c) 2000-2003 by Frank Singleton
4  * Copyright (c) 2000-2012 by Stephane Fillod
5  *
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20  *
21  */
22 /* SPDX-License-Identifier: LGPL-2.1-or-later */
23 
24 #ifndef _RIG_H
25 #define _RIG_H 1
26 
27 // as of 2023-11-23 rig_caps is no longer constant
28 // this #define allows clients to test which declaration to use for backwards compatibility
29 #define RIGCAPS_NOT_CONST 1
30 
31 #define BUILTINFUNC 0
32 
33 // Our shared secret password
34 #define HAMLIB_SECRET_LENGTH 32
35 
36 #define HAMLIB_TRACE rig_debug(RIG_DEBUG_TRACE,"%s%s(%d) trace\n",spaces(STATE(rig)->depth), __FILE__, __LINE__)
37 #define __FILENAME__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
38 
39 #include <stdio.h>
40 #include <string.h>
41 #include <inttypes.h>
42 #include <time.h>
43 
44 // to stop warnings about including winsock2.h before windows.h
45 #if defined(_WIN32)
46 #include <winsock2.h>
47 #include <windows.h>
48 #include <ws2tcpip.h>
49 #else
50 #include <sys/socket.h>
51 #include <netinet/in.h>
52 #include <arpa/inet.h>
53 #endif
54 
55 // mingw64 still shows __TIMESIZE != 64
56 // need to do more testing
57 #if 0
58 #if __TIMESIZE != 64
59 #warning TIMESIZE != 64 -- Please report your OS system to hamlib-developer@lists.sourceforge.net
60 #endif
61 #endif
62 
63 // For MSVC install the NUGet pthread package
64 #if defined(_MSC_VER)
65 #define HAVE_STRUCT_TIMESPEC
66 #endif
67 #include <pthread.h>
68 
69 /* Rig list is in a separate file so as not to mess up w/ this one */
70 #include <hamlib/riglist.h>
71 //#include <hamlib/config.h>
72 
86 /* __BEGIN_DECLS should be used at the beginning of your declarations,
87  * so that C++ compilers don't mangle their names. Use __END_DECLS at
88  * the end of C declarations. */
90 #undef __BEGIN_DECLS
91 #undef __END_DECLS
92 #ifdef __cplusplus
93 # define __BEGIN_DECLS extern "C" {
94 # define __END_DECLS }
95 #else
96 # define __BEGIN_DECLS /* empty */
97 # define __END_DECLS /* empty */
98 #endif
99 
101 /* HAMLIB_PARAMS is a macro used to wrap function prototypes, so that compilers
102  * that don't understand ANSI C prototypes still work, and ANSI C
103  * compilers can issue warnings about type mismatches. */
105 #undef HAMLIB_PARAMS
106 #if defined (__STDC__) \
107  || defined (_AIX) \
108  || (defined (__mips) && defined (_SYSTYPE_SVR4)) \
109  || defined(__CYGWIN__) \
110  || defined(_WIN32) \
111  || defined(__cplusplus)
112 # define HAMLIB_PARAMS(protos) protos
113 # define rig_ptr_t void *
114 # define amp_ptr_t void *
115 #else
116 # define HAMLIB_PARAMS(protos) ()
117 # define rig_ptr_t char *
118 # define amp_ptr_t char *
119 #endif
120 
122 #include <hamlib/rig_dll.h>
123 
124 #ifndef SWIGLUA
125 #define CONSTANT_64BIT_FLAG(BIT) (1ull << (BIT))
127 #else
129 /* SWIG's older Lua generator doesn't grok ull due to Lua using a
130  double-precision floating point type internally for number
131  representations (max 53 bits of precision) so makes a string
132  constant from a constant number literal using ull */
133 // #define CONSTANT_64BIT_FLAG(BIT) (1 << (BIT))
134 // #define SWIGLUAHIDE
135 /* But this appears to have been fixed so we'll use the correct one now
136  If you have the older version of SWIG comment out this line and use
137  the two above */
138 // This 1ul definition works on swig 4.0.1 and lua 5.3.5
139 #define CONSTANT_64BIT_FLAG(BIT) (1ul << (BIT))
140 #endif
141 
142 __BEGIN_DECLS
143 
144 // FIFO currently used for send_morse queue
145 #define HAMLIB_FIFO_SIZE 1024
146 
147 typedef struct
148 {
149  char data[HAMLIB_FIFO_SIZE];
150  int head;
151  int tail;
152  int flush; // flush flag for stop_morse
153 #ifdef _PTHREAD_H
154  pthread_mutex_t mutex;
155 #else
156  int mutex;
157 #endif
158 } FIFO_RIG;
159 
160 
165 // cookie is 26-char time code plus 10-char (2^31-1) random number
166 #define HAMLIB_COOKIE_SIZE 37
167 extern int cookie_use; // this is global as once one client requests it everybody needs to honor it
168 extern int skip_init; // allow rigctl to skip any radio commands at startup
169 
171 extern HAMLIB_EXPORT_VAR(const char) hamlib_version[];
172 extern HAMLIB_EXPORT_VAR(const char) hamlib_copyright[];
173 extern HAMLIB_EXPORT_VAR(const char *) hamlib_version2;
174 extern HAMLIB_EXPORT_VAR(const char *) hamlib_copyright2;
176 
188  RIG_OK = 0,
210  RIG_EEND // MUST BE LAST ITEM IN LAST
211 };
221 #define RIG_IS_SOFT_ERRCODE(errcode) (errcode == RIG_EINVAL || errcode == RIG_ENIMPL || errcode == RIG_ERJCTED \
222  || errcode == RIG_ETRUNC || errcode == RIG_ENAVAIL || errcode == RIG_ENTARGET \
223  || errcode == RIG_EVFO || errcode == RIG_EDOM || errcode == RIG_EDEPRECATED \
224  || errcode == RIG_ESECURITY || errcode == RIG_EPOWER)
225 
229 #define NETRIGCTL_RET "RPRT "
230 
231 
247 };
248 
249 
250 /* --------------- Rig capabilities -----------------*/
251 
252 /* Forward struct references */
253 
254 struct rig;
255 struct rig_state;
256 
260 typedef struct s_rig RIG;
261 
263 #define HAMLIB_RIGNAMSIZ 30
264 #define HAMLIB_RIGVERSIZ 8
265 #define HAMLIB_FILPATHLEN 512
266 #define HAMLIB_FRQRANGESIZ 30
267 #define HAMLIB_MAXCHANDESC 30 /* describe channel eg: "WWV 5Mhz" */
268 #define HAMLIB_TSLSTSIZ 20 /* max tuning step list size, zero ended */
269 #define HAMLIB_FLTLSTSIZ 60 /* max mode/filter list size, zero ended */
270 #define HAMLIB_MAXDBLSTSIZ 8 /* max preamp/att levels supported, zero ended */
271 #define HAMLIB_CHANLSTSIZ 16 /* max mem_list size, zero ended */
272 #define HAMLIB_MAX_AGC_LEVELS 8 /* max AGC levels supported */
273 #define HAMLIB_MAX_SPECTRUM_SCOPES 4 /* max number of spectrum scopes supported */
274 #define HAMLIB_MAX_SPECTRUM_MODES 5 /* max number of spectrum modes supported */
275 #define HAMLIB_MAX_SPECTRUM_AVG_MODES 12 /* max number of spectrum averaging modes supported */
276 #define HAMLIB_MAX_SPECTRUM_SPANS 20 /* max number of spectrum modes supported */
277 #define HAMLIB_MAX_SPECTRUM_DATA 2048 /* max number of data bytes in a single spectrum line */
278 #define HAMLIB_MAX_CAL_LENGTH 32 /* max calibration plots in cal_table_t */
279 #define HAMLIB_MAX_MODES 63
280 #define HAMLIB_MAX_VFOS 31
281 #define HAMLIB_MAX_ROTORS 63
282 #define HAMLIB_MAX_VFO_OPS 31
283 #define HAMLIB_MAX_RSCANS 31
284 #define HAMLIB_MAX_SNAPSHOT_PACKET_SIZE 16384 /* maximum number of bytes in a UDP snapshot packet */
285 
287 
298 #define CTCSS_LIST_SIZE 60
299 #define DCS_LIST_SIZE 128
300 typedef unsigned int tone_t;
301 
302 
308 typedef enum rig_port_e {
323 } rig_port_t;
324 
325 
335 };
336 
337 
345 };
346 
347 
355 };
356 
357 
361 typedef enum {
362  RIG_FLAG_RECEIVER = (1 << 1),
363  RIG_FLAG_TRANSMITTER = (1 << 2),
364  RIG_FLAG_SCANNER = (1 << 3),
365  RIG_FLAG_MOBILE = (1 << 4),
366  RIG_FLAG_HANDHELD = (1 << 5),
367  RIG_FLAG_COMPUTER = (1 << 6),
368  RIG_FLAG_TRUNKING = (1 << 7),
369  RIG_FLAG_APRS = (1 << 8),
370  RIG_FLAG_TNC = (1 << 9),
371  RIG_FLAG_DXCLUSTER = (1 << 10),
372  RIG_FLAG_TUNER = (1 << 11)
373 } rig_type_t;
374 
378 /* TODO: kill me, and replace by real AGC delay */
380  RIG_AGC_OFF = 0,
381  RIG_AGC_SUPERFAST,
382  RIG_AGC_FAST,
383  RIG_AGC_SLOW,
385  RIG_AGC_MEDIUM,
386  RIG_AGC_AUTO,
387  RIG_AGC_LONG,
390 };
391 
392 
394 #define RIG_FLAG_TRANSCEIVER (RIG_FLAG_RECEIVER|RIG_FLAG_TRANSMITTER)
395 #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)
396 
397 #define RIG_TYPE_OTHER 0
398 #define RIG_TYPE_TRANSCEIVER RIG_FLAG_TRANSCEIVER
399 #define RIG_TYPE_HANDHELD (RIG_FLAG_TRANSCEIVER|RIG_FLAG_HANDHELD)
400 #define RIG_TYPE_MOBILE (RIG_FLAG_TRANSCEIVER|RIG_FLAG_MOBILE)
401 #define RIG_TYPE_RECEIVER RIG_FLAG_RECEIVER
402 #define RIG_TYPE_PCRECEIVER (RIG_FLAG_COMPUTER|RIG_FLAG_RECEIVER)
403 #define RIG_TYPE_SCANNER (RIG_FLAG_SCANNER|RIG_FLAG_RECEIVER)
404 #define RIG_TYPE_TRUNKSCANNER (RIG_TYPE_SCANNER|RIG_FLAG_TRUNKING)
405 #define RIG_TYPE_COMPUTER (RIG_FLAG_TRANSCEIVER|RIG_FLAG_COMPUTER)
406 #define RIG_TYPE_TUNER RIG_FLAG_TUNER
407 
409 
419  /* RIG_STATUS_NEW * *!< Initial release of code
420  * !! Use of RIG_STATUS_NEW is deprecated. Do not use it anymore */
421 };
422 
427 #define RIG_STATUS_NEW RIG_STATUS_UNTESTED
428 
429 
433 typedef enum {
437 } rptr_shift_t;
438 
439 
443 typedef enum {
446 } split_t;
447 
448 
454 typedef double freq_t;
455 
459 #define PRIfreq ".0f"
460 
464 #define SCNfreq "lf"
465 
468 #define FREQFMT SCNfreq
469 
470 
476 typedef signed long shortfreq_t;
477 
479 #define Hz(f) ((freq_t)(f))
480 
481 #define kHz(f) ((freq_t)((f)*(freq_t)1000))
482 
483 #define MHz(f) ((freq_t)((f)*(freq_t)1000000))
484 
485 #define GHz(f) ((freq_t)((f)*(freq_t)1000000000))
486 
488 #define s_Hz(f) ((shortfreq_t)(f))
489 
490 #define s_kHz(f) ((shortfreq_t)((f)*(shortfreq_t)1000))
491 
492 #define s_MHz(f) ((shortfreq_t)((f)*(shortfreq_t)1000000))
493 
494 #define s_GHz(f) ((shortfreq_t)((f)*(shortfreq_t)1000000000))
495 
497 #define RIG_FREQ_NONE Hz(0)
498 
499 
514 typedef unsigned int vfo_t;
515 
518 #define RIG_VFO_N(n) (1u<<(n))
519 
521 #define RIG_VFO_NONE 0
522 
524 #define RIG_VFO_A RIG_VFO_N(0)
525 
527 #define RIG_VFO_B RIG_VFO_N(1)
528 
530 #define RIG_VFO_C RIG_VFO_N(2)
531 
532 // Any addition VFOS need to go from 3-20
533 // To maintain backward compatibility these values cannot change
534 
536 #define RIG_VFO_SUB_A RIG_VFO_N(21)
537 
539 #define RIG_VFO_SUB_B RIG_VFO_N(22)
540 
542 #define RIG_VFO_SUB_C RIG_VFO_N(3)
543 
545 #define RIG_VFO_MAIN_A RIG_VFO_N(23)
546 
548 #define RIG_VFO_MAIN_B RIG_VFO_N(24)
549 
551 #define RIG_VFO_MAIN_C RIG_VFO_N(4)
552 
554 #define RIG_VFO_OTHER RIG_VFO_N(5)
555 
557 #define RIG_VFO_SUB RIG_VFO_N(25)
558 
560 #define RIG_VFO_MAIN RIG_VFO_N(26)
561 
563 #define RIG_VFO_VFO RIG_VFO_N(27)
564 
566 #define RIG_VFO_MEM RIG_VFO_N(28)
567 
569 #define RIG_VFO_CURR RIG_VFO_N(29)
570 
572 #define RIG_VFO_TX_FLAG RIG_VFO_N(30)
573 
575 #define RIG_VFO_ALL RIG_VFO_N(31)
576 
577 // we can also use RIG_VFO_N(31) if needed
578 
579 // Misc VFO Macros
580 
582 #define RIG_VFO_TX_VFO(v) ((v)|RIG_VFO_TX_FLAG)
583 
585 #define RIG_VFO_TX RIG_VFO_TX_VFO(RIG_VFO_CURR)
586 
588 #define RIG_VFO_RX RIG_VFO_CURR
589 
590 
591 /*
592  * targetable bitfields, for internal use.
593  * In rig.c lack of a flag will case a VFO change if needed
594  * So setting this flag will mean the backend handles any VFO needs
595  * For many rigs RITXIT, PTT, MEM, and BANK are non-VFO commands so need these flags to avoid unnecessary VFO swapping
596  */
598 #define RIG_TARGETABLE_NONE 0
599 #define RIG_TARGETABLE_FREQ (1<<0)
600 #define RIG_TARGETABLE_MODE (1<<1) // mode by vfo or same mode on both vfos
601 #define RIG_TARGETABLE_PURE (1<<2) // deprecated -- not used -- reuse it
602 #define RIG_TARGETABLE_TONE (1<<3)
603 #define RIG_TARGETABLE_FUNC (1<<4)
604 #define RIG_TARGETABLE_LEVEL (1<<5)
605 #define RIG_TARGETABLE_RITXIT (1<<6)
606 #define RIG_TARGETABLE_PTT (1<<7)
607 #define RIG_TARGETABLE_MEM (1<<8)
608 #define RIG_TARGETABLE_BANK (1<<9)
609 #define RIG_TARGETABLE_ANT (1<<10)
610 #define RIG_TARGETABLE_ROOFING (1<<11) // roofing filter targetable by VFO
611 #define RIG_TARGETABLE_SPECTRUM (1<<12) // spectrum scope targetable by VFO
612 #define RIG_TARGETABLE_BAND (1<<13) // Band select -- e.g. Yaesu BS command
613 #define RIG_TARGETABLE_COMMON (RIG_TARGETABLE_RITXIT | RIG_TARGETABLE_PTT | RIG_TARGETABLE_MEM | RIG_TARGETABLE_BANK)
614 #define RIG_TARGETABLE_ALL 0x7fffffff
615 //
617 //
618 // Newer Icoms like the 9700 and 910 have VFOA/B on both Main & Sub
619 // Compared to older rigs which have one or the other
620 // So we need to distinguish between them
622 #define VFO_HAS_A_B ((STATE(rig)->vfo_list & (RIG_VFO_A|RIG_VFO_B)) == (RIG_VFO_A|RIG_VFO_B))
623 #define VFO_HAS_MAIN_SUB ((STATE(rig)->vfo_list & (RIG_VFO_MAIN|RIG_VFO_SUB)) == (RIG_VFO_MAIN|RIG_VFO_SUB))
624 #define VFO_HAS_MAIN_SUB_ONLY ((!VFO_HAS_A_B) & VFO_HAS_MAIN_SUB)
625 #define VFO_HAS_MAIN_SUB_A_B_ONLY (VFO_HAS_A_B & VFO_HAS_MAIN_SUB)
626 #define VFO_HAS_A_B_ONLY (VFO_HAS_A_B & (!VFO_HAS_MAIN_SUB))
627 #define VFO_DUAL (RIG_VFO_MAIN_A|RIG_VFO_MAIN_B|RIG_VFO_SUB_A|RIG_VFO_SUB_B)
628 #define VFO_HAS_DUAL ((STATE(rig)->vfo_list & VFO_DUAL) == VFO_DUAL)
629 
635 #define RIG_PASSBAND_NORMAL s_Hz(0)
636 
640 #define RIG_PASSBAND_NOCHANGE s_Hz(-1)
641 
647 
648 typedef float agc_time_t;
649 
650 typedef enum dcd_e {
653 } dcd_t;
654 
655 
661 typedef enum {
671 } dcd_type_t;
672 
673 
677 typedef enum {
682 } ptt_t;
683 
684 
690 typedef enum {
700 } ptt_type_t;
701 
702 
706 typedef enum {
708  RIG_POWER_ON = (1 << 0),
709  RIG_POWER_STANDBY = (1 << 1),
710  RIG_POWER_OPERATE = (1 << 2),
711  RIG_POWER_UNKNOWN = (1 << 3)
712 } powerstat_t;
713 
714 
718 typedef enum {
720  RIG_RESET_SOFT = (1 << 0),
721  RIG_RESET_VFO = (1 << 1),
722  RIG_RESET_MCALL = (1 << 2),
723  RIG_RESET_MASTER = (1 << 3)
724 } reset_t;
725 
726 typedef enum {
727  RIG_CLIENT_UNKNOWN,
728  RIG_CLIENT_WSJTX,
729  RIG_CLIENT_GPREDICT
730 } client_t;
731 
732 
748 typedef enum {
750  RIG_OP_CPY = (1 << 0),
751  RIG_OP_XCHG = (1 << 1),
752  RIG_OP_FROM_VFO = (1 << 2),
753  RIG_OP_TO_VFO = (1 << 3),
754  RIG_OP_MCL = (1 << 4),
755  RIG_OP_UP = (1 << 5),
756  RIG_OP_DOWN = (1 << 6),
757  RIG_OP_BAND_UP = (1 << 7),
758  RIG_OP_BAND_DOWN = (1 << 8),
759  RIG_OP_LEFT = (1 << 9),
760  RIG_OP_RIGHT = (1 << 10),
761  RIG_OP_TUNE = (1 << 11),
762  RIG_OP_TOGGLE = (1 << 12)
763 } vfo_op_t;
764 
772 typedef enum { // numbers here reflect the Yaesu values
783  RIG_BAND_6M = 10,
785  RIG_BAND_MW = 12,
790 } hamlib_band_t;
791 
792 typedef enum { // numbers here reflect generic values -- need to map to rig values
793  RIG_BANDSELECT_UNUSED = CONSTANT_64BIT_FLAG(0),
794  RIG_BANDSELECT_2200M = CONSTANT_64BIT_FLAG(1),
795  RIG_BANDSELECT_600M = CONSTANT_64BIT_FLAG(2),
796  RIG_BANDSELECT_160M = CONSTANT_64BIT_FLAG(3),
797  RIG_BANDSELECT_80M = CONSTANT_64BIT_FLAG(4),
798  RIG_BANDSELECT_60M = CONSTANT_64BIT_FLAG(5),
799  RIG_BANDSELECT_40M = CONSTANT_64BIT_FLAG(6),
800  RIG_BANDSELECT_30M = CONSTANT_64BIT_FLAG(7),
801  RIG_BANDSELECT_20M = CONSTANT_64BIT_FLAG(8),
802  RIG_BANDSELECT_17M = CONSTANT_64BIT_FLAG(9),
803  RIG_BANDSELECT_15M = CONSTANT_64BIT_FLAG(10),
804  RIG_BANDSELECT_12M = CONSTANT_64BIT_FLAG(11),
805  RIG_BANDSELECT_10M = CONSTANT_64BIT_FLAG(12),
806  RIG_BANDSELECT_6M = CONSTANT_64BIT_FLAG(13),
807  RIG_BANDSELECT_WFM = CONSTANT_64BIT_FLAG(14),
808  RIG_BANDSELECT_GEN = CONSTANT_64BIT_FLAG(15),
809  RIG_BANDSELECT_MW = CONSTANT_64BIT_FLAG(16),
810  RIG_BANDSELECT_AIR = CONSTANT_64BIT_FLAG(17),
811  RIG_BANDSELECT_4M = CONSTANT_64BIT_FLAG(18),
812  RIG_BANDSELECT_2M = CONSTANT_64BIT_FLAG(19),
813  RIG_BANDSELECT_1_25M = CONSTANT_64BIT_FLAG(20),
814  RIG_BANDSELECT_70CM = CONSTANT_64BIT_FLAG(21),
815  RIG_BANDSELECT_33CM = CONSTANT_64BIT_FLAG(22),
816  RIG_BANDSELECT_23CM = CONSTANT_64BIT_FLAG(23),
817  RIG_BANDSELECT_13CM = CONSTANT_64BIT_FLAG(24),
818  RIG_BANDSELECT_9CM = CONSTANT_64BIT_FLAG(25),
819  RIG_BANDSELECT_5CM = CONSTANT_64BIT_FLAG(26),
820  RIG_BANDSELECT_3CM = CONSTANT_64BIT_FLAG(27),
822 
823 
824 #define RIG_BANDSELECT_ALL
825 #define RIG_BANDSELECT_LF (RIG_BANDSELECT_2200M | RIG_BANDSELECT_600M)
826 #define RIG_BANDSELECT_HF (RIG_BANDSELECT_160M | RIG_BANDSELECT_80M | RIG_BANDSELECT_60M | RIG_BANDSELECT_40M\
827 | RIG_BANDSELECT_30M | RIG_BANDSELECT_20M | RIG_BANDSELECT_17M | RIG_BANDSELECT_15M | RIG_BANDSELECT_12M\
828 RIG_BANDSELECT_10M | RIG_BANDSELECT_6M)
829 #define RIG_BANDSELECT_VHF (RIG_BANDSELECT_AIR | RIG_BANDSELECT_2M| RIG_BANDSELECT_1_25M(
830 #define RIG_BANDSELECT_UHF (RIG_BANDSELECT_70CM)
831 
832 
841 typedef enum {
843  RIG_SCAN_MEM = (1 << 0),
844  RIG_SCAN_SLCT = (1 << 1),
845  RIG_SCAN_PRIO = (1 << 2),
846  RIG_SCAN_PROG = (1 << 3),
847  RIG_SCAN_DELTA = (1 << 4),
848  RIG_SCAN_VFO = (1 << 5),
849  RIG_SCAN_PLT = (1 << 6),
850  RIG_SCAN_STOP = (1 << 7)
851 } scan_t;
852 
853 
857 typedef long hamlib_token_t;
858 #define token_t hamlib_token_t
859 
860 
862 #define RIG_CONF_END 0
863 
865 
879 /* strongly inspired from soundmodem. Thanks Thomas! */
888 };
889 
891 #define RIG_COMBO_MAX 16
892 #define RIG_BIN_MAX 80
893 
898 struct confparams {
900  const char *name;
901  const char *label;
902  const char *tooltip;
903  const char *dflt;
905  union {
906  struct {
907  float min;
908  float max;
909  float step;
910  } n;
911  struct {
912  const char *combostr[RIG_COMBO_MAX];
913  } c;
914  } u;
915 };
916 
917 
923 typedef enum {
926  RIG_ANN_FREQ = (1 << 0),
927  RIG_ANN_RXMODE = (1 << 1),
928  RIG_ANN_CW = (1 << 2),
929  RIG_ANN_ENG = (1 << 3),
930  RIG_ANN_JAP = (1 << 4)
931 } ann_t;
932 
933 
980 typedef unsigned int ant_t;
981 
982 #define RIG_ANT_NONE 0
983 #define RIG_ANT_N(n) ((ant_t)1<<(n))
984 #define RIG_ANT_1 RIG_ANT_N(0)
985 #define RIG_ANT_2 RIG_ANT_N(1)
986 #define RIG_ANT_3 RIG_ANT_N(2)
987 #define RIG_ANT_4 RIG_ANT_N(3)
988 #define RIG_ANT_5 RIG_ANT_N(4)
989 
990 #define RIG_ANT_UNKNOWN RIG_ANT_N(30)
991 #define RIG_ANT_CURR RIG_ANT_N(31)
992 
993 #define RIG_ANT_MAX 32
994 
995 
997 #define RIG_AGC_LAST 99999
998 
1000 #if 1 // deprecated
1001 
1005  RIG_METER_NONE = 0, /*< No display meter */
1006  RIG_METER_SWR = (1 << 0), /*< Stationary Wave Ratio */
1007  RIG_METER_COMP = (1 << 1), /*< Compression level */
1008  RIG_METER_ALC = (1 << 2), /*< ALC */
1009  RIG_METER_IC = (1 << 3), /*< IC */
1010  RIG_METER_DB = (1 << 4), /*< DB */
1011  RIG_METER_PO = (1 << 5), /*< Power Out */
1012  RIG_METER_VDD = (1 << 6), /*< Final Amp Voltage */
1013  RIG_METER_TEMP = (1 << 7) /*< Final Amp Temperature */
1014 };
1015 #endif
1016 
1017 
1023 typedef union {
1024  signed int i;
1025  unsigned int u;
1026  float f;
1027  char *s;
1028  const char *cs;
1029  struct {
1031  int l;
1032  unsigned char *d; /* Pointer to data buffer */
1033  } b;
1035 } value_t;
1036 
1037 
1046 typedef uint64_t rig_level_e;
1047 #define RIG_LEVEL_NONE 0
1048 #define RIG_LEVEL_PREAMP CONSTANT_64BIT_FLAG(0)
1049 #define RIG_LEVEL_ATT CONSTANT_64BIT_FLAG(1)
1050 #define RIG_LEVEL_VOXDELAY CONSTANT_64BIT_FLAG(2)
1051 #define RIG_LEVEL_AF CONSTANT_64BIT_FLAG(3)
1052 #define RIG_LEVEL_RF CONSTANT_64BIT_FLAG(4)
1053 #define RIG_LEVEL_SQL CONSTANT_64BIT_FLAG(5)
1054 #define RIG_LEVEL_IF CONSTANT_64BIT_FLAG(6)
1055 #define RIG_LEVEL_APF CONSTANT_64BIT_FLAG(7)
1056 #define RIG_LEVEL_NR CONSTANT_64BIT_FLAG(8)
1057 #define RIG_LEVEL_PBT_IN CONSTANT_64BIT_FLAG(9)
1058 #define RIG_LEVEL_PBT_OUT CONSTANT_64BIT_FLAG(10)
1059 #define RIG_LEVEL_CWPITCH CONSTANT_64BIT_FLAG(11)
1060 #define RIG_LEVEL_RFPOWER CONSTANT_64BIT_FLAG(12)
1061 #define RIG_LEVEL_MICGAIN CONSTANT_64BIT_FLAG(13)
1062 #define RIG_LEVEL_KEYSPD CONSTANT_64BIT_FLAG(14)
1063 #define RIG_LEVEL_NOTCHF CONSTANT_64BIT_FLAG(15)
1064 #define RIG_LEVEL_COMP CONSTANT_64BIT_FLAG(16)
1065 #define RIG_LEVEL_AGC CONSTANT_64BIT_FLAG(17)
1066 #define RIG_LEVEL_BKINDL CONSTANT_64BIT_FLAG(18)
1067 #define RIG_LEVEL_BALANCE CONSTANT_64BIT_FLAG(19)
1068 #define RIG_LEVEL_METER CONSTANT_64BIT_FLAG(20)
1069 #define RIG_LEVEL_VOXGAIN CONSTANT_64BIT_FLAG(21)
1070 #define RIG_LEVEL_ANTIVOX CONSTANT_64BIT_FLAG(22)
1071 #define RIG_LEVEL_SLOPE_LOW CONSTANT_64BIT_FLAG(23)
1072 #define RIG_LEVEL_SLOPE_HIGH CONSTANT_64BIT_FLAG(24)
1073 #define RIG_LEVEL_BKIN_DLYMS CONSTANT_64BIT_FLAG(25)
1076 #define RIG_LEVEL_RAWSTR CONSTANT_64BIT_FLAG(26)
1077 //#define RIG_LEVEL_SQLSTAT CONSTANT_64BIT_FLAG(27)
1078 #define RIG_LEVEL_SWR CONSTANT_64BIT_FLAG(28)
1079 #define RIG_LEVEL_ALC CONSTANT_64BIT_FLAG(29)
1080 #define RIG_LEVEL_STRENGTH CONSTANT_64BIT_FLAG(30)
1081  /* RIG_LEVEL_BWC (1<<31) */
1082 #define RIG_LEVEL_RFPOWER_METER CONSTANT_64BIT_FLAG(32)
1083 #define RIG_LEVEL_COMP_METER CONSTANT_64BIT_FLAG(33)
1084 #define RIG_LEVEL_VD_METER CONSTANT_64BIT_FLAG(34)
1085 #define RIG_LEVEL_ID_METER CONSTANT_64BIT_FLAG(35)
1087 #define RIG_LEVEL_NOTCHF_RAW CONSTANT_64BIT_FLAG(36)
1088 #define RIG_LEVEL_MONITOR_GAIN CONSTANT_64BIT_FLAG(37)
1089 #define RIG_LEVEL_NB CONSTANT_64BIT_FLAG(38)
1090 #define RIG_LEVEL_RFPOWER_METER_WATTS CONSTANT_64BIT_FLAG(39)
1091 #define RIG_LEVEL_SPECTRUM_MODE CONSTANT_64BIT_FLAG(40)
1092 #define RIG_LEVEL_SPECTRUM_SPAN CONSTANT_64BIT_FLAG(41)
1093 #define RIG_LEVEL_SPECTRUM_EDGE_LOW CONSTANT_64BIT_FLAG(42)
1094 #define RIG_LEVEL_SPECTRUM_EDGE_HIGH CONSTANT_64BIT_FLAG(43)
1095 #define RIG_LEVEL_SPECTRUM_SPEED CONSTANT_64BIT_FLAG(44)
1096 #define RIG_LEVEL_SPECTRUM_REF CONSTANT_64BIT_FLAG(45)
1097 #define RIG_LEVEL_SPECTRUM_AVG CONSTANT_64BIT_FLAG(46)
1098 #define RIG_LEVEL_SPECTRUM_ATT CONSTANT_64BIT_FLAG(47)
1099 #define RIG_LEVEL_TEMP_METER CONSTANT_64BIT_FLAG(48)
1100 #define RIG_LEVEL_BAND_SELECT CONSTANT_64BIT_FLAG(49)
1101 #define RIG_LEVEL_USB_AF CONSTANT_64BIT_FLAG(50)
1102 #define RIG_LEVEL_USB_AF_INPUT CONSTANT_64BIT_FLAG(51)
1103 #define RIG_LEVEL_AGC_TIME CONSTANT_64BIT_FLAG(52)
1104 #define RIG_LEVEL_53 CONSTANT_64BIT_FLAG(53)
1105 #define RIG_LEVEL_54 CONSTANT_64BIT_FLAG(54)
1106 #define RIG_LEVEL_55 CONSTANT_64BIT_FLAG(55)
1107 #define RIG_LEVEL_56 CONSTANT_64BIT_FLAG(56)
1108 #define RIG_LEVEL_57 CONSTANT_64BIT_FLAG(57)
1109 #define RIG_LEVEL_58 CONSTANT_64BIT_FLAG(58)
1110 #define RIG_LEVEL_59 CONSTANT_64BIT_FLAG(59)
1111 #define RIG_LEVEL_60 CONSTANT_64BIT_FLAG(60)
1112 #define RIG_LEVEL_61 CONSTANT_64BIT_FLAG(61)
1113 #define RIG_LEVEL_62 CONSTANT_64BIT_FLAG(62)
1114 #define RIG_LEVEL_63 CONSTANT_64BIT_FLAG(63)
1116 #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)
1118 
1119 #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)
1120 
1121 #define RIG_LEVEL_IS_FLOAT(l) ((l)&RIG_LEVEL_FLOAT_LIST)
1122 #define RIG_LEVEL_SET(l) ((l)&~RIG_LEVEL_READONLY_LIST)
1123 
1125 
1136  RIG_PARM_ANN = (1 << 0),
1137  RIG_PARM_APO = (1 << 1),
1138  RIG_PARM_BACKLIGHT = (1 << 2),
1139  RIG_PARM_BEEP = (1 << 4),
1140  RIG_PARM_TIME = (1 << 5),
1141  RIG_PARM_BAT = (1 << 6),
1142  RIG_PARM_KEYLIGHT = (1 << 7),
1144  RIG_PARM_AFIF = (1 << 9),
1145  RIG_PARM_BANDSELECT = (1 << 10),
1146  RIG_PARM_KEYERTYPE = (1 << 11),
1147  RIG_PARM_AFIF_LAN = (1 << 12),
1148  RIG_PARM_AFIF_WLAN = (1 << 13),
1149  RIG_PARM_AFIF_ACC = (1 << 14)
1150 };
1151 
1152 enum rig_keyertype_e {
1153  RIG_KEYERTYPE_STRAIGHT = 0,
1154  RIG_KEYERTYPE_BUG = (1 << 0),
1155  RIG_KEYERTYPE_PADDLE = (1 << 1),
1156  RIG_KEYERTYPE_UNKNOWN = (1 << 2)
1157 };
1158 
1167 enum cookie_e {
1171 };
1172 
1178  RIG_MULTICAST_POLL, // hamlib will be polling the rig for all rig items
1179  RIG_MULTICAST_TRANSCEIVE, // transceive will be turned on and processed
1180  RIG_MULTICAST_SPECTRUM // spectrum data will be included
1181 };
1182 
1184 #define RIG_PARM_FLOAT_LIST (RIG_PARM_BACKLIGHT|RIG_PARM_BAT|RIG_PARM_KEYLIGHT|RIG_PARM_BACKLIGHT)
1185 #define RIG_PARM_STRING_LIST (RIG_PARM_BANDSELECT|RIG_PARM_KEYERTYPE)
1186 #define RIG_PARM_READONLY_LIST (RIG_PARM_BAT)
1187 
1188 #define RIG_PARM_IS_FLOAT(l) ((l)&RIG_PARM_FLOAT_LIST)
1189 #define RIG_PARM_IS_STRING(l) ((l)&RIG_PARM_STRING_LIST)
1190 #define RIG_PARM_SET(l) ((l)&~RIG_PARM_READONLY_LIST)
1191 
1199 typedef uint64_t setting_t;
1200 
1205 #define RIG_SETTING_MAX 64
1206 
1223 #define RIG_TRN_OFF 0
1224 #define RIG_TRN_RIG 1
1225 #define RIG_TRN_POLL 2
1226 
1227 
1236 /*
1237  * The C standard dictates that an enum constant is a 32 bit signed integer.
1238  * Setting a constant's bit 31 created a negative value that on amd64 had the
1239  * upper 32 bits set as well when assigned to the misc.c:rig_func_str structure.
1240  * This caused misc.c:rig_strfunc() to fail its comparison for RIG_FUNC_XIT
1241  * on amd64 (x86_64). To use bit 31 as an unsigned long, preprocessor macros
1242  * have been used instead as a 'const unsigned long' which cannot be used to
1243  * initialize the rig_func_str.func members. TNX KA6MAL, AC6SL. - N0NB
1244  */
1245 #define RIG_FUNC_NONE 0
1246 #define RIG_FUNC_FAGC CONSTANT_64BIT_FLAG (0)
1247 #define RIG_FUNC_NB CONSTANT_64BIT_FLAG (1)
1248 #define RIG_FUNC_COMP CONSTANT_64BIT_FLAG (2)
1249 #define RIG_FUNC_VOX CONSTANT_64BIT_FLAG (3)
1250 #define RIG_FUNC_TONE CONSTANT_64BIT_FLAG (4)
1251 #define RIG_FUNC_TSQL CONSTANT_64BIT_FLAG (5)
1252 #define RIG_FUNC_SBKIN CONSTANT_64BIT_FLAG (6)
1253 #define RIG_FUNC_FBKIN CONSTANT_64BIT_FLAG (7)
1254 #define RIG_FUNC_ANF CONSTANT_64BIT_FLAG (8)
1255 #define RIG_FUNC_NR CONSTANT_64BIT_FLAG (9)
1256 #define RIG_FUNC_AIP CONSTANT_64BIT_FLAG (10)
1257 #define RIG_FUNC_APF CONSTANT_64BIT_FLAG (11)
1258 #define RIG_FUNC_MON CONSTANT_64BIT_FLAG (12)
1259 #define RIG_FUNC_MN CONSTANT_64BIT_FLAG (13)
1260 #define RIG_FUNC_RF CONSTANT_64BIT_FLAG (14)
1261 #define RIG_FUNC_ARO CONSTANT_64BIT_FLAG (15)
1262 #define RIG_FUNC_LOCK CONSTANT_64BIT_FLAG (16)
1263 #define RIG_FUNC_MUTE CONSTANT_64BIT_FLAG (17)
1264 #define RIG_FUNC_VSC CONSTANT_64BIT_FLAG (18)
1265 #define RIG_FUNC_REV CONSTANT_64BIT_FLAG (19)
1266 #define RIG_FUNC_SQL CONSTANT_64BIT_FLAG (20)
1267 #define RIG_FUNC_ABM CONSTANT_64BIT_FLAG (21)
1268 #define RIG_FUNC_BC CONSTANT_64BIT_FLAG (22)
1269 #define RIG_FUNC_MBC CONSTANT_64BIT_FLAG (23)
1270 #define RIG_FUNC_RIT CONSTANT_64BIT_FLAG (24)
1271 #define RIG_FUNC_AFC CONSTANT_64BIT_FLAG (25)
1272 #define RIG_FUNC_SATMODE CONSTANT_64BIT_FLAG (26)
1273 #define RIG_FUNC_SCOPE CONSTANT_64BIT_FLAG (27)
1274 #define RIG_FUNC_RESUME CONSTANT_64BIT_FLAG (28)
1275 #define RIG_FUNC_TBURST CONSTANT_64BIT_FLAG (29)
1276 #define RIG_FUNC_TUNER CONSTANT_64BIT_FLAG (30)
1277 #define RIG_FUNC_XIT CONSTANT_64BIT_FLAG (31)
1278 #ifndef SWIGLUAHIDE
1279 /* Hide the top 32 bits from the old Lua binding as they can't be represented */
1280 #define RIG_FUNC_NB2 CONSTANT_64BIT_FLAG (32)
1281 #define RIG_FUNC_CSQL CONSTANT_64BIT_FLAG (33)
1282 #define RIG_FUNC_AFLT CONSTANT_64BIT_FLAG (34)
1283 #define RIG_FUNC_ANL CONSTANT_64BIT_FLAG (35)
1284 #define RIG_FUNC_BC2 CONSTANT_64BIT_FLAG (36)
1285 #define RIG_FUNC_DUAL_WATCH CONSTANT_64BIT_FLAG (37)
1286 #define RIG_FUNC_DIVERSITY CONSTANT_64BIT_FLAG (38)
1287 #define RIG_FUNC_DSQL CONSTANT_64BIT_FLAG (39)
1288 #define RIG_FUNC_SCEN CONSTANT_64BIT_FLAG (40)
1289 #define RIG_FUNC_SLICE CONSTANT_64BIT_FLAG (41)
1290 #define RIG_FUNC_TRANSCEIVE CONSTANT_64BIT_FLAG (42)
1291 #define RIG_FUNC_SPECTRUM CONSTANT_64BIT_FLAG (43)
1292 #define RIG_FUNC_SPECTRUM_HOLD CONSTANT_64BIT_FLAG (44)
1293 #define RIG_FUNC_SEND_MORSE CONSTANT_64BIT_FLAG (45)
1294 #define RIG_FUNC_SEND_VOICE_MEM CONSTANT_64BIT_FLAG (46)
1295 #define RIG_FUNC_OVF_STATUS CONSTANT_64BIT_FLAG (47)
1296 #define RIG_FUNC_SYNC CONSTANT_64BIT_FLAG (48)
1297 #define RIG_FUNC_BIT49 CONSTANT_64BIT_FLAG (49)
1298 #define RIG_FUNC_BIT50 CONSTANT_64BIT_FLAG (50)
1299 #define RIG_FUNC_BIT51 CONSTANT_64BIT_FLAG (51)
1300 #define RIG_FUNC_BIT52 CONSTANT_64BIT_FLAG (52)
1301 #define RIG_FUNC_BIT53 CONSTANT_64BIT_FLAG (53)
1302 #define RIG_FUNC_BIT54 CONSTANT_64BIT_FLAG (54)
1303 #define RIG_FUNC_BIT55 CONSTANT_64BIT_FLAG (55)
1304 #define RIG_FUNC_BIT56 CONSTANT_64BIT_FLAG (56)
1305 #define RIG_FUNC_BIT57 CONSTANT_64BIT_FLAG (57)
1306 #define RIG_FUNC_BIT58 CONSTANT_64BIT_FLAG (58)
1307 #define RIG_FUNC_BIT59 CONSTANT_64BIT_FLAG (59)
1308 #define RIG_FUNC_BIT60 CONSTANT_64BIT_FLAG (60)
1309 #define RIG_FUNC_BIT61 CONSTANT_64BIT_FLAG (61)
1310 #define RIG_FUNC_BIT62 CONSTANT_64BIT_FLAG (62)
1311 #define RIG_FUNC_BIT63 CONSTANT_64BIT_FLAG (63)
1312 /* 63 is this highest bit number that can be used */
1313 #endif
1314 
1321 #define mW(p) ((int)(p))
1322 
1329 #define Watts(p) ((int)((p)*1000))
1330 
1336 #define W(p) Watts(p)
1337 #if 0 // deprecating kW macro as this doesn't make sense
1338 
1344 #define kW(p) ((int)((p)*1000000L))
1345 #endif
1346 
1347 
1357 typedef uint64_t rmode_t;
1358 
1359 #define RIG_MODE_NONE 0
1360 #define RIG_MODE_AM CONSTANT_64BIT_FLAG (0)
1361 #define RIG_MODE_CW CONSTANT_64BIT_FLAG (1)
1362 #define RIG_MODE_USB CONSTANT_64BIT_FLAG (2)
1363 #define RIG_MODE_LSB CONSTANT_64BIT_FLAG (3)
1364 #define RIG_MODE_RTTY CONSTANT_64BIT_FLAG (4)
1365 #define RIG_MODE_FM CONSTANT_64BIT_FLAG (5)
1366 #define RIG_MODE_WFM CONSTANT_64BIT_FLAG (6)
1367 #define RIG_MODE_CWR CONSTANT_64BIT_FLAG (7)
1368 #define RIG_MODE_RTTYR CONSTANT_64BIT_FLAG (8)
1369 #define RIG_MODE_AMS CONSTANT_64BIT_FLAG (9)
1370 #define RIG_MODE_PKTLSB CONSTANT_64BIT_FLAG (10)
1371 #define RIG_MODE_PKTUSB CONSTANT_64BIT_FLAG (11)
1372 #define RIG_MODE_PKTFM CONSTANT_64BIT_FLAG (12)
1373 #define RIG_MODE_ECSSUSB CONSTANT_64BIT_FLAG (13)
1374 #define RIG_MODE_ECSSLSB CONSTANT_64BIT_FLAG (14)
1375 #define RIG_MODE_FAX CONSTANT_64BIT_FLAG (15)
1376 #define RIG_MODE_SAM CONSTANT_64BIT_FLAG (16)
1377 #define RIG_MODE_SAL CONSTANT_64BIT_FLAG (17)
1378 #define RIG_MODE_SAH CONSTANT_64BIT_FLAG (18)
1379 #define RIG_MODE_DSB CONSTANT_64BIT_FLAG (19)
1380 #define RIG_MODE_FMN CONSTANT_64BIT_FLAG (21)
1381 #define RIG_MODE_PKTAM CONSTANT_64BIT_FLAG (22)
1382 #define RIG_MODE_P25 CONSTANT_64BIT_FLAG (23)
1383 #define RIG_MODE_DSTAR CONSTANT_64BIT_FLAG (24)
1384 #define RIG_MODE_DPMR CONSTANT_64BIT_FLAG (25)
1385 #define RIG_MODE_NXDNVN CONSTANT_64BIT_FLAG (26)
1386 #define RIG_MODE_NXDN_N CONSTANT_64BIT_FLAG (27)
1387 #define RIG_MODE_DCR CONSTANT_64BIT_FLAG (28)
1388 #define RIG_MODE_AMN CONSTANT_64BIT_FLAG (29)
1389 #define RIG_MODE_PSK CONSTANT_64BIT_FLAG (30)
1390 #define RIG_MODE_PSKR CONSTANT_64BIT_FLAG (31)
1391 #ifndef SWIGLUAHIDE
1392 /* hide the top 32 bits from the Lua binding as they will not work */
1393 #define RIG_MODE_DD CONSTANT_64BIT_FLAG (32)
1394 #define RIG_MODE_C4FM CONSTANT_64BIT_FLAG (33)
1395 #define RIG_MODE_PKTFMN CONSTANT_64BIT_FLAG (34)
1396 #define RIG_MODE_SPEC CONSTANT_64BIT_FLAG (35)
1397 #define RIG_MODE_CWN CONSTANT_64BIT_FLAG (36)
1398 #define RIG_MODE_IQ CONSTANT_64BIT_FLAG (37)
1399 #define RIG_MODE_ISBUSB CONSTANT_64BIT_FLAG (38)
1400 #define RIG_MODE_ISBLSB CONSTANT_64BIT_FLAG (39)
1401 #define RIG_MODE_USBD1 CONSTANT_64BIT_FLAG (40)
1402 #define RIG_MODE_USBD2 CONSTANT_64BIT_FLAG (41)
1403 #define RIG_MODE_USBD3 CONSTANT_64BIT_FLAG (42)
1404 #define RIG_MODE_LSBD1 CONSTANT_64BIT_FLAG (43)
1405 #define RIG_MODE_LSBD2 CONSTANT_64BIT_FLAG (44)
1406 #define RIG_MODE_LSBD3 CONSTANT_64BIT_FLAG (45)
1407 #define RIG_MODE_BIT46 CONSTANT_64BIT_FLAG (46)
1408 #define RIG_MODE_BIT47 CONSTANT_64BIT_FLAG (47)
1409 #define RIG_MODE_BIT48 CONSTANT_64BIT_FLAG (48)
1410 #define RIG_MODE_BIT49 CONSTANT_64BIT_FLAG (49)
1411 #define RIG_MODE_BIT50 CONSTANT_64BIT_FLAG (50)
1412 #define RIG_MODE_BIT51 CONSTANT_64BIT_FLAG (51)
1413 #define RIG_MODE_BIT52 CONSTANT_64BIT_FLAG (52)
1414 #define RIG_MODE_BIT53 CONSTANT_64BIT_FLAG (53)
1415 #define RIG_MODE_BIT54 CONSTANT_64BIT_FLAG (54)
1416 #define RIG_MODE_BIT55 CONSTANT_64BIT_FLAG (55)
1417 #define RIG_MODE_BIT56 CONSTANT_64BIT_FLAG (56)
1418 #define RIG_MODE_BIT57 CONSTANT_64BIT_FLAG (57)
1419 #define RIG_MODE_BIT58 CONSTANT_64BIT_FLAG (58)
1420 #define RIG_MODE_BIT59 CONSTANT_64BIT_FLAG (59)
1421 #define RIG_MODE_BIT60 CONSTANT_64BIT_FLAG (60)
1422 #define RIG_MODE_BIT61 CONSTANT_64BIT_FLAG (61)
1423 #define RIG_MODE_BIT62 CONSTANT_64BIT_FLAG (62)
1424 #define RIG_MODE_TESTS_MAX CONSTANT_64BIT_FLAG (63)
1425 #define RIG_MODE_ALL (0xffffffff)
1426 #endif
1427 
1431 #define RIG_MODE_SSB (RIG_MODE_USB|RIG_MODE_LSB)
1432 
1436 #define RIG_MODE_PKTSSB (RIG_MODE_PKTUSB|RIG_MODE_PKTLSB)
1437 
1441 #define RIG_MODE_ECSS (RIG_MODE_ECSSUSB|RIG_MODE_ECSSLSB)
1442 
1444 #define RIG_DBLST_END 0 /* end marker in a preamp/att level list */
1445 #define RIG_IS_DBLST_END(d) ((d)==0)
1446 
1448 
1455 typedef struct freq_range_list {
1463  char *label;
1464 } freq_range_t;
1465 
1467 #define RIG_FRNG_END {Hz(0),Hz(0),RIG_MODE_NONE,0,0,RIG_VFO_NONE}
1468 #define RIG_IS_FRNG_END(r) ((r).startf == Hz(0) && (r).endf == Hz(0))
1469 
1490 };
1491 
1493 #define RIG_TS_ANY 0
1494 #define RIG_TS_END {RIG_MODE_NONE, 0}
1495 #define RIG_IS_TS_END(t) ((t).modes == RIG_MODE_NONE && (t).ts == 0)
1496 
1498 
1522 struct filter_list {
1525 };
1527 #define RIG_FLT_ANY 0
1528 #define RIG_FLT_END {RIG_MODE_NONE, 0}
1529 #define RIG_IS_FLT_END(f) ((f).modes == RIG_MODE_NONE)
1530 #define DEBUGMSGSAVE_SIZE 24000
1531 
1533 
1537 #define RIG_CHFLAG_NONE 0
1538 
1541 #define RIG_CHFLAG_SKIP (1<<0)
1542 
1545 #define RIG_CHFLAG_DATA (1<<1)
1546 
1549 #define RIG_CHFLAG_PSKIP (1<<2)
1550 
1555 struct ext_list {
1558 };
1559 
1561 #define RIG_EXT_END {0, {.i=0}}
1562 #define RIG_IS_EXT_END(x) ((x).token == 0)
1563 
1572 struct channel {
1574  int bank_num;
1595  tone_t ctcss_tone;
1596  tone_t ctcss_sql;
1597  tone_t dcs_code;
1598  tone_t dcs_sql;
1600  unsigned int flags;
1601  char channel_desc[HAMLIB_MAXCHANDESC];
1602  struct ext_list
1603  *ext_levels;
1604  char tag[32];
1605 };
1606 
1610 typedef struct channel channel_t;
1611 
1617 struct channel_cap {
1618  unsigned bank_num: 1;
1619  unsigned vfo: 1;
1620  unsigned ant: 1;
1621  unsigned freq: 1;
1622  unsigned mode: 1;
1623  unsigned width: 1;
1625  unsigned tx_freq: 1;
1626  unsigned tx_mode: 1;
1627  unsigned tx_width: 1;
1629  unsigned split: 1;
1630  unsigned tx_vfo: 1;
1631  unsigned rptr_shift: 1;
1632  unsigned rptr_offs: 1;
1633  unsigned tuning_step: 1;
1634  unsigned rit: 1;
1635  unsigned xit: 1;
1638  unsigned ctcss_tone: 1;
1639  unsigned ctcss_sql: 1;
1640  unsigned dcs_code: 1;
1641  unsigned dcs_sql: 1;
1642  unsigned scan_group: 1;
1643  unsigned flags: 1;
1644  unsigned channel_desc: 1;
1645  unsigned ext_levels: 1;
1646  unsigned tag: 1;
1647 };
1648 
1653 
1654 
1665 typedef enum {
1677 } chan_type_t;
1678 
1679 
1693 struct chan_list {
1694  int startc;
1695  int endc;
1698 };
1699 
1701 #define RIG_CHAN_END {0,0,RIG_MTYPE_NONE}
1702 #define RIG_IS_CHAN_END(c) ((c).type == RIG_MTYPE_NONE)
1703 
1708 #define RIG_MEM_CAPS_ALL -1
1709 
1713 typedef struct chan_list chan_t;
1714 
1715 
1727 struct gran {
1731 };
1732 
1736 typedef struct gran gran_t;
1737 
1738 
1742 struct cal_table {
1743  int size;
1744  struct {
1745  int raw;
1746  int val;
1747  } table[HAMLIB_MAX_CAL_LENGTH];
1748 };
1749 
1762 typedef struct cal_table cal_table_t;
1763 
1765 #define EMPTY_STR_CAL { 0, { { 0, 0 }, } }
1766 
1768 
1773  int size;
1774  struct {
1775  int raw;
1776  float val;
1777  } table[HAMLIB_MAX_CAL_LENGTH];
1778 };
1779 
1793 
1795 #define EMPTY_FLOAT_CAL { 0, { { 0, 0f }, } }
1796 
1797 typedef int (* chan_cb_t)(RIG *, vfo_t vfo, channel_t **, int, const chan_t *, rig_ptr_t);
1798 typedef int (* confval_cb_t)(RIG *,
1799  const struct confparams *,
1800  value_t *,
1801  rig_ptr_t);
1803 
1808 {
1809  int id;
1810  char *name;
1811 };
1812 
1817  RIG_SPECTRUM_MODE_NONE = 0,
1822 };
1823 
1828 {
1829  int id;
1830  char *name;
1831 };
1832 
1845 {
1846  int id;
1862  unsigned char *spectrum_data;
1863 };
1864 
1869  struct deferred_config_item *next;
1870  hamlib_token_t token;
1871  char *value; // strdup'ed, must be freed
1872 };
1874 
1876  struct deferred_config_item *first; // NULL if none
1877  struct deferred_config_item *last;
1878 };
1880 
1900 #define RIG_MODEL(arg) .rig_model=arg,.macro_name=#arg
1902 #define HAMLIB_CHECK_RIG_CAPS "HAMLIB_CHECK_RIG_CAPS"
1903 struct rig_caps {
1904  rig_model_t rig_model;
1905  const char *model_name;
1906  const char *mfg_name;
1907  const char *version;
1908  const char *copyright;
1909  enum rig_status_e status;
1911  int rig_type;
1912  ptt_type_t ptt_type;
1913  dcd_type_t dcd_type;
1914  rig_port_t port_type;
1916  int serial_rate_min;
1917  int serial_rate_max;
1918  int serial_data_bits;
1919  int serial_stop_bits;
1920  enum serial_parity_e serial_parity;
1921  enum serial_handshake_e serial_handshake;
1923  int write_delay;
1924  int post_write_delay;
1925  int timeout;
1926  int retry;
1928  setting_t has_get_func;
1929  setting_t has_set_func;
1930  setting_t has_get_level;
1931  setting_t has_set_level;
1932  setting_t has_get_parm;
1933  setting_t has_set_parm;
1935  gran_t level_gran[RIG_SETTING_MAX];
1936  gran_t parm_gran[RIG_SETTING_MAX];
1938  const struct confparams *extparms;
1939  const struct confparams *extlevels;
1940  const struct confparams *extfuncs;
1941  int *ext_tokens;
1943  tone_t *ctcss_list;
1944  tone_t *dcs_list;
1946  int preamp[HAMLIB_MAXDBLSTSIZ];
1947  int attenuator[HAMLIB_MAXDBLSTSIZ];
1948  shortfreq_t max_rit;
1949  shortfreq_t max_xit;
1950  shortfreq_t max_ifshift;
1952  int agc_level_count;
1953  enum agc_level_e agc_levels[HAMLIB_MAX_AGC_LEVELS];
1955  ann_t announces;
1957  vfo_op_t vfo_ops;
1958  scan_t scan_ops;
1959  int targetable_vfo;
1960  int transceive;
1962  int bank_qty;
1963  int chan_desc_sz;
1965  chan_t chan_list[HAMLIB_CHANLSTSIZ];
1967  // As of 2020-02-12 we know of 5 models from Icom USA, EUR, ITR, TPE, KOR for the IC-9700
1968  // So we currently have 5 ranges we need to deal with
1969  // The backend for the model should fill in the label field to explain what model it is
1970  // The the IC-9700 in ic7300.c for an example
1971  freq_range_t rx_range_list1[HAMLIB_FRQRANGESIZ];
1972  freq_range_t tx_range_list1[HAMLIB_FRQRANGESIZ];
1973  freq_range_t rx_range_list2[HAMLIB_FRQRANGESIZ];
1974  freq_range_t tx_range_list2[HAMLIB_FRQRANGESIZ];
1975  freq_range_t rx_range_list3[HAMLIB_FRQRANGESIZ];
1976  freq_range_t tx_range_list3[HAMLIB_FRQRANGESIZ];
1977  freq_range_t rx_range_list4[HAMLIB_FRQRANGESIZ];
1978  freq_range_t tx_range_list4[HAMLIB_FRQRANGESIZ];
1979  freq_range_t rx_range_list5[HAMLIB_FRQRANGESIZ];
1980  freq_range_t tx_range_list5[HAMLIB_FRQRANGESIZ];
1982  struct tuning_step_list tuning_steps[HAMLIB_TSLSTSIZ];
1983  struct filter_list filters[HAMLIB_FLTLSTSIZ];
1985  cal_table_t str_cal;
1986  cal_table_float_t swr_cal;
1987  cal_table_float_t alc_cal;
1988  cal_table_float_t rfpower_meter_cal;
1989  cal_table_float_t comp_meter_cal;
1990  cal_table_float_t vd_meter_cal;
1991  cal_table_float_t id_meter_cal;
1993  struct rig_spectrum_scope spectrum_scopes[HAMLIB_MAX_SPECTRUM_SCOPES];
1994  enum rig_spectrum_mode_e spectrum_modes[HAMLIB_MAX_SPECTRUM_MODES];
1995  freq_t spectrum_spans[HAMLIB_MAX_SPECTRUM_SPANS];
1996  struct rig_spectrum_avg_mode spectrum_avg_modes[HAMLIB_MAX_SPECTRUM_AVG_MODES];
1997  int spectrum_attenuator[HAMLIB_MAXDBLSTSIZ];
1999  const struct confparams *cfgparams;
2000  const rig_ptr_t priv;
2002  /*
2003  * Rig API
2004  *
2005  */
2006 
2007  int (*rig_init)(RIG *rig);
2008  int (*rig_cleanup)(RIG *rig);
2009  int (*rig_open)(RIG *rig);
2010  int (*rig_close)(RIG *rig);
2011 
2012  /*
2013  * General API commands, from most primitive to least.. :()
2014  * List Set/Get functions pairs
2015  */
2016 
2017  int (*set_freq)(RIG *rig, vfo_t vfo, freq_t freq);
2018  int (*get_freq)(RIG *rig, vfo_t vfo, freq_t *freq);
2019 
2020  int (*set_mode)(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width);
2021  int (*get_mode)(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width);
2022 
2023  int (*set_vfo)(RIG *rig, vfo_t vfo);
2024  int (*get_vfo)(RIG *rig, vfo_t *vfo);
2025 
2026  int (*set_ptt)(RIG *rig, vfo_t vfo, ptt_t ptt);
2027  int (*get_ptt)(RIG *rig, vfo_t vfo, ptt_t *ptt);
2028 
2029  int (*get_dcd)(RIG *rig, vfo_t vfo, dcd_t *dcd);
2030 
2031  int (*set_rptr_shift)(RIG *rig, vfo_t vfo, rptr_shift_t rptr_shift);
2032  int (*get_rptr_shift)(RIG *rig, vfo_t vfo, rptr_shift_t *rptr_shift);
2033 
2034  int (*set_rptr_offs)(RIG *rig, vfo_t vfo, shortfreq_t offs);
2035  int (*get_rptr_offs)(RIG *rig, vfo_t vfo, shortfreq_t *offs);
2036 
2037  int (*set_split_freq)(RIG *rig, vfo_t vfo, freq_t tx_freq);
2038  int (*get_split_freq)(RIG *rig, vfo_t vfo, freq_t *tx_freq);
2039 
2040  int (*set_split_mode)(RIG *rig,
2041  vfo_t vfo,
2042  rmode_t tx_mode,
2043  pbwidth_t tx_width);
2044  int (*get_split_mode)(RIG *rig,
2045  vfo_t vfo,
2046  rmode_t *tx_mode,
2047  pbwidth_t *tx_width);
2048 
2049  int (*set_split_freq_mode)(RIG *rig,
2050  vfo_t vfo,
2051  freq_t tx_freq,
2052  rmode_t tx_mode,
2053  pbwidth_t tx_width);
2054  int (*get_split_freq_mode)(RIG *rig,
2055  vfo_t vfo,
2056  freq_t *tx_freq,
2057  rmode_t *tx_mode,
2058  pbwidth_t *tx_width);
2059 
2060  int (*set_split_vfo)(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo);
2061  int (*get_split_vfo)(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo);
2062 
2063  int (*set_rit)(RIG *rig, vfo_t vfo, shortfreq_t rit);
2064  int (*get_rit)(RIG *rig, vfo_t vfo, shortfreq_t *rit);
2065 
2066  int (*set_xit)(RIG *rig, vfo_t vfo, shortfreq_t xit);
2067  int (*get_xit)(RIG *rig, vfo_t vfo, shortfreq_t *xit);
2068 
2069  int (*set_ts)(RIG *rig, vfo_t vfo, shortfreq_t ts);
2070  int (*get_ts)(RIG *rig, vfo_t vfo, shortfreq_t *ts);
2071 
2072  int (*set_dcs_code)(RIG *rig, vfo_t vfo, tone_t code);
2073  int (*get_dcs_code)(RIG *rig, vfo_t vfo, tone_t *code);
2074 
2075  int (*set_tone)(RIG *rig, vfo_t vfo, tone_t tone);
2076  int (*get_tone)(RIG *rig, vfo_t vfo, tone_t *tone);
2077 
2078  int (*set_ctcss_tone)(RIG *rig, vfo_t vfo, tone_t tone);
2079  int (*get_ctcss_tone)(RIG *rig, vfo_t vfo, tone_t *tone);
2080 
2081  int (*set_dcs_sql)(RIG *rig, vfo_t vfo, tone_t code);
2082  int (*get_dcs_sql)(RIG *rig, vfo_t vfo, tone_t *code);
2083 
2084  int (*set_tone_sql)(RIG *rig, vfo_t vfo, tone_t tone);
2085  int (*get_tone_sql)(RIG *rig, vfo_t vfo, tone_t *tone);
2086 
2087  int (*set_ctcss_sql)(RIG *rig, vfo_t vfo, tone_t tone);
2088  int (*get_ctcss_sql)(RIG *rig, vfo_t vfo, tone_t *tone);
2089 
2090  int (*power2mW)(RIG *rig,
2091  unsigned int *mwpower,
2092  float power,
2093  freq_t freq,
2094  rmode_t mode);
2095  int (*mW2power)(RIG *rig,
2096  float *power,
2097  unsigned int mwpower,
2098  freq_t freq,
2099  rmode_t mode);
2100 
2101  int (*set_powerstat)(RIG *rig, powerstat_t status);
2102  int (*get_powerstat)(RIG *rig, powerstat_t *status);
2103 
2104  int (*reset)(RIG *rig, reset_t reset);
2105 
2106  int (*set_ant)(RIG *rig, vfo_t vfo, ant_t ant, value_t option);
2107  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);
2108 
2109  int (*set_level)(RIG *rig, vfo_t vfo, setting_t level, value_t val);
2110  int (*get_level)(RIG *rig, vfo_t vfo, setting_t level, value_t *val);
2111 
2112  int (*set_func)(RIG *rig, vfo_t vfo, setting_t func, int status);
2113  int (*get_func)(RIG *rig, vfo_t vfo, setting_t func, int *status);
2114 
2115  int (*set_parm)(RIG *rig, setting_t parm, value_t val);
2116  int (*get_parm)(RIG *rig, setting_t parm, value_t *val);
2117 
2118  int (*set_ext_level)(RIG *rig, vfo_t vfo, hamlib_token_t token, value_t val);
2119  int (*get_ext_level)(RIG *rig, vfo_t vfo, hamlib_token_t token, value_t *val);
2120 
2121  int (*set_ext_func)(RIG *rig, vfo_t vfo, hamlib_token_t token, int status);
2122  int (*get_ext_func)(RIG *rig, vfo_t vfo, hamlib_token_t token, int *status);
2123 
2124  int (*set_ext_parm)(RIG *rig, hamlib_token_t token, value_t val);
2125  int (*get_ext_parm)(RIG *rig, hamlib_token_t token, value_t *val);
2126 
2127  int (*set_conf)(RIG *rig, hamlib_token_t token, const char *val);
2128  int (*get_conf)(RIG *rig, hamlib_token_t token, char *val);
2129 
2130  int (*send_dtmf)(RIG *rig, vfo_t vfo, const char *digits);
2131  int (*recv_dtmf)(RIG *rig, vfo_t vfo, char *digits, int *length);
2132 
2133  int (*send_morse)(RIG *rig, vfo_t vfo, const char *msg);
2134  int (*stop_morse)(RIG *rig, vfo_t vfo);
2135  int (*wait_morse)(RIG *rig, vfo_t vfo);
2136 
2137  int (*send_voice_mem)(RIG *rig, vfo_t vfo, int ch);
2138  int (*stop_voice_mem)(RIG *rig, vfo_t vfo);
2139 
2140  int (*set_bank)(RIG *rig, vfo_t vfo, int bank);
2141 
2142  int (*set_mem)(RIG *rig, vfo_t vfo, int ch);
2143  int (*get_mem)(RIG *rig, vfo_t vfo, int *ch);
2144 
2145  int (*vfo_op)(RIG *rig, vfo_t vfo, vfo_op_t op);
2146 
2147  int (*scan)(RIG *rig, vfo_t vfo, scan_t scan, int ch);
2148 
2149  int (*set_trn)(RIG *rig, int trn);
2150  int (*get_trn)(RIG *rig, int *trn);
2151 
2152  int (*decode_event)(RIG *rig);
2153 
2154  int (*set_channel)(RIG *rig, vfo_t vfo, const channel_t *chan);
2155  int (*get_channel)(RIG *rig, vfo_t vfo, channel_t *chan, int read_only);
2156 
2157  const char * (*get_info)(RIG *rig);
2158 
2159  int (*set_chan_all_cb)(RIG *rig, vfo_t vfo, chan_cb_t chan_cb, rig_ptr_t);
2160  int (*get_chan_all_cb)(RIG *rig, vfo_t vfo, chan_cb_t chan_cb, rig_ptr_t);
2161 
2162  int (*set_mem_all_cb)(RIG *rig,
2163  vfo_t vfo,
2164  chan_cb_t chan_cb,
2165  confval_cb_t parm_cb,
2166  rig_ptr_t);
2167  int (*get_mem_all_cb)(RIG *rig,
2168  vfo_t vfo,
2169  chan_cb_t chan_cb,
2170  confval_cb_t parm_cb,
2171  rig_ptr_t);
2172 
2173  int (*set_vfo_opt)(RIG *rig, int status); // only for Net Rigctl device
2174  int (*rig_get_vfo_info) (RIG *rig,
2175  vfo_t vfo,
2176  freq_t *freq,
2177  rmode_t *mode,
2178  pbwidth_t *width,
2179  split_t *split);
2180  int(*set_clock) (RIG *rig, int year, int month, int day, int hour, int min, int sec, double msec, int utc_offset);
2181  int(*get_clock) (RIG *rig, int *year, int *month, int *day, int *hour, int *min, int *sec, double *msec, int *utc_offset);
2182 
2183  const char *clone_combo_set;
2184  const char *clone_combo_get;
2185  const char *macro_name;
2187  int async_data_supported;
2188  int (*read_frame_direct)(RIG *rig,
2189  size_t buffer_length,
2190  const unsigned char *buffer);
2191  int (*is_async_frame)(RIG *rig,
2192  size_t frame_length,
2193  const unsigned char *frame);
2194  int (*process_async_frame)(RIG *rig,
2195  size_t frame_length,
2196  const unsigned char *frame);
2197 // this will be used to check rigcaps structure is compatible with client
2198  char *hamlib_check_rig_caps; // a constant value we can check for hamlib integrity
2199  int (*get_conf2)(RIG *rig, hamlib_token_t token, char *val, int val_len);
2200  int (*password)(RIG *rig, const char *key1); /*< Send encrypted password if rigctld is secured with -A/--password */
2201  int (*set_lock_mode)(RIG *rig, int mode);
2202  int (*get_lock_mode)(RIG *rig, int *mode);
2203  short timeout_retry;
2204  short morse_qsize; /* max length of morse */
2205 // int (*bandwidth2rig)(RIG *rig, enum bandwidth_t bandwidth);
2206 // enum bandwidth_t (*rig2bandwidth)(RIG *rig, int rigbandwidth);
2207 };
2209 
2214 // all functions enumerated for rig_get_function_ptr
2216  RIG_FUNCTION_INIT,
2217  RIG_FUNCTION_CLEANUP,
2218  RIG_FUNCTION_OPEN,
2219  RIG_FUNCTION_CLOSE,
2220  RIG_FUNCTION_SET_FREQ,
2221  RIG_FUNCTION_GET_FREQ,
2222  RIG_FUNCTION_SET_MODE,
2223  RIG_FUNCTION_GET_MODE,
2224  RIG_FUNCTION_SET_VFO,
2225  RIG_FUNCTION_GET_VFO,
2226  RIG_FUNCTION_SET_PTT,
2227  RIG_FUNCTION_GET_PTT,
2228  RIG_FUNCTION_GET_DCD,
2229  RIG_FUNCTION_SET_RPTR_SHIFT,
2230  RIG_FUNCTION_GET_RPTR_SHIFT,
2231  RIG_FUNCTION_SET_RPTR_OFFS,
2232  RIG_FUNCTION_GET_RPTR_OFFS,
2233  RIG_FUNCTION_SET_SPLIT_FREQ,
2234  RIG_FUNCTION_GET_SPLIT_FREQ,
2235  RIG_FUNCTION_SET_SPLIT_MODE,
2236  RIG_FUNCTION_SET_SPLIT_FREQ_MODE,
2237  RIG_FUNCTION_GET_SPLIT_FREQ_MODE,
2238  RIG_FUNCTION_SET_SPLIT_VFO,
2239  RIG_FUNCTION_GET_SPLIT_VFO,
2240  RIG_FUNCTION_SET_RIT,
2241  RIG_FUNCTION_GET_RIT,
2242  RIG_FUNCTION_SET_XIT,
2243  RIG_FUNCTION_GET_XIT,
2244  RIG_FUNCTION_SET_TS,
2245  RIG_FUNCTION_GET_TS,
2246  RIG_FUNCTION_SET_DCS_CODE,
2247  RIG_FUNCTION_GET_DCS_CODE,
2248  RIG_FUNCTION_SET_TONE,
2249  RIG_FUNCTION_GET_TONE,
2250  RIG_FUNCTION_SET_CTCSS_TONE,
2251  RIG_FUNCTION_GET_CTCSS_TONE,
2252  RIG_FUNCTION_SET_DCS_SQL,
2253  RIG_FUNCTION_GET_DCS_SQL,
2254  RIG_FUNCTION_SET_TONE_SQL,
2255  RIG_FUNCTION_GET_TONE_SQL,
2256  RIG_FUNCTION_SET_CTCSS_SQL,
2257  RIG_FUNCTION_GET_CTCSS_SQL,
2258  RIG_FUNCTION_POWER2MW,
2259  RIG_FUNCTION_MW2POWER,
2260  RIG_FUNCTION_SET_POWERSTAT,
2261  RIG_FUNCTION_GET_POWERSTAT,
2262  RIG_FUNCTION_RESET,
2263  RIG_FUNCTION_SET_ANT,
2264  RIG_FUNCTION_GET_ANT,
2265  RIG_FUNCTION_SET_LEVEL,
2266  RIG_FUNCTION_GET_LEVEL,
2267  RIG_FUNCTION_SET_FUNC,
2268  RIG_FUNCTION_GET_FUNC,
2269  RIG_FUNCTION_SET_PARM,
2270  RIG_FUNCTION_GET_PARM,
2271  RIG_FUNCTION_SET_EXT_LEVEL,
2272  RIG_FUNCTION_GET_EXT_LEVEL,
2273  RIG_FUNCTION_SET_EXT_FUNC,
2274  RIG_FUNCTION_GET_EXT_FUNC,
2275  RIG_FUNCTION_SET_EXT_PARM,
2276  RIG_FUNCTION_GET_EXT_PARM,
2277  RIG_FUNCTION_SET_CONF,
2278  RIG_FUNCTION_GET_CONF,
2279  RIG_FUNCTION_SEND_DTMF,
2280  RIG_FUNCTION_SEND_MORSE,
2281  RIG_FUNCTION_STOP_MORSE,
2282  RIG_FUNCTION_WAIT_MORSE,
2283  RIG_FUNCTION_SEND_VOICE_MEM,
2284  RIG_FUNCTION_SET_BANK,
2285  RIG_FUNCTION_SET_MEM,
2286  RIG_FUNCTION_GET_MEM,
2287  RIG_FUNCTION_VFO_OP,
2288  RIG_FUNCTION_SCAN,
2289  RIG_FUNCTION_SET_TRN,
2290  RIG_FUNCTION_GET_TRN,
2291  RIG_FUNCTION_DECODE_EVENT,
2292  RIG_FUNCTION_SET_CHANNEL,
2293  RIG_FUNCTION_GET_CHANNEL,
2294  RIG_FUNCTION_GET_INFO,
2295  RIG_FUNCTION_SET_CHAN_ALL_CB,
2296  RIG_FUNCTION_GET_CHAN_ALL_CB,
2297  RIG_FUNCTION_SET_MEM_ALL_CB,
2298  RIG_FUNCTION_GET_MEM_ALL_CB,
2299  RIG_FUNCTION_SET_VFO_OPT,
2300  RIG_FUNCTION_READ_FRAME_DIRECT,
2301  RIG_FUNCTION_IS_ASYNC_FRAME,
2302  RIG_FUNCTION_PROCESS_ASYNC_FRAME,
2303  RIG_FUNCTION_GET_CONF2,
2304  RIG_FUNCTION_STOP_VOICE_MEM,
2305 };
2306 
2311 extern HAMLIB_EXPORT (void *) rig_get_function_ptr(rig_model_t rig_model, enum rig_function_e rig_function);
2312 
2317 // values enumerated for rig->caps values
2319  RIG_CAPS_TARGETABLE_VFO,
2320  RIG_CAPS_RIG_MODEL,
2321  RIG_CAPS_PORT_TYPE,
2322  RIG_CAPS_PTT_TYPE,
2323  RIG_CAPS_HAS_GET_LEVEL,
2324  RIG_CAPS_HAS_SET_LEVEL,
2325 };
2326 
2327 enum rig_caps_cptr_e {
2328  RIG_CAPS_VERSION_CPTR,
2329  RIG_CAPS_MFG_NAME_CPTR,
2330  RIG_CAPS_MODEL_NAME_CPTR,
2331  RIG_CAPS_STATUS_CPTR
2332 };
2333 
2338 extern HAMLIB_EXPORT (uint64_t) rig_get_caps_int(rig_model_t rig_model, enum rig_caps_int_e rig_caps);
2339 
2344 extern HAMLIB_EXPORT (const char *) rig_get_caps_cptr(rig_model_t rig_model, enum rig_caps_cptr_e rig_caps);
2345 
2346 struct hamlib_async_pipe;
2347 
2348 typedef struct hamlib_async_pipe hamlib_async_pipe_t;
2349 
2355 // DO NOT CHANGE THIS STRUCTURE ALL UNTIL 5.0
2357 // Right now it is static inside rig structure
2358 // 5.0 will change it to a pointer which can then be added to
2359 // At that point only add to the end of the structure
2360 typedef struct hamlib_port {
2361  union {
2362  rig_port_t rig;
2363  ptt_type_t ptt;
2364  dcd_type_t dcd;
2365  } type;
2366 
2367  int fd;
2368  void *handle;
2370  int write_delay;
2371  int post_write_delay;
2373  struct {
2374  int tv_sec, tv_usec;
2375  } post_write_date;
2377  int timeout;
2378  short retry;
2379  short flushx;
2381  char pathname[HAMLIB_FILPATHLEN];
2383  union {
2384  struct {
2385  int rate;
2386  int data_bits;
2387  int stop_bits;
2388  enum serial_parity_e parity;
2389  enum serial_handshake_e handshake;
2390  enum serial_control_state_e rts_state;
2391  enum serial_control_state_e dtr_state;
2392  } serial;
2394  struct {
2395  int pin;
2396  } parallel;
2398  struct {
2399  int ptt_bitnum;
2400  } cm108;
2402  struct {
2403  int vid;
2404  int pid;
2405  int conf;
2406  int iface;
2407  int alt;
2408  char *vendor_name;
2409  char *product;
2410  } usb;
2412  struct {
2413  int on_value;
2414  int value;
2415  } gpio;
2416  } parm;
2417  int client_port;
2418  RIG *rig;
2419  int asyncio;
2420 #if defined(_WIN32)
2421  hamlib_async_pipe_t *sync_data_pipe;
2422  hamlib_async_pipe_t *sync_data_error_pipe;
2423 #else
2424  int fd_sync_write;
2425  int fd_sync_read;
2426  int fd_sync_error_write;
2427  int fd_sync_error_read;
2428 #endif
2429  short timeout_retry;
2430 // DO NOT ADD ANYTHING HERE UNTIL 5.0!!
2431 } hamlib_port_t;
2432 
2433 
2434 // DO NOT CHANGE THIS STRUCTURE AT ALL
2435 // Will be removed in 5.0
2436 typedef struct hamlib_port_deprecated {
2437  union {
2438  rig_port_t rig;
2439  ptt_type_t ptt;
2440  dcd_type_t dcd;
2441  } type;
2442 
2443  int fd;
2444  void *handle;
2446  int write_delay;
2447  int post_write_delay;
2449  struct {
2450  int tv_sec, tv_usec;
2451  } post_write_date;
2453  int timeout;
2454  short retry;
2455  short flushx;
2457  char pathname[HAMLIB_FILPATHLEN];
2459  union {
2460  struct {
2461  int rate;
2462  int data_bits;
2463  int stop_bits;
2464  enum serial_parity_e parity;
2465  enum serial_handshake_e handshake;
2466  enum serial_control_state_e rts_state;
2467  enum serial_control_state_e dtr_state;
2468  } serial;
2470  struct {
2471  int pin;
2472  } parallel;
2474  struct {
2475  int ptt_bitnum;
2476  } cm108;
2478  struct {
2479  int vid;
2480  int pid;
2481  int conf;
2482  int iface;
2483  int alt;
2484  char *vendor_name;
2485  char *product;
2486  } usb;
2488  struct {
2489  int on_value;
2490  int value;
2491  } gpio;
2492  } parm;
2493  int client_port;
2494  RIG *rig;
2495 } hamlib_port_t_deprecated;
2497 
2498 #if !defined(__APPLE__) || !defined(__cplusplus)
2499 typedef hamlib_port_t_deprecated port_t_deprecated;
2500 typedef hamlib_port_t port_t;
2501 #endif
2502 
2503 /* Macros to access data structures/pointers
2504  * Make it easier to change location in preparation
2505  * for moving them out of rig->state.
2506  * See https://github.com/Hamlib/Hamlib/issues/1445
2507  * https://github.com/Hamlib/Hamlib/issues/1452
2508  * https://github.com/Hamlib/Hamlib/issues/1420
2509  * https://github.com/Hamlib/Hamlib/issues/536
2510  * https://github.com/Hamlib/Hamlib/issues/487
2511  */
2512 // Note: Experimental, and subject to change!!
2513 #if defined(IN_HAMLIB)
2514 /* These are for internal use only */
2515 #define RIGPORT(r) (&r->state.rigport)
2516 #define PTTPORT(r) (&r->state.pttport)
2517 #define DCDPORT(r) (&r->state.dcdport)
2518 #define CACHE(r) (&r->state.cache)
2519 #define AMPPORT(a) (&a->state.ampport)
2520 #define ROTPORT(r) (&r->state.rotport)
2521 #define ROTPORT2(r) (&r->state.rotport2)
2522 #define STATE(r) (&r->state)
2523 #define AMPSTATE(a) (&(a)->state)
2524 #define ROTSTATE(r) (&(r)->state)
2525 /* Then when the rigport address is stored as a pointer somewhere else(say,
2526  * in the rig structure itself), the definition could be changed to
2527  * #define RIGPORT(r) r->somewhereelse
2528  * and every reference is updated.
2529  */
2530 #else
2531 /* Define external unique names */
2532 #define HAMLIB_RIGPORT(r) ((hamlib_port_t *)rig_data_pointer(r, RIG_PTRX_RIGPORT))
2533 #define HAMLIB_PTTPORT(r) ((hamlib_port_t *)rig_data_pointer(r, RIG_PTRX_PTTPORT))
2534 #define HAMLIB_DCDPORT(r) ((hamlib_port_t *)rig_data_pointer(r, RIG_PTRX_DCDPORT))
2535 #define HAMLIB_CACHE(r) ((struct rig_cache *)rig_data_pointer(r, RIG_PTRX_CACHE))
2536 #define HAMLIB_AMPPORT(a) ((hamlib_port_t *)amp_data_pointer(a, RIG_PTRX_AMPPORT))
2537 #define HAMLIB_ROTPORT(r) ((hamlib_port_t *)rot_data_pointer(r, RIG_PTRX_ROTPORT))
2538 #define HAMLIB_ROTPORT2(r) ((hamlib_port_t *)rot_data_pointer(r, RIG_PTRX_ROTPORT2))
2539 #define HAMLIB_STATE(r) ((struct rig_state *)rig_data_pointer(r, RIG_PTRX_STATE))
2540 #define HAMLIB_AMPSTATE(a) ((struct amp_state *)amp_data_pointer(a, RIG_PTRX_AMPSTATE))
2541 #define HAMLIB_ROTSTATE(r) ((struct rot_state *)rot_data_pointer(r, RIG_PTRX_ROTSTATE))
2542 #endif
2543 
2544 typedef enum {
2545  RIG_PTRX_NONE=0,
2546  RIG_PTRX_RIGPORT,
2547  RIG_PTRX_PTTPORT,
2548  RIG_PTRX_DCDPORT,
2549  RIG_PTRX_CACHE,
2550  RIG_PTRX_AMPPORT,
2551  RIG_PTRX_ROTPORT,
2552  RIG_PTRX_ROTPORT2,
2553  RIG_PTRX_STATE,
2554  RIG_PTRX_AMPSTATE,
2555  RIG_PTRX_ROTSTATE,
2556 // New entries go directly above this line====================
2557  RIG_PTRX_MAXIMUM
2558 } rig_ptrx_t;
2559 
2560 #define HAMLIB_ELAPSED_GET 0
2561 #define HAMLIB_ELAPSED_SET 1
2562 #define HAMLIB_ELAPSED_INVALIDATE 2
2563 
2564 #define HAMLIB_CACHE_ALWAYS (-1)
2566 typedef enum {
2567  HAMLIB_CACHE_ALL, // to set all cache timeouts at once
2568  HAMLIB_CACHE_VFO,
2569  HAMLIB_CACHE_FREQ,
2570  HAMLIB_CACHE_MODE,
2571  HAMLIB_CACHE_PTT,
2572  HAMLIB_CACHE_SPLIT,
2573  HAMLIB_CACHE_WIDTH
2574 } hamlib_cache_t;
2575 
2576 typedef enum {
2577  TWIDDLE_OFF,
2578  TWIDDLE_ON
2579 } twiddle_state_t;
2580 
2587 struct rig_cache {
2588  int timeout_ms; // the cache timeout for invalidating itself
2589  vfo_t vfo;
2590  //freq_t freq; // to be deprecated in 4.1 when full Main/Sub/A/B caching is implemented in 4.1
2591  // other abstraction here is based on dual vfo rigs and mapped to all others
2592  // So we have four possible states of rig
2593  // MainA, MainB, SubA, SubB
2594  // Main is the Main VFO and Sub is for the 2nd VFO
2595  // Most rigs have MainA and MainB
2596  // Dual VFO rigs can have SubA and SubB too
2597  // For dual VFO rigs simplex operations are all done on MainA/MainB -- ergo this abstraction
2598  freq_t freqCurr; // Other VFO
2599  freq_t freqOther; // Other VFO
2600  freq_t freqMainA; // VFO_A, VFO_MAIN, and VFO_MAINA
2601  freq_t freqMainB; // VFO_B, VFO_SUB, and VFO_MAINB
2602  freq_t freqMainC; // VFO_C, VFO_MAINC
2603  freq_t freqSubA; // VFO_SUBA -- only for rigs with dual Sub VFOs
2604  freq_t freqSubB; // VFO_SUBB -- only for rigs with dual Sub VFOs
2605  freq_t freqSubC; // VFO_SUBC -- only for rigs with 3 Sub VFOs
2606  freq_t freqMem; // VFO_MEM -- last MEM channel
2607  rmode_t modeCurr;
2608  rmode_t modeOther;
2609  rmode_t modeMainA;
2610  rmode_t modeMainB;
2611  rmode_t modeMainC;
2612  rmode_t modeSubA;
2613  rmode_t modeSubB;
2614  rmode_t modeSubC;
2615  rmode_t modeMem;
2616  pbwidth_t widthCurr; // if non-zero then rig has separate width for MainA
2617  pbwidth_t widthOther; // if non-zero then rig has separate width for MainA
2618  pbwidth_t widthMainA; // if non-zero then rig has separate width for MainA
2619  pbwidth_t widthMainB; // if non-zero then rig has separate width for MainB
2620  pbwidth_t widthMainC; // if non-zero then rig has separate width for MainC
2621  pbwidth_t widthSubA; // if non-zero then rig has separate width for SubA
2622  pbwidth_t widthSubB; // if non-zero then rig has separate width for SubB
2623  pbwidth_t widthSubC; // if non-zero then rig has separate width for SubC
2624  pbwidth_t widthMem; // if non-zero then rig has separate width for Mem
2625  ptt_t ptt;
2626  split_t split;
2627  vfo_t split_vfo; // split caches two values
2628  struct timespec time_freqCurr;
2629  struct timespec time_freqOther;
2630  struct timespec time_freqMainA;
2631  struct timespec time_freqMainB;
2632  struct timespec time_freqMainC;
2633  struct timespec time_freqSubA;
2634  struct timespec time_freqSubB;
2635  struct timespec time_freqSubC;
2636  struct timespec time_freqMem;
2637  struct timespec time_vfo;
2638  struct timespec time_modeCurr;
2639  struct timespec time_modeOther;
2640  struct timespec time_modeMainA;
2641  struct timespec time_modeMainB;
2642  struct timespec time_modeMainC;
2643  struct timespec time_modeSubA;
2644  struct timespec time_modeSubB;
2645  struct timespec time_modeSubC;
2646  struct timespec time_modeMem;
2647  struct timespec time_widthCurr;
2648  struct timespec time_widthOther;
2649  struct timespec time_widthMainA;
2650  struct timespec time_widthMainB;
2651  struct timespec time_widthMainC;
2652  struct timespec time_widthSubA;
2653  struct timespec time_widthSubB;
2654  struct timespec time_widthSubC;
2655  struct timespec time_widthMem;
2656  struct timespec time_ptt;
2657  struct timespec time_split;
2658  int satmode; // if rig is in satellite mode
2659 };
2660 
2665 #include <hamlib/multicast.h>
2667 {
2668  int multicast_running;
2669  int sock;
2670  int seqnumber;
2671  int runflag; // = 0;
2672  pthread_t threadid;
2673  // this mutex is needed to control serial access
2674  // as of 2023-05-13 we have main thread and multicast thread needing it
2675  // eventually we should be able to use cached info only in the main thread to avoid contention
2676  pthread_mutex_t mutex;
2677  int mutex_initialized;
2678 //#ifdef HAVE_ARPA_INET_H
2679  //struct ip_mreq mreq; // = {0};
2680  struct sockaddr_in dest_addr; // = {0};
2681  int port;
2682 //#endif
2683 };
2684 
2685 typedef unsigned int rig_comm_status_t;
2686 
2687 #define RIG_COMM_STATUS_OK 0x00
2688 #define RIG_COMM_STATUS_CONNECTING 0x01
2689 #define RIG_COMM_STATUS_DISCONNECTED 0x02
2690 #define RIG_COMM_STATUS_TERMINATED 0x03
2691 #define RIG_COMM_STATUS_WARNING 0x04
2692 #define RIG_COMM_STATUS_ERROR 0x05
2693 
2704 struct rig_state {
2705  /********* ENSURE ANY NEW ITEMS ARE ADDED AT BOTTOM OF THIS STRUCTURE *********/
2706  /*
2707  * overridable fields
2708  */
2709  // moving the hamlib_port_t to the end of rig_state and making it a pointer
2710  // this should allow changes to hamlib_port_t without breaking shared libraries
2711  // these will maintain a copy of the new port_t for backwards compatibility
2712  // to these offsets -- note these must stay until a major version update is done like 5.0
2713  hamlib_port_t_deprecated rigport_deprecated;
2714  hamlib_port_t_deprecated pttport_deprecated;
2715  hamlib_port_t_deprecated dcdport_deprecated;
2717  double vfo_comp;
2720  freq_range_t rx_range_list[HAMLIB_FRQRANGESIZ];
2721  freq_range_t tx_range_list[HAMLIB_FRQRANGESIZ];
2723  struct tuning_step_list tuning_steps[HAMLIB_TSLSTSIZ];
2725  struct filter_list filters[HAMLIB_FLTLSTSIZ];
2729  chan_t chan_list[HAMLIB_CHANLSTSIZ];
2737  int preamp[HAMLIB_MAXDBLSTSIZ];
2738  int attenuator[HAMLIB_MAXDBLSTSIZ];
2751  /*
2752  * non overridable fields, internal use
2753  */
2754 
2757  int vfo_list;
2759  rig_ptr_t priv;
2760  rig_ptr_t obj;
2766  //rmode_t current_modeB; /*!< Mode currently set VFOB */
2770  // mode_list is used by some
2771  // so anything added to this structure must be below here
2772  int transmit;
2776  time_t twiddle_time;
2778  // uplink allows gpredict to behave better by no reading the uplink VFO
2779  int uplink;
2780  struct rig_cache cache;
2781  int vfo_opt;
2798  volatile unsigned int snapshot_packet_sequence_number;
2799 
2800  volatile int multicast_publisher_run;
2802  volatile int async_data_handler_thread_run;
2803  void *async_data_handler_priv_data;
2804  volatile int poll_routine_thread_run;
2805  void *poll_routine_priv_data;
2806  pthread_mutex_t mutex_set_transaction;
2807  hamlib_port_t rigport;
2808  hamlib_port_t pttport;
2809  hamlib_port_t dcdport;
2810  /********* DO NOT ADD or CHANGE anything (or than to rename) ABOVE THIS LINE *********/
2811  /********* ENSURE ANY NEW ITEMS ARE ADDED AFTER HERE *********/
2812  /* flags instructing the rig_get routines to use cached values when asyncio is in use */
2816  int depth;
2820  char client_version[32];
2824  // Adding a number of items so netrigctl can see the real rig information
2825  // Eventually may want to add these so that rigctld can see more of the backend
2826  // But that will come later if requested -- for now they just fill out dumpstate.c
2828  const char *model_name;
2829  const char *mfg_name;
2830  const char *version;
2831  const char *copyright;
2833  int rig_type;
2845  int timeout;
2846  int retry;
2850  enum agc_level_e agc_levels[HAMLIB_MAX_AGC_LEVELS];
2851  tone_t *ctcss_list;
2852  tone_t *dcs_list;
2856  int bank_qty;
2858  freq_range_t rx_range_list1[HAMLIB_FRQRANGESIZ];
2859  freq_range_t tx_range_list1[HAMLIB_FRQRANGESIZ];
2860  freq_range_t rx_range_list2[HAMLIB_FRQRANGESIZ];
2861  freq_range_t tx_range_list2[HAMLIB_FRQRANGESIZ];
2862  freq_range_t rx_range_list3[HAMLIB_FRQRANGESIZ];
2863  freq_range_t tx_range_list3[HAMLIB_FRQRANGESIZ];
2864  freq_range_t rx_range_list4[HAMLIB_FRQRANGESIZ];
2865  freq_range_t tx_range_list4[HAMLIB_FRQRANGESIZ];
2866  freq_range_t rx_range_list5[HAMLIB_FRQRANGESIZ];
2867  freq_range_t tx_range_list5[HAMLIB_FRQRANGESIZ];
2868  struct rig_spectrum_scope spectrum_scopes[HAMLIB_MAX_SPECTRUM_SCOPES];
2869  enum rig_spectrum_mode_e spectrum_modes[HAMLIB_MAX_SPECTRUM_MODES];
2870  freq_t spectrum_spans[HAMLIB_MAX_SPECTRUM_SPANS];
2871  struct rig_spectrum_avg_mode spectrum_avg_modes[HAMLIB_MAX_SPECTRUM_AVG_MODES];
2872  int spectrum_attenuator[HAMLIB_MAXDBLSTSIZ];
2873  volatile int morse_data_handler_thread_run;
2874  void *morse_data_handler_priv_data;
2875  FIFO_RIG *fifo_morse;
2876  int doppler;
2881  volatile int multicast_receiver_run;
2883  rig_comm_status_t comm_status;
2884  char device_id[HAMLIB_RIGNAMSIZ];
2887  struct timespec freq_event_elapsed;
2889  client_t client;
2890 // New rig_state items go before this line ============================================
2891 };
2892 
2903  /********* ENSURE YOU DO NOT EVER MODIFY THIS STRUCTURE *********/
2904  /********* It will remain forever to provide DLL backwards compatibility ******/
2905  /*
2906  * overridable fields
2907  */
2908  // moving the hamlib_port_t to the end of rig_state and making it a pointer
2909  // this should allow changes to hamlib_port_t without breaking shared libraries
2910  // these will maintain a copy of the new port_t for backwards compatibility
2911  // to these offsets -- note these must stay until a major version update is done like 5.0
2912  hamlib_port_t_deprecated rigport_deprecated;
2913  hamlib_port_t_deprecated pttport_deprecated;
2914  hamlib_port_t_deprecated dcdport_deprecated;
2916  double vfo_comp;
2919  freq_range_t rx_range_list[HAMLIB_FRQRANGESIZ];
2920  freq_range_t tx_range_list[HAMLIB_FRQRANGESIZ];
2922  struct tuning_step_list tuning_steps[HAMLIB_TSLSTSIZ];
2924  struct filter_list filters[HAMLIB_FLTLSTSIZ];
2928  chan_t chan_list[HAMLIB_CHANLSTSIZ];
2936  int preamp[HAMLIB_MAXDBLSTSIZ];
2937  int attenuator[HAMLIB_MAXDBLSTSIZ];
2950  /*
2951  * non overridable fields, internal use
2952  */
2953 
2956  int vfo_list;
2958  rig_ptr_t priv;
2959  rig_ptr_t obj;
2965  //rmode_t current_modeB; /*!< Mode currently set VFOB */
2969  // mode_list is used by some
2970  // so anything added to this structure must be below here
2971  int transmit;
2975  time_t twiddle_time;
2977  // uplink allows gpredict to behave better by no reading the uplink VFO
2978  int uplink;
2979  struct rig_cache cache;
2980  int vfo_opt;
2997  volatile unsigned int snapshot_packet_sequence_number;
2998 
2999  volatile int multicast_publisher_run;
3001  volatile int async_data_handler_thread_run;
3002  void *async_data_handler_priv_data;
3003  volatile int poll_routine_thread_run;
3004  void *poll_routine_priv_data;
3005  pthread_mutex_t mutex_set_transaction;
3006  hamlib_port_t rigport;
3007  hamlib_port_t pttport;
3008  hamlib_port_t dcdport;
3009  /********* DO NOT ADD or CHANGE anything (or than to rename) ABOVE THIS LINE *********/
3010  /********* ENSURE ANY NEW ITEMS ARE ADDED AFTER HERE *********/
3011  /* flags instructing the rig_get routines to use cached values when asyncio is in use */
3015  int depth;
3019  char client_version[32];
3023 };
3024 
3026 typedef int (*vprintf_cb_t)(enum rig_debug_level_e,
3027  rig_ptr_t,
3028  const char *,
3029  va_list);
3030 
3031 typedef int (*freq_cb_t)(RIG *, vfo_t, freq_t, rig_ptr_t);
3032 typedef int (*mode_cb_t)(RIG *, vfo_t, rmode_t, pbwidth_t, rig_ptr_t);
3033 typedef int (*vfo_cb_t)(RIG *, vfo_t, rig_ptr_t);
3034 typedef int (*ptt_cb_t)(RIG *, vfo_t, ptt_t, rig_ptr_t);
3035 typedef int (*dcd_cb_t)(RIG *, vfo_t, dcd_t, rig_ptr_t);
3036 typedef int (*pltune_cb_t)(RIG *,
3037  vfo_t, freq_t *,
3038  rmode_t *,
3039  pbwidth_t *,
3040  rig_ptr_t);
3041 typedef int (*spectrum_cb_t)(RIG *,
3042  struct rig_spectrum_line *,
3043  rig_ptr_t);
3044 
3046 
3064 // Do NOT add/remove from this structure -- it will break DLL backwards compatibility
3066  freq_cb_t freq_event;
3067  rig_ptr_t freq_arg;
3068  mode_cb_t mode_event;
3069  rig_ptr_t mode_arg;
3070  vfo_cb_t vfo_event;
3071  rig_ptr_t vfo_arg;
3072  ptt_cb_t ptt_event;
3073  rig_ptr_t ptt_arg;
3074  dcd_cb_t dcd_event;
3075  rig_ptr_t dcd_arg;
3076  pltune_cb_t pltune;
3077  rig_ptr_t pltune_arg;
3078  spectrum_cb_t spectrum_event;
3079  rig_ptr_t spectrum_arg;
3080  /* etc.. */
3081 };
3082 
3083 
3093 struct s_rig {
3094  struct rig_caps *caps;
3095  // Do not remove the deprecated structure -- it will mess up DLL backwards compatibility
3098  // state should really be a pointer but that's a LOT of changes involved
3099  struct rig_state state;
3100 };
3101 
3102 
3103 
3104 /* --------------- API function prototypes -----------------*/
3105 
3107 
3108 extern HAMLIB_EXPORT(RIG *) rig_init HAMLIB_PARAMS((rig_model_t rig_model));
3109 extern HAMLIB_EXPORT(int) rig_open HAMLIB_PARAMS((RIG *rig));
3110 
3111 /*
3112  * General API commands, from most primitive to least.. :()
3113  * List Set/Get functions pairs
3114  */
3115 
3116 extern HAMLIB_EXPORT(int)
3117 rig_flush_force(hamlib_port_t *port, int flush_async_data);
3118 
3119 extern HAMLIB_EXPORT(int)
3120 rig_flush(hamlib_port_t *port);
3121 
3122 extern HAMLIB_EXPORT(void)
3123 rig_lock(RIG *rig, int lock);
3124 
3125 #if BUILTINFUNC
3126 #define rig_set_freq(r,v,f) rig_set_freq(r,v,f,__builtin_FUNCTION())
3127 extern HAMLIB_EXPORT(int)
3128 rig_set_freq HAMLIB_PARAMS((RIG *rig,
3129  vfo_t vfo,
3130  freq_t freq, const char*));
3131 #else
3132 extern HAMLIB_EXPORT(int)
3133 rig_set_freq HAMLIB_PARAMS((RIG *rig,
3134  vfo_t vfo,
3135  freq_t freq));
3136 #endif
3137 #if BUILTINFUNC
3138 #define rig_get_freq(r,v,f) rig_get_freq(r,v,f,__builtin_FUNCTION())
3139 extern HAMLIB_EXPORT(int)
3140 rig_get_freq HAMLIB_PARAMS((RIG *rig,
3141  vfo_t vfo,
3142  freq_t *freq, const char*));
3143 #else
3144 extern HAMLIB_EXPORT(int)
3145 rig_get_freq HAMLIB_PARAMS((RIG *rig,
3146  vfo_t vfo,
3147  freq_t *freq));
3148 #endif
3149 
3150 extern HAMLIB_EXPORT(int)
3151 rig_set_mode HAMLIB_PARAMS((RIG *rig,
3152  vfo_t vfo,
3153  rmode_t mode,
3154  pbwidth_t width));
3155 extern HAMLIB_EXPORT(int)
3156 rig_get_mode HAMLIB_PARAMS((RIG *rig,
3157  vfo_t vfo,
3158  rmode_t *mode,
3159  pbwidth_t *width));
3160 
3161 #if BUILTINFUNC
3162 #define rig_set_vfo(r,v) rig_set_vfo(r,v,__builtin_FUNCTION())
3163 extern HAMLIB_EXPORT(int)
3164 rig_set_vfo HAMLIB_PARAMS((RIG *rig,
3165  vfo_t vfo, const char *func));
3166 #else
3167 extern HAMLIB_EXPORT(int)
3168 rig_set_vfo HAMLIB_PARAMS((RIG *rig,
3169  vfo_t vfo));
3170 #endif
3171 extern HAMLIB_EXPORT(int)
3172 rig_get_vfo HAMLIB_PARAMS((RIG *rig,
3173  vfo_t *vfo));
3174 
3175 extern HAMLIB_EXPORT(int)
3176 rig_get_vfo_info HAMLIB_PARAMS((RIG *rig,
3177  vfo_t vfo,
3178  freq_t *freq,
3179  rmode_t *mode,
3180  pbwidth_t *width,
3181  split_t *split,
3182  int *satmode));
3183 
3184 extern HAMLIB_EXPORT(int)
3185 rig_get_vfo_list HAMLIB_PARAMS((RIG *rig, char *buf, int buflen));
3186 
3187 extern HAMLIB_EXPORT(int)
3188 netrigctl_get_vfo_mode HAMLIB_PARAMS((RIG *rig));
3189 
3190 extern HAMLIB_EXPORT(int)
3191 rig_set_ptt HAMLIB_PARAMS((RIG *rig,
3192  vfo_t vfo,
3193  ptt_t ptt));
3194 extern HAMLIB_EXPORT(int)
3195 rig_get_ptt HAMLIB_PARAMS((RIG *rig,
3196  vfo_t vfo,
3197  ptt_t *ptt));
3198 
3199 extern HAMLIB_EXPORT(int)
3200 rig_get_dcd HAMLIB_PARAMS((RIG *rig,
3201  vfo_t vfo,
3202  dcd_t *dcd));
3203 
3204 extern HAMLIB_EXPORT(int)
3205 rig_set_rptr_shift HAMLIB_PARAMS((RIG *rig,
3206  vfo_t vfo,
3207  rptr_shift_t rptr_shift));
3208 extern HAMLIB_EXPORT(int)
3209 rig_get_rptr_shift HAMLIB_PARAMS((RIG *rig,
3210  vfo_t vfo,
3211  rptr_shift_t *rptr_shift));
3212 
3213 extern HAMLIB_EXPORT(int)
3214 rig_set_rptr_offs HAMLIB_PARAMS((RIG *rig,
3215  vfo_t vfo,
3216  shortfreq_t rptr_offs));
3217 extern HAMLIB_EXPORT(int)
3218 rig_get_rptr_offs HAMLIB_PARAMS((RIG *rig,
3219  vfo_t vfo,
3220  shortfreq_t *rptr_offs));
3221 
3222 extern HAMLIB_EXPORT(int)
3223 rig_set_ctcss_tone HAMLIB_PARAMS((RIG *rig,
3224  vfo_t vfo,
3225  tone_t tone));
3226 extern HAMLIB_EXPORT(int)
3227 rig_get_ctcss_tone HAMLIB_PARAMS((RIG *rig,
3228  vfo_t vfo,
3229  tone_t *tone));
3230 
3231 extern HAMLIB_EXPORT(int)
3232 rig_set_dcs_code HAMLIB_PARAMS((RIG *rig,
3233  vfo_t vfo,
3234  tone_t code));
3235 extern HAMLIB_EXPORT(int)
3236 rig_get_dcs_code HAMLIB_PARAMS((RIG *rig,
3237  vfo_t vfo,
3238  tone_t *code));
3239 
3240 extern HAMLIB_EXPORT(int)
3241 rig_set_ctcss_sql HAMLIB_PARAMS((RIG *rig,
3242  vfo_t vfo,
3243  tone_t tone));
3244 extern HAMLIB_EXPORT(int)
3245 rig_get_ctcss_sql HAMLIB_PARAMS((RIG *rig,
3246  vfo_t vfo,
3247  tone_t *tone));
3248 
3249 extern HAMLIB_EXPORT(int)
3250 rig_set_dcs_sql HAMLIB_PARAMS((RIG *rig,
3251  vfo_t vfo,
3252  tone_t code));
3253 extern HAMLIB_EXPORT(int)
3254 rig_get_dcs_sql HAMLIB_PARAMS((RIG *rig,
3255  vfo_t vfo,
3256  tone_t *code));
3257 
3258 extern HAMLIB_EXPORT(int)
3259 rig_set_split_freq HAMLIB_PARAMS((RIG *rig,
3260  vfo_t vfo,
3261  freq_t tx_freq));
3262 extern HAMLIB_EXPORT(int)
3263 rig_get_split_freq HAMLIB_PARAMS((RIG *rig,
3264  vfo_t vfo,
3265  freq_t *tx_freq));
3266 
3267 extern HAMLIB_EXPORT(int)
3268 rig_set_split_mode HAMLIB_PARAMS((RIG *rig,
3269  vfo_t vfo,
3270  rmode_t tx_mode,
3271  pbwidth_t tx_width));
3272 extern HAMLIB_EXPORT(int)
3273 rig_get_split_mode HAMLIB_PARAMS((RIG *rig,
3274  vfo_t vfo,
3275  rmode_t *tx_mode,
3276  pbwidth_t *tx_width));
3277 
3278 extern HAMLIB_EXPORT(int)
3279 rig_set_split_freq_mode HAMLIB_PARAMS((RIG *rig,
3280  vfo_t vfo,
3281  freq_t tx_freq,
3282  rmode_t tx_mode,
3283  pbwidth_t tx_width));
3284 extern HAMLIB_EXPORT(int)
3285 rig_get_split_freq_mode HAMLIB_PARAMS((RIG *rig,
3286  vfo_t vfo,
3287  freq_t *tx_freq,
3288  rmode_t *tx_mode,
3289  pbwidth_t *tx_width));
3290 
3291 extern HAMLIB_EXPORT(int)
3292 rig_set_split_vfo HAMLIB_PARAMS((RIG *,
3293  vfo_t rx_vfo,
3294  split_t split,
3295  vfo_t tx_vfo));
3296 extern HAMLIB_EXPORT(int)
3297 rig_get_split_vfo HAMLIB_PARAMS((RIG *,
3298  vfo_t rx_vfo,
3299  split_t *split,
3300  vfo_t *tx_vfo));
3301 
3302 extern HAMLIB_EXPORT(int)
3303 rig_set_rit HAMLIB_PARAMS((RIG *rig,
3304  vfo_t vfo,
3305  shortfreq_t rit));
3306 extern HAMLIB_EXPORT(int)
3307 rig_get_rit HAMLIB_PARAMS((RIG *rig,
3308  vfo_t vfo,
3309  shortfreq_t *rit));
3310 
3311 extern HAMLIB_EXPORT(int)
3312 rig_set_xit HAMLIB_PARAMS((RIG *rig,
3313  vfo_t vfo,
3314  shortfreq_t xit));
3315 extern HAMLIB_EXPORT(int)
3316 rig_get_xit HAMLIB_PARAMS((RIG *rig,
3317  vfo_t vfo,
3318  shortfreq_t *xit));
3319 
3320 extern HAMLIB_EXPORT(int)
3321 rig_set_ts HAMLIB_PARAMS((RIG *rig,
3322  vfo_t vfo,
3323  shortfreq_t ts));
3324 extern HAMLIB_EXPORT(int)
3325 rig_get_ts HAMLIB_PARAMS((RIG *rig,
3326  vfo_t vfo,
3327  shortfreq_t *ts));
3328 
3329 extern HAMLIB_EXPORT(int)
3330 rig_power2mW HAMLIB_PARAMS((RIG *rig,
3331  unsigned int *mwpower,
3332  float power,
3333  freq_t freq,
3334  rmode_t mode));
3335 extern HAMLIB_EXPORT(int)
3336 rig_mW2power HAMLIB_PARAMS((RIG *rig,
3337  float *power,
3338  unsigned int mwpower,
3339  freq_t freq,
3340  rmode_t mode));
3341 
3342 extern HAMLIB_EXPORT(shortfreq_t)
3343 rig_get_resolution HAMLIB_PARAMS((RIG *rig,
3344  rmode_t mode));
3345 
3346 extern HAMLIB_EXPORT(int)
3347 rig_set_level HAMLIB_PARAMS((RIG *rig,
3348  vfo_t vfo,
3349  setting_t level,
3350  value_t val));
3351 extern HAMLIB_EXPORT(int)
3352 rig_get_level HAMLIB_PARAMS((RIG *rig,
3353  vfo_t vfo,
3354  setting_t level,
3355  value_t *val));
3356 
3357 #define rig_get_strength(r,v,s) rig_get_level((r),(v),RIG_LEVEL_STRENGTH, (value_t*)(s))
3358 
3359 extern HAMLIB_EXPORT(int)
3360 rig_set_parm HAMLIB_PARAMS((RIG *rig,
3361  setting_t parm,
3362  value_t val));
3363 extern HAMLIB_EXPORT(int)
3364 rig_get_parm HAMLIB_PARAMS((RIG *rig,
3365  setting_t parm,
3366  value_t *val));
3367 
3368 extern HAMLIB_EXPORT(int)
3369 rig_set_conf HAMLIB_PARAMS((RIG *rig,
3370  hamlib_token_t token,
3371  const char *val));
3372 // deprecating rig_get_conf
3373 extern HAMLIB_EXPORT(int)
3374 rig_get_conf HAMLIB_PARAMS((RIG *rig,
3375  hamlib_token_t token,
3376  char *val));
3377 extern HAMLIB_EXPORT(int)
3378 rig_get_conf2 HAMLIB_PARAMS((RIG *rig,
3379  hamlib_token_t token,
3380  char *val,
3381  int val_len));
3382 
3383 extern HAMLIB_EXPORT(int)
3384 rig_set_powerstat HAMLIB_PARAMS((RIG *rig,
3385  powerstat_t status));
3386 extern HAMLIB_EXPORT(int)
3387 rig_get_powerstat HAMLIB_PARAMS((RIG *rig,
3388  powerstat_t *status));
3389 
3390 extern HAMLIB_EXPORT(int)
3391 rig_reset HAMLIB_PARAMS((RIG *rig,
3392  reset_t reset)); /* dangerous! */
3393 
3394 extern HAMLIB_EXPORT(int)
3395 rig_set_ext_level HAMLIB_PARAMS((RIG *rig,
3396  vfo_t vfo,
3397  hamlib_token_t token,
3398  value_t val));
3399 extern HAMLIB_EXPORT(int)
3400 rig_get_ext_level HAMLIB_PARAMS((RIG *rig,
3401  vfo_t vfo,
3402  hamlib_token_t token,
3403  value_t *val));
3404 
3405 extern HAMLIB_EXPORT(int)
3406 rig_set_ext_func HAMLIB_PARAMS((RIG *rig,
3407  vfo_t vfo,
3408  hamlib_token_t token,
3409  int status));
3410 extern HAMLIB_EXPORT(int)
3411 rig_get_ext_func HAMLIB_PARAMS((RIG *rig,
3412  vfo_t vfo,
3413  hamlib_token_t token,
3414  int *status));
3415 
3416 extern HAMLIB_EXPORT(int)
3417 rig_set_ext_parm HAMLIB_PARAMS((RIG *rig,
3418  hamlib_token_t token,
3419  value_t val));
3420 extern HAMLIB_EXPORT(int)
3421 rig_get_ext_parm HAMLIB_PARAMS((RIG *rig,
3422  hamlib_token_t token,
3423  value_t *val));
3424 
3425 extern HAMLIB_EXPORT(int)
3426 rig_ext_func_foreach HAMLIB_PARAMS((RIG *rig,
3427  int (*cfunc)(RIG *,
3428  const struct confparams *,
3429  rig_ptr_t),
3430  rig_ptr_t data));
3431 extern HAMLIB_EXPORT(int)
3432 rig_ext_level_foreach HAMLIB_PARAMS((RIG *rig,
3433  int (*cfunc)(RIG *,
3434  const struct confparams *,
3435  rig_ptr_t),
3436  rig_ptr_t data));
3437 extern HAMLIB_EXPORT(int)
3438 rig_ext_parm_foreach HAMLIB_PARAMS((RIG *rig,
3439  int (*cfunc)(RIG *,
3440  const struct confparams *,
3441  rig_ptr_t),
3442  rig_ptr_t data));
3443 
3444 extern HAMLIB_EXPORT(const struct confparams *)
3445 rig_ext_lookup HAMLIB_PARAMS((RIG *rig,
3446  const char *name));
3447 
3448 extern HAMLIB_EXPORT(const struct confparams *)
3449 rig_ext_lookup_tok HAMLIB_PARAMS((RIG *rig,
3450  hamlib_token_t token));
3451 extern HAMLIB_EXPORT(hamlib_token_t)
3452 rig_ext_token_lookup HAMLIB_PARAMS((RIG *rig,
3453  const char *name));
3454 
3455 
3456 extern HAMLIB_EXPORT(int)
3457 rig_token_foreach HAMLIB_PARAMS((RIG *rig,
3458  int (*cfunc)(const struct confparams *,
3459  rig_ptr_t),
3460  rig_ptr_t data));
3461 
3462 extern HAMLIB_EXPORT(const struct confparams *)
3463 rig_confparam_lookup HAMLIB_PARAMS((RIG *rig,
3464  const char *name));
3465 extern HAMLIB_EXPORT(hamlib_token_t)
3466 rig_token_lookup HAMLIB_PARAMS((RIG *rig,
3467  const char *name));
3468 
3469 extern HAMLIB_EXPORT(int)
3470 rig_close HAMLIB_PARAMS((RIG *rig));
3471 
3472 extern HAMLIB_EXPORT(int)
3473 rig_cleanup HAMLIB_PARAMS((RIG *rig));
3474 
3475 extern HAMLIB_EXPORT(int)
3476 rig_set_ant HAMLIB_PARAMS((RIG *rig,
3477  vfo_t vfo,
3478  ant_t ant, /* antenna */
3479  value_t option)); /* optional ant info */
3480 extern HAMLIB_EXPORT(int)
3481 rig_get_ant HAMLIB_PARAMS((RIG *rig,
3482  vfo_t vfo,
3483  ant_t ant,
3484  value_t *option,
3485  ant_t *ant_curr,
3486  ant_t *ant_tx,
3487  ant_t *ant_rx));
3488 
3489 extern HAMLIB_EXPORT(setting_t)
3490 rig_has_get_level HAMLIB_PARAMS((RIG *rig,
3491  setting_t level));
3492 extern HAMLIB_EXPORT(setting_t)
3493 rig_has_set_level HAMLIB_PARAMS((RIG *rig,
3494  setting_t level));
3495 
3496 extern HAMLIB_EXPORT(setting_t)
3497 rig_has_get_parm HAMLIB_PARAMS((RIG *rig,
3498  setting_t parm));
3499 extern HAMLIB_EXPORT(setting_t)
3500 rig_has_set_parm HAMLIB_PARAMS((RIG *rig,
3501  setting_t parm));
3502 
3503 extern HAMLIB_EXPORT(setting_t)
3504 rig_has_get_func HAMLIB_PARAMS((RIG *rig,
3505  setting_t func));
3506 extern HAMLIB_EXPORT(setting_t)
3507 rig_has_set_func HAMLIB_PARAMS((RIG *rig,
3508  setting_t func));
3509 
3510 extern HAMLIB_EXPORT(int)
3511 rig_set_func HAMLIB_PARAMS((RIG *rig,
3512  vfo_t vfo,
3513  setting_t func,
3514  int status));
3515 extern HAMLIB_EXPORT(int)
3516 rig_get_func HAMLIB_PARAMS((RIG *rig,
3517  vfo_t vfo,
3518  setting_t func,
3519  int *status));
3520 
3521 extern HAMLIB_EXPORT(int)
3522 rig_send_dtmf HAMLIB_PARAMS((RIG *rig,
3523  vfo_t vfo,
3524  const char *digits));
3525 extern HAMLIB_EXPORT(int)
3526 rig_recv_dtmf HAMLIB_PARAMS((RIG *rig,
3527  vfo_t vfo,
3528  char *digits,
3529  int *length));
3530 
3531 extern HAMLIB_EXPORT(int)
3532 rig_send_morse HAMLIB_PARAMS((RIG *rig,
3533  vfo_t vfo,
3534  const char *msg));
3535 
3536 extern HAMLIB_EXPORT(int)
3537 rig_stop_morse HAMLIB_PARAMS((RIG *rig,
3538  vfo_t vfo));
3539 
3540 extern HAMLIB_EXPORT(int)
3541 rig_wait_morse HAMLIB_PARAMS((RIG *rig,
3542  vfo_t vfo));
3543 
3544 extern HAMLIB_EXPORT(int)
3545 rig_send_voice_mem HAMLIB_PARAMS((RIG *rig,
3546  vfo_t vfo,
3547  int ch));
3548 
3549 extern HAMLIB_EXPORT(int)
3550 rig_stop_voice_mem HAMLIB_PARAMS((RIG *rig,
3551  vfo_t vfo));
3552 
3553 extern HAMLIB_EXPORT(int)
3554 rig_set_bank HAMLIB_PARAMS((RIG *rig,
3555  vfo_t vfo,
3556  int bank));
3557 
3558 extern HAMLIB_EXPORT(int)
3559 rig_set_mem HAMLIB_PARAMS((RIG *rig,
3560  vfo_t vfo,
3561  int ch));
3562 extern HAMLIB_EXPORT(int)
3563 rig_get_mem HAMLIB_PARAMS((RIG *rig,
3564  vfo_t vfo,
3565  int *ch));
3566 
3567 extern HAMLIB_EXPORT(int)
3568 rig_vfo_op HAMLIB_PARAMS((RIG *rig,
3569  vfo_t vfo,
3570  vfo_op_t op));
3571 
3572 extern HAMLIB_EXPORT(vfo_op_t)
3573 rig_has_vfo_op HAMLIB_PARAMS((RIG *rig,
3574  vfo_op_t op));
3575 
3576 extern HAMLIB_EXPORT(int)
3577 rig_scan HAMLIB_PARAMS((RIG *rig,
3578  vfo_t vfo,
3579  scan_t scan,
3580  int ch));
3581 
3582 extern HAMLIB_EXPORT(scan_t)
3583 rig_has_scan HAMLIB_PARAMS((RIG *rig,
3584  scan_t scan));
3585 
3586 extern HAMLIB_EXPORT(int)
3587 rig_set_channel HAMLIB_PARAMS((RIG *rig,
3588  vfo_t vfo,
3589  const channel_t *chan)); /* mem */
3590 extern HAMLIB_EXPORT(int)
3591 rig_get_channel HAMLIB_PARAMS((RIG *rig,
3592  vfo_t vfo,
3593  channel_t *chan, int read_only));
3594 
3595 extern HAMLIB_EXPORT(int)
3596 rig_set_chan_all HAMLIB_PARAMS((RIG *rig,
3597  vfo_t vfo,
3598  const channel_t chans[]));
3599 extern HAMLIB_EXPORT(int)
3600 rig_get_chan_all HAMLIB_PARAMS((RIG *rig,
3601  vfo_t vfo,
3602  channel_t chans[]));
3603 
3604 extern HAMLIB_EXPORT(int)
3605 rig_set_chan_all_cb HAMLIB_PARAMS((RIG *rig,
3606  vfo_t vfo,
3607  chan_cb_t chan_cb,
3608  rig_ptr_t));
3609 extern HAMLIB_EXPORT(int)
3610 rig_get_chan_all_cb HAMLIB_PARAMS((RIG *rig,
3611  vfo_t vfo,
3612  chan_cb_t chan_cb,
3613  rig_ptr_t));
3614 
3615 extern HAMLIB_EXPORT(int)
3616 rig_set_mem_all_cb HAMLIB_PARAMS((RIG *rig,
3617  vfo_t vfo,
3618  chan_cb_t chan_cb,
3619  confval_cb_t parm_cb,
3620  rig_ptr_t));
3621 extern HAMLIB_EXPORT(int)
3622 rig_get_mem_all_cb HAMLIB_PARAMS((RIG *rig,
3623  vfo_t vfo,
3624  chan_cb_t chan_cb,
3625  confval_cb_t parm_cb,
3626  rig_ptr_t));
3627 
3628 extern HAMLIB_EXPORT(int)
3629 rig_set_mem_all HAMLIB_PARAMS((RIG *rig,
3630  vfo_t vfo,
3631  const channel_t *chan,
3632  const struct confparams *,
3633  const value_t *));
3634 extern HAMLIB_EXPORT(int)
3635 rig_get_mem_all HAMLIB_PARAMS((RIG *rig,
3636  vfo_t vfo,
3637  channel_t *chan,
3638  const struct confparams *,
3639  value_t *));
3640 
3641 extern HAMLIB_EXPORT(const chan_t *)
3642 rig_lookup_mem_caps HAMLIB_PARAMS((RIG *rig,
3643  int ch));
3644 
3645 extern HAMLIB_EXPORT(int)
3646 rig_mem_count HAMLIB_PARAMS((RIG *rig));
3647 
3648 extern HAMLIB_EXPORT(int)
3649 rig_set_trn HAMLIB_PARAMS((RIG *rig,
3650  int trn));
3651 extern HAMLIB_EXPORT(int)
3652 rig_get_trn HAMLIB_PARAMS((RIG *rig,
3653  int *trn));
3654 
3655 extern HAMLIB_EXPORT(int)
3656 rig_set_freq_callback HAMLIB_PARAMS((RIG *,
3657  freq_cb_t,
3658  rig_ptr_t));
3659 
3660 extern HAMLIB_EXPORT(int)
3661 rig_set_mode_callback HAMLIB_PARAMS((RIG *,
3662  mode_cb_t,
3663  rig_ptr_t));
3664 extern HAMLIB_EXPORT(int)
3665 rig_set_vfo_callback HAMLIB_PARAMS((RIG *,
3666  vfo_cb_t,
3667  rig_ptr_t));
3668 
3669 extern HAMLIB_EXPORT(int)
3670 rig_set_ptt_callback HAMLIB_PARAMS((RIG *,
3671  ptt_cb_t,
3672  rig_ptr_t));
3673 
3674 extern HAMLIB_EXPORT(int)
3675 rig_set_dcd_callback HAMLIB_PARAMS((RIG *,
3676  dcd_cb_t,
3677  rig_ptr_t));
3678 
3679 extern HAMLIB_EXPORT(int)
3680 rig_set_pltune_callback HAMLIB_PARAMS((RIG *,
3681  pltune_cb_t,
3682  rig_ptr_t));
3683 
3684 extern HAMLIB_EXPORT(int)
3685 rig_set_spectrum_callback HAMLIB_PARAMS((RIG *,
3686  spectrum_cb_t,
3687  rig_ptr_t));
3688 
3689 extern HAMLIB_EXPORT(int)
3690 rig_set_twiddle HAMLIB_PARAMS((RIG *rig,
3691  int seconds));
3692 
3693 extern HAMLIB_EXPORT(int)
3694 rig_get_twiddle HAMLIB_PARAMS((RIG *rig,
3695  int *seconds));
3696 
3697 extern HAMLIB_EXPORT(int)
3698 rig_set_uplink HAMLIB_PARAMS((RIG *rig,
3699  int val));
3700 
3701 extern HAMLIB_EXPORT(const char *)
3702 rig_get_info HAMLIB_PARAMS((RIG *rig));
3703 
3704 extern HAMLIB_EXPORT(struct rig_caps *)
3705 rig_get_caps HAMLIB_PARAMS((rig_model_t rig_model));
3706 
3707 extern HAMLIB_EXPORT(const freq_range_t *)
3708 rig_get_range HAMLIB_PARAMS((const freq_range_t *range_list,
3709  freq_t freq,
3710  rmode_t mode));
3711 
3712 extern HAMLIB_EXPORT(pbwidth_t)
3713 rig_passband_normal HAMLIB_PARAMS((RIG *rig,
3714  rmode_t mode));
3715 extern HAMLIB_EXPORT(pbwidth_t)
3716 rig_passband_narrow HAMLIB_PARAMS((RIG *rig,
3717  rmode_t mode));
3718 extern HAMLIB_EXPORT(pbwidth_t)
3719 rig_passband_wide HAMLIB_PARAMS((RIG *rig,
3720  rmode_t mode));
3721 
3722 extern HAMLIB_EXPORT(const char *)
3723 rigerror HAMLIB_PARAMS((int errnum));
3724 extern HAMLIB_EXPORT(const char *)
3725 rigerror2 HAMLIB_PARAMS((int errnum));
3726 
3727 extern HAMLIB_EXPORT(int)
3728 rig_setting2idx HAMLIB_PARAMS((setting_t s));
3729 
3730 #define HAMLIB_SETTINGS_FILE "hamlib_settings"
3731 
3732 extern HAMLIB_EXPORT(setting_t)
3733 rig_idx2setting(int i);
3734 /*
3735  * Even if these functions are prefixed with "rig_", they are not rig specific
3736  * Maybe "hamlib_" would have been better. Let me know. --SF
3737  */
3738 extern HAMLIB_EXPORT(void)
3739 rig_set_debug HAMLIB_PARAMS((enum rig_debug_level_e debug_level));
3740 
3741 extern HAMLIB_EXPORT(void)
3742 rig_get_debug HAMLIB_PARAMS((enum rig_debug_level_e *debug_level));
3743 
3744 extern HAMLIB_EXPORT(void)
3745 rig_set_debug_time_stamp HAMLIB_PARAMS((int flag));
3746 
3747 #define rig_set_debug_level(level) rig_set_debug(level)
3748 
3749 extern HAMLIB_EXPORT(int)
3750 rig_need_debug HAMLIB_PARAMS((enum rig_debug_level_e debug_level));
3751 
3752 
3753 extern HAMLIB_EXPORT(void)add2debugmsgsave(const char *s);
3754 // this needs to be fairly big to avoid compiler warnings
3755 extern HAMLIB_EXPORT_VAR(char) debugmsgsave[DEBUGMSGSAVE_SIZE]; // last debug msg
3756 extern HAMLIB_EXPORT_VAR(char) debugmsgsave2[DEBUGMSGSAVE_SIZE]; // last-1 debug msg
3757 // debugmsgsave3 is deprecated
3758 extern HAMLIB_EXPORT_VAR(char) debugmsgsave3[DEBUGMSGSAVE_SIZE]; // last-2 debug msg
3759 #define rig_debug_clear() { debugmsgsave[0] = debugmsgsave2[0] = debugmsgsave3[0] = 0; };
3760 #ifndef __cplusplus
3761 #ifdef __GNUC__
3762 // doing the debug macro with a dummy sprintf allows gcc to check the format string
3763 #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)
3764 #endif
3765 #endif
3766 
3767 // Measuring elapsed time -- local variable inside function when macro is used
3768 #define ELAPSED1 struct timespec __begin; elapsed_ms(&__begin, HAMLIB_ELAPSED_SET);
3769 #define ELAPSED2 rig_debug(RIG_DEBUG_VERBOSE, "%s%d:%s: elapsed=%.0lfms\n", spaces(STATE(rig)->depth), STATE(rig)->depth, __func__, elapsed_ms(&__begin, HAMLIB_ELAPSED_GET));
3770 
3771 // use this instead of snprintf for automatic detection of buffer limit
3772 #define SNPRINTF(s,n,...) { if (snprintf(s,n,##__VA_ARGS__) >= (n)) fprintf(stderr,"***** %s(%d): message truncated *****\n", __func__, __LINE__); }
3773 
3774 extern HAMLIB_EXPORT(void)
3775 rig_debug HAMLIB_PARAMS((enum rig_debug_level_e debug_level,
3776  const char *fmt, ...));
3777 
3778 extern HAMLIB_EXPORT(vprintf_cb_t)
3779 rig_set_debug_callback HAMLIB_PARAMS((vprintf_cb_t cb,
3780  rig_ptr_t arg));
3781 
3782 extern HAMLIB_EXPORT(FILE *)
3783 rig_set_debug_file HAMLIB_PARAMS((FILE *stream));
3784 
3785 extern HAMLIB_EXPORT(int)
3786 rig_register HAMLIB_PARAMS((struct rig_caps *caps));
3787 
3788 extern HAMLIB_EXPORT(int)
3789 rig_unregister HAMLIB_PARAMS((rig_model_t rig_model));
3790 
3791 extern HAMLIB_EXPORT(int)
3792 rig_list_foreach HAMLIB_PARAMS((int (*cfunc)(struct rig_caps *, rig_ptr_t),
3793  rig_ptr_t data));
3794 
3795 extern HAMLIB_EXPORT(int)
3796 rig_list_foreach_model HAMLIB_PARAMS((int (*cfunc)(const rig_model_t rig_model, rig_ptr_t),
3797  rig_ptr_t data));
3798 
3799 extern HAMLIB_EXPORT(int)
3800 rig_load_backend HAMLIB_PARAMS((const char *be_name));
3801 
3802 extern HAMLIB_EXPORT(int)
3803 rig_check_backend HAMLIB_PARAMS((rig_model_t rig_model));
3804 
3805 extern HAMLIB_EXPORT(int)
3806 rig_load_all_backends HAMLIB_PARAMS((void));
3807 
3808 typedef int (*rig_probe_func_t)(const hamlib_port_t *, rig_model_t, rig_ptr_t);
3809 
3810 extern HAMLIB_EXPORT(int)
3811 rig_probe_all HAMLIB_PARAMS((hamlib_port_t *p,
3812  rig_probe_func_t,
3813  rig_ptr_t));
3814 
3815 extern HAMLIB_EXPORT(rig_model_t)
3816 rig_probe HAMLIB_PARAMS((hamlib_port_t *p));
3817 
3818 
3819 /* Misc calls */
3820 extern HAMLIB_EXPORT(const char *) rig_strrmode(rmode_t mode);
3821 extern HAMLIB_EXPORT(int) rig_strrmodes(rmode_t modes, char *buf, int buflen);
3822 extern HAMLIB_EXPORT(const char *) rig_strvfo(vfo_t vfo);
3823 extern HAMLIB_EXPORT(const char *) rig_strfunc(setting_t);
3824 extern HAMLIB_EXPORT(const char *) rig_strlevel(setting_t);
3825 extern HAMLIB_EXPORT(const char *) rig_strparm(setting_t);
3826 extern HAMLIB_EXPORT(const char *) rig_stragclevel(enum agc_level_e level);
3827 extern HAMLIB_EXPORT(enum agc_level_e) rig_levelagcstr (const char *agcString);
3828 extern HAMLIB_EXPORT(enum agc_level_e) rig_levelagcvalue (int agcValue);
3829 extern HAMLIB_EXPORT(value_t) rig_valueagclevel (enum agc_level_e agcLevel);
3830 extern HAMLIB_EXPORT(const char *) rig_strptrshift(rptr_shift_t);
3831 extern HAMLIB_EXPORT(const char *) rig_strvfop(vfo_op_t op);
3832 extern HAMLIB_EXPORT(const char *) rig_strscan(scan_t scan);
3833 extern HAMLIB_EXPORT(const char *) rig_strstatus(enum rig_status_e status);
3834 extern HAMLIB_EXPORT(const char *) rig_strmtype(chan_type_t mtype);
3835 extern HAMLIB_EXPORT(const char *) rig_strspectrummode(enum rig_spectrum_mode_e mode);
3836 extern HAMLIB_EXPORT(const char *) rig_strcommstatus(rig_comm_status_t vfo);
3837 
3838 extern HAMLIB_EXPORT(rmode_t) rig_parse_mode(const char *s);
3839 extern HAMLIB_EXPORT(vfo_t) rig_parse_vfo(const char *s);
3840 extern HAMLIB_EXPORT(setting_t) rig_parse_func(const char *s);
3841 extern HAMLIB_EXPORT(setting_t) rig_parse_level(const char *s);
3842 extern HAMLIB_EXPORT(setting_t) rig_parse_parm(const char *s);
3843 extern HAMLIB_EXPORT(vfo_op_t) rig_parse_vfo_op(const char *s);
3844 extern HAMLIB_EXPORT(scan_t) rig_parse_scan(const char *s);
3845 extern HAMLIB_EXPORT(rptr_shift_t) rig_parse_rptr_shift(const char *s);
3846 extern HAMLIB_EXPORT(chan_type_t) rig_parse_mtype(const char *s);
3847 
3848 extern HAMLIB_EXPORT(const char *) rig_license HAMLIB_PARAMS((void));
3849 extern HAMLIB_EXPORT(const char *) rig_version HAMLIB_PARAMS((void));
3850 extern HAMLIB_EXPORT(const char *) rig_copyright HAMLIB_PARAMS((void));
3851 
3852 extern HAMLIB_EXPORT(void) rig_no_restore_ai(void);
3853 
3854 extern HAMLIB_EXPORT(int) rig_get_cache_timeout_ms(RIG *rig, hamlib_cache_t selection);
3855 extern HAMLIB_EXPORT(int) rig_set_cache_timeout_ms(RIG *rig, hamlib_cache_t selection, int ms);
3856 
3857 extern HAMLIB_EXPORT(int) rig_set_vfo_opt(RIG *rig, int status);
3858 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);
3859 extern HAMLIB_EXPORT(int) rig_get_rig_info(RIG *rig, char *response, int max_response_len);
3860 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);
3861 extern HAMLIB_EXPORT(int) rig_get_cache_freq(RIG *rig, vfo_t vfo, freq_t *freq, int * cache_ms_freq);
3862 
3863 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);
3864 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);
3865 
3866 typedef unsigned long rig_useconds_t;
3867 extern HAMLIB_EXPORT(int) hl_usleep(rig_useconds_t msec);
3868 
3869 extern HAMLIB_EXPORT(int) rig_cookie(RIG *rig, enum cookie_e cookie_cmd, char *cookie, int cookie_len);
3870 
3871 extern HAMLIB_EXPORT(int) rig_password(RIG *rig, const char *key1);
3872 extern HAMLIB_EXPORT(void) rig_password_generate_secret(char *pass,
3873  char result[HAMLIB_SECRET_LENGTH + 1]);
3874 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);
3875 
3876 extern HAMLIB_EXPORT(int)
3877 longlat2locator HAMLIB_PARAMS((double longitude,
3878  double latitude,
3879  char *locator_res,
3880  int pair_count));
3881 
3882 extern HAMLIB_EXPORT(int)
3883 locator2longlat HAMLIB_PARAMS((double *longitude,
3884  double *latitude,
3885  const char *locator));
3886 
3887 extern HAMLIB_EXPORT(char*) rig_make_md5(char *pass);
3888 
3889 extern HAMLIB_EXPORT(int) rig_set_lock_mode(RIG *rig, int lock);
3890 extern HAMLIB_EXPORT(int) rig_get_lock_mode(RIG *rig, int *lock);
3891 
3892 extern HAMLIB_EXPORT(int) rig_is_model(RIG *rig, rig_model_t model);
3893 
3894 extern HAMLIB_EXPORT(char*) rig_date_strget(char *buf, int buflen, int localtime);
3895 
3896 enum GPIO { GPIO1, GPIO2, GPIO3, GPIO4 };
3897 extern HAMLIB_EXPORT(int) rig_cm108_get_bit(hamlib_port_t *p, enum GPIO gpio, int *bit);
3898 extern HAMLIB_EXPORT(int) rig_cm108_set_bit(hamlib_port_t *p, enum GPIO gpio, int bit);
3899 extern HAMLIB_EXPORT(int) rig_band_changed(RIG *rig, hamlib_bandselect_t band);
3900 
3901 extern HAMLIB_EXPORT(void *) rig_data_pointer(RIG *rig, rig_ptrx_t idx);
3902 
3904 
3905 __END_DECLS
3906 
3907 #endif /* _RIG_H */
3908 
Definition: rig.h:719
const char * rig_strstatus(enum rig_status_e status)
Convert enum RIG_STATUS_... to printable string.
Definition: misc.c:427
rig_port_t port_type
Definition: rig.h:2836
Definition: rig.h:789
scan_t rig_has_scan(RIG *rig, scan_t scan)
check availability of scanning functions
Definition: rig.c:7134
setting_t funcs
Definition: rig.h:1636
Definition: rig.h:709
enum serial_handshake_e serial_handshake
Definition: rig.h:2842
int multicast_data_port
Definition: rig.h:2878
int rig_get_cache_freq(RIG *rig, vfo_t vfo, freq_t *freq, int *cache_ms_freq_p)
get cached values for a VFO
Definition: cache.c:549
hamlib_token_t token
Definition: rig.h:899
int rig_get_mem(RIG *rig, vfo_t vfo, int *ch)
get the current memory channel number
Definition: mem.c:131
int rig_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status)
get the status of functions of the radio
Definition: settings.c:585
vfo_cb_t vfo_event
Definition: rig.h:3070
int auto_power_on
Definition: rig.h:2782
rig_debug_level_e
Hamlib debug levels.
Definition: rig.h:239
struct rig_callbacks callbacks
Definition: rig.h:3097
double vfo_comp
Definition: rig.h:2916
value_t step
Definition: rig.h:1730
int rig_get_ext_level(RIG *rig, vfo_t vfo, hamlib_token_t token, value_t *val)
get the value of a level extra parameter
Definition: settings.c:716
Definition: rig.h:784
unsigned tuning_step
Definition: rig.h:1633
const char * rig_strspectrummode(enum rig_spectrum_mode_e mode)
Convert enum RIG_SPECTRUM_MODE_... to alpha string.
Definition: misc.c:1811
Definition: rig.h:1142
unsigned channel_desc
Definition: rig.h:1644
Definition: rig.h:1168
vfo_op_t vfo_ops
Definition: rig.h:2853
Definition: rig.h:663
Definition: rig.h:788
unsigned tx_vfo
Definition: rig.h:1630
int rig_set_uplink(RIG *rig, int val)
For GPredict to avoid reading frequency on uplink VFO.
Definition: rig.c:1901
setting_t rig_has_get_level(RIG *rig, setting_t level)
check retrieval ability of level settings
Definition: settings.c:309
Definition: rig.h:444
setting_t has_set_func
Definition: rig.h:2741
struct ext_list * ext_levels
Definition: rig.h:1602
hamlib_bandselect_t
Definition: rig.h:792
int raw
Definition: rig.h:1745
int rig_set_dcd_callback(RIG *rig, dcd_cb_t cb, rig_ptr_t arg)
set the callback for dcd events
Definition: event.c:491
double freq_t
Frequency type,.
Definition: rig.h:454
Definition: rig.h:241
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)
get cached values for a VFO
Definition: cache.c:310
int rig_get_dcd(RIG *rig, vfo_t vfo, dcd_t *dcd)
get the status of the DCD
Definition: rig.c:4189
value_t min
Definition: rig.h:1728
int use_cached_mode
Definition: rig.h:3013
rig_ptr_t spectrum_arg
Definition: rig.h:3079
shortfreq_t max_ifshift
Definition: rig.h:2932
unsigned bank_num
Definition: rig.h:1618
Definition: rig.h:666
int rig_set_dcs_code(RIG *rig, vfo_t vfo, tone_t code)
set the current encoding DCS code
Definition: tones.c:230
Filter definition.
Definition: rig.h:1522
vfo_t tx_vfo
Definition: rig.h:2768
float f
Definition: rig.h:1026
int rig_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan)
set channel data
Definition: mem.c:684
int rig_set_vfo(RIG *rig, vfo_t vfo)
set the current VFO
Definition: rig.c:3283
scan_t
Rig Scan operation.
Definition: rig.h:841
Definition: rig.h:669
float step
Definition: rig.h:909
int rig_get_rig_info(RIG *rig, char *response, int max_response_len)
get freq/mode/width for requested VFO
Definition: rig.c:7911
Definition: rig.h:1148
shortfreq_t xit
Definition: rig.h:1592
void rig_debug(enum rig_debug_level_e debug_level, const char *fmt,...)
Print debugging messages through stderr by default.
Definition: debug.c:206
Definition: rig.h:773
Definition: rig.h:1668
Definition: rig.h:793
dcd_type_t dcd_type
Definition: rig.h:2835
uint32_t rig_model_t
Convenience type definition for rig model.
Definition: riglist.h:707
Definition: rig.h:364
int chan_desc_sz
Definition: rig.h:2857
unsigned tx_width
Definition: rig.h:1627
pbwidth_t tx_width
Definition: rig.h:1583
Definition: rig.h:749
char tag[32]
Definition: rig.h:1604
Definition: rig.h:692
Definition: rig.h:317
int low_power
Definition: rig.h:1459
Definition: rig.h:1675
Definition: rig.h:1139
hamlib_port_t_deprecated rigport_deprecated
Definition: rig.h:2713
hamlib_port_t_deprecated dcdport_deprecated
Definition: rig.h:2715
int rig_set_mem_all_cb(RIG *rig, vfo_t vfo, chan_cb_t chan_cb, confval_cb_t parm_cb, rig_ptr_t arg)
set all channel and non-channel data by call-back
Definition: mem.c:1326
FILE * rig_set_debug_file(FILE *stream)
Change the output stream from stderr a different stream.
Definition: debug.c:334
freq_range_t rx_range_list[HAMLIB_FRQRANGESIZ]
Definition: rig.h:2919
rig_ptr_t priv
Definition: rig.h:2958
const char * dflt
Definition: rig.h:903
void rig_get_debug(enum rig_debug_level_e *debug_level)
Get the current debug level.
Definition: debug.c:160
int rig_send_morse(RIG *rig, vfo_t vfo, const char *msg)
send morse code
Definition: rig.c:7392
const char * cs
Definition: rig.h:1028
rig_ptr_t pltune_arg
Definition: rig.h:3077
int serial_data_bits
Definition: rig.h:2839
int rig_ext_level_foreach(RIG *rig, int(*cfunc)(RIG *, const struct confparams *, rig_ptr_t), rig_ptr_t data)
Executes cfunc on all the elements stored in the extlevels table.
Definition: ext.c:132
int transaction_active
Definition: rig.h:2755
int rig_mW2power(RIG *rig, float *power, unsigned int mwpower, freq_t freq, rmode_t mode)
conversion utility from absolute in mW to relative range
Definition: rig.c:6706
Deprecated Rig state containing live data and customized fields. Due to DLL problems this remains in-...
Definition: rig.h:2902
freq_t endf
Definition: rig.h:1457
powerstat_t powerstat
Definition: rig.h:2818
int twiddle_timeout
Definition: rig.h:2976
shortfreq_t max_ifshift
Definition: rig.h:2733
gran_t level_gran[64]
Definition: rig.h:2946
Definition: rig.h:191
pbwidth_t rig_passband_wide(RIG *rig, rmode_t mode)
get the wide passband of a mode
Definition: rig.c:3224
freq_range_t rx_range_list1[HAMLIB_FRQRANGESIZ]
Definition: rig.h:2858
int uplink
Definition: rig.h:2779
gran_t level_gran[64]
Definition: rig.h:2747
vfo_t vfo
Definition: rig.h:1575
Definition: rig.h:333
const char * model_name
Definition: rig.h:2828
Definition: rig.h:418
unsigned rptr_offs
Definition: rig.h:1632
const char * rig_strlevel(setting_t level)
Convert enum RIG_LEVEL_... to alpha string.
Definition: misc.c:1179
Definition: rig.h:198
int rig_set_bank(RIG *rig, vfo_t vfo, int bank)
set the current memory bank
Definition: mem.c:194
hamlib_token_t rig_token_lookup(RIG *rig, const char *name)
lookup a token id
Definition: conf.c:1439
int ptt_share
Definition: rig.h:2988
int rig_scan(RIG *rig, vfo_t vfo, scan_t scan, int ch)
perform Memory/VFO operations
Definition: rig.c:7167
int freq_skip
Definition: rig.h:2888
Definition: rig.h:416
const struct confparams * rig_ext_lookup_tok(RIG *rig, hamlib_token_t token)
lookup ext token, return pointer to confparams struct.
Definition: ext.c:279
Definition: rig.h:807
Definition: rig.h:678
int rig_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
get the frequency of the target VFO
Definition: rig.c:2407
int rig_power2mW(RIG *rig, unsigned int *mwpower, float power, freq_t freq, rmode_t mode)
conversion utility from relative range to absolute in mW
Definition: rig.c:6632
rig_parm_e
Rig Parameters.
Definition: rig.h:1134
struct cal_table::@3 table[HAMLIB_MAX_CAL_LENGTH]
Tuning step definition.
Definition: rig.h:1487
hamlib_token_t rig_ext_token_lookup(RIG *rig, const char *name)
Simple lookup returning token id associated with name.
Definition: ext.c:324
Definition: rig.h:415
int rig_get_xit(RIG *rig, vfo_t vfo, shortfreq_t *xit)
get the current XIT offset
Definition: rig.c:6227
setting_t rig_has_set_level(RIG *rig, setting_t level)
check settable ability of level settings
Definition: settings.c:339
vfo_op_t rig_has_vfo_op(RIG *rig, vfo_op_t op)
check retrieval ability of VFO operations
Definition: rig.c:7022
int rig_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt)
set PTT on/off
Definition: rig.c:3533
Definition: rig.h:881
pbwidth_t current_width
Definition: rig.h:2966
int rig_set_trn(RIG *rig, int trn)
control the transceive mode
Definition: event.c:582
int rig_ext_func_foreach(RIG *rig, int(*cfunc)(RIG *, const struct confparams *, rig_ptr_t), rig_ptr_t data)
Executes cfunc on all the elements stored in the extfuncs table.
Definition: ext.c:82
Frequency range.
Definition: rig.h:1455
ann_t announces
Definition: rig.h:2735
Calibration table struct for float values.
Definition: rig.h:1772
hamlib_port_t dcdport
Definition: rig.h:3008
Definition: rig.h:786
Definition: rig.h:203
double signal_strength_min
Definition: rig.h:1850
Definition: rig.h:189
const char * rig_strparm(setting_t parm)
Convert enum RIG_PARM_... to alpha string.
Definition: misc.c:1353
Definition: rig.h:314
powerstat_t
Radio power state.
Definition: rig.h:706
Definition: network.c:145
time_t twiddle_time
Definition: rig.h:2975
int lock_mode
Definition: rig.h:2817
Definition: rig.h:886
Definition: rig.h:192
int startc
Definition: rig.h:1694
rig_model_t rig_model
Definition: rig.h:2827
Definition: rig.h:320
value_t levels[64]
Definition: rig.h:1594
int vfo_list
Definition: rig.h:2757
double signal_strength_max
Definition: rig.h:1851
int rig_set_pltune_callback(RIG *rig, pltune_cb_t cb, rig_ptr_t arg)
set the callback for pipelined tuning module
Definition: event.c:521
Definition: rig.h:785
signed long shortfreq_t
Short frequency type.
Definition: rig.h:476
vfo_t rx_vfo
Definition: rig.h:2995
int async_data_enabled
Definition: rig.h:2961
chan_type_t rig_parse_mtype(const char *s)
Convert alpha string to enum RIG_MTYPE_...
Definition: misc.c:1746
struct filter_list filters[HAMLIB_FLTLSTSIZ]
Definition: rig.h:2725
unsigned flags
Definition: rig.h:1643
setting_t has_get_func
Definition: rig.h:2740
signed int i
Definition: rig.h:1024
Definition: rig.h:1821
pbwidth_t current_width
Definition: rig.h:2767
setting_t has_get_parm
Definition: rig.h:2744
int poll_interval
Definition: rig.h:2962
Definition: rig.h:368
Definition: rig.h:319
Definition: rig.h:1141
const chan_t * rig_lookup_mem_caps(RIG *rig, int ch)
lookup the memory type and capabilities
Definition: mem.c:1587
freq_t freq
Definition: rig.h:1577
setting_t rig_has_set_func(RIG *rig, setting_t func)
check ability of radio functions
Definition: settings.c:457
void rig_set_debug(enum rig_debug_level_e debug_level)
Change the current debug level.
Definition: debug.c:147
setting_t has_get_parm
Definition: rig.h:2943
freq_range_t tx_range_list[HAMLIB_FRQRANGESIZ]
Definition: rig.h:2721
int use_cached_mode
Definition: rig.h:2814
Definition: rig.h:417
rig_ptr_t ptt_arg
Definition: rig.h:3073
powerstat_t powerstat
Definition: rig.h:3017
uint64_t rig_idx2setting(int i)
Definition: misc.c:798
freq_t center_freq
Definition: rig.h:1855
hamlib_port_t pttport
Definition: rig.h:3007
int rig_set_conf(RIG *rig, hamlib_token_t token, const char *val)
set a radio configuration parameter
Definition: conf.c:1470
rig_ptr_t obj
Definition: rig.h:2959
int power_max
Definition: rig.h:2792
setting_t has_set_level
Definition: rig.h:2942
int comm_state
Definition: rig.h:2957
int rig_set_vfo_callback(RIG *rig, vfo_cb_t cb, rig_ptr_t arg)
set the callback for vfo events
Definition: event.c:435
setting_t rig_parse_func(const char *s)
Convert alpha string to enum RIG_FUNC_...
Definition: misc.c:810
pbwidth_t width
Definition: rig.h:1579
Definition: rig.h:810
rmode_t mode
Definition: rig.h:1578
Definition: rig.h:850
shortfreq_t tuning_step
Definition: rig.h:1590
freq_t current_freq
Definition: rig.h:2764
freq_range_t tx_range_list2[HAMLIB_FRQRANGESIZ]
Definition: rig.h:2861
int rig_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)
get the current antenna
Definition: rig.c:6539
int rig_probe_all(hamlib_port_t *port, rig_probe_func_t cfunc, rig_ptr_t data)
try to guess rigs
Definition: rig.c:6993
float val
Definition: rig.h:1776
int auto_power_off
Definition: rig.h:2983
Definition: rig.h:445
freq_t startf
Definition: rig.h:1456
Definition: rig.h:681
int post_ptt_delay
Definition: rig.h:2886
int rig_send_dtmf(RIG *rig, vfo_t vfo, const char *digits)
send DTMF digits
Definition: rig.c:7239
serial_handshake_e
Serial handshake.
Definition: rig.h:341
int high_power
Definition: rig.h:1460
Definition: rig.h:699
Definition: rig.h:930
struct confparams::@0::@2 c
int rig_set_split_mode(RIG *rig, vfo_t vfo, rmode_t tx_mode, pbwidth_t tx_width)
set the split modes
Definition: rig.c:5023
Definition: rig.h:342
struct tuning_step_list tuning_steps[HAMLIB_TSLSTSIZ]
Definition: rig.h:2922
int rig_set_func(RIG *rig, vfo_t vfo, setting_t func, int status)
activate/de-activate functions of radio
Definition: settings.c:488
Definition: rig.h:363
unsigned vfo
Definition: rig.h:1619
Definition: rig.h:696
unsigned mode
Definition: rig.h:1622
const char * rig_strvfo(vfo_t vfo)
Convert enum RIG_VFO_... to alpha string.
Definition: misc.c:670
shortfreq_t pbwidth_t
Definition: rig.h:646
int ptt_share
Definition: rig.h:2789
Definition: rig.h:318
Spectrum scope.
Definition: rig.h:1807
Definition: rig.h:321
Spectrum scope averaging modes.
Definition: rig.h:1827
Definition: rig.h:207
int rig_set_freq_callback(RIG *rig, freq_cb_t cb, rig_ptr_t arg)
set the callback for freq events
Definition: event.c:379
Channel capability definition.
Definition: rig.h:1617
Definition: rig.h:1136
int bank_qty
Definition: rig.h:2856
Definition: rig.h:204
int rig_set_ctcss_sql(RIG *rig, vfo_t vfo, tone_t tone)
set CTCSS squelch
Definition: tones.c:364
Definition: rig.h:679
shortfreq_t rig_get_resolution(RIG *rig, rmode_t mode)
get the best frequency resolution of the rig
Definition: rig.c:6771
Channel structure.
Definition: rig.h:1572
Definition: rig.h:365
Definition: rig.h:711
ann_t announces
Definition: rig.h:2934
Definition: rig.h:1671
vfo_op_t
VFO operation.
Definition: rig.h:748
Definition: rig.h:756
rptr_shift_t
Repeater shift type.
Definition: rig.h:433
Definition: rig.h:353
int size
Definition: rig.h:1743
Definition: rig.h:1820
int power_now
Definition: rig.h:2790
Definition: rig.h:887
const char * rig_license()
get the Hamlib license
Definition: rig.c:8157
Definition: rig.h:843
int serial_rate_min
Definition: rig.h:2837
int rig_wait_morse(RIG *rig, vfo_t vfo)
wait morse code
Definition: rig.c:7597
setting_t has_set_parm
Definition: rig.h:2944
int rig_setting2idx(setting_t s)
basically convert setting_t expressed 2^n to n
Definition: settings.c:971
rig_spectrum_mode_e
Spectrum scope modes.
Definition: rig.h:1816
unsigned int u
Definition: rig.h:1025
Definition: rig.h:818
const char * rig_strfunc(setting_t func)
Convert enum RIG_FUNC_... to alpha string.
Definition: misc.c:886
int rig_set_vfo_opt(RIG *rig, int status)
set the vfo option for rigctld
Definition: rig.c:7805
Extension attribute definition.
Definition: rig.h:1555
Definition: rig.h:652
struct rig_spectrum_scope spectrum_scopes[HAMLIB_MAX_SPECTRUM_SCOPES]
Definition: rig.h:2868
gran_t parm_gran[64]
Definition: rig.h:2947
rmode_t mode_list
Definition: rig.h:2968
Definition: rig.h:208
const char * rig_get_caps_cptr(rig_model_t rig_model, enum rig_caps_cptr_e rig_caps)
Function to return char pointer value from rig->caps.
Definition: misc.c:2702
int rig_set_xit(RIG *rig, vfo_t vfo, shortfreq_t xit)
set the XIT
Definition: rig.c:6155
setting_t rig_has_get_parm(RIG *rig, setting_t parm)
check retrieval ability of parameter settings
Definition: settings.c:369
freq_range_t rx_range_list5[HAMLIB_FRQRANGESIZ]
Definition: rig.h:2866
int async_data_supported
Definition: rig.h:2848
enum serial_parity_e serial_parity
Definition: rig.h:2841
Universal approach for passing values.
Definition: rig.h:1023
Definition: rig.h:194
Definition: rig.h:882
hamlib_port_t_deprecated pttport_deprecated
Definition: rig.h:2913
Definition: rig.h:698
int rig_get_split_mode(RIG *rig, vfo_t vfo, rmode_t *tx_mode, pbwidth_t *tx_width)
get the current split modes
Definition: rig.c:5261
char * multicast_cmd_addr
Definition: rig.h:2879
const char * rig_strptrshift(rptr_shift_t shift)
convert enum RIG_RPT_SHIFT_... to printable character
Definition: misc.c:1675
int twiddle_rit
Definition: rig.h:2794
vfo_t rig_parse_vfo(const char *s)
Convert alpha string to enum RIG_VFO_...
Definition: misc.c:641
Definition: rig.h:800
freq_range_t tx_range_list1[HAMLIB_FRQRANGESIZ]
Definition: rig.h:2859
const char * rig_strscan(scan_t rscan)
Convert enum RIG_SCAN_... to alpha string.
Definition: misc.c:1646
freq_t offset_vfob
Definition: rig.h:3021
setting_t has_set_parm
Definition: rig.h:2745
vfo_t tx_vfo
Definition: rig.h:2967
Definition: rig.h:751
int vfo_opt
Definition: rig.h:2980
int rig_get_ext_func(RIG *rig, vfo_t vfo, hamlib_token_t token, int *status)
get the value of a function extra parameter
Definition: settings.c:847
const freq_range_t * rig_get_range(const freq_range_t *range_list, freq_t freq, rmode_t mode)
find the freq_range of freq/mode
Definition: rig.c:7769
freq_range_t tx_range_list5[HAMLIB_FRQRANGESIZ]
Definition: rig.h:2867
vfo_t current_vfo
Definition: rig.h:2955
freq_range_t rx_range_list2[HAMLIB_FRQRANGESIZ]
Definition: rig.h:2860
unsigned ant
Definition: rig.h:1620
freq_cb_t freq_event
Definition: rig.h:3066
ptt_type_t ptt_type
Definition: rig.h:2834
setting_t has_get_func
Definition: rig.h:2939
vfo_t current_vfo
Definition: rig.h:2756
rig_ptr_t dcd_arg
Definition: rig.h:3075
int auto_power_off
Definition: rig.h:2784
Definition: rig.h:774
int rig_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt)
get the status of the PTT
Definition: rig.c:3864
hamlib_port_t pttport
Definition: rig.h:2808
The Rig structure.
Definition: rig.h:3093
int write_delay
Definition: rig.h:2843
dcd_type_t
DCD type.
Definition: rig.h:661
struct multicast_s * multicast
Definition: rig.h:2823
Definition: rig.h:775
int rig_reset(RIG *rig, reset_t reset)
reset the radio
Definition: rig.c:6920
rmode_t modes
Definition: rig.h:1458
int rig_set_clock(RIG *rig, int year, int month, int day, int hour, int min, int sec, double msec, int utc_offset)
set the rig&#39;s clock
Definition: rig.c:8118
pltune_cb_t pltune
Definition: rig.h:3076
Definition: rig.h:367
unsigned char disable_yaesu_bandselect
Definition: rig.h:2992
tone_t dcs_code
Definition: rig.h:1597
char * s
Definition: rig.h:1027
Definition: rig.h:206
Definition: rig.h:814
int rig_get_conf(RIG *rig, hamlib_token_t token, char *val)
get the value of a configuration parameter
Definition: conf.c:1531
Definition: rig.h:811
int raw
Definition: rig.h:1775
freq_t offset_vfob
Definition: rig.h:2822
setting_t rig_has_set_parm(RIG *rig, setting_t parm)
check settable ability of parameter settings
Definition: settings.c:398
struct tuning_step_list tuning_steps[HAMLIB_TSLSTSIZ]
Definition: rig.h:2723
unsigned tag
Definition: rig.h:1646
meter_level_e
Level display meters.
Definition: rig.h:1004
chan_type_t
Memory channel type definition.
Definition: rig.h:1665
setting_t has_set_level
Definition: rig.h:2743
Definition: rig.h:240
spectrum_cb_t spectrum_event
Definition: rig.h:3078
Definition: rig.h:668
const char * rig_stragclevel(enum agc_level_e level)
Convert enum RIG_AGC_... to alpha string.
Definition: misc.c:1429
int channel_num
Definition: rig.h:1573
setting_t rig_has_get_func(RIG *rig, setting_t func)
check ability of radio functions
Definition: settings.c:427
Definition: rig.h:362
rig_status_e
Development status of the backend.
Definition: rig.h:413
Definition: rig.h:787
Definition: rig.h:316
Definition: rig.h:1672
const char * rig_copyright()
get the Hamlib copyright
Definition: rig.c:8177
rig_comm_status_t comm_status
Definition: rig.h:2883
const struct confparams * rig_confparam_lookup(RIG *rig, const char *name)
lookup a confparam struct
Definition: conf.c:1369
Definition: rig.h:812
Definition: rig.h:434
char * multicast_data_addr
Definition: rig.h:2877
struct rig_state_deprecated state_deprecated
Definition: rig.h:3096
Definition: rig.h:201
setting_t has_get_level
Definition: rig.h:2941
Definition: rig.h:1143
Definition: rig.h:200
shortfreq_t max_rit
Definition: rig.h:2731
Definition: rig.h:1670
Definition: rig.h:797
char * tuner_control_pathname
Definition: rig.h:3018
Definition: rig.h:721
Definition: rig.h:1673
rmode_t modes
Definition: rig.h:1488
scan_t rig_parse_scan(const char *s)
Convert alpha string to enum RIG_SCAN_...
Definition: misc.c:1621
int rig_set_chan_all(RIG *rig, vfo_t vfo, const channel_t chans[])
set all channel data
Definition: mem.c:1167
Definition: rig.h:371
rig_function_e
Rig data structure.
Definition: rig.h:2215
Definition: rig.h:651
shortfreq_t max_rit
Definition: rig.h:2930
int rig_set_mem(RIG *rig, vfo_t vfo, int ch)
set the current memory channel number
Definition: mem.c:68
int rig_get_ext_parm(RIG *rig, hamlib_token_t token, value_t *val)
get the value of a parm extra parameter
Definition: settings.c:944
struct rig_state state
Definition: rig.h:3099
Definition: rig.h:246
int poll_interval
Definition: rig.h:2763
Definition: rig.h:693
Definition: rig.h:384
int post_write_delay
Definition: rig.h:2844
Definition: rig.h:761
unsigned split
Definition: rig.h:1629
freq_range_t rx_range_list4[HAMLIB_FRQRANGESIZ]
Definition: rig.h:2864
int rig_open(RIG *rig)
open the communication to the rig
Definition: rig.c:927
Definition: rig.h:925
Definition: rig.h:1169
unsigned rit
Definition: rig.h:1634
int rig_get_dcs_sql(RIG *rig, vfo_t vfo, tone_t *code)
get the current DCS code
Definition: tones.c:558
agc_level_e
AGC delay settings.
Definition: rig.h:379
int vfo_list
Definition: rig.h:2956
int transmit
Definition: rig.h:2772
int rig_set_mem_all(RIG *rig, vfo_t vfo, const channel_t chans[], const struct confparams cfgps[], const value_t vals[])
set all channel and non-channel data
Definition: mem.c:1460
enum rig_status_e status
Definition: rig.h:2832
Definition: rig.h:752
Definition: rig.h:723
void rig_set_debug_time_stamp(int flag)
Enable or disable the time stamp on debugging output.
Definition: debug.c:190
tone_t * ctcss_list
Definition: rig.h:2851
Rig state containing live data and customized fields.
Definition: rig.h:2704
vfo_t rx_vfo
Definition: rig.h:2796
Definition: rig.h:664
int rig_need_debug(enum rig_debug_level_e debug_level)
Test if a given debug level is active.
Definition: debug.c:176
shortfreq_t rit
Definition: rig.h:1591
Definition: rig.h:781
Definition: rig.h:804
Definition: rig.h:754
Definition: rig.h:779
Definition: rig.h:929
Definition: rig.h:193
hamlib_port_t rigport
Definition: rig.h:3006
int transceive
Definition: rig.h:2855
int rig_set_mode_callback(RIG *rig, mode_cb_t cb, rig_ptr_t arg)
set the callback for mode events
Definition: event.c:407
int rig_set_ext_func(RIG *rig, vfo_t vfo, hamlib_token_t token, int status)
set a radio function extra parameter
Definition: settings.c:781
time_t twiddle_time
Definition: rig.h:2776
Definition: rig.h:722
Definition: rig.h:243
Definition: rig.h:848
struct rig_caps * caps
Definition: rig.h:3094
Definition: rig.h:707
freq_range_t rx_range_list[HAMLIB_FRQRANGESIZ]
Definition: rig.h:2720
int twiddle_state
Definition: rig.h:2994
freq_range_t tx_range_list4[HAMLIB_FRQRANGESIZ]
Definition: rig.h:2865
Definition: rig.h:1170
ann_t
Announce.
Definition: rig.h:923
int rig_get_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t *rptr_shift)
get the current repeater shift
Definition: rig.c:4412
multicast_item_e
Multicast data items 3 different data item can be included in the multicast JSON. ...
Definition: rig.h:1177
int rig_cleanup(RIG *rig)
release a rig handle and free associated memory
Definition: rig.c:1833
RIG * rig_init(rig_model_t rig_model)
Allocate a new RIG handle.
Definition: rig.c:524
int rig_set_chan_all_cb(RIG *rig, vfo_t vfo, chan_cb_t chan_cb, rig_ptr_t arg)
set all channel data, by callback
Definition: mem.c:1079
Definition: rig.h:884
pbwidth_t rig_passband_normal(RIG *rig, rmode_t mode)
get the normal passband of a mode
Definition: rig.c:3120
Definition: rig.h:202
Definition: rig.h:369
Definition: rig.h:782
Definition: winpthreads.h:123
int use_cached_ptt
Definition: rig.h:2815
setting_t rig_parse_parm(const char *s)
Convert alpha string to RIG_PARM_...
Definition: misc.c:1303
unsigned xit
Definition: rig.h:1635
int serial_rate_max
Definition: rig.h:2838
int targetable_vfo
Definition: rig.h:2847
int rig_set_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t rptr_shift)
set the repeater shift
Definition: rig.c:4334
Definition: rig.h:311
Definition: rig.h:435
#define RIG_SETTING_MAX
Maximum # of rig settings.
Definition: rig.h:1205
unsigned int ant_t
Antenna typedef.
Definition: rig.h:980
int rig_get_mem_all_cb(RIG *rig, vfo_t vfo, chan_cb_t chan_cb, confval_cb_t parm_cb, rig_ptr_t arg)
get all channel and non-channel data by call-back
Definition: mem.c:1394
char * label
Definition: rig.h:1463
setting_t rig_parse_level(const char *s)
Convert alpha string to enum RIG_LEVEL_...
Definition: misc.c:1098
int rig_set_twiddle(RIG *rig, int seconds)
timeout (secs) to stop rigctld when VFO is manually changed
Definition: rig.c:1877
Definition: rig.h:801
const char * name
Definition: rig.h:900
int scan_group
Definition: rig.h:1599
rig_ptr_t mode_arg
Definition: rig.h:3069
int rig_set_parm(RIG *rig, setting_t parm, value_t val)
set a radio parameter
Definition: settings.c:241
Definition: rig.h:795
int rig_flush_force(hamlib_port_t *port, int flush_async_data)
Force flush of rig communication data buffers.
Definition: misc.c:2265
Definition: rig.h:315
reset_t
Reset operation.
Definition: rig.h:718
int rig_get_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t *rptr_offs)
get the current repeater offset
Definition: rig.c:4573
int rig_send_voice_mem(RIG *rig, vfo_t vfo, int ch)
send voice memory content
Definition: rig.c:7662
int depth
Definition: rig.h:3015
int rig_get_chan_all_cb(RIG *rig, vfo_t vfo, chan_cb_t chan_cb, rig_ptr_t arg)
get all channel data, by callback
Definition: mem.c:1126
Definition: rig.h:205
int rig_get_vfo_info(RIG *rig, vfo_t vfo, freq_t *freq, rmode_t *mode, pbwidth_t *width, split_t *split, int *satmode)
get freq/mode/width for requested VFO
Definition: rig.c:8018
int rig_set_spectrum_callback(RIG *rig, spectrum_cb_t cb, rig_ptr_t arg)
set the callback for spectrum line reception events
Definition: event.c:549
Definition: rig.h:332
uint64_t rig_level_e
Rig Level Settings.
Definition: rig.h:1046
Definition: rig.h:1146
freq_range_t tx_range_list[HAMLIB_FRQRANGESIZ]
Definition: rig.h:2920
rig_errcode_e
Definition: rig.h:187
int use_cached_freq
Definition: rig.h:2813
Definition: rig.h:783
int deprecated_itu_region
Definition: rig.h:2918
Definition: rig.h:1135
Rig cache data.
Definition: rig.h:2587
int rig_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
Definition: rig.c:2952
int rig_get_vfo_list(RIG *rig, char *buf, int buflen)
get list of available vfos
Definition: rig.c:8099
Hamlib rig(radio) model definitions.
rig_conf_e
parameter types
Definition: rig.h:880
Definition: rig.h:755
int power_now
Definition: rig.h:2989
Definition: rig.h:806
rmode_t mode_list
Definition: rig.h:2769
enum rig_port_e rig_port_t
Port type.
setting_t levels
Definition: rig.h:1637
rmode_t tx_mode
Definition: rig.h:1582
int rig_set_ptt_callback(RIG *rig, ptt_cb_t cb, rig_ptr_t arg)
set the callback for ptt events
Definition: event.c:463
int rig_set_dcs_sql(RIG *rig, vfo_t vfo, tone_t code)
set the current DCS code
Definition: tones.c:495
unsigned ctcss_tone
Definition: rig.h:1638
ptt_type_t
PTT type.
Definition: rig.h:690
int rig_get_split_freq_mode(RIG *rig, vfo_t vfo, freq_t *tx_freq, rmode_t *tx_mode, pbwidth_t *tx_width)
get the current split frequency and mode
Definition: rig.c:5567
Definition: rig.h:883
setting_t funcs
Definition: rig.h:1593
Definition: rig.h:802
int uplink
Definition: rig.h:2978
int rig_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option)
set the antenna
Definition: rig.c:6459
hamlib_band_t
Band enumeration.
Definition: rig.h:772
Definition: rig.h:354
int rig_recv_dtmf(RIG *rig, vfo_t vfo, char *digits, int *length)
receive DTMF digits
Definition: rig.c:7316
int timeout
Definition: rig.h:2845
Calibration table struct.
Definition: rig.h:1742
Definition: rig.h:927
Definition: rig.h:188
Definition: rig.h:817
serial_parity_e
Serial parity.
Definition: rig.h:329
const char * hamlib_copyright2
Hamlib copyright notice.
Definition: rig.c:112
int vfo_opt
Definition: rig.h:2781
int longlat2locator(double longitude, double latitude, char *locator, int pair_count)
Convert longitude/latitude to QRA locator (Maidenhead grid square).
Definition: locator.c:545
int rig_get_parm(RIG *rig, setting_t parm, value_t *val)
get the value of a parameter
Definition: settings.c:275
freq_t spectrum_spans[HAMLIB_MAX_SPECTRUM_SPANS]
Definition: rig.h:2870
freq_t low_edge_freq
Definition: rig.h:1858
int id
Definition: rig.h:1846
Definition: rig.h:750
int size
Definition: rig.h:1773
freq_t high_edge_freq
Definition: rig.h:1859
gran_t parm_gran[64]
Definition: rig.h:2748
tone_t ctcss_tone
Definition: rig.h:1595
value_t val
Definition: rig.h:1557
int rig_get_chan_all(RIG *rig, vfo_t vfo, channel_t chans[])
get all channel data
Definition: mem.c:1210
setting_t has_get_level
Definition: rig.h:2742
Definition: rig.h:197
int rig_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo)
get the current split mode
Definition: rig.c:5906
Definition: rig.h:778
Definition: rig.h:372
int rig_get_ctcss_sql(RIG *rig, vfo_t vfo, tone_t *tone)
get the current CTCSS squelch
Definition: tones.c:432
shortfreq_t ts
Definition: rig.h:1489
Definition: rig.h:924
const char * rig_strrmode(rmode_t mode)
Convert enum RIG_MODE to alpha string.
Definition: misc.c:540
int power_min
Definition: rig.h:2990
hamlib_port_t rigport
Definition: rig.h:2807
int rig_set_ext_parm(RIG *rig, hamlib_token_t token, value_t val)
set a radio parm extra parameter
Definition: settings.c:912
Definition: rig.h:1868
Definition: rig.h:816
int auto_disable_screensaver
Definition: rig.h:2786
int rig_set_split_freq_mode(RIG *rig, vfo_t vfo, freq_t tx_freq, rmode_t tx_mode, pbwidth_t tx_width)
set the split frequency and mode
Definition: rig.c:5425
unsigned tx_mode
Definition: rig.h:1626
int rig_get_powerstat(RIG *rig, powerstat_t *status)
get the on/off status of the radio
Definition: rig.c:6865
pbwidth_t width
Definition: rig.h:1524
freq_t span_freq
Definition: rig.h:1856
freq_t offset_vfoa
Definition: rig.h:3020
enum rig_spectrum_mode_e spectrum_modes[HAMLIB_MAX_SPECTRUM_MODES]
Definition: rig.h:2869
rmode_t current_mode
Definition: rig.h:2964
int rig_set_split_vfo(RIG *rig, vfo_t rx_vfo, split_t split, vfo_t tx_vfo)
set the split mode
Definition: rig.c:5655
enum rig_spectrum_mode_e spectrum_mode
Definition: rig.h:1853
Definition: rig.h:1144
hamlib_port_t_deprecated port_t_deprecated
Port definition.
Definition: rig.h:2499
int rig_get_trn(RIG *rig, int *trn)
get the current transceive mode
Definition: event.c:606
unsigned int flags
Definition: rig.h:1600
Definition: rig.h:815
freq_t lo_freq
Definition: rig.h:2775
unsigned rptr_shift
Definition: rig.h:1631
Definition: rig.h:147
int rig_stop_morse(RIG *rig, vfo_t vfo)
stop morse code
Definition: rig.c:7488
int rig_get_twiddle(RIG *rig, int *seconds)
get the twiddle timeout value (secs)
Definition: rig.c:1928
const char * version
Definition: rig.h:2830
int rig_get_ctcss_tone(RIG *rig, vfo_t vfo, tone_t *tone)
get the current CTCSS sub-tone frequency
Definition: tones.c:166
ant_t ant
Definition: rig.h:1576
Definition: rig.h:849
int use_cached_freq
Definition: rig.h:3012
const char * rig_strvfop(vfo_op_t op)
Convert enum RIG_OP_... to alpha string.
Definition: misc.c:1576
const char * rigerror2(int errnum)
get string describing the error code
Definition: rig.c:434
freq_t offset_vfoa
Definition: rig.h:2821
const char * combostr[RIG_COMBO_MAX]
Definition: rig.h:912
split_t
Split mode.
Definition: rig.h:443
Definition: rig.h:388
struct multicast_s * multicast
Definition: rig.h:3022
Definition: rig.h:777
int rig_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
set the frequency of the target VFO
Definition: rig.c:2059
chan_type_t type
Definition: rig.h:1696
Definition: rig.h:1145
Definition: rig.h:926
int transmit
Definition: rig.h:2971
int rig_get_split_freq(RIG *rig, vfo_t vfo, freq_t *tx_freq)
get the current split frequencies
Definition: rig.c:4846
Definition: rig.h:199
Callback functions and args for rig event.
Definition: rig.h:3065
int rig_stop_voice_mem(RIG *rig, vfo_t vfo)
stop sending voice memory
Definition: rig.c:7731
const char * tooltip
Definition: rig.h:902
Definition: rig.h:310
Definition: rig.h:757
Definition: rig.h:680
Definition: rig.h:389
Definition: rig.h:762
long hamlib_token_t
configuration token
Definition: rig.h:857
int rig_mem_count(RIG *rig)
get memory channel count
Definition: mem.c:1652
Memory channel list definition.
Definition: rig.h:1693
Definition: rig.h:312
int rig_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
set the mode of the target VFO
Definition: rig.c:2754
cookie_e
Rig Cookie enumerations.
Definition: rig.h:1167
unsigned ctcss_sql
Definition: rig.h:1639
Definition: rig.h:1140
level/parm granularity definition
Definition: rig.h:1727
Definition: rig.h:330
rig_model_t rig_probe(hamlib_port_t *port)
try to guess a rig
Definition: rig.c:6965
rig_caps_int_e
Enumeration of rig->caps values.
Definition: rig.h:2318
char * tuner_control_pathname
Definition: rig.h:2819
shortfreq_t rptr_offs
Definition: rig.h:1589
const char * rig_strcommstatus(rig_comm_status_t status)
Convert enum RIG_COMM_STATUS... to alpha string.
Definition: misc.c:2757
unsigned freq
Definition: rig.h:1621
ptt_t
PTT status.
Definition: rig.h:677
int data_level_max
Definition: rig.h:1849
float min
Definition: rig.h:907
char channel_desc[HAMLIB_MAXCHANDESC]
Definition: rig.h:1601
int rig_close(RIG *rig)
close the communication to the rig
Definition: rig.c:1654
struct cal_table_float::@4 table[HAMLIB_MAX_CAL_LENGTH]
int deprecated_itu_region
Definition: rig.h:2719
int bank_num
Definition: rig.h:1574
Definition: rig.h:1137
int doppler
Definition: rig.h:2876
int power_min
Definition: rig.h:2791
Definition: rig.h:808
char client_version[32]
Definition: rig.h:2820
Definition: rig.h:794
Definition: rig.h:1138
unsigned tx_freq
Definition: rig.h:1625
int twiddle_rit
Definition: rig.h:2993
rmode_t modes
Definition: rig.h:1523
unsigned dcs_code
Definition: rig.h:1640
Definition: rig.h:799
Definition: rig.h:803
enum agc_level_e rig_levelagcvalue(int agcValue)
Convert a value to agc_level_e – constrains the range.
Definition: misc.c:1474
struct freq_range_list freq_range_t
Frequency range.
Definition: rig.h:331
Definition: rig.h:244
dcd_e
Definition: rig.h:650
Definition: rig.h:667
int retry
Definition: rig.h:2846
rig_type_t
Rig type flags.
Definition: rig.h:361
rmode_t rig_parse_mode(const char *s)
Convert alpha string to enum RIG_MODE.
Definition: misc.c:513
struct rig_spectrum_avg_mode spectrum_avg_modes[HAMLIB_MAX_SPECTRUM_AVG_MODES]
Definition: rig.h:2871
Definition: rig.h:759
unsigned int vfo_t
VFO definition.
Definition: rig.h:514
Definition: rig.h:1674
int rig_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
get the value of a level
Definition: settings.c:153
freq_range_t rx_range_list3[HAMLIB_FRQRANGESIZ]
Definition: rig.h:2862
int rig_set_ext_level(RIG *rig, vfo_t vfo, hamlib_token_t token, value_t val)
set a radio level extra parameter
Definition: settings.c:650
unsigned width
Definition: rig.h:1623
Definition: rig.h:813
ptt_cb_t ptt_event
Definition: rig.h:3072
Definition: rig.h:1667
freq_t current_freq
Definition: rig.h:2963
Definition: rig.h:662
rptr_shift_t rig_parse_rptr_shift(const char *s)
Convert alpha char to enum RIG_RPT_SHIFT_...
Definition: misc.c:1700
Definition: rig.h:758
struct confparams::@0::@1 n
Definition: rig.h:697
hamlib_port_t_deprecated dcdport_deprecated
Definition: rig.h:2914
enum rig_conf_e type
Definition: rig.h:904
Definition: rig.h:242
vfo_t vfo
Definition: rig.h:1461
Definition: rig.h:196
int preamp[HAMLIB_MAXDBLSTSIZ]
Definition: rig.h:2737
Definition: rig.h:1819
int locator2longlat(double *longitude, double *latitude, const char *locator)
Convert QRA locator (Maidenhead grid square) to Longitude/Latitude.
Definition: locator.c:451
int agc_level_count
Definition: rig.h:2849
Definition: rig.h:776
int rig_get_mem_all(RIG *rig, vfo_t vfo, channel_t chans[], const struct confparams cfgps[], value_t vals[])
get all channel and non-channel data
Definition: mem.c:1528
int rig_get_dcs_code(RIG *rig, vfo_t vfo, tone_t *code)
get the current encoding DCS code
Definition: tones.c:293
freq_range_t tx_range_list3[HAMLIB_FRQRANGESIZ]
Definition: rig.h:2863
const char * rig_strmtype(chan_type_t mtype)
Convert enum RIG_MTYPE_... to alpha string.
Definition: misc.c:1771
int rig_get_channel(RIG *rig, vfo_t vfox, channel_t *chan, int read_only)
get channel data
Definition: mem.c:828
Definition: rig.h:805
int data_level_min
Definition: rig.h:1848
freq_t tx_freq
Definition: rig.h:1581
vfo_t tx_vfo
Definition: rig.h:1586
mode_cb_t mode_event
Definition: rig.h:3068
vprintf_cb_t rig_set_debug_callback(vprintf_cb_t cb, rig_ptr_t arg)
Set callback to handle debugging messages.
Definition: debug.c:316
int async_data_enabled
Definition: rig.h:2762
rig_ptr_t freq_arg
Definition: rig.h:3067
Definition: rig.h:760
int endc
Definition: rig.h:1695
Definition: rig.h:344
void * rig_get_function_ptr(rig_model_t rig_model, enum rig_function_e rig_function)
Function to return pointer to rig_* function.
Definition: misc.c:2364
enum agc_level_e agc_levels[HAMLIB_MAX_AGC_LEVELS]
Definition: rig.h:2850
tone_t * dcs_list
Definition: rig.h:2852
Definition: rig.h:694
size_t spectrum_data_length
Definition: rig.h:1861
Definition: rig.h:195
tone_t dcs_sql
Definition: rig.h:1598
Definition: rig.h:1669
int rig_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
set a radio level setting
Definition: settings.c:73
cal_table_t str_cal
Definition: rig.h:2926
Definition: rig.h:1875
int auto_disable_screensaver
Definition: rig.h:2985
int transaction_active
Definition: rig.h:2954
uint64_t setting_t
Setting.
Definition: rig.h:1199
int twiddle_state
Definition: rig.h:2795
int twiddle_timeout
Definition: rig.h:2777
Definition: rig.h:809
Definition: rig.h:796
cal_table_t str_cal
Definition: rig.h:2727
dcd_cb_t dcd_event
Definition: rig.h:3074
Definition: rig.h:928
rig_ptr_t vfo_arg
Definition: rig.h:3071
int serial_stop_bits
Definition: rig.h:2840
Definition: rig.h:845
int lock_mode
Definition: rig.h:3016
Definition: rig.h:846
rig_ptr_t obj
Definition: rig.h:2760
struct filter_list filters[HAMLIB_FLTLSTSIZ]
Definition: rig.h:2924
Definition: rig.h:885
unsigned ext_levels
Definition: rig.h:1645
Multicast data items the are unique per rig instantiation This is meant for internal Hamlib use only...
Definition: rig.h:2666
split_t split
Definition: rig.h:1585
Definition: rig.h:414
Definition: rig.h:209
unsigned char * spectrum_data
Definition: rig.h:1862
Definition: rig.h:190
freq_t lo_freq
Definition: rig.h:2974
int rig_cookie(RIG *rig, enum cookie_e cookie_cmd, char *cookie, int cookie_len)
get a cookie to grab rig control
Definition: rig.c:8206
serial_control_state_e
Serial control state.
Definition: rig.h:351
int auto_power_on
Definition: rig.h:2981
int rig_get_clock(RIG *rig, int *year, int *month, int *day, int *hour, int *min, int *sec, double *msec, int *utc_offset)
get the rig&#39;s clock
Definition: rig.c:8136
unsigned char disable_yaesu_bandselect
Definition: rig.h:2793
int dual_watch
Definition: rig.h:2885
Definition: rig.h:436
const char * mfg_name
Definition: rig.h:2829
setting_t has_set_func
Definition: rig.h:2940
pbwidth_t rig_passband_narrow(RIG *rig, rmode_t mode)
get the narrow passband of a mode
Definition: rig.c:3171
int rig_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op)
perform Memory/VFO operations
Definition: rig.c:7051
char client_version[32]
Definition: rig.h:3019
shortfreq_t max_xit
Definition: rig.h:2732
Definition: rig.h:753
Definition: rig.h:352
Definition: rig.h:366
Definition: rig.h:710
enum agc_level_e rig_levelagcstr(const char *agcString)
Convert AGC string... to agc_level_e.
Definition: misc.c:1505
Definition: rig.h:780
value_t max
Definition: rig.h:1729
uint64_t rig_get_caps_int(rig_model_t rig_model, enum rig_caps_int_e rig_caps)
Function to return int value from rig->caps Does not support > 32-bit rig_caps values.
Definition: misc.c:2656
int multicast_cmd_port
Definition: rig.h:2880
shortfreq_t max_xit
Definition: rig.h:2931
unsigned scan_group
Definition: rig.h:1642
Definition: network.c:131
Definition: rig.h:1147
int rig_get_ts(RIG *rig, vfo_t vfo, shortfreq_t *ts)
get the current Tuning Step
Definition: rig.c:6377
int rig_token_foreach(RIG *rig, int(*cfunc)(const struct confparams *, rig_ptr_t), rig_ptr_t data)
call a function against each configuration token of a rig
Definition: conf.c:1307
Definition: rig.h:708
Definition: rig.h:720
int spectrum_attenuator[HAMLIB_MAXDBLSTSIZ]
Definition: rig.h:2872
Definition: rig.h:1149
int rig_set_powerstat(RIG *rig, powerstat_t status)
turn on/off the radio
Definition: rig.c:6813
Definition: rig.h:343
scan_t scan_ops
Definition: rig.h:2854
Configuration parameter structure.
Definition: rig.h:898
uint64_t rmode_t
Radio mode.
Definition: rig.h:1357
tone_t ctcss_sql
Definition: rig.h:1596
int rig_set_ts(RIG *rig, vfo_t vfo, shortfreq_t ts)
set the Tuning Step
Definition: rig.c:6305
Definition: rig.h:670
Definition: rig.h:309
Definition: rig.h:322
int rig_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t rptr_offs)
set the repeater offset
Definition: rig.c:4496
Definition: rig.h:842
Definition: rig.h:334
const char * label
Definition: rig.h:901
int rig_type
Definition: rig.h:2833
int val
Definition: rig.h:1746
int rig_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit)
set the RIT
Definition: rig.c:6005
Definition: rig.h:691
Definition: rig.h:819
union confparams::@0 u
ant_t ant
Definition: rig.h:1462
const char * copyright
Definition: rig.h:2831
hamlib_port_t_deprecated rigport_deprecated
Definition: rig.h:2912
Definition: rig.h:798
int rig_set_ctcss_tone(RIG *rig, vfo_t vfo, tone_t tone)
set CTCSS sub-tone frequency
Definition: tones.c:98
value_t rig_valueagclevel(enum agc_level_e agcLevel)
Convert a enum agc_level_e to value.
Definition: misc.c:1454
int rig_ext_parm_foreach(RIG *rig, int(*cfunc)(RIG *, const struct confparams *, rig_ptr_t), rig_ptr_t data)
Executes cfunc on all the elements stored in the extparms table.
Definition: ext.c:182
rig_port_e
Port type.
Definition: rig.h:308
int rig_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq)
set the split frequencies
Definition: rig.c:4656
Definition: rig.h:313
Definition: rig.h:245
hamlib_port_t dcdport
Definition: rig.h:2809
int preamp[HAMLIB_MAXDBLSTSIZ]
Definition: rig.h:2936
channel_cap_t mem_caps
Definition: rig.h:1697
int rig_get_rit(RIG *rig, vfo_t vfo, shortfreq_t *rit)
get the current RIT offset
Definition: rig.c:6077
int depth
Definition: rig.h:2816
hamlib_port_t_deprecated pttport_deprecated
Definition: rig.h:2714
Definition: rig.h:665
rig_ptr_t priv
Definition: rig.h:2759
Definition: rig.h:1818
Definition: rig.h:1676
const struct confparams * rig_ext_lookup(RIG *rig, const char *name)
lookup ext token by its name, return pointer to confparams struct.
Definition: ext.c:232
int comm_state
Definition: rig.h:2758
const char * rig_get_info(RIG *rig)
get general information from the radio
Definition: rig.c:7844
Definition: rig.h:1666
float max
Definition: rig.h:908
int rig_get_vfo(RIG *rig, vfo_t *vfo)
get the current VFO
Definition: rig.c:3430
Represents a single line of rig spectrum scope FFT data.
Definition: rig.h:1844
vfo_op_t rig_parse_vfo_op(const char *s)
Convert alpha string to enum RIG_OP_...
Definition: misc.c:1551
rmode_t current_mode
Definition: rig.h:2765
Definition: rig.h:820
unsigned dcs_sql
Definition: rig.h:1641
Definition: rig.h:695
int attenuator[HAMLIB_MAXDBLSTSIZ]
Definition: rig.h:2738
Definition: rig.h:370
int attenuator[HAMLIB_MAXDBLSTSIZ]
Definition: rig.h:2937
rptr_shift_t rptr_shift
Definition: rig.h:1588
int power_max
Definition: rig.h:2991
const char * rig_version()
get the Hamlib version
Definition: rig.c:8167
Definition: rig.h:847
double vfo_comp
Definition: rig.h:2717
int use_cached_ptt
Definition: rig.h:3014
hamlib_token_t token
Definition: rig.h:1556
int rig_strrmodes(rmode_t modes, char *buf, int buflen)
Convert RIG_MODE or&#39;d value to alpha string of all modes.
Definition: misc.c:572
Definition: rig.h:844