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