Hamlib  4.5.3
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 
23 
24 #ifndef _RIG_H
25 #define _RIG_H 1
26 
27 #define BUILTINFUNC 0
28 
29 // Our shared secret password
30 #define HAMLIB_SECRET_LENGTH 32
31 
32 #define HAMLIB_TRACE rig_debug(RIG_DEBUG_TRACE,"%s(%d) trace\n", __FILE__, __LINE__)
33 #define __FILENAME__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
34 
35 #include <stdio.h>
36 #include <stdarg.h>
37 #include <string.h>
38 #include <inttypes.h>
39 #include <time.h>
40 
41 // For MSVC install the NUGet pthread package
42 #if defined(_MSC_VER)
43 #define HAVE_STRUCT_TIMESPEC
44 #endif
45 #include <pthread.h>
46 
47 /* Rig list is in a separate file so as not to mess up w/ this one */
48 #include <hamlib/riglist.h>
49 
63 /* __BEGIN_DECLS should be used at the beginning of your declarations,
64  * so that C++ compilers don't mangle their names. Use __END_DECLS at
65  * the end of C declarations. */
67 #undef __BEGIN_DECLS
68 #undef __END_DECLS
69 #ifdef __cplusplus
70 # define __BEGIN_DECLS extern "C" {
71 # define __END_DECLS }
72 #else
73 # define __BEGIN_DECLS /* empty */
74 # define __END_DECLS /* empty */
75 #endif
77 
78 /* HAMLIB_PARAMS is a macro used to wrap function prototypes, so that compilers
79  * that don't understand ANSI C prototypes still work, and ANSI C
80  * compilers can issue warnings about type mismatches. */
82 #undef HAMLIB_PARAMS
83 #if defined (__STDC__) \
84  || defined (_AIX) \
85  || (defined (__mips) && defined (_SYSTYPE_SVR4)) \
86  || defined(__CYGWIN__) \
87  || defined(_WIN32) \
88  || defined(__cplusplus)
89 # define HAMLIB_PARAMS(protos) protos
90 # define rig_ptr_t void *
91 # define amp_ptr_t void *
92 #else
93 # define HAMLIB_PARAMS(protos) ()
94 # define rig_ptr_t char *
95 # define amp_ptr_t char *
96 #endif
98 
99 #include <hamlib/rig_dll.h>
100 
101 #ifndef SWIGLUA
103 #define CONSTANT_64BIT_FLAG(BIT) (1ull << (BIT))
105 #else
106 /* SWIG's older Lua generator doesn't grok ull due to Lua using a
107  double-precision floating point type internally for number
108  representations (max 53 bits of precision) so makes a string
109  constant from a constant number literal using ull */
110 // #define CONSTANT_64BIT_FLAG(BIT) (1 << (BIT))
111 // #define SWIGLUAHIDE
112 /* But this appears to have been fixed so we'll use the correct one now
113  If you have the older version of SWIG comment out this line and use
114  the two above */
115 // This 1ul definition works on swig 4.0.1 and lua 5.3.5
116 #define CONSTANT_64BIT_FLAG(BIT) (1ul << (BIT))
117 #endif
118 
119 __BEGIN_DECLS
120 
125 // cookie is 26-char time code plus 10-char (2^31-1) random number
126 #define HAMLIB_COOKIE_SIZE 37
127 extern int cookie_use; // this is global as once one client requests it everybody needs to honor it
128 
130 extern HAMLIB_EXPORT_VAR(const char) hamlib_version[];
131 extern HAMLIB_EXPORT_VAR(const char) hamlib_copyright[];
132 extern HAMLIB_EXPORT_VAR(const char *) hamlib_version2;
133 extern HAMLIB_EXPORT_VAR(const char *) hamlib_copyright2;
135 
147  RIG_OK = 0,
167  RIG_EPOWER,
168  RIG_EEND // MUST BE LAST ITEM IN LAST
169 };
179 #define RIG_IS_SOFT_ERRCODE(errcode) (errcode == RIG_EINVAL || errcode == RIG_ENIMPL || errcode == RIG_ERJCTED \
180  || errcode == RIG_ETRUNC || errcode == RIG_ENAVAIL || errcode == RIG_ENTARGET \
181  || errcode == RIG_EVFO || errcode == RIG_EDOM || errcode == RIG_EDEPRECATED \
182  || errcode == RIG_ESECURITY || errcode == RIG_EPOWER)
183 
187 #define NETRIGCTL_RET "RPRT "
188 
189 
205 };
206 
207 
208 /* --------------- Rig capabilities -----------------*/
209 
210 /* Forward struct references */
211 
212 struct rig;
213 struct rig_state;
214 
218 typedef struct s_rig RIG;
219 
221 #define HAMLIB_RIGNAMSIZ 30
222 #define HAMLIB_RIGVERSIZ 8
223 #define HAMLIB_FILPATHLEN 512
224 #define HAMLIB_FRQRANGESIZ 30
225 #define HAMLIB_MAXCHANDESC 30 /* describe channel eg: "WWV 5Mhz" */
226 #define HAMLIB_TSLSTSIZ 20 /* max tuning step list size, zero ended */
227 #define HAMLIB_FLTLSTSIZ 60 /* max mode/filter list size, zero ended */
228 #define HAMLIB_MAXDBLSTSIZ 8 /* max preamp/att levels supported, zero ended */
229 #define HAMLIB_CHANLSTSIZ 16 /* max mem_list size, zero ended */
230 #define HAMLIB_MAX_AGC_LEVELS 8 /* max AGC levels supported */
231 #define HAMLIB_MAX_SPECTRUM_SCOPES 4 /* max number of spectrum scopes supported */
232 #define HAMLIB_MAX_SPECTRUM_MODES 5 /* max number of spectrum modes supported */
233 #define HAMLIB_MAX_SPECTRUM_AVG_MODES 12 /* max number of spectrum averaging modes supported */
234 #define HAMLIB_MAX_SPECTRUM_SPANS 20 /* max number of spectrum modes supported */
235 #define HAMLIB_MAX_SPECTRUM_DATA 2048 /* max number of data bytes in a single spectrum line */
236 #define HAMLIB_MAX_CAL_LENGTH 32 /* max calibration plots in cal_table_t */
237 #define HAMLIB_MAX_MODES 63
238 #define HAMLIB_MAX_VFOS 31
239 #define HAMLIB_MAX_ROTORS 63
240 #define HAMLIB_MAX_VFO_OPS 31
241 #define HAMLIB_MAX_RSCANS 31
242 #define HAMLIB_MAX_SNAPSHOT_PACKET_SIZE 16384 /* maximum number of bytes in a UDP snapshot packet */
244 
245 
256 #define CTCSS_LIST_SIZE 60
257 #define DCS_LIST_SIZE 128
258 typedef unsigned int tone_t;
259 
260 
264 typedef enum rig_port_e {
280 
281 
291 };
292 
293 
301 };
302 
303 
311 };
312 
313 
317 typedef enum {
318  RIG_FLAG_RECEIVER = (1 << 1),
319  RIG_FLAG_TRANSMITTER = (1 << 2),
320  RIG_FLAG_SCANNER = (1 << 3),
321  RIG_FLAG_MOBILE = (1 << 4),
322  RIG_FLAG_HANDHELD = (1 << 5),
323  RIG_FLAG_COMPUTER = (1 << 6),
324  RIG_FLAG_TRUNKING = (1 << 7),
325  RIG_FLAG_APRS = (1 << 8),
326  RIG_FLAG_TNC = (1 << 9),
327  RIG_FLAG_DXCLUSTER = (1 << 10),
328  RIG_FLAG_TUNER = (1 << 11)
330 
334 /* TODO: kill me, and replace by real AGC delay */
336  RIG_AGC_OFF = 0,
337  RIG_AGC_SUPERFAST,
338  RIG_AGC_FAST,
339  RIG_AGC_SLOW,
341  RIG_AGC_MEDIUM,
342  RIG_AGC_AUTO,
343  RIG_AGC_LONG,
344  RIG_AGC_ON /*< Turns AGC ON -- Kenwood -- restores last level set */
345 };
346 
347 
349 #define RIG_FLAG_TRANSCEIVER (RIG_FLAG_RECEIVER|RIG_FLAG_TRANSMITTER)
350 #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)
351 
352 #define RIG_TYPE_OTHER 0
353 #define RIG_TYPE_TRANSCEIVER RIG_FLAG_TRANSCEIVER
354 #define RIG_TYPE_HANDHELD (RIG_FLAG_TRANSCEIVER|RIG_FLAG_HANDHELD)
355 #define RIG_TYPE_MOBILE (RIG_FLAG_TRANSCEIVER|RIG_FLAG_MOBILE)
356 #define RIG_TYPE_RECEIVER RIG_FLAG_RECEIVER
357 #define RIG_TYPE_PCRECEIVER (RIG_FLAG_COMPUTER|RIG_FLAG_RECEIVER)
358 #define RIG_TYPE_SCANNER (RIG_FLAG_SCANNER|RIG_FLAG_RECEIVER)
359 #define RIG_TYPE_TRUNKSCANNER (RIG_TYPE_SCANNER|RIG_FLAG_TRUNKING)
360 #define RIG_TYPE_COMPUTER (RIG_FLAG_TRANSCEIVER|RIG_FLAG_COMPUTER)
361 #define RIG_TYPE_TUNER RIG_FLAG_TUNER
363 
364 
374  /* RIG_STATUS_NEW * *!< Initial release of code
375  * !! Use of RIG_STATUS_NEW is deprecated. Do not use it anymore */
376 };
377 
382 #define RIG_STATUS_NEW RIG_STATUS_UNTESTED
383 
384 
388 typedef enum {
393 
394 
398 typedef enum {
400  RIG_SPLIT_ON
402 
403 
409 typedef double freq_t;
410 
414 #define PRIfreq ".0f"
415 
419 #define SCNfreq "lf"
423 #define FREQFMT SCNfreq
424 
425 
431 typedef signed long shortfreq_t;
432 
434 #define Hz(f) ((freq_t)(f))
436 #define kHz(f) ((freq_t)((f)*(freq_t)1000))
438 #define MHz(f) ((freq_t)((f)*(freq_t)1000000))
440 #define GHz(f) ((freq_t)((f)*(freq_t)1000000000))
441 
443 #define s_Hz(f) ((shortfreq_t)(f))
445 #define s_kHz(f) ((shortfreq_t)((f)*(shortfreq_t)1000))
447 #define s_MHz(f) ((shortfreq_t)((f)*(shortfreq_t)1000000))
449 #define s_GHz(f) ((shortfreq_t)((f)*(shortfreq_t)1000000000))
450 
452 #define RIG_FREQ_NONE Hz(0)
453 
454 
469 typedef unsigned int vfo_t;
470 
473 #define RIG_VFO_N(n) (1u<<(n))
474 
476 #define RIG_VFO_NONE 0
477 
479 #define RIG_VFO_A RIG_VFO_N(0)
480 
482 #define RIG_VFO_B RIG_VFO_N(1)
483 
485 #define RIG_VFO_C RIG_VFO_N(2)
486 
487 // Any addition VFOS need to go from 3-20
488 // To maintain backward compatibility these values cannot change
489 
491 #define RIG_VFO_SUB_A RIG_VFO_N(21)
492 
494 #define RIG_VFO_SUB_B RIG_VFO_N(22)
495 
497 #define RIG_VFO_SUB_C RIG_VFO_N(3)
498 
500 #define RIG_VFO_MAIN_A RIG_VFO_N(23)
501 
503 #define RIG_VFO_MAIN_B RIG_VFO_N(24)
504 
506 #define RIG_VFO_MAIN_C RIG_VFO_N(4)
507 
509 #define RIG_VFO_OTHER RIG_VFO_N(5)
510 
512 #define RIG_VFO_SUB RIG_VFO_N(25)
513 
515 #define RIG_VFO_MAIN RIG_VFO_N(26)
516 
518 #define RIG_VFO_VFO RIG_VFO_N(27)
519 
521 #define RIG_VFO_MEM RIG_VFO_N(28)
522 
524 #define RIG_VFO_CURR RIG_VFO_N(29)
525 
527 #define RIG_VFO_TX_FLAG RIG_VFO_N(30)
528 
530 #define RIG_VFO_ALL RIG_VFO_N(31)
531 
532 // we can also use RIG_VFO_N(31) if needed
533 
534 // Misc VFO Macros
535 
537 #define RIG_VFO_TX_VFO(v) ((v)|RIG_VFO_TX_FLAG)
538 
540 #define RIG_VFO_TX RIG_VFO_TX_VFO(RIG_VFO_CURR)
541 
543 #define RIG_VFO_RX RIG_VFO_CURR
544 
545 
546 /*
547  * targetable bitfields, for internal use.
548  * In rig.c lack of a flag will case a VFO change if needed
549  * So setting this flag will mean the backend handles any VFO needs
550  * For many rigs RITXIT, PTT, MEM, and BANK are non-VFO commands so need these flags to avoid unnecessary VFO swapping
551  */
553 #define RIG_TARGETABLE_NONE 0
554 #define RIG_TARGETABLE_FREQ (1<<0)
555 #define RIG_TARGETABLE_MODE (1<<1) // mode by vfo or same mode on both vfos
556 #define RIG_TARGETABLE_PURE (1<<2) // deprecated -- not used -- reuse it
557 #define RIG_TARGETABLE_TONE (1<<3)
558 #define RIG_TARGETABLE_FUNC (1<<4)
559 #define RIG_TARGETABLE_LEVEL (1<<5)
560 #define RIG_TARGETABLE_RITXIT (1<<6)
561 #define RIG_TARGETABLE_PTT (1<<7)
562 #define RIG_TARGETABLE_MEM (1<<8)
563 #define RIG_TARGETABLE_BANK (1<<9)
564 #define RIG_TARGETABLE_ANT (1<<10)
565 #define RIG_TARGETABLE_ROOFING (1<<11) // roofing filter targetable by VFO
566 #define RIG_TARGETABLE_SPECTRUM (1<<12) // spectrum scope targetable by VFO
567 #define RIG_TARGETABLE_BAND (1<<13) // Band select -- e.g. Yaeus BS command
568 #define RIG_TARGETABLE_COMMON (RIG_TARGETABLE_RITXIT | RIG_TARGETABLE_PTT | RIG_TARGETABLE_MEM | RIG_TARGETABLE_BANK)
569 #define RIG_TARGETABLE_ALL 0x7fffffff
571 //
572 //
573 // Newer Icoms like the 9700 and 910 have VFOA/B on both Main & Sub
574 // Compared to older rigs which have one or the other
575 // So we need to distinguish between them
577 #define VFO_HAS_A_B ((rig->state.vfo_list & (RIG_VFO_A|RIG_VFO_B)) == (RIG_VFO_A|RIG_VFO_B))
578 #define VFO_HAS_MAIN_SUB ((rig->state.vfo_list & (RIG_VFO_MAIN|RIG_VFO_SUB)) == (RIG_VFO_MAIN|RIG_VFO_SUB))
579 #define VFO_HAS_MAIN_SUB_ONLY ((!VFO_HAS_A_B) & VFO_HAS_MAIN_SUB)
580 #define VFO_HAS_MAIN_SUB_A_B_ONLY (VFO_HAS_A_B & VFO_HAS_MAIN_SUB)
581 #define VFO_HAS_A_B_ONLY (VFO_HAS_A_B & (!VFO_HAS_MAIN_SUB))
582 #define VFO_DUAL (RIG_VFO_MAIN_A|RIG_VFO_MAIN_B|RIG_VFO_SUB_A|RIG_VFO_SUB_B)
583 #define VFO_HAS_DUAL ((rig->state.vfo_list & VFO_DUAL) == VFO_DUAL)
585 
590 #define RIG_PASSBAND_NORMAL s_Hz(0)
591 
595 #define RIG_PASSBAND_NOCHANGE s_Hz(-1)
596 
602 
603 typedef float agc_time_t;
604 
605 typedef enum dcd_e {
607  RIG_DCD_ON
608 } dcd_t;
609 
610 
616 typedef enum {
626 } dcd_type_t;
627 
628 
632 typedef enum {
638 
639 
645 typedef enum {
655 } ptt_type_t;
656 
657 
661 typedef enum {
663  RIG_POWER_ON = (1 << 0),
664  RIG_POWER_STANDBY = (1 << 1),
665  RIG_POWER_OPERATE = (1 << 2),
666  RIG_POWER_UNKNOWN = (1 << 3)
668 
669 
673 typedef enum {
675  RIG_RESET_SOFT = (1 << 0),
676  RIG_RESET_VFO = (1 << 1),
677  RIG_RESET_MCALL = (1 << 2),
678  RIG_RESET_MASTER = (1 << 3)
680 
681 
697 typedef enum {
699  RIG_OP_CPY = (1 << 0),
700  RIG_OP_XCHG = (1 << 1),
701  RIG_OP_FROM_VFO = (1 << 2),
702  RIG_OP_TO_VFO = (1 << 3),
703  RIG_OP_MCL = (1 << 4),
704  RIG_OP_UP = (1 << 5),
705  RIG_OP_DOWN = (1 << 6),
706  RIG_OP_BAND_UP = (1 << 7),
707  RIG_OP_BAND_DOWN = (1 << 8),
708  RIG_OP_LEFT = (1 << 9),
709  RIG_OP_RIGHT = (1 << 10),
710  RIG_OP_TUNE = (1 << 11),
711  RIG_OP_TOGGLE = (1 << 12)
713 
721 typedef enum { // numbers here reflect the Yaesu values
732  RIG_BAND_6M = 10,
734  RIG_BAND_MW = 12,
739 } hamlib_band_t;
740 
741 
750 typedef enum {
752  RIG_SCAN_MEM = (1 << 0),
753  RIG_SCAN_SLCT = (1 << 1),
754  RIG_SCAN_PRIO = (1 << 2),
755  RIG_SCAN_PROG = (1 << 3),
756  RIG_SCAN_DELTA = (1 << 4),
757  RIG_SCAN_VFO = (1 << 5),
758  RIG_SCAN_PLT = (1 << 6),
759  RIG_SCAN_STOP = (1 << 7)
761 
762 
766 typedef long token_t;
767 
768 
770 #define RIG_CONF_END 0
772 
773 
787 /* strongly inspired from soundmodem. Thanks Thomas! */
795 };
796 
798 #define RIG_COMBO_MAX 16
799 #define RIG_BIN_MAX 80
801 
805 struct confparams {
807  const char *name;
808  const char *label;
809  const char *tooltip;
810  const char *dflt;
811  enum rig_conf_e type;
812  union {
813  struct {
814  float min;
815  float max;
816  float step;
817  } n;
818  struct {
819  const char *combostr[RIG_COMBO_MAX];
820  } c;
821  } u;
822 };
823 
824 
830 typedef enum {
833  RIG_ANN_FREQ = (1 << 0),
834  RIG_ANN_RXMODE = (1 << 1),
835  RIG_ANN_CW = (1 << 2),
836  RIG_ANN_ENG = (1 << 3),
837  RIG_ANN_JAP = (1 << 4)
839 
840 
887 typedef unsigned int ant_t;
888 
889 #define RIG_ANT_NONE 0
890 #define RIG_ANT_N(n) ((ant_t)1<<(n))
891 #define RIG_ANT_1 RIG_ANT_N(0)
892 #define RIG_ANT_2 RIG_ANT_N(1)
893 #define RIG_ANT_3 RIG_ANT_N(2)
894 #define RIG_ANT_4 RIG_ANT_N(3)
895 #define RIG_ANT_5 RIG_ANT_N(4)
896 
897 #define RIG_ANT_UNKNOWN RIG_ANT_N(30)
898 #define RIG_ANT_CURR RIG_ANT_N(31)
899 
900 #define RIG_ANT_MAX 32
901 
902 
904 #define RIG_AGC_LAST -1
906 
907 #if 1 // deprecated
911 enum meter_level_e {
912  RIG_METER_NONE = 0, /*< No display meter */
913  RIG_METER_SWR = (1 << 0), /*< Stationary Wave Ratio */
914  RIG_METER_COMP = (1 << 1), /*< Compression level */
915  RIG_METER_ALC = (1 << 2), /*< ALC */
916  RIG_METER_IC = (1 << 3), /*< IC */
917  RIG_METER_DB = (1 << 4), /*< DB */
918  RIG_METER_PO = (1 << 5), /*< Power Out */
919  RIG_METER_VDD = (1 << 6), /*< Final Amp Voltage */
920  RIG_METER_TEMP = (1 << 7) /*< Final Amp Temperature */
921 };
922 #endif
923 
924 
930 typedef union {
931  signed int i;
932  float f;
933  char *s;
934  const char *cs;
936  struct {
937  int l;
938  unsigned char *d; /* Pointer to data buffer */
939  } b;
941 } value_t;
942 
943 
952 typedef uint64_t rig_level_e;
953 #define RIG_LEVEL_NONE 0
954 #define RIG_LEVEL_PREAMP CONSTANT_64BIT_FLAG(0)
955 #define RIG_LEVEL_ATT CONSTANT_64BIT_FLAG(1)
956 #define RIG_LEVEL_VOXDELAY CONSTANT_64BIT_FLAG(2)
957 #define RIG_LEVEL_AF CONSTANT_64BIT_FLAG(3)
958 #define RIG_LEVEL_RF CONSTANT_64BIT_FLAG(4)
959 #define RIG_LEVEL_SQL CONSTANT_64BIT_FLAG(5)
960 #define RIG_LEVEL_IF CONSTANT_64BIT_FLAG(6)
961 #define RIG_LEVEL_APF CONSTANT_64BIT_FLAG(7)
962 #define RIG_LEVEL_NR CONSTANT_64BIT_FLAG(8)
963 #define RIG_LEVEL_PBT_IN CONSTANT_64BIT_FLAG(9)
964 #define RIG_LEVEL_PBT_OUT CONSTANT_64BIT_FLAG(10)
965 #define RIG_LEVEL_CWPITCH CONSTANT_64BIT_FLAG(11)
966 #define RIG_LEVEL_RFPOWER CONSTANT_64BIT_FLAG(12)
967 #define RIG_LEVEL_MICGAIN CONSTANT_64BIT_FLAG(13)
968 #define RIG_LEVEL_KEYSPD CONSTANT_64BIT_FLAG(14)
969 #define RIG_LEVEL_NOTCHF CONSTANT_64BIT_FLAG(15)
970 #define RIG_LEVEL_COMP CONSTANT_64BIT_FLAG(16)
971 #define RIG_LEVEL_AGC CONSTANT_64BIT_FLAG(17)
972 #define RIG_LEVEL_BKINDL CONSTANT_64BIT_FLAG(18)
973 #define RIG_LEVEL_BALANCE CONSTANT_64BIT_FLAG(19)
974 #define RIG_LEVEL_METER CONSTANT_64BIT_FLAG(20)
975 #define RIG_LEVEL_VOXGAIN CONSTANT_64BIT_FLAG(21)
976 #define RIG_LEVEL_ANTIVOX CONSTANT_64BIT_FLAG(22)
977 #define RIG_LEVEL_SLOPE_LOW CONSTANT_64BIT_FLAG(23)
978 #define RIG_LEVEL_SLOPE_HIGH CONSTANT_64BIT_FLAG(24)
979 #define RIG_LEVEL_BKIN_DLYMS CONSTANT_64BIT_FLAG(25)
982 #define RIG_LEVEL_RAWSTR CONSTANT_64BIT_FLAG(26)
983 //#define RIG_LEVEL_SQLSTAT CONSTANT_64BIT_FLAG(27) /*!< \c SQLSTAT -- SQL status, arg int (open=1/closed=0). Deprecated, use get_dcd instead */
984 #define RIG_LEVEL_SWR CONSTANT_64BIT_FLAG(28)
985 #define RIG_LEVEL_ALC CONSTANT_64BIT_FLAG(29)
986 #define RIG_LEVEL_STRENGTH CONSTANT_64BIT_FLAG(30)
987  /* RIG_LEVEL_BWC (1<<31) */
988 #define RIG_LEVEL_RFPOWER_METER CONSTANT_64BIT_FLAG(32)
989 #define RIG_LEVEL_COMP_METER CONSTANT_64BIT_FLAG(33)
990 #define RIG_LEVEL_VD_METER CONSTANT_64BIT_FLAG(34)
991 #define RIG_LEVEL_ID_METER CONSTANT_64BIT_FLAG(35)
993 #define RIG_LEVEL_NOTCHF_RAW CONSTANT_64BIT_FLAG(36)
994 #define RIG_LEVEL_MONITOR_GAIN CONSTANT_64BIT_FLAG(37)
995 #define RIG_LEVEL_NB CONSTANT_64BIT_FLAG(38)
996 #define RIG_LEVEL_RFPOWER_METER_WATTS CONSTANT_64BIT_FLAG(39)
997 #define RIG_LEVEL_SPECTRUM_MODE CONSTANT_64BIT_FLAG(40)
998 #define RIG_LEVEL_SPECTRUM_SPAN CONSTANT_64BIT_FLAG(41)
999 #define RIG_LEVEL_SPECTRUM_EDGE_LOW CONSTANT_64BIT_FLAG(42)
1000 #define RIG_LEVEL_SPECTRUM_EDGE_HIGH CONSTANT_64BIT_FLAG(43)
1001 #define RIG_LEVEL_SPECTRUM_SPEED CONSTANT_64BIT_FLAG(44)
1002 #define RIG_LEVEL_SPECTRUM_REF CONSTANT_64BIT_FLAG(45)
1003 #define RIG_LEVEL_SPECTRUM_AVG CONSTANT_64BIT_FLAG(46)
1004 #define RIG_LEVEL_SPECTRUM_ATT CONSTANT_64BIT_FLAG(47)
1005 #define RIG_LEVEL_TEMP_METER CONSTANT_64BIT_FLAG(48)
1006 #define RIG_LEVEL_BAND_SELECT CONSTANT_64BIT_FLAG(49)
1007 #define RIG_LEVEL_USB_AF CONSTANT_64BIT_FLAG(50)
1008 #define RIG_LEVEL_AGC_TIME CONSTANT_64BIT_FLAG(51)
1009 #define RIG_LEVEL_52 CONSTANT_64BIT_FLAG(52)
1010 #define RIG_LEVEL_53 CONSTANT_64BIT_FLAG(53)
1011 #define RIG_LEVEL_54 CONSTANT_64BIT_FLAG(54)
1012 #define RIG_LEVEL_55 CONSTANT_64BIT_FLAG(55)
1013 #define RIG_LEVEL_56 CONSTANT_64BIT_FLAG(56)
1014 #define RIG_LEVEL_57 CONSTANT_64BIT_FLAG(57)
1015 #define RIG_LEVEL_58 CONSTANT_64BIT_FLAG(58)
1016 #define RIG_LEVEL_59 CONSTANT_64BIT_FLAG(59)
1017 #define RIG_LEVEL_60 CONSTANT_64BIT_FLAG(60)
1018 #define RIG_LEVEL_61 CONSTANT_64BIT_FLAG(61)
1019 #define RIG_LEVEL_62 CONSTANT_64BIT_FLAG(62)
1020 #define RIG_LEVEL_63 CONSTANT_64BIT_FLAG(63)
1023 #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_AGC_TIME)
1024 
1025 #define RIG_LEVEL_READONLY_LIST (RIG_LEVEL_SWR|RIG_LEVEL_ALC|RIG_LEVEL_STRENGTH|RIG_LEVEL_RAWSTR|RIG_LEVEL_RFPOWER_METER|RIG_LEVEL_COMP_METER|RIG_LEVEL_VD_METER|RIG_LEVEL_ID_METER|RIG_LEVEL_RFPOWER_METER|RIG_LEVEL_RFPOWER_METER_WATTS)
1026 
1027 #define RIG_LEVEL_IS_FLOAT(l) ((l)&RIG_LEVEL_FLOAT_LIST)
1028 #define RIG_LEVEL_SET(l) ((l)&~RIG_LEVEL_READONLY_LIST)
1030 
1031 
1042  RIG_PARM_ANN = (1 << 0),
1043  RIG_PARM_APO = (1 << 1),
1044  RIG_PARM_BACKLIGHT = (1 << 2),
1045  RIG_PARM_BEEP = (1 << 4),
1046  RIG_PARM_TIME = (1 << 5),
1047  RIG_PARM_BAT = (1 << 6),
1048  RIG_PARM_KEYLIGHT = (1 << 7),
1050  RIG_PARM_AFIF = (1 << 9)
1051 };
1052 
1061 enum cookie_e {
1065 };
1066 
1072  RIG_MULTICAST_POLL, // hamlib will be polling the rig for all rig items
1073  RIG_MULTICAST_TRANSCEIVE, // transceive will be turned on and processed
1074  RIG_MULTICAST_SPECTRUM // spectrum data will be included
1075 };
1076 
1078 #define RIG_PARM_FLOAT_LIST (RIG_PARM_BACKLIGHT|RIG_PARM_BAT|RIG_PARM_KEYLIGHT)
1079 #define RIG_PARM_READONLY_LIST (RIG_PARM_BAT)
1080 
1081 #define RIG_PARM_IS_FLOAT(l) ((l)&RIG_PARM_FLOAT_LIST)
1082 #define RIG_PARM_SET(l) ((l)&~RIG_PARM_READONLY_LIST)
1084 
1091 typedef uint64_t setting_t;
1092 
1097 #define RIG_SETTING_MAX 64
1098 
1115 #define RIG_TRN_OFF 0
1116 #define RIG_TRN_RIG 1
1117 #define RIG_TRN_POLL 2
1118 
1119 
1128 /*
1129  * The C standard dictates that an enum constant is a 32 bit signed integer.
1130  * Setting a constant's bit 31 created a negative value that on amd64 had the
1131  * upper 32 bits set as well when assigned to the misc.c:rig_func_str structure.
1132  * This caused misc.c:rig_strfunc() to fail its comparison for RIG_FUNC_XIT
1133  * on amd64 (x86_64). To use bit 31 as an unsigned long, preprocessor macros
1134  * have been used instead as a 'const unsigned long' which cannot be used to
1135  * initialize the rig_func_str.func members. TNX KA6MAL, AC6SL. - N0NB
1136  */
1137 #define RIG_FUNC_NONE 0
1138 #define RIG_FUNC_FAGC CONSTANT_64BIT_FLAG (0)
1139 #define RIG_FUNC_NB CONSTANT_64BIT_FLAG (1)
1140 #define RIG_FUNC_COMP CONSTANT_64BIT_FLAG (2)
1141 #define RIG_FUNC_VOX CONSTANT_64BIT_FLAG (3)
1142 #define RIG_FUNC_TONE CONSTANT_64BIT_FLAG (4)
1143 #define RIG_FUNC_TSQL CONSTANT_64BIT_FLAG (5)
1144 #define RIG_FUNC_SBKIN CONSTANT_64BIT_FLAG (6)
1145 #define RIG_FUNC_FBKIN CONSTANT_64BIT_FLAG (7)
1146 #define RIG_FUNC_ANF CONSTANT_64BIT_FLAG (8)
1147 #define RIG_FUNC_NR CONSTANT_64BIT_FLAG (9)
1148 #define RIG_FUNC_AIP CONSTANT_64BIT_FLAG (10)
1149 #define RIG_FUNC_APF CONSTANT_64BIT_FLAG (11)
1150 #define RIG_FUNC_MON CONSTANT_64BIT_FLAG (12)
1151 #define RIG_FUNC_MN CONSTANT_64BIT_FLAG (13)
1152 #define RIG_FUNC_RF CONSTANT_64BIT_FLAG (14)
1153 #define RIG_FUNC_ARO CONSTANT_64BIT_FLAG (15)
1154 #define RIG_FUNC_LOCK CONSTANT_64BIT_FLAG (16)
1155 #define RIG_FUNC_MUTE CONSTANT_64BIT_FLAG (17)
1156 #define RIG_FUNC_VSC CONSTANT_64BIT_FLAG (18)
1157 #define RIG_FUNC_REV CONSTANT_64BIT_FLAG (19)
1158 #define RIG_FUNC_SQL CONSTANT_64BIT_FLAG (20)
1159 #define RIG_FUNC_ABM CONSTANT_64BIT_FLAG (21)
1160 #define RIG_FUNC_BC CONSTANT_64BIT_FLAG (22)
1161 #define RIG_FUNC_MBC CONSTANT_64BIT_FLAG (23)
1162 #define RIG_FUNC_RIT CONSTANT_64BIT_FLAG (24)
1163 #define RIG_FUNC_AFC CONSTANT_64BIT_FLAG (25)
1164 #define RIG_FUNC_SATMODE CONSTANT_64BIT_FLAG (26)
1165 #define RIG_FUNC_SCOPE CONSTANT_64BIT_FLAG (27)
1166 #define RIG_FUNC_RESUME CONSTANT_64BIT_FLAG (28)
1167 #define RIG_FUNC_TBURST CONSTANT_64BIT_FLAG (29)
1168 #define RIG_FUNC_TUNER CONSTANT_64BIT_FLAG (30)
1169 #define RIG_FUNC_XIT CONSTANT_64BIT_FLAG (31)
1170 #ifndef SWIGLUAHIDE
1171 /* Hide the top 32 bits from the old Lua binding as they can't be represented */
1172 #define RIG_FUNC_NB2 CONSTANT_64BIT_FLAG (32)
1173 #define RIG_FUNC_CSQL CONSTANT_64BIT_FLAG (33)
1174 #define RIG_FUNC_AFLT CONSTANT_64BIT_FLAG (34)
1175 #define RIG_FUNC_ANL CONSTANT_64BIT_FLAG (35)
1176 #define RIG_FUNC_BC2 CONSTANT_64BIT_FLAG (36)
1177 #define RIG_FUNC_DUAL_WATCH CONSTANT_64BIT_FLAG (37)
1178 #define RIG_FUNC_DIVERSITY CONSTANT_64BIT_FLAG (38)
1179 #define RIG_FUNC_DSQL CONSTANT_64BIT_FLAG (39)
1180 #define RIG_FUNC_SCEN CONSTANT_64BIT_FLAG (40)
1181 #define RIG_FUNC_SLICE CONSTANT_64BIT_FLAG (41)
1182 #define RIG_FUNC_TRANSCEIVE CONSTANT_64BIT_FLAG (42)
1183 #define RIG_FUNC_SPECTRUM CONSTANT_64BIT_FLAG (43)
1184 #define RIG_FUNC_SPECTRUM_HOLD CONSTANT_64BIT_FLAG (44)
1185 #define RIG_FUNC_SEND_MORSE CONSTANT_64BIT_FLAG (45)
1186 #define RIG_FUNC_SEND_VOICE_MEM CONSTANT_64BIT_FLAG (46)
1187 #define RIG_FUNC_OVF_STATUS CONSTANT_64BIT_FLAG (47)
1188 #define RIG_FUNC_BIT48 CONSTANT_64BIT_FLAG (48)
1189 #define RIG_FUNC_BIT49 CONSTANT_64BIT_FLAG (49)
1190 #define RIG_FUNC_BIT50 CONSTANT_64BIT_FLAG (50)
1191 #define RIG_FUNC_BIT51 CONSTANT_64BIT_FLAG (51)
1192 #define RIG_FUNC_BIT52 CONSTANT_64BIT_FLAG (52)
1193 #define RIG_FUNC_BIT53 CONSTANT_64BIT_FLAG (53)
1194 #define RIG_FUNC_BIT54 CONSTANT_64BIT_FLAG (54)
1195 #define RIG_FUNC_BIT55 CONSTANT_64BIT_FLAG (55)
1196 #define RIG_FUNC_BIT56 CONSTANT_64BIT_FLAG (56)
1197 #define RIG_FUNC_BIT57 CONSTANT_64BIT_FLAG (57)
1198 #define RIG_FUNC_BIT58 CONSTANT_64BIT_FLAG (58)
1199 #define RIG_FUNC_BIT59 CONSTANT_64BIT_FLAG (59)
1200 #define RIG_FUNC_BIT60 CONSTANT_64BIT_FLAG (60)
1201 #define RIG_FUNC_BIT61 CONSTANT_64BIT_FLAG (61)
1202 #define RIG_FUNC_BIT62 CONSTANT_64BIT_FLAG (62)
1203 #define RIG_FUNC_BIT63 CONSTANT_64BIT_FLAG (63)
1204 /* 63 is this highest bit number that can be used */
1205 #endif
1206 
1213 #define mW(p) ((int)(p))
1221 #define Watts(p) ((int)((p)*1000))
1228 #define W(p) Watts(p)
1229 #if 0 // deprecating kW macro as this doesn't make sense
1236 #define kW(p) ((int)((p)*1000000L))
1237 #endif
1238 
1239 
1249 typedef uint64_t rmode_t;
1250 
1251 #define RIG_MODE_NONE 0
1252 #define RIG_MODE_AM CONSTANT_64BIT_FLAG (0)
1253 #define RIG_MODE_CW CONSTANT_64BIT_FLAG (1)
1254 #define RIG_MODE_USB CONSTANT_64BIT_FLAG (2)
1255 #define RIG_MODE_LSB CONSTANT_64BIT_FLAG (3)
1256 #define RIG_MODE_RTTY CONSTANT_64BIT_FLAG (4)
1257 #define RIG_MODE_FM CONSTANT_64BIT_FLAG (5)
1258 #define RIG_MODE_WFM CONSTANT_64BIT_FLAG (6)
1259 #define RIG_MODE_CWR CONSTANT_64BIT_FLAG (7)
1260 #define RIG_MODE_RTTYR CONSTANT_64BIT_FLAG (8)
1261 #define RIG_MODE_AMS CONSTANT_64BIT_FLAG (9)
1262 #define RIG_MODE_PKTLSB CONSTANT_64BIT_FLAG (10)
1263 #define RIG_MODE_PKTUSB CONSTANT_64BIT_FLAG (11)
1264 #define RIG_MODE_PKTFM CONSTANT_64BIT_FLAG (12)
1265 #define RIG_MODE_ECSSUSB CONSTANT_64BIT_FLAG (13)
1266 #define RIG_MODE_ECSSLSB CONSTANT_64BIT_FLAG (14)
1267 #define RIG_MODE_FAX CONSTANT_64BIT_FLAG (15)
1268 #define RIG_MODE_SAM CONSTANT_64BIT_FLAG (16)
1269 #define RIG_MODE_SAL CONSTANT_64BIT_FLAG (17)
1270 #define RIG_MODE_SAH CONSTANT_64BIT_FLAG (18)
1271 #define RIG_MODE_DSB CONSTANT_64BIT_FLAG (19)
1272 #define RIG_MODE_FMN CONSTANT_64BIT_FLAG (21)
1273 #define RIG_MODE_PKTAM CONSTANT_64BIT_FLAG (22)
1274 #define RIG_MODE_P25 CONSTANT_64BIT_FLAG (23)
1275 #define RIG_MODE_DSTAR CONSTANT_64BIT_FLAG (24)
1276 #define RIG_MODE_DPMR CONSTANT_64BIT_FLAG (25)
1277 #define RIG_MODE_NXDNVN CONSTANT_64BIT_FLAG (26)
1278 #define RIG_MODE_NXDN_N CONSTANT_64BIT_FLAG (27)
1279 #define RIG_MODE_DCR CONSTANT_64BIT_FLAG (28)
1280 #define RIG_MODE_AMN CONSTANT_64BIT_FLAG (29)
1281 #define RIG_MODE_PSK CONSTANT_64BIT_FLAG (30)
1282 #define RIG_MODE_PSKR CONSTANT_64BIT_FLAG (31)
1283 #ifndef SWIGLUAHIDE
1284 /* hide the top 32 bits from the Lua binding as they will not work */
1285 #define RIG_MODE_DD CONSTANT_64BIT_FLAG (32)
1286 #define RIG_MODE_C4FM CONSTANT_64BIT_FLAG (33)
1287 #define RIG_MODE_PKTFMN CONSTANT_64BIT_FLAG (34)
1288 #define RIG_MODE_SPEC CONSTANT_64BIT_FLAG (35)
1289 #define RIG_MODE_CWN CONSTANT_64BIT_FLAG (36)
1290 #define RIG_MODE_IQ CONSTANT_64BIT_FLAG (37)
1291 #define RIG_MODE_ISBUSB CONSTANT_64BIT_FLAG (38)
1292 #define RIG_MODE_ISBLSB CONSTANT_64BIT_FLAG (39)
1293 #define RIG_MODE_BIT40 CONSTANT_64BIT_FLAG (40)
1294 #define RIG_MODE_BIT41 CONSTANT_64BIT_FLAG (41)
1295 #define RIG_MODE_BIT42 CONSTANT_64BIT_FLAG (42)
1296 #define RIG_MODE_BIT43 CONSTANT_64BIT_FLAG (43)
1297 #define RIG_MODE_BIT44 CONSTANT_64BIT_FLAG (44)
1298 #define RIG_MODE_BIT45 CONSTANT_64BIT_FLAG (45)
1299 #define RIG_MODE_BIT46 CONSTANT_64BIT_FLAG (46)
1300 #define RIG_MODE_BIT47 CONSTANT_64BIT_FLAG (47)
1301 #define RIG_MODE_BIT48 CONSTANT_64BIT_FLAG (48)
1302 #define RIG_MODE_BIT49 CONSTANT_64BIT_FLAG (49)
1303 #define RIG_MODE_BIT50 CONSTANT_64BIT_FLAG (50)
1304 #define RIG_MODE_BIT51 CONSTANT_64BIT_FLAG (51)
1305 #define RIG_MODE_BIT52 CONSTANT_64BIT_FLAG (52)
1306 #define RIG_MODE_BIT53 CONSTANT_64BIT_FLAG (53)
1307 #define RIG_MODE_BIT54 CONSTANT_64BIT_FLAG (54)
1308 #define RIG_MODE_BIT55 CONSTANT_64BIT_FLAG (55)
1309 #define RIG_MODE_BIT56 CONSTANT_64BIT_FLAG (56)
1310 #define RIG_MODE_BIT57 CONSTANT_64BIT_FLAG (57)
1311 #define RIG_MODE_BIT58 CONSTANT_64BIT_FLAG (58)
1312 #define RIG_MODE_BIT59 CONSTANT_64BIT_FLAG (59)
1313 #define RIG_MODE_BIT60 CONSTANT_64BIT_FLAG (60)
1314 #define RIG_MODE_BIT61 CONSTANT_64BIT_FLAG (61)
1315 #define RIG_MODE_BIT62 CONSTANT_64BIT_FLAG (62)
1316 #define RIG_MODE_TESTS_MAX CONSTANT_64BIT_FLAG (63)
1317 #define RIG_MODE_ALL (0xffffffff)
1318 #endif
1319 
1323 #define RIG_MODE_SSB (RIG_MODE_USB|RIG_MODE_LSB)
1324 
1328 #define RIG_MODE_ECSS (RIG_MODE_ECSSUSB|RIG_MODE_ECSSLSB)
1329 
1331 #define RIG_DBLST_END 0 /* end marker in a preamp/att level list */
1332 #define RIG_IS_DBLST_END(d) ((d)==0)
1334 
1335 
1342 typedef struct freq_range_list {
1350  char *label;
1352 
1354 #define RIG_FRNG_END {Hz(0),Hz(0),RIG_MODE_NONE,0,0,RIG_VFO_NONE}
1355 #define RIG_IS_FRNG_END(r) ((r).startf == Hz(0) && (r).endf == Hz(0))
1357 
1377 };
1378 
1380 #define RIG_TS_ANY 0
1381 #define RIG_TS_END {RIG_MODE_NONE, 0}
1382 #define RIG_IS_TS_END(t) ((t).modes == RIG_MODE_NONE && (t).ts == 0)
1384 
1385 
1409 struct filter_list {
1412 };
1414 #define RIG_FLT_ANY 0
1415 #define RIG_FLT_END {RIG_MODE_NONE, 0}
1416 #define RIG_IS_FLT_END(f) ((f).modes == RIG_MODE_NONE)
1417 #define DEBUGMSGSAVE_SIZE 24000
1419 
1420 
1424 #define RIG_CHFLAG_NONE 0
1428 #define RIG_CHFLAG_SKIP (1<<0)
1432 #define RIG_CHFLAG_DATA (1<<1)
1436 #define RIG_CHFLAG_PSKIP (1<<2)
1437 
1442 struct ext_list {
1445 };
1446 
1448 #define RIG_EXT_END {0, {.i=0}}
1449 #define RIG_IS_EXT_END(x) ((x).token == 0)
1451 
1459 struct channel {
1461  int bank_num;
1482  tone_t ctcss_tone;
1483  tone_t ctcss_sql;
1484  tone_t dcs_code;
1485  tone_t dcs_sql;
1487  unsigned int flags;
1488  char channel_desc[HAMLIB_MAXCHANDESC];
1489  struct ext_list
1491 };
1492 
1496 typedef struct channel channel_t;
1497 
1503 struct channel_cap {
1504  unsigned bank_num: 1;
1505  unsigned vfo: 1;
1506  unsigned ant: 1;
1507  unsigned freq: 1;
1508  unsigned mode: 1;
1509  unsigned width: 1;
1511  unsigned tx_freq: 1;
1512  unsigned tx_mode: 1;
1513  unsigned tx_width: 1;
1515  unsigned split: 1;
1516  unsigned tx_vfo: 1;
1517  unsigned rptr_shift: 1;
1518  unsigned rptr_offs: 1;
1519  unsigned tuning_step: 1;
1520  unsigned rit: 1;
1521  unsigned xit: 1;
1524  unsigned ctcss_tone: 1;
1525  unsigned ctcss_sql: 1;
1526  unsigned dcs_code: 1;
1527  unsigned dcs_sql: 1;
1528  unsigned scan_group: 1;
1529  unsigned flags: 1;
1530  unsigned channel_desc: 1;
1531  unsigned ext_levels: 1;
1532 };
1533 
1537 typedef struct channel_cap channel_cap_t;
1538 
1539 
1550 typedef enum {
1560 
1561 
1575 struct chan_list {
1576  int startc;
1577  int endc;
1581 };
1582 
1584 #define RIG_CHAN_END {0,0,RIG_MTYPE_NONE}
1585 #define RIG_IS_CHAN_END(c) ((c).type == RIG_MTYPE_NONE)
1587 
1591 #define RIG_MEM_CAPS_ALL -1
1592 
1596 typedef struct chan_list chan_t;
1597 
1598 
1610 struct gran {
1614 };
1615 
1619 typedef struct gran gran_t;
1620 
1621 
1625 struct cal_table {
1626  int size;
1627  struct {
1628  int raw;
1629  int val;
1630  } table[HAMLIB_MAX_CAL_LENGTH];
1631 };
1632 
1645 typedef struct cal_table cal_table_t;
1646 
1648 #define EMPTY_STR_CAL { 0, { { 0, 0 }, } }
1650 
1651 
1656  int size;
1657  struct {
1658  int raw;
1659  float val;
1660  } table[HAMLIB_MAX_CAL_LENGTH];
1661 };
1662 
1675 typedef struct cal_table_float cal_table_float_t;
1676 
1678 #define EMPTY_FLOAT_CAL { 0, { { 0, 0f }, } }
1679 
1680 typedef int (* chan_cb_t)(RIG *, vfo_t vfo, channel_t **, int, const chan_t *, rig_ptr_t);
1681 typedef int (* confval_cb_t)(RIG *,
1682  const struct confparams *,
1683  value_t *,
1684  rig_ptr_t);
1686 
1691 {
1692  int id;
1693  char *name;
1694 };
1695 
1700  RIG_SPECTRUM_MODE_NONE = 0,
1705 };
1706 
1711 {
1712  int id;
1713  char *name;
1714 };
1715 
1728 {
1729  int id;
1745  unsigned char *spectrum_data;
1746 };
1747 
1768 #define RIG_MODEL(arg) .rig_model=arg,.macro_name=#arg
1769 #define HAMLIB_CHECK_RIG_CAPS "HAMLIB_CHECK_RIG_CAPS"
1770 struct rig_caps {
1771  rig_model_t rig_model;
1772  const char *model_name;
1773  const char *mfg_name;
1774  const char *version;
1775  const char *copyright;
1776  enum rig_status_e status;
1778  int rig_type;
1779  ptt_type_t ptt_type;
1780  dcd_type_t dcd_type;
1781  rig_port_t port_type;
1783  int serial_rate_min;
1784  int serial_rate_max;
1785  int serial_data_bits;
1786  int serial_stop_bits;
1787  enum serial_parity_e serial_parity;
1788  enum serial_handshake_e serial_handshake;
1790  int write_delay;
1791  int post_write_delay;
1792  int timeout;
1793  int retry;
1795  setting_t has_get_func;
1796  setting_t has_set_func;
1797  setting_t has_get_level;
1798  setting_t has_set_level;
1799  setting_t has_get_parm;
1800  setting_t has_set_parm;
1802  gran_t level_gran[RIG_SETTING_MAX];
1803  gran_t parm_gran[RIG_SETTING_MAX];
1805  const struct confparams *extparms;
1806  const struct confparams *extlevels;
1807  const struct confparams *extfuncs;
1808  int *ext_tokens;
1810  tone_t *ctcss_list;
1811  tone_t *dcs_list;
1813  int preamp[HAMLIB_MAXDBLSTSIZ];
1814  int attenuator[HAMLIB_MAXDBLSTSIZ];
1815  shortfreq_t max_rit;
1816  shortfreq_t max_xit;
1817  shortfreq_t max_ifshift;
1819  int agc_level_count;
1820  enum agc_level_e agc_levels[HAMLIB_MAX_AGC_LEVELS];
1822  ann_t announces;
1824  vfo_op_t vfo_ops;
1825  scan_t scan_ops;
1826  int targetable_vfo;
1827  int transceive;
1829  int bank_qty;
1830  int chan_desc_sz;
1832  chan_t chan_list[HAMLIB_CHANLSTSIZ];
1834  // As of 2020-02-12 we know of 5 models from Icom USA, EUR, ITR, TPE, KOR for the IC-9700
1835  // So we currently have 5 ranges we need to deal with
1836  // The backend for the model should fill in the label field to explain what model it is
1837  // The the IC-9700 in ic7300.c for an example
1838  freq_range_t rx_range_list1[HAMLIB_FRQRANGESIZ];
1839  freq_range_t tx_range_list1[HAMLIB_FRQRANGESIZ];
1840  freq_range_t rx_range_list2[HAMLIB_FRQRANGESIZ];
1841  freq_range_t tx_range_list2[HAMLIB_FRQRANGESIZ];
1842  freq_range_t rx_range_list3[HAMLIB_FRQRANGESIZ];
1843  freq_range_t tx_range_list3[HAMLIB_FRQRANGESIZ];
1844  freq_range_t rx_range_list4[HAMLIB_FRQRANGESIZ];
1845  freq_range_t tx_range_list4[HAMLIB_FRQRANGESIZ];
1846  freq_range_t rx_range_list5[HAMLIB_FRQRANGESIZ];
1847  freq_range_t tx_range_list5[HAMLIB_FRQRANGESIZ];
1849  struct tuning_step_list tuning_steps[HAMLIB_TSLSTSIZ];
1850  struct filter_list filters[HAMLIB_FLTLSTSIZ];
1852  cal_table_t str_cal;
1853  cal_table_float_t swr_cal;
1854  cal_table_float_t alc_cal;
1855  cal_table_float_t rfpower_meter_cal;
1856  cal_table_float_t comp_meter_cal;
1857  cal_table_float_t vd_meter_cal;
1858  cal_table_float_t id_meter_cal;
1860  struct rig_spectrum_scope spectrum_scopes[HAMLIB_MAX_SPECTRUM_SCOPES];
1861  enum rig_spectrum_mode_e spectrum_modes[HAMLIB_MAX_SPECTRUM_MODES];
1862  freq_t spectrum_spans[HAMLIB_MAX_SPECTRUM_SPANS];
1863  struct rig_spectrum_avg_mode spectrum_avg_modes[HAMLIB_MAX_SPECTRUM_AVG_MODES];
1864  int spectrum_attenuator[HAMLIB_MAXDBLSTSIZ];
1866  const struct confparams *cfgparams;
1867  const rig_ptr_t priv;
1869  /*
1870  * Rig API
1871  *
1872  */
1873 
1874  int (*rig_init)(RIG *rig);
1875  int (*rig_cleanup)(RIG *rig);
1876  int (*rig_open)(RIG *rig);
1877  int (*rig_close)(RIG *rig);
1878 
1879  /*
1880  * General API commands, from most primitive to least.. :()
1881  * List Set/Get functions pairs
1882  */
1883 
1884  int (*set_freq)(RIG *rig, vfo_t vfo, freq_t freq);
1885  int (*get_freq)(RIG *rig, vfo_t vfo, freq_t *freq);
1886 
1887  int (*set_mode)(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width);
1888  int (*get_mode)(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width);
1889 
1890  int (*set_vfo)(RIG *rig, vfo_t vfo);
1891  int (*get_vfo)(RIG *rig, vfo_t *vfo);
1892 
1893  int (*set_ptt)(RIG *rig, vfo_t vfo, ptt_t ptt);
1894  int (*get_ptt)(RIG *rig, vfo_t vfo, ptt_t *ptt);
1895 
1896  int (*get_dcd)(RIG *rig, vfo_t vfo, dcd_t *dcd);
1897 
1898  int (*set_rptr_shift)(RIG *rig, vfo_t vfo, rptr_shift_t rptr_shift);
1899  int (*get_rptr_shift)(RIG *rig, vfo_t vfo, rptr_shift_t *rptr_shift);
1900 
1901  int (*set_rptr_offs)(RIG *rig, vfo_t vfo, shortfreq_t offs);
1902  int (*get_rptr_offs)(RIG *rig, vfo_t vfo, shortfreq_t *offs);
1903 
1904  int (*set_split_freq)(RIG *rig, vfo_t vfo, freq_t tx_freq);
1905  int (*get_split_freq)(RIG *rig, vfo_t vfo, freq_t *tx_freq);
1906 
1907  int (*set_split_mode)(RIG *rig,
1908  vfo_t vfo,
1909  rmode_t tx_mode,
1910  pbwidth_t tx_width);
1911  int (*get_split_mode)(RIG *rig,
1912  vfo_t vfo,
1913  rmode_t *tx_mode,
1914  pbwidth_t *tx_width);
1915 
1916  int (*set_split_freq_mode)(RIG *rig,
1917  vfo_t vfo,
1918  freq_t tx_freq,
1919  rmode_t tx_mode,
1920  pbwidth_t tx_width);
1921  int (*get_split_freq_mode)(RIG *rig,
1922  vfo_t vfo,
1923  freq_t *tx_freq,
1924  rmode_t *tx_mode,
1925  pbwidth_t *tx_width);
1926 
1927  int (*set_split_vfo)(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo);
1928  int (*get_split_vfo)(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo);
1929 
1930  int (*set_rit)(RIG *rig, vfo_t vfo, shortfreq_t rit);
1931  int (*get_rit)(RIG *rig, vfo_t vfo, shortfreq_t *rit);
1932 
1933  int (*set_xit)(RIG *rig, vfo_t vfo, shortfreq_t xit);
1934  int (*get_xit)(RIG *rig, vfo_t vfo, shortfreq_t *xit);
1935 
1936  int (*set_ts)(RIG *rig, vfo_t vfo, shortfreq_t ts);
1937  int (*get_ts)(RIG *rig, vfo_t vfo, shortfreq_t *ts);
1938 
1939  int (*set_dcs_code)(RIG *rig, vfo_t vfo, tone_t code);
1940  int (*get_dcs_code)(RIG *rig, vfo_t vfo, tone_t *code);
1941 
1942  int (*set_tone)(RIG *rig, vfo_t vfo, tone_t tone);
1943  int (*get_tone)(RIG *rig, vfo_t vfo, tone_t *tone);
1944 
1945  int (*set_ctcss_tone)(RIG *rig, vfo_t vfo, tone_t tone);
1946  int (*get_ctcss_tone)(RIG *rig, vfo_t vfo, tone_t *tone);
1947 
1948  int (*set_dcs_sql)(RIG *rig, vfo_t vfo, tone_t code);
1949  int (*get_dcs_sql)(RIG *rig, vfo_t vfo, tone_t *code);
1950 
1951  int (*set_tone_sql)(RIG *rig, vfo_t vfo, tone_t tone);
1952  int (*get_tone_sql)(RIG *rig, vfo_t vfo, tone_t *tone);
1953 
1954  int (*set_ctcss_sql)(RIG *rig, vfo_t vfo, tone_t tone);
1955  int (*get_ctcss_sql)(RIG *rig, vfo_t vfo, tone_t *tone);
1956 
1957  int (*power2mW)(RIG *rig,
1958  unsigned int *mwpower,
1959  float power,
1960  freq_t freq,
1961  rmode_t mode);
1962  int (*mW2power)(RIG *rig,
1963  float *power,
1964  unsigned int mwpower,
1965  freq_t freq,
1966  rmode_t mode);
1967 
1968  int (*set_powerstat)(RIG *rig, powerstat_t status);
1969  int (*get_powerstat)(RIG *rig, powerstat_t *status);
1970 
1971  int (*reset)(RIG *rig, reset_t reset);
1972 
1973  int (*set_ant)(RIG *rig, vfo_t vfo, ant_t ant, value_t option);
1974  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);
1975 
1976  int (*set_level)(RIG *rig, vfo_t vfo, setting_t level, value_t val);
1977  int (*get_level)(RIG *rig, vfo_t vfo, setting_t level, value_t *val);
1978 
1979  int (*set_func)(RIG *rig, vfo_t vfo, setting_t func, int status);
1980  int (*get_func)(RIG *rig, vfo_t vfo, setting_t func, int *status);
1981 
1982  int (*set_parm)(RIG *rig, setting_t parm, value_t val);
1983  int (*get_parm)(RIG *rig, setting_t parm, value_t *val);
1984 
1985  int (*set_ext_level)(RIG *rig, vfo_t vfo, token_t token, value_t val);
1986  int (*get_ext_level)(RIG *rig, vfo_t vfo, token_t token, value_t *val);
1987 
1988  int (*set_ext_func)(RIG *rig, vfo_t vfo, token_t token, int status);
1989  int (*get_ext_func)(RIG *rig, vfo_t vfo, token_t token, int *status);
1990 
1991  int (*set_ext_parm)(RIG *rig, token_t token, value_t val);
1992  int (*get_ext_parm)(RIG *rig, token_t token, value_t *val);
1993 
1994  int (*set_conf)(RIG *rig, token_t token, const char *val);
1995  int (*get_conf)(RIG *rig, token_t token, char *val);
1996 
1997  int (*send_dtmf)(RIG *rig, vfo_t vfo, const char *digits);
1998  int (*recv_dtmf)(RIG *rig, vfo_t vfo, char *digits, int *length);
1999 
2000  int (*send_morse)(RIG *rig, vfo_t vfo, const char *msg);
2001  int (*stop_morse)(RIG *rig, vfo_t vfo);
2002  int (*wait_morse)(RIG *rig, vfo_t vfo);
2003 
2004  int (*send_voice_mem)(RIG *rig, vfo_t vfo, int ch);
2005 
2006  int (*set_bank)(RIG *rig, vfo_t vfo, int bank);
2007 
2008  int (*set_mem)(RIG *rig, vfo_t vfo, int ch);
2009  int (*get_mem)(RIG *rig, vfo_t vfo, int *ch);
2010 
2011  int (*vfo_op)(RIG *rig, vfo_t vfo, vfo_op_t op);
2012 
2013  int (*scan)(RIG *rig, vfo_t vfo, scan_t scan, int ch);
2014 
2015  int (*set_trn)(RIG *rig, int trn);
2016  int (*get_trn)(RIG *rig, int *trn);
2017 
2018  int (*decode_event)(RIG *rig);
2019 
2020  int (*set_channel)(RIG *rig, vfo_t vfo, const channel_t *chan);
2021  int (*get_channel)(RIG *rig, vfo_t vfo, channel_t *chan, int read_only);
2022 
2023  const char * (*get_info)(RIG *rig);
2024 
2025  int (*set_chan_all_cb)(RIG *rig, vfo_t vfo, chan_cb_t chan_cb, rig_ptr_t);
2026  int (*get_chan_all_cb)(RIG *rig, vfo_t vfo, chan_cb_t chan_cb, rig_ptr_t);
2027 
2028  int (*set_mem_all_cb)(RIG *rig,
2029  vfo_t vfo,
2030  chan_cb_t chan_cb,
2031  confval_cb_t parm_cb,
2032  rig_ptr_t);
2033  int (*get_mem_all_cb)(RIG *rig,
2034  vfo_t vfo,
2035  chan_cb_t chan_cb,
2036  confval_cb_t parm_cb,
2037  rig_ptr_t);
2038 
2039  int (*set_vfo_opt)(RIG *rig, int status); // only for Net Rigctl device
2040  int (*rig_get_vfo_info) (RIG *rig,
2041  vfo_t vfo,
2042  freq_t *freq,
2043  rmode_t *mode,
2044  pbwidth_t *width,
2045  split_t *split);
2046  int(*set_clock) (RIG *rig, int year, int month, int day, int hour, int min, int sec, double msec, int utc_offset);
2047  int(*get_clock) (RIG *rig, int *year, int *month, int *day, int *hour, int *min, int *sec, double *msec, int *utc_offset);
2048 
2049  const char *clone_combo_set;
2050  const char *clone_combo_get;
2051  const char *macro_name;
2053  int async_data_supported;
2054  int (*read_frame_direct)(RIG *rig,
2055  size_t buffer_length,
2056  const unsigned char *buffer);
2057  int (*is_async_frame)(RIG *rig,
2058  size_t frame_length,
2059  const unsigned char *frame);
2060  int (*process_async_frame)(RIG *rig,
2061  size_t frame_length,
2062  const unsigned char *frame);
2063 // this will be used to check rigcaps structure is compatible with client
2064  char *hamlib_check_rig_caps; // a constant value we can check for hamlib integrity
2065  int (*get_conf2)(RIG *rig, token_t token, char *val, int val_len);
2066  int (*password)(RIG *rig, const char *key1); /*< Send encrypted password if rigctld is secured with -A/--password */
2067  int (*set_lock_mode)(RIG *rig, int mode);
2068  int (*get_lock_mode)(RIG *rig, int *mode);
2069 };
2071 
2077 // all functions enumerated for rig_get_function_ptr
2078 enum rig_function_e {
2079  RIG_FUNCTION_INIT,
2080  RIG_FUNCTION_CLEANUP,
2081  RIG_FUNCTION_OPEN,
2082  RIG_FUNCTION_CLOSE,
2083  RIG_FUNCTION_SET_FREQ,
2084  RIG_FUNCTION_GET_FREQ,
2085  RIG_FUNCTION_SET_MODE,
2086  RIG_FUNCTION_GET_MODE,
2087  RIG_FUNCTION_SET_VFO,
2088  RIG_FUNCTION_GET_VFO,
2089  RIG_FUNCTION_SET_PTT,
2090  RIG_FUNCTION_GET_PTT,
2091  RIG_FUNCTION_GET_DCD,
2092  RIG_FUNCTION_SET_RPTR_SHIFT,
2093  RIG_FUNCTION_GET_RPTR_SHIFT,
2094  RIG_FUNCTION_SET_RPTR_OFFS,
2095  RIG_FUNCTION_GET_RPTR_OFFS,
2096  RIG_FUNCTION_SET_SPLIT_FREQ,
2097  RIG_FUNCTION_GET_SPLIT_FREQ,
2098  RIG_FUNCTION_SET_SPLIT_MODE,
2099  RIG_FUNCTION_SET_SPLIT_FREQ_MODE,
2100  RIG_FUNCTION_GET_SPLIT_FREQ_MODE,
2101  RIG_FUNCTION_SET_SPLIT_VFO,
2102  RIG_FUNCTION_GET_SPLIT_VFO,
2103  RIG_FUNCTION_SET_RIT,
2104  RIG_FUNCTION_GET_RIT,
2105  RIG_FUNCTION_SET_XIT,
2106  RIG_FUNCTION_GET_XIT,
2107  RIG_FUNCTION_SET_TS,
2108  RIG_FUNCTION_GET_TS,
2109  RIG_FUNCTION_SET_DCS_CODE,
2110  RIG_FUNCTION_GET_DCS_CODE,
2111  RIG_FUNCTION_SET_TONE,
2112  RIG_FUNCTION_GET_TONE,
2113  RIG_FUNCTION_SET_CTCSS_TONE,
2114  RIG_FUNCTION_GET_CTCSS_TONE,
2115  RIG_FUNCTION_SET_DCS_SQL,
2116  RIG_FUNCTION_GET_DCS_SQL,
2117  RIG_FUNCTION_SET_TONE_SQL,
2118  RIG_FUNCTION_GET_TONE_SQL,
2119  RIG_FUNCTION_SET_CTCSS_SQL,
2120  RIG_FUNCTION_GET_CTCSS_SQL,
2121  RIG_FUNCTION_POWER2MW,
2122  RIG_FUNCTION_MW2POWER,
2123  RIG_FUNCTION_SET_POWERSTAT,
2124  RIG_FUNCTION_GET_POWERSTAT,
2125  RIG_FUNCTION_RESET,
2126  RIG_FUNCTION_SET_ANT,
2127  RIG_FUNCTION_GET_ANT,
2128  RIG_FUNCTION_SET_LEVEL,
2129  RIG_FUNCTION_GET_LEVEL,
2130  RIG_FUNCTION_SET_FUNC,
2131  RIG_FUNCTION_GET_FUNC,
2132  RIG_FUNCTION_SET_PARM,
2133  RIG_FUNCTION_GET_PARM,
2134  RIG_FUNCTION_SET_EXT_LEVEL,
2135  RIG_FUNCTION_GET_EXT_LEVEL,
2136  RIG_FUNCTION_SET_EXT_FUNC,
2137  RIG_FUNCTION_GET_EXT_FUNC,
2138  RIG_FUNCTION_SET_EXT_PARM,
2139  RIG_FUNCTION_GET_EXT_PARM,
2140  RIG_FUNCTION_SET_CONF,
2141  RIG_FUNCTION_GET_CONF,
2142  RIG_FUNCTION_SEND_DTMF,
2143  RIG_FUNCTION_SEND_MORSE,
2144  RIG_FUNCTION_STOP_MORSE,
2145  RIG_FUNCTION_WAIT_MORSE,
2146  RIG_FUNCTION_SEND_VOICE_MEM,
2147  RIG_FUNCTION_SET_BANK,
2148  RIG_FUNCTION_SET_MEM,
2149  RIG_FUNCTION_GET_MEM,
2150  RIG_FUNCTION_VFO_OP,
2151  RIG_FUNCTION_SCAN,
2152  RIG_FUNCTION_SET_TRN,
2153  RIG_FUNCTION_GET_TRN,
2154  RIG_FUNCTION_DECODE_EVENT,
2155  RIG_FUNCTION_SET_CHANNEL,
2156  RIG_FUNCTION_GET_CHANNEL,
2157  RIG_FUNCTION_GET_INFO,
2158  RIG_FUNCTION_SET_CHAN_ALL_CB,
2159  RIG_FUNCTION_GET_CHAN_ALL_CB,
2160  RIG_FUNCTION_SET_MEM_ALL_CB,
2161  RIG_FUNCTION_GET_MEM_ALL_CB,
2162  RIG_FUNCTION_SET_VFO_OPT,
2163  RIG_FUNCTION_READ_FRAME_DIRECT,
2164  RIG_FUNCTION_IS_ASYNC_FRAME,
2165  RIG_FUNCTION_PROCESS_ASYNC_FRAME,
2166  RIG_FUNCTION_GET_CONF2,
2167 };
2168 
2174 extern HAMLIB_EXPORT (void *) rig_get_function_ptr(rig_model_t rig_model, enum rig_function_e rig_function);
2175 
2181 // values enumerated for rig->caps values
2182 enum rig_caps_int_e {
2183  RIG_CAPS_TARGETABLE_VFO,
2184  RIG_CAPS_RIG_MODEL,
2185  RIG_CAPS_PORT_TYPE,
2186  RIG_CAPS_PTT_TYPE,
2187  RIG_CAPS_HAS_GET_LEVEL
2188 };
2189 
2190 enum rig_caps_cptr_e {
2191  RIG_CAPS_VERSION_CPTR,
2192  RIG_CAPS_MFG_NAME_CPTR,
2193  RIG_CAPS_MODEL_NAME_CPTR,
2194  RIG_CAPS_STATUS_CPTR
2195 };
2196 
2202 extern HAMLIB_EXPORT (long long) rig_get_caps_int(rig_model_t rig_model, enum rig_caps_int_e rig_caps);
2203 
2209 extern HAMLIB_EXPORT (const char *) rig_get_caps_cptr(rig_model_t rig_model, enum rig_caps_cptr_e rig_caps);
2210 
2211 struct hamlib_async_pipe;
2212 
2213 typedef struct hamlib_async_pipe hamlib_async_pipe_t;
2214 
2221 // DO NOT CHANGE THIS STRUCTURE ALL UNTIL 5.0
2222 // Right now it is static inside rig structure
2223 // 5.0 will change it to a pointer which can then be added to
2224 // At that point only add to the end of the structure
2225 typedef struct hamlib_port {
2226  union {
2227  rig_port_t rig;
2228  ptt_type_t ptt;
2229  dcd_type_t dcd;
2230  } type;
2231 
2232  int fd;
2233  void *handle;
2235  int write_delay;
2236  int post_write_delay;
2238  struct {
2239  int tv_sec, tv_usec;
2240  } post_write_date;
2242  int timeout;
2243  short retry;
2244  short flushx;
2246  char pathname[HAMLIB_FILPATHLEN];
2248  union {
2249  struct {
2250  int rate;
2251  int data_bits;
2252  int stop_bits;
2253  enum serial_parity_e parity;
2254  enum serial_handshake_e handshake;
2255  enum serial_control_state_e rts_state;
2256  enum serial_control_state_e dtr_state;
2257  } serial;
2259  struct {
2260  int pin;
2261  } parallel;
2263  struct {
2264  int ptt_bitnum;
2265  } cm108;
2267  struct {
2268  int vid;
2269  int pid;
2270  int conf;
2271  int iface;
2272  int alt;
2273  char *vendor_name;
2274  char *product;
2275  } usb;
2277  struct {
2278  int on_value;
2279  int value;
2280  } gpio;
2281  } parm;
2282  int client_port;
2283  RIG *rig;
2284  int asyncio;
2285 #if defined(_WIN32)
2286  hamlib_async_pipe_t *sync_data_pipe;
2287  hamlib_async_pipe_t *sync_data_error_pipe;
2288 #else
2289  int fd_sync_write;
2290  int fd_sync_read;
2291  int fd_sync_error_write;
2292  int fd_sync_error_read;
2293 #endif
2294 } hamlib_port_t;
2295 
2296 
2297 // DO NOT CHANGE THIS STRUCTURE AT ALL
2298 // Will be removed in 5.0
2299 typedef struct hamlib_port_deprecated {
2300  union {
2301  rig_port_t rig;
2302  ptt_type_t ptt;
2303  dcd_type_t dcd;
2304  } type;
2305 
2306  int fd;
2307  void *handle;
2309  int write_delay;
2310  int post_write_delay;
2312  struct {
2313  int tv_sec, tv_usec;
2314  } post_write_date;
2316  int timeout;
2317  short retry;
2318  short flushx;
2320  char pathname[HAMLIB_FILPATHLEN];
2322  union {
2323  struct {
2324  int rate;
2325  int data_bits;
2326  int stop_bits;
2327  enum serial_parity_e parity;
2328  enum serial_handshake_e handshake;
2329  enum serial_control_state_e rts_state;
2330  enum serial_control_state_e dtr_state;
2331  } serial;
2333  struct {
2334  int pin;
2335  } parallel;
2337  struct {
2338  int ptt_bitnum;
2339  } cm108;
2341  struct {
2342  int vid;
2343  int pid;
2344  int conf;
2345  int iface;
2346  int alt;
2347  char *vendor_name;
2348  char *product;
2349  } usb;
2351  struct {
2352  int on_value;
2353  int value;
2354  } gpio;
2355  } parm;
2356  int client_port;
2357  RIG *rig;
2358 } hamlib_port_t_deprecated;
2360 
2361 #if !defined(__APPLE__) || !defined(__cplusplus)
2362 typedef hamlib_port_t_deprecated port_t_deprecated;
2363 typedef hamlib_port_t port_t;
2364 #endif
2365 
2366 #define HAMLIB_ELAPSED_GET 0
2367 #define HAMLIB_ELAPSED_SET 1
2368 #define HAMLIB_ELAPSED_INVALIDATE 2
2369 
2370 #define HAMLIB_CACHE_ALWAYS (-1) /*< value to set cache timeout to always use cache */
2371 
2372 typedef enum {
2373  HAMLIB_CACHE_ALL, // to set all cache timeouts at once
2374  HAMLIB_CACHE_VFO,
2375  HAMLIB_CACHE_FREQ,
2376  HAMLIB_CACHE_MODE,
2377  HAMLIB_CACHE_PTT,
2378  HAMLIB_CACHE_SPLIT,
2379  HAMLIB_CACHE_WIDTH
2380 } hamlib_cache_t;
2381 
2382 typedef enum {
2383  TWIDDLE_OFF,
2384  TWIDDLE_ON
2385 } twiddle_state_t;
2386 
2392 struct rig_cache {
2393  int timeout_ms; // the cache timeout for invalidating itself
2394  vfo_t vfo;
2395  //freq_t freq; // to be deprecated in 4.1 when full Main/Sub/A/B caching is implemented in 4.1
2396  // other abstraction here is based on dual vfo rigs and mapped to all others
2397  // So we have four possible states of rig
2398  // MainA, MainB, SubA, SubB
2399  // Main is the Main VFO and Sub is for the 2nd VFO
2400  // Most rigs have MainA and MainB
2401  // Dual VFO rigs can have SubA and SubB too
2402  // For dual VFO rigs simplex operations are all done on MainA/MainB -- ergo this abstraction
2403  freq_t freqCurr; // Other VFO
2404  freq_t freqOther; // Other VFO
2405  freq_t freqMainA; // VFO_A, VFO_MAIN, and VFO_MAINA
2406  freq_t freqMainB; // VFO_B, VFO_SUB, and VFO_MAINB
2407  freq_t freqMainC; // VFO_C, VFO_MAINC
2408  freq_t freqSubA; // VFO_SUBA -- only for rigs with dual Sub VFOs
2409  freq_t freqSubB; // VFO_SUBB -- only for rigs with dual Sub VFOs
2410  freq_t freqSubC; // VFO_SUBC -- only for rigs with 3 Sub VFOs
2411  freq_t freqMem; // VFO_MEM -- last MEM channel
2412  rmode_t modeCurr;
2413  rmode_t modeOther;
2414  rmode_t modeMainA;
2415  rmode_t modeMainB;
2416  rmode_t modeMainC;
2417  rmode_t modeSubA;
2418  rmode_t modeSubB;
2419  rmode_t modeSubC;
2420  rmode_t modeMem;
2421  pbwidth_t widthCurr; // if non-zero then rig has separate width for MainA
2422  pbwidth_t widthOther; // if non-zero then rig has separate width for MainA
2423  pbwidth_t widthMainA; // if non-zero then rig has separate width for MainA
2424  pbwidth_t widthMainB; // if non-zero then rig has separate width for MainB
2425  pbwidth_t widthMainC; // if non-zero then rig has separate width for MainC
2426  pbwidth_t widthSubA; // if non-zero then rig has separate width for SubA
2427  pbwidth_t widthSubB; // if non-zero then rig has separate width for SubB
2428  pbwidth_t widthSubC; // if non-zero then rig has separate width for SubC
2429  pbwidth_t widthMem; // if non-zero then rig has separate width for Mem
2430  ptt_t ptt;
2431  split_t split;
2432  vfo_t split_vfo; // split caches two values
2433  struct timespec time_freqCurr;
2434  struct timespec time_freqOther;
2435  struct timespec time_freqMainA;
2436  struct timespec time_freqMainB;
2437  struct timespec time_freqMainC;
2438  struct timespec time_freqSubA;
2439  struct timespec time_freqSubB;
2440  struct timespec time_freqSubC;
2441  struct timespec time_freqMem;
2442  struct timespec time_vfo;
2443  struct timespec time_modeCurr;
2444  struct timespec time_modeOther;
2445  struct timespec time_modeMainA;
2446  struct timespec time_modeMainB;
2447  struct timespec time_modeMainC;
2448  struct timespec time_modeSubA;
2449  struct timespec time_modeSubB;
2450  struct timespec time_modeSubC;
2451  struct timespec time_modeMem;
2452  struct timespec time_widthCurr;
2453  struct timespec time_widthOther;
2454  struct timespec time_widthMainA;
2455  struct timespec time_widthMainB;
2456  struct timespec time_widthMainC;
2457  struct timespec time_widthSubA;
2458  struct timespec time_widthSubB;
2459  struct timespec time_widthSubC;
2460  struct timespec time_widthMem;
2461  struct timespec time_ptt;
2462  struct timespec time_split;
2463  int satmode; // if rig is in satellite mode
2464 };
2465 
2466 
2477 struct rig_state {
2478  /********* ENSURE ANY NEW ITEMS ARE ADDED AT BOTTOM OF THIS STRUCTURE *********/
2479  /*
2480  * overridable fields
2481  */
2482  // moving the hamlib_port_t to the end of rig_state and making it a pointer
2483  // this should allow changes to hamlib_port_t without breaking shared libraries
2484  // these will maintain a copy of the new port_t for backwards compatibility
2485  // to these offsets -- note these must stay until a major version update is done like 5.0
2486  hamlib_port_t_deprecated rigport_deprecated;
2487  hamlib_port_t_deprecated pttport_deprecated;
2488  hamlib_port_t_deprecated dcdport_deprecated;
2490  double vfo_comp;
2493  freq_range_t rx_range_list[HAMLIB_FRQRANGESIZ];
2494  freq_range_t tx_range_list[HAMLIB_FRQRANGESIZ];
2496  struct tuning_step_list tuning_steps[HAMLIB_TSLSTSIZ];
2498  struct filter_list filters[HAMLIB_FLTLSTSIZ];
2502  chan_t chan_list[HAMLIB_CHANLSTSIZ];
2510  int preamp[HAMLIB_MAXDBLSTSIZ];
2511  int attenuator[HAMLIB_MAXDBLSTSIZ];
2524  /*
2525  * non overridable fields, internal use
2526  */
2527 
2530  int vfo_list;
2532  rig_ptr_t priv;
2533  rig_ptr_t obj;
2539  //rmode_t current_modeB; /*!< Mode currently set VFOB */
2543  // mode_list is used by some
2544  // so anything added to this structure must be below here
2545  int transmit;
2549  time_t twiddle_time;
2551  // uplink allows gpredict to behave better by no reading the uplink VFO
2552  int uplink;
2553  struct rig_cache cache;
2554  int vfo_opt;
2571  volatile unsigned int snapshot_packet_sequence_number;
2572 
2573  volatile int multicast_publisher_run;
2575  volatile int async_data_handler_thread_run;
2576  void *async_data_handler_priv_data;
2577  volatile int poll_routine_thread_run;
2578  void *poll_routine_priv_data;
2579  pthread_mutex_t mutex_set_transaction;
2580  hamlib_port_t rigport;
2581  hamlib_port_t pttport;
2582  hamlib_port_t dcdport;
2583  /********* DO NOT ADD or CHANGE anything (or than to rename) ABOVE THIS LINE *********/
2584  /********* ENSURE ANY NEW ITEMS ARE ADDED AFTER HERE *********/
2585  /* flags instructing the rig_get routines to use cached values when asyncio is in use */
2586  int use_cached_freq; /*<! flag instructing rig_get_freq to use cached values when asyncio is in use */
2587  int use_cached_mode; /*<! flag instructing rig_get_mode to use cached values when asyncio is in use */
2588  int use_cached_ptt; /*<! flag instructing rig_get_ptt to use cached values when asyncio is in use */
2589  int depth; /*<! a depth counter to use for debug indentation and such */
2590  int lock_mode; /*<! flag that prevents mode changes if ~= 0 -- see set/get_lock_mode */
2591  powerstat_t powerstat; /*<! power status */
2592 };
2593 
2595 typedef int (*vprintf_cb_t)(enum rig_debug_level_e,
2596  rig_ptr_t,
2597  const char *,
2598  va_list);
2599 
2600 typedef int (*freq_cb_t)(RIG *, vfo_t, freq_t, rig_ptr_t);
2601 typedef int (*mode_cb_t)(RIG *, vfo_t, rmode_t, pbwidth_t, rig_ptr_t);
2602 typedef int (*vfo_cb_t)(RIG *, vfo_t, rig_ptr_t);
2603 typedef int (*ptt_cb_t)(RIG *, vfo_t, ptt_t, rig_ptr_t);
2604 typedef int (*dcd_cb_t)(RIG *, vfo_t, dcd_t, rig_ptr_t);
2605 typedef int (*pltune_cb_t)(RIG *,
2606  vfo_t, freq_t *,
2607  rmode_t *,
2608  pbwidth_t *,
2609  rig_ptr_t);
2610 typedef int (*spectrum_cb_t)(RIG *,
2611  struct rig_spectrum_line *,
2612  rig_ptr_t);
2613 
2615 
2634  freq_cb_t freq_event;
2635  rig_ptr_t freq_arg;
2636  mode_cb_t mode_event;
2637  rig_ptr_t mode_arg;
2638  vfo_cb_t vfo_event;
2639  rig_ptr_t vfo_arg;
2640  ptt_cb_t ptt_event;
2641  rig_ptr_t ptt_arg;
2642  dcd_cb_t dcd_event;
2643  rig_ptr_t dcd_arg;
2644  pltune_cb_t pltune;
2645  rig_ptr_t pltune_arg;
2646  spectrum_cb_t spectrum_event;
2647  rig_ptr_t spectrum_arg;
2648  /* etc.. */
2649 };
2650 
2651 
2661 struct s_rig {
2662  struct rig_caps *caps;
2663  struct rig_state state;
2664  struct rig_callbacks callbacks;
2665 };
2666 
2667 
2668 
2669 /* --------------- API function prototypes -----------------*/
2670 
2672 
2673 extern HAMLIB_EXPORT(RIG *) rig_init HAMLIB_PARAMS((rig_model_t rig_model));
2674 extern HAMLIB_EXPORT(int) rig_open HAMLIB_PARAMS((RIG *rig));
2675 
2676 /*
2677  * General API commands, from most primitive to least.. :()
2678  * List Set/Get functions pairs
2679  */
2680 
2681 extern HAMLIB_EXPORT(int)
2682 rig_flush(hamlib_port_t *port);
2683 
2684 #if BUILTINFUNC
2685 #define rig_set_freq(r,v, f) rig_set_vfo(r,v,f,__builtin_FUNCTION())
2686 #else
2687 extern HAMLIB_EXPORT(int)
2688 rig_set_freq HAMLIB_PARAMS((RIG *rig,
2689  vfo_t vfo,
2690  freq_t freq));
2691 #endif
2692 extern HAMLIB_EXPORT(int)
2693 rig_get_freq HAMLIB_PARAMS((RIG *rig,
2694  vfo_t vfo,
2695  freq_t *freq));
2696 
2697 extern HAMLIB_EXPORT(int)
2698 rig_set_mode HAMLIB_PARAMS((RIG *rig,
2699  vfo_t vfo,
2700  rmode_t mode,
2701  pbwidth_t width));
2702 extern HAMLIB_EXPORT(int)
2703 rig_get_mode HAMLIB_PARAMS((RIG *rig,
2704  vfo_t vfo,
2705  rmode_t *mode,
2706  pbwidth_t *width));
2707 
2708 #if BUILTINFUNC
2709 #define rig_set_vfo(r,v) rig_set_vfo(r,v,__builtin_FUNCTION())
2710 extern HAMLIB_EXPORT(int)
2711 rig_set_vfo HAMLIB_PARAMS((RIG *rig,
2712  vfo_t vfo, const char *func));
2713 #else
2714 extern HAMLIB_EXPORT(int)
2715 rig_set_vfo HAMLIB_PARAMS((RIG *rig,
2716  vfo_t vfo));
2717 #endif
2718 extern HAMLIB_EXPORT(int)
2719 rig_get_vfo HAMLIB_PARAMS((RIG *rig,
2720  vfo_t *vfo));
2721 
2722 extern HAMLIB_EXPORT(int)
2723 rig_get_vfo_info HAMLIB_PARAMS((RIG *rig,
2724  vfo_t vfo,
2725  freq_t *freq,
2726  rmode_t *mode,
2727  pbwidth_t *width,
2728  split_t *split,
2729  int *satmode));
2730 
2731 extern HAMLIB_EXPORT(int)
2732 rig_get_vfo_list HAMLIB_PARAMS((RIG *rig, char *buf, int buflen));
2733 
2734 extern HAMLIB_EXPORT(int)
2735 netrigctl_get_vfo_mode HAMLIB_PARAMS((RIG *rig));
2736 
2737 extern HAMLIB_EXPORT(int)
2738 rig_set_ptt HAMLIB_PARAMS((RIG *rig,
2739  vfo_t vfo,
2740  ptt_t ptt));
2741 extern HAMLIB_EXPORT(int)
2742 rig_get_ptt HAMLIB_PARAMS((RIG *rig,
2743  vfo_t vfo,
2744  ptt_t *ptt));
2745 
2746 extern HAMLIB_EXPORT(int)
2747 rig_get_dcd HAMLIB_PARAMS((RIG *rig,
2748  vfo_t vfo,
2749  dcd_t *dcd));
2750 
2751 extern HAMLIB_EXPORT(int)
2752 rig_set_rptr_shift HAMLIB_PARAMS((RIG *rig,
2753  vfo_t vfo,
2754  rptr_shift_t rptr_shift));
2755 extern HAMLIB_EXPORT(int)
2756 rig_get_rptr_shift HAMLIB_PARAMS((RIG *rig,
2757  vfo_t vfo,
2758  rptr_shift_t *rptr_shift));
2759 
2760 extern HAMLIB_EXPORT(int)
2761 rig_set_rptr_offs HAMLIB_PARAMS((RIG *rig,
2762  vfo_t vfo,
2763  shortfreq_t rptr_offs));
2764 extern HAMLIB_EXPORT(int)
2765 rig_get_rptr_offs HAMLIB_PARAMS((RIG *rig,
2766  vfo_t vfo,
2767  shortfreq_t *rptr_offs));
2768 
2769 extern HAMLIB_EXPORT(int)
2770 rig_set_ctcss_tone HAMLIB_PARAMS((RIG *rig,
2771  vfo_t vfo,
2772  tone_t tone));
2773 extern HAMLIB_EXPORT(int)
2774 rig_get_ctcss_tone HAMLIB_PARAMS((RIG *rig,
2775  vfo_t vfo,
2776  tone_t *tone));
2777 
2778 extern HAMLIB_EXPORT(int)
2779 rig_set_dcs_code HAMLIB_PARAMS((RIG *rig,
2780  vfo_t vfo,
2781  tone_t code));
2782 extern HAMLIB_EXPORT(int)
2783 rig_get_dcs_code HAMLIB_PARAMS((RIG *rig,
2784  vfo_t vfo,
2785  tone_t *code));
2786 
2787 extern HAMLIB_EXPORT(int)
2788 rig_set_ctcss_sql HAMLIB_PARAMS((RIG *rig,
2789  vfo_t vfo,
2790  tone_t tone));
2791 extern HAMLIB_EXPORT(int)
2792 rig_get_ctcss_sql HAMLIB_PARAMS((RIG *rig,
2793  vfo_t vfo,
2794  tone_t *tone));
2795 
2796 extern HAMLIB_EXPORT(int)
2797 rig_set_dcs_sql HAMLIB_PARAMS((RIG *rig,
2798  vfo_t vfo,
2799  tone_t code));
2800 extern HAMLIB_EXPORT(int)
2801 rig_get_dcs_sql HAMLIB_PARAMS((RIG *rig,
2802  vfo_t vfo,
2803  tone_t *code));
2804 
2805 extern HAMLIB_EXPORT(int)
2806 rig_set_split_freq HAMLIB_PARAMS((RIG *rig,
2807  vfo_t vfo,
2808  freq_t tx_freq));
2809 extern HAMLIB_EXPORT(int)
2810 rig_get_split_freq HAMLIB_PARAMS((RIG *rig,
2811  vfo_t vfo,
2812  freq_t *tx_freq));
2813 
2814 extern HAMLIB_EXPORT(int)
2815 rig_set_split_mode HAMLIB_PARAMS((RIG *rig,
2816  vfo_t vfo,
2817  rmode_t tx_mode,
2818  pbwidth_t tx_width));
2819 extern HAMLIB_EXPORT(int)
2820 rig_get_split_mode HAMLIB_PARAMS((RIG *rig,
2821  vfo_t vfo,
2822  rmode_t *tx_mode,
2823  pbwidth_t *tx_width));
2824 
2825 extern HAMLIB_EXPORT(int)
2826 rig_set_split_freq_mode HAMLIB_PARAMS((RIG *rig,
2827  vfo_t vfo,
2828  freq_t tx_freq,
2829  rmode_t tx_mode,
2830  pbwidth_t tx_width));
2831 extern HAMLIB_EXPORT(int)
2832 rig_get_split_freq_mode HAMLIB_PARAMS((RIG *rig,
2833  vfo_t vfo,
2834  freq_t *tx_freq,
2835  rmode_t *tx_mode,
2836  pbwidth_t *tx_width));
2837 
2838 extern HAMLIB_EXPORT(int)
2839 rig_set_split_vfo HAMLIB_PARAMS((RIG *,
2840  vfo_t rx_vfo,
2841  split_t split,
2842  vfo_t tx_vfo));
2843 extern HAMLIB_EXPORT(int)
2844 rig_get_split_vfo HAMLIB_PARAMS((RIG *,
2845  vfo_t rx_vfo,
2846  split_t *split,
2847  vfo_t *tx_vfo));
2848 
2849 extern HAMLIB_EXPORT(int)
2850 rig_set_rit HAMLIB_PARAMS((RIG *rig,
2851  vfo_t vfo,
2852  shortfreq_t rit));
2853 extern HAMLIB_EXPORT(int)
2854 rig_get_rit HAMLIB_PARAMS((RIG *rig,
2855  vfo_t vfo,
2856  shortfreq_t *rit));
2857 
2858 extern HAMLIB_EXPORT(int)
2859 rig_set_xit HAMLIB_PARAMS((RIG *rig,
2860  vfo_t vfo,
2861  shortfreq_t xit));
2862 extern HAMLIB_EXPORT(int)
2863 rig_get_xit HAMLIB_PARAMS((RIG *rig,
2864  vfo_t vfo,
2865  shortfreq_t *xit));
2866 
2867 extern HAMLIB_EXPORT(int)
2868 rig_set_ts HAMLIB_PARAMS((RIG *rig,
2869  vfo_t vfo,
2870  shortfreq_t ts));
2871 extern HAMLIB_EXPORT(int)
2872 rig_get_ts HAMLIB_PARAMS((RIG *rig,
2873  vfo_t vfo,
2874  shortfreq_t *ts));
2875 
2876 extern HAMLIB_EXPORT(int)
2877 rig_power2mW HAMLIB_PARAMS((RIG *rig,
2878  unsigned int *mwpower,
2879  float power,
2880  freq_t freq,
2881  rmode_t mode));
2882 extern HAMLIB_EXPORT(int)
2883 rig_mW2power HAMLIB_PARAMS((RIG *rig,
2884  float *power,
2885  unsigned int mwpower,
2886  freq_t freq,
2887  rmode_t mode));
2888 
2889 extern HAMLIB_EXPORT(shortfreq_t)
2890 rig_get_resolution HAMLIB_PARAMS((RIG *rig,
2891  rmode_t mode));
2892 
2893 extern HAMLIB_EXPORT(int)
2894 rig_set_level HAMLIB_PARAMS((RIG *rig,
2895  vfo_t vfo,
2896  setting_t level,
2897  value_t val));
2898 extern HAMLIB_EXPORT(int)
2899 rig_get_level HAMLIB_PARAMS((RIG *rig,
2900  vfo_t vfo,
2901  setting_t level,
2902  value_t *val));
2903 
2904 #define rig_get_strength(r,v,s) rig_get_level((r),(v),RIG_LEVEL_STRENGTH, (value_t*)(s))
2905 
2906 extern HAMLIB_EXPORT(int)
2907 rig_set_parm HAMLIB_PARAMS((RIG *rig,
2908  setting_t parm,
2909  value_t val));
2910 extern HAMLIB_EXPORT(int)
2911 rig_get_parm HAMLIB_PARAMS((RIG *rig,
2912  setting_t parm,
2913  value_t *val));
2914 
2915 extern HAMLIB_EXPORT(int)
2916 rig_set_conf HAMLIB_PARAMS((RIG *rig,
2917  token_t token,
2918  const char *val));
2919 // deprecating rig_get_conf
2920 extern HAMLIB_EXPORT(int)
2921 rig_get_conf HAMLIB_PARAMS((RIG *rig,
2922  token_t token,
2923  char *val));
2924 extern HAMLIB_EXPORT(int)
2925 rig_get_conf2 HAMLIB_PARAMS((RIG *rig,
2926  token_t token,
2927  char *val,
2928  int val_len));
2929 
2930 extern HAMLIB_EXPORT(int)
2931 rig_set_powerstat HAMLIB_PARAMS((RIG *rig,
2932  powerstat_t status));
2933 extern HAMLIB_EXPORT(int)
2934 rig_get_powerstat HAMLIB_PARAMS((RIG *rig,
2935  powerstat_t *status));
2936 
2937 extern HAMLIB_EXPORT(int)
2938 rig_reset HAMLIB_PARAMS((RIG *rig,
2939  reset_t reset)); /* dangerous! */
2940 
2941 extern HAMLIB_EXPORT(int)
2942 rig_set_ext_level HAMLIB_PARAMS((RIG *rig,
2943  vfo_t vfo,
2944  token_t token,
2945  value_t val));
2946 extern HAMLIB_EXPORT(int)
2947 rig_get_ext_level HAMLIB_PARAMS((RIG *rig,
2948  vfo_t vfo,
2949  token_t token,
2950  value_t *val));
2951 
2952 extern HAMLIB_EXPORT(int)
2953 rig_set_ext_func HAMLIB_PARAMS((RIG *rig,
2954  vfo_t vfo,
2955  token_t token,
2956  int status));
2957 extern HAMLIB_EXPORT(int)
2958 rig_get_ext_func HAMLIB_PARAMS((RIG *rig,
2959  vfo_t vfo,
2960  token_t token,
2961  int *status));
2962 
2963 extern HAMLIB_EXPORT(int)
2964 rig_set_ext_parm HAMLIB_PARAMS((RIG *rig,
2965  token_t token,
2966  value_t val));
2967 extern HAMLIB_EXPORT(int)
2968 rig_get_ext_parm HAMLIB_PARAMS((RIG *rig,
2969  token_t token,
2970  value_t *val));
2971 
2972 extern HAMLIB_EXPORT(int)
2973 rig_ext_func_foreach HAMLIB_PARAMS((RIG *rig,
2974  int (*cfunc)(RIG *,
2975  const struct confparams *,
2976  rig_ptr_t),
2977  rig_ptr_t data));
2978 extern HAMLIB_EXPORT(int)
2979 rig_ext_level_foreach HAMLIB_PARAMS((RIG *rig,
2980  int (*cfunc)(RIG *,
2981  const struct confparams *,
2982  rig_ptr_t),
2983  rig_ptr_t data));
2984 extern HAMLIB_EXPORT(int)
2985 rig_ext_parm_foreach HAMLIB_PARAMS((RIG *rig,
2986  int (*cfunc)(RIG *,
2987  const struct confparams *,
2988  rig_ptr_t),
2989  rig_ptr_t data));
2990 
2991 extern HAMLIB_EXPORT(const struct confparams *)
2992 rig_ext_lookup HAMLIB_PARAMS((RIG *rig,
2993  const char *name));
2994 
2995 extern HAMLIB_EXPORT(const struct confparams *)
2996 rig_ext_lookup_tok HAMLIB_PARAMS((RIG *rig,
2997  token_t token));
2998 extern HAMLIB_EXPORT(token_t)
2999 rig_ext_token_lookup HAMLIB_PARAMS((RIG *rig,
3000  const char *name));
3001 
3002 
3003 extern HAMLIB_EXPORT(int)
3004 rig_token_foreach HAMLIB_PARAMS((RIG *rig,
3005  int (*cfunc)(const struct confparams *,
3006  rig_ptr_t),
3007  rig_ptr_t data));
3008 
3009 extern HAMLIB_EXPORT(const struct confparams *)
3010 rig_confparam_lookup HAMLIB_PARAMS((RIG *rig,
3011  const char *name));
3012 extern HAMLIB_EXPORT(token_t)
3013 rig_token_lookup HAMLIB_PARAMS((RIG *rig,
3014  const char *name));
3015 
3016 extern HAMLIB_EXPORT(int)
3017 rig_close HAMLIB_PARAMS((RIG *rig));
3018 
3019 extern HAMLIB_EXPORT(int)
3020 rig_cleanup HAMLIB_PARAMS((RIG *rig));
3021 
3022 extern HAMLIB_EXPORT(int)
3023 rig_set_ant HAMLIB_PARAMS((RIG *rig,
3024  vfo_t vfo,
3025  ant_t ant, /* antenna */
3026  value_t option)); /* optional ant info */
3027 extern HAMLIB_EXPORT(int)
3028 rig_get_ant HAMLIB_PARAMS((RIG *rig,
3029  vfo_t vfo,
3030  ant_t ant,
3031  value_t *option,
3032  ant_t *ant_curr,
3033  ant_t *ant_tx,
3034  ant_t *ant_rx));
3035 
3036 extern HAMLIB_EXPORT(setting_t)
3037 rig_has_get_level HAMLIB_PARAMS((RIG *rig,
3038  setting_t level));
3039 extern HAMLIB_EXPORT(setting_t)
3040 rig_has_set_level HAMLIB_PARAMS((RIG *rig,
3041  setting_t level));
3042 
3043 extern HAMLIB_EXPORT(setting_t)
3044 rig_has_get_parm HAMLIB_PARAMS((RIG *rig,
3045  setting_t parm));
3046 extern HAMLIB_EXPORT(setting_t)
3047 rig_has_set_parm HAMLIB_PARAMS((RIG *rig,
3048  setting_t parm));
3049 
3050 extern HAMLIB_EXPORT(setting_t)
3051 rig_has_get_func HAMLIB_PARAMS((RIG *rig,
3052  setting_t func));
3053 extern HAMLIB_EXPORT(setting_t)
3054 rig_has_set_func HAMLIB_PARAMS((RIG *rig,
3055  setting_t func));
3056 
3057 extern HAMLIB_EXPORT(int)
3058 rig_set_func HAMLIB_PARAMS((RIG *rig,
3059  vfo_t vfo,
3060  setting_t func,
3061  int status));
3062 extern HAMLIB_EXPORT(int)
3063 rig_get_func HAMLIB_PARAMS((RIG *rig,
3064  vfo_t vfo,
3065  setting_t func,
3066  int *status));
3067 
3068 extern HAMLIB_EXPORT(int)
3069 rig_send_dtmf HAMLIB_PARAMS((RIG *rig,
3070  vfo_t vfo,
3071  const char *digits));
3072 extern HAMLIB_EXPORT(int)
3073 rig_recv_dtmf HAMLIB_PARAMS((RIG *rig,
3074  vfo_t vfo,
3075  char *digits,
3076  int *length));
3077 
3078 extern HAMLIB_EXPORT(int)
3079 rig_send_morse HAMLIB_PARAMS((RIG *rig,
3080  vfo_t vfo,
3081  const char *msg));
3082 
3083 extern HAMLIB_EXPORT(int)
3084 rig_stop_morse HAMLIB_PARAMS((RIG *rig,
3085  vfo_t vfo));
3086 
3087 extern HAMLIB_EXPORT(int)
3088 rig_wait_morse HAMLIB_PARAMS((RIG *rig,
3089  vfo_t vfo));
3090 
3091 extern HAMLIB_EXPORT(int)
3092 rig_send_voice_mem HAMLIB_PARAMS((RIG *rig,
3093  vfo_t vfo,
3094  int ch));
3095 
3096 extern HAMLIB_EXPORT(int)
3097 rig_set_bank HAMLIB_PARAMS((RIG *rig,
3098  vfo_t vfo,
3099  int bank));
3100 
3101 extern HAMLIB_EXPORT(int)
3102 rig_set_mem HAMLIB_PARAMS((RIG *rig,
3103  vfo_t vfo,
3104  int ch));
3105 extern HAMLIB_EXPORT(int)
3106 rig_get_mem HAMLIB_PARAMS((RIG *rig,
3107  vfo_t vfo,
3108  int *ch));
3109 
3110 extern HAMLIB_EXPORT(int)
3111 rig_vfo_op HAMLIB_PARAMS((RIG *rig,
3112  vfo_t vfo,
3113  vfo_op_t op));
3114 
3115 extern HAMLIB_EXPORT(vfo_op_t)
3116 rig_has_vfo_op HAMLIB_PARAMS((RIG *rig,
3117  vfo_op_t op));
3118 
3119 extern HAMLIB_EXPORT(int)
3120 rig_scan HAMLIB_PARAMS((RIG *rig,
3121  vfo_t vfo,
3122  scan_t scan,
3123  int ch));
3124 
3125 extern HAMLIB_EXPORT(scan_t)
3126 rig_has_scan HAMLIB_PARAMS((RIG *rig,
3127  scan_t scan));
3128 
3129 extern HAMLIB_EXPORT(int)
3130 rig_set_channel HAMLIB_PARAMS((RIG *rig,
3131  vfo_t vfo,
3132  const channel_t *chan)); /* mem */
3133 extern HAMLIB_EXPORT(int)
3134 rig_get_channel HAMLIB_PARAMS((RIG *rig,
3135  vfo_t vfo,
3136  channel_t *chan, int read_only));
3137 
3138 extern HAMLIB_EXPORT(int)
3139 rig_set_chan_all HAMLIB_PARAMS((RIG *rig,
3140  vfo_t vfo,
3141  const channel_t chans[]));
3142 extern HAMLIB_EXPORT(int)
3143 rig_get_chan_all HAMLIB_PARAMS((RIG *rig,
3144  vfo_t vfo,
3145  channel_t chans[]));
3146 
3147 extern HAMLIB_EXPORT(int)
3148 rig_set_chan_all_cb HAMLIB_PARAMS((RIG *rig,
3149  vfo_t vfo,
3150  chan_cb_t chan_cb,
3151  rig_ptr_t));
3152 extern HAMLIB_EXPORT(int)
3153 rig_get_chan_all_cb HAMLIB_PARAMS((RIG *rig,
3154  vfo_t vfo,
3155  chan_cb_t chan_cb,
3156  rig_ptr_t));
3157 
3158 extern HAMLIB_EXPORT(int)
3159 rig_set_mem_all_cb HAMLIB_PARAMS((RIG *rig,
3160  vfo_t vfo,
3161  chan_cb_t chan_cb,
3162  confval_cb_t parm_cb,
3163  rig_ptr_t));
3164 extern HAMLIB_EXPORT(int)
3165 rig_get_mem_all_cb HAMLIB_PARAMS((RIG *rig,
3166  vfo_t vfo,
3167  chan_cb_t chan_cb,
3168  confval_cb_t parm_cb,
3169  rig_ptr_t));
3170 
3171 extern HAMLIB_EXPORT(int)
3172 rig_set_mem_all HAMLIB_PARAMS((RIG *rig,
3173  vfo_t vfo,
3174  const channel_t *chan,
3175  const struct confparams *,
3176  const value_t *));
3177 extern HAMLIB_EXPORT(int)
3178 rig_get_mem_all HAMLIB_PARAMS((RIG *rig,
3179  vfo_t vfo,
3180  channel_t *chan,
3181  const struct confparams *,
3182  value_t *));
3183 
3184 extern HAMLIB_EXPORT(const chan_t *)
3185 rig_lookup_mem_caps HAMLIB_PARAMS((RIG *rig,
3186  int ch));
3187 
3188 extern HAMLIB_EXPORT(int)
3189 rig_mem_count HAMLIB_PARAMS((RIG *rig));
3190 
3191 extern HAMLIB_EXPORT(int)
3192 rig_set_trn HAMLIB_PARAMS((RIG *rig,
3193  int trn));
3194 extern HAMLIB_EXPORT(int)
3195 rig_get_trn HAMLIB_PARAMS((RIG *rig,
3196  int *trn));
3197 
3198 extern HAMLIB_EXPORT(int)
3199 rig_set_freq_callback HAMLIB_PARAMS((RIG *,
3200  freq_cb_t,
3201  rig_ptr_t));
3202 
3203 extern HAMLIB_EXPORT(int)
3204 rig_set_mode_callback HAMLIB_PARAMS((RIG *,
3205  mode_cb_t,
3206  rig_ptr_t));
3207 extern HAMLIB_EXPORT(int)
3208 rig_set_vfo_callback HAMLIB_PARAMS((RIG *,
3209  vfo_cb_t,
3210  rig_ptr_t));
3211 
3212 extern HAMLIB_EXPORT(int)
3213 rig_set_ptt_callback HAMLIB_PARAMS((RIG *,
3214  ptt_cb_t,
3215  rig_ptr_t));
3216 
3217 extern HAMLIB_EXPORT(int)
3218 rig_set_dcd_callback HAMLIB_PARAMS((RIG *,
3219  dcd_cb_t,
3220  rig_ptr_t));
3221 
3222 extern HAMLIB_EXPORT(int)
3223 rig_set_pltune_callback HAMLIB_PARAMS((RIG *,
3224  pltune_cb_t,
3225  rig_ptr_t));
3226 
3227 extern HAMLIB_EXPORT(int)
3228 rig_set_spectrum_callback HAMLIB_PARAMS((RIG *,
3229  spectrum_cb_t,
3230  rig_ptr_t));
3231 
3232 extern HAMLIB_EXPORT(int)
3233 rig_set_twiddle HAMLIB_PARAMS((RIG *rig,
3234  int seconds));
3235 
3236 extern HAMLIB_EXPORT(int)
3237 rig_get_twiddle HAMLIB_PARAMS((RIG *rig,
3238  int *seconds));
3239 
3240 extern HAMLIB_EXPORT(int)
3241 rig_set_uplink HAMLIB_PARAMS((RIG *rig,
3242  int val));
3243 
3244 extern HAMLIB_EXPORT(const char *)
3245 rig_get_info HAMLIB_PARAMS((RIG *rig));
3246 
3247 extern HAMLIB_EXPORT(const struct rig_caps *)
3248 rig_get_caps HAMLIB_PARAMS((rig_model_t rig_model));
3249 
3250 extern HAMLIB_EXPORT(const freq_range_t *)
3251 rig_get_range HAMLIB_PARAMS((const freq_range_t *range_list,
3252  freq_t freq,
3253  rmode_t mode));
3254 
3255 extern HAMLIB_EXPORT(pbwidth_t)
3256 rig_passband_normal HAMLIB_PARAMS((RIG *rig,
3257  rmode_t mode));
3258 extern HAMLIB_EXPORT(pbwidth_t)
3259 rig_passband_narrow HAMLIB_PARAMS((RIG *rig,
3260  rmode_t mode));
3261 extern HAMLIB_EXPORT(pbwidth_t)
3262 rig_passband_wide HAMLIB_PARAMS((RIG *rig,
3263  rmode_t mode));
3264 
3265 extern HAMLIB_EXPORT(const char *)
3266 rigerror HAMLIB_PARAMS((int errnum));
3267 extern HAMLIB_EXPORT(const char *)
3268 rigerror2 HAMLIB_PARAMS((int errnum));
3269 
3270 extern HAMLIB_EXPORT(int)
3271 rig_setting2idx HAMLIB_PARAMS((setting_t s));
3272 
3273 #define HAMLIB_SETTINGS_FILE "hamlib_settings"
3274 
3275 extern HAMLIB_EXPORT(setting_t)
3276 rig_idx2setting(int i);
3277 /*
3278  * Even if these functions are prefixed with "rig_", they are not rig specific
3279  * Maybe "hamlib_" would have been better. Let me know. --SF
3280  */
3281 extern HAMLIB_EXPORT(void)
3282 rig_set_debug HAMLIB_PARAMS((enum rig_debug_level_e debug_level));
3283 
3284 extern HAMLIB_EXPORT(void)
3285 rig_set_debug_time_stamp HAMLIB_PARAMS((int flag));
3286 
3287 #define rig_set_debug_level(level) rig_set_debug(level)
3288 
3289 extern HAMLIB_EXPORT(int)
3290 rig_need_debug HAMLIB_PARAMS((enum rig_debug_level_e debug_level));
3291 
3292 
3293 extern HAMLIB_EXPORT(void)add2debugmsgsave(const char *s);
3294 // this needs to be fairly big to avoid compiler warnings
3295 extern HAMLIB_EXPORT_VAR(char) debugmsgsave[DEBUGMSGSAVE_SIZE]; // last debug msg
3296 extern HAMLIB_EXPORT_VAR(char) debugmsgsave2[DEBUGMSGSAVE_SIZE]; // last-1 debug msg
3297 // debugmsgsave3 is deprecated
3298 extern HAMLIB_EXPORT_VAR(char) debugmsgsave3[DEBUGMSGSAVE_SIZE]; // last-2 debug msg
3299 #ifndef __cplusplus
3300 #ifdef __GNUC__
3301 // doing the debug macro with a dummy sprintf allows gcc to check the format string
3302 #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)
3303 #endif
3304 #endif
3305 
3306 // Measuring elapsed time -- local variable inside function when macro is used
3307 #define ELAPSED1 struct timespec __begin; elapsed_ms(&__begin, HAMLIB_ELAPSED_SET);
3308 #define ELAPSED2 rig_debug(RIG_DEBUG_TRACE, "%.*s%d:%s: elapsed=%.0lfms\n", rig->state.depth, spaces(), rig->state.depth, __func__, elapsed_ms(&__begin, HAMLIB_ELAPSED_GET));
3309 
3310 // use this instead of snprintf for automatic detection of buffer limit
3311 #define SNPRINTF(s,n,...) { snprintf(s,n,##__VA_ARGS__);if (strlen(s) > n-1) fprintf(stderr,"****** %s(%d): buffer overflow ******\n", __func__, __LINE__); }
3312 
3313 extern HAMLIB_EXPORT(void)
3314 rig_debug HAMLIB_PARAMS((enum rig_debug_level_e debug_level,
3315  const char *fmt, ...));
3316 
3317 extern HAMLIB_EXPORT(vprintf_cb_t)
3318 rig_set_debug_callback HAMLIB_PARAMS((vprintf_cb_t cb,
3319  rig_ptr_t arg));
3320 
3321 extern HAMLIB_EXPORT(FILE *)
3322 rig_set_debug_file HAMLIB_PARAMS((FILE *stream));
3323 
3324 extern HAMLIB_EXPORT(int)
3325 rig_register HAMLIB_PARAMS((const struct rig_caps *caps));
3326 
3327 extern HAMLIB_EXPORT(int)
3328 rig_unregister HAMLIB_PARAMS((rig_model_t rig_model));
3329 
3330 extern HAMLIB_EXPORT(int)
3331 rig_list_foreach HAMLIB_PARAMS((int (*cfunc)(const struct rig_caps *, rig_ptr_t),
3332  rig_ptr_t data));
3333 
3334 extern HAMLIB_EXPORT(int)
3335 rig_list_foreach_model HAMLIB_PARAMS((int (*cfunc)(const rig_model_t rig_model, rig_ptr_t),
3336  rig_ptr_t data));
3337 
3338 extern HAMLIB_EXPORT(int)
3339 rig_load_backend HAMLIB_PARAMS((const char *be_name));
3340 
3341 extern HAMLIB_EXPORT(int)
3342 rig_check_backend HAMLIB_PARAMS((rig_model_t rig_model));
3343 
3344 extern HAMLIB_EXPORT(int)
3345 rig_load_all_backends HAMLIB_PARAMS((void));
3346 
3347 typedef int (*rig_probe_func_t)(const hamlib_port_t *, rig_model_t, rig_ptr_t);
3348 
3349 extern HAMLIB_EXPORT(int)
3350 rig_probe_all HAMLIB_PARAMS((hamlib_port_t *p,
3351  rig_probe_func_t,
3352  rig_ptr_t));
3353 
3354 extern HAMLIB_EXPORT(rig_model_t)
3355 rig_probe HAMLIB_PARAMS((hamlib_port_t *p));
3356 
3357 
3358 /* Misc calls */
3359 extern HAMLIB_EXPORT(const char *) rig_strrmode(rmode_t mode);
3360 extern HAMLIB_EXPORT(int) rig_strrmodes(rmode_t modes, char *buf, int buflen);
3361 extern HAMLIB_EXPORT(const char *) rig_strvfo(vfo_t vfo);
3362 extern HAMLIB_EXPORT(const char *) rig_strfunc(setting_t);
3363 extern HAMLIB_EXPORT(const char *) rig_strlevel(setting_t);
3364 extern HAMLIB_EXPORT(const char *) rig_strparm(setting_t);
3365 extern HAMLIB_EXPORT(const char *) rig_stragclevel(enum agc_level_e level);
3366 extern HAMLIB_EXPORT(enum agc_level_e) rig_levelagcstr (char *agcString);
3367 extern HAMLIB_EXPORT(enum agc_level_e) rig_levelagcvalue (int agcValue);
3368 extern HAMLIB_EXPORT(value_t) rig_valueagclevel (enum agc_level_e agcLevel);
3369 extern HAMLIB_EXPORT(const char *) rig_strptrshift(rptr_shift_t);
3370 extern HAMLIB_EXPORT(const char *) rig_strvfop(vfo_op_t op);
3371 extern HAMLIB_EXPORT(const char *) rig_strscan(scan_t scan);
3372 extern HAMLIB_EXPORT(const char *) rig_strstatus(enum rig_status_e status);
3373 extern HAMLIB_EXPORT(const char *) rig_strmtype(chan_type_t mtype);
3374 extern HAMLIB_EXPORT(const char *) rig_strspectrummode(enum rig_spectrum_mode_e mode);
3375 
3376 extern HAMLIB_EXPORT(rmode_t) rig_parse_mode(const char *s);
3377 extern HAMLIB_EXPORT(vfo_t) rig_parse_vfo(const char *s);
3378 extern HAMLIB_EXPORT(setting_t) rig_parse_func(const char *s);
3379 extern HAMLIB_EXPORT(setting_t) rig_parse_level(const char *s);
3380 extern HAMLIB_EXPORT(setting_t) rig_parse_parm(const char *s);
3381 extern HAMLIB_EXPORT(vfo_op_t) rig_parse_vfo_op(const char *s);
3382 extern HAMLIB_EXPORT(scan_t) rig_parse_scan(const char *s);
3383 extern HAMLIB_EXPORT(rptr_shift_t) rig_parse_rptr_shift(const char *s);
3384 extern HAMLIB_EXPORT(chan_type_t) rig_parse_mtype(const char *s);
3385 
3386 extern HAMLIB_EXPORT(const char *) rig_license HAMLIB_PARAMS((void));
3387 extern HAMLIB_EXPORT(const char *) rig_version HAMLIB_PARAMS((void));
3388 extern HAMLIB_EXPORT(const char *) rig_copyright HAMLIB_PARAMS((void));
3389 
3390 extern HAMLIB_EXPORT(void) rig_no_restore_ai(void);
3391 
3392 extern HAMLIB_EXPORT(int) rig_get_cache_timeout_ms(RIG *rig, hamlib_cache_t selection);
3393 extern HAMLIB_EXPORT(int) rig_set_cache_timeout_ms(RIG *rig, hamlib_cache_t selection, int ms);
3394 
3395 extern HAMLIB_EXPORT(int) rig_set_vfo_opt(RIG *rig, int status);
3396 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);
3397 extern HAMLIB_EXPORT(int) rig_get_rig_info(RIG *rig, char *response, int max_response_len);
3398 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);
3399 extern HAMLIB_EXPORT(int) rig_get_cache_freq(RIG *rig, vfo_t vfo, freq_t *freq, int * cache_ms_freq);
3400 
3401 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);
3402 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);
3403 
3404 typedef unsigned long rig_useconds_t;
3405 extern HAMLIB_EXPORT(int) hl_usleep(rig_useconds_t msec);
3406 
3407 extern HAMLIB_EXPORT(int) rig_cookie(RIG *rig, enum cookie_e cookie_cmd, char *cookie, int cookie_len);
3408 
3409 extern HAMLIB_EXPORT(int) rig_password(RIG *rig, const char *key1);
3410 extern HAMLIB_EXPORT(void) rig_password_generate_secret(char *pass,
3411  char result[HAMLIB_SECRET_LENGTH + 1]);
3412 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);
3413 
3414 extern HAMLIB_EXPORT(int)
3415 longlat2locator HAMLIB_PARAMS((double longitude,
3416  double latitude,
3417  char *locator_res,
3418  int pair_count));
3419 
3420 extern HAMLIB_EXPORT(int)
3421 locator2longlat HAMLIB_PARAMS((double *longitude,
3422  double *latitude,
3423  const char *locator));
3424 
3425 extern HAMLIB_EXPORT(char*) rig_make_md5(char *pass);
3426 
3427 extern HAMLIB_EXPORT(int) rig_set_lock_mode(RIG *rig, int lock);
3428 extern HAMLIB_EXPORT(int) rig_get_lock_mode(RIG *rig, int *lock);
3429 
3430 
3432 
3433 __END_DECLS
3434 
3435 #endif /* _RIG_H */
3436 
setting_t rig_parse_parm(const char *s)
Convert alpha string to RIG_PARM_...
Definition: misc.c:1170
vfo_t rig_parse_vfo(const char *s)
Convert alpha string to enum RIG_VFO_...
Definition: misc.c:638
enum agc_level_e rig_levelagcstr(char *agcString)
Convert AGC string... to agc_level_e.
Definition: misc.c:1371
const char * rig_strparm(setting_t parm)
Convert enum RIG_PARM_... to alpha string.
Definition: misc.c:1220
const char * rig_strptrshift(rptr_shift_t shift)
convert enum RIG_RPT_SHIFT_... to printable character
Definition: misc.c:1541
int rig_strrmodes(rmode_t modes, char *buf, int buflen)
Convert RIG_MODE or'd value to alpha string of all modes.
Definition: misc.c:570
rptr_shift_t rig_parse_rptr_shift(const char *s)
Convert alpha char to enum RIG_RPT_SHIFT_...
Definition: misc.c:1566
value_t rig_valueagclevel(enum agc_level_e agcLevel)
Convert a enum agc_level_e to value.
Definition: misc.c:1320
uint64_t rig_idx2setting(int i)
Definition: misc.c:758
const char * rig_strstatus(enum rig_status_e status)
Convert enum RIG_STATUS_... to printable string.
Definition: misc.c:427
chan_type_t rig_parse_mtype(const char *s)
Convert alpha string to enum RIG_MTYPE_...
Definition: misc.c:1609
const char * rig_strmtype(chan_type_t mtype)
Convert enum RIG_MTYPE_... to alpha string.
Definition: misc.c:1634
enum agc_level_e rig_levelagcvalue(int agcValue)
Convert a value to agc_level_e – constrains the range.
Definition: misc.c:1340
const char * rig_strspectrummode(enum rig_spectrum_mode_e mode)
Convert enum RIG_SPECTRUM_MODE_... to alpha string.
Definition: misc.c:1674
const char * rig_strrmode(rmode_t mode)
Convert enum RIG_MODE to alpha string.
Definition: misc.c:538
const char * rig_strscan(scan_t rscan)
Convert enum RIG_SCAN_... to alpha string.
Definition: misc.c:1512
setting_t rig_parse_level(const char *s)
Convert alpha string to enum RIG_LEVEL_...
Definition: misc.c:971
scan_t rig_parse_scan(const char *s)
Convert alpha string to enum RIG_SCAN_...
Definition: misc.c:1487
const char * rig_stragclevel(enum agc_level_e level)
Convert enum RIG_AGC_... to alpha string.
Definition: misc.c:1295
setting_t rig_parse_func(const char *s)
Convert alpha string to enum RIG_FUNC_...
Definition: misc.c:770
const char * rig_strvfo(vfo_t vfo)
Convert enum RIG_VFO_... to alpha string.
Definition: misc.c:667
rmode_t rig_parse_mode(const char *s)
Convert alpha string to enum RIG_MODE.
Definition: misc.c:512
const char * rig_strvfop(vfo_op_t op)
Convert enum RIG_OP_... to alpha string.
Definition: misc.c:1442
const char * rig_strlevel(setting_t level)
Convert enum RIG_LEVEL_... to alpha string.
Definition: misc.c:1052
const char * rig_strfunc(setting_t func)
Convert enum RIG_FUNC_... to alpha string.
Definition: misc.c:820
vfo_op_t rig_parse_vfo_op(const char *s)
Convert alpha string to enum RIG_OP_...
Definition: misc.c:1417
int rig_set_vfo(RIG *rig, vfo_t vfo)
set the current VFO
Definition: rig.c:2713
unsigned int vfo_t
VFO definition.
Definition: rig.h:469
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:4838
int rig_set_ext_level(RIG *rig, vfo_t vfo, token_t token, value_t val)
set a radio level extra parameter
Definition: settings.c:613
int rig_send_dtmf(RIG *rig, vfo_t vfo, const char *digits)
send DTMF digits
Definition: rig.c:6380
int rig_set_twiddle(RIG *rig, int seconds)
timeout (secs) to stop rigctld when VFO is manually changed
Definition: rig.c:1589
int rig_get_rig_info(RIG *rig, char *response, int max_response_len)
get freq/mode/width for requested VFO
Definition: rig.c:6980
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:1529
int rig_get_dcd(RIG *rig, vfo_t vfo, dcd_t *dcd)
get the status of the DCD
Definition: rig.c:3564
serial_parity_e
Serial parity.
Definition: rig.h:285
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:5064
int rig_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
Definition: rig.c:2395
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:243
int rig_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan)
set channel data
Definition: mem.c:685
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:4900
dcd_e
Definition: rig.h:605
int rig_set_freq_callback(RIG *rig, freq_cb_t cb, rig_ptr_t arg)
set the callback for freq events
Definition: event.c:359
hamlib_port_t_deprecated port_t_deprecated
Rig data structure.
Definition: rig.h:2362
hamlib_band_t
Band enumeration.
Definition: rig.h:721
const char * hamlib_copyright2
Hamlib copyright notice.
Definition: rig.c:105
int rig_get_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t *rptr_offs)
get the current repeater offset
Definition: rig.c:3945
int rig_set_powerstat(RIG *rig, powerstat_t status)
turn on/off the radio
Definition: rig.c:5981
int rig_get_powerstat(RIG *rig, powerstat_t *status)
get the on/off status of the radio
Definition: rig.c:6019
int rig_set_dcs_sql(RIG *rig, vfo_t vfo, tone_t code)
set the current DCS code
Definition: tones.c:489
serial_control_state_e
Serial control state.
Definition: rig.h:307
int rig_set_mem(RIG *rig, vfo_t vfo, int ch)
set the current memory channel number
Definition: mem.c:69
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:5828
setting_t rig_has_set_func(RIG *rig, setting_t func)
check ability of radio functions
Definition: settings.c:445
int rig_get_vfo(RIG *rig, vfo_t *vfo)
get the current VFO
Definition: rig.c:2873
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:4719
uint64_t rmode_t
Radio mode.
Definition: rig.h:1249
int rig_set_vfo_callback(RIG *rig, vfo_cb_t cb, rig_ptr_t arg)
set the callback for vfo events
Definition: event.c:415
shortfreq_t pbwidth_t
Definition: rig.h:601
int rig_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
set a radio level setting
Definition: settings.c:72
int rig_get_rit(RIG *rig, vfo_t vfo, shortfreq_t *rit)
get the current RIT offset
Definition: rig.c:5280
int rig_cleanup(RIG *rig)
release a rig handle and free associated memory
Definition: rig.c:1547
rig_type_t
Rig type flags.
Definition: rig.h:317
int rig_get_mem(RIG *rig, vfo_t vfo, int *ch)
get the current memory channel number
Definition: mem.c:132
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:1461
enum rig_port_e rig_port_t
Port type.
split_t
Split mode.
Definition: rig.h:398
int rig_get_vfo_list(RIG *rig, char *buf, int buflen)
get list of available vfos
Definition: rig.c:7158
rptr_shift_t
Repeater shift type.
Definition: rig.h:388
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:1327
int rig_get_dcs_sql(RIG *rig, vfo_t vfo, tone_t *code)
get the current DCS code
Definition: tones.c:551
scan_t rig_has_scan(RIG *rig, scan_t scan)
check availability of scanning functions
Definition: rig.c:6277
ptt_type_t
PTT type.
Definition: rig.h:645
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's clock
Definition: rig.c:7192
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:1395
token_t rig_token_lookup(RIG *rig, const char *name)
lookup a token id
Definition: conf.c:1208
int rig_set_ctcss_sql(RIG *rig, vfo_t vfo, tone_t tone)
set CTCSS squelch
Definition: tones.c:360
ann_t
Announce.
Definition: rig.h:830
int rig_set_dcs_code(RIG *rig, vfo_t vfo, tone_t code)
set the current encoding DCS code
Definition: tones.c:228
int rig_set_dcd_callback(RIG *rig, dcd_cb_t cb, rig_ptr_t arg)
set the callback for dcd events
Definition: event.c:471
int rig_get_ext_level(RIG *rig, vfo_t vfo, token_t token, value_t *val)
get the value of a level extra parameter
Definition: settings.c:679
int rig_get_channel(RIG *rig, vfo_t vfox, channel_t *chan, int read_only)
get channel data
Definition: mem.c:829
int rig_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
get the frequency of the target VFO
Definition: rig.c:1963
int rig_set_func(RIG *rig, vfo_t vfo, setting_t func, int status)
activate/de-activate functions of radio
Definition: settings.c:476
int rig_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt)
get the status of the PTT
Definition: rig.c:3270
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:1127
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:5884
int rig_set_bank(RIG *rig, vfo_t vfo, int bank)
set the current memory bank
Definition: mem.c:195
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
int rig_get_ctcss_sql(RIG *rig, vfo_t vfo, tone_t *tone)
get the current CTCSS squelch
Definition: tones.c:427
int rig_get_xit(RIG *rig, vfo_t vfo, shortfreq_t *xit)
get the current XIT offset
Definition: rig.c:5428
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:529
int rig_get_parm(RIG *rig, setting_t parm, value_t *val)
get the value of a parameter
Definition: settings.c:263
int rig_get_trn(RIG *rig, int *trn)
get the current transceive mode
Definition: event.c:586
int rig_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t rptr_offs)
set the repeater offset
Definition: rig.c:3867
int rig_get_ctcss_tone(RIG *rig, vfo_t vfo, tone_t *tone)
get the current CTCSS sub-tone frequency
Definition: tones.c:165
int rig_set_ext_func(RIG *rig, vfo_t vfo, token_t token, int status)
set a radio function extra parameter
Definition: settings.c:744
const struct confparams * rig_confparam_lookup(RIG *rig, const char *name)
lookup a confparam struct
Definition: conf.c:1152
setting_t rig_has_set_level(RIG *rig, setting_t level)
check settable ability of level settings
Definition: settings.c:327
rig_parm_e
Rig Parameters.
Definition: rig.h:1040
int rig_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option)
set the antenna
Definition: rig.c:5657
void rig_set_debug_time_stamp(int flag)
Enable or disable the time stamp on debugging output.
Definition: debug.c:178
shortfreq_t rig_get_resolution(RIG *rig, rmode_t mode)
get the best frequency resolution of the rig
Definition: rig.c:5940
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:7081
pbwidth_t rig_passband_wide(RIG *rig, rmode_t mode)
get the wide passband of a mode
Definition: rig.c:2656
int hl_usleep(rig_useconds_t usec)
provide sleep and usleep replacements
Definition: sleep.c:52
const char * rigerror2(int errnum)
get string describing the error code
Definition: rig.c:396
uint64_t setting_t
Setting.
Definition: rig.h:1091
powerstat_t
Radio power state.
Definition: rig.h:661
multicast_item_e
Multicast data items 3 different data item can be included in the multicast JSON.
Definition: rig.h:1071
setting_t rig_has_get_func(RIG *rig, setting_t func)
check ability of radio functions
Definition: settings.c:415
int rig_set_uplink(RIG *rig, int val)
For GPredict to avoid reading frequency on uplink VFO.
Definition: rig.c:1614
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:549
int rig_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq)
set the split frequencies
Definition: rig.c:4028
int rig_probe_all(hamlib_port_t *port, rig_probe_func_t cfunc, rig_ptr_t data)
try to guess rigs
Definition: rig.c:6135
rig_errcode_e
Definition: rig.h:146
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_conf_e
parameter types
Definition: rig.h:788
scan_t
Rig Scan operation.
Definition: rig.h:750
int rig_send_voice_mem(RIG *rig, vfo_t vfo, int ch)
send voice memory content
Definition: rig.c:6771
int rig_recv_dtmf(RIG *rig, vfo_t vfo, char *digits, int *length)
receive DTMF digits
Definition: rig.c:6456
int rig_set_mode_callback(RIG *rig, mode_cb_t cb, rig_ptr_t arg)
set the callback for mode events
Definition: event.c:387
int rig_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
set the frequency of the target VFO
Definition: rig.c:1722
int rig_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt)
set PTT on/off
Definition: rig.c:2960
int rig_get_conf(RIG *rig, token_t token, char *val)
get the value of a configuration parameter
Definition: conf.c:1292
double freq_t
Frequency type,.
Definition: rig.h:409
int rig_scan(RIG *rig, vfo_t vfo, scan_t scan, int ch)
perform Memory/VFO operations
Definition: rig.c:6309
cookie_e
Rig Cookie enumerations.
Definition: rig.h:1061
int rig_send_morse(RIG *rig, vfo_t vfo, const char *msg)
send morse code
Definition: rig.c:6531
int rig_setting2idx(setting_t s)
basically convert setting_t expressed 2^n to n
Definition: settings.c:934
int rig_get_ext_parm(RIG *rig, token_t token, value_t *val)
get the value of a parm extra parameter
Definition: settings.c:907
int rig_mem_count(RIG *rig)
get memory channel count
Definition: mem.c:1654
ptt_t
PTT status.
Definition: rig.h:632
RIG * rig_init(rig_model_t rig_model)
allocate a new RIG handle
Definition: rig.c:486
setting_t rig_has_get_parm(RIG *rig, setting_t parm)
check retrieval ability of parameter settings
Definition: settings.c:357
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 rig_set_pltune_callback(RIG *rig, pltune_cb_t cb, rig_ptr_t arg)
set the callback for pipelined tuning module
Definition: event.c:501
struct freq_range_list freq_range_t
Frequency range.
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's clock
Definition: rig.c:7176
int rig_set_ctcss_tone(RIG *rig, vfo_t vfo, tone_t tone)
set CTCSS sub-tone frequency
Definition: tones.c:98
int rig_set_ext_parm(RIG *rig, token_t token, value_t val)
set a radio parm extra parameter
Definition: settings.c:875
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:2232
vfo_op_t
VFO operation.
Definition: rig.h:697
int rig_get_ts(RIG *rig, vfo_t vfo, shortfreq_t *ts)
get the current Tuning Step
Definition: rig.c:5576
FILE * rig_set_debug_file(FILE *stream)
Change the output stream from stderr a different stream.
Definition: debug.c:324
signed long shortfreq_t
Short frequency type.
Definition: rig.h:431
token_t rig_ext_token_lookup(RIG *rig, const char *name)
Simple lookup returning token id associated with name.
Definition: ext.c:323
vprintf_cb_t rig_set_debug_callback(vprintf_cb_t cb, rig_ptr_t arg)
Set callback to handle debugging messages.
Definition: debug.c:306
const char * rig_version()
get the Hamlib version
Definition: rig.c:7222
int rig_set_conf(RIG *rig, token_t token, const char *val)
set a radio configuration parameter
Definition: conf.c:1239
int rig_need_debug(enum rig_debug_level_e debug_level)
Test if a given debug level is active.
Definition: debug.c:164
rig_port_e
Port type.
Definition: rig.h:264
int rig_wait_morse(RIG *rig, vfo_t vfo)
wait morse code
Definition: rig.c:6707
int rig_close(RIG *rig)
close the communication to the rig
Definition: rig.c:1387
pbwidth_t rig_passband_narrow(RIG *rig, rmode_t mode)
get the narrow passband of a mode
Definition: rig.c:2604
serial_handshake_e
Serial handshake.
Definition: rig.h:297
int rig_get_ext_func(RIG *rig, vfo_t vfo, token_t token, int *status)
get the value of a function extra parameter
Definition: settings.c:810
const chan_t * rig_lookup_mem_caps(RIG *rig, int ch)
lookup the memory type and capabilities
Definition: mem.c:1588
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:460
agc_level_e
AGC delay settings.
Definition: rig.h:335
dcd_type_t
DCD type.
Definition: rig.h:616
int rig_get_chan_all(RIG *rig, vfo_t vfo, channel_t chans[])
get all channel data
Definition: mem.c:1211
int rig_set_chan_all(RIG *rig, vfo_t vfo, const channel_t chans[])
set all channel data
Definition: mem.c:1168
int rig_set_vfo_opt(RIG *rig, int status)
set the vfo option for rigctld
Definition: rig.c:6876
int rig_set_ptt_callback(RIG *rig, ptt_cb_t cb, rig_ptr_t arg)
set the callback for ptt events
Definition: event.c:443
pbwidth_t rig_passband_normal(RIG *rig, rmode_t mode)
get the normal passband of a mode
Definition: rig.c:2553
rig_debug_level_e
Hamlib debug levels.
Definition: rig.h:197
#define RIG_SETTING_MAX
Maximum # of rig settings.
Definition: rig.h:1097
const struct confparams * rig_ext_lookup_tok(RIG *rig, token_t token)
lookup ext token, return pointer to confparams struct.
Definition: ext.c:279
setting_t rig_has_set_parm(RIG *rig, setting_t parm)
check settable ability of parameter settings
Definition: settings.c:386
const char * rig_license()
get the Hamlib license
Definition: rig.c:7212
int rig_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit)
set the RIT
Definition: rig.c:5209
const char * rig_copyright()
get the Hamlib copyright
Definition: rig.c:7232
int rig_get_twiddle(RIG *rig, int *seconds)
get the twiddle timeout value (secs)
Definition: rig.c:1640
int rig_set_ts(RIG *rig, vfo_t vfo, shortfreq_t ts)
set the Tuning Step
Definition: rig.c:5505
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:5736
int rig_open(RIG *rig)
open the communication to the rig
Definition: rig.c:803
int rig_set_parm(RIG *rig, setting_t parm, value_t val)
set a radio parameter
Definition: settings.c:229
int rig_get_dcs_code(RIG *rig, vfo_t vfo, tone_t *code)
get the current encoding DCS code
Definition: tones.c:290
int rig_stop_morse(RIG *rig, vfo_t vfo)
stop morse code
Definition: rig.c:6603
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
const char * rig_get_info(RIG *rig)
get general information from the radio
Definition: rig.c:6911
setting_t rig_has_get_level(RIG *rig, setting_t level)
check retrieval ability of level settings
Definition: settings.c:297
uint64_t rig_level_e
Rig Level Settings.
Definition: rig.h:952
long token_t
configuration token
Definition: rig.h:766
int rig_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
get the value of a level
Definition: settings.c:142
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:1080
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:4354
int rig_reset(RIG *rig, reset_t reset)
reset the radio
Definition: rig.c:6063
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:1090
int rig_set_trn(RIG *rig, int trn)
control the transceive mode
Definition: event.c:562
vfo_op_t rig_has_vfo_op(RIG *rig, vfo_op_t op)
check retrieval ability of VFO operations
Definition: rig.c:6164
unsigned int ant_t
Antenna typedef.
Definition: rig.h:887
int rig_get_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t *rptr_shift)
get the current repeater shift
Definition: rig.c:3783
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:4577
int rig_set_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t rptr_shift)
set the repeater shift
Definition: rig.c:3705
reset_t
Reset operation.
Definition: rig.h:673
int rig_get_split_freq(RIG *rig, vfo_t vfo, freq_t *tx_freq)
get the current split frequencies
Definition: rig.c:4197
void rig_set_debug(enum rig_debug_level_e debug_level)
Change the current debug level.
Definition: debug.c:148
int rig_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op)
perform Memory/VFO operations
Definition: rig.c:6195
rig_status_e
Development status of the backend.
Definition: rig.h:368
int rig_set_xit(RIG *rig, vfo_t vfo, shortfreq_t xit)
set the XIT
Definition: rig.c:5357
void rig_debug(enum rig_debug_level_e debug_level, const char *fmt,...)
Print debugging messages through stderr by default.
Definition: debug.c:196
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:7261
rig_spectrum_mode_e
Spectrum scope modes.
Definition: rig.h:1699
rig_model_t rig_probe(hamlib_port_t *port)
try to guess a rig
Definition: rig.c:6107
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:6840
chan_type_t
Memory channel type definition.
Definition: rig.h:1550
@ RIG_PARITY_MARK
Definition: rig.h:289
@ RIG_PARITY_NONE
Definition: rig.h:286
@ RIG_PARITY_EVEN
Definition: rig.h:288
@ RIG_PARITY_SPACE
Definition: rig.h:290
@ RIG_PARITY_ODD
Definition: rig.h:287
@ RIG_DCD_ON
Definition: rig.h:607
@ RIG_DCD_OFF
Definition: rig.h:606
@ RIG_BAND_AIR
Definition: rig.h:736
@ RIG_BAND_UNUSED
Definition: rig.h:735
@ RIG_BAND_20M
Definition: rig.h:727
@ RIG_BAND_12M
Definition: rig.h:730
@ RIG_BAND_60M
Definition: rig.h:724
@ RIG_BAND_10M
Definition: rig.h:731
@ RIG_BAND_430MHZ
Definition: rig.h:738
@ RIG_BAND_40M
Definition: rig.h:725
@ RIG_BAND_15M
Definition: rig.h:729
@ RIG_BAND_GEN
Definition: rig.h:733
@ RIG_BAND_30M
Definition: rig.h:726
@ RIG_BAND_144MHZ
Definition: rig.h:737
@ RIG_BAND_80M
Definition: rig.h:723
@ RIG_BAND_MW
Definition: rig.h:734
@ RIG_BAND_6M
Definition: rig.h:732
@ RIG_BAND_17M
Definition: rig.h:728
@ RIG_BAND_160M
Definition: rig.h:722
@ RIG_SIGNAL_ON
Definition: rig.h:309
@ RIG_SIGNAL_OFF
Definition: rig.h:310
@ RIG_SIGNAL_UNSET
Definition: rig.h:308
@ RIG_FLAG_COMPUTER
Definition: rig.h:323
@ RIG_FLAG_TUNER
Definition: rig.h:328
@ RIG_FLAG_SCANNER
Definition: rig.h:320
@ RIG_FLAG_TRANSMITTER
Definition: rig.h:319
@ RIG_FLAG_MOBILE
Definition: rig.h:321
@ RIG_FLAG_TRUNKING
Definition: rig.h:324
@ RIG_FLAG_APRS
Definition: rig.h:325
@ RIG_FLAG_TNC
Definition: rig.h:326
@ RIG_FLAG_HANDHELD
Definition: rig.h:322
@ RIG_FLAG_DXCLUSTER
Definition: rig.h:327
@ RIG_FLAG_RECEIVER
Definition: rig.h:318
@ RIG_SPLIT_ON
Definition: rig.h:400
@ RIG_SPLIT_OFF
Definition: rig.h:399
@ RIG_RPT_SHIFT_PLUS
Definition: rig.h:391
@ RIG_RPT_SHIFT_MINUS
Definition: rig.h:390
@ RIG_RPT_SHIFT_NONE
Definition: rig.h:389
@ RIG_PTT_RIG
Definition: rig.h:647
@ RIG_PTT_RIG_MICDATA
Definition: rig.h:651
@ RIG_PTT_SERIAL_DTR
Definition: rig.h:648
@ RIG_PTT_NONE
Definition: rig.h:646
@ RIG_PTT_PARALLEL
Definition: rig.h:650
@ RIG_PTT_GPION
Definition: rig.h:654
@ RIG_PTT_GPIO
Definition: rig.h:653
@ RIG_PTT_CM108
Definition: rig.h:652
@ RIG_PTT_SERIAL_RTS
Definition: rig.h:649
@ RIG_ANN_RXMODE
Definition: rig.h:834
@ RIG_ANN_OFF
Definition: rig.h:832
@ RIG_ANN_ENG
Definition: rig.h:836
@ RIG_ANN_FREQ
Definition: rig.h:833
@ RIG_ANN_NONE
Definition: rig.h:831
@ RIG_ANN_CW
Definition: rig.h:835
@ RIG_ANN_JAP
Definition: rig.h:837
@ RIG_PARM_BEEP
Definition: rig.h:1045
@ RIG_PARM_TIME
Definition: rig.h:1046
@ RIG_PARM_SCREENSAVER
Definition: rig.h:1049
@ RIG_PARM_ANN
Definition: rig.h:1042
@ RIG_PARM_AFIF
Definition: rig.h:1050
@ RIG_PARM_NONE
Definition: rig.h:1041
@ RIG_PARM_BACKLIGHT
Definition: rig.h:1044
@ RIG_PARM_KEYLIGHT
Definition: rig.h:1048
@ RIG_PARM_BAT
Definition: rig.h:1047
@ RIG_PARM_APO
Definition: rig.h:1043
@ RIG_POWER_OPERATE
Definition: rig.h:665
@ RIG_POWER_UNKNOWN
Definition: rig.h:666
@ RIG_POWER_STANDBY
Definition: rig.h:664
@ RIG_POWER_OFF
Definition: rig.h:662
@ RIG_POWER_ON
Definition: rig.h:663
@ RIG_ENIMPL
Definition: rig.h:151
@ RIG_ECONF
Definition: rig.h:149
@ RIG_ENAVAIL
Definition: rig.h:158
@ RIG_OK
Definition: rig.h:147
@ RIG_EPROTO
Definition: rig.h:155
@ RIG_EEND
Definition: rig.h:168
@ RIG_EINTERNAL
Definition: rig.h:154
@ RIG_EDOM
Definition: rig.h:164
@ RIG_EIO
Definition: rig.h:153
@ RIG_EVFO
Definition: rig.h:163
@ RIG_ETIMEOUT
Definition: rig.h:152
@ RIG_ENOMEM
Definition: rig.h:150
@ RIG_EARG
Definition: rig.h:162
@ RIG_ERJCTED
Definition: rig.h:156
@ RIG_ESECURITY
Definition: rig.h:166
@ RIG_BUSERROR
Definition: rig.h:160
@ RIG_BUSBUSY
Definition: rig.h:161
@ RIG_EDEPRECATED
Definition: rig.h:165
@ RIG_ENTARGET
Definition: rig.h:159
@ RIG_EINVAL
Definition: rig.h:148
@ RIG_ETRUNC
Definition: rig.h:157
@ RIG_CONF_STRING
Definition: rig.h:789
@ RIG_CONF_BUTTON
Definition: rig.h:793
@ RIG_CONF_CHECKBUTTON
Definition: rig.h:792
@ RIG_CONF_BINARY
Definition: rig.h:794
@ RIG_CONF_COMBO
Definition: rig.h:790
@ RIG_CONF_NUMERIC
Definition: rig.h:791
@ RIG_SCAN_DELTA
Definition: rig.h:756
@ RIG_SCAN_PLT
Definition: rig.h:758
@ RIG_SCAN_PROG
Definition: rig.h:755
@ RIG_SCAN_MEM
Definition: rig.h:752
@ RIG_SCAN_NONE
Definition: rig.h:751
@ RIG_SCAN_VFO
Definition: rig.h:757
@ RIG_SCAN_PRIO
Definition: rig.h:754
@ RIG_SCAN_SLCT
Definition: rig.h:753
@ RIG_SCAN_STOP
Definition: rig.h:759
@ RIG_COOKIE_RENEW
Definition: rig.h:1064
@ RIG_COOKIE_RELEASE
Definition: rig.h:1063
@ RIG_COOKIE_GET
Definition: rig.h:1062
@ RIG_PTT_OFF
Definition: rig.h:633
@ RIG_PTT_ON_DATA
Definition: rig.h:636
@ RIG_PTT_ON_MIC
Definition: rig.h:635
@ RIG_PTT_ON
Definition: rig.h:634
@ RIG_OP_CPY
Definition: rig.h:699
@ RIG_OP_DOWN
Definition: rig.h:705
@ RIG_OP_TO_VFO
Definition: rig.h:702
@ RIG_OP_TUNE
Definition: rig.h:710
@ RIG_OP_FROM_VFO
Definition: rig.h:701
@ RIG_OP_MCL
Definition: rig.h:703
@ RIG_OP_RIGHT
Definition: rig.h:709
@ RIG_OP_UP
Definition: rig.h:704
@ RIG_OP_TOGGLE
Definition: rig.h:711
@ RIG_OP_NONE
Definition: rig.h:698
@ RIG_OP_BAND_UP
Definition: rig.h:706
@ RIG_OP_BAND_DOWN
Definition: rig.h:707
@ RIG_OP_LEFT
Definition: rig.h:708
@ RIG_OP_XCHG
Definition: rig.h:700
@ RIG_PORT_PACKET
Definition: rig.h:269
@ RIG_PORT_UDP_NETWORK
Definition: rig.h:275
@ RIG_PORT_NONE
Definition: rig.h:265
@ RIG_PORT_CM108
Definition: rig.h:276
@ RIG_PORT_GPIO
Definition: rig.h:277
@ RIG_PORT_ULTRA
Definition: rig.h:271
@ RIG_PORT_GPION
Definition: rig.h:278
@ RIG_PORT_SERIAL
Definition: rig.h:266
@ RIG_PORT_PARALLEL
Definition: rig.h:273
@ RIG_PORT_NETWORK
Definition: rig.h:267
@ RIG_PORT_DEVICE
Definition: rig.h:268
@ RIG_PORT_RPC
Definition: rig.h:272
@ RIG_PORT_DTMF
Definition: rig.h:270
@ RIG_PORT_USB
Definition: rig.h:274
@ RIG_HANDSHAKE_HARDWARE
Definition: rig.h:300
@ RIG_HANDSHAKE_NONE
Definition: rig.h:298
@ RIG_HANDSHAKE_XONXOFF
Definition: rig.h:299
@ RIG_AGC_USER
Definition: rig.h:340
@ RIG_DCD_SERIAL_CTS
Definition: rig.h:620
@ RIG_DCD_PARALLEL
Definition: rig.h:622
@ RIG_DCD_CM108
Definition: rig.h:623
@ RIG_DCD_RIG
Definition: rig.h:618
@ RIG_DCD_GPION
Definition: rig.h:625
@ RIG_DCD_NONE
Definition: rig.h:617
@ RIG_DCD_SERIAL_DSR
Definition: rig.h:619
@ RIG_DCD_GPIO
Definition: rig.h:624
@ RIG_DCD_SERIAL_CAR
Definition: rig.h:621
@ RIG_DEBUG_ERR
Definition: rig.h:200
@ RIG_DEBUG_BUG
Definition: rig.h:199
@ RIG_DEBUG_WARN
Definition: rig.h:201
@ RIG_DEBUG_TRACE
Definition: rig.h:203
@ RIG_DEBUG_VERBOSE
Definition: rig.h:202
@ RIG_DEBUG_CACHE
Definition: rig.h:204
@ RIG_DEBUG_NONE
Definition: rig.h:198
@ RIG_RESET_MCALL
Definition: rig.h:677
@ RIG_RESET_MASTER
Definition: rig.h:678
@ RIG_RESET_NONE
Definition: rig.h:674
@ RIG_RESET_VFO
Definition: rig.h:676
@ RIG_RESET_SOFT
Definition: rig.h:675
@ RIG_STATUS_STABLE
Definition: rig.h:372
@ RIG_STATUS_BUGGY
Definition: rig.h:373
@ RIG_STATUS_UNTESTED
Definition: rig.h:370
@ RIG_STATUS_BETA
Definition: rig.h:371
@ RIG_STATUS_ALPHA
Definition: rig.h:369
@ RIG_SPECTRUM_MODE_CENTER_SCROLL
Definition: rig.h:1703
@ RIG_SPECTRUM_MODE_FIXED_SCROLL
Definition: rig.h:1704
@ RIG_SPECTRUM_MODE_FIXED
Definition: rig.h:1702
@ RIG_SPECTRUM_MODE_CENTER
Definition: rig.h:1701
@ RIG_MTYPE_PRIO
Definition: rig.h:1558
@ RIG_MTYPE_EDGE
Definition: rig.h:1553
@ RIG_MTYPE_MEM
Definition: rig.h:1552
@ RIG_MTYPE_CALL
Definition: rig.h:1554
@ RIG_MTYPE_SAT
Definition: rig.h:1556
@ RIG_MTYPE_MEMOPAD
Definition: rig.h:1555
@ RIG_MTYPE_NONE
Definition: rig.h:1551
@ RIG_MTYPE_BAND
Definition: rig.h:1557
int locator2longlat(double *longitude, double *latitude, const char *locator)
Convert QRA locator (Maidenhead grid square) to Longitude/Latitude.
Definition: locator.c:451
int longlat2locator(double longitude, double latitude, char *locator, int pair_count)
Convert longitude/latitude to QRA locator (Maidenhead grid square).
Definition: locator.c:545
Calibration table struct for float values.
Definition: rig.h:1655
float val
Definition: rig.h:1659
struct cal_table_float::@4 table[HAMLIB_MAX_CAL_LENGTH]
int size
Definition: rig.h:1656
int raw
Definition: rig.h:1658
Calibration table struct.
Definition: rig.h:1625
int val
Definition: rig.h:1629
struct cal_table::@3 table[HAMLIB_MAX_CAL_LENGTH]
int raw
Definition: rig.h:1628
int size
Definition: rig.h:1626
Memory channel list definition.
Definition: rig.h:1575
int startc
Definition: rig.h:1576
chan_type_t type
Definition: rig.h:1578
channel_cap_t mem_caps
Definition: rig.h:1580
int endc
Definition: rig.h:1577
Channel capability definition.
Definition: rig.h:1503
unsigned tx_vfo
Definition: rig.h:1516
unsigned tx_freq
Definition: rig.h:1511
unsigned mode
Definition: rig.h:1508
unsigned dcs_code
Definition: rig.h:1526
unsigned rit
Definition: rig.h:1520
unsigned dcs_sql
Definition: rig.h:1527
unsigned rptr_offs
Definition: rig.h:1518
unsigned bank_num
Definition: rig.h:1504
setting_t levels
Definition: rig.h:1523
unsigned width
Definition: rig.h:1509
unsigned rptr_shift
Definition: rig.h:1517
unsigned tx_width
Definition: rig.h:1513
unsigned ctcss_sql
Definition: rig.h:1525
unsigned tx_mode
Definition: rig.h:1512
unsigned freq
Definition: rig.h:1507
setting_t funcs
Definition: rig.h:1522
unsigned ctcss_tone
Definition: rig.h:1524
unsigned ext_levels
Definition: rig.h:1531
unsigned vfo
Definition: rig.h:1505
unsigned ant
Definition: rig.h:1506
unsigned split
Definition: rig.h:1515
unsigned scan_group
Definition: rig.h:1528
unsigned flags
Definition: rig.h:1529
unsigned tuning_step
Definition: rig.h:1519
unsigned xit
Definition: rig.h:1521
unsigned channel_desc
Definition: rig.h:1530
Channel structure.
Definition: rig.h:1459
shortfreq_t tuning_step
Definition: rig.h:1477
rmode_t mode
Definition: rig.h:1465
tone_t ctcss_tone
Definition: rig.h:1482
pbwidth_t tx_width
Definition: rig.h:1470
vfo_t vfo
Definition: rig.h:1462
value_t levels[64]
Definition: rig.h:1481
shortfreq_t rptr_offs
Definition: rig.h:1476
vfo_t tx_vfo
Definition: rig.h:1473
tone_t dcs_code
Definition: rig.h:1484
setting_t funcs
Definition: rig.h:1480
struct ext_list * ext_levels
Definition: rig.h:1489
tone_t ctcss_sql
Definition: rig.h:1483
shortfreq_t xit
Definition: rig.h:1479
int bank_num
Definition: rig.h:1461
pbwidth_t width
Definition: rig.h:1466
freq_t freq
Definition: rig.h:1464
rptr_shift_t rptr_shift
Definition: rig.h:1475
shortfreq_t rit
Definition: rig.h:1478
char channel_desc[HAMLIB_MAXCHANDESC]
Definition: rig.h:1488
rmode_t tx_mode
Definition: rig.h:1469
split_t split
Definition: rig.h:1472
freq_t tx_freq
Definition: rig.h:1468
ant_t ant
Definition: rig.h:1463
unsigned int flags
Definition: rig.h:1487
int scan_group
Definition: rig.h:1486
int channel_num
Definition: rig.h:1460
tone_t dcs_sql
Definition: rig.h:1485
Configuration parameter structure.
Definition: rig.h:805
const char * combostr[RIG_COMBO_MAX]
Definition: rig.h:819
const char * tooltip
Definition: rig.h:809
struct confparams::@0::@2 c
const char * dflt
Definition: rig.h:810
float min
Definition: rig.h:814
token_t token
Definition: rig.h:806
float step
Definition: rig.h:816
const char * label
Definition: rig.h:808
float max
Definition: rig.h:815
const char * name
Definition: rig.h:807
struct confparams::@0::@1 n
enum rig_conf_e type
Definition: rig.h:811
union confparams::@0 u
Extension attribute definition.
Definition: rig.h:1442
token_t token
Definition: rig.h:1443
value_t val
Definition: rig.h:1444
Filter definition.
Definition: rig.h:1409
rmode_t modes
Definition: rig.h:1410
pbwidth_t width
Definition: rig.h:1411
Frequency range.
Definition: rig.h:1342
freq_t startf
Definition: rig.h:1343
freq_t endf
Definition: rig.h:1344
int low_power
Definition: rig.h:1346
char * label
Definition: rig.h:1350
ant_t ant
Definition: rig.h:1349
int high_power
Definition: rig.h:1347
vfo_t vfo
Definition: rig.h:1348
rmode_t modes
Definition: rig.h:1345
level/parm granularity definition
Definition: rig.h:1610
value_t max
Definition: rig.h:1612
value_t step
Definition: rig.h:1613
value_t min
Definition: rig.h:1611
Definition: network.c:123
Rig cache data.
Definition: rig.h:2392
Callback functions and args for rig event.
Definition: rig.h:2633
rig_ptr_t mode_arg
Definition: rig.h:2637
ptt_cb_t ptt_event
Definition: rig.h:2640
vfo_cb_t vfo_event
Definition: rig.h:2638
spectrum_cb_t spectrum_event
Definition: rig.h:2646
mode_cb_t mode_event
Definition: rig.h:2636
rig_ptr_t freq_arg
Definition: rig.h:2635
rig_ptr_t spectrum_arg
Definition: rig.h:2647
rig_ptr_t ptt_arg
Definition: rig.h:2641
rig_ptr_t dcd_arg
Definition: rig.h:2643
dcd_cb_t dcd_event
Definition: rig.h:2642
rig_ptr_t pltune_arg
Definition: rig.h:2645
pltune_cb_t pltune
Definition: rig.h:2644
rig_ptr_t vfo_arg
Definition: rig.h:2639
freq_cb_t freq_event
Definition: rig.h:2634
Spectrum scope averaging modes.
Definition: rig.h:1711
Represents a single line of rig spectrum scope FFT data.
Definition: rig.h:1728
size_t spectrum_data_length
Definition: rig.h:1744
freq_t low_edge_freq
Definition: rig.h:1741
int data_level_min
Definition: rig.h:1731
int id
Definition: rig.h:1729
enum rig_spectrum_mode_e spectrum_mode
Definition: rig.h:1736
double signal_strength_max
Definition: rig.h:1734
freq_t center_freq
Definition: rig.h:1738
freq_t span_freq
Definition: rig.h:1739
double signal_strength_min
Definition: rig.h:1733
unsigned char * spectrum_data
Definition: rig.h:1745
int data_level_max
Definition: rig.h:1732
freq_t high_edge_freq
Definition: rig.h:1742
Spectrum scope.
Definition: rig.h:1691
Rig state containing live data and customized fields.
Definition: rig.h:2477
int auto_power_on
Definition: rig.h:2555
int transaction_active
Definition: rig.h:2528
int attenuator[HAMLIB_MAXDBLSTSIZ]
Definition: rig.h:2511
int vfo_opt
Definition: rig.h:2554
int twiddle_rit
Definition: rig.h:2567
setting_t has_set_parm
Definition: rig.h:2518
rmode_t mode_list
Definition: rig.h:2542
int async_data_enabled
Definition: rig.h:2535
shortfreq_t max_rit
Definition: rig.h:2504
freq_t lo_freq
Definition: rig.h:2548
int power_max
Definition: rig.h:2565
gran_t parm_gran[64]
Definition: rig.h:2521
freq_range_t rx_range_list[HAMLIB_FRQRANGESIZ]
Definition: rig.h:2493
hamlib_port_t_deprecated rigport_deprecated
Definition: rig.h:2486
vfo_t rx_vfo
Definition: rig.h:2569
rmode_t current_mode
Definition: rig.h:2538
setting_t has_set_func
Definition: rig.h:2514
int uplink
Definition: rig.h:2552
rig_ptr_t obj
Definition: rig.h:2533
int twiddle_state
Definition: rig.h:2568
struct filter_list filters[HAMLIB_FLTLSTSIZ]
Definition: rig.h:2498
pbwidth_t current_width
Definition: rig.h:2540
int ptt_share
Definition: rig.h:2562
rig_ptr_t priv
Definition: rig.h:2532
freq_range_t tx_range_list[HAMLIB_FRQRANGESIZ]
Definition: rig.h:2494
freq_t current_freq
Definition: rig.h:2537
hamlib_port_t dcdport
Definition: rig.h:2582
time_t twiddle_time
Definition: rig.h:2549
vfo_t tx_vfo
Definition: rig.h:2541
int deprecated_itu_region
Definition: rig.h:2492
int power_min
Definition: rig.h:2564
double vfo_comp
Definition: rig.h:2490
setting_t has_set_level
Definition: rig.h:2516
hamlib_port_t_deprecated pttport_deprecated
Definition: rig.h:2487
shortfreq_t max_xit
Definition: rig.h:2505
hamlib_port_t rigport
Definition: rig.h:2580
int power_now
Definition: rig.h:2563
int twiddle_timeout
Definition: rig.h:2550
int poll_interval
Definition: rig.h:2536
unsigned char disable_yaesu_bandselect
Definition: rig.h:2566
int auto_power_off
Definition: rig.h:2557
setting_t has_get_parm
Definition: rig.h:2517
int preamp[HAMLIB_MAXDBLSTSIZ]
Definition: rig.h:2510
vfo_t current_vfo
Definition: rig.h:2529
hamlib_port_t_deprecated dcdport_deprecated
Definition: rig.h:2488
int auto_disable_screensaver
Definition: rig.h:2559
int comm_state
Definition: rig.h:2531
int vfo_list
Definition: rig.h:2530
setting_t has_get_level
Definition: rig.h:2515
setting_t has_get_func
Definition: rig.h:2513
int transmit
Definition: rig.h:2545
ann_t announces
Definition: rig.h:2508
cal_table_t str_cal
Definition: rig.h:2500
shortfreq_t max_ifshift
Definition: rig.h:2506
gran_t level_gran[64]
Definition: rig.h:2520
hamlib_port_t pttport
Definition: rig.h:2581
struct tuning_step_list tuning_steps[HAMLIB_TSLSTSIZ]
Definition: rig.h:2496
The Rig structure.
Definition: rig.h:2661
struct rig_callbacks callbacks
Definition: rig.h:2664
struct rig_state state
Definition: rig.h:2663
struct rig_caps * caps
Definition: rig.h:2662
Tuning step definition.
Definition: rig.h:1374
rmode_t modes
Definition: rig.h:1375
shortfreq_t ts
Definition: rig.h:1376
Universal approach for passing values.
Definition: rig.h:930
char * s
Definition: rig.h:933
float f
Definition: rig.h:932
const char * cs
Definition: rig.h:934
signed int i
Definition: rig.h:931