Hamlib  4.5.5
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  RIG_AGC_NONE /*< Rig does not have CAT AGC control */
346 };
347 
348 
350 #define RIG_FLAG_TRANSCEIVER (RIG_FLAG_RECEIVER|RIG_FLAG_TRANSMITTER)
351 #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)
352 
353 #define RIG_TYPE_OTHER 0
354 #define RIG_TYPE_TRANSCEIVER RIG_FLAG_TRANSCEIVER
355 #define RIG_TYPE_HANDHELD (RIG_FLAG_TRANSCEIVER|RIG_FLAG_HANDHELD)
356 #define RIG_TYPE_MOBILE (RIG_FLAG_TRANSCEIVER|RIG_FLAG_MOBILE)
357 #define RIG_TYPE_RECEIVER RIG_FLAG_RECEIVER
358 #define RIG_TYPE_PCRECEIVER (RIG_FLAG_COMPUTER|RIG_FLAG_RECEIVER)
359 #define RIG_TYPE_SCANNER (RIG_FLAG_SCANNER|RIG_FLAG_RECEIVER)
360 #define RIG_TYPE_TRUNKSCANNER (RIG_TYPE_SCANNER|RIG_FLAG_TRUNKING)
361 #define RIG_TYPE_COMPUTER (RIG_FLAG_TRANSCEIVER|RIG_FLAG_COMPUTER)
362 #define RIG_TYPE_TUNER RIG_FLAG_TUNER
364 
365 
375  /* RIG_STATUS_NEW * *!< Initial release of code
376  * !! Use of RIG_STATUS_NEW is deprecated. Do not use it anymore */
377 };
378 
383 #define RIG_STATUS_NEW RIG_STATUS_UNTESTED
384 
385 
389 typedef enum {
394 
395 
399 typedef enum {
401  RIG_SPLIT_ON
403 
404 
410 typedef double freq_t;
411 
415 #define PRIfreq ".0f"
416 
420 #define SCNfreq "lf"
424 #define FREQFMT SCNfreq
425 
426 
432 typedef signed long shortfreq_t;
433 
435 #define Hz(f) ((freq_t)(f))
437 #define kHz(f) ((freq_t)((f)*(freq_t)1000))
439 #define MHz(f) ((freq_t)((f)*(freq_t)1000000))
441 #define GHz(f) ((freq_t)((f)*(freq_t)1000000000))
442 
444 #define s_Hz(f) ((shortfreq_t)(f))
446 #define s_kHz(f) ((shortfreq_t)((f)*(shortfreq_t)1000))
448 #define s_MHz(f) ((shortfreq_t)((f)*(shortfreq_t)1000000))
450 #define s_GHz(f) ((shortfreq_t)((f)*(shortfreq_t)1000000000))
451 
453 #define RIG_FREQ_NONE Hz(0)
454 
455 
470 typedef unsigned int vfo_t;
471 
474 #define RIG_VFO_N(n) (1u<<(n))
475 
477 #define RIG_VFO_NONE 0
478 
480 #define RIG_VFO_A RIG_VFO_N(0)
481 
483 #define RIG_VFO_B RIG_VFO_N(1)
484 
486 #define RIG_VFO_C RIG_VFO_N(2)
487 
488 // Any addition VFOS need to go from 3-20
489 // To maintain backward compatibility these values cannot change
490 
492 #define RIG_VFO_SUB_A RIG_VFO_N(21)
493 
495 #define RIG_VFO_SUB_B RIG_VFO_N(22)
496 
498 #define RIG_VFO_SUB_C RIG_VFO_N(3)
499 
501 #define RIG_VFO_MAIN_A RIG_VFO_N(23)
502 
504 #define RIG_VFO_MAIN_B RIG_VFO_N(24)
505 
507 #define RIG_VFO_MAIN_C RIG_VFO_N(4)
508 
510 #define RIG_VFO_OTHER RIG_VFO_N(5)
511 
513 #define RIG_VFO_SUB RIG_VFO_N(25)
514 
516 #define RIG_VFO_MAIN RIG_VFO_N(26)
517 
519 #define RIG_VFO_VFO RIG_VFO_N(27)
520 
522 #define RIG_VFO_MEM RIG_VFO_N(28)
523 
525 #define RIG_VFO_CURR RIG_VFO_N(29)
526 
528 #define RIG_VFO_TX_FLAG RIG_VFO_N(30)
529 
531 #define RIG_VFO_ALL RIG_VFO_N(31)
532 
533 // we can also use RIG_VFO_N(31) if needed
534 
535 // Misc VFO Macros
536 
538 #define RIG_VFO_TX_VFO(v) ((v)|RIG_VFO_TX_FLAG)
539 
541 #define RIG_VFO_TX RIG_VFO_TX_VFO(RIG_VFO_CURR)
542 
544 #define RIG_VFO_RX RIG_VFO_CURR
545 
546 
547 /*
548  * targetable bitfields, for internal use.
549  * In rig.c lack of a flag will case a VFO change if needed
550  * So setting this flag will mean the backend handles any VFO needs
551  * For many rigs RITXIT, PTT, MEM, and BANK are non-VFO commands so need these flags to avoid unnecessary VFO swapping
552  */
554 #define RIG_TARGETABLE_NONE 0
555 #define RIG_TARGETABLE_FREQ (1<<0)
556 #define RIG_TARGETABLE_MODE (1<<1) // mode by vfo or same mode on both vfos
557 #define RIG_TARGETABLE_PURE (1<<2) // deprecated -- not used -- reuse it
558 #define RIG_TARGETABLE_TONE (1<<3)
559 #define RIG_TARGETABLE_FUNC (1<<4)
560 #define RIG_TARGETABLE_LEVEL (1<<5)
561 #define RIG_TARGETABLE_RITXIT (1<<6)
562 #define RIG_TARGETABLE_PTT (1<<7)
563 #define RIG_TARGETABLE_MEM (1<<8)
564 #define RIG_TARGETABLE_BANK (1<<9)
565 #define RIG_TARGETABLE_ANT (1<<10)
566 #define RIG_TARGETABLE_ROOFING (1<<11) // roofing filter targetable by VFO
567 #define RIG_TARGETABLE_SPECTRUM (1<<12) // spectrum scope targetable by VFO
568 #define RIG_TARGETABLE_BAND (1<<13) // Band select -- e.g. Yaeus BS command
569 #define RIG_TARGETABLE_COMMON (RIG_TARGETABLE_RITXIT | RIG_TARGETABLE_PTT | RIG_TARGETABLE_MEM | RIG_TARGETABLE_BANK)
570 #define RIG_TARGETABLE_ALL 0x7fffffff
572 //
573 //
574 // Newer Icoms like the 9700 and 910 have VFOA/B on both Main & Sub
575 // Compared to older rigs which have one or the other
576 // So we need to distinguish between them
578 #define VFO_HAS_A_B ((rig->state.vfo_list & (RIG_VFO_A|RIG_VFO_B)) == (RIG_VFO_A|RIG_VFO_B))
579 #define VFO_HAS_MAIN_SUB ((rig->state.vfo_list & (RIG_VFO_MAIN|RIG_VFO_SUB)) == (RIG_VFO_MAIN|RIG_VFO_SUB))
580 #define VFO_HAS_MAIN_SUB_ONLY ((!VFO_HAS_A_B) & VFO_HAS_MAIN_SUB)
581 #define VFO_HAS_MAIN_SUB_A_B_ONLY (VFO_HAS_A_B & VFO_HAS_MAIN_SUB)
582 #define VFO_HAS_A_B_ONLY (VFO_HAS_A_B & (!VFO_HAS_MAIN_SUB))
583 #define VFO_DUAL (RIG_VFO_MAIN_A|RIG_VFO_MAIN_B|RIG_VFO_SUB_A|RIG_VFO_SUB_B)
584 #define VFO_HAS_DUAL ((rig->state.vfo_list & VFO_DUAL) == VFO_DUAL)
586 
591 #define RIG_PASSBAND_NORMAL s_Hz(0)
592 
596 #define RIG_PASSBAND_NOCHANGE s_Hz(-1)
597 
603 
604 typedef float agc_time_t;
605 
606 typedef enum dcd_e {
608  RIG_DCD_ON
609 } dcd_t;
610 
611 
617 typedef enum {
627 } dcd_type_t;
628 
629 
633 typedef enum {
639 
640 
646 typedef enum {
656 } ptt_type_t;
657 
658 
662 typedef enum {
664  RIG_POWER_ON = (1 << 0),
665  RIG_POWER_STANDBY = (1 << 1),
666  RIG_POWER_OPERATE = (1 << 2),
667  RIG_POWER_UNKNOWN = (1 << 3)
669 
670 
674 typedef enum {
676  RIG_RESET_SOFT = (1 << 0),
677  RIG_RESET_VFO = (1 << 1),
678  RIG_RESET_MCALL = (1 << 2),
679  RIG_RESET_MASTER = (1 << 3)
681 
682 
698 typedef enum {
700  RIG_OP_CPY = (1 << 0),
701  RIG_OP_XCHG = (1 << 1),
702  RIG_OP_FROM_VFO = (1 << 2),
703  RIG_OP_TO_VFO = (1 << 3),
704  RIG_OP_MCL = (1 << 4),
705  RIG_OP_UP = (1 << 5),
706  RIG_OP_DOWN = (1 << 6),
707  RIG_OP_BAND_UP = (1 << 7),
708  RIG_OP_BAND_DOWN = (1 << 8),
709  RIG_OP_LEFT = (1 << 9),
710  RIG_OP_RIGHT = (1 << 10),
711  RIG_OP_TUNE = (1 << 11),
712  RIG_OP_TOGGLE = (1 << 12)
714 
722 typedef enum { // numbers here reflect the Yaesu values
733  RIG_BAND_6M = 10,
735  RIG_BAND_MW = 12,
740 } hamlib_band_t;
741 
742 
751 typedef enum {
753  RIG_SCAN_MEM = (1 << 0),
754  RIG_SCAN_SLCT = (1 << 1),
755  RIG_SCAN_PRIO = (1 << 2),
756  RIG_SCAN_PROG = (1 << 3),
757  RIG_SCAN_DELTA = (1 << 4),
758  RIG_SCAN_VFO = (1 << 5),
759  RIG_SCAN_PLT = (1 << 6),
760  RIG_SCAN_STOP = (1 << 7)
762 
763 
767 typedef long token_t;
768 
769 
771 #define RIG_CONF_END 0
773 
774 
788 /* strongly inspired from soundmodem. Thanks Thomas! */
796 };
797 
799 #define RIG_COMBO_MAX 16
800 #define RIG_BIN_MAX 80
802 
806 struct confparams {
808  const char *name;
809  const char *label;
810  const char *tooltip;
811  const char *dflt;
812  enum rig_conf_e type;
813  union {
814  struct {
815  float min;
816  float max;
817  float step;
818  } n;
819  struct {
820  const char *combostr[RIG_COMBO_MAX];
821  } c;
822  } u;
823 };
824 
825 
831 typedef enum {
834  RIG_ANN_FREQ = (1 << 0),
835  RIG_ANN_RXMODE = (1 << 1),
836  RIG_ANN_CW = (1 << 2),
837  RIG_ANN_ENG = (1 << 3),
838  RIG_ANN_JAP = (1 << 4)
840 
841 
888 typedef unsigned int ant_t;
889 
890 #define RIG_ANT_NONE 0
891 #define RIG_ANT_N(n) ((ant_t)1<<(n))
892 #define RIG_ANT_1 RIG_ANT_N(0)
893 #define RIG_ANT_2 RIG_ANT_N(1)
894 #define RIG_ANT_3 RIG_ANT_N(2)
895 #define RIG_ANT_4 RIG_ANT_N(3)
896 #define RIG_ANT_5 RIG_ANT_N(4)
897 
898 #define RIG_ANT_UNKNOWN RIG_ANT_N(30)
899 #define RIG_ANT_CURR RIG_ANT_N(31)
900 
901 #define RIG_ANT_MAX 32
902 
903 
905 #define RIG_AGC_LAST -1
907 
908 #if 1 // deprecated
912 enum meter_level_e {
913  RIG_METER_NONE = 0, /*< No display meter */
914  RIG_METER_SWR = (1 << 0), /*< Stationary Wave Ratio */
915  RIG_METER_COMP = (1 << 1), /*< Compression level */
916  RIG_METER_ALC = (1 << 2), /*< ALC */
917  RIG_METER_IC = (1 << 3), /*< IC */
918  RIG_METER_DB = (1 << 4), /*< DB */
919  RIG_METER_PO = (1 << 5), /*< Power Out */
920  RIG_METER_VDD = (1 << 6), /*< Final Amp Voltage */
921  RIG_METER_TEMP = (1 << 7) /*< Final Amp Temperature */
922 };
923 #endif
924 
925 
931 typedef union {
932  signed int i;
933  float f;
934  char *s;
935  const char *cs;
937  struct {
938  int l;
939  unsigned char *d; /* Pointer to data buffer */
940  } b;
942 } value_t;
943 
944 
953 typedef uint64_t rig_level_e;
954 #define RIG_LEVEL_NONE 0
955 #define RIG_LEVEL_PREAMP CONSTANT_64BIT_FLAG(0)
956 #define RIG_LEVEL_ATT CONSTANT_64BIT_FLAG(1)
957 #define RIG_LEVEL_VOXDELAY CONSTANT_64BIT_FLAG(2)
958 #define RIG_LEVEL_AF CONSTANT_64BIT_FLAG(3)
959 #define RIG_LEVEL_RF CONSTANT_64BIT_FLAG(4)
960 #define RIG_LEVEL_SQL CONSTANT_64BIT_FLAG(5)
961 #define RIG_LEVEL_IF CONSTANT_64BIT_FLAG(6)
962 #define RIG_LEVEL_APF CONSTANT_64BIT_FLAG(7)
963 #define RIG_LEVEL_NR CONSTANT_64BIT_FLAG(8)
964 #define RIG_LEVEL_PBT_IN CONSTANT_64BIT_FLAG(9)
965 #define RIG_LEVEL_PBT_OUT CONSTANT_64BIT_FLAG(10)
966 #define RIG_LEVEL_CWPITCH CONSTANT_64BIT_FLAG(11)
967 #define RIG_LEVEL_RFPOWER CONSTANT_64BIT_FLAG(12)
968 #define RIG_LEVEL_MICGAIN CONSTANT_64BIT_FLAG(13)
969 #define RIG_LEVEL_KEYSPD CONSTANT_64BIT_FLAG(14)
970 #define RIG_LEVEL_NOTCHF CONSTANT_64BIT_FLAG(15)
971 #define RIG_LEVEL_COMP CONSTANT_64BIT_FLAG(16)
972 #define RIG_LEVEL_AGC CONSTANT_64BIT_FLAG(17)
973 #define RIG_LEVEL_BKINDL CONSTANT_64BIT_FLAG(18)
974 #define RIG_LEVEL_BALANCE CONSTANT_64BIT_FLAG(19)
975 #define RIG_LEVEL_METER CONSTANT_64BIT_FLAG(20)
976 #define RIG_LEVEL_VOXGAIN CONSTANT_64BIT_FLAG(21)
977 #define RIG_LEVEL_ANTIVOX CONSTANT_64BIT_FLAG(22)
978 #define RIG_LEVEL_SLOPE_LOW CONSTANT_64BIT_FLAG(23)
979 #define RIG_LEVEL_SLOPE_HIGH CONSTANT_64BIT_FLAG(24)
980 #define RIG_LEVEL_BKIN_DLYMS CONSTANT_64BIT_FLAG(25)
983 #define RIG_LEVEL_RAWSTR CONSTANT_64BIT_FLAG(26)
984 //#define RIG_LEVEL_SQLSTAT CONSTANT_64BIT_FLAG(27) /*!< \c SQLSTAT -- SQL status, arg int (open=1/closed=0). Deprecated, use get_dcd instead */
985 #define RIG_LEVEL_SWR CONSTANT_64BIT_FLAG(28)
986 #define RIG_LEVEL_ALC CONSTANT_64BIT_FLAG(29)
987 #define RIG_LEVEL_STRENGTH CONSTANT_64BIT_FLAG(30)
988  /* RIG_LEVEL_BWC (1<<31) */
989 #define RIG_LEVEL_RFPOWER_METER CONSTANT_64BIT_FLAG(32)
990 #define RIG_LEVEL_COMP_METER CONSTANT_64BIT_FLAG(33)
991 #define RIG_LEVEL_VD_METER CONSTANT_64BIT_FLAG(34)
992 #define RIG_LEVEL_ID_METER CONSTANT_64BIT_FLAG(35)
994 #define RIG_LEVEL_NOTCHF_RAW CONSTANT_64BIT_FLAG(36)
995 #define RIG_LEVEL_MONITOR_GAIN CONSTANT_64BIT_FLAG(37)
996 #define RIG_LEVEL_NB CONSTANT_64BIT_FLAG(38)
997 #define RIG_LEVEL_RFPOWER_METER_WATTS CONSTANT_64BIT_FLAG(39)
998 #define RIG_LEVEL_SPECTRUM_MODE CONSTANT_64BIT_FLAG(40)
999 #define RIG_LEVEL_SPECTRUM_SPAN CONSTANT_64BIT_FLAG(41)
1000 #define RIG_LEVEL_SPECTRUM_EDGE_LOW CONSTANT_64BIT_FLAG(42)
1001 #define RIG_LEVEL_SPECTRUM_EDGE_HIGH CONSTANT_64BIT_FLAG(43)
1002 #define RIG_LEVEL_SPECTRUM_SPEED CONSTANT_64BIT_FLAG(44)
1003 #define RIG_LEVEL_SPECTRUM_REF CONSTANT_64BIT_FLAG(45)
1004 #define RIG_LEVEL_SPECTRUM_AVG CONSTANT_64BIT_FLAG(46)
1005 #define RIG_LEVEL_SPECTRUM_ATT CONSTANT_64BIT_FLAG(47)
1006 #define RIG_LEVEL_TEMP_METER CONSTANT_64BIT_FLAG(48)
1007 #define RIG_LEVEL_BAND_SELECT CONSTANT_64BIT_FLAG(49)
1008 #define RIG_LEVEL_USB_AF CONSTANT_64BIT_FLAG(50)
1009 #define RIG_LEVEL_AGC_TIME CONSTANT_64BIT_FLAG(51)
1010 #define RIG_LEVEL_52 CONSTANT_64BIT_FLAG(52)
1011 #define RIG_LEVEL_53 CONSTANT_64BIT_FLAG(53)
1012 #define RIG_LEVEL_54 CONSTANT_64BIT_FLAG(54)
1013 #define RIG_LEVEL_55 CONSTANT_64BIT_FLAG(55)
1014 #define RIG_LEVEL_56 CONSTANT_64BIT_FLAG(56)
1015 #define RIG_LEVEL_57 CONSTANT_64BIT_FLAG(57)
1016 #define RIG_LEVEL_58 CONSTANT_64BIT_FLAG(58)
1017 #define RIG_LEVEL_59 CONSTANT_64BIT_FLAG(59)
1018 #define RIG_LEVEL_60 CONSTANT_64BIT_FLAG(60)
1019 #define RIG_LEVEL_61 CONSTANT_64BIT_FLAG(61)
1020 #define RIG_LEVEL_62 CONSTANT_64BIT_FLAG(62)
1021 #define RIG_LEVEL_63 CONSTANT_64BIT_FLAG(63)
1024 #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)
1025 
1026 #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)
1027 
1028 #define RIG_LEVEL_IS_FLOAT(l) ((l)&RIG_LEVEL_FLOAT_LIST)
1029 #define RIG_LEVEL_SET(l) ((l)&~RIG_LEVEL_READONLY_LIST)
1031 
1032 
1043  RIG_PARM_ANN = (1 << 0),
1044  RIG_PARM_APO = (1 << 1),
1045  RIG_PARM_BACKLIGHT = (1 << 2),
1046  RIG_PARM_BEEP = (1 << 4),
1047  RIG_PARM_TIME = (1 << 5),
1048  RIG_PARM_BAT = (1 << 6),
1049  RIG_PARM_KEYLIGHT = (1 << 7),
1051  RIG_PARM_AFIF = (1 << 9)
1052 };
1053 
1062 enum cookie_e {
1066 };
1067 
1073  RIG_MULTICAST_POLL, // hamlib will be polling the rig for all rig items
1074  RIG_MULTICAST_TRANSCEIVE, // transceive will be turned on and processed
1075  RIG_MULTICAST_SPECTRUM // spectrum data will be included
1076 };
1077 
1079 #define RIG_PARM_FLOAT_LIST (RIG_PARM_BACKLIGHT|RIG_PARM_BAT|RIG_PARM_KEYLIGHT)
1080 #define RIG_PARM_READONLY_LIST (RIG_PARM_BAT)
1081 
1082 #define RIG_PARM_IS_FLOAT(l) ((l)&RIG_PARM_FLOAT_LIST)
1083 #define RIG_PARM_SET(l) ((l)&~RIG_PARM_READONLY_LIST)
1085 
1092 typedef uint64_t setting_t;
1093 
1098 #define RIG_SETTING_MAX 64
1099 
1116 #define RIG_TRN_OFF 0
1117 #define RIG_TRN_RIG 1
1118 #define RIG_TRN_POLL 2
1119 
1120 
1129 /*
1130  * The C standard dictates that an enum constant is a 32 bit signed integer.
1131  * Setting a constant's bit 31 created a negative value that on amd64 had the
1132  * upper 32 bits set as well when assigned to the misc.c:rig_func_str structure.
1133  * This caused misc.c:rig_strfunc() to fail its comparison for RIG_FUNC_XIT
1134  * on amd64 (x86_64). To use bit 31 as an unsigned long, preprocessor macros
1135  * have been used instead as a 'const unsigned long' which cannot be used to
1136  * initialize the rig_func_str.func members. TNX KA6MAL, AC6SL. - N0NB
1137  */
1138 #define RIG_FUNC_NONE 0
1139 #define RIG_FUNC_FAGC CONSTANT_64BIT_FLAG (0)
1140 #define RIG_FUNC_NB CONSTANT_64BIT_FLAG (1)
1141 #define RIG_FUNC_COMP CONSTANT_64BIT_FLAG (2)
1142 #define RIG_FUNC_VOX CONSTANT_64BIT_FLAG (3)
1143 #define RIG_FUNC_TONE CONSTANT_64BIT_FLAG (4)
1144 #define RIG_FUNC_TSQL CONSTANT_64BIT_FLAG (5)
1145 #define RIG_FUNC_SBKIN CONSTANT_64BIT_FLAG (6)
1146 #define RIG_FUNC_FBKIN CONSTANT_64BIT_FLAG (7)
1147 #define RIG_FUNC_ANF CONSTANT_64BIT_FLAG (8)
1148 #define RIG_FUNC_NR CONSTANT_64BIT_FLAG (9)
1149 #define RIG_FUNC_AIP CONSTANT_64BIT_FLAG (10)
1150 #define RIG_FUNC_APF CONSTANT_64BIT_FLAG (11)
1151 #define RIG_FUNC_MON CONSTANT_64BIT_FLAG (12)
1152 #define RIG_FUNC_MN CONSTANT_64BIT_FLAG (13)
1153 #define RIG_FUNC_RF CONSTANT_64BIT_FLAG (14)
1154 #define RIG_FUNC_ARO CONSTANT_64BIT_FLAG (15)
1155 #define RIG_FUNC_LOCK CONSTANT_64BIT_FLAG (16)
1156 #define RIG_FUNC_MUTE CONSTANT_64BIT_FLAG (17)
1157 #define RIG_FUNC_VSC CONSTANT_64BIT_FLAG (18)
1158 #define RIG_FUNC_REV CONSTANT_64BIT_FLAG (19)
1159 #define RIG_FUNC_SQL CONSTANT_64BIT_FLAG (20)
1160 #define RIG_FUNC_ABM CONSTANT_64BIT_FLAG (21)
1161 #define RIG_FUNC_BC CONSTANT_64BIT_FLAG (22)
1162 #define RIG_FUNC_MBC CONSTANT_64BIT_FLAG (23)
1163 #define RIG_FUNC_RIT CONSTANT_64BIT_FLAG (24)
1164 #define RIG_FUNC_AFC CONSTANT_64BIT_FLAG (25)
1165 #define RIG_FUNC_SATMODE CONSTANT_64BIT_FLAG (26)
1166 #define RIG_FUNC_SCOPE CONSTANT_64BIT_FLAG (27)
1167 #define RIG_FUNC_RESUME CONSTANT_64BIT_FLAG (28)
1168 #define RIG_FUNC_TBURST CONSTANT_64BIT_FLAG (29)
1169 #define RIG_FUNC_TUNER CONSTANT_64BIT_FLAG (30)
1170 #define RIG_FUNC_XIT CONSTANT_64BIT_FLAG (31)
1171 #ifndef SWIGLUAHIDE
1172 /* Hide the top 32 bits from the old Lua binding as they can't be represented */
1173 #define RIG_FUNC_NB2 CONSTANT_64BIT_FLAG (32)
1174 #define RIG_FUNC_CSQL CONSTANT_64BIT_FLAG (33)
1175 #define RIG_FUNC_AFLT CONSTANT_64BIT_FLAG (34)
1176 #define RIG_FUNC_ANL CONSTANT_64BIT_FLAG (35)
1177 #define RIG_FUNC_BC2 CONSTANT_64BIT_FLAG (36)
1178 #define RIG_FUNC_DUAL_WATCH CONSTANT_64BIT_FLAG (37)
1179 #define RIG_FUNC_DIVERSITY CONSTANT_64BIT_FLAG (38)
1180 #define RIG_FUNC_DSQL CONSTANT_64BIT_FLAG (39)
1181 #define RIG_FUNC_SCEN CONSTANT_64BIT_FLAG (40)
1182 #define RIG_FUNC_SLICE CONSTANT_64BIT_FLAG (41)
1183 #define RIG_FUNC_TRANSCEIVE CONSTANT_64BIT_FLAG (42)
1184 #define RIG_FUNC_SPECTRUM CONSTANT_64BIT_FLAG (43)
1185 #define RIG_FUNC_SPECTRUM_HOLD CONSTANT_64BIT_FLAG (44)
1186 #define RIG_FUNC_SEND_MORSE CONSTANT_64BIT_FLAG (45)
1187 #define RIG_FUNC_SEND_VOICE_MEM CONSTANT_64BIT_FLAG (46)
1188 #define RIG_FUNC_OVF_STATUS CONSTANT_64BIT_FLAG (47)
1189 #define RIG_FUNC_BIT48 CONSTANT_64BIT_FLAG (48)
1190 #define RIG_FUNC_BIT49 CONSTANT_64BIT_FLAG (49)
1191 #define RIG_FUNC_BIT50 CONSTANT_64BIT_FLAG (50)
1192 #define RIG_FUNC_BIT51 CONSTANT_64BIT_FLAG (51)
1193 #define RIG_FUNC_BIT52 CONSTANT_64BIT_FLAG (52)
1194 #define RIG_FUNC_BIT53 CONSTANT_64BIT_FLAG (53)
1195 #define RIG_FUNC_BIT54 CONSTANT_64BIT_FLAG (54)
1196 #define RIG_FUNC_BIT55 CONSTANT_64BIT_FLAG (55)
1197 #define RIG_FUNC_BIT56 CONSTANT_64BIT_FLAG (56)
1198 #define RIG_FUNC_BIT57 CONSTANT_64BIT_FLAG (57)
1199 #define RIG_FUNC_BIT58 CONSTANT_64BIT_FLAG (58)
1200 #define RIG_FUNC_BIT59 CONSTANT_64BIT_FLAG (59)
1201 #define RIG_FUNC_BIT60 CONSTANT_64BIT_FLAG (60)
1202 #define RIG_FUNC_BIT61 CONSTANT_64BIT_FLAG (61)
1203 #define RIG_FUNC_BIT62 CONSTANT_64BIT_FLAG (62)
1204 #define RIG_FUNC_BIT63 CONSTANT_64BIT_FLAG (63)
1205 /* 63 is this highest bit number that can be used */
1206 #endif
1207 
1214 #define mW(p) ((int)(p))
1222 #define Watts(p) ((int)((p)*1000))
1229 #define W(p) Watts(p)
1230 #if 0 // deprecating kW macro as this doesn't make sense
1237 #define kW(p) ((int)((p)*1000000L))
1238 #endif
1239 
1240 
1250 typedef uint64_t rmode_t;
1251 
1252 #define RIG_MODE_NONE 0
1253 #define RIG_MODE_AM CONSTANT_64BIT_FLAG (0)
1254 #define RIG_MODE_CW CONSTANT_64BIT_FLAG (1)
1255 #define RIG_MODE_USB CONSTANT_64BIT_FLAG (2)
1256 #define RIG_MODE_LSB CONSTANT_64BIT_FLAG (3)
1257 #define RIG_MODE_RTTY CONSTANT_64BIT_FLAG (4)
1258 #define RIG_MODE_FM CONSTANT_64BIT_FLAG (5)
1259 #define RIG_MODE_WFM CONSTANT_64BIT_FLAG (6)
1260 #define RIG_MODE_CWR CONSTANT_64BIT_FLAG (7)
1261 #define RIG_MODE_RTTYR CONSTANT_64BIT_FLAG (8)
1262 #define RIG_MODE_AMS CONSTANT_64BIT_FLAG (9)
1263 #define RIG_MODE_PKTLSB CONSTANT_64BIT_FLAG (10)
1264 #define RIG_MODE_PKTUSB CONSTANT_64BIT_FLAG (11)
1265 #define RIG_MODE_PKTFM CONSTANT_64BIT_FLAG (12)
1266 #define RIG_MODE_ECSSUSB CONSTANT_64BIT_FLAG (13)
1267 #define RIG_MODE_ECSSLSB CONSTANT_64BIT_FLAG (14)
1268 #define RIG_MODE_FAX CONSTANT_64BIT_FLAG (15)
1269 #define RIG_MODE_SAM CONSTANT_64BIT_FLAG (16)
1270 #define RIG_MODE_SAL CONSTANT_64BIT_FLAG (17)
1271 #define RIG_MODE_SAH CONSTANT_64BIT_FLAG (18)
1272 #define RIG_MODE_DSB CONSTANT_64BIT_FLAG (19)
1273 #define RIG_MODE_FMN CONSTANT_64BIT_FLAG (21)
1274 #define RIG_MODE_PKTAM CONSTANT_64BIT_FLAG (22)
1275 #define RIG_MODE_P25 CONSTANT_64BIT_FLAG (23)
1276 #define RIG_MODE_DSTAR CONSTANT_64BIT_FLAG (24)
1277 #define RIG_MODE_DPMR CONSTANT_64BIT_FLAG (25)
1278 #define RIG_MODE_NXDNVN CONSTANT_64BIT_FLAG (26)
1279 #define RIG_MODE_NXDN_N CONSTANT_64BIT_FLAG (27)
1280 #define RIG_MODE_DCR CONSTANT_64BIT_FLAG (28)
1281 #define RIG_MODE_AMN CONSTANT_64BIT_FLAG (29)
1282 #define RIG_MODE_PSK CONSTANT_64BIT_FLAG (30)
1283 #define RIG_MODE_PSKR CONSTANT_64BIT_FLAG (31)
1284 #ifndef SWIGLUAHIDE
1285 /* hide the top 32 bits from the Lua binding as they will not work */
1286 #define RIG_MODE_DD CONSTANT_64BIT_FLAG (32)
1287 #define RIG_MODE_C4FM CONSTANT_64BIT_FLAG (33)
1288 #define RIG_MODE_PKTFMN CONSTANT_64BIT_FLAG (34)
1289 #define RIG_MODE_SPEC CONSTANT_64BIT_FLAG (35)
1290 #define RIG_MODE_CWN CONSTANT_64BIT_FLAG (36)
1291 #define RIG_MODE_IQ CONSTANT_64BIT_FLAG (37)
1292 #define RIG_MODE_ISBUSB CONSTANT_64BIT_FLAG (38)
1293 #define RIG_MODE_ISBLSB CONSTANT_64BIT_FLAG (39)
1294 #define RIG_MODE_BIT40 CONSTANT_64BIT_FLAG (40)
1295 #define RIG_MODE_BIT41 CONSTANT_64BIT_FLAG (41)
1296 #define RIG_MODE_BIT42 CONSTANT_64BIT_FLAG (42)
1297 #define RIG_MODE_BIT43 CONSTANT_64BIT_FLAG (43)
1298 #define RIG_MODE_BIT44 CONSTANT_64BIT_FLAG (44)
1299 #define RIG_MODE_BIT45 CONSTANT_64BIT_FLAG (45)
1300 #define RIG_MODE_BIT46 CONSTANT_64BIT_FLAG (46)
1301 #define RIG_MODE_BIT47 CONSTANT_64BIT_FLAG (47)
1302 #define RIG_MODE_BIT48 CONSTANT_64BIT_FLAG (48)
1303 #define RIG_MODE_BIT49 CONSTANT_64BIT_FLAG (49)
1304 #define RIG_MODE_BIT50 CONSTANT_64BIT_FLAG (50)
1305 #define RIG_MODE_BIT51 CONSTANT_64BIT_FLAG (51)
1306 #define RIG_MODE_BIT52 CONSTANT_64BIT_FLAG (52)
1307 #define RIG_MODE_BIT53 CONSTANT_64BIT_FLAG (53)
1308 #define RIG_MODE_BIT54 CONSTANT_64BIT_FLAG (54)
1309 #define RIG_MODE_BIT55 CONSTANT_64BIT_FLAG (55)
1310 #define RIG_MODE_BIT56 CONSTANT_64BIT_FLAG (56)
1311 #define RIG_MODE_BIT57 CONSTANT_64BIT_FLAG (57)
1312 #define RIG_MODE_BIT58 CONSTANT_64BIT_FLAG (58)
1313 #define RIG_MODE_BIT59 CONSTANT_64BIT_FLAG (59)
1314 #define RIG_MODE_BIT60 CONSTANT_64BIT_FLAG (60)
1315 #define RIG_MODE_BIT61 CONSTANT_64BIT_FLAG (61)
1316 #define RIG_MODE_BIT62 CONSTANT_64BIT_FLAG (62)
1317 #define RIG_MODE_TESTS_MAX CONSTANT_64BIT_FLAG (63)
1318 #define RIG_MODE_ALL (0xffffffff)
1319 #endif
1320 
1324 #define RIG_MODE_SSB (RIG_MODE_USB|RIG_MODE_LSB)
1325 
1329 #define RIG_MODE_ECSS (RIG_MODE_ECSSUSB|RIG_MODE_ECSSLSB)
1330 
1332 #define RIG_DBLST_END 0 /* end marker in a preamp/att level list */
1333 #define RIG_IS_DBLST_END(d) ((d)==0)
1335 
1336 
1343 typedef struct freq_range_list {
1351  char *label;
1353 
1355 #define RIG_FRNG_END {Hz(0),Hz(0),RIG_MODE_NONE,0,0,RIG_VFO_NONE}
1356 #define RIG_IS_FRNG_END(r) ((r).startf == Hz(0) && (r).endf == Hz(0))
1358 
1378 };
1379 
1381 #define RIG_TS_ANY 0
1382 #define RIG_TS_END {RIG_MODE_NONE, 0}
1383 #define RIG_IS_TS_END(t) ((t).modes == RIG_MODE_NONE && (t).ts == 0)
1385 
1386 
1410 struct filter_list {
1413 };
1415 #define RIG_FLT_ANY 0
1416 #define RIG_FLT_END {RIG_MODE_NONE, 0}
1417 #define RIG_IS_FLT_END(f) ((f).modes == RIG_MODE_NONE)
1418 #define DEBUGMSGSAVE_SIZE 24000
1420 
1421 
1425 #define RIG_CHFLAG_NONE 0
1429 #define RIG_CHFLAG_SKIP (1<<0)
1433 #define RIG_CHFLAG_DATA (1<<1)
1437 #define RIG_CHFLAG_PSKIP (1<<2)
1438 
1443 struct ext_list {
1446 };
1447 
1449 #define RIG_EXT_END {0, {.i=0}}
1450 #define RIG_IS_EXT_END(x) ((x).token == 0)
1452 
1460 struct channel {
1462  int bank_num;
1483  tone_t ctcss_tone;
1484  tone_t ctcss_sql;
1485  tone_t dcs_code;
1486  tone_t dcs_sql;
1488  unsigned int flags;
1489  char channel_desc[HAMLIB_MAXCHANDESC];
1490  struct ext_list
1492 };
1493 
1497 typedef struct channel channel_t;
1498 
1504 struct channel_cap {
1505  unsigned bank_num: 1;
1506  unsigned vfo: 1;
1507  unsigned ant: 1;
1508  unsigned freq: 1;
1509  unsigned mode: 1;
1510  unsigned width: 1;
1512  unsigned tx_freq: 1;
1513  unsigned tx_mode: 1;
1514  unsigned tx_width: 1;
1516  unsigned split: 1;
1517  unsigned tx_vfo: 1;
1518  unsigned rptr_shift: 1;
1519  unsigned rptr_offs: 1;
1520  unsigned tuning_step: 1;
1521  unsigned rit: 1;
1522  unsigned xit: 1;
1525  unsigned ctcss_tone: 1;
1526  unsigned ctcss_sql: 1;
1527  unsigned dcs_code: 1;
1528  unsigned dcs_sql: 1;
1529  unsigned scan_group: 1;
1530  unsigned flags: 1;
1531  unsigned channel_desc: 1;
1532  unsigned ext_levels: 1;
1533 };
1534 
1538 typedef struct channel_cap channel_cap_t;
1539 
1540 
1551 typedef enum {
1561 
1562 
1576 struct chan_list {
1577  int startc;
1578  int endc;
1582 };
1583 
1585 #define RIG_CHAN_END {0,0,RIG_MTYPE_NONE}
1586 #define RIG_IS_CHAN_END(c) ((c).type == RIG_MTYPE_NONE)
1588 
1592 #define RIG_MEM_CAPS_ALL -1
1593 
1597 typedef struct chan_list chan_t;
1598 
1599 
1611 struct gran {
1615 };
1616 
1620 typedef struct gran gran_t;
1621 
1622 
1626 struct cal_table {
1627  int size;
1628  struct {
1629  int raw;
1630  int val;
1631  } table[HAMLIB_MAX_CAL_LENGTH];
1632 };
1633 
1646 typedef struct cal_table cal_table_t;
1647 
1649 #define EMPTY_STR_CAL { 0, { { 0, 0 }, } }
1651 
1652 
1657  int size;
1658  struct {
1659  int raw;
1660  float val;
1661  } table[HAMLIB_MAX_CAL_LENGTH];
1662 };
1663 
1676 typedef struct cal_table_float cal_table_float_t;
1677 
1679 #define EMPTY_FLOAT_CAL { 0, { { 0, 0f }, } }
1680 
1681 typedef int (* chan_cb_t)(RIG *, vfo_t vfo, channel_t **, int, const chan_t *, rig_ptr_t);
1682 typedef int (* confval_cb_t)(RIG *,
1683  const struct confparams *,
1684  value_t *,
1685  rig_ptr_t);
1687 
1692 {
1693  int id;
1694  char *name;
1695 };
1696 
1701  RIG_SPECTRUM_MODE_NONE = 0,
1706 };
1707 
1712 {
1713  int id;
1714  char *name;
1715 };
1716 
1729 {
1730  int id;
1746  unsigned char *spectrum_data;
1747 };
1748 
1769 #define RIG_MODEL(arg) .rig_model=arg,.macro_name=#arg
1770 #define HAMLIB_CHECK_RIG_CAPS "HAMLIB_CHECK_RIG_CAPS"
1771 struct rig_caps {
1772  rig_model_t rig_model;
1773  const char *model_name;
1774  const char *mfg_name;
1775  const char *version;
1776  const char *copyright;
1777  enum rig_status_e status;
1779  int rig_type;
1780  ptt_type_t ptt_type;
1781  dcd_type_t dcd_type;
1782  rig_port_t port_type;
1784  int serial_rate_min;
1785  int serial_rate_max;
1786  int serial_data_bits;
1787  int serial_stop_bits;
1788  enum serial_parity_e serial_parity;
1789  enum serial_handshake_e serial_handshake;
1791  int write_delay;
1792  int post_write_delay;
1793  int timeout;
1794  int retry;
1796  setting_t has_get_func;
1797  setting_t has_set_func;
1798  setting_t has_get_level;
1799  setting_t has_set_level;
1800  setting_t has_get_parm;
1801  setting_t has_set_parm;
1803  gran_t level_gran[RIG_SETTING_MAX];
1804  gran_t parm_gran[RIG_SETTING_MAX];
1806  const struct confparams *extparms;
1807  const struct confparams *extlevels;
1808  const struct confparams *extfuncs;
1809  int *ext_tokens;
1811  tone_t *ctcss_list;
1812  tone_t *dcs_list;
1814  int preamp[HAMLIB_MAXDBLSTSIZ];
1815  int attenuator[HAMLIB_MAXDBLSTSIZ];
1816  shortfreq_t max_rit;
1817  shortfreq_t max_xit;
1818  shortfreq_t max_ifshift;
1820  int agc_level_count;
1821  enum agc_level_e agc_levels[HAMLIB_MAX_AGC_LEVELS];
1823  ann_t announces;
1825  vfo_op_t vfo_ops;
1826  scan_t scan_ops;
1827  int targetable_vfo;
1828  int transceive;
1830  int bank_qty;
1831  int chan_desc_sz;
1833  chan_t chan_list[HAMLIB_CHANLSTSIZ];
1835  // As of 2020-02-12 we know of 5 models from Icom USA, EUR, ITR, TPE, KOR for the IC-9700
1836  // So we currently have 5 ranges we need to deal with
1837  // The backend for the model should fill in the label field to explain what model it is
1838  // The the IC-9700 in ic7300.c for an example
1839  freq_range_t rx_range_list1[HAMLIB_FRQRANGESIZ];
1840  freq_range_t tx_range_list1[HAMLIB_FRQRANGESIZ];
1841  freq_range_t rx_range_list2[HAMLIB_FRQRANGESIZ];
1842  freq_range_t tx_range_list2[HAMLIB_FRQRANGESIZ];
1843  freq_range_t rx_range_list3[HAMLIB_FRQRANGESIZ];
1844  freq_range_t tx_range_list3[HAMLIB_FRQRANGESIZ];
1845  freq_range_t rx_range_list4[HAMLIB_FRQRANGESIZ];
1846  freq_range_t tx_range_list4[HAMLIB_FRQRANGESIZ];
1847  freq_range_t rx_range_list5[HAMLIB_FRQRANGESIZ];
1848  freq_range_t tx_range_list5[HAMLIB_FRQRANGESIZ];
1850  struct tuning_step_list tuning_steps[HAMLIB_TSLSTSIZ];
1851  struct filter_list filters[HAMLIB_FLTLSTSIZ];
1853  cal_table_t str_cal;
1854  cal_table_float_t swr_cal;
1855  cal_table_float_t alc_cal;
1856  cal_table_float_t rfpower_meter_cal;
1857  cal_table_float_t comp_meter_cal;
1858  cal_table_float_t vd_meter_cal;
1859  cal_table_float_t id_meter_cal;
1861  struct rig_spectrum_scope spectrum_scopes[HAMLIB_MAX_SPECTRUM_SCOPES];
1862  enum rig_spectrum_mode_e spectrum_modes[HAMLIB_MAX_SPECTRUM_MODES];
1863  freq_t spectrum_spans[HAMLIB_MAX_SPECTRUM_SPANS];
1864  struct rig_spectrum_avg_mode spectrum_avg_modes[HAMLIB_MAX_SPECTRUM_AVG_MODES];
1865  int spectrum_attenuator[HAMLIB_MAXDBLSTSIZ];
1867  const struct confparams *cfgparams;
1868  const rig_ptr_t priv;
1870  /*
1871  * Rig API
1872  *
1873  */
1874 
1875  int (*rig_init)(RIG *rig);
1876  int (*rig_cleanup)(RIG *rig);
1877  int (*rig_open)(RIG *rig);
1878  int (*rig_close)(RIG *rig);
1879 
1880  /*
1881  * General API commands, from most primitive to least.. :()
1882  * List Set/Get functions pairs
1883  */
1884 
1885  int (*set_freq)(RIG *rig, vfo_t vfo, freq_t freq);
1886  int (*get_freq)(RIG *rig, vfo_t vfo, freq_t *freq);
1887 
1888  int (*set_mode)(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width);
1889  int (*get_mode)(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width);
1890 
1891  int (*set_vfo)(RIG *rig, vfo_t vfo);
1892  int (*get_vfo)(RIG *rig, vfo_t *vfo);
1893 
1894  int (*set_ptt)(RIG *rig, vfo_t vfo, ptt_t ptt);
1895  int (*get_ptt)(RIG *rig, vfo_t vfo, ptt_t *ptt);
1896 
1897  int (*get_dcd)(RIG *rig, vfo_t vfo, dcd_t *dcd);
1898 
1899  int (*set_rptr_shift)(RIG *rig, vfo_t vfo, rptr_shift_t rptr_shift);
1900  int (*get_rptr_shift)(RIG *rig, vfo_t vfo, rptr_shift_t *rptr_shift);
1901 
1902  int (*set_rptr_offs)(RIG *rig, vfo_t vfo, shortfreq_t offs);
1903  int (*get_rptr_offs)(RIG *rig, vfo_t vfo, shortfreq_t *offs);
1904 
1905  int (*set_split_freq)(RIG *rig, vfo_t vfo, freq_t tx_freq);
1906  int (*get_split_freq)(RIG *rig, vfo_t vfo, freq_t *tx_freq);
1907 
1908  int (*set_split_mode)(RIG *rig,
1909  vfo_t vfo,
1910  rmode_t tx_mode,
1911  pbwidth_t tx_width);
1912  int (*get_split_mode)(RIG *rig,
1913  vfo_t vfo,
1914  rmode_t *tx_mode,
1915  pbwidth_t *tx_width);
1916 
1917  int (*set_split_freq_mode)(RIG *rig,
1918  vfo_t vfo,
1919  freq_t tx_freq,
1920  rmode_t tx_mode,
1921  pbwidth_t tx_width);
1922  int (*get_split_freq_mode)(RIG *rig,
1923  vfo_t vfo,
1924  freq_t *tx_freq,
1925  rmode_t *tx_mode,
1926  pbwidth_t *tx_width);
1927 
1928  int (*set_split_vfo)(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo);
1929  int (*get_split_vfo)(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo);
1930 
1931  int (*set_rit)(RIG *rig, vfo_t vfo, shortfreq_t rit);
1932  int (*get_rit)(RIG *rig, vfo_t vfo, shortfreq_t *rit);
1933 
1934  int (*set_xit)(RIG *rig, vfo_t vfo, shortfreq_t xit);
1935  int (*get_xit)(RIG *rig, vfo_t vfo, shortfreq_t *xit);
1936 
1937  int (*set_ts)(RIG *rig, vfo_t vfo, shortfreq_t ts);
1938  int (*get_ts)(RIG *rig, vfo_t vfo, shortfreq_t *ts);
1939 
1940  int (*set_dcs_code)(RIG *rig, vfo_t vfo, tone_t code);
1941  int (*get_dcs_code)(RIG *rig, vfo_t vfo, tone_t *code);
1942 
1943  int (*set_tone)(RIG *rig, vfo_t vfo, tone_t tone);
1944  int (*get_tone)(RIG *rig, vfo_t vfo, tone_t *tone);
1945 
1946  int (*set_ctcss_tone)(RIG *rig, vfo_t vfo, tone_t tone);
1947  int (*get_ctcss_tone)(RIG *rig, vfo_t vfo, tone_t *tone);
1948 
1949  int (*set_dcs_sql)(RIG *rig, vfo_t vfo, tone_t code);
1950  int (*get_dcs_sql)(RIG *rig, vfo_t vfo, tone_t *code);
1951 
1952  int (*set_tone_sql)(RIG *rig, vfo_t vfo, tone_t tone);
1953  int (*get_tone_sql)(RIG *rig, vfo_t vfo, tone_t *tone);
1954 
1955  int (*set_ctcss_sql)(RIG *rig, vfo_t vfo, tone_t tone);
1956  int (*get_ctcss_sql)(RIG *rig, vfo_t vfo, tone_t *tone);
1957 
1958  int (*power2mW)(RIG *rig,
1959  unsigned int *mwpower,
1960  float power,
1961  freq_t freq,
1962  rmode_t mode);
1963  int (*mW2power)(RIG *rig,
1964  float *power,
1965  unsigned int mwpower,
1966  freq_t freq,
1967  rmode_t mode);
1968 
1969  int (*set_powerstat)(RIG *rig, powerstat_t status);
1970  int (*get_powerstat)(RIG *rig, powerstat_t *status);
1971 
1972  int (*reset)(RIG *rig, reset_t reset);
1973 
1974  int (*set_ant)(RIG *rig, vfo_t vfo, ant_t ant, value_t option);
1975  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);
1976 
1977  int (*set_level)(RIG *rig, vfo_t vfo, setting_t level, value_t val);
1978  int (*get_level)(RIG *rig, vfo_t vfo, setting_t level, value_t *val);
1979 
1980  int (*set_func)(RIG *rig, vfo_t vfo, setting_t func, int status);
1981  int (*get_func)(RIG *rig, vfo_t vfo, setting_t func, int *status);
1982 
1983  int (*set_parm)(RIG *rig, setting_t parm, value_t val);
1984  int (*get_parm)(RIG *rig, setting_t parm, value_t *val);
1985 
1986  int (*set_ext_level)(RIG *rig, vfo_t vfo, token_t token, value_t val);
1987  int (*get_ext_level)(RIG *rig, vfo_t vfo, token_t token, value_t *val);
1988 
1989  int (*set_ext_func)(RIG *rig, vfo_t vfo, token_t token, int status);
1990  int (*get_ext_func)(RIG *rig, vfo_t vfo, token_t token, int *status);
1991 
1992  int (*set_ext_parm)(RIG *rig, token_t token, value_t val);
1993  int (*get_ext_parm)(RIG *rig, token_t token, value_t *val);
1994 
1995  int (*set_conf)(RIG *rig, token_t token, const char *val);
1996  int (*get_conf)(RIG *rig, token_t token, char *val);
1997 
1998  int (*send_dtmf)(RIG *rig, vfo_t vfo, const char *digits);
1999  int (*recv_dtmf)(RIG *rig, vfo_t vfo, char *digits, int *length);
2000 
2001  int (*send_morse)(RIG *rig, vfo_t vfo, const char *msg);
2002  int (*stop_morse)(RIG *rig, vfo_t vfo);
2003  int (*wait_morse)(RIG *rig, vfo_t vfo);
2004 
2005  int (*send_voice_mem)(RIG *rig, vfo_t vfo, int ch);
2006 
2007  int (*set_bank)(RIG *rig, vfo_t vfo, int bank);
2008 
2009  int (*set_mem)(RIG *rig, vfo_t vfo, int ch);
2010  int (*get_mem)(RIG *rig, vfo_t vfo, int *ch);
2011 
2012  int (*vfo_op)(RIG *rig, vfo_t vfo, vfo_op_t op);
2013 
2014  int (*scan)(RIG *rig, vfo_t vfo, scan_t scan, int ch);
2015 
2016  int (*set_trn)(RIG *rig, int trn);
2017  int (*get_trn)(RIG *rig, int *trn);
2018 
2019  int (*decode_event)(RIG *rig);
2020 
2021  int (*set_channel)(RIG *rig, vfo_t vfo, const channel_t *chan);
2022  int (*get_channel)(RIG *rig, vfo_t vfo, channel_t *chan, int read_only);
2023 
2024  const char * (*get_info)(RIG *rig);
2025 
2026  int (*set_chan_all_cb)(RIG *rig, vfo_t vfo, chan_cb_t chan_cb, rig_ptr_t);
2027  int (*get_chan_all_cb)(RIG *rig, vfo_t vfo, chan_cb_t chan_cb, rig_ptr_t);
2028 
2029  int (*set_mem_all_cb)(RIG *rig,
2030  vfo_t vfo,
2031  chan_cb_t chan_cb,
2032  confval_cb_t parm_cb,
2033  rig_ptr_t);
2034  int (*get_mem_all_cb)(RIG *rig,
2035  vfo_t vfo,
2036  chan_cb_t chan_cb,
2037  confval_cb_t parm_cb,
2038  rig_ptr_t);
2039 
2040  int (*set_vfo_opt)(RIG *rig, int status); // only for Net Rigctl device
2041  int (*rig_get_vfo_info) (RIG *rig,
2042  vfo_t vfo,
2043  freq_t *freq,
2044  rmode_t *mode,
2045  pbwidth_t *width,
2046  split_t *split);
2047  int(*set_clock) (RIG *rig, int year, int month, int day, int hour, int min, int sec, double msec, int utc_offset);
2048  int(*get_clock) (RIG *rig, int *year, int *month, int *day, int *hour, int *min, int *sec, double *msec, int *utc_offset);
2049 
2050  const char *clone_combo_set;
2051  const char *clone_combo_get;
2052  const char *macro_name;
2054  int async_data_supported;
2055  int (*read_frame_direct)(RIG *rig,
2056  size_t buffer_length,
2057  const unsigned char *buffer);
2058  int (*is_async_frame)(RIG *rig,
2059  size_t frame_length,
2060  const unsigned char *frame);
2061  int (*process_async_frame)(RIG *rig,
2062  size_t frame_length,
2063  const unsigned char *frame);
2064 // this will be used to check rigcaps structure is compatible with client
2065  char *hamlib_check_rig_caps; // a constant value we can check for hamlib integrity
2066  int (*get_conf2)(RIG *rig, token_t token, char *val, int val_len);
2067  int (*password)(RIG *rig, const char *key1); /*< Send encrypted password if rigctld is secured with -A/--password */
2068  int (*set_lock_mode)(RIG *rig, int mode);
2069  int (*get_lock_mode)(RIG *rig, int *mode);
2070 };
2072 
2078 // all functions enumerated for rig_get_function_ptr
2079 enum rig_function_e {
2080  RIG_FUNCTION_INIT,
2081  RIG_FUNCTION_CLEANUP,
2082  RIG_FUNCTION_OPEN,
2083  RIG_FUNCTION_CLOSE,
2084  RIG_FUNCTION_SET_FREQ,
2085  RIG_FUNCTION_GET_FREQ,
2086  RIG_FUNCTION_SET_MODE,
2087  RIG_FUNCTION_GET_MODE,
2088  RIG_FUNCTION_SET_VFO,
2089  RIG_FUNCTION_GET_VFO,
2090  RIG_FUNCTION_SET_PTT,
2091  RIG_FUNCTION_GET_PTT,
2092  RIG_FUNCTION_GET_DCD,
2093  RIG_FUNCTION_SET_RPTR_SHIFT,
2094  RIG_FUNCTION_GET_RPTR_SHIFT,
2095  RIG_FUNCTION_SET_RPTR_OFFS,
2096  RIG_FUNCTION_GET_RPTR_OFFS,
2097  RIG_FUNCTION_SET_SPLIT_FREQ,
2098  RIG_FUNCTION_GET_SPLIT_FREQ,
2099  RIG_FUNCTION_SET_SPLIT_MODE,
2100  RIG_FUNCTION_SET_SPLIT_FREQ_MODE,
2101  RIG_FUNCTION_GET_SPLIT_FREQ_MODE,
2102  RIG_FUNCTION_SET_SPLIT_VFO,
2103  RIG_FUNCTION_GET_SPLIT_VFO,
2104  RIG_FUNCTION_SET_RIT,
2105  RIG_FUNCTION_GET_RIT,
2106  RIG_FUNCTION_SET_XIT,
2107  RIG_FUNCTION_GET_XIT,
2108  RIG_FUNCTION_SET_TS,
2109  RIG_FUNCTION_GET_TS,
2110  RIG_FUNCTION_SET_DCS_CODE,
2111  RIG_FUNCTION_GET_DCS_CODE,
2112  RIG_FUNCTION_SET_TONE,
2113  RIG_FUNCTION_GET_TONE,
2114  RIG_FUNCTION_SET_CTCSS_TONE,
2115  RIG_FUNCTION_GET_CTCSS_TONE,
2116  RIG_FUNCTION_SET_DCS_SQL,
2117  RIG_FUNCTION_GET_DCS_SQL,
2118  RIG_FUNCTION_SET_TONE_SQL,
2119  RIG_FUNCTION_GET_TONE_SQL,
2120  RIG_FUNCTION_SET_CTCSS_SQL,
2121  RIG_FUNCTION_GET_CTCSS_SQL,
2122  RIG_FUNCTION_POWER2MW,
2123  RIG_FUNCTION_MW2POWER,
2124  RIG_FUNCTION_SET_POWERSTAT,
2125  RIG_FUNCTION_GET_POWERSTAT,
2126  RIG_FUNCTION_RESET,
2127  RIG_FUNCTION_SET_ANT,
2128  RIG_FUNCTION_GET_ANT,
2129  RIG_FUNCTION_SET_LEVEL,
2130  RIG_FUNCTION_GET_LEVEL,
2131  RIG_FUNCTION_SET_FUNC,
2132  RIG_FUNCTION_GET_FUNC,
2133  RIG_FUNCTION_SET_PARM,
2134  RIG_FUNCTION_GET_PARM,
2135  RIG_FUNCTION_SET_EXT_LEVEL,
2136  RIG_FUNCTION_GET_EXT_LEVEL,
2137  RIG_FUNCTION_SET_EXT_FUNC,
2138  RIG_FUNCTION_GET_EXT_FUNC,
2139  RIG_FUNCTION_SET_EXT_PARM,
2140  RIG_FUNCTION_GET_EXT_PARM,
2141  RIG_FUNCTION_SET_CONF,
2142  RIG_FUNCTION_GET_CONF,
2143  RIG_FUNCTION_SEND_DTMF,
2144  RIG_FUNCTION_SEND_MORSE,
2145  RIG_FUNCTION_STOP_MORSE,
2146  RIG_FUNCTION_WAIT_MORSE,
2147  RIG_FUNCTION_SEND_VOICE_MEM,
2148  RIG_FUNCTION_SET_BANK,
2149  RIG_FUNCTION_SET_MEM,
2150  RIG_FUNCTION_GET_MEM,
2151  RIG_FUNCTION_VFO_OP,
2152  RIG_FUNCTION_SCAN,
2153  RIG_FUNCTION_SET_TRN,
2154  RIG_FUNCTION_GET_TRN,
2155  RIG_FUNCTION_DECODE_EVENT,
2156  RIG_FUNCTION_SET_CHANNEL,
2157  RIG_FUNCTION_GET_CHANNEL,
2158  RIG_FUNCTION_GET_INFO,
2159  RIG_FUNCTION_SET_CHAN_ALL_CB,
2160  RIG_FUNCTION_GET_CHAN_ALL_CB,
2161  RIG_FUNCTION_SET_MEM_ALL_CB,
2162  RIG_FUNCTION_GET_MEM_ALL_CB,
2163  RIG_FUNCTION_SET_VFO_OPT,
2164  RIG_FUNCTION_READ_FRAME_DIRECT,
2165  RIG_FUNCTION_IS_ASYNC_FRAME,
2166  RIG_FUNCTION_PROCESS_ASYNC_FRAME,
2167  RIG_FUNCTION_GET_CONF2,
2168 };
2169 
2175 extern HAMLIB_EXPORT (void *) rig_get_function_ptr(rig_model_t rig_model, enum rig_function_e rig_function);
2176 
2182 // values enumerated for rig->caps values
2183 enum rig_caps_int_e {
2184  RIG_CAPS_TARGETABLE_VFO,
2185  RIG_CAPS_RIG_MODEL,
2186  RIG_CAPS_PORT_TYPE,
2187  RIG_CAPS_PTT_TYPE,
2188  RIG_CAPS_HAS_GET_LEVEL
2189 };
2190 
2191 enum rig_caps_cptr_e {
2192  RIG_CAPS_VERSION_CPTR,
2193  RIG_CAPS_MFG_NAME_CPTR,
2194  RIG_CAPS_MODEL_NAME_CPTR,
2195  RIG_CAPS_STATUS_CPTR
2196 };
2197 
2203 extern HAMLIB_EXPORT (long long) rig_get_caps_int(rig_model_t rig_model, enum rig_caps_int_e rig_caps);
2204 
2210 extern HAMLIB_EXPORT (const char *) rig_get_caps_cptr(rig_model_t rig_model, enum rig_caps_cptr_e rig_caps);
2211 
2212 struct hamlib_async_pipe;
2213 
2214 typedef struct hamlib_async_pipe hamlib_async_pipe_t;
2215 
2222 // DO NOT CHANGE THIS STRUCTURE ALL UNTIL 5.0
2223 // Right now it is static inside rig structure
2224 // 5.0 will change it to a pointer which can then be added to
2225 // At that point only add to the end of the structure
2226 typedef struct hamlib_port {
2227  union {
2228  rig_port_t rig;
2229  ptt_type_t ptt;
2230  dcd_type_t dcd;
2231  } type;
2232 
2233  int fd;
2234  void *handle;
2236  int write_delay;
2237  int post_write_delay;
2239  struct {
2240  int tv_sec, tv_usec;
2241  } post_write_date;
2243  int timeout;
2244  short retry;
2245  short flushx;
2247  char pathname[HAMLIB_FILPATHLEN];
2249  union {
2250  struct {
2251  int rate;
2252  int data_bits;
2253  int stop_bits;
2254  enum serial_parity_e parity;
2255  enum serial_handshake_e handshake;
2256  enum serial_control_state_e rts_state;
2257  enum serial_control_state_e dtr_state;
2258  } serial;
2260  struct {
2261  int pin;
2262  } parallel;
2264  struct {
2265  int ptt_bitnum;
2266  } cm108;
2268  struct {
2269  int vid;
2270  int pid;
2271  int conf;
2272  int iface;
2273  int alt;
2274  char *vendor_name;
2275  char *product;
2276  } usb;
2278  struct {
2279  int on_value;
2280  int value;
2281  } gpio;
2282  } parm;
2283  int client_port;
2284  RIG *rig;
2285  int asyncio;
2286 #if defined(_WIN32)
2287  hamlib_async_pipe_t *sync_data_pipe;
2288  hamlib_async_pipe_t *sync_data_error_pipe;
2289 #else
2290  int fd_sync_write;
2291  int fd_sync_read;
2292  int fd_sync_error_write;
2293  int fd_sync_error_read;
2294 #endif
2295 } hamlib_port_t;
2296 
2297 
2298 // DO NOT CHANGE THIS STRUCTURE AT ALL
2299 // Will be removed in 5.0
2300 typedef struct hamlib_port_deprecated {
2301  union {
2302  rig_port_t rig;
2303  ptt_type_t ptt;
2304  dcd_type_t dcd;
2305  } type;
2306 
2307  int fd;
2308  void *handle;
2310  int write_delay;
2311  int post_write_delay;
2313  struct {
2314  int tv_sec, tv_usec;
2315  } post_write_date;
2317  int timeout;
2318  short retry;
2319  short flushx;
2321  char pathname[HAMLIB_FILPATHLEN];
2323  union {
2324  struct {
2325  int rate;
2326  int data_bits;
2327  int stop_bits;
2328  enum serial_parity_e parity;
2329  enum serial_handshake_e handshake;
2330  enum serial_control_state_e rts_state;
2331  enum serial_control_state_e dtr_state;
2332  } serial;
2334  struct {
2335  int pin;
2336  } parallel;
2338  struct {
2339  int ptt_bitnum;
2340  } cm108;
2342  struct {
2343  int vid;
2344  int pid;
2345  int conf;
2346  int iface;
2347  int alt;
2348  char *vendor_name;
2349  char *product;
2350  } usb;
2352  struct {
2353  int on_value;
2354  int value;
2355  } gpio;
2356  } parm;
2357  int client_port;
2358  RIG *rig;
2359 } hamlib_port_t_deprecated;
2361 
2362 #if !defined(__APPLE__) || !defined(__cplusplus)
2363 typedef hamlib_port_t_deprecated port_t_deprecated;
2364 typedef hamlib_port_t port_t;
2365 #endif
2366 
2367 #define HAMLIB_ELAPSED_GET 0
2368 #define HAMLIB_ELAPSED_SET 1
2369 #define HAMLIB_ELAPSED_INVALIDATE 2
2370 
2371 #define HAMLIB_CACHE_ALWAYS (-1) /*< value to set cache timeout to always use cache */
2372 
2373 typedef enum {
2374  HAMLIB_CACHE_ALL, // to set all cache timeouts at once
2375  HAMLIB_CACHE_VFO,
2376  HAMLIB_CACHE_FREQ,
2377  HAMLIB_CACHE_MODE,
2378  HAMLIB_CACHE_PTT,
2379  HAMLIB_CACHE_SPLIT,
2380  HAMLIB_CACHE_WIDTH
2381 } hamlib_cache_t;
2382 
2383 typedef enum {
2384  TWIDDLE_OFF,
2385  TWIDDLE_ON
2386 } twiddle_state_t;
2387 
2393 struct rig_cache {
2394  int timeout_ms; // the cache timeout for invalidating itself
2395  vfo_t vfo;
2396  //freq_t freq; // to be deprecated in 4.1 when full Main/Sub/A/B caching is implemented in 4.1
2397  // other abstraction here is based on dual vfo rigs and mapped to all others
2398  // So we have four possible states of rig
2399  // MainA, MainB, SubA, SubB
2400  // Main is the Main VFO and Sub is for the 2nd VFO
2401  // Most rigs have MainA and MainB
2402  // Dual VFO rigs can have SubA and SubB too
2403  // For dual VFO rigs simplex operations are all done on MainA/MainB -- ergo this abstraction
2404  freq_t freqCurr; // Other VFO
2405  freq_t freqOther; // Other VFO
2406  freq_t freqMainA; // VFO_A, VFO_MAIN, and VFO_MAINA
2407  freq_t freqMainB; // VFO_B, VFO_SUB, and VFO_MAINB
2408  freq_t freqMainC; // VFO_C, VFO_MAINC
2409  freq_t freqSubA; // VFO_SUBA -- only for rigs with dual Sub VFOs
2410  freq_t freqSubB; // VFO_SUBB -- only for rigs with dual Sub VFOs
2411  freq_t freqSubC; // VFO_SUBC -- only for rigs with 3 Sub VFOs
2412  freq_t freqMem; // VFO_MEM -- last MEM channel
2413  rmode_t modeCurr;
2414  rmode_t modeOther;
2415  rmode_t modeMainA;
2416  rmode_t modeMainB;
2417  rmode_t modeMainC;
2418  rmode_t modeSubA;
2419  rmode_t modeSubB;
2420  rmode_t modeSubC;
2421  rmode_t modeMem;
2422  pbwidth_t widthCurr; // if non-zero then rig has separate width for MainA
2423  pbwidth_t widthOther; // if non-zero then rig has separate width for MainA
2424  pbwidth_t widthMainA; // if non-zero then rig has separate width for MainA
2425  pbwidth_t widthMainB; // if non-zero then rig has separate width for MainB
2426  pbwidth_t widthMainC; // if non-zero then rig has separate width for MainC
2427  pbwidth_t widthSubA; // if non-zero then rig has separate width for SubA
2428  pbwidth_t widthSubB; // if non-zero then rig has separate width for SubB
2429  pbwidth_t widthSubC; // if non-zero then rig has separate width for SubC
2430  pbwidth_t widthMem; // if non-zero then rig has separate width for Mem
2431  ptt_t ptt;
2432  split_t split;
2433  vfo_t split_vfo; // split caches two values
2434  struct timespec time_freqCurr;
2435  struct timespec time_freqOther;
2436  struct timespec time_freqMainA;
2437  struct timespec time_freqMainB;
2438  struct timespec time_freqMainC;
2439  struct timespec time_freqSubA;
2440  struct timespec time_freqSubB;
2441  struct timespec time_freqSubC;
2442  struct timespec time_freqMem;
2443  struct timespec time_vfo;
2444  struct timespec time_modeCurr;
2445  struct timespec time_modeOther;
2446  struct timespec time_modeMainA;
2447  struct timespec time_modeMainB;
2448  struct timespec time_modeMainC;
2449  struct timespec time_modeSubA;
2450  struct timespec time_modeSubB;
2451  struct timespec time_modeSubC;
2452  struct timespec time_modeMem;
2453  struct timespec time_widthCurr;
2454  struct timespec time_widthOther;
2455  struct timespec time_widthMainA;
2456  struct timespec time_widthMainB;
2457  struct timespec time_widthMainC;
2458  struct timespec time_widthSubA;
2459  struct timespec time_widthSubB;
2460  struct timespec time_widthSubC;
2461  struct timespec time_widthMem;
2462  struct timespec time_ptt;
2463  struct timespec time_split;
2464  int satmode; // if rig is in satellite mode
2465 };
2466 
2467 
2478 struct rig_state {
2479  /********* ENSURE ANY NEW ITEMS ARE ADDED AT BOTTOM OF THIS STRUCTURE *********/
2480  /*
2481  * overridable fields
2482  */
2483  // moving the hamlib_port_t to the end of rig_state and making it a pointer
2484  // this should allow changes to hamlib_port_t without breaking shared libraries
2485  // these will maintain a copy of the new port_t for backwards compatibility
2486  // to these offsets -- note these must stay until a major version update is done like 5.0
2487  hamlib_port_t_deprecated rigport_deprecated;
2488  hamlib_port_t_deprecated pttport_deprecated;
2489  hamlib_port_t_deprecated dcdport_deprecated;
2491  double vfo_comp;
2494  freq_range_t rx_range_list[HAMLIB_FRQRANGESIZ];
2495  freq_range_t tx_range_list[HAMLIB_FRQRANGESIZ];
2497  struct tuning_step_list tuning_steps[HAMLIB_TSLSTSIZ];
2499  struct filter_list filters[HAMLIB_FLTLSTSIZ];
2503  chan_t chan_list[HAMLIB_CHANLSTSIZ];
2511  int preamp[HAMLIB_MAXDBLSTSIZ];
2512  int attenuator[HAMLIB_MAXDBLSTSIZ];
2525  /*
2526  * non overridable fields, internal use
2527  */
2528 
2531  int vfo_list;
2533  rig_ptr_t priv;
2534  rig_ptr_t obj;
2540  //rmode_t current_modeB; /*!< Mode currently set VFOB */
2544  // mode_list is used by some
2545  // so anything added to this structure must be below here
2546  int transmit;
2550  time_t twiddle_time;
2552  // uplink allows gpredict to behave better by no reading the uplink VFO
2553  int uplink;
2554  struct rig_cache cache;
2555  int vfo_opt;
2572  volatile unsigned int snapshot_packet_sequence_number;
2573 
2574  volatile int multicast_publisher_run;
2576  volatile int async_data_handler_thread_run;
2577  void *async_data_handler_priv_data;
2578  volatile int poll_routine_thread_run;
2579  void *poll_routine_priv_data;
2580  pthread_mutex_t mutex_set_transaction;
2581  hamlib_port_t rigport;
2582  hamlib_port_t pttport;
2583  hamlib_port_t dcdport;
2584  /********* DO NOT ADD or CHANGE anything (or than to rename) ABOVE THIS LINE *********/
2585  /********* ENSURE ANY NEW ITEMS ARE ADDED AFTER HERE *********/
2586  /* flags instructing the rig_get routines to use cached values when asyncio is in use */
2587  int use_cached_freq; /*<! flag instructing rig_get_freq to use cached values when asyncio is in use */
2588  int use_cached_mode; /*<! flag instructing rig_get_mode to use cached values when asyncio is in use */
2589  int use_cached_ptt; /*<! flag instructing rig_get_ptt to use cached values when asyncio is in use */
2590  int depth; /*<! a depth counter to use for debug indentation and such */
2591  int lock_mode; /*<! flag that prevents mode changes if ~= 0 -- see set/get_lock_mode */
2592  powerstat_t powerstat; /*<! power status */
2593 };
2594 
2596 typedef int (*vprintf_cb_t)(enum rig_debug_level_e,
2597  rig_ptr_t,
2598  const char *,
2599  va_list);
2600 
2601 typedef int (*freq_cb_t)(RIG *, vfo_t, freq_t, rig_ptr_t);
2602 typedef int (*mode_cb_t)(RIG *, vfo_t, rmode_t, pbwidth_t, rig_ptr_t);
2603 typedef int (*vfo_cb_t)(RIG *, vfo_t, rig_ptr_t);
2604 typedef int (*ptt_cb_t)(RIG *, vfo_t, ptt_t, rig_ptr_t);
2605 typedef int (*dcd_cb_t)(RIG *, vfo_t, dcd_t, rig_ptr_t);
2606 typedef int (*pltune_cb_t)(RIG *,
2607  vfo_t, freq_t *,
2608  rmode_t *,
2609  pbwidth_t *,
2610  rig_ptr_t);
2611 typedef int (*spectrum_cb_t)(RIG *,
2612  struct rig_spectrum_line *,
2613  rig_ptr_t);
2614 
2616 
2635  freq_cb_t freq_event;
2636  rig_ptr_t freq_arg;
2637  mode_cb_t mode_event;
2638  rig_ptr_t mode_arg;
2639  vfo_cb_t vfo_event;
2640  rig_ptr_t vfo_arg;
2641  ptt_cb_t ptt_event;
2642  rig_ptr_t ptt_arg;
2643  dcd_cb_t dcd_event;
2644  rig_ptr_t dcd_arg;
2645  pltune_cb_t pltune;
2646  rig_ptr_t pltune_arg;
2647  spectrum_cb_t spectrum_event;
2648  rig_ptr_t spectrum_arg;
2649  /* etc.. */
2650 };
2651 
2652 
2662 struct s_rig {
2663  struct rig_caps *caps;
2664  struct rig_state state;
2665  struct rig_callbacks callbacks;
2666 };
2667 
2668 
2669 
2670 /* --------------- API function prototypes -----------------*/
2671 
2673 
2674 extern HAMLIB_EXPORT(RIG *) rig_init HAMLIB_PARAMS((rig_model_t rig_model));
2675 extern HAMLIB_EXPORT(int) rig_open HAMLIB_PARAMS((RIG *rig));
2676 
2677 /*
2678  * General API commands, from most primitive to least.. :()
2679  * List Set/Get functions pairs
2680  */
2681 
2682 extern HAMLIB_EXPORT(int)
2683 rig_flush(hamlib_port_t *port);
2684 
2685 #if BUILTINFUNC
2686 #define rig_set_freq(r,v, f) rig_set_vfo(r,v,f,__builtin_FUNCTION())
2687 #else
2688 extern HAMLIB_EXPORT(int)
2689 rig_set_freq HAMLIB_PARAMS((RIG *rig,
2690  vfo_t vfo,
2691  freq_t freq));
2692 #endif
2693 extern HAMLIB_EXPORT(int)
2694 rig_get_freq HAMLIB_PARAMS((RIG *rig,
2695  vfo_t vfo,
2696  freq_t *freq));
2697 
2698 extern HAMLIB_EXPORT(int)
2699 rig_set_mode HAMLIB_PARAMS((RIG *rig,
2700  vfo_t vfo,
2701  rmode_t mode,
2702  pbwidth_t width));
2703 extern HAMLIB_EXPORT(int)
2704 rig_get_mode HAMLIB_PARAMS((RIG *rig,
2705  vfo_t vfo,
2706  rmode_t *mode,
2707  pbwidth_t *width));
2708 
2709 #if BUILTINFUNC
2710 #define rig_set_vfo(r,v) rig_set_vfo(r,v,__builtin_FUNCTION())
2711 extern HAMLIB_EXPORT(int)
2712 rig_set_vfo HAMLIB_PARAMS((RIG *rig,
2713  vfo_t vfo, const char *func));
2714 #else
2715 extern HAMLIB_EXPORT(int)
2716 rig_set_vfo HAMLIB_PARAMS((RIG *rig,
2717  vfo_t vfo));
2718 #endif
2719 extern HAMLIB_EXPORT(int)
2720 rig_get_vfo HAMLIB_PARAMS((RIG *rig,
2721  vfo_t *vfo));
2722 
2723 extern HAMLIB_EXPORT(int)
2724 rig_get_vfo_info HAMLIB_PARAMS((RIG *rig,
2725  vfo_t vfo,
2726  freq_t *freq,
2727  rmode_t *mode,
2728  pbwidth_t *width,
2729  split_t *split,
2730  int *satmode));
2731 
2732 extern HAMLIB_EXPORT(int)
2733 rig_get_vfo_list HAMLIB_PARAMS((RIG *rig, char *buf, int buflen));
2734 
2735 extern HAMLIB_EXPORT(int)
2736 netrigctl_get_vfo_mode HAMLIB_PARAMS((RIG *rig));
2737 
2738 extern HAMLIB_EXPORT(int)
2739 rig_set_ptt HAMLIB_PARAMS((RIG *rig,
2740  vfo_t vfo,
2741  ptt_t ptt));
2742 extern HAMLIB_EXPORT(int)
2743 rig_get_ptt HAMLIB_PARAMS((RIG *rig,
2744  vfo_t vfo,
2745  ptt_t *ptt));
2746 
2747 extern HAMLIB_EXPORT(int)
2748 rig_get_dcd HAMLIB_PARAMS((RIG *rig,
2749  vfo_t vfo,
2750  dcd_t *dcd));
2751 
2752 extern HAMLIB_EXPORT(int)
2753 rig_set_rptr_shift HAMLIB_PARAMS((RIG *rig,
2754  vfo_t vfo,
2755  rptr_shift_t rptr_shift));
2756 extern HAMLIB_EXPORT(int)
2757 rig_get_rptr_shift HAMLIB_PARAMS((RIG *rig,
2758  vfo_t vfo,
2759  rptr_shift_t *rptr_shift));
2760 
2761 extern HAMLIB_EXPORT(int)
2762 rig_set_rptr_offs HAMLIB_PARAMS((RIG *rig,
2763  vfo_t vfo,
2764  shortfreq_t rptr_offs));
2765 extern HAMLIB_EXPORT(int)
2766 rig_get_rptr_offs HAMLIB_PARAMS((RIG *rig,
2767  vfo_t vfo,
2768  shortfreq_t *rptr_offs));
2769 
2770 extern HAMLIB_EXPORT(int)
2771 rig_set_ctcss_tone HAMLIB_PARAMS((RIG *rig,
2772  vfo_t vfo,
2773  tone_t tone));
2774 extern HAMLIB_EXPORT(int)
2775 rig_get_ctcss_tone HAMLIB_PARAMS((RIG *rig,
2776  vfo_t vfo,
2777  tone_t *tone));
2778 
2779 extern HAMLIB_EXPORT(int)
2780 rig_set_dcs_code HAMLIB_PARAMS((RIG *rig,
2781  vfo_t vfo,
2782  tone_t code));
2783 extern HAMLIB_EXPORT(int)
2784 rig_get_dcs_code HAMLIB_PARAMS((RIG *rig,
2785  vfo_t vfo,
2786  tone_t *code));
2787 
2788 extern HAMLIB_EXPORT(int)
2789 rig_set_ctcss_sql HAMLIB_PARAMS((RIG *rig,
2790  vfo_t vfo,
2791  tone_t tone));
2792 extern HAMLIB_EXPORT(int)
2793 rig_get_ctcss_sql HAMLIB_PARAMS((RIG *rig,
2794  vfo_t vfo,
2795  tone_t *tone));
2796 
2797 extern HAMLIB_EXPORT(int)
2798 rig_set_dcs_sql HAMLIB_PARAMS((RIG *rig,
2799  vfo_t vfo,
2800  tone_t code));
2801 extern HAMLIB_EXPORT(int)
2802 rig_get_dcs_sql HAMLIB_PARAMS((RIG *rig,
2803  vfo_t vfo,
2804  tone_t *code));
2805 
2806 extern HAMLIB_EXPORT(int)
2807 rig_set_split_freq HAMLIB_PARAMS((RIG *rig,
2808  vfo_t vfo,
2809  freq_t tx_freq));
2810 extern HAMLIB_EXPORT(int)
2811 rig_get_split_freq HAMLIB_PARAMS((RIG *rig,
2812  vfo_t vfo,
2813  freq_t *tx_freq));
2814 
2815 extern HAMLIB_EXPORT(int)
2816 rig_set_split_mode HAMLIB_PARAMS((RIG *rig,
2817  vfo_t vfo,
2818  rmode_t tx_mode,
2819  pbwidth_t tx_width));
2820 extern HAMLIB_EXPORT(int)
2821 rig_get_split_mode HAMLIB_PARAMS((RIG *rig,
2822  vfo_t vfo,
2823  rmode_t *tx_mode,
2824  pbwidth_t *tx_width));
2825 
2826 extern HAMLIB_EXPORT(int)
2827 rig_set_split_freq_mode HAMLIB_PARAMS((RIG *rig,
2828  vfo_t vfo,
2829  freq_t tx_freq,
2830  rmode_t tx_mode,
2831  pbwidth_t tx_width));
2832 extern HAMLIB_EXPORT(int)
2833 rig_get_split_freq_mode HAMLIB_PARAMS((RIG *rig,
2834  vfo_t vfo,
2835  freq_t *tx_freq,
2836  rmode_t *tx_mode,
2837  pbwidth_t *tx_width));
2838 
2839 extern HAMLIB_EXPORT(int)
2840 rig_set_split_vfo HAMLIB_PARAMS((RIG *,
2841  vfo_t rx_vfo,
2842  split_t split,
2843  vfo_t tx_vfo));
2844 extern HAMLIB_EXPORT(int)
2845 rig_get_split_vfo HAMLIB_PARAMS((RIG *,
2846  vfo_t rx_vfo,
2847  split_t *split,
2848  vfo_t *tx_vfo));
2849 
2850 extern HAMLIB_EXPORT(int)
2851 rig_set_rit HAMLIB_PARAMS((RIG *rig,
2852  vfo_t vfo,
2853  shortfreq_t rit));
2854 extern HAMLIB_EXPORT(int)
2855 rig_get_rit HAMLIB_PARAMS((RIG *rig,
2856  vfo_t vfo,
2857  shortfreq_t *rit));
2858 
2859 extern HAMLIB_EXPORT(int)
2860 rig_set_xit HAMLIB_PARAMS((RIG *rig,
2861  vfo_t vfo,
2862  shortfreq_t xit));
2863 extern HAMLIB_EXPORT(int)
2864 rig_get_xit HAMLIB_PARAMS((RIG *rig,
2865  vfo_t vfo,
2866  shortfreq_t *xit));
2867 
2868 extern HAMLIB_EXPORT(int)
2869 rig_set_ts HAMLIB_PARAMS((RIG *rig,
2870  vfo_t vfo,
2871  shortfreq_t ts));
2872 extern HAMLIB_EXPORT(int)
2873 rig_get_ts HAMLIB_PARAMS((RIG *rig,
2874  vfo_t vfo,
2875  shortfreq_t *ts));
2876 
2877 extern HAMLIB_EXPORT(int)
2878 rig_power2mW HAMLIB_PARAMS((RIG *rig,
2879  unsigned int *mwpower,
2880  float power,
2881  freq_t freq,
2882  rmode_t mode));
2883 extern HAMLIB_EXPORT(int)
2884 rig_mW2power HAMLIB_PARAMS((RIG *rig,
2885  float *power,
2886  unsigned int mwpower,
2887  freq_t freq,
2888  rmode_t mode));
2889 
2890 extern HAMLIB_EXPORT(shortfreq_t)
2891 rig_get_resolution HAMLIB_PARAMS((RIG *rig,
2892  rmode_t mode));
2893 
2894 extern HAMLIB_EXPORT(int)
2895 rig_set_level HAMLIB_PARAMS((RIG *rig,
2896  vfo_t vfo,
2897  setting_t level,
2898  value_t val));
2899 extern HAMLIB_EXPORT(int)
2900 rig_get_level HAMLIB_PARAMS((RIG *rig,
2901  vfo_t vfo,
2902  setting_t level,
2903  value_t *val));
2904 
2905 #define rig_get_strength(r,v,s) rig_get_level((r),(v),RIG_LEVEL_STRENGTH, (value_t*)(s))
2906 
2907 extern HAMLIB_EXPORT(int)
2908 rig_set_parm HAMLIB_PARAMS((RIG *rig,
2909  setting_t parm,
2910  value_t val));
2911 extern HAMLIB_EXPORT(int)
2912 rig_get_parm HAMLIB_PARAMS((RIG *rig,
2913  setting_t parm,
2914  value_t *val));
2915 
2916 extern HAMLIB_EXPORT(int)
2917 rig_set_conf HAMLIB_PARAMS((RIG *rig,
2918  token_t token,
2919  const char *val));
2920 // deprecating rig_get_conf
2921 extern HAMLIB_EXPORT(int)
2922 rig_get_conf HAMLIB_PARAMS((RIG *rig,
2923  token_t token,
2924  char *val));
2925 extern HAMLIB_EXPORT(int)
2926 rig_get_conf2 HAMLIB_PARAMS((RIG *rig,
2927  token_t token,
2928  char *val,
2929  int val_len));
2930 
2931 extern HAMLIB_EXPORT(int)
2932 rig_set_powerstat HAMLIB_PARAMS((RIG *rig,
2933  powerstat_t status));
2934 extern HAMLIB_EXPORT(int)
2935 rig_get_powerstat HAMLIB_PARAMS((RIG *rig,
2936  powerstat_t *status));
2937 
2938 extern HAMLIB_EXPORT(int)
2939 rig_reset HAMLIB_PARAMS((RIG *rig,
2940  reset_t reset)); /* dangerous! */
2941 
2942 extern HAMLIB_EXPORT(int)
2943 rig_set_ext_level HAMLIB_PARAMS((RIG *rig,
2944  vfo_t vfo,
2945  token_t token,
2946  value_t val));
2947 extern HAMLIB_EXPORT(int)
2948 rig_get_ext_level HAMLIB_PARAMS((RIG *rig,
2949  vfo_t vfo,
2950  token_t token,
2951  value_t *val));
2952 
2953 extern HAMLIB_EXPORT(int)
2954 rig_set_ext_func HAMLIB_PARAMS((RIG *rig,
2955  vfo_t vfo,
2956  token_t token,
2957  int status));
2958 extern HAMLIB_EXPORT(int)
2959 rig_get_ext_func HAMLIB_PARAMS((RIG *rig,
2960  vfo_t vfo,
2961  token_t token,
2962  int *status));
2963 
2964 extern HAMLIB_EXPORT(int)
2965 rig_set_ext_parm HAMLIB_PARAMS((RIG *rig,
2966  token_t token,
2967  value_t val));
2968 extern HAMLIB_EXPORT(int)
2969 rig_get_ext_parm HAMLIB_PARAMS((RIG *rig,
2970  token_t token,
2971  value_t *val));
2972 
2973 extern HAMLIB_EXPORT(int)
2974 rig_ext_func_foreach HAMLIB_PARAMS((RIG *rig,
2975  int (*cfunc)(RIG *,
2976  const struct confparams *,
2977  rig_ptr_t),
2978  rig_ptr_t data));
2979 extern HAMLIB_EXPORT(int)
2980 rig_ext_level_foreach HAMLIB_PARAMS((RIG *rig,
2981  int (*cfunc)(RIG *,
2982  const struct confparams *,
2983  rig_ptr_t),
2984  rig_ptr_t data));
2985 extern HAMLIB_EXPORT(int)
2986 rig_ext_parm_foreach HAMLIB_PARAMS((RIG *rig,
2987  int (*cfunc)(RIG *,
2988  const struct confparams *,
2989  rig_ptr_t),
2990  rig_ptr_t data));
2991 
2992 extern HAMLIB_EXPORT(const struct confparams *)
2993 rig_ext_lookup HAMLIB_PARAMS((RIG *rig,
2994  const char *name));
2995 
2996 extern HAMLIB_EXPORT(const struct confparams *)
2997 rig_ext_lookup_tok HAMLIB_PARAMS((RIG *rig,
2998  token_t token));
2999 extern HAMLIB_EXPORT(token_t)
3000 rig_ext_token_lookup HAMLIB_PARAMS((RIG *rig,
3001  const char *name));
3002 
3003 
3004 extern HAMLIB_EXPORT(int)
3005 rig_token_foreach HAMLIB_PARAMS((RIG *rig,
3006  int (*cfunc)(const struct confparams *,
3007  rig_ptr_t),
3008  rig_ptr_t data));
3009 
3010 extern HAMLIB_EXPORT(const struct confparams *)
3011 rig_confparam_lookup HAMLIB_PARAMS((RIG *rig,
3012  const char *name));
3013 extern HAMLIB_EXPORT(token_t)
3014 rig_token_lookup HAMLIB_PARAMS((RIG *rig,
3015  const char *name));
3016 
3017 extern HAMLIB_EXPORT(int)
3018 rig_close HAMLIB_PARAMS((RIG *rig));
3019 
3020 extern HAMLIB_EXPORT(int)
3021 rig_cleanup HAMLIB_PARAMS((RIG *rig));
3022 
3023 extern HAMLIB_EXPORT(int)
3024 rig_set_ant HAMLIB_PARAMS((RIG *rig,
3025  vfo_t vfo,
3026  ant_t ant, /* antenna */
3027  value_t option)); /* optional ant info */
3028 extern HAMLIB_EXPORT(int)
3029 rig_get_ant HAMLIB_PARAMS((RIG *rig,
3030  vfo_t vfo,
3031  ant_t ant,
3032  value_t *option,
3033  ant_t *ant_curr,
3034  ant_t *ant_tx,
3035  ant_t *ant_rx));
3036 
3037 extern HAMLIB_EXPORT(setting_t)
3038 rig_has_get_level HAMLIB_PARAMS((RIG *rig,
3039  setting_t level));
3040 extern HAMLIB_EXPORT(setting_t)
3041 rig_has_set_level HAMLIB_PARAMS((RIG *rig,
3042  setting_t level));
3043 
3044 extern HAMLIB_EXPORT(setting_t)
3045 rig_has_get_parm HAMLIB_PARAMS((RIG *rig,
3046  setting_t parm));
3047 extern HAMLIB_EXPORT(setting_t)
3048 rig_has_set_parm HAMLIB_PARAMS((RIG *rig,
3049  setting_t parm));
3050 
3051 extern HAMLIB_EXPORT(setting_t)
3052 rig_has_get_func HAMLIB_PARAMS((RIG *rig,
3053  setting_t func));
3054 extern HAMLIB_EXPORT(setting_t)
3055 rig_has_set_func HAMLIB_PARAMS((RIG *rig,
3056  setting_t func));
3057 
3058 extern HAMLIB_EXPORT(int)
3059 rig_set_func HAMLIB_PARAMS((RIG *rig,
3060  vfo_t vfo,
3061  setting_t func,
3062  int status));
3063 extern HAMLIB_EXPORT(int)
3064 rig_get_func HAMLIB_PARAMS((RIG *rig,
3065  vfo_t vfo,
3066  setting_t func,
3067  int *status));
3068 
3069 extern HAMLIB_EXPORT(int)
3070 rig_send_dtmf HAMLIB_PARAMS((RIG *rig,
3071  vfo_t vfo,
3072  const char *digits));
3073 extern HAMLIB_EXPORT(int)
3074 rig_recv_dtmf HAMLIB_PARAMS((RIG *rig,
3075  vfo_t vfo,
3076  char *digits,
3077  int *length));
3078 
3079 extern HAMLIB_EXPORT(int)
3080 rig_send_morse HAMLIB_PARAMS((RIG *rig,
3081  vfo_t vfo,
3082  const char *msg));
3083 
3084 extern HAMLIB_EXPORT(int)
3085 rig_stop_morse HAMLIB_PARAMS((RIG *rig,
3086  vfo_t vfo));
3087 
3088 extern HAMLIB_EXPORT(int)
3089 rig_wait_morse HAMLIB_PARAMS((RIG *rig,
3090  vfo_t vfo));
3091 
3092 extern HAMLIB_EXPORT(int)
3093 rig_send_voice_mem HAMLIB_PARAMS((RIG *rig,
3094  vfo_t vfo,
3095  int ch));
3096 
3097 extern HAMLIB_EXPORT(int)
3098 rig_set_bank HAMLIB_PARAMS((RIG *rig,
3099  vfo_t vfo,
3100  int bank));
3101 
3102 extern HAMLIB_EXPORT(int)
3103 rig_set_mem HAMLIB_PARAMS((RIG *rig,
3104  vfo_t vfo,
3105  int ch));
3106 extern HAMLIB_EXPORT(int)
3107 rig_get_mem HAMLIB_PARAMS((RIG *rig,
3108  vfo_t vfo,
3109  int *ch));
3110 
3111 extern HAMLIB_EXPORT(int)
3112 rig_vfo_op HAMLIB_PARAMS((RIG *rig,
3113  vfo_t vfo,
3114  vfo_op_t op));
3115 
3116 extern HAMLIB_EXPORT(vfo_op_t)
3117 rig_has_vfo_op HAMLIB_PARAMS((RIG *rig,
3118  vfo_op_t op));
3119 
3120 extern HAMLIB_EXPORT(int)
3121 rig_scan HAMLIB_PARAMS((RIG *rig,
3122  vfo_t vfo,
3123  scan_t scan,
3124  int ch));
3125 
3126 extern HAMLIB_EXPORT(scan_t)
3127 rig_has_scan HAMLIB_PARAMS((RIG *rig,
3128  scan_t scan));
3129 
3130 extern HAMLIB_EXPORT(int)
3131 rig_set_channel HAMLIB_PARAMS((RIG *rig,
3132  vfo_t vfo,
3133  const channel_t *chan)); /* mem */
3134 extern HAMLIB_EXPORT(int)
3135 rig_get_channel HAMLIB_PARAMS((RIG *rig,
3136  vfo_t vfo,
3137  channel_t *chan, int read_only));
3138 
3139 extern HAMLIB_EXPORT(int)
3140 rig_set_chan_all HAMLIB_PARAMS((RIG *rig,
3141  vfo_t vfo,
3142  const channel_t chans[]));
3143 extern HAMLIB_EXPORT(int)
3144 rig_get_chan_all HAMLIB_PARAMS((RIG *rig,
3145  vfo_t vfo,
3146  channel_t chans[]));
3147 
3148 extern HAMLIB_EXPORT(int)
3149 rig_set_chan_all_cb HAMLIB_PARAMS((RIG *rig,
3150  vfo_t vfo,
3151  chan_cb_t chan_cb,
3152  rig_ptr_t));
3153 extern HAMLIB_EXPORT(int)
3154 rig_get_chan_all_cb HAMLIB_PARAMS((RIG *rig,
3155  vfo_t vfo,
3156  chan_cb_t chan_cb,
3157  rig_ptr_t));
3158 
3159 extern HAMLIB_EXPORT(int)
3160 rig_set_mem_all_cb HAMLIB_PARAMS((RIG *rig,
3161  vfo_t vfo,
3162  chan_cb_t chan_cb,
3163  confval_cb_t parm_cb,
3164  rig_ptr_t));
3165 extern HAMLIB_EXPORT(int)
3166 rig_get_mem_all_cb HAMLIB_PARAMS((RIG *rig,
3167  vfo_t vfo,
3168  chan_cb_t chan_cb,
3169  confval_cb_t parm_cb,
3170  rig_ptr_t));
3171 
3172 extern HAMLIB_EXPORT(int)
3173 rig_set_mem_all HAMLIB_PARAMS((RIG *rig,
3174  vfo_t vfo,
3175  const channel_t *chan,
3176  const struct confparams *,
3177  const value_t *));
3178 extern HAMLIB_EXPORT(int)
3179 rig_get_mem_all HAMLIB_PARAMS((RIG *rig,
3180  vfo_t vfo,
3181  channel_t *chan,
3182  const struct confparams *,
3183  value_t *));
3184 
3185 extern HAMLIB_EXPORT(const chan_t *)
3186 rig_lookup_mem_caps HAMLIB_PARAMS((RIG *rig,
3187  int ch));
3188 
3189 extern HAMLIB_EXPORT(int)
3190 rig_mem_count HAMLIB_PARAMS((RIG *rig));
3191 
3192 extern HAMLIB_EXPORT(int)
3193 rig_set_trn HAMLIB_PARAMS((RIG *rig,
3194  int trn));
3195 extern HAMLIB_EXPORT(int)
3196 rig_get_trn HAMLIB_PARAMS((RIG *rig,
3197  int *trn));
3198 
3199 extern HAMLIB_EXPORT(int)
3200 rig_set_freq_callback HAMLIB_PARAMS((RIG *,
3201  freq_cb_t,
3202  rig_ptr_t));
3203 
3204 extern HAMLIB_EXPORT(int)
3205 rig_set_mode_callback HAMLIB_PARAMS((RIG *,
3206  mode_cb_t,
3207  rig_ptr_t));
3208 extern HAMLIB_EXPORT(int)
3209 rig_set_vfo_callback HAMLIB_PARAMS((RIG *,
3210  vfo_cb_t,
3211  rig_ptr_t));
3212 
3213 extern HAMLIB_EXPORT(int)
3214 rig_set_ptt_callback HAMLIB_PARAMS((RIG *,
3215  ptt_cb_t,
3216  rig_ptr_t));
3217 
3218 extern HAMLIB_EXPORT(int)
3219 rig_set_dcd_callback HAMLIB_PARAMS((RIG *,
3220  dcd_cb_t,
3221  rig_ptr_t));
3222 
3223 extern HAMLIB_EXPORT(int)
3224 rig_set_pltune_callback HAMLIB_PARAMS((RIG *,
3225  pltune_cb_t,
3226  rig_ptr_t));
3227 
3228 extern HAMLIB_EXPORT(int)
3229 rig_set_spectrum_callback HAMLIB_PARAMS((RIG *,
3230  spectrum_cb_t,
3231  rig_ptr_t));
3232 
3233 extern HAMLIB_EXPORT(int)
3234 rig_set_twiddle HAMLIB_PARAMS((RIG *rig,
3235  int seconds));
3236 
3237 extern HAMLIB_EXPORT(int)
3238 rig_get_twiddle HAMLIB_PARAMS((RIG *rig,
3239  int *seconds));
3240 
3241 extern HAMLIB_EXPORT(int)
3242 rig_set_uplink HAMLIB_PARAMS((RIG *rig,
3243  int val));
3244 
3245 extern HAMLIB_EXPORT(const char *)
3246 rig_get_info HAMLIB_PARAMS((RIG *rig));
3247 
3248 extern HAMLIB_EXPORT(const struct rig_caps *)
3249 rig_get_caps HAMLIB_PARAMS((rig_model_t rig_model));
3250 
3251 extern HAMLIB_EXPORT(const freq_range_t *)
3252 rig_get_range HAMLIB_PARAMS((const freq_range_t *range_list,
3253  freq_t freq,
3254  rmode_t mode));
3255 
3256 extern HAMLIB_EXPORT(pbwidth_t)
3257 rig_passband_normal HAMLIB_PARAMS((RIG *rig,
3258  rmode_t mode));
3259 extern HAMLIB_EXPORT(pbwidth_t)
3260 rig_passband_narrow HAMLIB_PARAMS((RIG *rig,
3261  rmode_t mode));
3262 extern HAMLIB_EXPORT(pbwidth_t)
3263 rig_passband_wide HAMLIB_PARAMS((RIG *rig,
3264  rmode_t mode));
3265 
3266 extern HAMLIB_EXPORT(const char *)
3267 rigerror HAMLIB_PARAMS((int errnum));
3268 extern HAMLIB_EXPORT(const char *)
3269 rigerror2 HAMLIB_PARAMS((int errnum));
3270 
3271 extern HAMLIB_EXPORT(int)
3272 rig_setting2idx HAMLIB_PARAMS((setting_t s));
3273 
3274 #define HAMLIB_SETTINGS_FILE "hamlib_settings"
3275 
3276 extern HAMLIB_EXPORT(setting_t)
3277 rig_idx2setting(int i);
3278 /*
3279  * Even if these functions are prefixed with "rig_", they are not rig specific
3280  * Maybe "hamlib_" would have been better. Let me know. --SF
3281  */
3282 extern HAMLIB_EXPORT(void)
3283 rig_set_debug HAMLIB_PARAMS((enum rig_debug_level_e debug_level));
3284 
3285 extern HAMLIB_EXPORT(void)
3286 rig_set_debug_time_stamp HAMLIB_PARAMS((int flag));
3287 
3288 #define rig_set_debug_level(level) rig_set_debug(level)
3289 
3290 extern HAMLIB_EXPORT(int)
3291 rig_need_debug HAMLIB_PARAMS((enum rig_debug_level_e debug_level));
3292 
3293 
3294 extern HAMLIB_EXPORT(void)add2debugmsgsave(const char *s);
3295 // this needs to be fairly big to avoid compiler warnings
3296 extern HAMLIB_EXPORT_VAR(char) debugmsgsave[DEBUGMSGSAVE_SIZE]; // last debug msg
3297 extern HAMLIB_EXPORT_VAR(char) debugmsgsave2[DEBUGMSGSAVE_SIZE]; // last-1 debug msg
3298 // debugmsgsave3 is deprecated
3299 extern HAMLIB_EXPORT_VAR(char) debugmsgsave3[DEBUGMSGSAVE_SIZE]; // last-2 debug msg
3300 #ifndef __cplusplus
3301 #ifdef __GNUC__
3302 // doing the debug macro with a dummy sprintf allows gcc to check the format string
3303 #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)
3304 #endif
3305 #endif
3306 
3307 // Measuring elapsed time -- local variable inside function when macro is used
3308 #define ELAPSED1 struct timespec __begin; elapsed_ms(&__begin, HAMLIB_ELAPSED_SET);
3309 #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));
3310 
3311 // use this instead of snprintf for automatic detection of buffer limit
3312 #define SNPRINTF(s,n,...) { snprintf(s,n,##__VA_ARGS__);if (strlen(s) > n-1) fprintf(stderr,"****** %s(%d): buffer overflow ******\n", __func__, __LINE__); }
3313 
3314 extern HAMLIB_EXPORT(void)
3315 rig_debug HAMLIB_PARAMS((enum rig_debug_level_e debug_level,
3316  const char *fmt, ...));
3317 
3318 extern HAMLIB_EXPORT(vprintf_cb_t)
3319 rig_set_debug_callback HAMLIB_PARAMS((vprintf_cb_t cb,
3320  rig_ptr_t arg));
3321 
3322 extern HAMLIB_EXPORT(FILE *)
3323 rig_set_debug_file HAMLIB_PARAMS((FILE *stream));
3324 
3325 extern HAMLIB_EXPORT(int)
3326 rig_register HAMLIB_PARAMS((const struct rig_caps *caps));
3327 
3328 extern HAMLIB_EXPORT(int)
3329 rig_unregister HAMLIB_PARAMS((rig_model_t rig_model));
3330 
3331 extern HAMLIB_EXPORT(int)
3332 rig_list_foreach HAMLIB_PARAMS((int (*cfunc)(const struct rig_caps *, rig_ptr_t),
3333  rig_ptr_t data));
3334 
3335 extern HAMLIB_EXPORT(int)
3336 rig_list_foreach_model HAMLIB_PARAMS((int (*cfunc)(const rig_model_t rig_model, rig_ptr_t),
3337  rig_ptr_t data));
3338 
3339 extern HAMLIB_EXPORT(int)
3340 rig_load_backend HAMLIB_PARAMS((const char *be_name));
3341 
3342 extern HAMLIB_EXPORT(int)
3343 rig_check_backend HAMLIB_PARAMS((rig_model_t rig_model));
3344 
3345 extern HAMLIB_EXPORT(int)
3346 rig_load_all_backends HAMLIB_PARAMS((void));
3347 
3348 typedef int (*rig_probe_func_t)(const hamlib_port_t *, rig_model_t, rig_ptr_t);
3349 
3350 extern HAMLIB_EXPORT(int)
3351 rig_probe_all HAMLIB_PARAMS((hamlib_port_t *p,
3352  rig_probe_func_t,
3353  rig_ptr_t));
3354 
3355 extern HAMLIB_EXPORT(rig_model_t)
3356 rig_probe HAMLIB_PARAMS((hamlib_port_t *p));
3357 
3358 
3359 /* Misc calls */
3360 extern HAMLIB_EXPORT(const char *) rig_strrmode(rmode_t mode);
3361 extern HAMLIB_EXPORT(int) rig_strrmodes(rmode_t modes, char *buf, int buflen);
3362 extern HAMLIB_EXPORT(const char *) rig_strvfo(vfo_t vfo);
3363 extern HAMLIB_EXPORT(const char *) rig_strfunc(setting_t);
3364 extern HAMLIB_EXPORT(const char *) rig_strlevel(setting_t);
3365 extern HAMLIB_EXPORT(const char *) rig_strparm(setting_t);
3366 extern HAMLIB_EXPORT(const char *) rig_stragclevel(enum agc_level_e level);
3367 extern HAMLIB_EXPORT(enum agc_level_e) rig_levelagcstr (char *agcString);
3368 extern HAMLIB_EXPORT(enum agc_level_e) rig_levelagcvalue (int agcValue);
3369 extern HAMLIB_EXPORT(value_t) rig_valueagclevel (enum agc_level_e agcLevel);
3370 extern HAMLIB_EXPORT(const char *) rig_strptrshift(rptr_shift_t);
3371 extern HAMLIB_EXPORT(const char *) rig_strvfop(vfo_op_t op);
3372 extern HAMLIB_EXPORT(const char *) rig_strscan(scan_t scan);
3373 extern HAMLIB_EXPORT(const char *) rig_strstatus(enum rig_status_e status);
3374 extern HAMLIB_EXPORT(const char *) rig_strmtype(chan_type_t mtype);
3375 extern HAMLIB_EXPORT(const char *) rig_strspectrummode(enum rig_spectrum_mode_e mode);
3376 
3377 extern HAMLIB_EXPORT(rmode_t) rig_parse_mode(const char *s);
3378 extern HAMLIB_EXPORT(vfo_t) rig_parse_vfo(const char *s);
3379 extern HAMLIB_EXPORT(setting_t) rig_parse_func(const char *s);
3380 extern HAMLIB_EXPORT(setting_t) rig_parse_level(const char *s);
3381 extern HAMLIB_EXPORT(setting_t) rig_parse_parm(const char *s);
3382 extern HAMLIB_EXPORT(vfo_op_t) rig_parse_vfo_op(const char *s);
3383 extern HAMLIB_EXPORT(scan_t) rig_parse_scan(const char *s);
3384 extern HAMLIB_EXPORT(rptr_shift_t) rig_parse_rptr_shift(const char *s);
3385 extern HAMLIB_EXPORT(chan_type_t) rig_parse_mtype(const char *s);
3386 
3387 extern HAMLIB_EXPORT(const char *) rig_license HAMLIB_PARAMS((void));
3388 extern HAMLIB_EXPORT(const char *) rig_version HAMLIB_PARAMS((void));
3389 extern HAMLIB_EXPORT(const char *) rig_copyright HAMLIB_PARAMS((void));
3390 
3391 extern HAMLIB_EXPORT(void) rig_no_restore_ai(void);
3392 
3393 extern HAMLIB_EXPORT(int) rig_get_cache_timeout_ms(RIG *rig, hamlib_cache_t selection);
3394 extern HAMLIB_EXPORT(int) rig_set_cache_timeout_ms(RIG *rig, hamlib_cache_t selection, int ms);
3395 
3396 extern HAMLIB_EXPORT(int) rig_set_vfo_opt(RIG *rig, int status);
3397 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);
3398 extern HAMLIB_EXPORT(int) rig_get_rig_info(RIG *rig, char *response, int max_response_len);
3399 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);
3400 extern HAMLIB_EXPORT(int) rig_get_cache_freq(RIG *rig, vfo_t vfo, freq_t *freq, int * cache_ms_freq);
3401 
3402 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);
3403 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);
3404 
3405 typedef unsigned long rig_useconds_t;
3406 extern HAMLIB_EXPORT(int) hl_usleep(rig_useconds_t msec);
3407 
3408 extern HAMLIB_EXPORT(int) rig_cookie(RIG *rig, enum cookie_e cookie_cmd, char *cookie, int cookie_len);
3409 
3410 extern HAMLIB_EXPORT(int) rig_password(RIG *rig, const char *key1);
3411 extern HAMLIB_EXPORT(void) rig_password_generate_secret(char *pass,
3412  char result[HAMLIB_SECRET_LENGTH + 1]);
3413 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);
3414 
3415 extern HAMLIB_EXPORT(int)
3416 longlat2locator HAMLIB_PARAMS((double longitude,
3417  double latitude,
3418  char *locator_res,
3419  int pair_count));
3420 
3421 extern HAMLIB_EXPORT(int)
3422 locator2longlat HAMLIB_PARAMS((double *longitude,
3423  double *latitude,
3424  const char *locator));
3425 
3426 extern HAMLIB_EXPORT(char*) rig_make_md5(char *pass);
3427 
3428 extern HAMLIB_EXPORT(int) rig_set_lock_mode(RIG *rig, int lock);
3429 extern HAMLIB_EXPORT(int) rig_get_lock_mode(RIG *rig, int *lock);
3430 
3431 extern HAMLIB_EXPORT(int) rig_is_model(RIG *rig, rig_model_t model);
3432 
3433 
3435 
3436 __END_DECLS
3437 
3438 #endif /* _RIG_H */
3439 
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:1372
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:1542
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:1567
value_t rig_valueagclevel(enum agc_level_e agcLevel)
Convert a enum agc_level_e to value.
Definition: misc.c:1321
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:1610
const char * rig_strmtype(chan_type_t mtype)
Convert enum RIG_MTYPE_... to alpha string.
Definition: misc.c:1635
enum agc_level_e rig_levelagcvalue(int agcValue)
Convert a value to agc_level_e – constrains the range.
Definition: misc.c:1341
const char * rig_strspectrummode(enum rig_spectrum_mode_e mode)
Convert enum RIG_SPECTRUM_MODE_... to alpha string.
Definition: misc.c:1675
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:1513
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:1488
const char * rig_stragclevel(enum agc_level_e level)
Convert enum RIG_AGC_... to alpha string.
Definition: misc.c:1296
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:1443
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:1418
int rig_set_vfo(RIG *rig, vfo_t vfo)
set the current VFO
Definition: rig.c:2762
unsigned int vfo_t
VFO definition.
Definition: rig.h:470
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:4887
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:6444
int rig_set_twiddle(RIG *rig, int seconds)
timeout (secs) to stop rigctld when VFO is manually changed
Definition: rig.c:1622
int rig_get_rig_info(RIG *rig, char *response, int max_response_len)
get freq/mode/width for requested VFO
Definition: rig.c:7044
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:3613
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:5113
int rig_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
Definition: rig.c:2444
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:4949
dcd_e
Definition: rig.h:606
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:2363
hamlib_band_t
Band enumeration.
Definition: rig.h:722
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:3994
int rig_set_powerstat(RIG *rig, powerstat_t status)
turn on/off the radio
Definition: rig.c:6042
int rig_get_powerstat(RIG *rig, powerstat_t *status)
get the on/off status of the radio
Definition: rig.c:6080
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:5877
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:2922
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:4768
uint64_t rmode_t
Radio mode.
Definition: rig.h:1250
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:602
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:5329
int rig_cleanup(RIG *rig)
release a rig handle and free associated memory
Definition: rig.c:1580
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:399
int rig_get_vfo_list(RIG *rig, char *buf, int buflen)
get list of available vfos
Definition: rig.c:7222
rptr_shift_t
Repeater shift type.
Definition: rig.h:389
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:6341
ptt_type_t
PTT type.
Definition: rig.h:646
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:7256
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:1209
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:831
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:2012
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:3319
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:5945
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:5477
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:3916
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:1153
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:1041
int rig_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option)
set the antenna
Definition: rig.c:5706
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:6001
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:7145
pbwidth_t rig_passband_wide(RIG *rig, rmode_t mode)
get the wide passband of a mode
Definition: rig.c:2705
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:1092
powerstat_t
Radio power state.
Definition: rig.h:662
multicast_item_e
Multicast data items 3 different data item can be included in the multicast JSON.
Definition: rig.h:1072
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:1647
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:4077
int rig_probe_all(hamlib_port_t *port, rig_probe_func_t cfunc, rig_ptr_t data)
try to guess rigs
Definition: rig.c:6199
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:789
scan_t
Rig Scan operation.
Definition: rig.h:751
int rig_send_voice_mem(RIG *rig, vfo_t vfo, int ch)
send voice memory content
Definition: rig.c:6835
int rig_recv_dtmf(RIG *rig, vfo_t vfo, char *digits, int *length)
receive DTMF digits
Definition: rig.c:6520
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:1755
int rig_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt)
set PTT on/off
Definition: rig.c:3009
int rig_get_conf(RIG *rig, token_t token, char *val)
get the value of a configuration parameter
Definition: conf.c:1293
double freq_t
Frequency type,.
Definition: rig.h:410
int rig_scan(RIG *rig, vfo_t vfo, scan_t scan, int ch)
perform Memory/VFO operations
Definition: rig.c:6373
cookie_e
Rig Cookie enumerations.
Definition: rig.h:1062
int rig_send_morse(RIG *rig, vfo_t vfo, const char *msg)
send morse code
Definition: rig.c:6595
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:633
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:7240
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:2281
vfo_op_t
VFO operation.
Definition: rig.h:698
int rig_get_ts(RIG *rig, vfo_t vfo, shortfreq_t *ts)
get the current Tuning Step
Definition: rig.c:5625
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:432
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:7286
int rig_set_conf(RIG *rig, token_t token, const char *val)
set a radio configuration parameter
Definition: conf.c:1240
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:6771
int rig_close(RIG *rig)
close the communication to the rig
Definition: rig.c:1420
pbwidth_t rig_passband_narrow(RIG *rig, rmode_t mode)
get the narrow passband of a mode
Definition: rig.c:2653
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:617
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:6940
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:2602
rig_debug_level_e
Hamlib debug levels.
Definition: rig.h:197
#define RIG_SETTING_MAX
Maximum # of rig settings.
Definition: rig.h:1098
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:7276
int rig_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit)
set the RIT
Definition: rig.c:5258
const char * rig_copyright()
get the Hamlib copyright
Definition: rig.c:7296
int rig_get_twiddle(RIG *rig, int *seconds)
get the twiddle timeout value (secs)
Definition: rig.c:1673
int rig_set_ts(RIG *rig, vfo_t vfo, shortfreq_t ts)
set the Tuning Step
Definition: rig.c:5554
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:5785
int rig_open(RIG *rig)
open the communication to the rig
Definition: rig.c:808
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:6667
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:6975
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:953
long token_t
configuration token
Definition: rig.h:767
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:4403
int rig_reset(RIG *rig, reset_t reset)
reset the radio
Definition: rig.c:6127
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:1091
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:6228
unsigned int ant_t
Antenna typedef.
Definition: rig.h:888
int rig_get_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t *rptr_shift)
get the current repeater shift
Definition: rig.c:3832
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:4626
int rig_set_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t rptr_shift)
set the repeater shift
Definition: rig.c:3754
reset_t
Reset operation.
Definition: rig.h:674
int rig_get_split_freq(RIG *rig, vfo_t vfo, freq_t *tx_freq)
get the current split frequencies
Definition: rig.c:4246
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:6259
rig_status_e
Development status of the backend.
Definition: rig.h:369
int rig_set_xit(RIG *rig, vfo_t vfo, shortfreq_t xit)
set the XIT
Definition: rig.c:5406
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:7325
rig_spectrum_mode_e
Spectrum scope modes.
Definition: rig.h:1700
rig_model_t rig_probe(hamlib_port_t *port)
try to guess a rig
Definition: rig.c:6171
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:6904
chan_type_t
Memory channel type definition.
Definition: rig.h:1551
@ 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:608
@ RIG_DCD_OFF
Definition: rig.h:607
@ RIG_BAND_AIR
Definition: rig.h:737
@ RIG_BAND_UNUSED
Definition: rig.h:736
@ RIG_BAND_20M
Definition: rig.h:728
@ RIG_BAND_12M
Definition: rig.h:731
@ RIG_BAND_60M
Definition: rig.h:725
@ RIG_BAND_10M
Definition: rig.h:732
@ RIG_BAND_430MHZ
Definition: rig.h:739
@ RIG_BAND_40M
Definition: rig.h:726
@ RIG_BAND_15M
Definition: rig.h:730
@ RIG_BAND_GEN
Definition: rig.h:734
@ RIG_BAND_30M
Definition: rig.h:727
@ RIG_BAND_144MHZ
Definition: rig.h:738
@ RIG_BAND_80M
Definition: rig.h:724
@ RIG_BAND_MW
Definition: rig.h:735
@ RIG_BAND_6M
Definition: rig.h:733
@ RIG_BAND_17M
Definition: rig.h:729
@ RIG_BAND_160M
Definition: rig.h:723
@ 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:401
@ RIG_SPLIT_OFF
Definition: rig.h:400
@ RIG_RPT_SHIFT_PLUS
Definition: rig.h:392
@ RIG_RPT_SHIFT_MINUS
Definition: rig.h:391
@ RIG_RPT_SHIFT_NONE
Definition: rig.h:390
@ RIG_PTT_RIG
Definition: rig.h:648
@ RIG_PTT_RIG_MICDATA
Definition: rig.h:652
@ RIG_PTT_SERIAL_DTR
Definition: rig.h:649
@ RIG_PTT_NONE
Definition: rig.h:647
@ RIG_PTT_PARALLEL
Definition: rig.h:651
@ RIG_PTT_GPION
Definition: rig.h:655
@ RIG_PTT_GPIO
Definition: rig.h:654
@ RIG_PTT_CM108
Definition: rig.h:653
@ RIG_PTT_SERIAL_RTS
Definition: rig.h:650
@ RIG_ANN_RXMODE
Definition: rig.h:835
@ RIG_ANN_OFF
Definition: rig.h:833
@ RIG_ANN_ENG
Definition: rig.h:837
@ RIG_ANN_FREQ
Definition: rig.h:834
@ RIG_ANN_NONE
Definition: rig.h:832
@ RIG_ANN_CW
Definition: rig.h:836
@ RIG_ANN_JAP
Definition: rig.h:838
@ RIG_PARM_BEEP
Definition: rig.h:1046
@ RIG_PARM_TIME
Definition: rig.h:1047
@ RIG_PARM_SCREENSAVER
Definition: rig.h:1050
@ RIG_PARM_ANN
Definition: rig.h:1043
@ RIG_PARM_AFIF
Definition: rig.h:1051
@ RIG_PARM_NONE
Definition: rig.h:1042
@ RIG_PARM_BACKLIGHT
Definition: rig.h:1045
@ RIG_PARM_KEYLIGHT
Definition: rig.h:1049
@ RIG_PARM_BAT
Definition: rig.h:1048
@ RIG_PARM_APO
Definition: rig.h:1044
@ RIG_POWER_OPERATE
Definition: rig.h:666
@ RIG_POWER_UNKNOWN
Definition: rig.h:667
@ RIG_POWER_STANDBY
Definition: rig.h:665
@ RIG_POWER_OFF
Definition: rig.h:663
@ RIG_POWER_ON
Definition: rig.h:664
@ 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:790
@ RIG_CONF_BUTTON
Definition: rig.h:794
@ RIG_CONF_CHECKBUTTON
Definition: rig.h:793
@ RIG_CONF_BINARY
Definition: rig.h:795
@ RIG_CONF_COMBO
Definition: rig.h:791
@ RIG_CONF_NUMERIC
Definition: rig.h:792
@ RIG_SCAN_DELTA
Definition: rig.h:757
@ RIG_SCAN_PLT
Definition: rig.h:759
@ RIG_SCAN_PROG
Definition: rig.h:756
@ RIG_SCAN_MEM
Definition: rig.h:753
@ RIG_SCAN_NONE
Definition: rig.h:752
@ RIG_SCAN_VFO
Definition: rig.h:758
@ RIG_SCAN_PRIO
Definition: rig.h:755
@ RIG_SCAN_SLCT
Definition: rig.h:754
@ RIG_SCAN_STOP
Definition: rig.h:760
@ RIG_COOKIE_RENEW
Definition: rig.h:1065
@ RIG_COOKIE_RELEASE
Definition: rig.h:1064
@ RIG_COOKIE_GET
Definition: rig.h:1063
@ RIG_PTT_OFF
Definition: rig.h:634
@ RIG_PTT_ON_DATA
Definition: rig.h:637
@ RIG_PTT_ON_MIC
Definition: rig.h:636
@ RIG_PTT_ON
Definition: rig.h:635
@ RIG_OP_CPY
Definition: rig.h:700
@ RIG_OP_DOWN
Definition: rig.h:706
@ RIG_OP_TO_VFO
Definition: rig.h:703
@ RIG_OP_TUNE
Definition: rig.h:711
@ RIG_OP_FROM_VFO
Definition: rig.h:702
@ RIG_OP_MCL
Definition: rig.h:704
@ RIG_OP_RIGHT
Definition: rig.h:710
@ RIG_OP_UP
Definition: rig.h:705
@ RIG_OP_TOGGLE
Definition: rig.h:712
@ RIG_OP_NONE
Definition: rig.h:699
@ RIG_OP_BAND_UP
Definition: rig.h:707
@ RIG_OP_BAND_DOWN
Definition: rig.h:708
@ RIG_OP_LEFT
Definition: rig.h:709
@ RIG_OP_XCHG
Definition: rig.h:701
@ 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:621
@ RIG_DCD_PARALLEL
Definition: rig.h:623
@ RIG_DCD_CM108
Definition: rig.h:624
@ RIG_DCD_RIG
Definition: rig.h:619
@ RIG_DCD_GPION
Definition: rig.h:626
@ RIG_DCD_NONE
Definition: rig.h:618
@ RIG_DCD_SERIAL_DSR
Definition: rig.h:620
@ RIG_DCD_GPIO
Definition: rig.h:625
@ RIG_DCD_SERIAL_CAR
Definition: rig.h:622
@ 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:678
@ RIG_RESET_MASTER
Definition: rig.h:679
@ RIG_RESET_NONE
Definition: rig.h:675
@ RIG_RESET_VFO
Definition: rig.h:677
@ RIG_RESET_SOFT
Definition: rig.h:676
@ RIG_STATUS_STABLE
Definition: rig.h:373
@ RIG_STATUS_BUGGY
Definition: rig.h:374
@ RIG_STATUS_UNTESTED
Definition: rig.h:371
@ RIG_STATUS_BETA
Definition: rig.h:372
@ RIG_STATUS_ALPHA
Definition: rig.h:370
@ RIG_SPECTRUM_MODE_CENTER_SCROLL
Definition: rig.h:1704
@ RIG_SPECTRUM_MODE_FIXED_SCROLL
Definition: rig.h:1705
@ RIG_SPECTRUM_MODE_FIXED
Definition: rig.h:1703
@ RIG_SPECTRUM_MODE_CENTER
Definition: rig.h:1702
@ RIG_MTYPE_PRIO
Definition: rig.h:1559
@ RIG_MTYPE_EDGE
Definition: rig.h:1554
@ RIG_MTYPE_MEM
Definition: rig.h:1553
@ RIG_MTYPE_CALL
Definition: rig.h:1555
@ RIG_MTYPE_SAT
Definition: rig.h:1557
@ RIG_MTYPE_MEMOPAD
Definition: rig.h:1556
@ RIG_MTYPE_NONE
Definition: rig.h:1552
@ RIG_MTYPE_BAND
Definition: rig.h:1558
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:1656
float val
Definition: rig.h:1660
struct cal_table_float::@4 table[HAMLIB_MAX_CAL_LENGTH]
int size
Definition: rig.h:1657
int raw
Definition: rig.h:1659
Calibration table struct.
Definition: rig.h:1626
int val
Definition: rig.h:1630
struct cal_table::@3 table[HAMLIB_MAX_CAL_LENGTH]
int raw
Definition: rig.h:1629
int size
Definition: rig.h:1627
Memory channel list definition.
Definition: rig.h:1576
int startc
Definition: rig.h:1577
chan_type_t type
Definition: rig.h:1579
channel_cap_t mem_caps
Definition: rig.h:1581
int endc
Definition: rig.h:1578
Channel capability definition.
Definition: rig.h:1504
unsigned tx_vfo
Definition: rig.h:1517
unsigned tx_freq
Definition: rig.h:1512
unsigned mode
Definition: rig.h:1509
unsigned dcs_code
Definition: rig.h:1527
unsigned rit
Definition: rig.h:1521
unsigned dcs_sql
Definition: rig.h:1528
unsigned rptr_offs
Definition: rig.h:1519
unsigned bank_num
Definition: rig.h:1505
setting_t levels
Definition: rig.h:1524
unsigned width
Definition: rig.h:1510
unsigned rptr_shift
Definition: rig.h:1518
unsigned tx_width
Definition: rig.h:1514
unsigned ctcss_sql
Definition: rig.h:1526
unsigned tx_mode
Definition: rig.h:1513
unsigned freq
Definition: rig.h:1508
setting_t funcs
Definition: rig.h:1523
unsigned ctcss_tone
Definition: rig.h:1525
unsigned ext_levels
Definition: rig.h:1532
unsigned vfo
Definition: rig.h:1506
unsigned ant
Definition: rig.h:1507
unsigned split
Definition: rig.h:1516
unsigned scan_group
Definition: rig.h:1529
unsigned flags
Definition: rig.h:1530
unsigned tuning_step
Definition: rig.h:1520
unsigned xit
Definition: rig.h:1522
unsigned channel_desc
Definition: rig.h:1531
Channel structure.
Definition: rig.h:1460
shortfreq_t tuning_step
Definition: rig.h:1478
rmode_t mode
Definition: rig.h:1466
tone_t ctcss_tone
Definition: rig.h:1483
pbwidth_t tx_width
Definition: rig.h:1471
vfo_t vfo
Definition: rig.h:1463
value_t levels[64]
Definition: rig.h:1482
shortfreq_t rptr_offs
Definition: rig.h:1477
vfo_t tx_vfo
Definition: rig.h:1474
tone_t dcs_code
Definition: rig.h:1485
setting_t funcs
Definition: rig.h:1481
struct ext_list * ext_levels
Definition: rig.h:1490
tone_t ctcss_sql
Definition: rig.h:1484
shortfreq_t xit
Definition: rig.h:1480
int bank_num
Definition: rig.h:1462
pbwidth_t width
Definition: rig.h:1467
freq_t freq
Definition: rig.h:1465
rptr_shift_t rptr_shift
Definition: rig.h:1476
shortfreq_t rit
Definition: rig.h:1479
char channel_desc[HAMLIB_MAXCHANDESC]
Definition: rig.h:1489
rmode_t tx_mode
Definition: rig.h:1470
split_t split
Definition: rig.h:1473
freq_t tx_freq
Definition: rig.h:1469
ant_t ant
Definition: rig.h:1464
unsigned int flags
Definition: rig.h:1488
int scan_group
Definition: rig.h:1487
int channel_num
Definition: rig.h:1461
tone_t dcs_sql
Definition: rig.h:1486
Configuration parameter structure.
Definition: rig.h:806
const char * combostr[RIG_COMBO_MAX]
Definition: rig.h:820
const char * tooltip
Definition: rig.h:810
struct confparams::@0::@2 c
const char * dflt
Definition: rig.h:811
float min
Definition: rig.h:815
token_t token
Definition: rig.h:807
float step
Definition: rig.h:817
const char * label
Definition: rig.h:809
float max
Definition: rig.h:816
const char * name
Definition: rig.h:808
struct confparams::@0::@1 n
enum rig_conf_e type
Definition: rig.h:812
union confparams::@0 u
Extension attribute definition.
Definition: rig.h:1443
token_t token
Definition: rig.h:1444
value_t val
Definition: rig.h:1445
Filter definition.
Definition: rig.h:1410
rmode_t modes
Definition: rig.h:1411
pbwidth_t width
Definition: rig.h:1412
Frequency range.
Definition: rig.h:1343
freq_t startf
Definition: rig.h:1344
freq_t endf
Definition: rig.h:1345
int low_power
Definition: rig.h:1347
char * label
Definition: rig.h:1351
ant_t ant
Definition: rig.h:1350
int high_power
Definition: rig.h:1348
vfo_t vfo
Definition: rig.h:1349
rmode_t modes
Definition: rig.h:1346
level/parm granularity definition
Definition: rig.h:1611
value_t max
Definition: rig.h:1613
value_t step
Definition: rig.h:1614
value_t min
Definition: rig.h:1612
Definition: network.c:123
Rig cache data.
Definition: rig.h:2393
Callback functions and args for rig event.
Definition: rig.h:2634
rig_ptr_t mode_arg
Definition: rig.h:2638
ptt_cb_t ptt_event
Definition: rig.h:2641
vfo_cb_t vfo_event
Definition: rig.h:2639
spectrum_cb_t spectrum_event
Definition: rig.h:2647
mode_cb_t mode_event
Definition: rig.h:2637
rig_ptr_t freq_arg
Definition: rig.h:2636
rig_ptr_t spectrum_arg
Definition: rig.h:2648
rig_ptr_t ptt_arg
Definition: rig.h:2642
rig_ptr_t dcd_arg
Definition: rig.h:2644
dcd_cb_t dcd_event
Definition: rig.h:2643
rig_ptr_t pltune_arg
Definition: rig.h:2646
pltune_cb_t pltune
Definition: rig.h:2645
rig_ptr_t vfo_arg
Definition: rig.h:2640
freq_cb_t freq_event
Definition: rig.h:2635
Spectrum scope averaging modes.
Definition: rig.h:1712
Represents a single line of rig spectrum scope FFT data.
Definition: rig.h:1729
size_t spectrum_data_length
Definition: rig.h:1745
freq_t low_edge_freq
Definition: rig.h:1742
int data_level_min
Definition: rig.h:1732
int id
Definition: rig.h:1730
enum rig_spectrum_mode_e spectrum_mode
Definition: rig.h:1737
double signal_strength_max
Definition: rig.h:1735
freq_t center_freq
Definition: rig.h:1739
freq_t span_freq
Definition: rig.h:1740
double signal_strength_min
Definition: rig.h:1734
unsigned char * spectrum_data
Definition: rig.h:1746
int data_level_max
Definition: rig.h:1733
freq_t high_edge_freq
Definition: rig.h:1743
Spectrum scope.
Definition: rig.h:1692
Rig state containing live data and customized fields.
Definition: rig.h:2478
int auto_power_on
Definition: rig.h:2556
int transaction_active
Definition: rig.h:2529
int attenuator[HAMLIB_MAXDBLSTSIZ]
Definition: rig.h:2512
int vfo_opt
Definition: rig.h:2555
int twiddle_rit
Definition: rig.h:2568
setting_t has_set_parm
Definition: rig.h:2519
rmode_t mode_list
Definition: rig.h:2543
int async_data_enabled
Definition: rig.h:2536
shortfreq_t max_rit
Definition: rig.h:2505
freq_t lo_freq
Definition: rig.h:2549
int power_max
Definition: rig.h:2566
gran_t parm_gran[64]
Definition: rig.h:2522
freq_range_t rx_range_list[HAMLIB_FRQRANGESIZ]
Definition: rig.h:2494
hamlib_port_t_deprecated rigport_deprecated
Definition: rig.h:2487
vfo_t rx_vfo
Definition: rig.h:2570
rmode_t current_mode
Definition: rig.h:2539
setting_t has_set_func
Definition: rig.h:2515
int uplink
Definition: rig.h:2553
rig_ptr_t obj
Definition: rig.h:2534
int twiddle_state
Definition: rig.h:2569
struct filter_list filters[HAMLIB_FLTLSTSIZ]
Definition: rig.h:2499
pbwidth_t current_width
Definition: rig.h:2541
int ptt_share
Definition: rig.h:2563
rig_ptr_t priv
Definition: rig.h:2533
freq_range_t tx_range_list[HAMLIB_FRQRANGESIZ]
Definition: rig.h:2495
freq_t current_freq
Definition: rig.h:2538
hamlib_port_t dcdport
Definition: rig.h:2583
time_t twiddle_time
Definition: rig.h:2550
vfo_t tx_vfo
Definition: rig.h:2542
int deprecated_itu_region
Definition: rig.h:2493
int power_min
Definition: rig.h:2565
double vfo_comp
Definition: rig.h:2491
setting_t has_set_level
Definition: rig.h:2517
hamlib_port_t_deprecated pttport_deprecated
Definition: rig.h:2488
shortfreq_t max_xit
Definition: rig.h:2506
hamlib_port_t rigport
Definition: rig.h:2581
int power_now
Definition: rig.h:2564
int twiddle_timeout
Definition: rig.h:2551
int poll_interval
Definition: rig.h:2537
unsigned char disable_yaesu_bandselect
Definition: rig.h:2567
int auto_power_off
Definition: rig.h:2558
setting_t has_get_parm
Definition: rig.h:2518
int preamp[HAMLIB_MAXDBLSTSIZ]
Definition: rig.h:2511
vfo_t current_vfo
Definition: rig.h:2530
hamlib_port_t_deprecated dcdport_deprecated
Definition: rig.h:2489
int auto_disable_screensaver
Definition: rig.h:2560
int comm_state
Definition: rig.h:2532
int vfo_list
Definition: rig.h:2531
setting_t has_get_level
Definition: rig.h:2516
setting_t has_get_func
Definition: rig.h:2514
int transmit
Definition: rig.h:2546
ann_t announces
Definition: rig.h:2509
cal_table_t str_cal
Definition: rig.h:2501
shortfreq_t max_ifshift
Definition: rig.h:2507
gran_t level_gran[64]
Definition: rig.h:2521
hamlib_port_t pttport
Definition: rig.h:2582
struct tuning_step_list tuning_steps[HAMLIB_TSLSTSIZ]
Definition: rig.h:2497
The Rig structure.
Definition: rig.h:2662
struct rig_callbacks callbacks
Definition: rig.h:2665
struct rig_state state
Definition: rig.h:2664
struct rig_caps * caps
Definition: rig.h:2663
Tuning step definition.
Definition: rig.h:1375
rmode_t modes
Definition: rig.h:1376
shortfreq_t ts
Definition: rig.h:1377
Universal approach for passing values.
Definition: rig.h:931
char * s
Definition: rig.h:934
float f
Definition: rig.h:933
const char * cs
Definition: rig.h:935
signed int i
Definition: rig.h:932