Hamlib  4.0
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 #include <stdio.h>
28 #include <stdarg.h>
29 #include <inttypes.h>
30 #include <time.h>
31 
32 /* Rig list is in a separate file so as not to mess up w/ this one */
33 #include <hamlib/riglist.h>
34 
48 /* __BEGIN_DECLS should be used at the beginning of your declarations,
49  * so that C++ compilers don't mangle their names. Use __END_DECLS at
50  * the end of C declarations. */
52 #undef __BEGIN_DECLS
53 #undef __END_DECLS
54 #ifdef __cplusplus
55 # define __BEGIN_DECLS extern "C" {
56 # define __END_DECLS }
57 #else
58 # define __BEGIN_DECLS /* empty */
59 # define __END_DECLS /* empty */
60 #endif
62 
63 /* HAMLIB_PARAMS is a macro used to wrap function prototypes, so that compilers
64  * that don't understand ANSI C prototypes still work, and ANSI C
65  * compilers can issue warnings about type mismatches. */
67 #undef HAMLIB_PARAMS
68 #if defined (__STDC__) \
69  || defined (_AIX) \
70  || (defined (__mips) && defined (_SYSTYPE_SVR4)) \
71  || defined(__CYGWIN__) \
72  || defined(_WIN32) \
73  || defined(__cplusplus)
74 # define HAMLIB_PARAMS(protos) protos
75 # define rig_ptr_t void *
76 # define amp_ptr_t void *
77 #else
78 # define HAMLIB_PARAMS(protos) ()
79 # define rig_ptr_t char *
80 # define amp_ptr_t char *
81 #endif
83 
84 #include <hamlib/rig_dll.h>
85 
86 #ifndef SWIGLUA
88 #define CONSTANT_64BIT_FLAG(BIT) (1ull << (BIT))
90 #else
91 /* SWIG's older Lua generator doesn't grok ull due to Lua using a
92  double-precision floating point type internally for number
93  representations (max 53 bits of precision) so makes a string
94  constant from a constant number literal using ull */
95 // #define CONSTANT_64BIT_FLAG(BIT) (1 << (BIT))
96 // #define SWIGLUAHIDE
97 /* But this appears to have been fixed so we'll use the correct one now
98  If you have the older version of SWIG comment out this line and use
99  the two above */
100 // This 1ul definition works on swig 4.0.1 and lua 5.3.5
101 #define CONSTANT_64BIT_FLAG(BIT) (1ul << (BIT))
102 #endif
103 
104 __BEGIN_DECLS
105 
107 extern HAMLIB_EXPORT_VAR(const char) hamlib_version[];
108 extern HAMLIB_EXPORT_VAR(const char) hamlib_copyright[];
109 extern HAMLIB_EXPORT_VAR(const char *) hamlib_version2;
110 extern HAMLIB_EXPORT_VAR(const char *) hamlib_copyright2;
112 
120  RIG_OK = 0,
137  RIG_EDOM
138 };
139 
143 #define NETRIGCTL_RET "RPRT "
144 
145 
160 };
161 
162 
163 /* --------------- Rig capabilities -----------------*/
164 
165 /* Forward struct references */
166 
167 struct rig;
168 struct rig_state;
169 
173 typedef struct s_rig RIG;
174 
176 #define RIGNAMSIZ 30
177 #define RIGVERSIZ 8
178 #define FILPATHLEN 512
179 #define FRQRANGESIZ 30
180 #define MAXCHANDESC 30 /* describe channel eg: "WWV 5Mhz" */
181 #define TSLSTSIZ 20 /* max tuning step list size, zero ended */
182 #define FLTLSTSIZ 60 /* max mode/filter list size, zero ended */
183 #define MAXDBLSTSIZ 8 /* max preamp/att levels supported, zero ended */
184 #define CHANLSTSIZ 16 /* max mem_list size, zero ended */
185 #define MAX_CAL_LENGTH 32 /* max calibration plots in cal_table_t */
187 
188 
199 typedef unsigned int tone_t;
200 
201 
205 typedef enum rig_port_e {
221 
222 
232 };
233 
234 
242 };
243 
244 
252 };
253 
254 
258 typedef enum {
259  RIG_FLAG_RECEIVER = (1 << 1),
260  RIG_FLAG_TRANSMITTER = (1 << 2),
261  RIG_FLAG_SCANNER = (1 << 3),
262  RIG_FLAG_MOBILE = (1 << 4),
263  RIG_FLAG_HANDHELD = (1 << 5),
264  RIG_FLAG_COMPUTER = (1 << 6),
265  RIG_FLAG_TRUNKING = (1 << 7),
266  RIG_FLAG_APRS = (1 << 8),
267  RIG_FLAG_TNC = (1 << 9),
268  RIG_FLAG_DXCLUSTER = (1 << 10),
269  RIG_FLAG_TUNER = (1 << 11)
271 
273 #define RIG_FLAG_TRANSCEIVER (RIG_FLAG_RECEIVER|RIG_FLAG_TRANSMITTER)
274 #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)
275 
276 #define RIG_TYPE_OTHER 0
277 #define RIG_TYPE_TRANSCEIVER RIG_FLAG_TRANSCEIVER
278 #define RIG_TYPE_HANDHELD (RIG_FLAG_TRANSCEIVER|RIG_FLAG_HANDHELD)
279 #define RIG_TYPE_MOBILE (RIG_FLAG_TRANSCEIVER|RIG_FLAG_MOBILE)
280 #define RIG_TYPE_RECEIVER RIG_FLAG_RECEIVER
281 #define RIG_TYPE_PCRECEIVER (RIG_FLAG_COMPUTER|RIG_FLAG_RECEIVER)
282 #define RIG_TYPE_SCANNER (RIG_FLAG_SCANNER|RIG_FLAG_RECEIVER)
283 #define RIG_TYPE_TRUNKSCANNER (RIG_TYPE_SCANNER|RIG_FLAG_TRUNKING)
284 #define RIG_TYPE_COMPUTER (RIG_FLAG_TRANSCEIVER|RIG_FLAG_COMPUTER)
285 #define RIG_TYPE_TUNER RIG_FLAG_TUNER
287 
288 
298  /* RIG_STATUS_NEW * *!< Initial release of code
299  * !! Use of RIG_STATUS_NEW is deprecated. Do not use it anymore */
300 };
301 
306 #define RIG_STATUS_NEW RIG_STATUS_UNTESTED
307 
308 
312 typedef enum {
317 
318 
322 typedef enum {
324  RIG_SPLIT_ON
326 
327 
333 typedef double freq_t;
334 
338 #define PRIfreq "f"
339 
343 #define SCNfreq "lf"
347 #define FREQFMT SCNfreq
348 
349 
355 typedef signed long shortfreq_t;
356 
358 #define Hz(f) ((freq_t)(f))
360 #define kHz(f) ((freq_t)((f)*(freq_t)1000))
362 #define MHz(f) ((freq_t)((f)*(freq_t)1000000))
364 #define GHz(f) ((freq_t)((f)*(freq_t)1000000000))
365 
367 #define s_Hz(f) ((shortfreq_t)(f))
369 #define s_kHz(f) ((shortfreq_t)((f)*(shortfreq_t)1000))
371 #define s_MHz(f) ((shortfreq_t)((f)*(shortfreq_t)1000000))
373 #define s_GHz(f) ((shortfreq_t)((f)*(shortfreq_t)1000000000))
374 
376 #define RIG_FREQ_NONE Hz(0)
377 
378 
393 typedef unsigned int vfo_t;
394 
397 #define RIG_VFO_N(n) (1u<<(n))
398 
400 #define RIG_VFO_NONE 0
401 
403 #define RIG_VFO_A RIG_VFO_N(0)
404 
406 #define RIG_VFO_B RIG_VFO_N(1)
407 
409 #define RIG_VFO_C RIG_VFO_N(2)
410 
411 // Any addition VFOS need to go from 3-20
412 // To maintain backward compatibility these values cannot change
413 
415 #define RIG_VFO_SUB_A RIG_VFO_N(21)
416 
418 #define RIG_VFO_SUB_B RIG_VFO_N(22)
419 
421 #define RIG_VFO_MAIN_A RIG_VFO_N(23)
422 
424 #define RIG_VFO_MAIN_B RIG_VFO_N(24)
425 
427 #define RIG_VFO_SUB RIG_VFO_N(25)
428 
430 #define RIG_VFO_MAIN RIG_VFO_N(26)
431 
433 #define RIG_VFO_VFO RIG_VFO_N(27)
434 
436 #define RIG_VFO_MEM RIG_VFO_N(28)
437 
439 #define RIG_VFO_CURR RIG_VFO_N(29)
440 
442 #define RIG_VFO_TX_FLAG RIG_VFO_N(30)
443 // we and also use RIG_VFO_N(31) if needed
444 
445 // Misc VFO Macros
446 
448 #define RIG_VFO_TX_VFO(v) ((v)|RIG_VFO_TX_FLAG)
449 
451 #define RIG_VFO_TX RIG_VFO_TX_VFO(RIG_VFO_CURR)
452 
454 #define RIG_VFO_RX RIG_VFO_CURR
455 
456 
457 /*
458  * targetable bitfields, for internal use.
459  * RIG_TARGETABLE_PURE means a pure targetable radio on every command
460  * In rig.c lack of a flag will case a VFO change if needed
461  * So setting this flag will mean the backend handles any VFO needs
462  * For many rigs RITXIT, PTT, MEM, and BANK are non-VFO commands so need these flags to avoid unnecessary VFO swapping
463  */
465 #define RIG_TARGETABLE_NONE 0
466 #define RIG_TARGETABLE_FREQ (1<<0)
467 #define RIG_TARGETABLE_MODE (1<<1)
468 #define RIG_TARGETABLE_PURE (1<<2)
469 #define RIG_TARGETABLE_TONE (1<<3)
470 #define RIG_TARGETABLE_FUNC (1<<4)
471 #define RIG_TARGETABLE_LEVEL (1<<5)
472 #define RIG_TARGETABLE_RITXIT (1<<6)
473 #define RIG_TARGETABLE_PTT (1<<7)
474 #define RIG_TARGETABLE_MEM (1<<8)
475 #define RIG_TARGETABLE_BANK (1<<9)
476 #define RIG_TARGETABLE_COMMON (RIG_TARGETABLE_RITXIT | RIG_TARGETABLE_PTT | RIG_TARGETABLE_MEM | RIG_TARGETABLE_BANK)
477 #define RIG_TARGETABLE_ALL 0x7fffffff
479 //
480 //
481 // Newer Icoms like the 9700 and 910 have VFOA/B on both Main & Sub
482 // Compared to older rigs which have one or the other
483 // So we need to distinguish between them
485 #define VFO_HAS_A_B ((rig->state.vfo_list & (RIG_VFO_A|RIG_VFO_B)) == (RIG_VFO_A|RIG_VFO_B))
486 #define VFO_HAS_MAIN_SUB ((rig->state.vfo_list & (RIG_VFO_MAIN|RIG_VFO_SUB)) == (RIG_VFO_MAIN|RIG_VFO_SUB))
487 #define VFO_HAS_MAIN_SUB_ONLY ((!VFO_HAS_A_B) & VFO_HAS_MAIN_SUB)
488 #define VFO_HAS_MAIN_SUB_A_B_ONLY (VFO_HAS_A_B & VFO_HAS_MAIN_SUB)
489 #define VFO_HAS_A_B_ONLY (VFO_HAS_A_B & (!VFO_HAS_MAIN_SUB))
490 #define VFO_DUAL (RIG_VFO_MAIN_A|RIG_VFO_MAIN_B|RIG_VFO_SUB_A|RIG_VFO_SUB_B)
491 #define VFO_HAS_DUAL ((rig->state.vfo_list & VFO_DUAL == VFO_DUAL)
493 
498 #define RIG_PASSBAND_NORMAL s_Hz(0)
499 
503 #define RIG_PASSBAND_NOCHANGE s_Hz(-1)
504 
510 
511 
515 typedef enum dcd_e {
517  RIG_DCD_ON
519 
520 
526 typedef enum {
536 } dcd_type_t;
537 
538 
542 typedef enum {
548 
549 
555 typedef enum {
565 } ptt_type_t;
566 
567 
571 typedef enum {
573  RIG_POWER_ON = (1 << 0),
574  RIG_POWER_STANDBY = (1 << 1),
575  RIG_POWER_OPERATE = (1 << 2),
576  RIG_POWER_UNKNOWN = (1 << 3)
578 
579 
583 typedef enum {
585  RIG_RESET_SOFT = (1 << 0),
586  RIG_RESET_VFO = (1 << 1),
587  RIG_RESET_MCALL = (1 << 2),
588  RIG_RESET_MASTER = (1 << 3)
590 
591 
607 typedef enum {
609  RIG_OP_CPY = (1 << 0),
610  RIG_OP_XCHG = (1 << 1),
611  RIG_OP_FROM_VFO = (1 << 2),
612  RIG_OP_TO_VFO = (1 << 3),
613  RIG_OP_MCL = (1 << 4),
614  RIG_OP_UP = (1 << 5),
615  RIG_OP_DOWN = (1 << 6),
616  RIG_OP_BAND_UP = (1 << 7),
617  RIG_OP_BAND_DOWN = (1 << 8),
618  RIG_OP_LEFT = (1 << 9),
619  RIG_OP_RIGHT = (1 << 10),
620  RIG_OP_TUNE = (1 << 11),
621  RIG_OP_TOGGLE = (1 << 12)
623 
624 
633 typedef enum {
635  RIG_SCAN_MEM = (1 << 0),
636  RIG_SCAN_SLCT = (1 << 1),
637  RIG_SCAN_PRIO = (1 << 2),
638  RIG_SCAN_PROG = (1 << 3),
639  RIG_SCAN_DELTA = (1 << 4),
640  RIG_SCAN_VFO = (1 << 5),
641  RIG_SCAN_PLT = (1 << 6),
642  RIG_SCAN_STOP = (1 << 7)
644 
645 
649 typedef long token_t;
650 
651 
653 #define RIG_CONF_END 0
655 
656 
670 /* strongly inspired from soundmodem. Thanks Thomas! */
678 };
679 
681 #define RIG_COMBO_MAX 16
682 #define RIG_BIN_MAX 80
684 
688 struct confparams {
690  const char *name;
691  const char *label;
692  const char *tooltip;
693  const char *dflt;
694  enum rig_conf_e type;
695  union {
696  struct {
697  float min;
698  float max;
699  float step;
700  } n;
701  struct {
702  const char *combostr[RIG_COMBO_MAX];
703  } c;
704  } u;
705 };
706 
707 
713 typedef enum {
716  RIG_ANN_FREQ = (1 << 0),
717  RIG_ANN_RXMODE = (1 << 1),
718  RIG_ANN_CW = (1 << 2),
719  RIG_ANN_ENG = (1 << 3),
720  RIG_ANN_JAP = (1 << 4)
722 
723 
770 typedef unsigned int ant_t;
771 
772 #define RIG_ANT_NONE 0
773 #define RIG_ANT_N(n) ((ant_t)1<<(n))
774 #define RIG_ANT_1 RIG_ANT_N(0)
775 #define RIG_ANT_2 RIG_ANT_N(1)
776 #define RIG_ANT_3 RIG_ANT_N(2)
777 #define RIG_ANT_4 RIG_ANT_N(3)
778 #define RIG_ANT_5 RIG_ANT_N(4)
779 
780 #define RIG_ANT_UNKNOWN RIG_ANT_N(30)
781 #define RIG_ANT_CURR RIG_ANT_N(31)
782 
783 #define RIG_ANT_MAX 32
784 
785 
789 /* TODO: kill me, and replace by real AGC delay */
791  RIG_AGC_OFF = 0,
792  RIG_AGC_SUPERFAST,
793  RIG_AGC_FAST,
794  RIG_AGC_SLOW,
796  RIG_AGC_MEDIUM,
797  RIG_AGC_AUTO
798 };
799 
801 #define RIG_AGC_LAST RIG_AGC_AUTO
803 
808  RIG_METER_NONE = 0, /*< No display meter */
809  RIG_METER_SWR = (1 << 0), /*< Stationary Wave Ratio */
810  RIG_METER_COMP = (1 << 1), /*< Compression level */
811  RIG_METER_ALC = (1 << 2), /*< ALC */
812  RIG_METER_IC = (1 << 3), /*< IC */
813  RIG_METER_DB = (1 << 4), /*< DB */
814  RIG_METER_PO = (1 << 5), /*< Power Out */
815  RIG_METER_VDD = (1 << 6), /*< Final Amp Voltage */
816  RIG_METER_TEMP = (1 << 7) /*< Final Amp Voltage */
817 };
818 
819 
825 typedef union {
826  signed int i;
827  float f;
828  char *s;
829  const char *cs;
831  struct {
832  int l;
833  unsigned char *d; /* Pointer to data buffer */
834  } b;
836 } value_t;
837 
838 
849  RIG_LEVEL_PREAMP = (1 << 0),
850  RIG_LEVEL_ATT = (1 << 1),
851  RIG_LEVEL_VOXDELAY = (1 << 2),
852  RIG_LEVEL_AF = (1 << 3),
853  RIG_LEVEL_RF = (1 << 4),
854  RIG_LEVEL_SQL = (1 << 5),
855  RIG_LEVEL_IF = (1 << 6),
856  RIG_LEVEL_APF = (1 << 7),
857  RIG_LEVEL_NR = (1 << 8),
858  RIG_LEVEL_PBT_IN = (1 << 9),
859  RIG_LEVEL_PBT_OUT = (1 << 10),
860  RIG_LEVEL_CWPITCH = (1 << 11),
861  RIG_LEVEL_RFPOWER = (1 << 12),
862  RIG_LEVEL_MICGAIN = (1 << 13),
863  RIG_LEVEL_KEYSPD = (1 << 14),
864  RIG_LEVEL_NOTCHF = (1 << 15),
865  RIG_LEVEL_COMP = (1 << 16),
866  RIG_LEVEL_AGC = (1 << 17),
867  RIG_LEVEL_BKINDL = (1 << 18),
868  RIG_LEVEL_BALANCE = (1 << 19),
869  RIG_LEVEL_METER = (1 << 20),
870  RIG_LEVEL_VOXGAIN = (1 << 21),
871  RIG_LEVEL_ANTIVOX = (1 << 22),
872  RIG_LEVEL_SLOPE_LOW = (1 << 23),
873  RIG_LEVEL_SLOPE_HIGH = (1 << 24),
874  RIG_LEVEL_BKIN_DLYMS = (1 << 25),
877  RIG_LEVEL_RAWSTR = (1 << 26),
878  RIG_LEVEL_SQLSTAT = (1 << 27),
879  RIG_LEVEL_SWR = (1 << 28),
880  RIG_LEVEL_ALC = (1 << 29),
881  RIG_LEVEL_STRENGTH = (1 << 30),
882  /* RIG_LEVEL_BWC = (1<<31) */
883  RIG_LEVEL_RFPOWER_METER = CONSTANT_64BIT_FLAG(32),
884  RIG_LEVEL_COMP_METER = CONSTANT_64BIT_FLAG(33),
885  RIG_LEVEL_VD_METER = CONSTANT_64BIT_FLAG(34),
886  RIG_LEVEL_ID_METER = CONSTANT_64BIT_FLAG(35),
888  RIG_LEVEL_NOTCHF_RAW = CONSTANT_64BIT_FLAG(36),
889  RIG_LEVEL_MONITOR_GAIN = CONSTANT_64BIT_FLAG(37),
890  RIG_LEVEL_NB = CONSTANT_64BIT_FLAG(38),
891  RIG_LEVEL_RFPOWER_METER_WATTS = CONSTANT_64BIT_FLAG(39),
892  RIG_LEVEL_40 = CONSTANT_64BIT_FLAG(40),
893  RIG_LEVEL_41 = CONSTANT_64BIT_FLAG(41),
894  RIG_LEVEL_42 = CONSTANT_64BIT_FLAG(42),
895  RIG_LEVEL_43 = CONSTANT_64BIT_FLAG(43),
896  RIG_LEVEL_44 = CONSTANT_64BIT_FLAG(44),
897  RIG_LEVEL_45 = CONSTANT_64BIT_FLAG(45),
898  RIG_LEVEL_46 = CONSTANT_64BIT_FLAG(46),
899  RIG_LEVEL_47 = CONSTANT_64BIT_FLAG(47),
900  RIG_LEVEL_48 = CONSTANT_64BIT_FLAG(48),
901  RIG_LEVEL_49 = CONSTANT_64BIT_FLAG(49),
902  RIG_LEVEL_50 = CONSTANT_64BIT_FLAG(50),
903  RIG_LEVEL_51 = CONSTANT_64BIT_FLAG(51),
904  RIG_LEVEL_52 = CONSTANT_64BIT_FLAG(52),
905  RIG_LEVEL_53 = CONSTANT_64BIT_FLAG(53),
906  RIG_LEVEL_54 = CONSTANT_64BIT_FLAG(54),
907  RIG_LEVEL_55 = CONSTANT_64BIT_FLAG(55),
908  RIG_LEVEL_56 = CONSTANT_64BIT_FLAG(56),
909  RIG_LEVEL_57 = CONSTANT_64BIT_FLAG(57),
910  RIG_LEVEL_58 = CONSTANT_64BIT_FLAG(58),
911  RIG_LEVEL_59 = CONSTANT_64BIT_FLAG(59),
912  RIG_LEVEL_60 = CONSTANT_64BIT_FLAG(60),
913  RIG_LEVEL_61 = CONSTANT_64BIT_FLAG(61),
914  RIG_LEVEL_62 = CONSTANT_64BIT_FLAG(62),
915  RIG_LEVEL_63 = CONSTANT_64BIT_FLAG(63),
916 };
917 
919 #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)
920 
921 #define RIG_LEVEL_READONLY_LIST (RIG_LEVEL_SQLSTAT|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)
922 
923 #define RIG_LEVEL_IS_FLOAT(l) ((l)&RIG_LEVEL_FLOAT_LIST)
924 #define RIG_LEVEL_SET(l) ((l)&~RIG_LEVEL_READONLY_LIST)
926 
927 
938  RIG_PARM_ANN = (1 << 0),
939  RIG_PARM_APO = (1 << 1),
940  RIG_PARM_BACKLIGHT = (1 << 2),
941  RIG_PARM_BEEP = (1 << 4),
942  RIG_PARM_TIME = (1 << 5),
943  RIG_PARM_BAT = (1 << 6),
944  RIG_PARM_KEYLIGHT = (1 << 7),
945  RIG_PARM_SCREENSAVER = (1 << 8)
946 };
947 
949 #define RIG_PARM_FLOAT_LIST (RIG_PARM_BACKLIGHT|RIG_PARM_BAT|RIG_PARM_KEYLIGHT)
950 #define RIG_PARM_READONLY_LIST (RIG_PARM_BAT)
951 
952 #define RIG_PARM_IS_FLOAT(l) ((l)&RIG_PARM_FLOAT_LIST)
953 #define RIG_PARM_SET(l) ((l)&~RIG_PARM_READONLY_LIST)
955 
962 typedef uint64_t setting_t;
963 
968 #define RIG_SETTING_MAX 64
969 
983 #define RIG_TRN_OFF 0
984 #define RIG_TRN_RIG 1
985 #define RIG_TRN_POLL 2
986 
987 
996 /*
997  * The C standard dictates that an enum constant is a 32 bit signed integer.
998  * Setting a constant's bit 31 created a negative value that on amd64 had the
999  * upper 32 bits set as well when assigned to the misc.c:rig_func_str structure.
1000  * This caused misc.c:rig_strfunc() to fail its comparison for RIG_FUNC_XIT
1001  * on amd64 (x86_64). To use bit 31 as an unsigned long, preprocessor macros
1002  * have been used instead as a 'const unsigned long' which cannot be used to
1003  * initialize the rig_func_str.func members. TNX KA6MAL, AC6SL. - N0NB
1004  */
1005 #define RIG_FUNC_NONE 0
1006 #define RIG_FUNC_FAGC CONSTANT_64BIT_FLAG (0)
1007 #define RIG_FUNC_NB CONSTANT_64BIT_FLAG (1)
1008 #define RIG_FUNC_COMP CONSTANT_64BIT_FLAG (2)
1009 #define RIG_FUNC_VOX CONSTANT_64BIT_FLAG (3)
1010 #define RIG_FUNC_TONE CONSTANT_64BIT_FLAG (4)
1011 #define RIG_FUNC_TSQL CONSTANT_64BIT_FLAG (5)
1012 #define RIG_FUNC_SBKIN CONSTANT_64BIT_FLAG (6)
1013 #define RIG_FUNC_FBKIN CONSTANT_64BIT_FLAG (7)
1014 #define RIG_FUNC_ANF CONSTANT_64BIT_FLAG (8)
1015 #define RIG_FUNC_NR CONSTANT_64BIT_FLAG (9)
1016 #define RIG_FUNC_AIP CONSTANT_64BIT_FLAG (10)
1017 #define RIG_FUNC_APF CONSTANT_64BIT_FLAG (11)
1018 #define RIG_FUNC_MON CONSTANT_64BIT_FLAG (12)
1019 #define RIG_FUNC_MN CONSTANT_64BIT_FLAG (13)
1020 #define RIG_FUNC_RF CONSTANT_64BIT_FLAG (14)
1021 #define RIG_FUNC_ARO CONSTANT_64BIT_FLAG (15)
1022 #define RIG_FUNC_LOCK CONSTANT_64BIT_FLAG (16)
1023 #define RIG_FUNC_MUTE CONSTANT_64BIT_FLAG (17)
1024 #define RIG_FUNC_VSC CONSTANT_64BIT_FLAG (18)
1025 #define RIG_FUNC_REV CONSTANT_64BIT_FLAG (19)
1026 #define RIG_FUNC_SQL CONSTANT_64BIT_FLAG (20)
1027 #define RIG_FUNC_ABM CONSTANT_64BIT_FLAG (21)
1028 #define RIG_FUNC_BC CONSTANT_64BIT_FLAG (22)
1029 #define RIG_FUNC_MBC CONSTANT_64BIT_FLAG (23)
1030 #define RIG_FUNC_RIT CONSTANT_64BIT_FLAG (24)
1031 #define RIG_FUNC_AFC CONSTANT_64BIT_FLAG (25)
1032 #define RIG_FUNC_SATMODE CONSTANT_64BIT_FLAG (26)
1033 #define RIG_FUNC_SCOPE CONSTANT_64BIT_FLAG (27)
1034 #define RIG_FUNC_RESUME CONSTANT_64BIT_FLAG (28)
1035 #define RIG_FUNC_TBURST CONSTANT_64BIT_FLAG (29)
1036 #define RIG_FUNC_TUNER CONSTANT_64BIT_FLAG (30)
1037 #define RIG_FUNC_XIT CONSTANT_64BIT_FLAG (31)
1038 #ifndef SWIGLUAHIDE
1039 /* Hide the top 32 bits from the old Lua binding as they can't be represented */
1040 #define RIG_FUNC_NB2 CONSTANT_64BIT_FLAG (32)
1041 #define RIG_FUNC_CSQL CONSTANT_64BIT_FLAG (33)
1042 #define RIG_FUNC_AFLT CONSTANT_64BIT_FLAG (34)
1043 #define RIG_FUNC_ANL CONSTANT_64BIT_FLAG (35)
1044 #define RIG_FUNC_BC2 CONSTANT_64BIT_FLAG (36)
1045 #define RIG_FUNC_DUAL_WATCH CONSTANT_64BIT_FLAG (37)
1046 #define RIG_FUNC_DIVERSITY CONSTANT_64BIT_FLAG (38)
1047 #define RIG_FUNC_DSQL CONSTANT_64BIT_FLAG (39)
1048 #define RIG_FUNC_SCEN CONSTANT_64BIT_FLAG (40)
1049 #define RIG_FUNC_BIT41 CONSTANT_64BIT_FLAG (41)
1050 #define RIG_FUNC_BIT42 CONSTANT_64BIT_FLAG (42)
1051 #define RIG_FUNC_BIT43 CONSTANT_64BIT_FLAG (43)
1052 #define RIG_FUNC_BIT44 CONSTANT_64BIT_FLAG (44)
1053 #define RIG_FUNC_BIT45 CONSTANT_64BIT_FLAG (45)
1054 #define RIG_FUNC_BIT46 CONSTANT_64BIT_FLAG (46)
1055 #define RIG_FUNC_BIT47 CONSTANT_64BIT_FLAG (47)
1056 #define RIG_FUNC_BIT48 CONSTANT_64BIT_FLAG (48)
1057 #define RIG_FUNC_BIT49 CONSTANT_64BIT_FLAG (49)
1058 #define RIG_FUNC_BIT50 CONSTANT_64BIT_FLAG (50)
1059 #define RIG_FUNC_BIT51 CONSTANT_64BIT_FLAG (51)
1060 #define RIG_FUNC_BIT52 CONSTANT_64BIT_FLAG (52)
1061 #define RIG_FUNC_BIT53 CONSTANT_64BIT_FLAG (53)
1062 #define RIG_FUNC_BIT54 CONSTANT_64BIT_FLAG (54)
1063 #define RIG_FUNC_BIT55 CONSTANT_64BIT_FLAG (55)
1064 #define RIG_FUNC_BIT56 CONSTANT_64BIT_FLAG (56)
1065 #define RIG_FUNC_BIT57 CONSTANT_64BIT_FLAG (57)
1066 #define RIG_FUNC_BIT58 CONSTANT_64BIT_FLAG (58)
1067 #define RIG_FUNC_BIT59 CONSTANT_64BIT_FLAG (59)
1068 #define RIG_FUNC_BIT60 CONSTANT_64BIT_FLAG (60)
1069 #define RIG_FUNC_BIT61 CONSTANT_64BIT_FLAG (61)
1070 #define RIG_FUNC_BIT62 CONSTANT_64BIT_FLAG (62)
1071 #define RIG_FUNC_BIT63 CONSTANT_64BIT_FLAG (63)
1072 /* 63 is this highest bit number that can be used */
1073 #endif
1074 
1081 #define mW(p) ((int)(p))
1089 #define Watts(p) ((int)((p)*1000))
1096 #define W(p) Watts(p)
1097 #if 0 // deprecating kW macro as this doesn't make sense
1104 #define kW(p) ((int)((p)*1000000L))
1105 #endif
1106 
1107 
1117 typedef uint64_t rmode_t;
1118 
1119 #define RIG_MODE_NONE 0
1120 #define RIG_MODE_AM CONSTANT_64BIT_FLAG (0)
1121 #define RIG_MODE_CW CONSTANT_64BIT_FLAG (1)
1122 #define RIG_MODE_USB CONSTANT_64BIT_FLAG (2)
1123 #define RIG_MODE_LSB CONSTANT_64BIT_FLAG (3)
1124 #define RIG_MODE_RTTY CONSTANT_64BIT_FLAG (4)
1125 #define RIG_MODE_FM CONSTANT_64BIT_FLAG (5)
1126 #define RIG_MODE_WFM CONSTANT_64BIT_FLAG (6)
1127 #define RIG_MODE_CWR CONSTANT_64BIT_FLAG (7)
1128 #define RIG_MODE_RTTYR CONSTANT_64BIT_FLAG (8)
1129 #define RIG_MODE_AMS CONSTANT_64BIT_FLAG (9)
1130 #define RIG_MODE_PKTLSB CONSTANT_64BIT_FLAG (10)
1131 #define RIG_MODE_PKTUSB CONSTANT_64BIT_FLAG (11)
1132 #define RIG_MODE_PKTFM CONSTANT_64BIT_FLAG (12)
1133 #define RIG_MODE_ECSSUSB CONSTANT_64BIT_FLAG (13)
1134 #define RIG_MODE_ECSSLSB CONSTANT_64BIT_FLAG (14)
1135 #define RIG_MODE_FAX CONSTANT_64BIT_FLAG (15)
1136 #define RIG_MODE_SAM CONSTANT_64BIT_FLAG (16)
1137 #define RIG_MODE_SAL CONSTANT_64BIT_FLAG (17)
1138 #define RIG_MODE_SAH CONSTANT_64BIT_FLAG (18)
1139 #define RIG_MODE_DSB CONSTANT_64BIT_FLAG (19)
1140 #define RIG_MODE_FMN CONSTANT_64BIT_FLAG (21)
1141 #define RIG_MODE_PKTAM CONSTANT_64BIT_FLAG (22)
1142 #define RIG_MODE_P25 CONSTANT_64BIT_FLAG (23)
1143 #define RIG_MODE_DSTAR CONSTANT_64BIT_FLAG (24)
1144 #define RIG_MODE_DPMR CONSTANT_64BIT_FLAG (25)
1145 #define RIG_MODE_NXDNVN CONSTANT_64BIT_FLAG (26)
1146 #define RIG_MODE_NXDN_N CONSTANT_64BIT_FLAG (27)
1147 #define RIG_MODE_DCR CONSTANT_64BIT_FLAG (28)
1148 #define RIG_MODE_AMN CONSTANT_64BIT_FLAG (29)
1149 #define RIG_MODE_PSK CONSTANT_64BIT_FLAG (30)
1150 #define RIG_MODE_PSKR CONSTANT_64BIT_FLAG (31)
1151 #ifndef SWIGLUAHIDE
1152 /* hide the top 32 bits from the Lua binding as they will not work */
1153 #define RIG_MODE_DD CONSTANT_64BIT_FLAG (32)
1154 #define RIG_MODE_C4FM CONSTANT_64BIT_FLAG (33)
1155 #define RIG_MODE_PKTFMN CONSTANT_64BIT_FLAG (34)
1156 #define RIG_MODE_BIT35 CONSTANT_64BIT_FLAG (35)
1157 #define RIG_MODE_BIT36 CONSTANT_64BIT_FLAG (36)
1158 #define RIG_MODE_BIT37 CONSTANT_64BIT_FLAG (37)
1159 #define RIG_MODE_BIT38 CONSTANT_64BIT_FLAG (38)
1160 #define RIG_MODE_BIT39 CONSTANT_64BIT_FLAG (39)
1161 #define RIG_MODE_BIT40 CONSTANT_64BIT_FLAG (40)
1162 #define RIG_MODE_BIT41 CONSTANT_64BIT_FLAG (41)
1163 #define RIG_MODE_BIT42 CONSTANT_64BIT_FLAG (42)
1164 #define RIG_MODE_BIT43 CONSTANT_64BIT_FLAG (43)
1165 #define RIG_MODE_BIT44 CONSTANT_64BIT_FLAG (44)
1166 #define RIG_MODE_BIT45 CONSTANT_64BIT_FLAG (45)
1167 #define RIG_MODE_BIT46 CONSTANT_64BIT_FLAG (46)
1168 #define RIG_MODE_BIT47 CONSTANT_64BIT_FLAG (47)
1169 #define RIG_MODE_BIT48 CONSTANT_64BIT_FLAG (48)
1170 #define RIG_MODE_BIT49 CONSTANT_64BIT_FLAG (49)
1171 #define RIG_MODE_BIT50 CONSTANT_64BIT_FLAG (50)
1172 #define RIG_MODE_BIT51 CONSTANT_64BIT_FLAG (51)
1173 #define RIG_MODE_BIT52 CONSTANT_64BIT_FLAG (52)
1174 #define RIG_MODE_BIT53 CONSTANT_64BIT_FLAG (53)
1175 #define RIG_MODE_BIT54 CONSTANT_64BIT_FLAG (54)
1176 #define RIG_MODE_BIT55 CONSTANT_64BIT_FLAG (55)
1177 #define RIG_MODE_BIT56 CONSTANT_64BIT_FLAG (56)
1178 #define RIG_MODE_BIT57 CONSTANT_64BIT_FLAG (57)
1179 #define RIG_MODE_BIT58 CONSTANT_64BIT_FLAG (58)
1180 #define RIG_MODE_BIT59 CONSTANT_64BIT_FLAG (59)
1181 #define RIG_MODE_BIT60 CONSTANT_64BIT_FLAG (60)
1182 #define RIG_MODE_BIT61 CONSTANT_64BIT_FLAG (61)
1183 #define RIG_MODE_BIT62 CONSTANT_64BIT_FLAG (62)
1184 #define RIG_MODE_TESTS_MAX CONSTANT_64BIT_FLAG (63)
1185 #endif
1186 
1190 #define RIG_MODE_SSB (RIG_MODE_USB|RIG_MODE_LSB)
1191 
1195 #define RIG_MODE_ECSS (RIG_MODE_ECSSUSB|RIG_MODE_ECSSLSB)
1196 
1198 #define RIG_DBLST_END 0 /* end marker in a preamp/att level list */
1199 #define RIG_IS_DBLST_END(d) ((d)==0)
1201 
1202 
1209 typedef struct freq_range_list {
1217  char *label;
1219 
1221 #define RIG_FRNG_END {Hz(0),Hz(0),RIG_MODE_NONE,0,0,RIG_VFO_NONE}
1222 #define RIG_IS_FRNG_END(r) ((r).startf == Hz(0) && (r).endf == Hz(0))
1224 
1244 };
1245 
1247 #define RIG_TS_ANY 0
1248 #define RIG_TS_END {RIG_MODE_NONE, 0}
1249 #define RIG_IS_TS_END(t) ((t).modes == RIG_MODE_NONE && (t).ts == 0)
1251 
1252 
1276 struct filter_list {
1279 };
1281 #define RIG_FLT_ANY 0
1282 #define RIG_FLT_END {RIG_MODE_NONE, 0}
1283 #define RIG_IS_FLT_END(f) ((f).modes == RIG_MODE_NONE)
1285 
1286 
1290 #define RIG_CHFLAG_NONE 0
1294 #define RIG_CHFLAG_SKIP (1<<0)
1298 #define RIG_CHFLAG_DATA (1<<1)
1302 #define RIG_CHFLAG_PSKIP (1<<2)
1303 
1308 struct ext_list {
1311 };
1312 
1314 #define RIG_EXT_END {0, {.i=0}}
1315 #define RIG_IS_EXT_END(x) ((x).token == 0)
1317 
1325 struct channel {
1327  int bank_num;
1353  unsigned int flags;
1354  char channel_desc[MAXCHANDESC];
1355  struct ext_list
1357 };
1358 
1362 typedef struct channel channel_t;
1363 
1369 struct channel_cap {
1370  unsigned bank_num: 1;
1371  unsigned vfo: 1;
1372  unsigned ant: 1;
1373  unsigned freq: 1;
1374  unsigned mode: 1;
1375  unsigned width: 1;
1377  unsigned tx_freq: 1;
1378  unsigned tx_mode: 1;
1379  unsigned tx_width: 1;
1381  unsigned split: 1;
1382  unsigned tx_vfo: 1;
1383  unsigned rptr_shift: 1;
1384  unsigned rptr_offs: 1;
1385  unsigned tuning_step: 1;
1386  unsigned rit: 1;
1387  unsigned xit: 1;
1390  unsigned ctcss_tone: 1;
1391  unsigned ctcss_sql: 1;
1392  unsigned dcs_code: 1;
1393  unsigned dcs_sql: 1;
1394  unsigned scan_group: 1;
1395  unsigned flags: 1;
1396  unsigned channel_desc: 1;
1397  unsigned ext_levels: 1;
1398 };
1399 
1403 typedef struct channel_cap channel_cap_t;
1404 
1405 
1416 typedef enum {
1426 
1427 
1441 struct chan_list {
1442  int startc;
1443  int endc;
1447 };
1448 
1450 #define RIG_CHAN_END {0,0,RIG_MTYPE_NONE}
1451 #define RIG_IS_CHAN_END(c) ((c).type == RIG_MTYPE_NONE)
1453 
1457 #define RIG_MEM_CAPS_ALL -1
1458 
1462 typedef struct chan_list chan_t;
1463 
1464 
1476 struct gran {
1480 };
1481 
1485 typedef struct gran gran_t;
1486 
1487 
1491 struct cal_table {
1492  int size;
1493  struct {
1494  int raw;
1495  int val;
1496  } table[MAX_CAL_LENGTH];
1497 };
1498 
1511 typedef struct cal_table cal_table_t;
1512 
1514 #define EMPTY_STR_CAL { 0, { { 0, 0 }, } }
1516 
1517 
1522  int size;
1523  struct {
1524  int raw;
1525  float val;
1526  } table[MAX_CAL_LENGTH];
1527 };
1528 
1541 typedef struct cal_table_float cal_table_float_t;
1542 
1544 #define EMPTY_FLOAT_CAL { 0, { { 0, 0f }, } }
1545 
1546 typedef int (* chan_cb_t)(RIG *, channel_t **, int, const chan_t *, rig_ptr_t);
1547 typedef int (* confval_cb_t)(RIG *,
1548  const struct confparams *,
1549  value_t *,
1550  rig_ptr_t);
1552 
1553 
1574 #define RIG_MODEL(arg) .rig_model=arg,.macro_name=#arg
1575 struct rig_caps {
1576  rig_model_t rig_model;
1577  const char *model_name;
1578  const char *mfg_name;
1579  const char *version;
1580  const char *copyright;
1581  enum rig_status_e status;
1583  int rig_type;
1584  ptt_type_t ptt_type;
1585  dcd_type_t dcd_type;
1586  rig_port_t port_type;
1588  int serial_rate_min;
1589  int serial_rate_max;
1590  int serial_data_bits;
1591  int serial_stop_bits;
1592  enum serial_parity_e serial_parity;
1593  enum serial_handshake_e serial_handshake;
1595  int write_delay;
1596  int post_write_delay;
1597  int timeout;
1598  int retry;
1600  setting_t has_get_func;
1601  setting_t has_set_func;
1602  setting_t has_get_level;
1603  setting_t has_set_level;
1604  setting_t has_get_parm;
1605  setting_t has_set_parm;
1607  gran_t level_gran[RIG_SETTING_MAX];
1608  gran_t parm_gran[RIG_SETTING_MAX];
1610  const struct confparams *extparms;
1611  const struct confparams *extlevels;
1612  const struct confparams *extfuncs;
1613  int *ext_tokens;
1615  const tone_t *ctcss_list;
1616  const tone_t *dcs_list;
1618  int preamp[MAXDBLSTSIZ];
1619  int attenuator[MAXDBLSTSIZ];
1620  shortfreq_t max_rit;
1621  shortfreq_t max_xit;
1622  shortfreq_t max_ifshift;
1624  ann_t announces;
1626  vfo_op_t vfo_ops;
1627  scan_t scan_ops;
1628  int targetable_vfo;
1629  int transceive;
1631  int bank_qty;
1632  int chan_desc_sz;
1634  chan_t chan_list[CHANLSTSIZ];
1636  // As of 2020-02-12 we know of 5 models from Icom USA, EUR, ITR, TPE, KOR for the IC-9700
1637  // So we currently have 5 ranges we need to deal with
1638  // The backend for the model should fill in the label field to explain what model it is
1639  // The the IC-9700 in ic7300.c for an example
1640  freq_range_t rx_range_list1[FRQRANGESIZ];
1641  freq_range_t tx_range_list1[FRQRANGESIZ];
1642  freq_range_t rx_range_list2[FRQRANGESIZ];
1643  freq_range_t tx_range_list2[FRQRANGESIZ];
1644  freq_range_t rx_range_list3[FRQRANGESIZ];
1645  freq_range_t tx_range_list3[FRQRANGESIZ];
1646  freq_range_t rx_range_list4[FRQRANGESIZ];
1647  freq_range_t tx_range_list4[FRQRANGESIZ];
1648  freq_range_t rx_range_list5[FRQRANGESIZ];
1649  freq_range_t tx_range_list5[FRQRANGESIZ];
1651  struct tuning_step_list tuning_steps[TSLSTSIZ];
1652  struct filter_list filters[FLTLSTSIZ];
1654  cal_table_t str_cal;
1655  cal_table_float_t swr_cal;
1656  cal_table_float_t alc_cal;
1657  cal_table_float_t rfpower_meter_cal;
1658  cal_table_float_t comp_meter_cal;
1659  cal_table_float_t vd_meter_cal;
1660  cal_table_float_t id_meter_cal;
1662  const struct confparams *cfgparams;
1663  const rig_ptr_t priv;
1665  /*
1666  * Rig API
1667  *
1668  */
1669 
1670  int (*rig_init)(RIG *rig);
1671  int (*rig_cleanup)(RIG *rig);
1672  int (*rig_open)(RIG *rig);
1673  int (*rig_close)(RIG *rig);
1674 
1675  /*
1676  * General API commands, from most primitive to least.. :()
1677  * List Set/Get functions pairs
1678  */
1679 
1680  int (*set_freq)(RIG *rig, vfo_t vfo, freq_t freq);
1681  int (*get_freq)(RIG *rig, vfo_t vfo, freq_t *freq);
1682 
1683  int (*set_mode)(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width);
1684  int (*get_mode)(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width);
1685 
1686  int (*set_vfo)(RIG *rig, vfo_t vfo);
1687  int (*get_vfo)(RIG *rig, vfo_t *vfo);
1688 
1689  int (*set_ptt)(RIG *rig, vfo_t vfo, ptt_t ptt);
1690  int (*get_ptt)(RIG *rig, vfo_t vfo, ptt_t *ptt);
1691 
1692  int (*get_dcd)(RIG *rig, vfo_t vfo, dcd_t *dcd);
1693 
1694  int (*set_rptr_shift)(RIG *rig, vfo_t vfo, rptr_shift_t rptr_shift);
1695  int (*get_rptr_shift)(RIG *rig, vfo_t vfo, rptr_shift_t *rptr_shift);
1696 
1697  int (*set_rptr_offs)(RIG *rig, vfo_t vfo, shortfreq_t offs);
1698  int (*get_rptr_offs)(RIG *rig, vfo_t vfo, shortfreq_t *offs);
1699 
1700  int (*set_split_freq)(RIG *rig, vfo_t vfo, freq_t tx_freq);
1701  int (*get_split_freq)(RIG *rig, vfo_t vfo, freq_t *tx_freq);
1702 
1703  int (*set_split_mode)(RIG *rig,
1704  vfo_t vfo,
1705  rmode_t tx_mode,
1706  pbwidth_t tx_width);
1707  int (*get_split_mode)(RIG *rig,
1708  vfo_t vfo,
1709  rmode_t *tx_mode,
1710  pbwidth_t *tx_width);
1711 
1712  int (*set_split_freq_mode)(RIG *rig,
1713  vfo_t vfo,
1714  freq_t tx_freq,
1715  rmode_t tx_mode,
1716  pbwidth_t tx_width);
1717  int (*get_split_freq_mode)(RIG *rig,
1718  vfo_t vfo,
1719  freq_t *tx_freq,
1720  rmode_t *tx_mode,
1721  pbwidth_t *tx_width);
1722 
1723  int (*set_split_vfo)(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo);
1724  int (*get_split_vfo)(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo);
1725 
1726  int (*set_rit)(RIG *rig, vfo_t vfo, shortfreq_t rit);
1727  int (*get_rit)(RIG *rig, vfo_t vfo, shortfreq_t *rit);
1728 
1729  int (*set_xit)(RIG *rig, vfo_t vfo, shortfreq_t xit);
1730  int (*get_xit)(RIG *rig, vfo_t vfo, shortfreq_t *xit);
1731 
1732  int (*set_ts)(RIG *rig, vfo_t vfo, shortfreq_t ts);
1733  int (*get_ts)(RIG *rig, vfo_t vfo, shortfreq_t *ts);
1734 
1735  int (*set_dcs_code)(RIG *rig, vfo_t vfo, tone_t code);
1736  int (*get_dcs_code)(RIG *rig, vfo_t vfo, tone_t *code);
1737 
1738  int (*set_tone)(RIG *rig, vfo_t vfo, tone_t tone);
1739  int (*get_tone)(RIG *rig, vfo_t vfo, tone_t *tone);
1740 
1741  int (*set_ctcss_tone)(RIG *rig, vfo_t vfo, tone_t tone);
1742  int (*get_ctcss_tone)(RIG *rig, vfo_t vfo, tone_t *tone);
1743 
1744  int (*set_dcs_sql)(RIG *rig, vfo_t vfo, tone_t code);
1745  int (*get_dcs_sql)(RIG *rig, vfo_t vfo, tone_t *code);
1746 
1747  int (*set_tone_sql)(RIG *rig, vfo_t vfo, tone_t tone);
1748  int (*get_tone_sql)(RIG *rig, vfo_t vfo, tone_t *tone);
1749 
1750  int (*set_ctcss_sql)(RIG *rig, vfo_t vfo, tone_t tone);
1751  int (*get_ctcss_sql)(RIG *rig, vfo_t vfo, tone_t *tone);
1752 
1753  int (*power2mW)(RIG *rig,
1754  unsigned int *mwpower,
1755  float power,
1756  freq_t freq,
1757  rmode_t mode);
1758  int (*mW2power)(RIG *rig,
1759  float *power,
1760  unsigned int mwpower,
1761  freq_t freq,
1762  rmode_t mode);
1763 
1764  int (*set_powerstat)(RIG *rig, powerstat_t status);
1765  int (*get_powerstat)(RIG *rig, powerstat_t *status);
1766 
1767  int (*reset)(RIG *rig, reset_t reset);
1768 
1769  int (*set_ant)(RIG *rig, vfo_t vfo, ant_t ant, value_t option);
1770  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);
1771 
1772  int (*set_level)(RIG *rig, vfo_t vfo, setting_t level, value_t val);
1773  int (*get_level)(RIG *rig, vfo_t vfo, setting_t level, value_t *val);
1774 
1775  int (*set_func)(RIG *rig, vfo_t vfo, setting_t func, int status);
1776  int (*get_func)(RIG *rig, vfo_t vfo, setting_t func, int *status);
1777 
1778  int (*set_parm)(RIG *rig, setting_t parm, value_t val);
1779  int (*get_parm)(RIG *rig, setting_t parm, value_t *val);
1780 
1781  int (*set_ext_level)(RIG *rig, vfo_t vfo, token_t token, value_t val);
1782  int (*get_ext_level)(RIG *rig, vfo_t vfo, token_t token, value_t *val);
1783 
1784  int (*set_ext_func)(RIG *rig, vfo_t vfo, token_t token, int status);
1785  int (*get_ext_func)(RIG *rig, vfo_t vfo, token_t token, int *status);
1786 
1787  int (*set_ext_parm)(RIG *rig, token_t token, value_t val);
1788  int (*get_ext_parm)(RIG *rig, token_t token, value_t *val);
1789 
1790  int (*set_conf)(RIG *rig, token_t token, const char *val);
1791  int (*get_conf)(RIG *rig, token_t token, char *val);
1792 
1793  int (*send_dtmf)(RIG *rig, vfo_t vfo, const char *digits);
1794  int (*recv_dtmf)(RIG *rig, vfo_t vfo, char *digits, int *length);
1795 
1796  int (*send_morse)(RIG *rig, vfo_t vfo, const char *msg);
1797  int (*stop_morse)(RIG *rig, vfo_t vfo);
1798  int (*wait_morse)(RIG *rig, vfo_t vfo);
1799 
1800  int (*send_voice_mem)(RIG *rig, vfo_t vfo, int ch);
1801 
1802  int (*set_bank)(RIG *rig, vfo_t vfo, int bank);
1803 
1804  int (*set_mem)(RIG *rig, vfo_t vfo, int ch);
1805  int (*get_mem)(RIG *rig, vfo_t vfo, int *ch);
1806 
1807  int (*vfo_op)(RIG *rig, vfo_t vfo, vfo_op_t op);
1808 
1809  int (*scan)(RIG *rig, vfo_t vfo, scan_t scan, int ch);
1810 
1811  int (*set_trn)(RIG *rig, int trn);
1812  int (*get_trn)(RIG *rig, int *trn);
1813 
1814  int (*decode_event)(RIG *rig);
1815 
1816  int (*set_channel)(RIG *rig, vfo_t vfo, const channel_t *chan);
1817  int (*get_channel)(RIG *rig, vfo_t vfo, channel_t *chan, int read_only);
1818 
1819  const char * (*get_info)(RIG *rig);
1820 
1821  int (*set_chan_all_cb)(RIG *rig, vfo_t vfo, chan_cb_t chan_cb, rig_ptr_t);
1822  int (*get_chan_all_cb)(RIG *rig, vfo_t vfo, chan_cb_t chan_cb, rig_ptr_t);
1823 
1824  int (*set_mem_all_cb)(RIG *rig,
1825  chan_cb_t chan_cb,
1826  confval_cb_t parm_cb,
1827  rig_ptr_t);
1828  int (*get_mem_all_cb)(RIG *rig,
1829  chan_cb_t chan_cb,
1830  confval_cb_t parm_cb,
1831  rig_ptr_t);
1832 
1833  int (*set_vfo_opt)(RIG *rig, int status); // only for Net Rigctl device
1834 
1835  const char *clone_combo_set;
1836  const char *clone_combo_get;
1837  const char *macro_name;
1838 };
1840 
1841 
1848 typedef struct hamlib_port {
1849  union {
1850  rig_port_t rig;
1851  ptt_type_t ptt;
1852  dcd_type_t dcd;
1853  } type;
1854 
1855  int fd;
1856  void *handle;
1858  int write_delay;
1859  int post_write_delay;
1861  struct {
1862  int tv_sec, tv_usec;
1863  } post_write_date;
1865  int timeout;
1866  int retry;
1868  char pathname[FILPATHLEN];
1870  union {
1871  struct {
1872  int rate;
1873  int data_bits;
1874  int stop_bits;
1875  enum serial_parity_e parity;
1876  enum serial_handshake_e handshake;
1877  enum serial_control_state_e rts_state;
1878  enum serial_control_state_e dtr_state;
1879  } serial;
1881  struct {
1882  int pin;
1883  } parallel;
1885  struct {
1886  int ptt_bitnum;
1887  } cm108;
1889  struct {
1890  int vid;
1891  int pid;
1892  int conf;
1893  int iface;
1894  int alt;
1895  char *vendor_name;
1896  char *product;
1897  } usb;
1899  struct {
1900  int on_value;
1901  int value;
1902  } gpio;
1903  } parm;
1904  int flushx;
1905 } hamlib_port_t;
1907 
1908 #if !defined(__APPLE__) || !defined(__cplusplus)
1909 typedef hamlib_port_t port_t;
1910 #endif
1911 
1912 #define HAMLIB_ELAPSED_GET 0
1913 #define HAMLIB_ELAPSED_SET 1
1914 #define HAMLIB_ELAPSED_INVALIDATE 2
1915 
1916 typedef enum {
1917  HAMLIB_CACHE_ALL, // to set all cache timeouts at once
1918  HAMLIB_CACHE_VFO,
1919  HAMLIB_CACHE_FREQ,
1920  HAMLIB_CACHE_MODE,
1921  HAMLIB_CACHE_PTT,
1922  HAMLIB_CACHE_SPLIT
1923 } hamlib_cache_t;
1924 
1930 struct rig_cache {
1931  int timeout_ms; // the cache timeout for invalidating itself
1932  vfo_t vfo;
1933  freq_t freq; // to be deprecated in 4.1 when full Main/Sub/A/B caching is implemented in 4.1
1934  // other abstraction here is based on dual vfo rigs and mapped to all others
1935  // So we have four possible states of rig
1936  // MainA, MainB, SubA, SubB
1937  // Main is the Main VFO and Sub is for the 2nd VFO
1938  // Most rigs have MainA and MainB
1939  // Dual VFO rigs can have SubA and SubB too
1940  // For dual VFO rigs simplex operations are all done on MainA/MainB -- ergo this abstraction
1941  freq_t freqCurr; // VFO_CURR
1942  freq_t freqMainA; // VFO_A, VFO_MAIN, and VFO_MAINA
1943  freq_t freqMainB; // VFO_B, VFO_SUB, and VFO_MAINB
1944  freq_t freqMainC; // VFO_C (future MainC?)
1945  freq_t freqSubA; // VFO_SUBA -- only for rigs with dual Sub VFOs
1946  freq_t freqSubB; // VFO_SUBB -- only for rigs with dual Sub VFOs
1947  rmode_t mode;
1948  pbwidth_t width;
1949  ptt_t ptt;
1950  split_t split;
1951  vfo_t split_vfo; // split caches two values
1952  struct timespec time_freq;
1953  struct timespec time_freqCurr;
1954  struct timespec time_freqMainA;
1955  struct timespec time_freqMainB;
1956  struct timespec time_freqMainC;
1957  struct timespec time_freqSubA;
1958  struct timespec time_freqSubB;
1959  struct timespec time_vfo;
1960  struct timespec time_mode;
1961  struct timespec time_ptt;
1962  struct timespec time_split;
1963  vfo_t vfo_freq; // last vfo cached
1964  vfo_t vfo_mode; // last vfo cached
1965  int satmode; // if rig is in satellite mode
1966 };
1967 
1968 
1978 struct rig_state {
1979  /*
1980  * overridable fields
1981  */
1982  hamlib_port_t rigport;
1983  hamlib_port_t pttport;
1984  hamlib_port_t dcdport;
1986  double vfo_comp;
1992  struct tuning_step_list tuning_steps[TSLSTSIZ];
1994  struct filter_list filters[FLTLSTSIZ];
1998  chan_t chan_list[CHANLSTSIZ];
2006  int preamp[MAXDBLSTSIZ];
2007  int attenuator[MAXDBLSTSIZ];
2020  /*
2021  * non overridable fields, internal use
2022  */
2023 
2026  int vfo_list;
2028  rig_ptr_t priv;
2029  rig_ptr_t obj;
2038  int transmit;
2042  time_t twiddle_time;
2044  // uplink allows gpredict to behave better by no reading the uplink VFO
2045  int uplink;
2046  struct rig_cache cache;
2047  int vfo_opt;
2057 };
2058 
2060 typedef int (*vprintf_cb_t)(enum rig_debug_level_e,
2061  rig_ptr_t,
2062  const char *,
2063  va_list);
2064 
2065 typedef int (*freq_cb_t)(RIG *, vfo_t, freq_t, rig_ptr_t);
2066 typedef int (*mode_cb_t)(RIG *, vfo_t, rmode_t, pbwidth_t, rig_ptr_t);
2067 typedef int (*vfo_cb_t)(RIG *, vfo_t, rig_ptr_t);
2068 typedef int (*ptt_cb_t)(RIG *, vfo_t, ptt_t, rig_ptr_t);
2069 typedef int (*dcd_cb_t)(RIG *, vfo_t, dcd_t, rig_ptr_t);
2070 typedef int (*pltune_cb_t)(RIG *,
2071  vfo_t, freq_t *,
2072  rmode_t *,
2073  pbwidth_t *,
2074  rig_ptr_t);
2075 
2077 
2096  freq_cb_t freq_event;
2097  rig_ptr_t freq_arg;
2098  mode_cb_t mode_event;
2099  rig_ptr_t mode_arg;
2100  vfo_cb_t vfo_event;
2101  rig_ptr_t vfo_arg;
2102  ptt_cb_t ptt_event;
2103  rig_ptr_t ptt_arg;
2104  dcd_cb_t dcd_event;
2105  rig_ptr_t dcd_arg;
2106  pltune_cb_t pltune;
2107  rig_ptr_t pltune_arg;
2108  /* etc.. */
2109 };
2110 
2111 
2121 struct s_rig {
2122  struct rig_caps *caps;
2123  struct rig_state state;
2124  struct rig_callbacks callbacks;
2125 };
2126 
2127 
2128 
2129 /* --------------- API function prototypes -----------------*/
2130 
2132 
2133 extern HAMLIB_EXPORT(RIG *) rig_init HAMLIB_PARAMS((rig_model_t rig_model));
2134 extern HAMLIB_EXPORT(int) rig_open HAMLIB_PARAMS((RIG *rig));
2135 
2136 /*
2137  * General API commands, from most primitive to least.. :()
2138  * List Set/Get functions pairs
2139  */
2140 
2141 extern HAMLIB_EXPORT(int)
2142 rig_flush(hamlib_port_t *port);
2143 
2144 extern HAMLIB_EXPORT(int)
2145 rig_set_freq HAMLIB_PARAMS((RIG *rig,
2146  vfo_t vfo,
2147  freq_t freq));
2148 extern HAMLIB_EXPORT(int)
2149 rig_get_freq HAMLIB_PARAMS((RIG *rig,
2150  vfo_t vfo,
2151  freq_t *freq));
2152 
2153 extern HAMLIB_EXPORT(int)
2154 rig_set_mode HAMLIB_PARAMS((RIG *rig,
2155  vfo_t vfo,
2156  rmode_t mode,
2157  pbwidth_t width));
2158 extern HAMLIB_EXPORT(int)
2159 rig_get_mode HAMLIB_PARAMS((RIG *rig,
2160  vfo_t vfo,
2161  rmode_t *mode,
2162  pbwidth_t *width));
2163 
2164 extern HAMLIB_EXPORT(int)
2165 rig_set_vfo HAMLIB_PARAMS((RIG *rig,
2166  vfo_t vfo));
2167 extern HAMLIB_EXPORT(int)
2168 rig_get_vfo HAMLIB_PARAMS((RIG *rig,
2169  vfo_t *vfo));
2170 
2171 extern HAMLIB_EXPORT(int)
2172 netrigctl_get_vfo_mode HAMLIB_PARAMS((RIG *rig));
2173 
2174 extern HAMLIB_EXPORT(int)
2175 rig_set_ptt HAMLIB_PARAMS((RIG *rig,
2176  vfo_t vfo,
2177  ptt_t ptt));
2178 extern HAMLIB_EXPORT(int)
2179 rig_get_ptt HAMLIB_PARAMS((RIG *rig,
2180  vfo_t vfo,
2181  ptt_t *ptt));
2182 
2183 extern HAMLIB_EXPORT(int)
2184 rig_get_dcd HAMLIB_PARAMS((RIG *rig,
2185  vfo_t vfo,
2186  dcd_t *dcd));
2187 
2188 extern HAMLIB_EXPORT(int)
2189 rig_set_rptr_shift HAMLIB_PARAMS((RIG *rig,
2190  vfo_t vfo,
2191  rptr_shift_t rptr_shift));
2192 extern HAMLIB_EXPORT(int)
2193 rig_get_rptr_shift HAMLIB_PARAMS((RIG *rig,
2194  vfo_t vfo,
2195  rptr_shift_t *rptr_shift));
2196 
2197 extern HAMLIB_EXPORT(int)
2198 rig_set_rptr_offs HAMLIB_PARAMS((RIG *rig,
2199  vfo_t vfo,
2200  shortfreq_t rptr_offs));
2201 extern HAMLIB_EXPORT(int)
2202 rig_get_rptr_offs HAMLIB_PARAMS((RIG *rig,
2203  vfo_t vfo,
2204  shortfreq_t *rptr_offs));
2205 
2206 extern HAMLIB_EXPORT(int)
2207 rig_set_ctcss_tone HAMLIB_PARAMS((RIG *rig,
2208  vfo_t vfo,
2209  tone_t tone));
2210 extern HAMLIB_EXPORT(int)
2211 rig_get_ctcss_tone HAMLIB_PARAMS((RIG *rig,
2212  vfo_t vfo,
2213  tone_t *tone));
2214 
2215 extern HAMLIB_EXPORT(int)
2216 rig_set_dcs_code HAMLIB_PARAMS((RIG *rig,
2217  vfo_t vfo,
2218  tone_t code));
2219 extern HAMLIB_EXPORT(int)
2220 rig_get_dcs_code HAMLIB_PARAMS((RIG *rig,
2221  vfo_t vfo,
2222  tone_t *code));
2223 
2224 extern HAMLIB_EXPORT(int)
2225 rig_set_ctcss_sql HAMLIB_PARAMS((RIG *rig,
2226  vfo_t vfo,
2227  tone_t tone));
2228 extern HAMLIB_EXPORT(int)
2229 rig_get_ctcss_sql HAMLIB_PARAMS((RIG *rig,
2230  vfo_t vfo,
2231  tone_t *tone));
2232 
2233 extern HAMLIB_EXPORT(int)
2234 rig_set_dcs_sql HAMLIB_PARAMS((RIG *rig,
2235  vfo_t vfo,
2236  tone_t code));
2237 extern HAMLIB_EXPORT(int)
2238 rig_get_dcs_sql HAMLIB_PARAMS((RIG *rig,
2239  vfo_t vfo,
2240  tone_t *code));
2241 
2242 extern HAMLIB_EXPORT(int)
2243 rig_set_split_freq HAMLIB_PARAMS((RIG *rig,
2244  vfo_t vfo,
2245  freq_t tx_freq));
2246 extern HAMLIB_EXPORT(int)
2247 rig_get_split_freq HAMLIB_PARAMS((RIG *rig,
2248  vfo_t vfo,
2249  freq_t *tx_freq));
2250 
2251 extern HAMLIB_EXPORT(int)
2252 rig_set_split_mode HAMLIB_PARAMS((RIG *rig,
2253  vfo_t vfo,
2254  rmode_t tx_mode,
2255  pbwidth_t tx_width));
2256 extern HAMLIB_EXPORT(int)
2257 rig_get_split_mode HAMLIB_PARAMS((RIG *rig,
2258  vfo_t vfo,
2259  rmode_t *tx_mode,
2260  pbwidth_t *tx_width));
2261 
2262 extern HAMLIB_EXPORT(int)
2263 rig_set_split_freq_mode HAMLIB_PARAMS((RIG *rig,
2264  vfo_t vfo,
2265  freq_t tx_freq,
2266  rmode_t tx_mode,
2267  pbwidth_t tx_width));
2268 extern HAMLIB_EXPORT(int)
2269 rig_get_split_freq_mode HAMLIB_PARAMS((RIG *rig,
2270  vfo_t vfo,
2271  freq_t *tx_freq,
2272  rmode_t *tx_mode,
2273  pbwidth_t *tx_width));
2274 
2275 extern HAMLIB_EXPORT(int)
2276 rig_set_split_vfo HAMLIB_PARAMS((RIG *,
2277  vfo_t rx_vfo,
2278  split_t split,
2279  vfo_t tx_vfo));
2280 extern HAMLIB_EXPORT(int)
2281 rig_get_split_vfo HAMLIB_PARAMS((RIG *,
2282  vfo_t rx_vfo,
2283  split_t *split,
2284  vfo_t *tx_vfo));
2285 
2286 #define rig_set_split(r,v,s) rig_set_split_vfo((r),(v),(s),RIG_VFO_CURR)
2287 #define rig_get_split(r,v,s) ({ vfo_t _tx_vfo; rig_get_split_vfo((r),(v),(s),&_tx_vfo); })
2288 
2289 extern HAMLIB_EXPORT(int)
2290 rig_set_rit HAMLIB_PARAMS((RIG *rig,
2291  vfo_t vfo,
2292  shortfreq_t rit));
2293 extern HAMLIB_EXPORT(int)
2294 rig_get_rit HAMLIB_PARAMS((RIG *rig,
2295  vfo_t vfo,
2296  shortfreq_t *rit));
2297 
2298 extern HAMLIB_EXPORT(int)
2299 rig_set_xit HAMLIB_PARAMS((RIG *rig,
2300  vfo_t vfo,
2301  shortfreq_t xit));
2302 extern HAMLIB_EXPORT(int)
2303 rig_get_xit HAMLIB_PARAMS((RIG *rig,
2304  vfo_t vfo,
2305  shortfreq_t *xit));
2306 
2307 extern HAMLIB_EXPORT(int)
2308 rig_set_ts HAMLIB_PARAMS((RIG *rig,
2309  vfo_t vfo,
2310  shortfreq_t ts));
2311 extern HAMLIB_EXPORT(int)
2312 rig_get_ts HAMLIB_PARAMS((RIG *rig,
2313  vfo_t vfo,
2314  shortfreq_t *ts));
2315 
2316 extern HAMLIB_EXPORT(int)
2317 rig_power2mW HAMLIB_PARAMS((RIG *rig,
2318  unsigned int *mwpower,
2319  float power,
2320  freq_t freq,
2321  rmode_t mode));
2322 extern HAMLIB_EXPORT(int)
2323 rig_mW2power HAMLIB_PARAMS((RIG *rig,
2324  float *power,
2325  unsigned int mwpower,
2326  freq_t freq,
2327  rmode_t mode));
2328 
2329 extern HAMLIB_EXPORT(shortfreq_t)
2330 rig_get_resolution HAMLIB_PARAMS((RIG *rig,
2331  rmode_t mode));
2332 
2333 extern HAMLIB_EXPORT(int)
2334 rig_set_level HAMLIB_PARAMS((RIG *rig,
2335  vfo_t vfo,
2336  setting_t level,
2337  value_t val));
2338 extern HAMLIB_EXPORT(int)
2339 rig_get_level HAMLIB_PARAMS((RIG *rig,
2340  vfo_t vfo,
2341  setting_t level,
2342  value_t *val));
2343 
2344 #define rig_get_strength(r,v,s) rig_get_level((r),(v),RIG_LEVEL_STRENGTH, (value_t*)(s))
2345 
2346 extern HAMLIB_EXPORT(int)
2347 rig_set_parm HAMLIB_PARAMS((RIG *rig,
2348  setting_t parm,
2349  value_t val));
2350 extern HAMLIB_EXPORT(int)
2351 rig_get_parm HAMLIB_PARAMS((RIG *rig,
2352  setting_t parm,
2353  value_t *val));
2354 
2355 extern HAMLIB_EXPORT(int)
2356 rig_set_conf HAMLIB_PARAMS((RIG *rig,
2357  token_t token,
2358  const char *val));
2359 extern HAMLIB_EXPORT(int)
2360 rig_get_conf HAMLIB_PARAMS((RIG *rig,
2361  token_t token,
2362  char *val));
2363 
2364 extern HAMLIB_EXPORT(int)
2365 rig_set_powerstat HAMLIB_PARAMS((RIG *rig,
2366  powerstat_t status));
2367 extern HAMLIB_EXPORT(int)
2368 rig_get_powerstat HAMLIB_PARAMS((RIG *rig,
2369  powerstat_t *status));
2370 
2371 extern HAMLIB_EXPORT(int)
2372 rig_reset HAMLIB_PARAMS((RIG *rig,
2373  reset_t reset)); /* dangerous! */
2374 
2375 extern HAMLIB_EXPORT(int)
2376 rig_set_ext_level HAMLIB_PARAMS((RIG *rig,
2377  vfo_t vfo,
2378  token_t token,
2379  value_t val));
2380 extern HAMLIB_EXPORT(int)
2381 rig_get_ext_level HAMLIB_PARAMS((RIG *rig,
2382  vfo_t vfo,
2383  token_t token,
2384  value_t *val));
2385 
2386 extern HAMLIB_EXPORT(int)
2387 rig_set_ext_func HAMLIB_PARAMS((RIG *rig,
2388  vfo_t vfo,
2389  token_t token,
2390  int status));
2391 extern HAMLIB_EXPORT(int)
2392 rig_get_ext_func HAMLIB_PARAMS((RIG *rig,
2393  vfo_t vfo,
2394  token_t token,
2395  int *status));
2396 
2397 extern HAMLIB_EXPORT(int)
2398 rig_set_ext_parm HAMLIB_PARAMS((RIG *rig,
2399  token_t token,
2400  value_t val));
2401 extern HAMLIB_EXPORT(int)
2402 rig_get_ext_parm HAMLIB_PARAMS((RIG *rig,
2403  token_t token,
2404  value_t *val));
2405 
2406 extern HAMLIB_EXPORT(int)
2407 rig_ext_func_foreach HAMLIB_PARAMS((RIG *rig,
2408  int (*cfunc)(RIG *,
2409  const struct confparams *,
2410  rig_ptr_t),
2411  rig_ptr_t data));
2412 extern HAMLIB_EXPORT(int)
2413 rig_ext_level_foreach HAMLIB_PARAMS((RIG *rig,
2414  int (*cfunc)(RIG *,
2415  const struct confparams *,
2416  rig_ptr_t),
2417  rig_ptr_t data));
2418 extern HAMLIB_EXPORT(int)
2419 rig_ext_parm_foreach HAMLIB_PARAMS((RIG *rig,
2420  int (*cfunc)(RIG *,
2421  const struct confparams *,
2422  rig_ptr_t),
2423  rig_ptr_t data));
2424 
2425 extern HAMLIB_EXPORT(const struct confparams *)
2426 rig_ext_lookup HAMLIB_PARAMS((RIG *rig,
2427  const char *name));
2428 
2429 extern HAMLIB_EXPORT(const struct confparams *)
2430 rig_ext_lookup_tok HAMLIB_PARAMS((RIG *rig,
2431  token_t token));
2432 extern HAMLIB_EXPORT(token_t)
2433 rig_ext_token_lookup HAMLIB_PARAMS((RIG *rig,
2434  const char *name));
2435 
2436 
2437 extern HAMLIB_EXPORT(int)
2438 rig_token_foreach HAMLIB_PARAMS((RIG *rig,
2439  int (*cfunc)(const struct confparams *,
2440  rig_ptr_t),
2441  rig_ptr_t data));
2442 
2443 extern HAMLIB_EXPORT(const struct confparams *)
2444 rig_confparam_lookup HAMLIB_PARAMS((RIG *rig,
2445  const char *name));
2446 extern HAMLIB_EXPORT(token_t)
2447 rig_token_lookup HAMLIB_PARAMS((RIG *rig,
2448  const char *name));
2449 
2450 extern HAMLIB_EXPORT(int)
2451 rig_close HAMLIB_PARAMS((RIG *rig));
2452 
2453 extern HAMLIB_EXPORT(int)
2454 rig_cleanup HAMLIB_PARAMS((RIG *rig));
2455 
2456 extern HAMLIB_EXPORT(int)
2457 rig_set_ant HAMLIB_PARAMS((RIG *rig,
2458  vfo_t vfo,
2459  ant_t ant, /* antenna */
2460  value_t option)); /* optional ant info */
2461 extern HAMLIB_EXPORT(int)
2462 rig_get_ant HAMLIB_PARAMS((RIG *rig,
2463  vfo_t vfo,
2464  ant_t ant,
2465  value_t *option,
2466  ant_t *ant_curr,
2467  ant_t *ant_tx,
2468  ant_t *ant_rx));
2469 
2470 extern HAMLIB_EXPORT(setting_t)
2471 rig_has_get_level HAMLIB_PARAMS((RIG *rig,
2472  setting_t level));
2473 extern HAMLIB_EXPORT(setting_t)
2474 rig_has_set_level HAMLIB_PARAMS((RIG *rig,
2475  setting_t level));
2476 
2477 extern HAMLIB_EXPORT(setting_t)
2478 rig_has_get_parm HAMLIB_PARAMS((RIG *rig,
2479  setting_t parm));
2480 extern HAMLIB_EXPORT(setting_t)
2481 rig_has_set_parm HAMLIB_PARAMS((RIG *rig,
2482  setting_t parm));
2483 
2484 extern HAMLIB_EXPORT(setting_t)
2485 rig_has_get_func HAMLIB_PARAMS((RIG *rig,
2486  setting_t func));
2487 extern HAMLIB_EXPORT(setting_t)
2488 rig_has_set_func HAMLIB_PARAMS((RIG *rig,
2489  setting_t func));
2490 
2491 extern HAMLIB_EXPORT(int)
2492 rig_set_func HAMLIB_PARAMS((RIG *rig,
2493  vfo_t vfo,
2494  setting_t func,
2495  int status));
2496 extern HAMLIB_EXPORT(int)
2497 rig_get_func HAMLIB_PARAMS((RIG *rig,
2498  vfo_t vfo,
2499  setting_t func,
2500  int *status));
2501 
2502 extern HAMLIB_EXPORT(int)
2503 rig_send_dtmf HAMLIB_PARAMS((RIG *rig,
2504  vfo_t vfo,
2505  const char *digits));
2506 extern HAMLIB_EXPORT(int)
2507 rig_recv_dtmf HAMLIB_PARAMS((RIG *rig,
2508  vfo_t vfo,
2509  char *digits,
2510  int *length));
2511 
2512 extern HAMLIB_EXPORT(int)
2513 rig_send_morse HAMLIB_PARAMS((RIG *rig,
2514  vfo_t vfo,
2515  const char *msg));
2516 
2517 extern HAMLIB_EXPORT(int)
2518 rig_stop_morse HAMLIB_PARAMS((RIG *rig,
2519  vfo_t vfo));
2520 
2521 extern HAMLIB_EXPORT(int)
2522 rig_wait_morse HAMLIB_PARAMS((RIG *rig,
2523  vfo_t vfo));
2524 
2525 extern HAMLIB_EXPORT(int)
2526 rig_send_voice_mem HAMLIB_PARAMS((RIG *rig,
2527  vfo_t vfo,
2528  int ch));
2529 
2530 extern HAMLIB_EXPORT(int)
2531 rig_set_bank HAMLIB_PARAMS((RIG *rig,
2532  vfo_t vfo,
2533  int bank));
2534 
2535 extern HAMLIB_EXPORT(int)
2536 rig_set_mem HAMLIB_PARAMS((RIG *rig,
2537  vfo_t vfo,
2538  int ch));
2539 extern HAMLIB_EXPORT(int)
2540 rig_get_mem HAMLIB_PARAMS((RIG *rig,
2541  vfo_t vfo,
2542  int *ch));
2543 
2544 extern HAMLIB_EXPORT(int)
2545 rig_vfo_op HAMLIB_PARAMS((RIG *rig,
2546  vfo_t vfo,
2547  vfo_op_t op));
2548 
2549 extern HAMLIB_EXPORT(vfo_op_t)
2550 rig_has_vfo_op HAMLIB_PARAMS((RIG *rig,
2551  vfo_op_t op));
2552 
2553 extern HAMLIB_EXPORT(int)
2554 rig_scan HAMLIB_PARAMS((RIG *rig,
2555  vfo_t vfo,
2556  scan_t scan,
2557  int ch));
2558 
2559 extern HAMLIB_EXPORT(scan_t)
2560 rig_has_scan HAMLIB_PARAMS((RIG *rig,
2561  scan_t scan));
2562 
2563 extern HAMLIB_EXPORT(int)
2564 rig_set_channel HAMLIB_PARAMS((RIG *rig,
2565  vfo_t vfo,
2566  const channel_t *chan)); /* mem */
2567 extern HAMLIB_EXPORT(int)
2568 rig_get_channel HAMLIB_PARAMS((RIG *rig,
2569  vfo_t vfo,
2570  channel_t *chan, int read_only));
2571 
2572 extern HAMLIB_EXPORT(int)
2573 rig_set_chan_all HAMLIB_PARAMS((RIG *rig,
2574  vfo_t vfo,
2575  const channel_t chans[]));
2576 extern HAMLIB_EXPORT(int)
2577 rig_get_chan_all HAMLIB_PARAMS((RIG *rig,
2578  vfo_t vfo,
2579  channel_t chans[]));
2580 
2581 extern HAMLIB_EXPORT(int)
2582 rig_set_chan_all_cb HAMLIB_PARAMS((RIG *rig,
2583  vfo_t vfo,
2584  chan_cb_t chan_cb,
2585  rig_ptr_t));
2586 extern HAMLIB_EXPORT(int)
2587 rig_get_chan_all_cb HAMLIB_PARAMS((RIG *rig,
2588  vfo_t vfo,
2589  chan_cb_t chan_cb,
2590  rig_ptr_t));
2591 
2592 extern HAMLIB_EXPORT(int)
2593 rig_set_mem_all_cb HAMLIB_PARAMS((RIG *rig,
2594  vfo_t vfo,
2595  chan_cb_t chan_cb,
2596  confval_cb_t parm_cb,
2597  rig_ptr_t));
2598 extern HAMLIB_EXPORT(int)
2599 rig_get_mem_all_cb HAMLIB_PARAMS((RIG *rig,
2600  vfo_t vfo,
2601  chan_cb_t chan_cb,
2602  confval_cb_t parm_cb,
2603  rig_ptr_t));
2604 
2605 extern HAMLIB_EXPORT(int)
2606 rig_set_mem_all HAMLIB_PARAMS((RIG *rig,
2607  vfo_t vfo,
2608  const channel_t *chan,
2609  const struct confparams *,
2610  const value_t *));
2611 extern HAMLIB_EXPORT(int)
2612 rig_get_mem_all HAMLIB_PARAMS((RIG *rig,
2613  vfo_t vfo,
2614  channel_t *chan,
2615  const struct confparams *,
2616  value_t *));
2617 
2618 extern HAMLIB_EXPORT(const chan_t *)
2619 rig_lookup_mem_caps HAMLIB_PARAMS((RIG *rig,
2620  int ch));
2621 
2622 extern HAMLIB_EXPORT(int)
2623 rig_mem_count HAMLIB_PARAMS((RIG *rig));
2624 
2625 extern HAMLIB_EXPORT(int)
2626 rig_set_trn HAMLIB_PARAMS((RIG *rig,
2627  int trn));
2628 extern HAMLIB_EXPORT(int)
2629 rig_get_trn HAMLIB_PARAMS((RIG *rig,
2630  int *trn));
2631 
2632 extern HAMLIB_EXPORT(int)
2633 rig_set_freq_callback HAMLIB_PARAMS((RIG *,
2634  freq_cb_t,
2635  rig_ptr_t));
2636 
2637 extern HAMLIB_EXPORT(int)
2638 rig_set_mode_callback HAMLIB_PARAMS((RIG *,
2639  mode_cb_t,
2640  rig_ptr_t));
2641 extern HAMLIB_EXPORT(int)
2642 rig_set_vfo_callback HAMLIB_PARAMS((RIG *,
2643  vfo_cb_t,
2644  rig_ptr_t));
2645 
2646 extern HAMLIB_EXPORT(int)
2647 rig_set_ptt_callback HAMLIB_PARAMS((RIG *,
2648  ptt_cb_t,
2649  rig_ptr_t));
2650 
2651 extern HAMLIB_EXPORT(int)
2652 rig_set_dcd_callback HAMLIB_PARAMS((RIG *,
2653  dcd_cb_t,
2654  rig_ptr_t));
2655 
2656 extern HAMLIB_EXPORT(int)
2657 rig_set_pltune_callback HAMLIB_PARAMS((RIG *,
2658  pltune_cb_t,
2659  rig_ptr_t));
2660 
2661 extern HAMLIB_EXPORT(int)
2662 rig_set_twiddle HAMLIB_PARAMS((RIG *rig,
2663  int seconds));
2664 
2665 extern HAMLIB_EXPORT(int)
2666 rig_get_twiddle HAMLIB_PARAMS((RIG *rig,
2667  int *seconds));
2668 
2669 extern HAMLIB_EXPORT(int)
2670 rig_set_uplink HAMLIB_PARAMS((RIG *rig,
2671  int val));
2672 
2673 
2674 extern HAMLIB_EXPORT(const char *)
2675 rig_get_info HAMLIB_PARAMS((RIG *rig));
2676 
2677 extern HAMLIB_EXPORT(const struct rig_caps *)
2678 rig_get_caps HAMLIB_PARAMS((rig_model_t rig_model));
2679 
2680 extern HAMLIB_EXPORT(const freq_range_t *)
2681 rig_get_range HAMLIB_PARAMS((const freq_range_t *range_list,
2682  freq_t freq,
2683  rmode_t mode));
2684 
2685 extern HAMLIB_EXPORT(pbwidth_t)
2686 rig_passband_normal HAMLIB_PARAMS((RIG *rig,
2687  rmode_t mode));
2688 extern HAMLIB_EXPORT(pbwidth_t)
2689 rig_passband_narrow HAMLIB_PARAMS((RIG *rig,
2690  rmode_t mode));
2691 extern HAMLIB_EXPORT(pbwidth_t)
2692 rig_passband_wide HAMLIB_PARAMS((RIG *rig,
2693  rmode_t mode));
2694 
2695 extern HAMLIB_EXPORT(const char *)
2696 rigerror HAMLIB_PARAMS((int errnum));
2697 
2698 extern HAMLIB_EXPORT(int)
2699 rig_setting2idx HAMLIB_PARAMS((setting_t s));
2700 
2701 extern HAMLIB_EXPORT(setting_t)
2702 rig_idx2setting(int i);
2703 /*
2704  * Even if these functions are prefixed with "rig_", they are not rig specific
2705  * Maybe "hamlib_" would have been better. Let me know. --SF
2706  */
2707 extern HAMLIB_EXPORT(void)
2708 rig_set_debug HAMLIB_PARAMS((enum rig_debug_level_e debug_level));
2709 
2710 extern HAMLIB_EXPORT(void)
2711 rig_set_debug_time_stamp HAMLIB_PARAMS((int flag));
2712 
2713 #define rig_set_debug_level(level) rig_set_debug(level)
2714 
2715 extern HAMLIB_EXPORT(int)
2716 rig_need_debug HAMLIB_PARAMS((enum rig_debug_level_e debug_level));
2717 
2718 
2719 
2720 #ifndef __cplusplus
2721 #ifdef __GNUC__
2722 // doing the debug macro with a dummy sprintf allows gcc to check the format string
2723 #define rig_debug(debug_level,fmt,...) { char xxxbuf[16384]="";snprintf(xxxbuf,sizeof(xxxbuf),fmt,__VA_ARGS__);rig_debug(debug_level,fmt,##__VA_ARGS__); }
2724 #endif
2725 #endif
2726 extern HAMLIB_EXPORT(void)
2727 rig_debug HAMLIB_PARAMS((enum rig_debug_level_e debug_level,
2728  const char *fmt, ...));
2729 
2730 extern HAMLIB_EXPORT(vprintf_cb_t)
2731 rig_set_debug_callback HAMLIB_PARAMS((vprintf_cb_t cb,
2732  rig_ptr_t arg));
2733 
2734 extern HAMLIB_EXPORT(FILE *)
2735 rig_set_debug_file HAMLIB_PARAMS((FILE *stream));
2736 
2737 extern HAMLIB_EXPORT(int)
2738 rig_register HAMLIB_PARAMS((const struct rig_caps *caps));
2739 
2740 extern HAMLIB_EXPORT(int)
2741 rig_unregister HAMLIB_PARAMS((rig_model_t rig_model));
2742 
2743 extern HAMLIB_EXPORT(int)
2744 rig_list_foreach HAMLIB_PARAMS((int (*cfunc)(const struct rig_caps *, rig_ptr_t),
2745  rig_ptr_t data));
2746 
2747 extern HAMLIB_EXPORT(int)
2748 rig_load_backend HAMLIB_PARAMS((const char *be_name));
2749 
2750 extern HAMLIB_EXPORT(int)
2751 rig_check_backend HAMLIB_PARAMS((rig_model_t rig_model));
2752 
2753 extern HAMLIB_EXPORT(int)
2754 rig_load_all_backends HAMLIB_PARAMS((void));
2755 
2756 typedef int (*rig_probe_func_t)(const hamlib_port_t *, rig_model_t, rig_ptr_t);
2757 
2758 extern HAMLIB_EXPORT(int)
2759 rig_probe_all HAMLIB_PARAMS((hamlib_port_t *p,
2760  rig_probe_func_t,
2761  rig_ptr_t));
2762 
2763 extern HAMLIB_EXPORT(rig_model_t)
2764 rig_probe HAMLIB_PARAMS((hamlib_port_t *p));
2765 
2766 
2767 /* Misc calls */
2768 extern HAMLIB_EXPORT(const char *) rig_strrmode(rmode_t mode);
2769 extern HAMLIB_EXPORT(int) rig_strrmodes(rmode_t modes, char *buf, int buflen);
2770 extern HAMLIB_EXPORT(const char *) rig_strvfo(vfo_t vfo);
2771 extern HAMLIB_EXPORT(const char *) rig_strfunc(setting_t);
2772 extern HAMLIB_EXPORT(const char *) rig_strlevel(setting_t);
2773 extern HAMLIB_EXPORT(const char *) rig_strparm(setting_t);
2774 extern HAMLIB_EXPORT(const char *) rig_strptrshift(rptr_shift_t);
2775 extern HAMLIB_EXPORT(const char *) rig_strvfop(vfo_op_t op);
2776 extern HAMLIB_EXPORT(const char *) rig_strscan(scan_t scan);
2777 extern HAMLIB_EXPORT(const char *) rig_strstatus(enum rig_status_e status);
2778 extern HAMLIB_EXPORT(const char *) rig_strmtype(chan_type_t mtype);
2779 
2780 extern HAMLIB_EXPORT(rmode_t) rig_parse_mode(const char *s);
2781 extern HAMLIB_EXPORT(vfo_t) rig_parse_vfo(const char *s);
2782 extern HAMLIB_EXPORT(setting_t) rig_parse_func(const char *s);
2783 extern HAMLIB_EXPORT(setting_t) rig_parse_level(const char *s);
2784 extern HAMLIB_EXPORT(setting_t) rig_parse_parm(const char *s);
2785 extern HAMLIB_EXPORT(vfo_op_t) rig_parse_vfo_op(const char *s);
2786 extern HAMLIB_EXPORT(scan_t) rig_parse_scan(const char *s);
2787 extern HAMLIB_EXPORT(rptr_shift_t) rig_parse_rptr_shift(const char *s);
2788 extern HAMLIB_EXPORT(chan_type_t) rig_parse_mtype(const char *s);
2789 
2790 extern HAMLIB_EXPORT(const char *) rig_license HAMLIB_PARAMS(());
2791 extern HAMLIB_EXPORT(const char *) rig_version HAMLIB_PARAMS(());
2792 extern HAMLIB_EXPORT(const char *) rig_copyright HAMLIB_PARAMS(());
2793 
2794 extern HAMLIB_EXPORT(void) rig_no_restore_ai();
2795 
2796 extern HAMLIB_EXPORT(int) rig_get_cache_timeout_ms(RIG *rig, hamlib_cache_t selection);
2797 extern HAMLIB_EXPORT(int) rig_set_cache_timeout_ms(RIG *rig, hamlib_cache_t selection, int ms);
2798 
2799 extern HAMLIB_EXPORT(int) rig_set_vfo_opt(RIG *rig, int status);
2800 
2801 
2802 typedef unsigned long rig_useconds_t;
2803 extern HAMLIB_EXPORT(int) hl_usleep(rig_useconds_t msec);
2804 
2806 
2807 __END_DECLS
2808 
2809 #endif /* _RIG_H */
2810 
setting_t rig_parse_parm(const char *s)
Convert alpha string to RIG_PARM_...
Definition: misc.c:1037
vfo_t rig_parse_vfo(const char *s)
Convert alpha string to enum RIG_VFO_...
Definition: misc.c:526
const char * rig_strparm(setting_t parm)
Convert enum RIG_PARM_... to alpha string.
Definition: misc.c:1087
const char * rig_strptrshift(rptr_shift_t shift)
convert enum RIG_RPT_SHIFT_... to printable character
Definition: misc.c:1294
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:462
rptr_shift_t rig_parse_rptr_shift(const char *s)
Convert alpha char to enum RIG_RPT_SHIFT_...
Definition: misc.c:1319
uint64_t rig_idx2setting(int i)
Definition: misc.c:636
const char * rig_strstatus(enum rig_status_e status)
Convert enum RIG_STATUS_... to printable string.
Definition: misc.c:331
void rig_set_debug_time_stamp(int flag)
Enbable/disable time stamp on debug output.
Definition: debug.c:142
chan_type_t rig_parse_mtype(const char *s)
Convert alpha string to enum RIG_MTYPE_...
Definition: misc.c:1362
const char * rig_strmtype(chan_type_t mtype)
Convert enum RIG_MTYPE_... to alpha string.
Definition: misc.c:1387
FILE * rig_set_debug_file(FILE *stream)
change stderr to some different output
Definition: debug.c:295
const char * rig_strrmode(rmode_t mode)
Convert enum RIG_MODE to alpha string.
Definition: misc.c:430
vprintf_cb_t rig_set_debug_callback(vprintf_cb_t cb, rig_ptr_t arg)
set callback to handle debug messages
Definition: debug.c:280
int rig_need_debug(enum rig_debug_level_e debug_level)
Useful for dump_hex, etc.
Definition: debug.c:133
const char * rig_strscan(scan_t rscan)
Convert enum RIG_SCAN_... to alpha string.
Definition: misc.c:1265
setting_t rig_parse_level(const char *s)
Convert alpha string to enum RIG_LEVEL_...
Definition: misc.c:838
scan_t rig_parse_scan(const char *s)
Convert alpha string to enum RIG_SCAN_...
Definition: misc.c:1240
setting_t rig_parse_func(const char *s)
Convert alpha string to enum RIG_FUNC_...
Definition: misc.c:648
const char * rig_strvfo(vfo_t vfo)
Convert enum RIG_VFO_... to alpha string.
Definition: misc.c:551
rmode_t rig_parse_mode(const char *s)
Convert alpha string to enum RIG_MODE.
Definition: misc.c:405
const char * rig_strvfop(vfo_op_t op)
Convert enum RIG_OP_... to alpha string.
Definition: misc.c:1195
void rig_set_debug(enum rig_debug_level_e debug_level)
Change the current debug level.
Definition: debug.c:123
const char * rig_strlevel(setting_t level)
Convert enum RIG_LEVEL_... to alpha string.
Definition: misc.c:919
void rig_debug(enum rig_debug_level_e debug_level, const char *fmt,...)
Default is debugging messages are done through stderr.
Definition: debug.c:171
const char * rig_strfunc(setting_t func)
Convert enum RIG_FUNC_... to alpha string.
Definition: misc.c:698
vfo_op_t rig_parse_vfo_op(const char *s)
Convert alpha string to enum RIG_OP_...
Definition: misc.c:1170
int rig_set_vfo(RIG *rig, vfo_t vfo)
set the current VFO
Definition: rig.c:2076
unsigned int vfo_t
VFO definition.
Definition: rig.h:393
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:3593
rig_level_e
Rig Level Settings.
Definition: rig.h:847
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:612
int rig_send_dtmf(RIG *rig, vfo_t vfo, const char *digits)
send DTMF digits
Definition: rig.c:4928
int rig_set_twiddle(RIG *rig, int seconds)
timeout (secs) to stop rigctld when VFO is manually changed
Definition: rig.c:1169
meter_level_e
Level display meters.
Definition: rig.h:807
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:2689
serial_parity_e
Serial parity.
Definition: rig.h:226
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:3735
int rig_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
get the mode of the target VFO
Definition: rig.c:1815
int rig_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan)
set channel data
Definition: mem.c:688
dcd_e
DCD status.
Definition: rig.h:515
int rig_set_freq_callback(RIG *rig, freq_cb_t cb, rig_ptr_t arg)
set the callback for freq events
Definition: event.c:526
const char * hamlib_copyright2
Hamlib copyright notice.
Definition: rig.c:94
int rig_get_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t *rptr_offs)
get the current repeater offset
Definition: rig.c:2998
int rig_set_powerstat(RIG *rig, powerstat_t status)
turn on/off the radio
Definition: rig.c:4565
int rig_get_powerstat(RIG *rig, powerstat_t *status)
get the on/off status of the radio
Definition: rig.c:4598
int rig_set_dcs_sql(RIG *rig, vfo_t vfo, tone_t code)
set the current DCS code
Definition: tones.c:491
serial_control_state_e
Serial control state.
Definition: rig.h:248
int rig_set_mem(RIG *rig, vfo_t vfo, int ch)
set the current memory channel number
Definition: mem.c:72
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:4410
setting_t rig_has_set_func(RIG *rig, setting_t func)
check ability of radio functions
Definition: settings.c:444
int rig_get_vfo(RIG *rig, vfo_t *vfo)
get the current VFO
Definition: rig.c:2175
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:3534
uint64_t rmode_t
Radio mode.
Definition: rig.h:1117
int rig_set_vfo_callback(RIG *rig, vfo_cb_t cb, rig_ptr_t arg)
set the callback for vfo events
Definition: event.c:586
shortfreq_t pbwidth_t
Definition: rig.h:509
int rig_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
set a radio level setting
Definition: settings.c:71
int rig_get_rit(RIG *rig, vfo_t vfo, shortfreq_t *rit)
get the current RIT offset
Definition: rig.c:3916
int rig_cleanup(RIG *rig)
release a rig handle and free associated memory
Definition: rig.c:1125
rig_type_t
Rig type flags.
Definition: rig.h:258
int rig_get_mem(RIG *rig, vfo_t vfo, int *ch)
get the current memory channel number
Definition: mem.c:135
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:322
rptr_shift_t
Repeater shift type.
Definition: rig.h:312
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:553
scan_t rig_has_scan(RIG *rig, scan_t scan)
check availability of scanning functions
Definition: rig.c:4830
ptt_type_t
PTT type.
Definition: rig.h:555
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:1063
int rig_set_ctcss_sql(RIG *rig, vfo_t vfo, tone_t tone)
set CTCSS squelch
Definition: tones.c:362
ann_t
Announce.
Definition: rig.h:713
int rig_set_dcs_code(RIG *rig, vfo_t vfo, tone_t code)
set the current encoding DCS code
Definition: tones.c:230
int rig_set_dcd_callback(RIG *rig, dcd_cb_t cb, rig_ptr_t arg)
set the callback for dcd events
Definition: event.c:646
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:678
int rig_get_channel(RIG *rig, vfo_t vfox, channel_t *chan, int read_only)
get channel data
Definition: mem.c:832
int rig_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
get the frequency of the target VFO
Definition: rig.c:1532
int rig_set_func(RIG *rig, vfo_t vfo, setting_t func, int status)
activate/de-activate functions of radio
Definition: settings.c:475
int rig_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt)
get the status of the PTT
Definition: rig.c:2452
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:1129
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:4466
int rig_set_bank(RIG *rig, vfo_t vfo, int bank)
set the current memory bank
Definition: mem.c:198
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:86
int rig_get_ctcss_sql(RIG *rig, vfo_t vfo, tone_t *tone)
get the current CTCSS squelch
Definition: tones.c:429
int rig_get_xit(RIG *rig, vfo_t vfo, shortfreq_t *xit)
get the current XIT offset
Definition: rig.c:4052
int rig_get_parm(RIG *rig, setting_t parm, value_t *val)
get the value of a parameter
Definition: settings.c:262
int rig_get_trn(RIG *rig, int *trn)
get the current transceive mode
Definition: event.c:855
int rig_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t rptr_offs)
set the repeater offset
Definition: rig.c:2930
int rig_get_ctcss_tone(RIG *rig, vfo_t vfo, tone_t *tone)
get the current CTCSS sub-tone frequency
Definition: tones.c:167
int rig_set_ext_func(RIG *rig, vfo_t vfo, token_t token, int status)
set a radio function extra parameter
Definition: settings.c:743
const struct confparams * rig_confparam_lookup(RIG *rig, const char *name)
lookup a confparam struct
Definition: conf.c:1007
setting_t rig_has_set_level(RIG *rig, setting_t level)
check settable ability of level settings
Definition: settings.c:326
rig_parm_e
Rig Parameters.
Definition: rig.h:936
int rig_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option)
set the antenna
Definition: rig.c:4261
const char * rigerror(int errnum)
get string describing the error code
Definition: rig.c:290
int rig_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo)
set the split mode
Definition: rig.c:3642
shortfreq_t rig_get_resolution(RIG *rig, rmode_t mode)
get the best frequency resolution of the rig
Definition: rig.c:4524
pbwidth_t rig_passband_wide(RIG *rig, rmode_t mode)
get the wide passband of a mode
Definition: rig.c:2023
int hl_usleep(rig_useconds_t usec)
provide sleep and usleep replacements
Definition: sleep.c:53
uint64_t setting_t
Setting.
Definition: rig.h:962
powerstat_t
Radio power state.
Definition: rig.h:571
setting_t rig_has_get_func(RIG *rig, setting_t func)
check ability of radio functions
Definition: settings.c:414
int rig_set_uplink(RIG *rig, int val)
For GPredict to avoid reading frequency on uplink VFO.
Definition: rig.c:1194
enum dcd_e dcd_t
DCD status.
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:548
int rig_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq)
set the split frequencies
Definition: rig.c:3066
int rig_probe_all(hamlib_port_t *port, rig_probe_func_t cfunc, rig_ptr_t data)
try to guess rigs
Definition: rig.c:4701
rig_errcode_e
Hamlib error codes Error code definition that can be returned by the Hamlib functions....
Definition: rig.h:119
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:186
rig_conf_e
parameter types
Definition: rig.h:671
scan_t
Rig Scan operation.
Definition: rig.h:633
int rig_send_voice_mem(RIG *rig, vfo_t vfo, int ch)
send voice memory content
Definition: rig.c:5283
int rig_recv_dtmf(RIG *rig, vfo_t vfo, char *digits, int *length)
receive DTMF digits
Definition: rig.c:4997
int rig_set_mode_callback(RIG *rig, mode_cb_t cb, rig_ptr_t arg)
set the callback for mode events
Definition: event.c:556
int rig_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
set the frequency of the target VFO
Definition: rig.c:1383
int rig_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt)
set PTT on/off
Definition: rig.c:2249
int rig_get_conf(RIG *rig, token_t token, char *val)
get the value of a configuration parameter
Definition: conf.c:1147
double freq_t
Frequency type,.
Definition: rig.h:333
int rig_scan(RIG *rig, vfo_t vfo, scan_t scan, int ch)
perform Memory/VFO operations
Definition: rig.c:4859
int rig_send_morse(RIG *rig, vfo_t vfo, const char *msg)
send morse code
Definition: rig.c:5065
int rig_setting2idx(setting_t s)
basically convert setting_t expressed 2^n to n
Definition: settings.c:933
int rig_get_ext_parm(RIG *rig, token_t token, value_t *val)
get the value of a parm extra parameter
Definition: settings.c:906
int rig_mem_count(RIG *rig)
get memory channel count
Definition: mem.c:1654
ptt_t
PTT status.
Definition: rig.h:542
RIG * rig_init(rig_model_t rig_model)
allocate a new RIG handle
Definition: rig.c:316
setting_t rig_has_get_parm(RIG *rig, setting_t parm)
check retrieval ability of parameter settings
Definition: settings.c:356
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:136
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:678
struct freq_range_list freq_range_t
Frequency range.
int rig_set_ctcss_tone(RIG *rig, vfo_t vfo, tone_t tone)
set CTCSS sub-tone frequency
Definition: tones.c:100
int rig_set_ext_parm(RIG *rig, token_t token, value_t val)
set a radio parm extra parameter
Definition: settings.c:874
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:1725
vfo_op_t
VFO operation.
Definition: rig.h:607
int rig_get_ts(RIG *rig, vfo_t vfo, shortfreq_t *ts)
get the current Tuning Step
Definition: rig.c:4188
signed long shortfreq_t
Short frequency type.
Definition: rig.h:355
token_t rig_ext_token_lookup(RIG *rig, const char *name)
Simple lookup returning token id associated with name.
Definition: ext.c:327
const char * rig_version()
get the Hamlib version
Definition: rig.c:5440
int rig_set_conf(RIG *rig, token_t token, const char *val)
set a radio configuration parameter
Definition: conf.c:1094
rig_port_e
Port type.
Definition: rig.h:205
int rig_wait_morse(RIG *rig, vfo_t vfo)
wait morse code
Definition: rig.c:5226
int rig_close(RIG *rig)
close the communication to the rig
Definition: rig.c:970
pbwidth_t rig_passband_narrow(RIG *rig, rmode_t mode)
get the narrow passband of a mode
Definition: rig.c:1971
serial_handshake_e
Serial handshake.
Definition: rig.h:238
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:809
const chan_t * rig_lookup_mem_caps(RIG *rig, int ch)
lookup the memory type and capabilities
Definition: mem.c:1588
agc_level_e
AGC delay settings.
Definition: rig.h:790
dcd_type_t
DCD type.
Definition: rig.h:526
unsigned int tone_t
CTCSS and DCS type definition.
Definition: rig.h:199
int rig_get_chan_all(RIG *rig, vfo_t vfo, channel_t chans[])
get all channel data
Definition: mem.c:1212
int rig_set_chan_all(RIG *rig, vfo_t vfo, const channel_t chans[])
set all channel data
Definition: mem.c:1170
int rig_set_vfo_opt(RIG *rig, int status)
set the vfo option for rigctld
Definition: rig.c:5385
int rig_set_ptt_callback(RIG *rig, ptt_cb_t cb, rig_ptr_t arg)
set the callback for ptt events
Definition: event.c:616
pbwidth_t rig_passband_normal(RIG *rig, rmode_t mode)
get the normal passband of a mode
Definition: rig.c:1926
rig_debug_level_e
Hamlib debug levels.
Definition: rig.h:153
#define RIG_SETTING_MAX
Maximum # of rig settings.
Definition: rig.h:968
const struct confparams * rig_ext_lookup_tok(RIG *rig, token_t token)
lookup ext token, return pointer to confparams struct.
Definition: ext.c:283
setting_t rig_has_set_parm(RIG *rig, setting_t parm)
check settable ability of parameter settings
Definition: settings.c:385
const char * rig_license()
get the Hamlib license
Definition: rig.c:5430
int rig_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit)
set the RIT
Definition: rig.c:3848
const char * rig_copyright()
get the Hamlib copyright
Definition: rig.c:5450
int rig_get_twiddle(RIG *rig, int *seconds)
get the twiddle timeout value (secs)
Definition: rig.c:1220
int rig_set_ts(RIG *rig, vfo_t vfo, shortfreq_t ts)
set the Tuning Step
Definition: rig.c:4120
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:4333
int rig_open(RIG *rig)
open the communication to the rig
Definition: rig.c:553
int rig_set_parm(RIG *rig, setting_t parm, value_t val)
set a radio parameter
Definition: settings.c:228
int rig_get_dcs_code(RIG *rig, vfo_t vfo, tone_t *code)
get the current encoding DCS code
Definition: tones.c:292
hamlib_port_t port_t
Rig data structure.
Definition: rig.h:1909
int rig_stop_morse(RIG *rig, vfo_t vfo)
stop morse code
Definition: rig.c:5130
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:236
const char * rig_get_info(RIG *rig)
get general information from the radio
Definition: rig.c:5408
setting_t rig_has_get_level(RIG *rig, setting_t level)
check retrieval ability of level settings
Definition: settings.c:296
long token_t
configuration token
Definition: rig.h:649
int rig_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
get the value of a level
Definition: settings.c:141
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:1082
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:3302
int rig_reset(RIG *rig, reset_t reset)
reset the radio
Definition: rig.c:4630
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:953
int rig_set_trn(RIG *rig, int trn)
control the transceive mode
Definition: event.c:707
vfo_op_t rig_has_vfo_op(RIG *rig, vfo_op_t op)
check retrieval ability of VFO operations
Definition: rig.c:4732
unsigned int ant_t
Antenna typedef.
Definition: rig.h:770
int rig_get_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t *rptr_shift)
get the current repeater shift
Definition: rig.c:2862
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:3414
int rig_set_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t rptr_shift)
set the repeater shift
Definition: rig.c:2794
reset_t
Reset operation.
Definition: rig.h:583
int rig_get_split_freq(RIG *rig, vfo_t vfo, freq_t *tx_freq)
get the current split frequencies
Definition: rig.c:3174
int rig_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op)
perform Memory/VFO operations
Definition: rig.c:4760
rig_status_e
Development status of the backend.
Definition: rig.h:292
int rig_set_xit(RIG *rig, vfo_t vfo, shortfreq_t xit)
set the XIT
Definition: rig.c:3984
rig_model_t rig_probe(hamlib_port_t *port)
try to guess a rig
Definition: rig.c:4671
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:5350
chan_type_t
Memory channel type definition.
Definition: rig.h:1416
@ RIG_LEVEL_SLOPE_HIGH
Definition: rig.h:873
@ RIG_LEVEL_COMP_METER
Definition: rig.h:884
@ RIG_LEVEL_SQLSTAT
Definition: rig.h:878
@ RIG_LEVEL_58
Definition: rig.h:910
@ RIG_LEVEL_AGC
Definition: rig.h:866
@ RIG_LEVEL_METER
Definition: rig.h:869
@ RIG_LEVEL_NB
Definition: rig.h:890
@ RIG_LEVEL_COMP
Definition: rig.h:865
@ RIG_LEVEL_IF
Definition: rig.h:855
@ RIG_LEVEL_MONITOR_GAIN
Definition: rig.h:889
@ RIG_LEVEL_CWPITCH
Definition: rig.h:860
@ RIG_LEVEL_51
Definition: rig.h:903
@ RIG_LEVEL_VD_METER
Definition: rig.h:885
@ RIG_LEVEL_42
Definition: rig.h:894
@ RIG_LEVEL_SLOPE_LOW
Definition: rig.h:872
@ RIG_LEVEL_BKINDL
Definition: rig.h:867
@ RIG_LEVEL_ATT
Definition: rig.h:850
@ RIG_LEVEL_RFPOWER_METER
Definition: rig.h:883
@ RIG_LEVEL_43
Definition: rig.h:895
@ RIG_LEVEL_48
Definition: rig.h:900
@ RIG_LEVEL_NOTCHF
Definition: rig.h:864
@ RIG_LEVEL_41
Definition: rig.h:893
@ RIG_LEVEL_PREAMP
Definition: rig.h:849
@ RIG_LEVEL_ID_METER
Definition: rig.h:886
@ RIG_LEVEL_RF
Definition: rig.h:853
@ RIG_LEVEL_53
Definition: rig.h:905
@ RIG_LEVEL_RFPOWER
Definition: rig.h:861
@ RIG_LEVEL_ANTIVOX
Definition: rig.h:871
@ RIG_LEVEL_RFPOWER_METER_WATTS
Definition: rig.h:891
@ RIG_LEVEL_NOTCHF_RAW
Definition: rig.h:888
@ RIG_LEVEL_50
Definition: rig.h:902
@ RIG_LEVEL_RAWSTR
Definition: rig.h:877
@ RIG_LEVEL_44
Definition: rig.h:896
@ RIG_LEVEL_BKIN_DLYMS
Definition: rig.h:874
@ RIG_LEVEL_SWR
Definition: rig.h:879
@ RIG_LEVEL_APF
Definition: rig.h:856
@ RIG_LEVEL_47
Definition: rig.h:899
@ RIG_LEVEL_60
Definition: rig.h:912
@ RIG_LEVEL_STRENGTH
Definition: rig.h:881
@ RIG_LEVEL_63
Definition: rig.h:915
@ RIG_LEVEL_57
Definition: rig.h:909
@ RIG_LEVEL_BALANCE
Definition: rig.h:868
@ RIG_LEVEL_61
Definition: rig.h:913
@ RIG_LEVEL_46
Definition: rig.h:898
@ RIG_LEVEL_52
Definition: rig.h:904
@ RIG_LEVEL_PBT_OUT
Definition: rig.h:859
@ RIG_LEVEL_NR
Definition: rig.h:857
@ RIG_LEVEL_PBT_IN
Definition: rig.h:858
@ RIG_LEVEL_NONE
Definition: rig.h:848
@ RIG_LEVEL_55
Definition: rig.h:907
@ RIG_LEVEL_ALC
Definition: rig.h:880
@ RIG_LEVEL_59
Definition: rig.h:911
@ RIG_LEVEL_54
Definition: rig.h:906
@ RIG_LEVEL_56
Definition: rig.h:908
@ RIG_LEVEL_KEYSPD
Definition: rig.h:863
@ RIG_LEVEL_49
Definition: rig.h:901
@ RIG_LEVEL_40
Definition: rig.h:892
@ RIG_LEVEL_MICGAIN
Definition: rig.h:862
@ RIG_LEVEL_VOXDELAY
Definition: rig.h:851
@ RIG_LEVEL_SQL
Definition: rig.h:854
@ RIG_LEVEL_45
Definition: rig.h:897
@ RIG_LEVEL_VOXGAIN
Definition: rig.h:870
@ RIG_LEVEL_AF
Definition: rig.h:852
@ RIG_LEVEL_62
Definition: rig.h:914
@ RIG_PARITY_MARK
Definition: rig.h:230
@ RIG_PARITY_NONE
Definition: rig.h:227
@ RIG_PARITY_EVEN
Definition: rig.h:229
@ RIG_PARITY_SPACE
Definition: rig.h:231
@ RIG_PARITY_ODD
Definition: rig.h:228
@ RIG_DCD_ON
Definition: rig.h:517
@ RIG_DCD_OFF
Definition: rig.h:516
@ RIG_SIGNAL_ON
Definition: rig.h:250
@ RIG_SIGNAL_OFF
Definition: rig.h:251
@ RIG_SIGNAL_UNSET
Definition: rig.h:249
@ RIG_FLAG_COMPUTER
Definition: rig.h:264
@ RIG_FLAG_TUNER
Definition: rig.h:269
@ RIG_FLAG_SCANNER
Definition: rig.h:261
@ RIG_FLAG_TRANSMITTER
Definition: rig.h:260
@ RIG_FLAG_MOBILE
Definition: rig.h:262
@ RIG_FLAG_TRUNKING
Definition: rig.h:265
@ RIG_FLAG_APRS
Definition: rig.h:266
@ RIG_FLAG_TNC
Definition: rig.h:267
@ RIG_FLAG_HANDHELD
Definition: rig.h:263
@ RIG_FLAG_DXCLUSTER
Definition: rig.h:268
@ RIG_FLAG_RECEIVER
Definition: rig.h:259
@ RIG_SPLIT_ON
Definition: rig.h:324
@ RIG_SPLIT_OFF
Definition: rig.h:323
@ RIG_RPT_SHIFT_PLUS
Definition: rig.h:315
@ RIG_RPT_SHIFT_MINUS
Definition: rig.h:314
@ RIG_RPT_SHIFT_NONE
Definition: rig.h:313
@ RIG_PTT_RIG
Definition: rig.h:557
@ RIG_PTT_RIG_MICDATA
Definition: rig.h:561
@ RIG_PTT_SERIAL_DTR
Definition: rig.h:558
@ RIG_PTT_NONE
Definition: rig.h:556
@ RIG_PTT_PARALLEL
Definition: rig.h:560
@ RIG_PTT_GPION
Definition: rig.h:564
@ RIG_PTT_GPIO
Definition: rig.h:563
@ RIG_PTT_CM108
Definition: rig.h:562
@ RIG_PTT_SERIAL_RTS
Definition: rig.h:559
@ RIG_ANN_RXMODE
Definition: rig.h:717
@ RIG_ANN_OFF
Definition: rig.h:715
@ RIG_ANN_ENG
Definition: rig.h:719
@ RIG_ANN_FREQ
Definition: rig.h:716
@ RIG_ANN_NONE
Definition: rig.h:714
@ RIG_ANN_CW
Definition: rig.h:718
@ RIG_ANN_JAP
Definition: rig.h:720
@ RIG_PARM_BEEP
Definition: rig.h:941
@ RIG_PARM_TIME
Definition: rig.h:942
@ RIG_PARM_SCREENSAVER
Definition: rig.h:945
@ RIG_PARM_ANN
Definition: rig.h:938
@ RIG_PARM_NONE
Definition: rig.h:937
@ RIG_PARM_BACKLIGHT
Definition: rig.h:940
@ RIG_PARM_KEYLIGHT
Definition: rig.h:944
@ RIG_PARM_BAT
Definition: rig.h:943
@ RIG_PARM_APO
Definition: rig.h:939
@ RIG_POWER_OPERATE
Definition: rig.h:575
@ RIG_POWER_UNKNOWN
Definition: rig.h:576
@ RIG_POWER_STANDBY
Definition: rig.h:574
@ RIG_POWER_OFF
Definition: rig.h:572
@ RIG_POWER_ON
Definition: rig.h:573
@ RIG_ENIMPL
Definition: rig.h:124
@ RIG_ECONF
Definition: rig.h:122
@ RIG_ENAVAIL
Definition: rig.h:131
@ RIG_OK
Definition: rig.h:120
@ RIG_EPROTO
Definition: rig.h:128
@ RIG_EINTERNAL
Definition: rig.h:127
@ RIG_EDOM
Definition: rig.h:137
@ RIG_EIO
Definition: rig.h:126
@ RIG_EVFO
Definition: rig.h:136
@ RIG_ETIMEOUT
Definition: rig.h:125
@ RIG_ENOMEM
Definition: rig.h:123
@ RIG_EARG
Definition: rig.h:135
@ RIG_ERJCTED
Definition: rig.h:129
@ RIG_BUSERROR
Definition: rig.h:133
@ RIG_BUSBUSY
Definition: rig.h:134
@ RIG_ENTARGET
Definition: rig.h:132
@ RIG_EINVAL
Definition: rig.h:121
@ RIG_ETRUNC
Definition: rig.h:130
@ RIG_CONF_STRING
Definition: rig.h:672
@ RIG_CONF_BUTTON
Definition: rig.h:676
@ RIG_CONF_CHECKBUTTON
Definition: rig.h:675
@ RIG_CONF_BINARY
Definition: rig.h:677
@ RIG_CONF_COMBO
Definition: rig.h:673
@ RIG_CONF_NUMERIC
Definition: rig.h:674
@ RIG_SCAN_DELTA
Definition: rig.h:639
@ RIG_SCAN_PLT
Definition: rig.h:641
@ RIG_SCAN_PROG
Definition: rig.h:638
@ RIG_SCAN_MEM
Definition: rig.h:635
@ RIG_SCAN_NONE
Definition: rig.h:634
@ RIG_SCAN_VFO
Definition: rig.h:640
@ RIG_SCAN_PRIO
Definition: rig.h:637
@ RIG_SCAN_SLCT
Definition: rig.h:636
@ RIG_SCAN_STOP
Definition: rig.h:642
@ RIG_PTT_OFF
Definition: rig.h:543
@ RIG_PTT_ON_DATA
Definition: rig.h:546
@ RIG_PTT_ON_MIC
Definition: rig.h:545
@ RIG_PTT_ON
Definition: rig.h:544
@ RIG_OP_CPY
Definition: rig.h:609
@ RIG_OP_DOWN
Definition: rig.h:615
@ RIG_OP_TO_VFO
Definition: rig.h:612
@ RIG_OP_TUNE
Definition: rig.h:620
@ RIG_OP_FROM_VFO
Definition: rig.h:611
@ RIG_OP_MCL
Definition: rig.h:613
@ RIG_OP_RIGHT
Definition: rig.h:619
@ RIG_OP_UP
Definition: rig.h:614
@ RIG_OP_TOGGLE
Definition: rig.h:621
@ RIG_OP_NONE
Definition: rig.h:608
@ RIG_OP_BAND_UP
Definition: rig.h:616
@ RIG_OP_BAND_DOWN
Definition: rig.h:617
@ RIG_OP_LEFT
Definition: rig.h:618
@ RIG_OP_XCHG
Definition: rig.h:610
@ RIG_PORT_PACKET
Definition: rig.h:210
@ RIG_PORT_UDP_NETWORK
Definition: rig.h:216
@ RIG_PORT_NONE
Definition: rig.h:206
@ RIG_PORT_CM108
Definition: rig.h:217
@ RIG_PORT_GPIO
Definition: rig.h:218
@ RIG_PORT_ULTRA
Definition: rig.h:212
@ RIG_PORT_GPION
Definition: rig.h:219
@ RIG_PORT_SERIAL
Definition: rig.h:207
@ RIG_PORT_PARALLEL
Definition: rig.h:214
@ RIG_PORT_NETWORK
Definition: rig.h:208
@ RIG_PORT_DEVICE
Definition: rig.h:209
@ RIG_PORT_RPC
Definition: rig.h:213
@ RIG_PORT_DTMF
Definition: rig.h:211
@ RIG_PORT_USB
Definition: rig.h:215
@ RIG_HANDSHAKE_HARDWARE
Definition: rig.h:241
@ RIG_HANDSHAKE_NONE
Definition: rig.h:239
@ RIG_HANDSHAKE_XONXOFF
Definition: rig.h:240
@ RIG_AGC_USER
Definition: rig.h:795
@ RIG_DCD_SERIAL_CTS
Definition: rig.h:530
@ RIG_DCD_PARALLEL
Definition: rig.h:532
@ RIG_DCD_CM108
Definition: rig.h:533
@ RIG_DCD_RIG
Definition: rig.h:528
@ RIG_DCD_GPION
Definition: rig.h:535
@ RIG_DCD_NONE
Definition: rig.h:527
@ RIG_DCD_SERIAL_DSR
Definition: rig.h:529
@ RIG_DCD_GPIO
Definition: rig.h:534
@ RIG_DCD_SERIAL_CAR
Definition: rig.h:531
@ RIG_DEBUG_ERR
Definition: rig.h:156
@ RIG_DEBUG_BUG
Definition: rig.h:155
@ RIG_DEBUG_WARN
Definition: rig.h:157
@ RIG_DEBUG_TRACE
Definition: rig.h:159
@ RIG_DEBUG_VERBOSE
Definition: rig.h:158
@ RIG_DEBUG_NONE
Definition: rig.h:154
@ RIG_RESET_MCALL
Definition: rig.h:587
@ RIG_RESET_MASTER
Definition: rig.h:588
@ RIG_RESET_NONE
Definition: rig.h:584
@ RIG_RESET_VFO
Definition: rig.h:586
@ RIG_RESET_SOFT
Definition: rig.h:585
@ RIG_STATUS_STABLE
Definition: rig.h:296
@ RIG_STATUS_BUGGY
Definition: rig.h:297
@ RIG_STATUS_UNTESTED
Definition: rig.h:294
@ RIG_STATUS_BETA
Definition: rig.h:295
@ RIG_STATUS_ALPHA
Definition: rig.h:293
@ RIG_MTYPE_PRIO
Definition: rig.h:1424
@ RIG_MTYPE_EDGE
Definition: rig.h:1419
@ RIG_MTYPE_MEM
Definition: rig.h:1418
@ RIG_MTYPE_CALL
Definition: rig.h:1420
@ RIG_MTYPE_SAT
Definition: rig.h:1422
@ RIG_MTYPE_MEMOPAD
Definition: rig.h:1421
@ RIG_MTYPE_NONE
Definition: rig.h:1417
@ RIG_MTYPE_BAND
Definition: rig.h:1423
Calibration table struct for float values.
Definition: rig.h:1521
float val
Definition: rig.h:1525
int size
Definition: rig.h:1522
struct cal_table_float::@19 table[MAX_CAL_LENGTH]
int raw
Definition: rig.h:1524
Calibration table struct.
Definition: rig.h:1491
int val
Definition: rig.h:1495
struct cal_table::@18 table[MAX_CAL_LENGTH]
int raw
Definition: rig.h:1494
int size
Definition: rig.h:1492
Memory channel list definition.
Definition: rig.h:1441
int startc
Definition: rig.h:1442
chan_type_t type
Definition: rig.h:1444
channel_cap_t mem_caps
Definition: rig.h:1446
int endc
Definition: rig.h:1443
Channel capability definition.
Definition: rig.h:1369
unsigned tx_vfo
Definition: rig.h:1382
unsigned tx_freq
Definition: rig.h:1377
unsigned mode
Definition: rig.h:1374
unsigned dcs_code
Definition: rig.h:1392
unsigned rit
Definition: rig.h:1386
unsigned dcs_sql
Definition: rig.h:1393
unsigned rptr_offs
Definition: rig.h:1384
unsigned bank_num
Definition: rig.h:1370
setting_t levels
Definition: rig.h:1389
unsigned width
Definition: rig.h:1375
unsigned rptr_shift
Definition: rig.h:1383
unsigned tx_width
Definition: rig.h:1379
unsigned ctcss_sql
Definition: rig.h:1391
unsigned tx_mode
Definition: rig.h:1378
unsigned freq
Definition: rig.h:1373
setting_t funcs
Definition: rig.h:1388
unsigned ctcss_tone
Definition: rig.h:1390
unsigned ext_levels
Definition: rig.h:1397
unsigned vfo
Definition: rig.h:1371
unsigned ant
Definition: rig.h:1372
unsigned split
Definition: rig.h:1381
unsigned scan_group
Definition: rig.h:1394
unsigned flags
Definition: rig.h:1395
unsigned tuning_step
Definition: rig.h:1385
unsigned xit
Definition: rig.h:1387
unsigned channel_desc
Definition: rig.h:1396
Channel structure.
Definition: rig.h:1325
shortfreq_t tuning_step
Definition: rig.h:1343
rmode_t mode
Definition: rig.h:1331
tone_t ctcss_tone
Definition: rig.h:1348
pbwidth_t tx_width
Definition: rig.h:1336
vfo_t vfo
Definition: rig.h:1328
value_t levels[64]
Definition: rig.h:1347
shortfreq_t rptr_offs
Definition: rig.h:1342
vfo_t tx_vfo
Definition: rig.h:1339
tone_t dcs_code
Definition: rig.h:1350
setting_t funcs
Definition: rig.h:1346
struct ext_list * ext_levels
Definition: rig.h:1355
char channel_desc[MAXCHANDESC]
Definition: rig.h:1354
tone_t ctcss_sql
Definition: rig.h:1349
shortfreq_t xit
Definition: rig.h:1345
int bank_num
Definition: rig.h:1327
pbwidth_t width
Definition: rig.h:1332
freq_t freq
Definition: rig.h:1330
rptr_shift_t rptr_shift
Definition: rig.h:1341
shortfreq_t rit
Definition: rig.h:1344
rmode_t tx_mode
Definition: rig.h:1335
split_t split
Definition: rig.h:1338
freq_t tx_freq
Definition: rig.h:1334
ant_t ant
Definition: rig.h:1329
unsigned int flags
Definition: rig.h:1353
int scan_group
Definition: rig.h:1352
int channel_num
Definition: rig.h:1326
tone_t dcs_sql
Definition: rig.h:1351
Configuration parameter structure.
Definition: rig.h:688
const char * combostr[RIG_COMBO_MAX]
Definition: rig.h:702
struct confparams::@15::@16 n
const char * tooltip
Definition: rig.h:692
const char * dflt
Definition: rig.h:693
float min
Definition: rig.h:697
token_t token
Definition: rig.h:689
float step
Definition: rig.h:699
struct confparams::@15::@17 c
const char * label
Definition: rig.h:691
float max
Definition: rig.h:698
const char * name
Definition: rig.h:690
enum rig_conf_e type
Definition: rig.h:694
union confparams::@15 u
Extension attribute definition.
Definition: rig.h:1308
token_t token
Definition: rig.h:1309
value_t val
Definition: rig.h:1310
Filter definition.
Definition: rig.h:1276
rmode_t modes
Definition: rig.h:1277
pbwidth_t width
Definition: rig.h:1278
Frequency range.
Definition: rig.h:1209
freq_t startf
Definition: rig.h:1210
freq_t endf
Definition: rig.h:1211
int low_power
Definition: rig.h:1213
char * label
Definition: rig.h:1217
ant_t ant
Definition: rig.h:1216
int high_power
Definition: rig.h:1214
vfo_t vfo
Definition: rig.h:1215
rmode_t modes
Definition: rig.h:1212
level/parm granularity definition
Definition: rig.h:1476
value_t max
Definition: rig.h:1478
value_t step
Definition: rig.h:1479
value_t min
Definition: rig.h:1477
Rig cache data.
Definition: rig.h:1930
Callback functions and args for rig event.
Definition: rig.h:2095
rig_ptr_t mode_arg
Definition: rig.h:2099
ptt_cb_t ptt_event
Definition: rig.h:2102
vfo_cb_t vfo_event
Definition: rig.h:2100
mode_cb_t mode_event
Definition: rig.h:2098
rig_ptr_t freq_arg
Definition: rig.h:2097
rig_ptr_t ptt_arg
Definition: rig.h:2103
rig_ptr_t dcd_arg
Definition: rig.h:2105
dcd_cb_t dcd_event
Definition: rig.h:2104
rig_ptr_t pltune_arg
Definition: rig.h:2107
pltune_cb_t pltune
Definition: rig.h:2106
rig_ptr_t vfo_arg
Definition: rig.h:2101
freq_cb_t freq_event
Definition: rig.h:2096
Rig state containing live data and customized fields.
Definition: rig.h:1978
int auto_power_on
Definition: rig.h:2048
int vfo_opt
Definition: rig.h:2047
setting_t has_set_parm
Definition: rig.h:2014
rmode_t mode_list
Definition: rig.h:2037
shortfreq_t max_rit
Definition: rig.h:2000
freq_t lo_freq
Definition: rig.h:2041
int power_max
Definition: rig.h:2056
gran_t parm_gran[64]
Definition: rig.h:2017
int hold_decode
Definition: rig.h:2024
int transceive
Definition: rig.h:2031
int preamp[MAXDBLSTSIZ]
Definition: rig.h:2006
rmode_t current_mode
Definition: rig.h:2034
setting_t has_set_func
Definition: rig.h:2010
int uplink
Definition: rig.h:2045
rig_ptr_t obj
Definition: rig.h:2029
pbwidth_t current_width
Definition: rig.h:2035
int ptt_share
Definition: rig.h:2053
rig_ptr_t priv
Definition: rig.h:2028
freq_range_t tx_range_list[FRQRANGESIZ]
Definition: rig.h:1990
freq_t current_freq
Definition: rig.h:2033
hamlib_port_t dcdport
Definition: rig.h:1984
time_t twiddle_time
Definition: rig.h:2042
vfo_t tx_vfo
Definition: rig.h:2036
int deprecated_itu_region
Definition: rig.h:1988
int power_min
Definition: rig.h:2055
double vfo_comp
Definition: rig.h:1986
setting_t has_set_level
Definition: rig.h:2012
shortfreq_t max_xit
Definition: rig.h:2001
hamlib_port_t rigport
Definition: rig.h:1982
int power_now
Definition: rig.h:2054
int twiddle_timeout
Definition: rig.h:2043
int poll_interval
Definition: rig.h:2032
int attenuator[MAXDBLSTSIZ]
Definition: rig.h:2007
setting_t has_get_parm
Definition: rig.h:2013
struct filter_list filters[FLTLSTSIZ]
Definition: rig.h:1994
vfo_t current_vfo
Definition: rig.h:2025
int auto_disable_screensaver
Definition: rig.h:2050
freq_range_t rx_range_list[FRQRANGESIZ]
Definition: rig.h:1989
int comm_state
Definition: rig.h:2027
int vfo_list
Definition: rig.h:2026
setting_t has_get_level
Definition: rig.h:2011
setting_t has_get_func
Definition: rig.h:2009
int transmit
Definition: rig.h:2038
ann_t announces
Definition: rig.h:2004
struct tuning_step_list tuning_steps[TSLSTSIZ]
Definition: rig.h:1992
cal_table_t str_cal
Definition: rig.h:1996
shortfreq_t max_ifshift
Definition: rig.h:2002
gran_t level_gran[64]
Definition: rig.h:2016
hamlib_port_t pttport
Definition: rig.h:1983
The Rig structure.
Definition: rig.h:2121
struct rig_callbacks callbacks
Definition: rig.h:2124
struct rig_state state
Definition: rig.h:2123
struct rig_caps * caps
Definition: rig.h:2122
Tuning step definition.
Definition: rig.h:1241
rmode_t modes
Definition: rig.h:1242
shortfreq_t ts
Definition: rig.h:1243
Universal approach for passing values.
Definition: rig.h:825
char * s
Definition: rig.h:828
float f
Definition: rig.h:827
const char * cs
Definition: rig.h:829
signed int i
Definition: rig.h:826

Generated by doxygen 1.9.1

Hamlib documentation for version 4.0 -- Tue Jan 26 2021 00:00:00
Project page: http://www.hamlib.org