Hamlib  4.0~rc2
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
61 
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
82 
84 #include <hamlib/rig_dll.h>
85 
86 #ifndef SWIGLUA
87 #define CONSTANT_64BIT_FLAG(BIT) (1ull << (BIT))
89 #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,
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 */
186 
188 
199 typedef unsigned int tone_t;
200 
201 
205 typedef enum rig_port_e {
220 } rig_port_t;
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)
270 } rig_type_t;
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
286 
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 {
316 } rptr_shift_t;
317 
318 
322 typedef enum {
325 } split_t;
326 
327 
333 typedef double freq_t;
334 
338 #define PRIfreq "f"
339 
343 #define SCNfreq "lf"
344 
347 #define FREQFMT SCNfreq
348 
349 
355 typedef signed long shortfreq_t;
356 
358 #define Hz(f) ((freq_t)(f))
359 
360 #define kHz(f) ((freq_t)((f)*(freq_t)1000))
361 
362 #define MHz(f) ((freq_t)((f)*(freq_t)1000000))
363 
364 #define GHz(f) ((freq_t)((f)*(freq_t)1000000000))
365 
367 #define s_Hz(f) ((shortfreq_t)(f))
368 
369 #define s_kHz(f) ((shortfreq_t)((f)*(shortfreq_t)1000))
370 
371 #define s_MHz(f) ((shortfreq_t)((f)*(shortfreq_t)1000000))
372 
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
478 //
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)
492 
498 #define RIG_PASSBAND_NORMAL s_Hz(0) // was 0 but collided with Yasue SH00; capability
499 
503 #define RIG_PASSBAND_NOCHANGE s_Hz(-1)
504 
507 #define RIG_PASSBAND_ROOF s_Hz(-3)
508 
513 
514 
518 typedef enum dcd_e {
521 } dcd_t;
522 
523 
529 typedef enum {
539 } dcd_type_t;
540 
541 
545 typedef enum {
550 } ptt_t;
551 
552 
558 typedef enum {
568 } ptt_type_t;
569 
570 
574 typedef enum {
576  RIG_POWER_ON = (1 << 0),
577  RIG_POWER_STANDBY = (1 << 1),
578  RIG_POWER_OPERATE = (1 << 2),
579  RIG_POWER_UNKNOWN = (1 << 3)
580 } powerstat_t;
581 
582 
586 typedef enum {
588  RIG_RESET_SOFT = (1 << 0),
589  RIG_RESET_VFO = (1 << 1),
590  RIG_RESET_MCALL = (1 << 2),
591  RIG_RESET_MASTER = (1 << 3)
592 } reset_t;
593 
594 
610 typedef enum {
612  RIG_OP_CPY = (1 << 0),
613  RIG_OP_XCHG = (1 << 1),
614  RIG_OP_FROM_VFO = (1 << 2),
615  RIG_OP_TO_VFO = (1 << 3),
616  RIG_OP_MCL = (1 << 4),
617  RIG_OP_UP = (1 << 5),
618  RIG_OP_DOWN = (1 << 6),
619  RIG_OP_BAND_UP = (1 << 7),
620  RIG_OP_BAND_DOWN = (1 << 8),
621  RIG_OP_LEFT = (1 << 9),
622  RIG_OP_RIGHT = (1 << 10),
623  RIG_OP_TUNE = (1 << 11),
624  RIG_OP_TOGGLE = (1 << 12)
625 } vfo_op_t;
626 
627 
636 typedef enum {
638  RIG_SCAN_MEM = (1 << 0),
639  RIG_SCAN_SLCT = (1 << 1),
640  RIG_SCAN_PRIO = (1 << 2),
641  RIG_SCAN_PROG = (1 << 3),
642  RIG_SCAN_DELTA = (1 << 4),
643  RIG_SCAN_VFO = (1 << 5),
644  RIG_SCAN_PLT = (1 << 6),
645  RIG_SCAN_STOP = (1 << 7)
646 } scan_t;
647 
648 
652 typedef long token_t;
653 
654 
656 #define RIG_CONF_END 0
657 
659 
673 /* strongly inspired from soundmodem. Thanks Thomas! */
681 };
682 
684 #define RIG_COMBO_MAX 16
685 #define RIG_BIN_MAX 80
686 
691 struct confparams {
693  const char *name;
694  const char *label;
695  const char *tooltip;
696  const char *dflt;
698  union {
699  struct {
700  float min;
701  float max;
702  float step;
703  } n;
704  struct {
705  const char *combostr[RIG_COMBO_MAX];
706  } c;
707  } u;
708 };
709 
710 
716 typedef enum {
719  RIG_ANN_FREQ = (1 << 0),
720  RIG_ANN_RXMODE = (1 << 1),
721  RIG_ANN_CW = (1 << 2),
722  RIG_ANN_ENG = (1 << 3),
723  RIG_ANN_JAP = (1 << 4)
724 } ann_t;
725 
726 
773 typedef unsigned int ant_t;
774 
775 #define RIG_ANT_NONE 0
776 #define RIG_ANT_N(n) ((ant_t)1<<(n))
777 #define RIG_ANT_1 RIG_ANT_N(0)
778 #define RIG_ANT_2 RIG_ANT_N(1)
779 #define RIG_ANT_3 RIG_ANT_N(2)
780 #define RIG_ANT_4 RIG_ANT_N(3)
781 #define RIG_ANT_5 RIG_ANT_N(4)
782 
783 #define RIG_ANT_UNKNOWN RIG_ANT_N(30)
784 #define RIG_ANT_CURR RIG_ANT_N(31)
785 
786 #define RIG_ANT_MAX 32
787 
788 
792 /* TODO: kill me, and replace by real AGC delay */
794  RIG_AGC_OFF = 0,
795  RIG_AGC_SUPERFAST,
796  RIG_AGC_FAST,
797  RIG_AGC_SLOW,
799  RIG_AGC_MEDIUM,
800  RIG_AGC_AUTO
801 };
802 
804 #define RIG_AGC_LAST RIG_AGC_AUTO
805 
811  RIG_METER_NONE = 0, /*< No display meter */
812  RIG_METER_SWR = (1 << 0), /*< Stationary Wave Ratio */
813  RIG_METER_COMP = (1 << 1), /*< Compression level */
814  RIG_METER_ALC = (1 << 2), /*< ALC */
815  RIG_METER_IC = (1 << 3), /*< IC */
816  RIG_METER_DB = (1 << 4), /*< DB */
817  RIG_METER_PO = (1 << 5), /*< Power Out */
818  RIG_METER_VDD = (1 << 6) /*< Final Amp Voltage */
819 };
820 
821 
827 typedef union {
828  signed int i;
829  float f;
830  char *s;
831  const char *cs;
832  struct {
834  int l;
835  unsigned char *d; /* Pointer to data buffer */
836  } b;
838 } value_t;
839 
840 
851  RIG_LEVEL_PREAMP = (1 << 0),
852  RIG_LEVEL_ATT = (1 << 1),
853  RIG_LEVEL_VOXDELAY = (1 << 2),
854  RIG_LEVEL_AF = (1 << 3),
855  RIG_LEVEL_RF = (1 << 4),
856  RIG_LEVEL_SQL = (1 << 5),
857  RIG_LEVEL_IF = (1 << 6),
858  RIG_LEVEL_APF = (1 << 7),
859  RIG_LEVEL_NR = (1 << 8),
860  RIG_LEVEL_PBT_IN = (1 << 9),
861  RIG_LEVEL_PBT_OUT = (1 << 10),
862  RIG_LEVEL_CWPITCH = (1 << 11),
863  RIG_LEVEL_RFPOWER = (1 << 12),
864  RIG_LEVEL_MICGAIN = (1 << 13),
865  RIG_LEVEL_KEYSPD = (1 << 14),
866  RIG_LEVEL_NOTCHF = (1 << 15),
867  RIG_LEVEL_COMP = (1 << 16),
868  RIG_LEVEL_AGC = (1 << 17),
869  RIG_LEVEL_BKINDL = (1 << 18),
870  RIG_LEVEL_BALANCE = (1 << 19),
871  RIG_LEVEL_METER = (1 << 20),
872  RIG_LEVEL_VOXGAIN = (1 << 21),
873  RIG_LEVEL_ANTIVOX = (1 << 22),
874  RIG_LEVEL_SLOPE_LOW = (1 << 23),
875  RIG_LEVEL_SLOPE_HIGH = (1 << 24),
876  RIG_LEVEL_BKIN_DLYMS = (1 << 25),
879  RIG_LEVEL_RAWSTR = (1 << 26),
880  RIG_LEVEL_SQLSTAT = (1 << 27),
881  RIG_LEVEL_SWR = (1 << 28),
882  RIG_LEVEL_ALC = (1 << 29),
883  RIG_LEVEL_STRENGTH = (1 << 30),
884  /* RIG_LEVEL_BWC = (1<<31) */
885  RIG_LEVEL_RFPOWER_METER = CONSTANT_64BIT_FLAG(32),
886  RIG_LEVEL_COMP_METER = CONSTANT_64BIT_FLAG(33),
887  RIG_LEVEL_VD_METER = CONSTANT_64BIT_FLAG(34),
888  RIG_LEVEL_ID_METER = CONSTANT_64BIT_FLAG(35),
890  RIG_LEVEL_NOTCHF_RAW = CONSTANT_64BIT_FLAG(36),
891  RIG_LEVEL_MONITOR_GAIN = CONSTANT_64BIT_FLAG(37),
892  RIG_LEVEL_NB = CONSTANT_64BIT_FLAG(38),
893  RIG_LEVEL_39 = CONSTANT_64BIT_FLAG(39),
894  RIG_LEVEL_40 = CONSTANT_64BIT_FLAG(40),
895  RIG_LEVEL_41 = CONSTANT_64BIT_FLAG(41),
896  RIG_LEVEL_42 = CONSTANT_64BIT_FLAG(42),
897  RIG_LEVEL_43 = CONSTANT_64BIT_FLAG(43),
898  RIG_LEVEL_44 = CONSTANT_64BIT_FLAG(44),
899  RIG_LEVEL_45 = CONSTANT_64BIT_FLAG(45),
900  RIG_LEVEL_46 = CONSTANT_64BIT_FLAG(46),
901  RIG_LEVEL_47 = CONSTANT_64BIT_FLAG(47),
902  RIG_LEVEL_48 = CONSTANT_64BIT_FLAG(48),
903  RIG_LEVEL_49 = CONSTANT_64BIT_FLAG(49),
904  RIG_LEVEL_50 = CONSTANT_64BIT_FLAG(50),
905  RIG_LEVEL_51 = CONSTANT_64BIT_FLAG(51),
906  RIG_LEVEL_52 = CONSTANT_64BIT_FLAG(52),
907  RIG_LEVEL_53 = CONSTANT_64BIT_FLAG(53),
908  RIG_LEVEL_54 = CONSTANT_64BIT_FLAG(54),
909  RIG_LEVEL_55 = CONSTANT_64BIT_FLAG(55),
910  RIG_LEVEL_56 = CONSTANT_64BIT_FLAG(56),
911  RIG_LEVEL_57 = CONSTANT_64BIT_FLAG(57),
912  RIG_LEVEL_58 = CONSTANT_64BIT_FLAG(58),
913  RIG_LEVEL_59 = CONSTANT_64BIT_FLAG(59),
914  RIG_LEVEL_60 = CONSTANT_64BIT_FLAG(60),
915  RIG_LEVEL_61 = CONSTANT_64BIT_FLAG(61),
916  RIG_LEVEL_62 = CONSTANT_64BIT_FLAG(62),
917  RIG_LEVEL_63 = CONSTANT_64BIT_FLAG(63),
918 };
919 
921 #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_COMP_METER|RIG_LEVEL_VD_METER|RIG_LEVEL_ID_METER|RIG_LEVEL_NOTCHF_RAW|RIG_LEVEL_MONITOR_GAIN|RIG_LEVEL_NB)
922 
923 #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)
924 
925 #define RIG_LEVEL_IS_FLOAT(l) ((l)&RIG_LEVEL_FLOAT_LIST)
926 #define RIG_LEVEL_SET(l) ((l)&~RIG_LEVEL_READONLY_LIST)
927 
929 
940  RIG_PARM_ANN = (1 << 0),
941  RIG_PARM_APO = (1 << 1),
942  RIG_PARM_BACKLIGHT = (1 << 2),
943  RIG_PARM_BEEP = (1 << 4),
944  RIG_PARM_TIME = (1 << 5),
945  RIG_PARM_BAT = (1 << 6),
946  RIG_PARM_KEYLIGHT = (1 << 7),
948 };
949 
951 #define RIG_PARM_FLOAT_LIST (RIG_PARM_BACKLIGHT|RIG_PARM_BAT|RIG_PARM_KEYLIGHT)
952 #define RIG_PARM_READONLY_LIST (RIG_PARM_BAT)
953 
954 #define RIG_PARM_IS_FLOAT(l) ((l)&RIG_PARM_FLOAT_LIST)
955 #define RIG_PARM_SET(l) ((l)&~RIG_PARM_READONLY_LIST)
956 
964 typedef uint64_t setting_t;
965 
970 #define RIG_SETTING_MAX 64
971 
985 #define RIG_TRN_OFF 0
986 #define RIG_TRN_RIG 1
987 #define RIG_TRN_POLL 2
988 
989 
998 /*
999  * The C standard dictates that an enum constant is a 32 bit signed integer.
1000  * Setting a constant's bit 31 created a negative value that on amd64 had the
1001  * upper 32 bits set as well when assigned to the misc.c:func_str structure.
1002  * This caused misc.c:rig_strfunc() to fail its comparison for RIG_FUNC_XIT
1003  * on amd64 (x86_64). To use bit 31 as an unsigned long, preprocessor macros
1004  * have been used instead as a 'const unsigned long' which cannot be used to
1005  * initialize the func_str.func members. TNX KA6MAL, AC6SL. - N0NB
1006  */
1007 #define RIG_FUNC_NONE 0
1008 #define RIG_FUNC_FAGC CONSTANT_64BIT_FLAG (0)
1009 #define RIG_FUNC_NB CONSTANT_64BIT_FLAG (1)
1010 #define RIG_FUNC_COMP CONSTANT_64BIT_FLAG (2)
1011 #define RIG_FUNC_VOX CONSTANT_64BIT_FLAG (3)
1012 #define RIG_FUNC_TONE CONSTANT_64BIT_FLAG (4)
1013 #define RIG_FUNC_TSQL CONSTANT_64BIT_FLAG (5)
1014 #define RIG_FUNC_SBKIN CONSTANT_64BIT_FLAG (6)
1015 #define RIG_FUNC_FBKIN CONSTANT_64BIT_FLAG (7)
1016 #define RIG_FUNC_ANF CONSTANT_64BIT_FLAG (8)
1017 #define RIG_FUNC_NR CONSTANT_64BIT_FLAG (9)
1018 #define RIG_FUNC_AIP CONSTANT_64BIT_FLAG (10)
1019 #define RIG_FUNC_APF CONSTANT_64BIT_FLAG (11)
1020 #define RIG_FUNC_MON CONSTANT_64BIT_FLAG (12)
1021 #define RIG_FUNC_MN CONSTANT_64BIT_FLAG (13)
1022 #define RIG_FUNC_RF CONSTANT_64BIT_FLAG (14)
1023 #define RIG_FUNC_ARO CONSTANT_64BIT_FLAG (15)
1024 #define RIG_FUNC_LOCK CONSTANT_64BIT_FLAG (16)
1025 #define RIG_FUNC_MUTE CONSTANT_64BIT_FLAG (17)
1026 #define RIG_FUNC_VSC CONSTANT_64BIT_FLAG (18)
1027 #define RIG_FUNC_REV CONSTANT_64BIT_FLAG (19)
1028 #define RIG_FUNC_SQL CONSTANT_64BIT_FLAG (20)
1029 #define RIG_FUNC_ABM CONSTANT_64BIT_FLAG (21)
1030 #define RIG_FUNC_BC CONSTANT_64BIT_FLAG (22)
1031 #define RIG_FUNC_MBC CONSTANT_64BIT_FLAG (23)
1032 #define RIG_FUNC_RIT CONSTANT_64BIT_FLAG (24)
1033 #define RIG_FUNC_AFC CONSTANT_64BIT_FLAG (25)
1034 #define RIG_FUNC_SATMODE CONSTANT_64BIT_FLAG (26)
1035 #define RIG_FUNC_SCOPE CONSTANT_64BIT_FLAG (27)
1036 #define RIG_FUNC_RESUME CONSTANT_64BIT_FLAG (28)
1037 #define RIG_FUNC_TBURST CONSTANT_64BIT_FLAG (29)
1038 #define RIG_FUNC_TUNER CONSTANT_64BIT_FLAG (30)
1039 #define RIG_FUNC_XIT CONSTANT_64BIT_FLAG (31)
1040 #ifndef SWIGLUAHIDE
1041 /* Hide the top 32 bits from the old Lua binding as they can't be represented */
1042 #define RIG_FUNC_NB2 CONSTANT_64BIT_FLAG (32)
1043 #define RIG_FUNC_CSQL CONSTANT_64BIT_FLAG (33)
1044 #define RIG_FUNC_AFLT CONSTANT_64BIT_FLAG (34)
1045 #define RIG_FUNC_ANL CONSTANT_64BIT_FLAG (35)
1046 #define RIG_FUNC_BC2 CONSTANT_64BIT_FLAG (36)
1047 #define RIG_FUNC_DUAL_WATCH CONSTANT_64BIT_FLAG (37)
1048 #define RIG_FUNC_DIVERSITY CONSTANT_64BIT_FLAG (38)
1049 #define RIG_FUNC_DSQL CONSTANT_64BIT_FLAG (39)
1050 #define RIG_FUNC_SCEN CONSTANT_64BIT_FLAG (40)
1051 #define RIG_FUNC_BIT41 CONSTANT_64BIT_FLAG (41)
1052 #define RIG_FUNC_BIT42 CONSTANT_64BIT_FLAG (42)
1053 #define RIG_FUNC_BIT43 CONSTANT_64BIT_FLAG (43)
1054 #define RIG_FUNC_BIT44 CONSTANT_64BIT_FLAG (44)
1055 #define RIG_FUNC_BIT45 CONSTANT_64BIT_FLAG (45)
1056 #define RIG_FUNC_BIT46 CONSTANT_64BIT_FLAG (46)
1057 #define RIG_FUNC_BIT47 CONSTANT_64BIT_FLAG (47)
1058 #define RIG_FUNC_BIT48 CONSTANT_64BIT_FLAG (48)
1059 #define RIG_FUNC_BIT49 CONSTANT_64BIT_FLAG (49)
1060 #define RIG_FUNC_BIT50 CONSTANT_64BIT_FLAG (50)
1061 #define RIG_FUNC_BIT51 CONSTANT_64BIT_FLAG (51)
1062 #define RIG_FUNC_BIT52 CONSTANT_64BIT_FLAG (52)
1063 #define RIG_FUNC_BIT53 CONSTANT_64BIT_FLAG (53)
1064 #define RIG_FUNC_BIT54 CONSTANT_64BIT_FLAG (54)
1065 #define RIG_FUNC_BIT55 CONSTANT_64BIT_FLAG (55)
1066 #define RIG_FUNC_BIT56 CONSTANT_64BIT_FLAG (56)
1067 #define RIG_FUNC_BIT57 CONSTANT_64BIT_FLAG (57)
1068 #define RIG_FUNC_BIT58 CONSTANT_64BIT_FLAG (58)
1069 #define RIG_FUNC_BIT59 CONSTANT_64BIT_FLAG (59)
1070 #define RIG_FUNC_BIT60 CONSTANT_64BIT_FLAG (60)
1071 #define RIG_FUNC_BIT61 CONSTANT_64BIT_FLAG (61)
1072 #define RIG_FUNC_BIT62 CONSTANT_64BIT_FLAG (62)
1073 #define RIG_FUNC_BIT63 CONSTANT_64BIT_FLAG (63)
1074 /* 63 is this highest bit number that can be used */
1075 #endif
1076 
1083 #define mW(p) ((int)(p))
1084 
1091 #define Watts(p) ((int)((p)*1000))
1092 
1098 #define W(p) Watts(p)
1099 #if 0 // deprecating kW macro as this doesn't make sense
1100 
1106 #define kW(p) ((int)((p)*1000000L))
1107 #endif
1108 
1109 
1119 typedef uint64_t rmode_t;
1120 
1121 #define RIG_MODE_NONE 0
1122 #define RIG_MODE_AM CONSTANT_64BIT_FLAG (0)
1123 #define RIG_MODE_CW CONSTANT_64BIT_FLAG (1)
1124 #define RIG_MODE_USB CONSTANT_64BIT_FLAG (2)
1125 #define RIG_MODE_LSB CONSTANT_64BIT_FLAG (3)
1126 #define RIG_MODE_RTTY CONSTANT_64BIT_FLAG (4)
1127 #define RIG_MODE_FM CONSTANT_64BIT_FLAG (5)
1128 #define RIG_MODE_WFM CONSTANT_64BIT_FLAG (6)
1129 #define RIG_MODE_CWR CONSTANT_64BIT_FLAG (7)
1130 #define RIG_MODE_RTTYR CONSTANT_64BIT_FLAG (8)
1131 #define RIG_MODE_AMS CONSTANT_64BIT_FLAG (9)
1132 #define RIG_MODE_PKTLSB CONSTANT_64BIT_FLAG (10)
1133 #define RIG_MODE_PKTUSB CONSTANT_64BIT_FLAG (11)
1134 #define RIG_MODE_PKTFM CONSTANT_64BIT_FLAG (12)
1135 #define RIG_MODE_ECSSUSB CONSTANT_64BIT_FLAG (13)
1136 #define RIG_MODE_ECSSLSB CONSTANT_64BIT_FLAG (14)
1137 #define RIG_MODE_FAX CONSTANT_64BIT_FLAG (15)
1138 #define RIG_MODE_SAM CONSTANT_64BIT_FLAG (16)
1139 #define RIG_MODE_SAL CONSTANT_64BIT_FLAG (17)
1140 #define RIG_MODE_SAH CONSTANT_64BIT_FLAG (18)
1141 #define RIG_MODE_DSB CONSTANT_64BIT_FLAG (19)
1142 #define RIG_MODE_FMN CONSTANT_64BIT_FLAG (21)
1143 #define RIG_MODE_PKTAM CONSTANT_64BIT_FLAG (22)
1144 #define RIG_MODE_P25 CONSTANT_64BIT_FLAG (23)
1145 #define RIG_MODE_DSTAR CONSTANT_64BIT_FLAG (24)
1146 #define RIG_MODE_DPMR CONSTANT_64BIT_FLAG (25)
1147 #define RIG_MODE_NXDNVN CONSTANT_64BIT_FLAG (26)
1148 #define RIG_MODE_NXDN_N CONSTANT_64BIT_FLAG (27)
1149 #define RIG_MODE_DCR CONSTANT_64BIT_FLAG (28)
1150 #define RIG_MODE_AMN CONSTANT_64BIT_FLAG (29)
1151 #define RIG_MODE_PSK CONSTANT_64BIT_FLAG (30)
1152 #define RIG_MODE_PSKR CONSTANT_64BIT_FLAG (31)
1153 #ifndef SWIGLUAHIDE
1154 /* hide the top 32 bits from the Lua binding as they will not work */
1155 #define RIG_MODE_DD CONSTANT_64BIT_FLAG (32)
1156 #define RIG_MODE_C4FM CONSTANT_64BIT_FLAG (33)
1157 #define RIG_MODE_PKTFMN CONSTANT_64BIT_FLAG (34)
1158 #define RIG_MODE_BIT35 CONSTANT_64BIT_FLAG (35)
1159 #define RIG_MODE_BIT36 CONSTANT_64BIT_FLAG (36)
1160 #define RIG_MODE_BIT37 CONSTANT_64BIT_FLAG (37)
1161 #define RIG_MODE_BIT38 CONSTANT_64BIT_FLAG (38)
1162 #define RIG_MODE_BIT39 CONSTANT_64BIT_FLAG (39)
1163 #define RIG_MODE_BIT40 CONSTANT_64BIT_FLAG (40)
1164 #define RIG_MODE_BIT41 CONSTANT_64BIT_FLAG (41)
1165 #define RIG_MODE_BIT42 CONSTANT_64BIT_FLAG (42)
1166 #define RIG_MODE_BIT43 CONSTANT_64BIT_FLAG (43)
1167 #define RIG_MODE_BIT44 CONSTANT_64BIT_FLAG (44)
1168 #define RIG_MODE_BIT45 CONSTANT_64BIT_FLAG (45)
1169 #define RIG_MODE_BIT46 CONSTANT_64BIT_FLAG (46)
1170 #define RIG_MODE_BIT47 CONSTANT_64BIT_FLAG (47)
1171 #define RIG_MODE_BIT48 CONSTANT_64BIT_FLAG (48)
1172 #define RIG_MODE_BIT49 CONSTANT_64BIT_FLAG (49)
1173 #define RIG_MODE_BIT50 CONSTANT_64BIT_FLAG (50)
1174 #define RIG_MODE_BIT51 CONSTANT_64BIT_FLAG (51)
1175 #define RIG_MODE_BIT52 CONSTANT_64BIT_FLAG (52)
1176 #define RIG_MODE_BIT53 CONSTANT_64BIT_FLAG (53)
1177 #define RIG_MODE_BIT54 CONSTANT_64BIT_FLAG (54)
1178 #define RIG_MODE_BIT55 CONSTANT_64BIT_FLAG (55)
1179 #define RIG_MODE_BIT56 CONSTANT_64BIT_FLAG (56)
1180 #define RIG_MODE_BIT57 CONSTANT_64BIT_FLAG (57)
1181 #define RIG_MODE_BIT58 CONSTANT_64BIT_FLAG (58)
1182 #define RIG_MODE_BIT59 CONSTANT_64BIT_FLAG (59)
1183 #define RIG_MODE_BIT60 CONSTANT_64BIT_FLAG (60)
1184 #define RIG_MODE_BIT61 CONSTANT_64BIT_FLAG (61)
1185 #define RIG_MODE_BIT62 CONSTANT_64BIT_FLAG (62)
1186 #define RIG_MODE_TESTS_MAX CONSTANT_64BIT_FLAG (63)
1187 #endif
1188 
1192 #define RIG_MODE_SSB (RIG_MODE_USB|RIG_MODE_LSB)
1193 
1197 #define RIG_MODE_ECSS (RIG_MODE_ECSSUSB|RIG_MODE_ECSSLSB)
1198 
1200 #define RIG_DBLST_END 0 /* end marker in a preamp/att level list */
1201 #define RIG_IS_DBLST_END(d) ((d)==0)
1202 
1204 
1211 typedef struct freq_range_list {
1219  char *label;
1220 } freq_range_t;
1221 
1223 #define RIG_FRNG_END {Hz(0),Hz(0),RIG_MODE_NONE,0,0,RIG_VFO_NONE}
1224 #define RIG_IS_FRNG_END(r) ((r).startf == Hz(0) && (r).endf == Hz(0))
1225 
1246 };
1247 
1249 #define RIG_TS_ANY 0
1250 #define RIG_TS_END {RIG_MODE_NONE, 0}
1251 #define RIG_IS_TS_END(t) ((t).modes == RIG_MODE_NONE && (t).ts == 0)
1252 
1254 
1278 struct filter_list {
1281 };
1283 #define RIG_FLT_ANY 0
1284 #define RIG_FLT_END {RIG_MODE_NONE, 0}
1285 #define RIG_IS_FLT_END(f) ((f).modes == RIG_MODE_NONE)
1286 
1288 
1292 #define RIG_CHFLAG_NONE 0
1293 
1296 #define RIG_CHFLAG_SKIP (1<<0)
1297 
1300 #define RIG_CHFLAG_DATA (1<<1)
1301 
1304 #define RIG_CHFLAG_PSKIP (1<<2)
1305 
1310 struct ext_list {
1313 };
1314 
1316 #define RIG_EXT_END {0, {.i=0}}
1317 #define RIG_IS_EXT_END(x) ((x).token == 0)
1318 
1327 struct channel {
1329  int bank_num;
1355  unsigned int flags;
1356  char channel_desc[MAXCHANDESC];
1357  struct ext_list
1358  *ext_levels;
1359 };
1360 
1364 typedef struct channel channel_t;
1365 
1371 struct channel_cap {
1372  unsigned bank_num: 1;
1373  unsigned vfo: 1;
1374  unsigned ant: 1;
1375  unsigned freq: 1;
1376  unsigned mode: 1;
1377  unsigned width: 1;
1379  unsigned tx_freq: 1;
1380  unsigned tx_mode: 1;
1381  unsigned tx_width: 1;
1383  unsigned split: 1;
1384  unsigned tx_vfo: 1;
1385  unsigned rptr_shift: 1;
1386  unsigned rptr_offs: 1;
1387  unsigned tuning_step: 1;
1388  unsigned rit: 1;
1389  unsigned xit: 1;
1392  unsigned ctcss_tone: 1;
1393  unsigned ctcss_sql: 1;
1394  unsigned dcs_code: 1;
1395  unsigned dcs_sql: 1;
1396  unsigned scan_group: 1;
1397  unsigned flags: 1;
1398  unsigned channel_desc: 1;
1399  unsigned ext_levels: 1;
1400 };
1401 
1406 
1407 
1418 typedef enum {
1427 } chan_type_t;
1428 
1429 
1443 struct chan_list {
1444  int startc;
1445  int endc;
1449 };
1450 
1452 #define RIG_CHAN_END {0,0,RIG_MTYPE_NONE}
1453 #define RIG_IS_CHAN_END(c) ((c).type == RIG_MTYPE_NONE)
1454 
1459 #define RIG_MEM_CAPS_ALL -1
1460 
1464 typedef struct chan_list chan_t;
1465 
1466 
1478 struct gran {
1482 };
1483 
1487 typedef struct gran gran_t;
1488 
1489 
1493 struct cal_table {
1494  int size;
1495  struct {
1496  int raw;
1497  int val;
1498  } table[MAX_CAL_LENGTH];
1499 };
1500 
1513 typedef struct cal_table cal_table_t;
1514 
1516 #define EMPTY_STR_CAL { 0, { { 0, 0 }, } }
1517 
1519 
1524  int size;
1525  struct {
1526  int raw;
1527  float val;
1528  } table[MAX_CAL_LENGTH];
1529 };
1530 
1544 
1546 #define EMPTY_FLOAT_CAL { 0, { { 0, 0f }, } }
1547 
1548 typedef int (* chan_cb_t)(RIG *, channel_t **, int, const chan_t *, rig_ptr_t);
1549 typedef int (* confval_cb_t)(RIG *,
1550  const struct confparams *,
1551  value_t *,
1552  rig_ptr_t);
1554 
1555 
1575 #define RIG_MODEL(arg) .rig_model=arg,.macro_name=#arg
1577 struct rig_caps {
1578  rig_model_t rig_model;
1579  const char *model_name;
1580  const char *mfg_name;
1581  const char *version;
1582  const char *copyright;
1583  enum rig_status_e status;
1585  int rig_type;
1586  ptt_type_t ptt_type;
1587  dcd_type_t dcd_type;
1588  rig_port_t port_type;
1590  int serial_rate_min;
1591  int serial_rate_max;
1592  int serial_data_bits;
1593  int serial_stop_bits;
1594  enum serial_parity_e serial_parity;
1595  enum serial_handshake_e serial_handshake;
1597  int write_delay;
1598  int post_write_delay;
1599  int timeout;
1600  int retry;
1602  setting_t has_get_func;
1603  setting_t has_set_func;
1604  setting_t has_get_level;
1605  setting_t has_set_level;
1606  setting_t has_get_parm;
1607  setting_t has_set_parm;
1609  gran_t level_gran[RIG_SETTING_MAX];
1610  gran_t parm_gran[RIG_SETTING_MAX];
1612  const struct confparams *extparms;
1613  const struct confparams *extlevels;
1614  const struct confparams *extfuncs;
1615  int *ext_tokens;
1617  const tone_t *ctcss_list;
1618  const tone_t *dcs_list;
1620  int preamp[MAXDBLSTSIZ];
1621  int attenuator[MAXDBLSTSIZ];
1622  shortfreq_t max_rit;
1623  shortfreq_t max_xit;
1624  shortfreq_t max_ifshift;
1626  ann_t announces;
1628  vfo_op_t vfo_ops;
1629  scan_t scan_ops;
1630  int targetable_vfo;
1631  int transceive;
1633  int bank_qty;
1634  int chan_desc_sz;
1636  chan_t chan_list[CHANLSTSIZ];
1638  // As of 2020-02-12 we know of 5 models from Icom USA, EUR, ITR, TPE, KOR for the IC-9700
1639  // So we currently have 5 ranges we need to deal with
1640  // The backend for the model should fill in the label field to explain what model it is
1641  // The the IC-9700 in ic7300.c for an example
1642  freq_range_t rx_range_list1[FRQRANGESIZ];
1643  freq_range_t tx_range_list1[FRQRANGESIZ];
1644  freq_range_t rx_range_list2[FRQRANGESIZ];
1645  freq_range_t tx_range_list2[FRQRANGESIZ];
1646  freq_range_t rx_range_list3[FRQRANGESIZ];
1647  freq_range_t tx_range_list3[FRQRANGESIZ];
1648  freq_range_t rx_range_list4[FRQRANGESIZ];
1649  freq_range_t tx_range_list4[FRQRANGESIZ];
1650  freq_range_t rx_range_list5[FRQRANGESIZ];
1651  freq_range_t tx_range_list5[FRQRANGESIZ];
1653  struct tuning_step_list tuning_steps[TSLSTSIZ];
1654  struct filter_list filters[FLTLSTSIZ];
1656  cal_table_t str_cal;
1657  cal_table_float_t swr_cal;
1658  cal_table_float_t alc_cal;
1659  cal_table_float_t rfpower_meter_cal;
1660  cal_table_float_t comp_meter_cal;
1661  cal_table_float_t vd_meter_cal;
1662  cal_table_float_t id_meter_cal;
1664  const struct confparams *cfgparams;
1665  const rig_ptr_t priv;
1667  /*
1668  * Rig API
1669  *
1670  */
1671 
1672  int (*rig_init)(RIG *rig);
1673  int (*rig_cleanup)(RIG *rig);
1674  int (*rig_open)(RIG *rig);
1675  int (*rig_close)(RIG *rig);
1676 
1677  /*
1678  * General API commands, from most primitive to least.. :()
1679  * List Set/Get functions pairs
1680  */
1681 
1682  int (*set_freq)(RIG *rig, vfo_t vfo, freq_t freq);
1683  int (*get_freq)(RIG *rig, vfo_t vfo, freq_t *freq);
1684 
1685  int (*set_mode)(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width);
1686  int (*get_mode)(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width);
1687 
1688  int (*set_vfo)(RIG *rig, vfo_t vfo);
1689  int (*get_vfo)(RIG *rig, vfo_t *vfo);
1690 
1691  int (*set_ptt)(RIG *rig, vfo_t vfo, ptt_t ptt);
1692  int (*get_ptt)(RIG *rig, vfo_t vfo, ptt_t *ptt);
1693 
1694  int (*get_dcd)(RIG *rig, vfo_t vfo, dcd_t *dcd);
1695 
1696  int (*set_rptr_shift)(RIG *rig, vfo_t vfo, rptr_shift_t rptr_shift);
1697  int (*get_rptr_shift)(RIG *rig, vfo_t vfo, rptr_shift_t *rptr_shift);
1698 
1699  int (*set_rptr_offs)(RIG *rig, vfo_t vfo, shortfreq_t offs);
1700  int (*get_rptr_offs)(RIG *rig, vfo_t vfo, shortfreq_t *offs);
1701 
1702  int (*set_split_freq)(RIG *rig, vfo_t vfo, freq_t tx_freq);
1703  int (*get_split_freq)(RIG *rig, vfo_t vfo, freq_t *tx_freq);
1704 
1705  int (*set_split_mode)(RIG *rig,
1706  vfo_t vfo,
1707  rmode_t tx_mode,
1708  pbwidth_t tx_width);
1709  int (*get_split_mode)(RIG *rig,
1710  vfo_t vfo,
1711  rmode_t *tx_mode,
1712  pbwidth_t *tx_width);
1713 
1714  int (*set_split_freq_mode)(RIG *rig,
1715  vfo_t vfo,
1716  freq_t tx_freq,
1717  rmode_t tx_mode,
1718  pbwidth_t tx_width);
1719  int (*get_split_freq_mode)(RIG *rig,
1720  vfo_t vfo,
1721  freq_t *tx_freq,
1722  rmode_t *tx_mode,
1723  pbwidth_t *tx_width);
1724 
1725  int (*set_split_vfo)(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo);
1726  int (*get_split_vfo)(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo);
1727 
1728  int (*set_rit)(RIG *rig, vfo_t vfo, shortfreq_t rit);
1729  int (*get_rit)(RIG *rig, vfo_t vfo, shortfreq_t *rit);
1730 
1731  int (*set_xit)(RIG *rig, vfo_t vfo, shortfreq_t xit);
1732  int (*get_xit)(RIG *rig, vfo_t vfo, shortfreq_t *xit);
1733 
1734  int (*set_ts)(RIG *rig, vfo_t vfo, shortfreq_t ts);
1735  int (*get_ts)(RIG *rig, vfo_t vfo, shortfreq_t *ts);
1736 
1737  int (*set_dcs_code)(RIG *rig, vfo_t vfo, tone_t code);
1738  int (*get_dcs_code)(RIG *rig, vfo_t vfo, tone_t *code);
1739 
1740  int (*set_tone)(RIG *rig, vfo_t vfo, tone_t tone);
1741  int (*get_tone)(RIG *rig, vfo_t vfo, tone_t *tone);
1742 
1743  int (*set_ctcss_tone)(RIG *rig, vfo_t vfo, tone_t tone);
1744  int (*get_ctcss_tone)(RIG *rig, vfo_t vfo, tone_t *tone);
1745 
1746  int (*set_dcs_sql)(RIG *rig, vfo_t vfo, tone_t code);
1747  int (*get_dcs_sql)(RIG *rig, vfo_t vfo, tone_t *code);
1748 
1749  int (*set_tone_sql)(RIG *rig, vfo_t vfo, tone_t tone);
1750  int (*get_tone_sql)(RIG *rig, vfo_t vfo, tone_t *tone);
1751 
1752  int (*set_ctcss_sql)(RIG *rig, vfo_t vfo, tone_t tone);
1753  int (*get_ctcss_sql)(RIG *rig, vfo_t vfo, tone_t *tone);
1754 
1755  int (*power2mW)(RIG *rig,
1756  unsigned int *mwpower,
1757  float power,
1758  freq_t freq,
1759  rmode_t mode);
1760  int (*mW2power)(RIG *rig,
1761  float *power,
1762  unsigned int mwpower,
1763  freq_t freq,
1764  rmode_t mode);
1765 
1766  int (*set_powerstat)(RIG *rig, powerstat_t status);
1767  int (*get_powerstat)(RIG *rig, powerstat_t *status);
1768 
1769  int (*reset)(RIG *rig, reset_t reset);
1770 
1771  int (*set_ant)(RIG *rig, vfo_t vfo, ant_t ant, value_t option);
1772  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);
1773 
1774  int (*set_level)(RIG *rig, vfo_t vfo, setting_t level, value_t val);
1775  int (*get_level)(RIG *rig, vfo_t vfo, setting_t level, value_t *val);
1776 
1777  int (*set_func)(RIG *rig, vfo_t vfo, setting_t func, int status);
1778  int (*get_func)(RIG *rig, vfo_t vfo, setting_t func, int *status);
1779 
1780  int (*set_parm)(RIG *rig, setting_t parm, value_t val);
1781  int (*get_parm)(RIG *rig, setting_t parm, value_t *val);
1782 
1783  int (*set_ext_level)(RIG *rig, vfo_t vfo, token_t token, value_t val);
1784  int (*get_ext_level)(RIG *rig, vfo_t vfo, token_t token, value_t *val);
1785 
1786  int (*set_ext_func)(RIG *rig, vfo_t vfo, token_t token, int status);
1787  int (*get_ext_func)(RIG *rig, vfo_t vfo, token_t token, int *status);
1788 
1789  int (*set_ext_parm)(RIG *rig, token_t token, value_t val);
1790  int (*get_ext_parm)(RIG *rig, token_t token, value_t *val);
1791 
1792  int (*set_conf)(RIG *rig, token_t token, const char *val);
1793  int (*get_conf)(RIG *rig, token_t token, char *val);
1794 
1795  int (*send_dtmf)(RIG *rig, vfo_t vfo, const char *digits);
1796  int (*recv_dtmf)(RIG *rig, vfo_t vfo, char *digits, int *length);
1797 
1798  int (*send_morse)(RIG *rig, vfo_t vfo, const char *msg);
1799  int (*stop_morse)(RIG *rig, vfo_t vfo);
1800  int (*wait_morse)(RIG *rig, vfo_t vfo);
1801 
1802  int (*send_voice_mem)(RIG *rig, vfo_t vfo, int ch);
1803 
1804  int (*set_bank)(RIG *rig, vfo_t vfo, int bank);
1805 
1806  int (*set_mem)(RIG *rig, vfo_t vfo, int ch);
1807  int (*get_mem)(RIG *rig, vfo_t vfo, int *ch);
1808 
1809  int (*vfo_op)(RIG *rig, vfo_t vfo, vfo_op_t op);
1810 
1811  int (*scan)(RIG *rig, vfo_t vfo, scan_t scan, int ch);
1812 
1813  int (*set_trn)(RIG *rig, int trn);
1814  int (*get_trn)(RIG *rig, int *trn);
1815 
1816  int (*decode_event)(RIG *rig);
1817 
1818  int (*set_channel)(RIG *rig, const channel_t *chan);
1819  int (*get_channel)(RIG *rig, channel_t *chan, int read_only);
1820 
1821  const char * (*get_info)(RIG *rig);
1822 
1823  int (*set_chan_all_cb)(RIG *rig, chan_cb_t chan_cb, rig_ptr_t);
1824  int (*get_chan_all_cb)(RIG *rig, chan_cb_t chan_cb, rig_ptr_t);
1825 
1826  int (*set_mem_all_cb)(RIG *rig,
1827  chan_cb_t chan_cb,
1828  confval_cb_t parm_cb,
1829  rig_ptr_t);
1830  int (*get_mem_all_cb)(RIG *rig,
1831  chan_cb_t chan_cb,
1832  confval_cb_t parm_cb,
1833  rig_ptr_t);
1834 
1835  int (*set_vfo_opt)(RIG *rig, int status); // only for Net Rigctl device
1836 
1837  const char *clone_combo_set;
1838  const char *clone_combo_get;
1839  const char *macro_name;
1840 };
1842 
1843 
1849 typedef struct hamlib_port {
1851  union {
1852  rig_port_t rig;
1853  ptt_type_t ptt;
1854  dcd_type_t dcd;
1855  } type;
1856 
1857  int fd;
1858  void *handle;
1860  int write_delay;
1861  int post_write_delay;
1863  struct {
1864  int tv_sec, tv_usec;
1865  } post_write_date;
1867  int timeout;
1868  int retry;
1870  char pathname[FILPATHLEN];
1872  union {
1873  struct {
1874  int rate;
1875  int data_bits;
1876  int stop_bits;
1877  enum serial_parity_e parity;
1878  enum serial_handshake_e handshake;
1879  enum serial_control_state_e rts_state;
1880  enum serial_control_state_e dtr_state;
1881  } serial;
1883  struct {
1884  int pin;
1885  } parallel;
1887  struct {
1888  int ptt_bitnum;
1889  } cm108;
1891  struct {
1892  int vid;
1893  int pid;
1894  int conf;
1895  int iface;
1896  int alt;
1897  char *vendor_name;
1898  char *product;
1899  } usb;
1901  struct {
1902  int on_value;
1903  int value;
1904  } gpio;
1905  } parm;
1906 } hamlib_port_t;
1908 
1909 #if !defined(__APPLE__) || !defined(__cplusplus)
1910 typedef hamlib_port_t port_t;
1911 #endif
1912 
1913 #define HAMLIB_ELAPSED_GET 0
1914 #define HAMLIB_ELAPSED_SET 1
1915 #define HAMLIB_ELAPSED_INVALIDATE 2
1916 
1917 typedef enum {
1918  HAMLIB_CACHE_ALL, // to set all cache timeouts at once
1919  HAMLIB_CACHE_VFO,
1920  HAMLIB_CACHE_FREQ,
1921  HAMLIB_CACHE_MODE,
1922  HAMLIB_CACHE_PTT,
1923  HAMLIB_CACHE_SPLIT
1924 } hamlib_cache_t;
1925 
1931 struct rig_cache {
1932  int timeout_ms; // the cache timeout for invalidating itself
1933  vfo_t vfo;
1934  freq_t freq; // to be deprecated in 4.1 when full Main/Sub/A/B caching is implemented in 4.1
1935  // other abstraction here is based on dual vfo rigs and mapped to all others
1936  // So we have four possible states of rig
1937  // MainA, MainB, SubA, SubB
1938  // Main is the Main VFO and Sub is for the 2nd VFO
1939  // Most rigs have MainA and MainB
1940  // Dual VFO rigs can have SubA and SubB too
1941  // For dual VFO rigs simplex operations are all done on MainA/MainB -- ergo this abstraction
1942  freq_t freqCurr; // VFO_CURR
1943  freq_t freqMainA; // VFO_A, VFO_MAIN, and VFO_MAINA
1944  freq_t freqMainB; // VFO_B, VFO_SUB, and VFO_MAINB
1945  freq_t freqMainC; // VFO_C (future MainC?)
1946  freq_t freqSubA; // VFO_SUBA -- only for rigs with dual Sub VFOs
1947  freq_t freqSubB; // VFO_SUBB -- only for rigs with dual Sub VFOs
1948  rmode_t mode;
1949  pbwidth_t width;
1950  ptt_t ptt;
1951  split_t split;
1952  vfo_t split_vfo; // split caches two values
1953  struct timespec time_freq;
1954  struct timespec time_freqCurr;
1955  struct timespec time_freqMainA;
1956  struct timespec time_freqMainB;
1957  struct timespec time_freqMainC;
1958  struct timespec time_freqSubA;
1959  struct timespec time_freqSubB;
1960  struct timespec time_vfo;
1961  struct timespec time_mode;
1962  struct timespec time_ptt;
1963  struct timespec time_split;
1964  vfo_t vfo_freq; // last vfo cached
1965  vfo_t vfo_mode; // last vfo cached
1966  int satmode; // if rig is in satellite mode
1967 };
1968 
1969 
1979 struct rig_state {
1980  /*
1981  * overridable fields
1982  */
1983  hamlib_port_t rigport;
1984  hamlib_port_t pttport;
1985  hamlib_port_t dcdport;
1987  double vfo_comp;
1993  struct tuning_step_list tuning_steps[TSLSTSIZ];
1995  struct filter_list filters[FLTLSTSIZ];
1999  chan_t chan_list[CHANLSTSIZ];
2007  int preamp[MAXDBLSTSIZ];
2008  int attenuator[MAXDBLSTSIZ];
2021  /*
2022  * non overridable fields, internal use
2023  */
2024 
2027  int vfo_list;
2029  rig_ptr_t priv;
2030  rig_ptr_t obj;
2039  int transmit;
2043  time_t twiddle_time;
2045  // uplink allows gpredict to behave better by no reading the uplink VFO
2046  int uplink;
2047  struct rig_cache cache;
2048  int vfo_opt;
2058 };
2059 
2061 typedef int (*vprintf_cb_t)(enum rig_debug_level_e,
2062  rig_ptr_t,
2063  const char *,
2064  va_list);
2065 
2066 typedef int (*freq_cb_t)(RIG *, vfo_t, freq_t, rig_ptr_t);
2067 typedef int (*mode_cb_t)(RIG *, vfo_t, rmode_t, pbwidth_t, rig_ptr_t);
2068 typedef int (*vfo_cb_t)(RIG *, vfo_t, rig_ptr_t);
2069 typedef int (*ptt_cb_t)(RIG *, vfo_t, ptt_t, rig_ptr_t);
2070 typedef int (*dcd_cb_t)(RIG *, vfo_t, dcd_t, rig_ptr_t);
2071 typedef int (*pltune_cb_t)(RIG *,
2072  vfo_t, freq_t *,
2073  rmode_t *,
2074  pbwidth_t *,
2075  rig_ptr_t);
2076 
2078 
2097  freq_cb_t freq_event;
2098  rig_ptr_t freq_arg;
2099  mode_cb_t mode_event;
2100  rig_ptr_t mode_arg;
2101  vfo_cb_t vfo_event;
2102  rig_ptr_t vfo_arg;
2103  ptt_cb_t ptt_event;
2104  rig_ptr_t ptt_arg;
2105  dcd_cb_t dcd_event;
2106  rig_ptr_t dcd_arg;
2107  pltune_cb_t pltune;
2108  rig_ptr_t pltune_arg;
2109  /* etc.. */
2110 };
2111 
2112 
2122 struct s_rig {
2123  struct rig_caps *caps;
2124  struct rig_state state;
2126 };
2127 
2128 
2129 
2130 /* --------------- API function prototypes -----------------*/
2131 
2133 
2134 extern HAMLIB_EXPORT(RIG *) rig_init HAMLIB_PARAMS((rig_model_t rig_model));
2135 extern HAMLIB_EXPORT(int) rig_open HAMLIB_PARAMS((RIG *rig));
2136 
2137 /*
2138  * General API commands, from most primitive to least.. :()
2139  * List Set/Get functions pairs
2140  */
2141 
2142 extern HAMLIB_EXPORT(int)
2143 rig_flush(hamlib_port_t *port);
2144 
2145 extern HAMLIB_EXPORT(int)
2146 rig_set_freq HAMLIB_PARAMS((RIG *rig,
2147  vfo_t vfo,
2148  freq_t freq));
2149 extern HAMLIB_EXPORT(int)
2150 rig_get_freq HAMLIB_PARAMS((RIG *rig,
2151  vfo_t vfo,
2152  freq_t *freq));
2153 
2154 extern HAMLIB_EXPORT(int)
2155 rig_set_mode HAMLIB_PARAMS((RIG *rig,
2156  vfo_t vfo,
2157  rmode_t mode,
2158  pbwidth_t width));
2159 extern HAMLIB_EXPORT(int)
2160 rig_get_mode HAMLIB_PARAMS((RIG *rig,
2161  vfo_t vfo,
2162  rmode_t *mode,
2163  pbwidth_t *width));
2164 
2165 extern HAMLIB_EXPORT(int)
2166 rig_set_vfo HAMLIB_PARAMS((RIG *rig,
2167  vfo_t vfo));
2168 extern HAMLIB_EXPORT(int)
2169 rig_get_vfo HAMLIB_PARAMS((RIG *rig,
2170  vfo_t *vfo));
2171 
2172 extern HAMLIB_EXPORT(int)
2173 netrigctl_get_vfo_mode HAMLIB_PARAMS((RIG *rig));
2174 
2175 extern HAMLIB_EXPORT(int)
2176 rig_set_ptt HAMLIB_PARAMS((RIG *rig,
2177  vfo_t vfo,
2178  ptt_t ptt));
2179 extern HAMLIB_EXPORT(int)
2180 rig_get_ptt HAMLIB_PARAMS((RIG *rig,
2181  vfo_t vfo,
2182  ptt_t *ptt));
2183 
2184 extern HAMLIB_EXPORT(int)
2185 rig_get_dcd HAMLIB_PARAMS((RIG *rig,
2186  vfo_t vfo,
2187  dcd_t *dcd));
2188 
2189 extern HAMLIB_EXPORT(int)
2190 rig_set_rptr_shift HAMLIB_PARAMS((RIG *rig,
2191  vfo_t vfo,
2192  rptr_shift_t rptr_shift));
2193 extern HAMLIB_EXPORT(int)
2194 rig_get_rptr_shift HAMLIB_PARAMS((RIG *rig,
2195  vfo_t vfo,
2196  rptr_shift_t *rptr_shift));
2197 
2198 extern HAMLIB_EXPORT(int)
2199 rig_set_rptr_offs HAMLIB_PARAMS((RIG *rig,
2200  vfo_t vfo,
2201  shortfreq_t rptr_offs));
2202 extern HAMLIB_EXPORT(int)
2203 rig_get_rptr_offs HAMLIB_PARAMS((RIG *rig,
2204  vfo_t vfo,
2205  shortfreq_t *rptr_offs));
2206 
2207 extern HAMLIB_EXPORT(int)
2208 rig_set_ctcss_tone HAMLIB_PARAMS((RIG *rig,
2209  vfo_t vfo,
2210  tone_t tone));
2211 extern HAMLIB_EXPORT(int)
2212 rig_get_ctcss_tone HAMLIB_PARAMS((RIG *rig,
2213  vfo_t vfo,
2214  tone_t *tone));
2215 
2216 extern HAMLIB_EXPORT(int)
2217 rig_set_dcs_code HAMLIB_PARAMS((RIG *rig,
2218  vfo_t vfo,
2219  tone_t code));
2220 extern HAMLIB_EXPORT(int)
2221 rig_get_dcs_code HAMLIB_PARAMS((RIG *rig,
2222  vfo_t vfo,
2223  tone_t *code));
2224 
2225 extern HAMLIB_EXPORT(int)
2226 rig_set_ctcss_sql HAMLIB_PARAMS((RIG *rig,
2227  vfo_t vfo,
2228  tone_t tone));
2229 extern HAMLIB_EXPORT(int)
2230 rig_get_ctcss_sql HAMLIB_PARAMS((RIG *rig,
2231  vfo_t vfo,
2232  tone_t *tone));
2233 
2234 extern HAMLIB_EXPORT(int)
2235 rig_set_dcs_sql HAMLIB_PARAMS((RIG *rig,
2236  vfo_t vfo,
2237  tone_t code));
2238 extern HAMLIB_EXPORT(int)
2239 rig_get_dcs_sql HAMLIB_PARAMS((RIG *rig,
2240  vfo_t vfo,
2241  tone_t *code));
2242 
2243 extern HAMLIB_EXPORT(int)
2244 rig_set_split_freq HAMLIB_PARAMS((RIG *rig,
2245  vfo_t vfo,
2246  freq_t tx_freq));
2247 extern HAMLIB_EXPORT(int)
2248 rig_get_split_freq HAMLIB_PARAMS((RIG *rig,
2249  vfo_t vfo,
2250  freq_t *tx_freq));
2251 
2252 extern HAMLIB_EXPORT(int)
2253 rig_set_split_mode HAMLIB_PARAMS((RIG *rig,
2254  vfo_t vfo,
2255  rmode_t tx_mode,
2256  pbwidth_t tx_width));
2257 extern HAMLIB_EXPORT(int)
2258 rig_get_split_mode HAMLIB_PARAMS((RIG *rig,
2259  vfo_t vfo,
2260  rmode_t *tx_mode,
2261  pbwidth_t *tx_width));
2262 
2263 extern HAMLIB_EXPORT(int)
2264 rig_set_split_freq_mode HAMLIB_PARAMS((RIG *rig,
2265  vfo_t vfo,
2266  freq_t tx_freq,
2267  rmode_t tx_mode,
2268  pbwidth_t tx_width));
2269 extern HAMLIB_EXPORT(int)
2270 rig_get_split_freq_mode HAMLIB_PARAMS((RIG *rig,
2271  vfo_t vfo,
2272  freq_t *tx_freq,
2273  rmode_t *tx_mode,
2274  pbwidth_t *tx_width));
2275 
2276 extern HAMLIB_EXPORT(int)
2277 rig_set_split_vfo HAMLIB_PARAMS((RIG *,
2278  vfo_t rx_vfo,
2279  split_t split,
2280  vfo_t tx_vfo));
2281 extern HAMLIB_EXPORT(int)
2282 rig_get_split_vfo HAMLIB_PARAMS((RIG *,
2283  vfo_t rx_vfo,
2284  split_t *split,
2285  vfo_t *tx_vfo));
2286 
2287 #define rig_set_split(r,v,s) rig_set_split_vfo((r),(v),(s),RIG_VFO_CURR)
2288 #define rig_get_split(r,v,s) ({ vfo_t _tx_vfo; rig_get_split_vfo((r),(v),(s),&_tx_vfo); })
2289 
2290 extern HAMLIB_EXPORT(int)
2291 rig_set_rit HAMLIB_PARAMS((RIG *rig,
2292  vfo_t vfo,
2293  shortfreq_t rit));
2294 extern HAMLIB_EXPORT(int)
2295 rig_get_rit HAMLIB_PARAMS((RIG *rig,
2296  vfo_t vfo,
2297  shortfreq_t *rit));
2298 
2299 extern HAMLIB_EXPORT(int)
2300 rig_set_xit HAMLIB_PARAMS((RIG *rig,
2301  vfo_t vfo,
2302  shortfreq_t xit));
2303 extern HAMLIB_EXPORT(int)
2304 rig_get_xit HAMLIB_PARAMS((RIG *rig,
2305  vfo_t vfo,
2306  shortfreq_t *xit));
2307 
2308 extern HAMLIB_EXPORT(int)
2309 rig_set_ts HAMLIB_PARAMS((RIG *rig,
2310  vfo_t vfo,
2311  shortfreq_t ts));
2312 extern HAMLIB_EXPORT(int)
2313 rig_get_ts HAMLIB_PARAMS((RIG *rig,
2314  vfo_t vfo,
2315  shortfreq_t *ts));
2316 
2317 extern HAMLIB_EXPORT(int)
2318 rig_power2mW HAMLIB_PARAMS((RIG *rig,
2319  unsigned int *mwpower,
2320  float power,
2321  freq_t freq,
2322  rmode_t mode));
2323 extern HAMLIB_EXPORT(int)
2324 rig_mW2power HAMLIB_PARAMS((RIG *rig,
2325  float *power,
2326  unsigned int mwpower,
2327  freq_t freq,
2328  rmode_t mode));
2329 
2330 extern HAMLIB_EXPORT(shortfreq_t)
2331 rig_get_resolution HAMLIB_PARAMS((RIG *rig,
2332  rmode_t mode));
2333 
2334 extern HAMLIB_EXPORT(int)
2335 rig_set_level HAMLIB_PARAMS((RIG *rig,
2336  vfo_t vfo,
2337  setting_t level,
2338  value_t val));
2339 extern HAMLIB_EXPORT(int)
2340 rig_get_level HAMLIB_PARAMS((RIG *rig,
2341  vfo_t vfo,
2342  setting_t level,
2343  value_t *val));
2344 
2345 #define rig_get_strength(r,v,s) rig_get_level((r),(v),RIG_LEVEL_STRENGTH, (value_t*)(s))
2346 
2347 extern HAMLIB_EXPORT(int)
2348 rig_set_parm HAMLIB_PARAMS((RIG *rig,
2349  setting_t parm,
2350  value_t val));
2351 extern HAMLIB_EXPORT(int)
2352 rig_get_parm HAMLIB_PARAMS((RIG *rig,
2353  setting_t parm,
2354  value_t *val));
2355 
2356 extern HAMLIB_EXPORT(int)
2357 rig_set_conf HAMLIB_PARAMS((RIG *rig,
2358  token_t token,
2359  const char *val));
2360 extern HAMLIB_EXPORT(int)
2361 rig_get_conf HAMLIB_PARAMS((RIG *rig,
2362  token_t token,
2363  char *val));
2364 
2365 extern HAMLIB_EXPORT(int)
2366 rig_set_powerstat HAMLIB_PARAMS((RIG *rig,
2367  powerstat_t status));
2368 extern HAMLIB_EXPORT(int)
2369 rig_get_powerstat HAMLIB_PARAMS((RIG *rig,
2370  powerstat_t *status));
2371 
2372 extern HAMLIB_EXPORT(int)
2373 rig_reset HAMLIB_PARAMS((RIG *rig,
2374  reset_t reset)); /* dangerous! */
2375 
2376 extern HAMLIB_EXPORT(int)
2377 rig_set_ext_level HAMLIB_PARAMS((RIG *rig,
2378  vfo_t vfo,
2379  token_t token,
2380  value_t val));
2381 extern HAMLIB_EXPORT(int)
2382 rig_get_ext_level HAMLIB_PARAMS((RIG *rig,
2383  vfo_t vfo,
2384  token_t token,
2385  value_t *val));
2386 
2387 extern HAMLIB_EXPORT(int)
2388 rig_set_ext_func HAMLIB_PARAMS((RIG *rig,
2389  vfo_t vfo,
2390  token_t token,
2391  int status));
2392 extern HAMLIB_EXPORT(int)
2393 rig_get_ext_func HAMLIB_PARAMS((RIG *rig,
2394  vfo_t vfo,
2395  token_t token,
2396  int *status));
2397 
2398 extern HAMLIB_EXPORT(int)
2399 rig_set_ext_parm HAMLIB_PARAMS((RIG *rig,
2400  token_t token,
2401  value_t val));
2402 extern HAMLIB_EXPORT(int)
2403 rig_get_ext_parm HAMLIB_PARAMS((RIG *rig,
2404  token_t token,
2405  value_t *val));
2406 
2407 extern HAMLIB_EXPORT(int)
2408 rig_ext_func_foreach HAMLIB_PARAMS((RIG *rig,
2409  int (*cfunc)(RIG *,
2410  const struct confparams *,
2411  rig_ptr_t),
2412  rig_ptr_t data));
2413 extern HAMLIB_EXPORT(int)
2414 rig_ext_level_foreach HAMLIB_PARAMS((RIG *rig,
2415  int (*cfunc)(RIG *,
2416  const struct confparams *,
2417  rig_ptr_t),
2418  rig_ptr_t data));
2419 extern HAMLIB_EXPORT(int)
2420 rig_ext_parm_foreach HAMLIB_PARAMS((RIG *rig,
2421  int (*cfunc)(RIG *,
2422  const struct confparams *,
2423  rig_ptr_t),
2424  rig_ptr_t data));
2425 
2426 extern HAMLIB_EXPORT(const struct confparams *)
2427 rig_ext_lookup HAMLIB_PARAMS((RIG *rig,
2428  const char *name));
2429 
2430 extern HAMLIB_EXPORT(const struct confparams *)
2431 rig_ext_lookup_tok HAMLIB_PARAMS((RIG *rig,
2432  token_t token));
2433 extern HAMLIB_EXPORT(token_t)
2434 rig_ext_token_lookup HAMLIB_PARAMS((RIG *rig,
2435  const char *name));
2436 
2437 
2438 extern HAMLIB_EXPORT(int)
2439 rig_token_foreach HAMLIB_PARAMS((RIG *rig,
2440  int (*cfunc)(const struct confparams *,
2441  rig_ptr_t),
2442  rig_ptr_t data));
2443 
2444 extern HAMLIB_EXPORT(const struct confparams *)
2445 rig_confparam_lookup HAMLIB_PARAMS((RIG *rig,
2446  const char *name));
2447 extern HAMLIB_EXPORT(token_t)
2448 rig_token_lookup HAMLIB_PARAMS((RIG *rig,
2449  const char *name));
2450 
2451 extern HAMLIB_EXPORT(int)
2452 rig_close HAMLIB_PARAMS((RIG *rig));
2453 
2454 extern HAMLIB_EXPORT(int)
2455 rig_cleanup HAMLIB_PARAMS((RIG *rig));
2456 
2457 extern HAMLIB_EXPORT(int)
2458 rig_set_ant HAMLIB_PARAMS((RIG *rig,
2459  vfo_t vfo,
2460  ant_t ant, /* antenna */
2461  value_t option)); /* optional ant info */
2462 extern HAMLIB_EXPORT(int)
2463 rig_get_ant HAMLIB_PARAMS((RIG *rig,
2464  vfo_t vfo,
2465  ant_t ant,
2466  value_t *option,
2467  ant_t *ant_curr,
2468  ant_t *ant_tx,
2469  ant_t *ant_rx));
2470 
2471 extern HAMLIB_EXPORT(setting_t)
2472 rig_has_get_level HAMLIB_PARAMS((RIG *rig,
2473  setting_t level));
2474 extern HAMLIB_EXPORT(setting_t)
2475 rig_has_set_level HAMLIB_PARAMS((RIG *rig,
2476  setting_t level));
2477 
2478 extern HAMLIB_EXPORT(setting_t)
2479 rig_has_get_parm HAMLIB_PARAMS((RIG *rig,
2480  setting_t parm));
2481 extern HAMLIB_EXPORT(setting_t)
2482 rig_has_set_parm HAMLIB_PARAMS((RIG *rig,
2483  setting_t parm));
2484 
2485 extern HAMLIB_EXPORT(setting_t)
2486 rig_has_get_func HAMLIB_PARAMS((RIG *rig,
2487  setting_t func));
2488 extern HAMLIB_EXPORT(setting_t)
2489 rig_has_set_func HAMLIB_PARAMS((RIG *rig,
2490  setting_t func));
2491 
2492 extern HAMLIB_EXPORT(int)
2493 rig_set_func HAMLIB_PARAMS((RIG *rig,
2494  vfo_t vfo,
2495  setting_t func,
2496  int status));
2497 extern HAMLIB_EXPORT(int)
2498 rig_get_func HAMLIB_PARAMS((RIG *rig,
2499  vfo_t vfo,
2500  setting_t func,
2501  int *status));
2502 
2503 extern HAMLIB_EXPORT(int)
2504 rig_send_dtmf HAMLIB_PARAMS((RIG *rig,
2505  vfo_t vfo,
2506  const char *digits));
2507 extern HAMLIB_EXPORT(int)
2508 rig_recv_dtmf HAMLIB_PARAMS((RIG *rig,
2509  vfo_t vfo,
2510  char *digits,
2511  int *length));
2512 
2513 extern HAMLIB_EXPORT(int)
2514 rig_send_morse HAMLIB_PARAMS((RIG *rig,
2515  vfo_t vfo,
2516  const char *msg));
2517 
2518 extern HAMLIB_EXPORT(int)
2519 rig_stop_morse HAMLIB_PARAMS((RIG *rig,
2520  vfo_t vfo));
2521 
2522 extern HAMLIB_EXPORT(int)
2523 rig_wait_morse HAMLIB_PARAMS((RIG *rig,
2524  vfo_t vfo));
2525 
2526 extern HAMLIB_EXPORT(int)
2527 rig_send_voice_mem HAMLIB_PARAMS((RIG *rig,
2528  vfo_t vfo,
2529  int ch));
2530 
2531 extern HAMLIB_EXPORT(int)
2532 rig_set_bank HAMLIB_PARAMS((RIG *rig,
2533  vfo_t vfo,
2534  int bank));
2535 
2536 extern HAMLIB_EXPORT(int)
2537 rig_set_mem HAMLIB_PARAMS((RIG *rig,
2538  vfo_t vfo,
2539  int ch));
2540 extern HAMLIB_EXPORT(int)
2541 rig_get_mem HAMLIB_PARAMS((RIG *rig,
2542  vfo_t vfo,
2543  int *ch));
2544 
2545 extern HAMLIB_EXPORT(int)
2546 rig_vfo_op HAMLIB_PARAMS((RIG *rig,
2547  vfo_t vfo,
2548  vfo_op_t op));
2549 
2550 extern HAMLIB_EXPORT(vfo_op_t)
2551 rig_has_vfo_op HAMLIB_PARAMS((RIG *rig,
2552  vfo_op_t op));
2553 
2554 extern HAMLIB_EXPORT(int)
2555 rig_scan HAMLIB_PARAMS((RIG *rig,
2556  vfo_t vfo,
2557  scan_t scan,
2558  int ch));
2559 
2560 extern HAMLIB_EXPORT(scan_t)
2561 rig_has_scan HAMLIB_PARAMS((RIG *rig,
2562  scan_t scan));
2563 
2564 extern HAMLIB_EXPORT(int)
2565 rig_set_channel HAMLIB_PARAMS((RIG *rig,
2566  const channel_t *chan)); /* mem */
2567 extern HAMLIB_EXPORT(int)
2568 rig_get_channel HAMLIB_PARAMS((RIG *rig,
2569  channel_t *chan, int read_only));
2570 
2571 extern HAMLIB_EXPORT(int)
2572 rig_set_chan_all HAMLIB_PARAMS((RIG *rig,
2573  const channel_t chans[]));
2574 extern HAMLIB_EXPORT(int)
2575 rig_get_chan_all HAMLIB_PARAMS((RIG *rig,
2576  channel_t chans[]));
2577 
2578 extern HAMLIB_EXPORT(int)
2579 rig_set_chan_all_cb HAMLIB_PARAMS((RIG *rig,
2580  chan_cb_t chan_cb,
2581  rig_ptr_t));
2582 extern HAMLIB_EXPORT(int)
2583 rig_get_chan_all_cb HAMLIB_PARAMS((RIG *rig,
2584  chan_cb_t chan_cb,
2585  rig_ptr_t));
2586 
2587 extern HAMLIB_EXPORT(int)
2588 rig_set_mem_all_cb HAMLIB_PARAMS((RIG *rig,
2589  chan_cb_t chan_cb,
2590  confval_cb_t parm_cb,
2591  rig_ptr_t));
2592 extern HAMLIB_EXPORT(int)
2593 rig_get_mem_all_cb HAMLIB_PARAMS((RIG *rig,
2594  chan_cb_t chan_cb,
2595  confval_cb_t parm_cb,
2596  rig_ptr_t));
2597 
2598 extern HAMLIB_EXPORT(int)
2599 rig_set_mem_all HAMLIB_PARAMS((RIG *rig,
2600  const channel_t *chan,
2601  const struct confparams *,
2602  const value_t *));
2603 extern HAMLIB_EXPORT(int)
2604 rig_get_mem_all HAMLIB_PARAMS((RIG *rig,
2605  channel_t *chan,
2606  const struct confparams *,
2607  value_t *));
2608 
2609 extern HAMLIB_EXPORT(const chan_t *)
2610 rig_lookup_mem_caps HAMLIB_PARAMS((RIG *rig,
2611  int ch));
2612 
2613 extern HAMLIB_EXPORT(int)
2614 rig_mem_count HAMLIB_PARAMS((RIG *rig));
2615 
2616 extern HAMLIB_EXPORT(int)
2617 rig_set_trn HAMLIB_PARAMS((RIG *rig,
2618  int trn));
2619 extern HAMLIB_EXPORT(int)
2620 rig_get_trn HAMLIB_PARAMS((RIG *rig,
2621  int *trn));
2622 
2623 extern HAMLIB_EXPORT(int)
2624 rig_set_freq_callback HAMLIB_PARAMS((RIG *,
2625  freq_cb_t,
2626  rig_ptr_t));
2627 
2628 extern HAMLIB_EXPORT(int)
2629 rig_set_mode_callback HAMLIB_PARAMS((RIG *,
2630  mode_cb_t,
2631  rig_ptr_t));
2632 extern HAMLIB_EXPORT(int)
2633 rig_set_vfo_callback HAMLIB_PARAMS((RIG *,
2634  vfo_cb_t,
2635  rig_ptr_t));
2636 
2637 extern HAMLIB_EXPORT(int)
2638 rig_set_ptt_callback HAMLIB_PARAMS((RIG *,
2639  ptt_cb_t,
2640  rig_ptr_t));
2641 
2642 extern HAMLIB_EXPORT(int)
2643 rig_set_dcd_callback HAMLIB_PARAMS((RIG *,
2644  dcd_cb_t,
2645  rig_ptr_t));
2646 
2647 extern HAMLIB_EXPORT(int)
2648 rig_set_pltune_callback HAMLIB_PARAMS((RIG *,
2649  pltune_cb_t,
2650  rig_ptr_t));
2651 
2652 extern HAMLIB_EXPORT(int)
2653 rig_set_twiddle HAMLIB_PARAMS((RIG *rig,
2654  int seconds));
2655 
2656 extern HAMLIB_EXPORT(int)
2657 rig_get_twiddle HAMLIB_PARAMS((RIG *rig,
2658  int *seconds));
2659 
2660 extern HAMLIB_EXPORT(int)
2661 rig_set_uplink HAMLIB_PARAMS((RIG *rig,
2662  int val));
2663 
2664 
2665 extern HAMLIB_EXPORT(const char *)
2666 rig_get_info HAMLIB_PARAMS((RIG *rig));
2667 
2668 extern HAMLIB_EXPORT(const struct rig_caps *)
2669 rig_get_caps HAMLIB_PARAMS((rig_model_t rig_model));
2670 
2671 extern HAMLIB_EXPORT(const freq_range_t *)
2672 rig_get_range HAMLIB_PARAMS((const freq_range_t *range_list,
2673  freq_t freq,
2674  rmode_t mode));
2675 
2676 extern HAMLIB_EXPORT(pbwidth_t)
2677 rig_passband_normal HAMLIB_PARAMS((RIG *rig,
2678  rmode_t mode));
2679 extern HAMLIB_EXPORT(pbwidth_t)
2680 rig_passband_narrow HAMLIB_PARAMS((RIG *rig,
2681  rmode_t mode));
2682 extern HAMLIB_EXPORT(pbwidth_t)
2683 rig_passband_wide HAMLIB_PARAMS((RIG *rig,
2684  rmode_t mode));
2685 
2686 extern HAMLIB_EXPORT(const char *)
2687 rigerror HAMLIB_PARAMS((int errnum));
2688 
2689 extern HAMLIB_EXPORT(int)
2690 rig_setting2idx HAMLIB_PARAMS((setting_t s));
2691 
2692 extern HAMLIB_EXPORT(setting_t)
2693 rig_idx2setting(int i);
2694 /*
2695  * Even if these functions are prefixed with "rig_", they are not rig specific
2696  * Maybe "hamlib_" would have been better. Let me know. --SF
2697  */
2698 extern HAMLIB_EXPORT(void)
2699 rig_set_debug HAMLIB_PARAMS((enum rig_debug_level_e debug_level));
2700 
2701 extern HAMLIB_EXPORT(void)
2702 rig_set_debug_time_stamp HAMLIB_PARAMS((int flag));
2703 
2704 #define rig_set_debug_level(level) rig_set_debug(level)
2705 
2706 extern HAMLIB_EXPORT(int)
2707 rig_need_debug HAMLIB_PARAMS((enum rig_debug_level_e debug_level));
2708 
2709 
2710 
2711 #ifndef __cplusplus
2712 #ifdef __GNUC__
2713 // doing the debug macro with a dummy sprintf allows gcc to check the format string
2714 #define rig_debug(debug_level,fmt,...) { char xxxbuf[16384]="";snprintf(xxxbuf,sizeof(xxxbuf),fmt,__VA_ARGS__);rig_debug(debug_level,fmt,##__VA_ARGS__); }
2715 #endif
2716 #endif
2717 extern HAMLIB_EXPORT(void)
2718 rig_debug HAMLIB_PARAMS((enum rig_debug_level_e debug_level,
2719  const char *fmt, ...));
2720 
2721 extern HAMLIB_EXPORT(vprintf_cb_t)
2722 rig_set_debug_callback HAMLIB_PARAMS((vprintf_cb_t cb,
2723  rig_ptr_t arg));
2724 
2725 extern HAMLIB_EXPORT(FILE *)
2726 rig_set_debug_file HAMLIB_PARAMS((FILE *stream));
2727 
2728 extern HAMLIB_EXPORT(int)
2729 rig_register HAMLIB_PARAMS((const struct rig_caps *caps));
2730 
2731 extern HAMLIB_EXPORT(int)
2732 rig_unregister HAMLIB_PARAMS((rig_model_t rig_model));
2733 
2734 extern HAMLIB_EXPORT(int)
2735 rig_list_foreach HAMLIB_PARAMS((int (*cfunc)(const struct rig_caps *, rig_ptr_t),
2736  rig_ptr_t data));
2737 
2738 extern HAMLIB_EXPORT(int)
2739 rig_load_backend HAMLIB_PARAMS((const char *be_name));
2740 
2741 extern HAMLIB_EXPORT(int)
2742 rig_check_backend HAMLIB_PARAMS((rig_model_t rig_model));
2743 
2744 extern HAMLIB_EXPORT(int)
2745 rig_load_all_backends HAMLIB_PARAMS((void));
2746 
2747 typedef int (*rig_probe_func_t)(const hamlib_port_t *, rig_model_t, rig_ptr_t);
2748 
2749 extern HAMLIB_EXPORT(int)
2750 rig_probe_all HAMLIB_PARAMS((hamlib_port_t *p,
2751  rig_probe_func_t,
2752  rig_ptr_t));
2753 
2754 extern HAMLIB_EXPORT(rig_model_t)
2755 rig_probe HAMLIB_PARAMS((hamlib_port_t *p));
2756 
2757 
2758 /* Misc calls */
2759 extern HAMLIB_EXPORT(const char *) rig_strrmode(rmode_t mode);
2760 extern HAMLIB_EXPORT(int) rig_strrmodes(rmode_t modes, char *buf, int buflen);
2761 extern HAMLIB_EXPORT(const char *) rig_strvfo(vfo_t vfo);
2762 extern HAMLIB_EXPORT(const char *) rig_strfunc(setting_t);
2763 extern HAMLIB_EXPORT(const char *) rig_strlevel(setting_t);
2764 extern HAMLIB_EXPORT(const char *) rig_strparm(setting_t);
2765 extern HAMLIB_EXPORT(const char *) rig_strptrshift(rptr_shift_t);
2766 extern HAMLIB_EXPORT(const char *) rig_strvfop(vfo_op_t op);
2767 extern HAMLIB_EXPORT(const char *) rig_strscan(scan_t scan);
2768 extern HAMLIB_EXPORT(const char *) rig_strstatus(enum rig_status_e status);
2769 extern HAMLIB_EXPORT(const char *) rig_strmtype(chan_type_t mtype);
2770 
2771 extern HAMLIB_EXPORT(rmode_t) rig_parse_mode(const char *s);
2772 extern HAMLIB_EXPORT(vfo_t) rig_parse_vfo(const char *s);
2773 extern HAMLIB_EXPORT(setting_t) rig_parse_func(const char *s);
2774 extern HAMLIB_EXPORT(setting_t) rig_parse_level(const char *s);
2775 extern HAMLIB_EXPORT(setting_t) amp_parse_level(const char *s);
2776 extern HAMLIB_EXPORT(setting_t) rig_parse_parm(const char *s);
2777 extern HAMLIB_EXPORT(vfo_op_t) rig_parse_vfo_op(const char *s);
2778 extern HAMLIB_EXPORT(scan_t) rig_parse_scan(const char *s);
2779 extern HAMLIB_EXPORT(rptr_shift_t) rig_parse_rptr_shift(const char *s);
2780 extern HAMLIB_EXPORT(chan_type_t) rig_parse_mtype(const char *s);
2781 
2782 extern HAMLIB_EXPORT(const char *) rig_license HAMLIB_PARAMS(());
2783 extern HAMLIB_EXPORT(const char *) rig_version HAMLIB_PARAMS(());
2784 extern HAMLIB_EXPORT(const char *) rig_copyright HAMLIB_PARAMS(());
2785 
2786 extern HAMLIB_EXPORT(void) rig_no_restore_ai();
2787 
2788 extern HAMLIB_EXPORT(int) rig_get_cache_timeout_ms(RIG *rig, hamlib_cache_t selection);
2789 extern HAMLIB_EXPORT(int) rig_set_cache_timeout_ms(RIG *rig, hamlib_cache_t selection, int ms);
2790 
2791 extern HAMLIB_EXPORT(int) rig_set_vfo_opt(RIG *rig, int status);
2792 
2793 
2794 typedef unsigned long rig_useconds_t;
2795 extern HAMLIB_EXPORT(int) hl_usleep(rig_useconds_t msec);
2796 
2798 
2799 __END_DECLS
2800 
2801 #endif /* _RIG_H */
2802 
Definition: rig.h:587
const char * rig_strstatus(enum rig_status_e status)
Convert enum RIG_STATUS_... to printable string.
Definition: misc.c:288
int rig_get_conf(RIG *rig, token_t token, char *val)
get the value of a configuration parameter
Definition: conf.c:1134
scan_t rig_has_scan(RIG *rig, scan_t scan)
check availability of scanning functions
Definition: rig.c:4825
setting_t funcs
Definition: rig.h:1390
Definition: rig.h:577
Definition: rig.h:909
int rig_get_mem_all_cb(RIG *rig, 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:1387
int rig_get_mem(RIG *rig, vfo_t vfo, int *ch)
get the current memory channel number
Definition: mem.c:135
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:583
vfo_cb_t vfo_event
Definition: rig.h:2101
int auto_power_on
Definition: rig.h:2049
rig_debug_level_e
Hamlib debug levels.
Definition: rig.h:153
struct rig_callbacks callbacks
Definition: rig.h:2125
value_t step
Definition: rig.h:1481
Definition: rig.h:911
unsigned tuning_step
Definition: rig.h:1387
Definition: rig.h:910
Definition: rig.h:946
unsigned channel_desc
Definition: rig.h:1398
Definition: rig.h:531
Definition: rig.h:868
unsigned tx_vfo
Definition: rig.h:1384
token_t rig_ext_token_lookup(RIG *rig, const char *name)
Simple lookup returning token id associated with name.
Definition: ext.c:327
int rig_set_uplink(RIG *rig, int val)
For GPredict to avoid reading frequency on uplink VFO.
Definition: rig.c:1194
setting_t rig_has_get_level(RIG *rig, setting_t level)
check retrieval ability of level settings
Definition: settings.c:302
Definition: rig.h:323
setting_t has_set_func
Definition: rig.h:2011
struct ext_list * ext_levels
Definition: rig.h:1357
int raw
Definition: rig.h:1496
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
double freq_t
Frequency type,.
Definition: rig.h:333
Definition: rig.h:155
struct cal_table_float::@16 table[MAX_CAL_LENGTH]
int rig_get_dcd(RIG *rig, vfo_t vfo, dcd_t *dcd)
get the status of the DCD
Definition: rig.c:2684
const char * rigerror(int errnum)
get string describing the error code
Definition: rig.c:290
Definition: rig.h:888
value_t min
Definition: rig.h:1479
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:647
unsigned bank_num
Definition: rig.h:1372
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
Definition: rig.h:534
int rig_set_dcs_code(RIG *rig, vfo_t vfo, tone_t code)
set the current encoding DCS code
Definition: tones.c:230
Filter definition.
Definition: rig.h:1278
vfo_t tx_vfo
Definition: rig.h:2037
float f
Definition: rig.h:829
int rig_set_vfo(RIG *rig, vfo_t vfo)
set the current VFO
Definition: rig.c:2071
long token_t
configuration token
Definition: rig.h:652
scan_t
Rig Scan operation.
Definition: rig.h:636
Definition: rig.h:901
Definition: rig.h:537
Definition: rig.h:887
union confparams::@12 u
float step
Definition: rig.h:702
setting_t amp_parse_level(const char *s)
Convert alpha string to enum AMP_LEVEL_...
Definition: misc.c:739
shortfreq_t xit
Definition: rig.h:1347
Definition: rig.h:1421
Definition: rig.h:261
unsigned tx_width
Definition: rig.h:1381
pbwidth_t tx_width
Definition: rig.h:1338
Definition: rig.h:611
Definition: rig.h:890
Definition: rig.h:560
Definition: rig.h:214
int low_power
Definition: rig.h:1215
Definition: rig.h:943
const char * dflt
Definition: rig.h:696
int rig_send_morse(RIG *rig, vfo_t vfo, const char *msg)
send morse code
Definition: rig.c:5060
const char * cs
Definition: rig.h:831
rig_ptr_t pltune_arg
Definition: rig.h:2108
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_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:4461
freq_t endf
Definition: rig.h:1213
shortfreq_t max_ifshift
Definition: rig.h:2003
Definition: rig.h:123
Definition: rig.h:898
pbwidth_t rig_passband_wide(RIG *rig, rmode_t mode)
get the wide passband of a mode
Definition: rig.c:2018
int uplink
Definition: rig.h:2046
Definition: rig.h:894
Definition: rig.h:876
gran_t level_gran[64]
Definition: rig.h:2017
vfo_t vfo
Definition: rig.h:1330
Definition: rig.h:230
Definition: rig.h:871
Definition: rig.h:297
unsigned rptr_offs
Definition: rig.h:1386
const char * rig_strlevel(setting_t level)
Convert enum RIG_LEVEL_... to alpha string.
Definition: misc.c:770
Definition: rig.h:130
int rig_set_bank(RIG *rig, vfo_t vfo, int bank)
set the current memory bank
Definition: mem.c:198
int rig_scan(RIG *rig, vfo_t vfo, scan_t scan, int ch)
perform Memory/VFO operations
Definition: rig.c:4854
Definition: rig.h:295
Definition: rig.h:850
Definition: rig.h:546
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_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:4405
Definition: rig.h:883
rig_parm_e
Rig Parameters.
Definition: rig.h:938
Tuning step definition.
Definition: rig.h:1243
Definition: rig.h:294
int rig_get_xit(RIG *rig, vfo_t vfo, shortfreq_t *xit)
get the current XIT offset
Definition: rig.c:4047
setting_t rig_has_set_level(RIG *rig, setting_t level)
check settable ability of level settings
Definition: settings.c:361
vfo_op_t rig_has_vfo_op(RIG *rig, vfo_op_t op)
check retrieval ability of VFO operations
Definition: rig.c:4727
int rig_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt)
set PTT on/off
Definition: rig.c:2244
Definition: rig.h:675
int rig_set_trn(RIG *rig, int trn)
control the transceive mode
Definition: event.c:707
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
Frequency range.
Definition: rig.h:1211
ann_t announces
Definition: rig.h:2005
Calibration table struct for float values.
Definition: rig.h:1523
Definition: rig.h:135
Definition: rig.h:121
const char * rig_strparm(setting_t parm)
Convert enum RIG_PARM_... to alpha string.
Definition: misc.c:872
Definition: rig.h:211
int rig_set_conf(RIG *rig, token_t token, const char *val)
set a radio configuration parameter
Definition: conf.c:1081
powerstat_t
Radio power state.
Definition: rig.h:574
int rig_set_ext_func(RIG *rig, vfo_t vfo, token_t token, int status)
set a radio function extra parameter
Definition: settings.c:778
Definition: rig.h:680
Definition: rig.h:124
int startc
Definition: rig.h:1444
Definition: rig.h:217
value_t levels[64]
Definition: rig.h:1349
int vfo_list
Definition: rig.h:2027
Definition: rig.h:886
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
signed long shortfreq_t
Short frequency type.
Definition: rig.h:355
void rig_set_debug(enum rig_debug_level_e debug_level)
Change the current debug level.
Definition: debug.c:123
chan_type_t rig_parse_mtype(const char *s)
Convert alpha string to enum RIG_MTYPE_...
Definition: misc.c:1117
unsigned flags
Definition: rig.h:1397
char channel_desc[MAXCHANDESC]
Definition: rig.h:1356
setting_t has_get_func
Definition: rig.h:2010
signed int i
Definition: rig.h:828
int rig_set_mem_all_cb(RIG *rig, 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:1320
pbwidth_t current_width
Definition: rig.h:2036
setting_t has_get_parm
Definition: rig.h:2014
Definition: rig.h:265
Definition: rig.h:216
Definition: rig.h:945
int rig_get_ext_parm(RIG *rig, token_t token, value_t *val)
get the value of a parm extra parameter
Definition: settings.c:941
const chan_t * rig_lookup_mem_caps(RIG *rig, int ch)
lookup the memory type and capabilities
Definition: mem.c:1577
freq_t freq
Definition: rig.h:1332
setting_t rig_has_set_func(RIG *rig, setting_t func)
check ability of radio functions
Definition: settings.c:479
hamlib_port_t port_t
Rig data structure.
Definition: rig.h:1910
Definition: rig.h:296
rig_ptr_t ptt_arg
Definition: rig.h:2104
Definition: rig.h:912
uint64_t rig_idx2setting(int i)
Definition: misc.c:582
int power_max
Definition: rig.h:2057
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
setting_t rig_parse_func(const char *s)
Convert alpha string to enum RIG_FUNC_...
Definition: misc.c:594
pbwidth_t width
Definition: rig.h:1334
rmode_t mode
Definition: rig.h:1333
Definition: rig.h:645
Definition: rig.h:858
shortfreq_t tuning_step
Definition: rig.h:1345
unsigned int tone_t
CTCSS and DCS type definition.
Definition: rig.h:199
freq_t current_freq
Definition: rig.h:2034
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:4328
int rig_probe_all(hamlib_port_t *port, rig_probe_func_t cfunc, rig_ptr_t data)
try to guess rigs
Definition: rig.c:4696
float val
Definition: rig.h:1527
Definition: rig.h:324
freq_t startf
Definition: rig.h:1212
Definition: rig.h:549
int rig_send_dtmf(RIG *rig, vfo_t vfo, const char *digits)
send DTMF digits
Definition: rig.c:4923
serial_handshake_e
Serial handshake.
Definition: rig.h:238
int high_power
Definition: rig.h:1216
Definition: rig.h:567
Definition: rig.h:723
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:3297
Definition: rig.h:239
Definition: rig.h:857
int rig_set_func(RIG *rig, vfo_t vfo, setting_t func, int status)
activate/de-activate functions of radio
Definition: settings.c:510
Definition: rig.h:260
unsigned vfo
Definition: rig.h:1373
Definition: rig.h:564
unsigned mode
Definition: rig.h:1376
const char * rig_strvfo(vfo_t vfo)
Convert enum RIG_VFO_... to alpha string.
Definition: misc.c:508
shortfreq_t pbwidth_t
Definition: rig.h:512
int ptt_share
Definition: rig.h:2054
Definition: rig.h:215
Definition: rig.h:218
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
Channel capability definition.
Definition: rig.h:1371
Definition: rig.h:940
Definition: rig.h:136
int rig_set_ctcss_sql(RIG *rig, vfo_t vfo, tone_t tone)
set CTCSS squelch
Definition: tones.c:362
Definition: rig.h:547
shortfreq_t rig_get_resolution(RIG *rig, rmode_t mode)
get the best frequency resolution of the rig
Definition: rig.c:4519
Channel structure.
Definition: rig.h:1327
Definition: rig.h:262
Definition: rig.h:895
Definition: rig.h:579
Definition: rig.h:1424
vfo_op_t
VFO operation.
Definition: rig.h:610
Definition: rig.h:618
rptr_shift_t
Repeater shift type.
Definition: rig.h:312
Definition: rig.h:250
int size
Definition: rig.h:1494
int power_now
Definition: rig.h:2055
const char * rig_license()
get the Hamlib license
Definition: rig.c:5425
Definition: rig.h:638
int rig_wait_morse(RIG *rig, vfo_t vfo)
wait morse code
Definition: rig.c:5221
int rig_setting2idx(setting_t s)
basically convert setting_t expressed 2^n to n
Definition: settings.c:968
const char * rig_strfunc(setting_t func)
Convert enum RIG_FUNC_... to alpha string.
Definition: misc.c:619
int rig_set_vfo_opt(RIG *rig, int status)
set the vfo option for rigctld
Definition: rig.c:5380
Extension attribute definition.
Definition: rig.h:1310
Definition: rig.h:520
const struct confparams * rig_ext_lookup_tok(RIG *rig, token_t token)
lookup ext token, return pointer to confparams struct.
Definition: ext.c:283
Definition: rig.h:861
int rig_set_xit(RIG *rig, vfo_t vfo, shortfreq_t xit)
set the XIT
Definition: rig.c:3979
int rig_set_chan_all(RIG *rig, const channel_t chans[])
set all channel data
Definition: mem.c:1165
Definition: rig.h:891
setting_t rig_has_get_parm(RIG *rig, setting_t parm)
check retrieval ability of parameter settings
Definition: settings.c:391
Universal approach for passing values.
Definition: rig.h:827
Definition: rig.h:126
Definition: rig.h:676
Definition: rig.h:566
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:3409
Definition: rig.h:867
const char * rig_strptrshift(rptr_shift_t shift)
convert enum RIG_RPT_SHIFT_... to printable character
Definition: misc.c:1049
vfo_t rig_parse_vfo(const char *s)
Convert alpha string to enum RIG_VFO_...
Definition: misc.c:483
const char * rig_strscan(scan_t rscan)
Convert enum RIG_SCAN_... to alpha string.
Definition: misc.c:1020
setting_t has_set_parm
Definition: rig.h:2015
Definition: rig.h:860
Definition: rig.h:613
void rig_set_debug_time_stamp(int flag)
Enbable/disable time stamp on debug output.
Definition: debug.c:142
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:5345
int hl_usleep(rig_useconds_t usec)
provide sleep and usleep replacements
Definition: sleep.c:53
unsigned ant
Definition: rig.h:1374
freq_cb_t freq_event
Definition: rig.h:2097
vfo_t current_vfo
Definition: rig.h:2026
rig_ptr_t dcd_arg
Definition: rig.h:2106
int rig_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt)
get the status of the PTT
Definition: rig.c:2447
Definition: rig.h:916
hamlib_port_t pttport
Definition: rig.h:1984
struct tuning_step_list tuning_steps[TSLSTSIZ]
Definition: rig.h:1993
The Rig structure.
Definition: rig.h:2122
dcd_type_t
DCD type.
Definition: rig.h:529
int rig_reset(RIG *rig, reset_t reset)
reset the radio
Definition: rig.c:4625
token_t token
Definition: rig.h:1311
rmode_t modes
Definition: rig.h:1214
pltune_cb_t pltune
Definition: rig.h:2107
Definition: rig.h:264
tone_t dcs_code
Definition: rig.h:1352
char * s
Definition: rig.h:830
int raw
Definition: rig.h:1526
setting_t rig_has_set_parm(RIG *rig, setting_t parm)
check settable ability of parameter settings
Definition: settings.c:420
meter_level_e
Level display meters.
Definition: rig.h:810
freq_range_t rx_range_list[FRQRANGESIZ]
Definition: rig.h:1990
chan_type_t
Memory channel type definition.
Definition: rig.h:1418
setting_t has_set_level
Definition: rig.h:2013
Definition: rig.h:154
Definition: rig.h:536
Definition: rig.h:856
int channel_num
Definition: rig.h:1328
setting_t rig_has_get_func(RIG *rig, setting_t func)
check ability of radio functions
Definition: settings.c:449
Definition: rig.h:259
rig_status_e
Development status of the backend.
Definition: rig.h:292
Definition: rig.h:213
Definition: rig.h:1425
const char * rig_copyright()
get the Hamlib copyright
Definition: rig.c:5445
int rig_set_ext_parm(RIG *rig, token_t token, value_t val)
set a radio parm extra parameter
Definition: settings.c:909
const struct confparams * rig_confparam_lookup(RIG *rig, const char *name)
lookup a confparam struct
Definition: conf.c:994
Definition: rig.h:313
int rig_set_mem_all(RIG *rig, const channel_t chans[], const struct confparams cfgps[], const value_t vals[])
set all channel and non-channel data
Definition: mem.c:1452
Definition: rig.h:855
Definition: rig.h:133
Definition: rig.h:947
Definition: rig.h:866
Definition: rig.h:132
shortfreq_t max_rit
Definition: rig.h:2001
Definition: rig.h:1423
Definition: rig.h:589
Definition: rig.h:1426
rmode_t modes
Definition: rig.h:1244
scan_t rig_parse_scan(const char *s)
Convert alpha string to enum RIG_SCAN_...
Definition: misc.c:995
Definition: rig.h:268
Definition: rig.h:519
int rig_set_mem(RIG *rig, vfo_t vfo, int ch)
set the current memory channel number
Definition: mem.c:72
struct rig_state state
Definition: rig.h:2124
int poll_interval
Definition: rig.h:2033
Definition: rig.h:561
Definition: rig.h:798
Definition: rig.h:623
struct cal_table::@15 table[MAX_CAL_LENGTH]
unsigned split
Definition: rig.h:1383
int rig_open(RIG *rig)
open the communication to the rig
Definition: rig.c:553
Definition: rig.h:718
unsigned rit
Definition: rig.h:1388
int rig_get_dcs_sql(RIG *rig, vfo_t vfo, tone_t *code)
get the current DCS code
Definition: tones.c:553
Definition: rig.h:904
agc_level_e
AGC delay settings.
Definition: rig.h:793
int transmit
Definition: rig.h:2039
Definition: rig.h:614
Definition: rig.h:591
Rig state containing live data and customized fields.
Definition: rig.h:1979
Definition: rig.h:532
shortfreq_t rit
Definition: rig.h:1346
int hold_decode
Definition: rig.h:2025
Definition: rig.h:897
Definition: rig.h:616
Definition: rig.h:722
Definition: rig.h:125
int transceive
Definition: rig.h:2032
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
time_t twiddle_time
Definition: rig.h:2043
Definition: rig.h:590
Definition: rig.h:157
Definition: rig.h:643
struct rig_caps * caps
Definition: rig.h:2123
Definition: rig.h:864
Definition: rig.h:575
Definition: rig.h:906
ann_t
Announce.
Definition: rig.h:716
int preamp[MAXDBLSTSIZ]
Definition: rig.h:2007
int rig_get_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t *rptr_shift)
get the current repeater shift
Definition: rig.c:2857
rig_level_e
Rig Level Settings.
Definition: rig.h:849
int rig_cleanup(RIG *rig)
release a rig handle and free associated memory
Definition: rig.c:1125
RIG * rig_init(rig_model_t rig_model)
allocate a new RIG handle
Definition: rig.c:316
Definition: rig.h:678
pbwidth_t rig_passband_normal(RIG *rig, rmode_t mode)
get the normal passband of a mode
Definition: rig.c:1926
Definition: rig.h:134
Definition: rig.h:266
Definition: rig.h:854
setting_t rig_parse_parm(const char *s)
Convert alpha string to RIG_PARM_...
Definition: misc.c:847
unsigned xit
Definition: rig.h:1389
Definition: rig.h:913
int rig_set_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t rptr_shift)
set the repeater shift
Definition: rig.c:2789
Definition: rig.h:208
Definition: rig.h:314
#define RIG_SETTING_MAX
Maximum # of rig settings.
Definition: rig.h:970
unsigned int ant_t
Antenna typedef.
Definition: rig.h:773
char * label
Definition: rig.h:1219
setting_t rig_parse_level(const char *s)
Convert alpha string to enum RIG_LEVEL_...
Definition: misc.c:715
int rig_set_twiddle(RIG *rig, int seconds)
timeout (secs) to stop rigctld when VFO is manually changed
Definition: rig.c:1169
const char * name
Definition: rig.h:693
Definition: rig.h:899
int scan_group
Definition: rig.h:1354
struct confparams::@12::@13 n
Definition: rig.h:879
rig_ptr_t mode_arg
Definition: rig.h:2100
Definition: rig.h:851
int rig_set_parm(RIG *rig, setting_t parm, value_t val)
set a radio parameter
Definition: settings.c:234
Definition: rig.h:212
reset_t
Reset operation.
Definition: rig.h:586
int rig_get_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t *rptr_offs)
get the current repeater offset
Definition: rig.c:2993
int rig_send_voice_mem(RIG *rig, vfo_t vfo, int ch)
send voice memory content
Definition: rig.c:5278
Definition: rig.h:137
Definition: rig.h:229
Definition: rig.h:882
rig_errcode_e
Hamlib error codes Error code definition that can be returned by the Hamlib functions....
Definition: rig.h:119
Definition: rig.h:873
Definition: rig.h:905
Definition: rig.h:939
token_t token
Definition: rig.h:692
Rig cache data.
Definition: rig.h:1931
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
rig_conf_e
parameter types
Definition: rig.h:674
Definition: rig.h:617
rmode_t mode_list
Definition: rig.h:2038
struct confparams::@12::@14 c
enum rig_port_e rig_port_t
Port type.
setting_t levels
Definition: rig.h:1391
rmode_t tx_mode
Definition: rig.h:1337
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
int rig_set_dcs_sql(RIG *rig, vfo_t vfo, tone_t code)
set the current DCS code
Definition: tones.c:491
unsigned ctcss_tone
Definition: rig.h:1392
ptt_type_t
PTT type.
Definition: rig.h:558
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:3588
Definition: rig.h:677
setting_t funcs
Definition: rig.h:1348
int rig_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option)
set the antenna
Definition: rig.c:4256
Definition: rig.h:251
int rig_recv_dtmf(RIG *rig, vfo_t vfo, char *digits, int *length)
receive DTMF digits
Definition: rig.c:4992
Calibration table struct.
Definition: rig.h:1493
Definition: rig.h:720
Definition: rig.h:120
serial_parity_e
Serial parity.
Definition: rig.h:226
const char * hamlib_copyright2
Hamlib copyright notice.
Definition: rig.c:94
int vfo_opt
Definition: rig.h:2048
int rig_get_parm(RIG *rig, setting_t parm, value_t *val)
get the value of a parameter
Definition: settings.c:268
Definition: rig.h:612
int size
Definition: rig.h:1524
gran_t parm_gran[64]
Definition: rig.h:2018
Definition: rig.h:885
tone_t ctcss_tone
Definition: rig.h:1350
value_t val
Definition: rig.h:1312
setting_t has_get_level
Definition: rig.h:2012
Definition: rig.h:129
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:3730
Definition: rig.h:269
int rig_get_ctcss_sql(RIG *rig, vfo_t vfo, tone_t *tone)
get the current CTCSS squelch
Definition: tones.c:429
shortfreq_t ts
Definition: rig.h:1245
Definition: rig.h:717
const char * rig_strrmode(rmode_t mode)
Convert enum RIG_MODE to alpha string.
Definition: misc.c:387
Definition: rig.h:915
hamlib_port_t rigport
Definition: rig.h:1983
Definition: rig.h:852
int auto_disable_screensaver
Definition: rig.h:2051
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:3529
unsigned tx_mode
Definition: rig.h:1380
int rig_get_powerstat(RIG *rig, powerstat_t *status)
get the on/off status of the radio
Definition: rig.c:4593
pbwidth_t width
Definition: rig.h:1280
Definition: rig.h:853
int rig_get_trn(RIG *rig, int *trn)
get the current transceive mode
Definition: event.c:855
unsigned int flags
Definition: rig.h:1355
freq_t lo_freq
Definition: rig.h:2042
unsigned rptr_shift
Definition: rig.h:1385
int rig_stop_morse(RIG *rig, vfo_t vfo)
stop morse code
Definition: rig.c:5125
int rig_get_twiddle(RIG *rig, int *seconds)
get the twiddle timeout value (secs)
Definition: rig.c:1220
int rig_get_ctcss_tone(RIG *rig, vfo_t vfo, tone_t *tone)
get the current CTCSS sub-tone frequency
Definition: tones.c:167
ant_t ant
Definition: rig.h:1331
Definition: rig.h:644
const char * rig_strvfop(vfo_op_t op)
Convert enum RIG_OP_... to alpha string.
Definition: misc.c:950
const char * combostr[RIG_COMBO_MAX]
Definition: rig.h:705
split_t
Split mode.
Definition: rig.h:322
int rig_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
set the frequency of the target VFO
Definition: rig.c:1383
chan_type_t type
Definition: rig.h:1446
Definition: rig.h:719
int rig_get_split_freq(RIG *rig, vfo_t vfo, freq_t *tx_freq)
get the current split frequencies
Definition: rig.c:3169
Definition: rig.h:131
Callback functions and args for rig event.
Definition: rig.h:2096
const char * tooltip
Definition: rig.h:695
Definition: rig.h:207
Definition: rig.h:619
Definition: rig.h:548
Definition: rig.h:869
Definition: rig.h:624
int rig_mem_count(RIG *rig)
get memory channel count
Definition: mem.c:1643
Memory channel list definition.
Definition: rig.h:1443
Definition: rig.h:209
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
unsigned ctcss_sql
Definition: rig.h:1393
Definition: rig.h:944
level/parm granularity definition
Definition: rig.h:1478
Definition: rig.h:227
rig_model_t rig_probe(hamlib_port_t *port)
try to guess a rig
Definition: rig.c:4666
Definition: rig.h:907
shortfreq_t rptr_offs
Definition: rig.h:1344
unsigned freq
Definition: rig.h:1375
ptt_t
PTT status.
Definition: rig.h:545
float min
Definition: rig.h:700
int rig_close(RIG *rig)
close the communication to the rig
Definition: rig.c:970
int deprecated_itu_region
Definition: rig.h:1989
int bank_num
Definition: rig.h:1329
Definition: rig.h:941
Definition: rig.h:893
int power_min
Definition: rig.h:2056
int rig_get_chan_all_cb(RIG *rig, chan_cb_t chan_cb, rig_ptr_t arg)
get all channel data, by callback
Definition: mem.c:1125
Definition: rig.h:942
int attenuator[MAXDBLSTSIZ]
Definition: rig.h:2008
unsigned tx_freq
Definition: rig.h:1379
rmode_t modes
Definition: rig.h:1279
unsigned dcs_code
Definition: rig.h:1394
struct freq_range_list freq_range_t
Frequency range.
Definition: rig.h:228
Definition: rig.h:158
dcd_e
DCD status.
Definition: rig.h:518
Definition: rig.h:535
Definition: rig.h:914
rig_type_t
Rig type flags.
Definition: rig.h:258
rmode_t rig_parse_mode(const char *s)
Convert alpha string to enum RIG_MODE.
Definition: misc.c:362
Definition: rig.h:621
FILE * rig_set_debug_file(FILE *stream)
change stderr to some different output
Definition: debug.c:295
unsigned int vfo_t
VFO definition.
Definition: rig.h:393
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:844
int rig_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
get the value of a level
Definition: settings.c:147
Definition: rig.h:865
token_t rig_token_lookup(RIG *rig, const char *name)
lookup a token id
Definition: conf.c:1050
unsigned width
Definition: rig.h:1377
Definition: rig.h:900
ptt_cb_t ptt_event
Definition: rig.h:2103
Definition: rig.h:1420
Definition: rig.h:530
rptr_shift_t rig_parse_rptr_shift(const char *s)
Convert alpha char to enum RIG_RPT_SHIFT_...
Definition: misc.c:1074
Definition: rig.h:620
int rig_need_debug(enum rig_debug_level_e debug_level)
Useful for dump_hex, etc.
Definition: debug.c:133
Definition: rig.h:565
enum rig_conf_e type
Definition: rig.h:697
Definition: rig.h:156
vfo_t vfo
Definition: rig.h:1217
Definition: rig.h:128
Definition: rig.h:896
int rig_get_dcs_code(RIG *rig, vfo_t vfo, tone_t *code)
get the current encoding DCS code
Definition: tones.c:292
const char * rig_strmtype(chan_type_t mtype)
Convert enum RIG_MTYPE_... to alpha string.
Definition: misc.c:1142
freq_t tx_freq
Definition: rig.h:1336
vfo_t tx_vfo
Definition: rig.h:1341
mode_cb_t mode_event
Definition: rig.h:2099
rig_ptr_t freq_arg
Definition: rig.h:2098
Definition: rig.h:622
Definition: rig.h:872
int endc
Definition: rig.h:1445
Definition: rig.h:241
int rig_get_chan_all(RIG *rig, channel_t chans[])
get all channel data
Definition: mem.c:1207
Definition: rig.h:892
Definition: rig.h:562
Definition: rig.h:127
tone_t dcs_sql
Definition: rig.h:1353
Definition: rig.h:1422
int rig_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
set a radio level setting
Definition: settings.c:77
Definition: rig.h:908
uint64_t setting_t
Setting.
Definition: rig.h:964
int twiddle_timeout
Definition: rig.h:2044
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:713
cal_table_t str_cal
Definition: rig.h:1997
dcd_cb_t dcd_event
Definition: rig.h:2105
Definition: rig.h:721
rig_ptr_t vfo_arg
Definition: rig.h:2102
Definition: rig.h:640
Definition: rig.h:641
rig_ptr_t obj
Definition: rig.h:2030
Definition: rig.h:679
unsigned ext_levels
Definition: rig.h:1399
split_t split
Definition: rig.h:1340
int rig_get_mem_all(RIG *rig, channel_t chans[], const struct confparams cfgps[], value_t vals[])
get all channel and non-channel data
Definition: mem.c:1519
Definition: rig.h:293
enum dcd_e dcd_t
DCD status.
Definition: rig.h:122
serial_control_state_e
Serial control state.
Definition: rig.h:248
Definition: rig.h:874
Definition: rig.h:315
Definition: rig.h:862
pbwidth_t rig_passband_narrow(RIG *rig, rmode_t mode)
get the narrow passband of a mode
Definition: rig.c:1966
int rig_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op)
perform Memory/VFO operations
Definition: rig.c:4755
shortfreq_t max_xit
Definition: rig.h:2002
freq_range_t tx_range_list[FRQRANGESIZ]
Definition: rig.h:1991
Definition: rig.h:615
Definition: rig.h:249
Definition: rig.h:263
Definition: rig.h:578
Definition: rig.h:880
Definition: rig.h:903
value_t max
Definition: rig.h:1480
Definition: rig.h:863
unsigned scan_group
Definition: rig.h:1396
int rig_get_ts(RIG *rig, vfo_t vfo, shortfreq_t *ts)
get the current Tuning Step
Definition: rig.c:4183
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:940
Definition: rig.h:576
Definition: rig.h:588
int rig_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo)
set the split mode
Definition: rig.c:3637
int rig_set_powerstat(RIG *rig, powerstat_t status)
turn on/off the radio
Definition: rig.c:4560
Definition: rig.h:240
Configuration parameter structure.
Definition: rig.h:691
uint64_t rmode_t
Radio mode.
Definition: rig.h:1119
tone_t ctcss_sql
Definition: rig.h:1351
int rig_set_ts(RIG *rig, vfo_t vfo, shortfreq_t ts)
set the Tuning Step
Definition: rig.c:4115
Definition: rig.h:538
Definition: rig.h:206
Definition: rig.h:219
int rig_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t rptr_offs)
set the repeater offset
Definition: rig.c:2925
int rig_set_channel(RIG *rig, const channel_t *chan)
set channel data
Definition: mem.c:688
Definition: rig.h:637
Definition: rig.h:231
Definition: rig.h:859
const char * label
Definition: rig.h:694
Definition: rig.h:917
int rig_set_chan_all_cb(RIG *rig, chan_cb_t chan_cb, rig_ptr_t arg)
set all channel data, by callback
Definition: mem.c:1079
int val
Definition: rig.h:1497
int rig_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit)
set the RIT
Definition: rig.c:3843
Definition: rig.h:870
Definition: rig.h:559
Definition: rig.h:881
ant_t ant
Definition: rig.h:1218
int rig_set_ctcss_tone(RIG *rig, vfo_t vfo, tone_t tone)
set CTCSS sub-tone frequency
Definition: tones.c:100
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_port_e
Port type.
Definition: rig.h:205
int rig_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq)
set the split frequencies
Definition: rig.c:3061
Definition: rig.h:902
Definition: rig.h:210
Definition: rig.h:159
hamlib_port_t dcdport
Definition: rig.h:1985
channel_cap_t mem_caps
Definition: rig.h:1448
int rig_get_rit(RIG *rig, vfo_t vfo, shortfreq_t *rit)
get the current RIT offset
Definition: rig.c:3911
Definition: rig.h:533
rig_ptr_t priv
Definition: rig.h:2029
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
int comm_state
Definition: rig.h:2028
const char * rig_get_info(RIG *rig)
get general information from the radio
Definition: rig.c:5403
Definition: rig.h:1419
float max
Definition: rig.h:701
int rig_get_vfo(RIG *rig, vfo_t *vfo)
get the current VFO
Definition: rig.c:2170
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
vfo_op_t rig_parse_vfo_op(const char *s)
Convert alpha string to enum RIG_OP_...
Definition: misc.c:925
struct filter_list filters[FLTLSTSIZ]
Definition: rig.h:1995
rmode_t current_mode
Definition: rig.h:2035
unsigned dcs_sql
Definition: rig.h:1395
Definition: rig.h:563
int rig_get_channel(RIG *rig, channel_t *chan, int read_only)
get channel data
Definition: mem.c:832
Definition: rig.h:267
rptr_shift_t rptr_shift
Definition: rig.h:1343
const char * rig_version()
get the Hamlib version
Definition: rig.c:5435
Definition: rig.h:642
double vfo_comp
Definition: rig.h:1987
Definition: rig.h:875
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:419
Definition: rig.h:639

Generated by doxygen 1.8.15

Hamlib documentation for version 4.0~rc2 -- Thu Nov 12 2020 00:00:00
Project page: http://www.hamlib.org