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