Hamlib  4.5
rig.h
Go to the documentation of this file.
1 /*
2  * Hamlib Interface - API header
3  * Copyright (c) 2000-2003 by Frank Singleton
4  * Copyright (c) 2000-2012 by Stephane Fillod
5  *
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20  *
21  */
22 
23 
24 #ifndef _RIG_H
25 #define _RIG_H 1
26 
27 #define BUILTINFUNC 0
28 
29 // Our shared secret password
30 #define HAMLIB_SECRET_LENGTH 32
31 
32 #define HAMLIB_TRACE rig_debug(RIG_DEBUG_TRACE,"%s(%d) trace\n", __FILE__, __LINE__)
33 #define __FILENAME__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
34 
35 #include <stdio.h>
36 #include <stdarg.h>
37 #include <string.h>
38 #include <inttypes.h>
39 #include <time.h>
40 
41 // For MSVC install the NUGet pthread package
42 #if defined(_MSC_VER)
43 #define HAVE_STRUCT_TIMESPEC
44 #endif
45 #include <pthread.h>
46 
47 /* Rig list is in a separate file so as not to mess up w/ this one */
48 #include <hamlib/riglist.h>
49 
63 /* __BEGIN_DECLS should be used at the beginning of your declarations,
64  * so that C++ compilers don't mangle their names. Use __END_DECLS at
65  * the end of C declarations. */
67 #undef __BEGIN_DECLS
68 #undef __END_DECLS
69 #ifdef __cplusplus
70 # define __BEGIN_DECLS extern "C" {
71 # define __END_DECLS }
72 #else
73 # define __BEGIN_DECLS /* empty */
74 # define __END_DECLS /* empty */
75 #endif
77 
78 /* HAMLIB_PARAMS is a macro used to wrap function prototypes, so that compilers
79  * that don't understand ANSI C prototypes still work, and ANSI C
80  * compilers can issue warnings about type mismatches. */
82 #undef HAMLIB_PARAMS
83 #if defined (__STDC__) \
84  || defined (_AIX) \
85  || (defined (__mips) && defined (_SYSTYPE_SVR4)) \
86  || defined(__CYGWIN__) \
87  || defined(_WIN32) \
88  || defined(__cplusplus)
89 # define HAMLIB_PARAMS(protos) protos
90 # define rig_ptr_t void *
91 # define amp_ptr_t void *
92 #else
93 # define HAMLIB_PARAMS(protos) ()
94 # define rig_ptr_t char *
95 # define amp_ptr_t char *
96 #endif
98 
99 #include <hamlib/rig_dll.h>
100 
101 #ifndef SWIGLUA
103 #define CONSTANT_64BIT_FLAG(BIT) (1ull << (BIT))
105 #else
106 /* SWIG's older Lua generator doesn't grok ull due to Lua using a
107  double-precision floating point type internally for number
108  representations (max 53 bits of precision) so makes a string
109  constant from a constant number literal using ull */
110 // #define CONSTANT_64BIT_FLAG(BIT) (1 << (BIT))
111 // #define SWIGLUAHIDE
112 /* But this appears to have been fixed so we'll use the correct one now
113  If you have the older version of SWIG comment out this line and use
114  the two above */
115 // This 1ul definition works on swig 4.0.1 and lua 5.3.5
116 #define CONSTANT_64BIT_FLAG(BIT) (1ul << (BIT))
117 #endif
118 
119 __BEGIN_DECLS
120 
125 // cookie is 26-char time code plus 10-char (2^31-1) random number
126 #define HAMLIB_COOKIE_SIZE 37
127 extern int cookie_use; // this is global as once one client requests it everybody needs to honor it
128 
130 extern HAMLIB_EXPORT_VAR(const char) hamlib_version[];
131 extern HAMLIB_EXPORT_VAR(const char) hamlib_copyright[];
132 extern HAMLIB_EXPORT_VAR(const char *) hamlib_version2;
133 extern HAMLIB_EXPORT_VAR(const char *) hamlib_copyright2;
135 
147  RIG_OK = 0,
167  RIG_EPOWER,
168  RIG_EEND // MUST BE LAST ITEM IN LAST
169 };
179 #define RIG_IS_SOFT_ERRCODE(errcode) (errcode == RIG_EINVAL || errcode == RIG_ENIMPL || errcode == RIG_ERJCTED \
180  || errcode == RIG_ETRUNC || errcode == RIG_ENAVAIL || errcode == RIG_ENTARGET \
181  || errcode == RIG_EVFO || errcode == RIG_EDOM || errcode == RIG_EDEPRECATED \
182  || errcode == RIG_ESECURITY || errcode == RIG_EPOWER)
183 
187 #define NETRIGCTL_RET "RPRT "
188 
189 
205 };
206 
207 
208 /* --------------- Rig capabilities -----------------*/
209 
210 /* Forward struct references */
211 
212 struct rig;
213 struct rig_state;
214 
218 typedef struct s_rig RIG;
219 
221 #define HAMLIB_RIGNAMSIZ 30
222 #define HAMLIB_RIGVERSIZ 8
223 #define HAMLIB_FILPATHLEN 512
224 /* 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 };
346 
347 
349 #define RIG_FLAG_TRANSCEIVER (RIG_FLAG_RECEIVER|RIG_FLAG_TRANSMITTER)
350 #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)
351 
352 #define RIG_TYPE_OTHER 0
353 #define RIG_TYPE_TRANSCEIVER RIG_FLAG_TRANSCEIVER
354 #define RIG_TYPE_HANDHELD (RIG_FLAG_TRANSCEIVER|RIG_FLAG_HANDHELD)
355 #define RIG_TYPE_MOBILE (RIG_FLAG_TRANSCEIVER|RIG_FLAG_MOBILE)
356 #define RIG_TYPE_RECEIVER RIG_FLAG_RECEIVER
357 #define RIG_TYPE_PCRECEIVER (RIG_FLAG_COMPUTER|RIG_FLAG_RECEIVER)
358 #define RIG_TYPE_SCANNER (RIG_FLAG_SCANNER|RIG_FLAG_RECEIVER)
359 #define RIG_TYPE_TRUNKSCANNER (RIG_TYPE_SCANNER|RIG_FLAG_TRUNKING)
360 #define RIG_TYPE_COMPUTER (RIG_FLAG_TRANSCEIVER|RIG_FLAG_COMPUTER)
361 #define RIG_TYPE_TUNER RIG_FLAG_TUNER
363 
364 
374  /* RIG_STATUS_NEW * *!< Initial release of code
375  * !! Use of RIG_STATUS_NEW is deprecated. Do not use it anymore */
376 };
377 
382 #define RIG_STATUS_NEW RIG_STATUS_UNTESTED
383 
384 
388 typedef enum {
393 
394 
398 typedef enum {
400  RIG_SPLIT_ON
402 
403 
409 typedef double freq_t;
410 
414 #define PRIfreq ".0f"
415 
419 #define SCNfreq "lf"
423 #define FREQFMT SCNfreq
424 
425 
431 typedef signed long shortfreq_t;
432 
434 #define Hz(f) ((freq_t)(f))
436 #define kHz(f) ((freq_t)((f)*(freq_t)1000))
438 #define MHz(f) ((freq_t)((f)*(freq_t)1000000))
440 #define GHz(f) ((freq_t)((f)*(freq_t)1000000000))
441 
443 #define s_Hz(f) ((shortfreq_t)(f))
445 #define s_kHz(f) ((shortfreq_t)((f)*(shortfreq_t)1000))
447 #define s_MHz(f) ((shortfreq_t)((f)*(shortfreq_t)1000000))
449 #define s_GHz(f) ((shortfreq_t)((f)*(shortfreq_t)1000000000))
450 
452 #define RIG_FREQ_NONE Hz(0)
453 
454 
469 typedef unsigned int vfo_t;
470 
473 #define RIG_VFO_N(n) (1u<<(n))
474 
476 #define RIG_VFO_NONE 0
477 
479 #define RIG_VFO_A RIG_VFO_N(0)
480 
482 #define RIG_VFO_B RIG_VFO_N(1)
483 
485 #define RIG_VFO_C RIG_VFO_N(2)
486 
487 // Any addition VFOS need to go from 3-20
488 // To maintain backward compatibility these values cannot change
489 
491 #define RIG_VFO_SUB_A RIG_VFO_N(21)
492 
494 #define RIG_VFO_SUB_B RIG_VFO_N(22)
495 
497 #define RIG_VFO_SUB_C RIG_VFO_N(3)
498 
500 #define RIG_VFO_MAIN_A RIG_VFO_N(23)
501 
503 #define RIG_VFO_MAIN_B RIG_VFO_N(24)
504 
506 #define RIG_VFO_MAIN_C RIG_VFO_N(4)
507 
509 #define RIG_VFO_OTHER RIG_VFO_N(5)
510 
512 #define RIG_VFO_SUB RIG_VFO_N(25)
513 
515 #define RIG_VFO_MAIN RIG_VFO_N(26)
516 
518 #define RIG_VFO_VFO RIG_VFO_N(27)
519 
521 #define RIG_VFO_MEM RIG_VFO_N(28)
522 
524 #define RIG_VFO_CURR RIG_VFO_N(29)
525 
527 #define RIG_VFO_TX_FLAG RIG_VFO_N(30)
528 
530 #define RIG_VFO_ALL RIG_VFO_N(31)
531 
532 // we can also use RIG_VFO_N(31) if needed
533 
534 // Misc VFO Macros
535 
537 #define RIG_VFO_TX_VFO(v) ((v)|RIG_VFO_TX_FLAG)
538 
540 #define RIG_VFO_TX RIG_VFO_TX_VFO(RIG_VFO_CURR)
541 
543 #define RIG_VFO_RX RIG_VFO_CURR
544 
545 
546 /*
547  * targetable bitfields, for internal use.
548  * In rig.c lack of a flag will case a VFO change if needed
549  * So setting this flag will mean the backend handles any VFO needs
550  * For many rigs RITXIT, PTT, MEM, and BANK are non-VFO commands so need these flags to avoid unnecessary VFO swapping
551  */
553 #define RIG_TARGETABLE_NONE 0
554 #define RIG_TARGETABLE_FREQ (1<<0)
555 #define RIG_TARGETABLE_MODE (1<<1) // mode by vfo or same mode on both vfos
556 #define RIG_TARGETABLE_PURE (1<<2) // deprecated -- not used -- reuse it
557 #define RIG_TARGETABLE_TONE (1<<3)
558 #define RIG_TARGETABLE_FUNC (1<<4)
559 #define RIG_TARGETABLE_LEVEL (1<<5)
560 #define RIG_TARGETABLE_RITXIT (1<<6)
561 #define RIG_TARGETABLE_PTT (1<<7)
562 #define RIG_TARGETABLE_MEM (1<<8)
563 #define RIG_TARGETABLE_BANK (1<<9)
564 #define RIG_TARGETABLE_ANT (1<<10)
565 #define RIG_TARGETABLE_ROOFING (1<<11) // roofing filter targetable by VFO
566 #define RIG_TARGETABLE_SPECTRUM (1<<12) // spectrum scope targetable by VFO
567 #define RIG_TARGETABLE_BAND (1<<13) // Band select -- e.g. Yaeus BS command
568 #define RIG_TARGETABLE_COMMON (RIG_TARGETABLE_RITXIT | RIG_TARGETABLE_PTT | RIG_TARGETABLE_MEM | RIG_TARGETABLE_BANK)
569 #define RIG_TARGETABLE_ALL 0x7fffffff
571 //
572 //
573 // Newer Icoms like the 9700 and 910 have VFOA/B on both Main & Sub
574 // Compared to older rigs which have one or the other
575 // So we need to distinguish between them
577 #define VFO_HAS_A_B ((rig->state.vfo_list & (RIG_VFO_A|RIG_VFO_B)) == (RIG_VFO_A|RIG_VFO_B))
578 #define VFO_HAS_MAIN_SUB ((rig->state.vfo_list & (RIG_VFO_MAIN|RIG_VFO_SUB)) == (RIG_VFO_MAIN|RIG_VFO_SUB))
579 #define VFO_HAS_MAIN_SUB_ONLY ((!VFO_HAS_A_B) & VFO_HAS_MAIN_SUB)
580 #define VFO_HAS_MAIN_SUB_A_B_ONLY (VFO_HAS_A_B & VFO_HAS_MAIN_SUB)
581 #define VFO_HAS_A_B_ONLY (VFO_HAS_A_B & (!VFO_HAS_MAIN_SUB))
582 #define VFO_DUAL (RIG_VFO_MAIN_A|RIG_VFO_MAIN_B|RIG_VFO_SUB_A|RIG_VFO_SUB_B)
583 #define VFO_HAS_DUAL ((rig->state.vfo_list & VFO_DUAL) == VFO_DUAL)
585 
590 #define RIG_PASSBAND_NORMAL s_Hz(0)
591 
595 #define RIG_PASSBAND_NOCHANGE s_Hz(-1)
596 
602 
603 
607 typedef enum dcd_e {
609  RIG_DCD_ON
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 RIG_AGC_AUTO
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_50 CONSTANT_64BIT_FLAG(50)
1010 #define RIG_LEVEL_51 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)
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)
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_BIT47 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 #endif
1320 
1324 #define RIG_MODE_SSB (RIG_MODE_USB|RIG_MODE_LSB)
1325 
1329 #define RIG_MODE_ECSS (RIG_MODE_ECSSUSB|RIG_MODE_ECSSLSB)
1330 
1332 #define RIG_DBLST_END 0 /* end marker in a preamp/att level list */
1333 #define RIG_IS_DBLST_END(d) ((d)==0)
1335 
1336 
1343 typedef struct freq_range_list {
1351  char *label;
1353 
1355 #define RIG_FRNG_END {Hz(0),Hz(0),RIG_MODE_NONE,0,0,RIG_VFO_NONE}
1356 #define RIG_IS_FRNG_END(r) ((r).startf == Hz(0) && (r).endf == Hz(0))
1358 
1378 };
1379 
1381 #define RIG_TS_ANY 0
1382 #define RIG_TS_END {RIG_MODE_NONE, 0}
1383 #define RIG_IS_TS_END(t) ((t).modes == RIG_MODE_NONE && (t).ts == 0)
1385 
1386 
1410 struct filter_list {
1413 };
1415 #define RIG_FLT_ANY 0
1416 #define RIG_FLT_END {RIG_MODE_NONE, 0}
1417 #define RIG_IS_FLT_END(f) ((f).modes == RIG_MODE_NONE)
1418 #define DEBUGMSGSAVE_SIZE 24000
1420 
1421 
1425 #define RIG_CHFLAG_NONE 0
1429 #define RIG_CHFLAG_SKIP (1<<0)
1433 #define RIG_CHFLAG_DATA (1<<1)
1437 #define RIG_CHFLAG_PSKIP (1<<2)
1438 
1443 struct ext_list {
1446 };
1447 
1449 #define RIG_EXT_END {0, {.i=0}}
1450 #define RIG_IS_EXT_END(x) ((x).token == 0)
1452 
1460 struct channel {
1462  int bank_num;
1483  tone_t ctcss_tone;
1484  tone_t ctcss_sql;
1485  tone_t dcs_code;
1486  tone_t dcs_sql;
1488  unsigned int flags;
1489  char channel_desc[HAMLIB_MAXCHANDESC];
1490  struct ext_list
1492 };
1493 
1497 typedef struct channel channel_t;
1498 
1504 struct channel_cap {
1505  unsigned bank_num: 1;
1506  unsigned vfo: 1;
1507  unsigned ant: 1;
1508  unsigned freq: 1;
1509  unsigned mode: 1;
1510  unsigned width: 1;
1512  unsigned tx_freq: 1;
1513  unsigned tx_mode: 1;
1514  unsigned tx_width: 1;
1516  unsigned split: 1;
1517  unsigned tx_vfo: 1;
1518  unsigned rptr_shift: 1;
1519  unsigned rptr_offs: 1;
1520  unsigned tuning_step: 1;
1521  unsigned rit: 1;
1522  unsigned xit: 1;
1525  unsigned ctcss_tone: 1;
1526  unsigned ctcss_sql: 1;
1527  unsigned dcs_code: 1;
1528  unsigned dcs_sql: 1;
1529  unsigned scan_group: 1;
1530  unsigned flags: 1;
1531  unsigned channel_desc: 1;
1532  unsigned ext_levels: 1;
1533 };
1534 
1538 typedef struct channel_cap channel_cap_t;
1539 
1540 
1551 typedef enum {
1561 
1562 
1576 struct chan_list {
1577  int startc;
1578  int endc;
1582 };
1583 
1585 #define RIG_CHAN_END {0,0,RIG_MTYPE_NONE}
1586 #define RIG_IS_CHAN_END(c) ((c).type == RIG_MTYPE_NONE)
1588 
1592 #define RIG_MEM_CAPS_ALL -1
1593 
1597 typedef struct chan_list chan_t;
1598 
1599 
1611 struct gran {
1615 };
1616 
1620 typedef struct gran gran_t;
1621 
1622 
1626 struct cal_table {
1627  int size;
1628  struct {
1629  int raw;
1630  int val;
1631  } table[HAMLIB_MAX_CAL_LENGTH];
1632 };
1633 
1646 typedef struct cal_table cal_table_t;
1647 
1649 #define EMPTY_STR_CAL { 0, { { 0, 0 }, } }
1651 
1652 
1657  int size;
1658  struct {
1659  int raw;
1660  float val;
1661  } table[HAMLIB_MAX_CAL_LENGTH];
1662 };
1663 
1676 typedef struct cal_table_float cal_table_float_t;
1677 
1679 #define EMPTY_FLOAT_CAL { 0, { { 0, 0f }, } }
1680 
1681 typedef int (* chan_cb_t)(RIG *, channel_t **, int, const chan_t *, rig_ptr_t);
1682 typedef int (* confval_cb_t)(RIG *,
1683  const struct confparams *,
1684  value_t *,
1685  rig_ptr_t);
1687 
1692 {
1693  int id;
1694  char *name;
1695 };
1696 
1701  RIG_SPECTRUM_MODE_NONE = 0,
1706 };
1707 
1712 {
1713  int id;
1714  char *name;
1715 };
1716 
1729 {
1730  int id;
1746  unsigned char *spectrum_data;
1747 };
1748 
1769 #define RIG_MODEL(arg) .rig_model=arg,.macro_name=#arg
1770 #define HAMLIB_CHECK_RIG_CAPS "HAMLIB_CHECK_RIG_CAPS"
1771 struct rig_caps {
1772  rig_model_t rig_model;
1773  const char *model_name;
1774  const char *mfg_name;
1775  const char *version;
1776  const char *copyright;
1777  enum rig_status_e status;
1779  int rig_type;
1780  ptt_type_t ptt_type;
1781  dcd_type_t dcd_type;
1782  rig_port_t port_type;
1784  int serial_rate_min;
1785  int serial_rate_max;
1786  int serial_data_bits;
1787  int serial_stop_bits;
1788  enum serial_parity_e serial_parity;
1789  enum serial_handshake_e serial_handshake;
1791  int write_delay;
1792  int post_write_delay;
1793  int timeout;
1794  int retry;
1796  setting_t has_get_func;
1797  setting_t has_set_func;
1798  setting_t has_get_level;
1799  setting_t has_set_level;
1800  setting_t has_get_parm;
1801  setting_t has_set_parm;
1803  gran_t level_gran[RIG_SETTING_MAX];
1804  gran_t parm_gran[RIG_SETTING_MAX];
1806  const struct confparams *extparms;
1807  const struct confparams *extlevels;
1808  const struct confparams *extfuncs;
1809  int *ext_tokens;
1811  tone_t *ctcss_list;
1812  tone_t *dcs_list;
1814  int preamp[HAMLIB_MAXDBLSTSIZ];
1815  int attenuator[HAMLIB_MAXDBLSTSIZ];
1816  shortfreq_t max_rit;
1817  shortfreq_t max_xit;
1818  shortfreq_t max_ifshift;
1820  int agc_level_count;
1821  enum agc_level_e agc_levels[HAMLIB_MAX_AGC_LEVELS];
1823  ann_t announces;
1825  vfo_op_t vfo_ops;
1826  scan_t scan_ops;
1827  int targetable_vfo;
1828  int transceive;
1830  int bank_qty;
1831  int chan_desc_sz;
1833  chan_t chan_list[HAMLIB_CHANLSTSIZ];
1835  // As of 2020-02-12 we know of 5 models from Icom USA, EUR, ITR, TPE, KOR for the IC-9700
1836  // So we currently have 5 ranges we need to deal with
1837  // The backend for the model should fill in the label field to explain what model it is
1838  // The the IC-9700 in ic7300.c for an example
1839  freq_range_t rx_range_list1[HAMLIB_FRQRANGESIZ];
1840  freq_range_t tx_range_list1[HAMLIB_FRQRANGESIZ];
1841  freq_range_t rx_range_list2[HAMLIB_FRQRANGESIZ];
1842  freq_range_t tx_range_list2[HAMLIB_FRQRANGESIZ];
1843  freq_range_t rx_range_list3[HAMLIB_FRQRANGESIZ];
1844  freq_range_t tx_range_list3[HAMLIB_FRQRANGESIZ];
1845  freq_range_t rx_range_list4[HAMLIB_FRQRANGESIZ];
1846  freq_range_t tx_range_list4[HAMLIB_FRQRANGESIZ];
1847  freq_range_t rx_range_list5[HAMLIB_FRQRANGESIZ];
1848  freq_range_t tx_range_list5[HAMLIB_FRQRANGESIZ];
1850  struct tuning_step_list tuning_steps[HAMLIB_TSLSTSIZ];
1851  struct filter_list filters[HAMLIB_FLTLSTSIZ];
1853  cal_table_t str_cal;
1854  cal_table_float_t swr_cal;
1855  cal_table_float_t alc_cal;
1856  cal_table_float_t rfpower_meter_cal;
1857  cal_table_float_t comp_meter_cal;
1858  cal_table_float_t vd_meter_cal;
1859  cal_table_float_t id_meter_cal;
1861  struct rig_spectrum_scope spectrum_scopes[HAMLIB_MAX_SPECTRUM_SCOPES];
1862  enum rig_spectrum_mode_e spectrum_modes[HAMLIB_MAX_SPECTRUM_MODES];
1863  freq_t spectrum_spans[HAMLIB_MAX_SPECTRUM_SPANS];
1864  struct rig_spectrum_avg_mode spectrum_avg_modes[HAMLIB_MAX_SPECTRUM_AVG_MODES];
1865  int spectrum_attenuator[HAMLIB_MAXDBLSTSIZ];
1867  const struct confparams *cfgparams;
1868  const rig_ptr_t priv;
1870  /*
1871  * Rig API
1872  *
1873  */
1874 
1875  int (*rig_init)(RIG *rig);
1876  int (*rig_cleanup)(RIG *rig);
1877  int (*rig_open)(RIG *rig);
1878  int (*rig_close)(RIG *rig);
1879 
1880  /*
1881  * General API commands, from most primitive to least.. :()
1882  * List Set/Get functions pairs
1883  */
1884 
1885  int (*set_freq)(RIG *rig, vfo_t vfo, freq_t freq);
1886  int (*get_freq)(RIG *rig, vfo_t vfo, freq_t *freq);
1887 
1888  int (*set_mode)(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width);
1889  int (*get_mode)(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width);
1890 
1891  int (*set_vfo)(RIG *rig, vfo_t vfo);
1892  int (*get_vfo)(RIG *rig, vfo_t *vfo);
1893 
1894  int (*set_ptt)(RIG *rig, vfo_t vfo, ptt_t ptt);
1895  int (*get_ptt)(RIG *rig, vfo_t vfo, ptt_t *ptt);
1896 
1897  int (*get_dcd)(RIG *rig, vfo_t vfo, dcd_t *dcd);
1898 
1899  int (*set_rptr_shift)(RIG *rig, vfo_t vfo, rptr_shift_t rptr_shift);
1900  int (*get_rptr_shift)(RIG *rig, vfo_t vfo, rptr_shift_t *rptr_shift);
1901 
1902  int (*set_rptr_offs)(RIG *rig, vfo_t vfo, shortfreq_t offs);
1903  int (*get_rptr_offs)(RIG *rig, vfo_t vfo, shortfreq_t *offs);
1904 
1905  int (*set_split_freq)(RIG *rig, vfo_t vfo, freq_t tx_freq);
1906  int (*get_split_freq)(RIG *rig, vfo_t vfo, freq_t *tx_freq);
1907 
1908  int (*set_split_mode)(RIG *rig,
1909  vfo_t vfo,
1910  rmode_t tx_mode,
1911  pbwidth_t tx_width);
1912  int (*get_split_mode)(RIG *rig,
1913  vfo_t vfo,
1914  rmode_t *tx_mode,
1915  pbwidth_t *tx_width);
1916 
1917  int (*set_split_freq_mode)(RIG *rig,
1918  vfo_t vfo,
1919  freq_t tx_freq,
1920  rmode_t tx_mode,
1921  pbwidth_t tx_width);
1922  int (*get_split_freq_mode)(RIG *rig,
1923  vfo_t vfo,
1924  freq_t *tx_freq,
1925  rmode_t *tx_mode,
1926  pbwidth_t *tx_width);
1927 
1928  int (*set_split_vfo)(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo);
1929  int (*get_split_vfo)(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo);
1930 
1931  int (*set_rit)(RIG *rig, vfo_t vfo, shortfreq_t rit);
1932  int (*get_rit)(RIG *rig, vfo_t vfo, shortfreq_t *rit);
1933 
1934  int (*set_xit)(RIG *rig, vfo_t vfo, shortfreq_t xit);
1935  int (*get_xit)(RIG *rig, vfo_t vfo, shortfreq_t *xit);
1936 
1937  int (*set_ts)(RIG *rig, vfo_t vfo, shortfreq_t ts);
1938  int (*get_ts)(RIG *rig, vfo_t vfo, shortfreq_t *ts);
1939 
1940  int (*set_dcs_code)(RIG *rig, vfo_t vfo, tone_t code);
1941  int (*get_dcs_code)(RIG *rig, vfo_t vfo, tone_t *code);
1942 
1943  int (*set_tone)(RIG *rig, vfo_t vfo, tone_t tone);
1944  int (*get_tone)(RIG *rig, vfo_t vfo, tone_t *tone);
1945 
1946  int (*set_ctcss_tone)(RIG *rig, vfo_t vfo, tone_t tone);
1947  int (*get_ctcss_tone)(RIG *rig, vfo_t vfo, tone_t *tone);
1948 
1949  int (*set_dcs_sql)(RIG *rig, vfo_t vfo, tone_t code);
1950  int (*get_dcs_sql)(RIG *rig, vfo_t vfo, tone_t *code);
1951 
1952  int (*set_tone_sql)(RIG *rig, vfo_t vfo, tone_t tone);
1953  int (*get_tone_sql)(RIG *rig, vfo_t vfo, tone_t *tone);
1954 
1955  int (*set_ctcss_sql)(RIG *rig, vfo_t vfo, tone_t tone);
1956  int (*get_ctcss_sql)(RIG *rig, vfo_t vfo, tone_t *tone);
1957 
1958  int (*power2mW)(RIG *rig,
1959  unsigned int *mwpower,
1960  float power,
1961  freq_t freq,
1962  rmode_t mode);
1963  int (*mW2power)(RIG *rig,
1964  float *power,
1965  unsigned int mwpower,
1966  freq_t freq,
1967  rmode_t mode);
1968 
1969  int (*set_powerstat)(RIG *rig, powerstat_t status);
1970  int (*get_powerstat)(RIG *rig, powerstat_t *status);
1971 
1972  int (*reset)(RIG *rig, reset_t reset);
1973 
1974  int (*set_ant)(RIG *rig, vfo_t vfo, ant_t ant, value_t option);
1975  int (*get_ant)(RIG *rig, vfo_t vfo, ant_t ant, value_t *option, ant_t *ant_curr, ant_t *ant_tx, ant_t *ant_rx);
1976 
1977  int (*set_level)(RIG *rig, vfo_t vfo, setting_t level, value_t val);
1978  int (*get_level)(RIG *rig, vfo_t vfo, setting_t level, value_t *val);
1979 
1980  int (*set_func)(RIG *rig, vfo_t vfo, setting_t func, int status);
1981  int (*get_func)(RIG *rig, vfo_t vfo, setting_t func, int *status);
1982 
1983  int (*set_parm)(RIG *rig, setting_t parm, value_t val);
1984  int (*get_parm)(RIG *rig, setting_t parm, value_t *val);
1985 
1986  int (*set_ext_level)(RIG *rig, vfo_t vfo, token_t token, value_t val);
1987  int (*get_ext_level)(RIG *rig, vfo_t vfo, token_t token, value_t *val);
1988 
1989  int (*set_ext_func)(RIG *rig, vfo_t vfo, token_t token, int status);
1990  int (*get_ext_func)(RIG *rig, vfo_t vfo, token_t token, int *status);
1991 
1992  int (*set_ext_parm)(RIG *rig, token_t token, value_t val);
1993  int (*get_ext_parm)(RIG *rig, token_t token, value_t *val);
1994 
1995  int (*set_conf)(RIG *rig, token_t token, const char *val);
1996  int (*get_conf)(RIG *rig, token_t token, char *val);
1997 
1998  int (*send_dtmf)(RIG *rig, vfo_t vfo, const char *digits);
1999  int (*recv_dtmf)(RIG *rig, vfo_t vfo, char *digits, int *length);
2000 
2001  int (*send_morse)(RIG *rig, vfo_t vfo, const char *msg);
2002  int (*stop_morse)(RIG *rig, vfo_t vfo);
2003  int (*wait_morse)(RIG *rig, vfo_t vfo);
2004 
2005  int (*send_voice_mem)(RIG *rig, vfo_t vfo, int ch);
2006 
2007  int (*set_bank)(RIG *rig, vfo_t vfo, int bank);
2008 
2009  int (*set_mem)(RIG *rig, vfo_t vfo, int ch);
2010  int (*get_mem)(RIG *rig, vfo_t vfo, int *ch);
2011 
2012  int (*vfo_op)(RIG *rig, vfo_t vfo, vfo_op_t op);
2013 
2014  int (*scan)(RIG *rig, vfo_t vfo, scan_t scan, int ch);
2015 
2016  int (*set_trn)(RIG *rig, int trn);
2017  int (*get_trn)(RIG *rig, int *trn);
2018 
2019  int (*decode_event)(RIG *rig);
2020 
2021  int (*set_channel)(RIG *rig, vfo_t vfo, const channel_t *chan);
2022  int (*get_channel)(RIG *rig, vfo_t vfo, channel_t *chan, int read_only);
2023 
2024  const char * (*get_info)(RIG *rig);
2025 
2026  int (*set_chan_all_cb)(RIG *rig, vfo_t vfo, chan_cb_t chan_cb, rig_ptr_t);
2027  int (*get_chan_all_cb)(RIG *rig, vfo_t vfo, chan_cb_t chan_cb, rig_ptr_t);
2028 
2029  int (*set_mem_all_cb)(RIG *rig,
2030  chan_cb_t chan_cb,
2031  confval_cb_t parm_cb,
2032  rig_ptr_t);
2033  int (*get_mem_all_cb)(RIG *rig,
2034  chan_cb_t chan_cb,
2035  confval_cb_t parm_cb,
2036  rig_ptr_t);
2037 
2038  int (*set_vfo_opt)(RIG *rig, int status); // only for Net Rigctl device
2039  int (*rig_get_vfo_info) (RIG *rig,
2040  vfo_t vfo,
2041  freq_t *freq,
2042  rmode_t *mode,
2043  pbwidth_t *width,
2044  split_t *split);
2045  int(*set_clock) (RIG *rig, int year, int month, int day, int hour, int min, int sec, double msec, int utc_offset);
2046  int(*get_clock) (RIG *rig, int *year, int *month, int *day, int *hour, int *min, int *sec, double *msec, int *utc_offset);
2047 
2048  const char *clone_combo_set;
2049  const char *clone_combo_get;
2050  const char *macro_name;
2052  int async_data_supported;
2053  int (*read_frame_direct)(RIG *rig,
2054  size_t buffer_length,
2055  const unsigned char *buffer);
2056  int (*is_async_frame)(RIG *rig,
2057  size_t frame_length,
2058  const unsigned char *frame);
2059  int (*process_async_frame)(RIG *rig,
2060  size_t frame_length,
2061  const unsigned char *frame);
2062 // this will be used to check rigcaps structure is compatible with client
2063  char *hamlib_check_rig_caps; // a constant value we can check for hamlib integrity
2064  int (*get_conf2)(RIG *rig, token_t token, char *val, int val_len);
2065  int (*password)(RIG *rig, const char *key1); /*< Send encrypted password if rigctld is secured with -A/--password */
2066  int (*set_lock_mode)(RIG *rig, int mode);
2067  int (*get_lock_mode)(RIG *rig, int *mode);
2068 };
2070 
2076 // all functions enumerated for rig_get_function_ptr
2077 enum rig_function_e {
2078  RIG_FUNCTION_INIT,
2079  RIG_FUNCTION_CLEANUP,
2080  RIG_FUNCTION_OPEN,
2081  RIG_FUNCTION_CLOSE,
2082  RIG_FUNCTION_SET_FREQ,
2083  RIG_FUNCTION_GET_FREQ,
2084  RIG_FUNCTION_SET_MODE,
2085  RIG_FUNCTION_GET_MODE,
2086  RIG_FUNCTION_SET_VFO,
2087  RIG_FUNCTION_GET_VFO,
2088  RIG_FUNCTION_SET_PTT,
2089  RIG_FUNCTION_GET_PTT,
2090  RIG_FUNCTION_GET_DCD,
2091  RIG_FUNCTION_SET_RPTR_SHIFT,
2092  RIG_FUNCTION_GET_RPTR_SHIFT,
2093  RIG_FUNCTION_SET_RPTR_OFFS,
2094  RIG_FUNCTION_GET_RPTR_OFFS,
2095  RIG_FUNCTION_SET_SPLIT_FREQ,
2096  RIG_FUNCTION_GET_SPLIT_FREQ,
2097  RIG_FUNCTION_SET_SPLIT_MODE,
2098  RIG_FUNCTION_SET_SPLIT_FREQ_MODE,
2099  RIG_FUNCTION_GET_SPLIT_FREQ_MODE,
2100  RIG_FUNCTION_SET_SPLIT_VFO,
2101  RIG_FUNCTION_GET_SPLIT_VFO,
2102  RIG_FUNCTION_SET_RIT,
2103  RIG_FUNCTION_GET_RIT,
2104  RIG_FUNCTION_SET_XIT,
2105  RIG_FUNCTION_GET_XIT,
2106  RIG_FUNCTION_SET_TS,
2107  RIG_FUNCTION_GET_TS,
2108  RIG_FUNCTION_SET_DCS_CODE,
2109  RIG_FUNCTION_GET_DCS_CODE,
2110  RIG_FUNCTION_SET_TONE,
2111  RIG_FUNCTION_GET_TONE,
2112  RIG_FUNCTION_SET_CTCSS_TONE,
2113  RIG_FUNCTION_GET_CTCSS_TONE,
2114  RIG_FUNCTION_SET_DCS_SQL,
2115  RIG_FUNCTION_GET_DCS_SQL,
2116  RIG_FUNCTION_SET_TONE_SQL,
2117  RIG_FUNCTION_GET_TONE_SQL,
2118  RIG_FUNCTION_SET_CTCSS_SQL,
2119  RIG_FUNCTION_GET_CTCSS_SQL,
2120  RIG_FUNCTION_POWER2MW,
2121  RIG_FUNCTION_MW2POWER,
2122  RIG_FUNCTION_SET_POWERSTAT,
2123  RIG_FUNCTION_GET_POWERSTAT,
2124  RIG_FUNCTION_RESET,
2125  RIG_FUNCTION_SET_ANT,
2126  RIG_FUNCTION_GET_ANT,
2127  RIG_FUNCTION_SET_LEVEL,
2128  RIG_FUNCTION_GET_LEVEL,
2129  RIG_FUNCTION_SET_FUNC,
2130  RIG_FUNCTION_GET_FUNC,
2131  RIG_FUNCTION_SET_PARM,
2132  RIG_FUNCTION_GET_PARM,
2133  RIG_FUNCTION_SET_EXT_LEVEL,
2134  RIG_FUNCTION_GET_EXT_LEVEL,
2135  RIG_FUNCTION_SET_EXT_FUNC,
2136  RIG_FUNCTION_GET_EXT_FUNC,
2137  RIG_FUNCTION_SET_EXT_PARM,
2138  RIG_FUNCTION_GET_EXT_PARM,
2139  RIG_FUNCTION_SET_CONF,
2140  RIG_FUNCTION_GET_CONF,
2141  RIG_FUNCTION_SEND_DTMF,
2142  RIG_FUNCTION_SEND_MORSE,
2143  RIG_FUNCTION_STOP_MORSE,
2144  RIG_FUNCTION_WAIT_MORSE,
2145  RIG_FUNCTION_SEND_VOICE_MEM,
2146  RIG_FUNCTION_SET_BANK,
2147  RIG_FUNCTION_SET_MEM,
2148  RIG_FUNCTION_GET_MEM,
2149  RIG_FUNCTION_VFO_OP,
2150  RIG_FUNCTION_SCAN,
2151  RIG_FUNCTION_SET_TRN,
2152  RIG_FUNCTION_GET_TRN,
2153  RIG_FUNCTION_DECODE_EVENT,
2154  RIG_FUNCTION_SET_CHANNEL,
2155  RIG_FUNCTION_GET_CHANNEL,
2156  RIG_FUNCTION_GET_INFO,
2157  RIG_FUNCTION_SET_CHAN_ALL_CB,
2158  RIG_FUNCTION_GET_CHAN_ALL_CB,
2159  RIG_FUNCTION_SET_MEM_ALL_CB,
2160  RIG_FUNCTION_GET_MEM_ALL_CB,
2161  RIG_FUNCTION_SET_VFO_OPT,
2162  RIG_FUNCTION_READ_FRAME_DIRECT,
2163  RIG_FUNCTION_IS_ASYNC_FRAME,
2164  RIG_FUNCTION_PROCESS_ASYNC_FRAME,
2165  RIG_FUNCTION_GET_CONF2,
2166 };
2167 
2173 extern HAMLIB_EXPORT (void *) rig_get_function_ptr(rig_model_t rig_model, enum rig_function_e rig_function);
2174 
2180 // values enumerated for rig->caps values
2181 enum rig_caps_int_e {
2182  RIG_CAPS_TARGETABLE_VFO,
2183  RIG_CAPS_RIG_MODEL,
2184  RIG_CAPS_PORT_TYPE,
2185  RIG_CAPS_PTT_TYPE,
2186  RIG_CAPS_HAS_GET_LEVEL
2187 };
2188 
2189 enum rig_caps_cptr_e {
2190  RIG_CAPS_VERSION_CPTR,
2191  RIG_CAPS_MFG_NAME_CPTR,
2192  RIG_CAPS_MODEL_NAME_CPTR,
2193  RIG_CAPS_STATUS_CPTR
2194 };
2195 
2201 extern HAMLIB_EXPORT (long long) rig_get_caps_int(rig_model_t rig_model, enum rig_caps_int_e rig_caps);
2202 
2208 extern HAMLIB_EXPORT (const char *) rig_get_caps_cptr(rig_model_t rig_model, enum rig_caps_cptr_e rig_caps);
2209 
2210 struct hamlib_async_pipe;
2211 
2212 typedef struct hamlib_async_pipe hamlib_async_pipe_t;
2213 
2220 // DO NOT CHANGE THIS STRUCTURE ALL UNTIL 5.0
2221 // Right now it is static inside rig structure
2222 // 5.0 will change it to a pointer which can then be added to
2223 // At that point only add to the end of the structure
2224 typedef struct hamlib_port {
2225  union {
2226  rig_port_t rig;
2227  ptt_type_t ptt;
2228  dcd_type_t dcd;
2229  } type;
2230 
2231  int fd;
2232  void *handle;
2234  int write_delay;
2235  int post_write_delay;
2237  struct {
2238  int tv_sec, tv_usec;
2239  } post_write_date;
2241  int timeout;
2242  short retry;
2243  short flushx;
2245  char pathname[HAMLIB_FILPATHLEN];
2247  union {
2248  struct {
2249  int rate;
2250  int data_bits;
2251  int stop_bits;
2252  enum serial_parity_e parity;
2253  enum serial_handshake_e handshake;
2254  enum serial_control_state_e rts_state;
2255  enum serial_control_state_e dtr_state;
2256  } serial;
2258  struct {
2259  int pin;
2260  } parallel;
2262  struct {
2263  int ptt_bitnum;
2264  } cm108;
2266  struct {
2267  int vid;
2268  int pid;
2269  int conf;
2270  int iface;
2271  int alt;
2272  char *vendor_name;
2273  char *product;
2274  } usb;
2276  struct {
2277  int on_value;
2278  int value;
2279  } gpio;
2280  } parm;
2281  int client_port;
2282  RIG *rig;
2283  int asyncio;
2284 #if defined(_WIN32)
2285  hamlib_async_pipe_t *sync_data_pipe;
2286  hamlib_async_pipe_t *sync_data_error_pipe;
2287 #else
2288  int fd_sync_write;
2289  int fd_sync_read;
2290  int fd_sync_error_write;
2291  int fd_sync_error_read;
2292 #endif
2293 } hamlib_port_t;
2294 
2295 
2296 // DO NOT CHANGE THIS STRUCTURE AT ALL
2297 // Will be removed in 5.0
2298 typedef struct hamlib_port_deprecated {
2299  union {
2300  rig_port_t rig;
2301  ptt_type_t ptt;
2302  dcd_type_t dcd;
2303  } type;
2304 
2305  int fd;
2306  void *handle;
2308  int write_delay;
2309  int post_write_delay;
2311  struct {
2312  int tv_sec, tv_usec;
2313  } post_write_date;
2315  int timeout;
2316  short retry;
2317  short flushx;
2319  char pathname[HAMLIB_FILPATHLEN];
2321  union {
2322  struct {
2323  int rate;
2324  int data_bits;
2325  int stop_bits;
2326  enum serial_parity_e parity;
2327  enum serial_handshake_e handshake;
2328  enum serial_control_state_e rts_state;
2329  enum serial_control_state_e dtr_state;
2330  } serial;
2332  struct {
2333  int pin;
2334  } parallel;
2336  struct {
2337  int ptt_bitnum;
2338  } cm108;
2340  struct {
2341  int vid;
2342  int pid;
2343  int conf;
2344  int iface;
2345  int alt;
2346  char *vendor_name;
2347  char *product;
2348  } usb;
2350  struct {
2351  int on_value;
2352  int value;
2353  } gpio;
2354  } parm;
2355  int client_port;
2356  RIG *rig;
2357 } hamlib_port_t_deprecated;
2359 
2360 #if !defined(__APPLE__) || !defined(__cplusplus)
2361 typedef hamlib_port_t_deprecated port_t_deprecated;
2362 typedef hamlib_port_t port_t;
2363 #endif
2364 
2365 #define HAMLIB_ELAPSED_GET 0
2366 #define HAMLIB_ELAPSED_SET 1
2367 #define HAMLIB_ELAPSED_INVALIDATE 2
2368 
2369 #define HAMLIB_CACHE_ALWAYS (-1) /*< value to set cache timeout to always use cache */
2370 
2371 typedef enum {
2372  HAMLIB_CACHE_ALL, // to set all cache timeouts at once
2373  HAMLIB_CACHE_VFO,
2374  HAMLIB_CACHE_FREQ,
2375  HAMLIB_CACHE_MODE,
2376  HAMLIB_CACHE_PTT,
2377  HAMLIB_CACHE_SPLIT,
2378  HAMLIB_CACHE_WIDTH
2379 } hamlib_cache_t;
2380 
2381 typedef enum {
2382  TWIDDLE_OFF,
2383  TWIDDLE_ON
2384 } twiddle_state_t;
2385 
2391 struct rig_cache {
2392  int timeout_ms; // the cache timeout for invalidating itself
2393  vfo_t vfo;
2394  //freq_t freq; // to be deprecated in 4.1 when full Main/Sub/A/B caching is implemented in 4.1
2395  // other abstraction here is based on dual vfo rigs and mapped to all others
2396  // So we have four possible states of rig
2397  // MainA, MainB, SubA, SubB
2398  // Main is the Main VFO and Sub is for the 2nd VFO
2399  // Most rigs have MainA and MainB
2400  // Dual VFO rigs can have SubA and SubB too
2401  // For dual VFO rigs simplex operations are all done on MainA/MainB -- ergo this abstraction
2402  freq_t freqCurr; // Other VFO
2403  freq_t freqOther; // Other VFO
2404  freq_t freqMainA; // VFO_A, VFO_MAIN, and VFO_MAINA
2405  freq_t freqMainB; // VFO_B, VFO_SUB, and VFO_MAINB
2406  freq_t freqMainC; // VFO_C, VFO_MAINC
2407  freq_t freqSubA; // VFO_SUBA -- only for rigs with dual Sub VFOs
2408  freq_t freqSubB; // VFO_SUBB -- only for rigs with dual Sub VFOs
2409  freq_t freqSubC; // VFO_SUBC -- only for rigs with 3 Sub VFOs
2410  freq_t freqMem; // VFO_MEM -- last MEM channel
2411  rmode_t modeCurr;
2412  rmode_t modeOther;
2413  rmode_t modeMainA;
2414  rmode_t modeMainB;
2415  rmode_t modeMainC;
2416  rmode_t modeSubA;
2417  rmode_t modeSubB;
2418  rmode_t modeSubC;
2419  rmode_t modeMem;
2420  pbwidth_t widthCurr; // if non-zero then rig has separate width for MainA
2421  pbwidth_t widthOther; // if non-zero then rig has separate width for MainA
2422  pbwidth_t widthMainA; // if non-zero then rig has separate width for MainA
2423  pbwidth_t widthMainB; // if non-zero then rig has separate width for MainB
2424  pbwidth_t widthMainC; // if non-zero then rig has separate width for MainC
2425  pbwidth_t widthSubA; // if non-zero then rig has separate width for SubA
2426  pbwidth_t widthSubB; // if non-zero then rig has separate width for SubB
2427  pbwidth_t widthSubC; // if non-zero then rig has separate width for SubC
2428  pbwidth_t widthMem; // if non-zero then rig has separate width for Mem
2429  ptt_t ptt;
2430  split_t split;
2431  vfo_t split_vfo; // split caches two values
2432  struct timespec time_freqCurr;
2433  struct timespec time_freqOther;
2434  struct timespec time_freqMainA;
2435  struct timespec time_freqMainB;
2436  struct timespec time_freqMainC;
2437  struct timespec time_freqSubA;
2438  struct timespec time_freqSubB;
2439  struct timespec time_freqSubC;
2440  struct timespec time_freqMem;
2441  struct timespec time_vfo;
2442  struct timespec time_modeCurr;
2443  struct timespec time_modeOther;
2444  struct timespec time_modeMainA;
2445  struct timespec time_modeMainB;
2446  struct timespec time_modeMainC;
2447  struct timespec time_modeSubA;
2448  struct timespec time_modeSubB;
2449  struct timespec time_modeSubC;
2450  struct timespec time_modeMem;
2451  struct timespec time_widthCurr;
2452  struct timespec time_widthOther;
2453  struct timespec time_widthMainA;
2454  struct timespec time_widthMainB;
2455  struct timespec time_widthMainC;
2456  struct timespec time_widthSubA;
2457  struct timespec time_widthSubB;
2458  struct timespec time_widthSubC;
2459  struct timespec time_widthMem;
2460  struct timespec time_ptt;
2461  struct timespec time_split;
2462  int satmode; // if rig is in satellite mode
2463 };
2464 
2465 
2476 struct rig_state {
2477  /********* ENSURE ANY NEW ITEMS ARE ADDED AT BOTTOM OF THIS STRUCTURE *********/
2478  /*
2479  * overridable fields
2480  */
2481  // moving the hamlib_port_t to the end of rig_state and making it a pointer
2482  // this should allow changes to hamlib_port_t without breaking shared libraries
2483  // these will maintain a copy of the new port_t for backwards compatibility
2484  // to these offsets -- note these must stay until a major version update is done like 5.0
2485  hamlib_port_t_deprecated rigport_deprecated;
2486  hamlib_port_t_deprecated pttport_deprecated;
2487  hamlib_port_t_deprecated dcdport_deprecated;
2489  double vfo_comp;
2492  freq_range_t rx_range_list[HAMLIB_FRQRANGESIZ];
2493  freq_range_t tx_range_list[HAMLIB_FRQRANGESIZ];
2495  struct tuning_step_list tuning_steps[HAMLIB_TSLSTSIZ];
2497  struct filter_list filters[HAMLIB_FLTLSTSIZ];
2501  chan_t chan_list[HAMLIB_CHANLSTSIZ];
2509  int preamp[HAMLIB_MAXDBLSTSIZ];
2510  int attenuator[HAMLIB_MAXDBLSTSIZ];
2523  /*
2524  * non overridable fields, internal use
2525  */
2526 
2529  int vfo_list;
2531  rig_ptr_t priv;
2532  rig_ptr_t obj;
2538  //rmode_t current_modeB; /*!< Mode currently set VFOB */
2542  // mode_list is used by some
2543  // so anything added to this structure must be below here
2544  int transmit;
2548  time_t twiddle_time;
2550  // uplink allows gpredict to behave better by no reading the uplink VFO
2551  int uplink;
2552  struct rig_cache cache;
2553  int vfo_opt;
2570  volatile unsigned int snapshot_packet_sequence_number;
2571 
2572  volatile int multicast_publisher_run;
2574  volatile int async_data_handler_thread_run;
2575  void *async_data_handler_priv_data;
2576  volatile int poll_routine_thread_run;
2577  void *poll_routine_priv_data;
2578  pthread_mutex_t mutex_set_transaction;
2579  hamlib_port_t rigport;
2580  hamlib_port_t pttport;
2581  hamlib_port_t dcdport;
2582  /********* DO NOT ADD or CHANGE anything (or than to rename) ABOVE THIS LINE *********/
2583  /********* ENSURE ANY NEW ITEMS ARE ADDED AFTER HERE *********/
2584  /* flags instructing the rig_get routines to use cached values when asyncio is in use */
2585  int use_cached_freq; /*<! flag instructing rig_get_freq to use cached values when asyncio is in use */
2586  int use_cached_mode; /*<! flag instructing rig_get_mode to use cached values when asyncio is in use */
2587  int use_cached_ptt; /*<! flag instructing rig_get_ptt to use cached values when asyncio is in use */
2588  int depth; /*<! a depth counter to use for debug indentation and such */
2589  int lock_mode; /*<! flag that prevents mode changes if ~= 0 -- see set/get_lock_mode */
2590  powerstat_t powerstat; /*<! power status */
2591 };
2592 
2594 typedef int (*vprintf_cb_t)(enum rig_debug_level_e,
2595  rig_ptr_t,
2596  const char *,
2597  va_list);
2598 
2599 typedef int (*freq_cb_t)(RIG *, vfo_t, freq_t, rig_ptr_t);
2600 typedef int (*mode_cb_t)(RIG *, vfo_t, rmode_t, pbwidth_t, rig_ptr_t);
2601 typedef int (*vfo_cb_t)(RIG *, vfo_t, rig_ptr_t);
2602 typedef int (*ptt_cb_t)(RIG *, vfo_t, ptt_t, rig_ptr_t);
2603 typedef int (*dcd_cb_t)(RIG *, vfo_t, dcd_t, rig_ptr_t);
2604 typedef int (*pltune_cb_t)(RIG *,
2605  vfo_t, freq_t *,
2606  rmode_t *,
2607  pbwidth_t *,
2608  rig_ptr_t);
2609 typedef int (*spectrum_cb_t)(RIG *,
2610  struct rig_spectrum_line *,
2611  rig_ptr_t);
2612 
2614 
2633  freq_cb_t freq_event;
2634  rig_ptr_t freq_arg;
2635  mode_cb_t mode_event;
2636  rig_ptr_t mode_arg;
2637  vfo_cb_t vfo_event;
2638  rig_ptr_t vfo_arg;
2639  ptt_cb_t ptt_event;
2640  rig_ptr_t ptt_arg;
2641  dcd_cb_t dcd_event;
2642  rig_ptr_t dcd_arg;
2643  pltune_cb_t pltune;
2644  rig_ptr_t pltune_arg;
2645  spectrum_cb_t spectrum_event;
2646  rig_ptr_t spectrum_arg;
2647  /* etc.. */
2648 };
2649 
2650 
2660 struct s_rig {
2661  struct rig_caps *caps;
2662  struct rig_state state;
2663  struct rig_callbacks callbacks;
2664 };
2665 
2666 
2667 
2668 /* --------------- API function prototypes -----------------*/
2669 
2671 
2672 extern HAMLIB_EXPORT(RIG *) rig_init HAMLIB_PARAMS((rig_model_t rig_model));
2673 extern HAMLIB_EXPORT(int) rig_open HAMLIB_PARAMS((RIG *rig));
2674 
2675 /*
2676  * General API commands, from most primitive to least.. :()
2677  * List Set/Get functions pairs
2678  */
2679 
2680 extern HAMLIB_EXPORT(int)
2681 rig_flush(hamlib_port_t *port);
2682 
2683 #if BUILTINFUNC
2684 #define rig_set_freq(r,v, f) rig_set_vfo(r,v,f,__builtin_FUNCTION())
2685 #else
2686 extern HAMLIB_EXPORT(int)
2687 rig_set_freq HAMLIB_PARAMS((RIG *rig,
2688  vfo_t vfo,
2689  freq_t freq));
2690 #endif
2691 extern HAMLIB_EXPORT(int)
2692 rig_get_freq HAMLIB_PARAMS((RIG *rig,
2693  vfo_t vfo,
2694  freq_t *freq));
2695 
2696 extern HAMLIB_EXPORT(int)
2697 rig_set_mode HAMLIB_PARAMS((RIG *rig,
2698  vfo_t vfo,
2699  rmode_t mode,
2700  pbwidth_t width));
2701 extern HAMLIB_EXPORT(int)
2702 rig_get_mode HAMLIB_PARAMS((RIG *rig,
2703  vfo_t vfo,
2704  rmode_t *mode,
2705  pbwidth_t *width));
2706 
2707 #if BUILTINFUNC
2708 #define rig_set_vfo(r,v) rig_set_vfo(r,v,__builtin_FUNCTION())
2709 extern HAMLIB_EXPORT(int)
2710 rig_set_vfo HAMLIB_PARAMS((RIG *rig,
2711  vfo_t vfo, const char *func));
2712 #else
2713 extern HAMLIB_EXPORT(int)
2714 rig_set_vfo HAMLIB_PARAMS((RIG *rig,
2715  vfo_t vfo));
2716 #endif
2717 extern HAMLIB_EXPORT(int)
2718 rig_get_vfo HAMLIB_PARAMS((RIG *rig,
2719  vfo_t *vfo));
2720 
2721 extern HAMLIB_EXPORT(int)
2722 rig_get_vfo_info HAMLIB_PARAMS((RIG *rig,
2723  vfo_t vfo,
2724  freq_t *freq,
2725  rmode_t *mode,
2726  pbwidth_t *width,
2727  split_t *split,
2728  int *satmode));
2729 
2730 extern HAMLIB_EXPORT(int)
2731 rig_get_vfo_list HAMLIB_PARAMS((RIG *rig, char *buf, int buflen));
2732 
2733 extern HAMLIB_EXPORT(int)
2734 netrigctl_get_vfo_mode HAMLIB_PARAMS((RIG *rig));
2735 
2736 extern HAMLIB_EXPORT(int)
2737 rig_set_ptt HAMLIB_PARAMS((RIG *rig,
2738  vfo_t vfo,
2739  ptt_t ptt));
2740 extern HAMLIB_EXPORT(int)
2741 rig_get_ptt HAMLIB_PARAMS((RIG *rig,
2742  vfo_t vfo,
2743  ptt_t *ptt));
2744 
2745 extern HAMLIB_EXPORT(int)
2746 rig_get_dcd HAMLIB_PARAMS((RIG *rig,
2747  vfo_t vfo,
2748  dcd_t *dcd));
2749 
2750 extern HAMLIB_EXPORT(int)
2751 rig_set_rptr_shift HAMLIB_PARAMS((RIG *rig,
2752  vfo_t vfo,
2753  rptr_shift_t rptr_shift));
2754 extern HAMLIB_EXPORT(int)
2755 rig_get_rptr_shift HAMLIB_PARAMS((RIG *rig,
2756  vfo_t vfo,
2757  rptr_shift_t *rptr_shift));
2758 
2759 extern HAMLIB_EXPORT(int)
2760 rig_set_rptr_offs HAMLIB_PARAMS((RIG *rig,
2761  vfo_t vfo,
2762  shortfreq_t rptr_offs));
2763 extern HAMLIB_EXPORT(int)
2764 rig_get_rptr_offs HAMLIB_PARAMS((RIG *rig,
2765  vfo_t vfo,
2766  shortfreq_t *rptr_offs));
2767 
2768 extern HAMLIB_EXPORT(int)
2769 rig_set_ctcss_tone HAMLIB_PARAMS((RIG *rig,
2770  vfo_t vfo,
2771  tone_t tone));
2772 extern HAMLIB_EXPORT(int)
2773 rig_get_ctcss_tone HAMLIB_PARAMS((RIG *rig,
2774  vfo_t vfo,
2775  tone_t *tone));
2776 
2777 extern HAMLIB_EXPORT(int)
2778 rig_set_dcs_code HAMLIB_PARAMS((RIG *rig,
2779  vfo_t vfo,
2780  tone_t code));
2781 extern HAMLIB_EXPORT(int)
2782 rig_get_dcs_code HAMLIB_PARAMS((RIG *rig,
2783  vfo_t vfo,
2784  tone_t *code));
2785 
2786 extern HAMLIB_EXPORT(int)
2787 rig_set_ctcss_sql HAMLIB_PARAMS((RIG *rig,
2788  vfo_t vfo,
2789  tone_t tone));
2790 extern HAMLIB_EXPORT(int)
2791 rig_get_ctcss_sql HAMLIB_PARAMS((RIG *rig,
2792  vfo_t vfo,
2793  tone_t *tone));
2794 
2795 extern HAMLIB_EXPORT(int)
2796 rig_set_dcs_sql HAMLIB_PARAMS((RIG *rig,
2797  vfo_t vfo,
2798  tone_t code));
2799 extern HAMLIB_EXPORT(int)
2800 rig_get_dcs_sql HAMLIB_PARAMS((RIG *rig,
2801  vfo_t vfo,
2802  tone_t *code));
2803 
2804 extern HAMLIB_EXPORT(int)
2805 rig_set_split_freq HAMLIB_PARAMS((RIG *rig,
2806  vfo_t vfo,
2807  freq_t tx_freq));
2808 extern HAMLIB_EXPORT(int)
2809 rig_get_split_freq HAMLIB_PARAMS((RIG *rig,
2810  vfo_t vfo,
2811  freq_t *tx_freq));
2812 
2813 extern HAMLIB_EXPORT(int)
2814 rig_set_split_mode HAMLIB_PARAMS((RIG *rig,
2815  vfo_t vfo,
2816  rmode_t tx_mode,
2817  pbwidth_t tx_width));
2818 extern HAMLIB_EXPORT(int)
2819 rig_get_split_mode HAMLIB_PARAMS((RIG *rig,
2820  vfo_t vfo,
2821  rmode_t *tx_mode,
2822  pbwidth_t *tx_width));
2823 
2824 extern HAMLIB_EXPORT(int)
2825 rig_set_split_freq_mode HAMLIB_PARAMS((RIG *rig,
2826  vfo_t vfo,
2827  freq_t tx_freq,
2828  rmode_t tx_mode,
2829  pbwidth_t tx_width));
2830 extern HAMLIB_EXPORT(int)
2831 rig_get_split_freq_mode HAMLIB_PARAMS((RIG *rig,
2832  vfo_t vfo,
2833  freq_t *tx_freq,
2834  rmode_t *tx_mode,
2835  pbwidth_t *tx_width));
2836 
2837 extern HAMLIB_EXPORT(int)
2838 rig_set_split_vfo HAMLIB_PARAMS((RIG *,
2839  vfo_t rx_vfo,
2840  split_t split,
2841  vfo_t tx_vfo));
2842 extern HAMLIB_EXPORT(int)
2843 rig_get_split_vfo HAMLIB_PARAMS((RIG *,
2844  vfo_t rx_vfo,
2845  split_t *split,
2846  vfo_t *tx_vfo));
2847 
2848 extern HAMLIB_EXPORT(int)
2849 rig_set_rit HAMLIB_PARAMS((RIG *rig,
2850  vfo_t vfo,
2851  shortfreq_t rit));
2852 extern HAMLIB_EXPORT(int)
2853 rig_get_rit HAMLIB_PARAMS((RIG *rig,
2854  vfo_t vfo,
2855  shortfreq_t *rit));
2856 
2857 extern HAMLIB_EXPORT(int)
2858 rig_set_xit HAMLIB_PARAMS((RIG *rig,
2859  vfo_t vfo,
2860  shortfreq_t xit));
2861 extern HAMLIB_EXPORT(int)
2862 rig_get_xit HAMLIB_PARAMS((RIG *rig,
2863  vfo_t vfo,
2864  shortfreq_t *xit));
2865 
2866 extern HAMLIB_EXPORT(int)
2867 rig_set_ts HAMLIB_PARAMS((RIG *rig,
2868  vfo_t vfo,
2869  shortfreq_t ts));
2870 extern HAMLIB_EXPORT(int)
2871 rig_get_ts HAMLIB_PARAMS((RIG *rig,
2872  vfo_t vfo,
2873  shortfreq_t *ts));
2874 
2875 extern HAMLIB_EXPORT(int)
2876 rig_power2mW HAMLIB_PARAMS((RIG *rig,
2877  unsigned int *mwpower,
2878  float power,
2879  freq_t freq,
2880  rmode_t mode));
2881 extern HAMLIB_EXPORT(int)
2882 rig_mW2power HAMLIB_PARAMS((RIG *rig,
2883  float *power,
2884  unsigned int mwpower,
2885  freq_t freq,
2886  rmode_t mode));
2887 
2888 extern HAMLIB_EXPORT(shortfreq_t)
2889 rig_get_resolution HAMLIB_PARAMS((RIG *rig,
2890  rmode_t mode));
2891 
2892 extern HAMLIB_EXPORT(int)
2893 rig_set_level HAMLIB_PARAMS((RIG *rig,
2894  vfo_t vfo,
2895  setting_t level,
2896  value_t val));
2897 extern HAMLIB_EXPORT(int)
2898 rig_get_level HAMLIB_PARAMS((RIG *rig,
2899  vfo_t vfo,
2900  setting_t level,
2901  value_t *val));
2902 
2903 #define rig_get_strength(r,v,s) rig_get_level((r),(v),RIG_LEVEL_STRENGTH, (value_t*)(s))
2904 
2905 extern HAMLIB_EXPORT(int)
2906 rig_set_parm HAMLIB_PARAMS((RIG *rig,
2907  setting_t parm,
2908  value_t val));
2909 extern HAMLIB_EXPORT(int)
2910 rig_get_parm HAMLIB_PARAMS((RIG *rig,
2911  setting_t parm,
2912  value_t *val));
2913 
2914 extern HAMLIB_EXPORT(int)
2915 rig_set_conf HAMLIB_PARAMS((RIG *rig,
2916  token_t token,
2917  const char *val));
2918 // deprecating rig_get_conf
2919 extern HAMLIB_EXPORT(int)
2920 rig_get_conf HAMLIB_PARAMS((RIG *rig,
2921  token_t token,
2922  char *val));
2923 extern HAMLIB_EXPORT(int)
2924 rig_get_conf2 HAMLIB_PARAMS((RIG *rig,
2925  token_t token,
2926  char *val,
2927  int val_len));
2928 
2929 extern HAMLIB_EXPORT(int)
2930 rig_set_powerstat HAMLIB_PARAMS((RIG *rig,
2931  powerstat_t status));
2932 extern HAMLIB_EXPORT(int)
2933 rig_get_powerstat HAMLIB_PARAMS((RIG *rig,
2934  powerstat_t *status));
2935 
2936 extern HAMLIB_EXPORT(int)
2937 rig_reset HAMLIB_PARAMS((RIG *rig,
2938  reset_t reset)); /* dangerous! */
2939 
2940 extern HAMLIB_EXPORT(int)
2941 rig_set_ext_level HAMLIB_PARAMS((RIG *rig,
2942  vfo_t vfo,
2943  token_t token,
2944  value_t val));
2945 extern HAMLIB_EXPORT(int)
2946 rig_get_ext_level HAMLIB_PARAMS((RIG *rig,
2947  vfo_t vfo,
2948  token_t token,
2949  value_t *val));
2950 
2951 extern HAMLIB_EXPORT(int)
2952 rig_set_ext_func HAMLIB_PARAMS((RIG *rig,
2953  vfo_t vfo,
2954  token_t token,
2955  int status));
2956 extern HAMLIB_EXPORT(int)
2957 rig_get_ext_func HAMLIB_PARAMS((RIG *rig,
2958  vfo_t vfo,
2959  token_t token,
2960  int *status));
2961 
2962 extern HAMLIB_EXPORT(int)
2963 rig_set_ext_parm HAMLIB_PARAMS((RIG *rig,
2964  token_t token,
2965  value_t val));
2966 extern HAMLIB_EXPORT(int)
2967 rig_get_ext_parm HAMLIB_PARAMS((RIG *rig,
2968  token_t token,
2969  value_t *val));
2970 
2971 extern HAMLIB_EXPORT(int)
2972 rig_ext_func_foreach HAMLIB_PARAMS((RIG *rig,
2973  int (*cfunc)(RIG *,
2974  const struct confparams *,
2975  rig_ptr_t),
2976  rig_ptr_t data));
2977 extern HAMLIB_EXPORT(int)
2978 rig_ext_level_foreach HAMLIB_PARAMS((RIG *rig,
2979  int (*cfunc)(RIG *,
2980  const struct confparams *,
2981  rig_ptr_t),
2982  rig_ptr_t data));
2983 extern HAMLIB_EXPORT(int)
2984 rig_ext_parm_foreach HAMLIB_PARAMS((RIG *rig,
2985  int (*cfunc)(RIG *,
2986  const struct confparams *,
2987  rig_ptr_t),
2988  rig_ptr_t data));
2989 
2990 extern HAMLIB_EXPORT(const struct confparams *)
2991 rig_ext_lookup HAMLIB_PARAMS((RIG *rig,
2992  const char *name));
2993 
2994 extern HAMLIB_EXPORT(const struct confparams *)
2995 rig_ext_lookup_tok HAMLIB_PARAMS((RIG *rig,
2996  token_t token));
2997 extern HAMLIB_EXPORT(token_t)
2998 rig_ext_token_lookup HAMLIB_PARAMS((RIG *rig,
2999  const char *name));
3000 
3001 
3002 extern HAMLIB_EXPORT(int)
3003 rig_token_foreach HAMLIB_PARAMS((RIG *rig,
3004  int (*cfunc)(const struct confparams *,
3005  rig_ptr_t),
3006  rig_ptr_t data));
3007 
3008 extern HAMLIB_EXPORT(const struct confparams *)
3009 rig_confparam_lookup HAMLIB_PARAMS((RIG *rig,
3010  const char *name));
3011 extern HAMLIB_EXPORT(token_t)
3012 rig_token_lookup HAMLIB_PARAMS((RIG *rig,
3013  const char *name));
3014 
3015 extern HAMLIB_EXPORT(int)
3016 rig_close HAMLIB_PARAMS((RIG *rig));
3017 
3018 extern HAMLIB_EXPORT(int)
3019 rig_cleanup HAMLIB_PARAMS((RIG *rig));
3020 
3021 extern HAMLIB_EXPORT(int)
3022 rig_set_ant HAMLIB_PARAMS((RIG *rig,
3023  vfo_t vfo,
3024  ant_t ant, /* antenna */
3025  value_t option)); /* optional ant info */
3026 extern HAMLIB_EXPORT(int)
3027 rig_get_ant HAMLIB_PARAMS((RIG *rig,
3028  vfo_t vfo,
3029  ant_t ant,
3030  value_t *option,
3031  ant_t *ant_curr,
3032  ant_t *ant_tx,
3033  ant_t *ant_rx));
3034 
3035 extern HAMLIB_EXPORT(setting_t)
3036 rig_has_get_level HAMLIB_PARAMS((RIG *rig,
3037  setting_t level));
3038 extern HAMLIB_EXPORT(setting_t)
3039 rig_has_set_level HAMLIB_PARAMS((RIG *rig,
3040  setting_t level));
3041 
3042 extern HAMLIB_EXPORT(setting_t)
3043 rig_has_get_parm HAMLIB_PARAMS((RIG *rig,
3044  setting_t parm));
3045 extern HAMLIB_EXPORT(setting_t)
3046 rig_has_set_parm HAMLIB_PARAMS((RIG *rig,
3047  setting_t parm));
3048 
3049 extern HAMLIB_EXPORT(setting_t)
3050 rig_has_get_func HAMLIB_PARAMS((RIG *rig,
3051  setting_t func));
3052 extern HAMLIB_EXPORT(setting_t)
3053 rig_has_set_func HAMLIB_PARAMS((RIG *rig,
3054  setting_t func));
3055 
3056 extern HAMLIB_EXPORT(int)
3057 rig_set_func HAMLIB_PARAMS((RIG *rig,
3058  vfo_t vfo,
3059  setting_t func,
3060  int status));
3061 extern HAMLIB_EXPORT(int)
3062 rig_get_func HAMLIB_PARAMS((RIG *rig,
3063  vfo_t vfo,
3064  setting_t func,
3065  int *status));
3066 
3067 extern HAMLIB_EXPORT(int)
3068 rig_send_dtmf HAMLIB_PARAMS((RIG *rig,
3069  vfo_t vfo,
3070  const char *digits));
3071 extern HAMLIB_EXPORT(int)
3072 rig_recv_dtmf HAMLIB_PARAMS((RIG *rig,
3073  vfo_t vfo,
3074  char *digits,
3075  int *length));
3076 
3077 extern HAMLIB_EXPORT(int)
3078 rig_send_morse HAMLIB_PARAMS((RIG *rig,
3079  vfo_t vfo,
3080  const char *msg));
3081 
3082 extern HAMLIB_EXPORT(int)
3083 rig_stop_morse HAMLIB_PARAMS((RIG *rig,
3084  vfo_t vfo));
3085 
3086 extern HAMLIB_EXPORT(int)
3087 rig_wait_morse HAMLIB_PARAMS((RIG *rig,
3088  vfo_t vfo));
3089 
3090 extern HAMLIB_EXPORT(int)
3091 rig_send_voice_mem HAMLIB_PARAMS((RIG *rig,
3092  vfo_t vfo,
3093  int ch));
3094 
3095 extern HAMLIB_EXPORT(int)
3096 rig_set_bank HAMLIB_PARAMS((RIG *rig,
3097  vfo_t vfo,
3098  int bank));
3099 
3100 extern HAMLIB_EXPORT(int)
3101 rig_set_mem HAMLIB_PARAMS((RIG *rig,
3102  vfo_t vfo,
3103  int ch));
3104 extern HAMLIB_EXPORT(int)
3105 rig_get_mem HAMLIB_PARAMS((RIG *rig,
3106  vfo_t vfo,
3107  int *ch));
3108 
3109 extern HAMLIB_EXPORT(int)
3110 rig_vfo_op HAMLIB_PARAMS((RIG *rig,
3111  vfo_t vfo,
3112  vfo_op_t op));
3113 
3114 extern HAMLIB_EXPORT(vfo_op_t)
3115 rig_has_vfo_op HAMLIB_PARAMS((RIG *rig,
3116  vfo_op_t op));
3117 
3118 extern HAMLIB_EXPORT(int)
3119 rig_scan HAMLIB_PARAMS((RIG *rig,
3120  vfo_t vfo,
3121  scan_t scan,
3122  int ch));
3123 
3124 extern HAMLIB_EXPORT(scan_t)
3125 rig_has_scan HAMLIB_PARAMS((RIG *rig,
3126  scan_t scan));
3127 
3128 extern HAMLIB_EXPORT(int)
3129 rig_set_channel HAMLIB_PARAMS((RIG *rig,
3130  vfo_t vfo,
3131  const channel_t *chan)); /* mem */
3132 extern HAMLIB_EXPORT(int)
3133 rig_get_channel HAMLIB_PARAMS((RIG *rig,
3134  vfo_t vfo,
3135  channel_t *chan, int read_only));
3136 
3137 extern HAMLIB_EXPORT(int)
3138 rig_set_chan_all HAMLIB_PARAMS((RIG *rig,
3139  vfo_t vfo,
3140  const channel_t chans[]));
3141 extern HAMLIB_EXPORT(int)
3142 rig_get_chan_all HAMLIB_PARAMS((RIG *rig,
3143  vfo_t vfo,
3144  channel_t chans[]));
3145 
3146 extern HAMLIB_EXPORT(int)
3147 rig_set_chan_all_cb HAMLIB_PARAMS((RIG *rig,
3148  vfo_t vfo,
3149  chan_cb_t chan_cb,
3150  rig_ptr_t));
3151 extern HAMLIB_EXPORT(int)
3152 rig_get_chan_all_cb HAMLIB_PARAMS((RIG *rig,
3153  vfo_t vfo,
3154  chan_cb_t chan_cb,
3155  rig_ptr_t));
3156 
3157 extern HAMLIB_EXPORT(int)
3158 rig_set_mem_all_cb HAMLIB_PARAMS((RIG *rig,
3159  vfo_t vfo,
3160  chan_cb_t chan_cb,
3161  confval_cb_t parm_cb,
3162  rig_ptr_t));
3163 extern HAMLIB_EXPORT(int)
3164 rig_get_mem_all_cb HAMLIB_PARAMS((RIG *rig,
3165  vfo_t vfo,
3166  chan_cb_t chan_cb,
3167  confval_cb_t parm_cb,
3168  rig_ptr_t));
3169 
3170 extern HAMLIB_EXPORT(int)
3171 rig_set_mem_all HAMLIB_PARAMS((RIG *rig,
3172  vfo_t vfo,
3173  const channel_t *chan,
3174  const struct confparams *,
3175  const value_t *));
3176 extern HAMLIB_EXPORT(int)
3177 rig_get_mem_all HAMLIB_PARAMS((RIG *rig,
3178  vfo_t vfo,
3179  channel_t *chan,
3180  const struct confparams *,
3181  value_t *));
3182 
3183 extern HAMLIB_EXPORT(const chan_t *)
3184 rig_lookup_mem_caps HAMLIB_PARAMS((RIG *rig,
3185  int ch));
3186 
3187 extern HAMLIB_EXPORT(int)
3188 rig_mem_count HAMLIB_PARAMS((RIG *rig));
3189 
3190 extern HAMLIB_EXPORT(int)
3191 rig_set_trn HAMLIB_PARAMS((RIG *rig,
3192  int trn));
3193 extern HAMLIB_EXPORT(int)
3194 rig_get_trn HAMLIB_PARAMS((RIG *rig,
3195  int *trn));
3196 
3197 extern HAMLIB_EXPORT(int)
3198 rig_set_freq_callback HAMLIB_PARAMS((RIG *,
3199  freq_cb_t,
3200  rig_ptr_t));
3201 
3202 extern HAMLIB_EXPORT(int)
3203 rig_set_mode_callback HAMLIB_PARAMS((RIG *,
3204  mode_cb_t,
3205  rig_ptr_t));
3206 extern HAMLIB_EXPORT(int)
3207 rig_set_vfo_callback HAMLIB_PARAMS((RIG *,
3208  vfo_cb_t,
3209  rig_ptr_t));
3210 
3211 extern HAMLIB_EXPORT(int)
3212 rig_set_ptt_callback HAMLIB_PARAMS((RIG *,
3213  ptt_cb_t,
3214  rig_ptr_t));
3215 
3216 extern HAMLIB_EXPORT(int)
3217 rig_set_dcd_callback HAMLIB_PARAMS((RIG *,
3218  dcd_cb_t,
3219  rig_ptr_t));
3220 
3221 extern HAMLIB_EXPORT(int)
3222 rig_set_pltune_callback HAMLIB_PARAMS((RIG *,
3223  pltune_cb_t,
3224  rig_ptr_t));
3225 
3226 extern HAMLIB_EXPORT(int)
3227 rig_set_spectrum_callback HAMLIB_PARAMS((RIG *,
3228  spectrum_cb_t,
3229  rig_ptr_t));
3230 
3231 extern HAMLIB_EXPORT(int)
3232 rig_set_twiddle HAMLIB_PARAMS((RIG *rig,
3233  int seconds));
3234 
3235 extern HAMLIB_EXPORT(int)
3236 rig_get_twiddle HAMLIB_PARAMS((RIG *rig,
3237  int *seconds));
3238 
3239 extern HAMLIB_EXPORT(int)
3240 rig_set_uplink HAMLIB_PARAMS((RIG *rig,
3241  int val));
3242 
3243 extern HAMLIB_EXPORT(const char *)
3244 rig_get_info HAMLIB_PARAMS((RIG *rig));
3245 
3246 extern HAMLIB_EXPORT(const struct rig_caps *)
3247 rig_get_caps HAMLIB_PARAMS((rig_model_t rig_model));
3248 
3249 extern HAMLIB_EXPORT(const freq_range_t *)
3250 rig_get_range HAMLIB_PARAMS((const freq_range_t *range_list,
3251  freq_t freq,
3252  rmode_t mode));
3253 
3254 extern HAMLIB_EXPORT(pbwidth_t)
3255 rig_passband_normal HAMLIB_PARAMS((RIG *rig,
3256  rmode_t mode));
3257 extern HAMLIB_EXPORT(pbwidth_t)
3258 rig_passband_narrow HAMLIB_PARAMS((RIG *rig,
3259  rmode_t mode));
3260 extern HAMLIB_EXPORT(pbwidth_t)
3261 rig_passband_wide HAMLIB_PARAMS((RIG *rig,
3262  rmode_t mode));
3263 
3264 extern HAMLIB_EXPORT(const char *)
3265 rigerror HAMLIB_PARAMS((int errnum));
3266 extern HAMLIB_EXPORT(const char *)
3267 rigerror2 HAMLIB_PARAMS((int errnum));
3268 
3269 extern HAMLIB_EXPORT(int)
3270 rig_setting2idx HAMLIB_PARAMS((setting_t s));
3271 
3272 #define HAMLIB_SETTINGS_FILE "hamlib_settings"
3273 
3274 extern HAMLIB_EXPORT(setting_t)
3275 rig_idx2setting(int i);
3276 /*
3277  * Even if these functions are prefixed with "rig_", they are not rig specific
3278  * Maybe "hamlib_" would have been better. Let me know. --SF
3279  */
3280 extern HAMLIB_EXPORT(void)
3281 rig_set_debug HAMLIB_PARAMS((enum rig_debug_level_e debug_level));
3282 
3283 extern HAMLIB_EXPORT(void)
3284 rig_set_debug_time_stamp HAMLIB_PARAMS((int flag));
3285 
3286 #define rig_set_debug_level(level) rig_set_debug(level)
3287 
3288 extern HAMLIB_EXPORT(int)
3289 rig_need_debug HAMLIB_PARAMS((enum rig_debug_level_e debug_level));
3290 
3291 
3292 extern HAMLIB_EXPORT(void)add2debugmsgsave(const char *s);
3293 // this needs to be fairly big to avoid compiler warnings
3294 extern HAMLIB_EXPORT_VAR(char) debugmsgsave[DEBUGMSGSAVE_SIZE]; // last debug msg
3295 extern HAMLIB_EXPORT_VAR(char) debugmsgsave2[DEBUGMSGSAVE_SIZE]; // last-1 debug msg
3296 // debugmsgsave3 is deprecated
3297 extern HAMLIB_EXPORT_VAR(char) debugmsgsave3[DEBUGMSGSAVE_SIZE]; // last-2 debug msg
3298 #ifndef __cplusplus
3299 #ifdef __GNUC__
3300 // doing the debug macro with a dummy sprintf allows gcc to check the format string
3301 #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)
3302 #endif
3303 #endif
3304 
3305 // Measuring elapsed time -- local variable inside function when macro is used
3306 #define ELAPSED1 struct timespec __begin; elapsed_ms(&__begin, HAMLIB_ELAPSED_SET);
3307 #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));
3308 
3309 // use this instead of snprintf for automatic detection of buffer limit
3310 #define SNPRINTF(s,n,...) { snprintf(s,n,##__VA_ARGS__);if (strlen(s) > n-1) fprintf(stderr,"****** %s(%d): buffer overflow ******\n", __func__, __LINE__); }
3311 
3312 extern HAMLIB_EXPORT(void)
3313 rig_debug HAMLIB_PARAMS((enum rig_debug_level_e debug_level,
3314  const char *fmt, ...));
3315 
3316 extern HAMLIB_EXPORT(vprintf_cb_t)
3317 rig_set_debug_callback HAMLIB_PARAMS((vprintf_cb_t cb,
3318  rig_ptr_t arg));
3319 
3320 extern HAMLIB_EXPORT(FILE *)
3321 rig_set_debug_file HAMLIB_PARAMS((FILE *stream));
3322 
3323 extern HAMLIB_EXPORT(int)
3324 rig_register HAMLIB_PARAMS((const struct rig_caps *caps));
3325 
3326 extern HAMLIB_EXPORT(int)
3327 rig_unregister HAMLIB_PARAMS((rig_model_t rig_model));
3328 
3329 extern HAMLIB_EXPORT(int)
3330 rig_list_foreach HAMLIB_PARAMS((int (*cfunc)(const struct rig_caps *, rig_ptr_t),
3331  rig_ptr_t data));
3332 
3333 extern HAMLIB_EXPORT(int)
3334 rig_list_foreach_model HAMLIB_PARAMS((int (*cfunc)(const rig_model_t rig_model, rig_ptr_t),
3335  rig_ptr_t data));
3336 
3337 extern HAMLIB_EXPORT(int)
3338 rig_load_backend HAMLIB_PARAMS((const char *be_name));
3339 
3340 extern HAMLIB_EXPORT(int)
3341 rig_check_backend HAMLIB_PARAMS((rig_model_t rig_model));
3342 
3343 extern HAMLIB_EXPORT(int)
3344 rig_load_all_backends HAMLIB_PARAMS((void));
3345 
3346 typedef int (*rig_probe_func_t)(const hamlib_port_t *, rig_model_t, rig_ptr_t);
3347 
3348 extern HAMLIB_EXPORT(int)
3349 rig_probe_all HAMLIB_PARAMS((hamlib_port_t *p,
3350  rig_probe_func_t,
3351  rig_ptr_t));
3352 
3353 extern HAMLIB_EXPORT(rig_model_t)
3354 rig_probe HAMLIB_PARAMS((hamlib_port_t *p));
3355 
3356 
3357 /* Misc calls */
3358 extern HAMLIB_EXPORT(const char *) rig_strrmode(rmode_t mode);
3359 extern HAMLIB_EXPORT(int) rig_strrmodes(rmode_t modes, char *buf, int buflen);
3360 extern HAMLIB_EXPORT(const char *) rig_strvfo(vfo_t vfo);
3361 extern HAMLIB_EXPORT(const char *) rig_strfunc(setting_t);
3362 extern HAMLIB_EXPORT(const char *) rig_strlevel(setting_t);
3363 extern HAMLIB_EXPORT(const char *) rig_strparm(setting_t);
3364 extern HAMLIB_EXPORT(const char *) rig_stragclevel(enum agc_level_e level);
3365 extern HAMLIB_EXPORT(enum agc_level_e) rig_levelagcstr (char *agcString);
3366 extern HAMLIB_EXPORT(enum agc_level_e) rig_levelagcvalue (int agcValue);
3367 extern HAMLIB_EXPORT(value_t) rig_valueagclevel (enum agc_level_e agcLevel);
3368 extern HAMLIB_EXPORT(const char *) rig_strptrshift(rptr_shift_t);
3369 extern HAMLIB_EXPORT(const char *) rig_strvfop(vfo_op_t op);
3370 extern HAMLIB_EXPORT(const char *) rig_strscan(scan_t scan);
3371 extern HAMLIB_EXPORT(const char *) rig_strstatus(enum rig_status_e status);
3372 extern HAMLIB_EXPORT(const char *) rig_strmtype(chan_type_t mtype);
3373 extern HAMLIB_EXPORT(const char *) rig_strspectrummode(enum rig_spectrum_mode_e mode);
3374 
3375 extern HAMLIB_EXPORT(rmode_t) rig_parse_mode(const char *s);
3376 extern HAMLIB_EXPORT(vfo_t) rig_parse_vfo(const char *s);
3377 extern HAMLIB_EXPORT(setting_t) rig_parse_func(const char *s);
3378 extern HAMLIB_EXPORT(setting_t) rig_parse_level(const char *s);
3379 extern HAMLIB_EXPORT(setting_t) rig_parse_parm(const char *s);
3380 extern HAMLIB_EXPORT(vfo_op_t) rig_parse_vfo_op(const char *s);
3381 extern HAMLIB_EXPORT(scan_t) rig_parse_scan(const char *s);
3382 extern HAMLIB_EXPORT(rptr_shift_t) rig_parse_rptr_shift(const char *s);
3383 extern HAMLIB_EXPORT(chan_type_t) rig_parse_mtype(const char *s);
3384 
3385 extern HAMLIB_EXPORT(const char *) rig_license HAMLIB_PARAMS((void));
3386 extern HAMLIB_EXPORT(const char *) rig_version HAMLIB_PARAMS((void));
3387 extern HAMLIB_EXPORT(const char *) rig_copyright HAMLIB_PARAMS((void));
3388 
3389 extern HAMLIB_EXPORT(void) rig_no_restore_ai(void);
3390 
3391 extern HAMLIB_EXPORT(int) rig_get_cache_timeout_ms(RIG *rig, hamlib_cache_t selection);
3392 extern HAMLIB_EXPORT(int) rig_set_cache_timeout_ms(RIG *rig, hamlib_cache_t selection, int ms);
3393 
3394 extern HAMLIB_EXPORT(int) rig_set_vfo_opt(RIG *rig, int status);
3395 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);
3396 extern HAMLIB_EXPORT(int) rig_get_rig_info(RIG *rig, char *response, int max_response_len);
3397 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);
3398 
3399 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);
3400 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);
3401 
3402 typedef unsigned long rig_useconds_t;
3403 extern HAMLIB_EXPORT(int) hl_usleep(rig_useconds_t msec);
3404 
3405 extern HAMLIB_EXPORT(int) rig_cookie(RIG *rig, enum cookie_e cookie_cmd, char *cookie, int cookie_len);
3406 
3407 extern HAMLIB_EXPORT(int) rig_password(RIG *rig, const char *key1);
3408 extern HAMLIB_EXPORT(void) rig_password_generate_secret(char *pass,
3409  char result[HAMLIB_SECRET_LENGTH + 1]);
3410 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);
3411 
3412 extern HAMLIB_EXPORT(int)
3413 longlat2locator HAMLIB_PARAMS((double longitude,
3414  double latitude,
3415  char *locator_res,
3416  int pair_count));
3417 
3418 extern HAMLIB_EXPORT(int)
3419 locator2longlat HAMLIB_PARAMS((double *longitude,
3420  double *latitude,
3421  const char *locator));
3422 
3423 extern HAMLIB_EXPORT(char*) rig_make_md5(char *pass);
3424 
3425 extern HAMLIB_EXPORT(int) rig_set_lock_mode(RIG *rig, int lock);
3426 extern HAMLIB_EXPORT(int) rig_get_lock_mode(RIG *rig, int *lock);
3427 
3428 
3430 
3431 __END_DECLS
3432 
3433 #endif /* _RIG_H */
3434 
setting_t rig_parse_parm(const char *s)
Convert alpha string to RIG_PARM_...
Definition: misc.c:1167
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:1366
const char * rig_strparm(setting_t parm)
Convert enum RIG_PARM_... to alpha string.
Definition: misc.c:1217
const char * rig_strptrshift(rptr_shift_t shift)
convert enum RIG_RPT_SHIFT_... to printable character
Definition: misc.c:1536
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:1561
value_t rig_valueagclevel(enum agc_level_e agcLevel)
Convert a enum agc_level_e to value.
Definition: misc.c:1315
uint64_t rig_idx2setting(int i)
Definition: misc.c:757
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:1604
const char * rig_strmtype(chan_type_t mtype)
Convert enum RIG_MTYPE_... to alpha string.
Definition: misc.c:1629
enum agc_level_e rig_levelagcvalue(int agcValue)
Convert a value to agc_level_e – constrains the range.
Definition: misc.c:1335
const char * rig_strspectrummode(enum rig_spectrum_mode_e mode)
Convert enum RIG_SPECTRUM_MODE_... to alpha string.
Definition: misc.c:1669
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:1507
setting_t rig_parse_level(const char *s)
Convert alpha string to enum RIG_LEVEL_...
Definition: misc.c:968
scan_t rig_parse_scan(const char *s)
Convert alpha string to enum RIG_SCAN_...
Definition: misc.c:1482
const char * rig_stragclevel(enum agc_level_e level)
Convert enum RIG_AGC_... to alpha string.
Definition: misc.c:1290
setting_t rig_parse_func(const char *s)
Convert alpha string to enum RIG_FUNC_...
Definition: misc.c:769
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:1437
const char * rig_strlevel(setting_t level)
Convert enum RIG_LEVEL_... to alpha string.
Definition: misc.c:1049
const char * rig_strfunc(setting_t func)
Convert enum RIG_FUNC_... to alpha string.
Definition: misc.c:819
vfo_op_t rig_parse_vfo_op(const char *s)
Convert alpha string to enum RIG_OP_...
Definition: misc.c:1412
int rig_set_vfo(RIG *rig, vfo_t vfo)
set the current VFO
Definition: rig.c:2655
unsigned int vfo_t
VFO definition.
Definition: rig.h:469
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:4673
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:6200
int rig_set_twiddle(RIG *rig, int seconds)
timeout (secs) to stop rigctld when VFO is manually changed
Definition: rig.c:1578
int rig_get_rig_info(RIG *rig, char *response, int max_response_len)
get freq/mode/width for requested VFO
Definition: rig.c:6798
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:1528
int rig_get_dcd(RIG *rig, vfo_t vfo, dcd_t *dcd)
get the status of the DCD
Definition: rig.c:3466
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:4893
int rig_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
Definition: rig.c:2349
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:4733
dcd_e
DCD status.
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:2361
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:3808
int rig_set_powerstat(RIG *rig, powerstat_t status)
turn on/off the radio
Definition: rig.c:5806
int rig_get_powerstat(RIG *rig, powerstat_t *status)
get the on/off status of the radio
Definition: rig.c:5844
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:5653
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:2806
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:4555
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:601
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:5105
int rig_cleanup(RIG *rig)
release a rig handle and free associated memory
Definition: rig.c:1536
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:1460
enum rig_port_e rig_port_t
Port type.
split_t
Split mode.
Definition: rig.h:398
int rig_get_vfo_list(RIG *rig, char *buf, int buflen)
get list of available vfos
Definition: rig.c:6958
rptr_shift_t
Repeater shift type.
Definition: rig.h:388
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:1326
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:6097
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:6992
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:1394
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:1936
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:3183
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:1126
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:5709
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:5253
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:3738
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:5482
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:5765
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:6890
pbwidth_t rig_passband_wide(RIG *rig, rmode_t mode)
get the wide passband of a mode
Definition: rig.c:2598
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:1603
enum dcd_e dcd_t
DCD status.
int rig_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status)
get the status of functions of the radio
Definition: settings.c:549
int rig_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq)
set the split frequencies
Definition: rig.c:3883
int rig_probe_all(hamlib_port_t *port, rig_probe_func_t cfunc, rig_ptr_t data)
try to guess rigs
Definition: rig.c:5958
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:6591
int rig_recv_dtmf(RIG *rig, vfo_t vfo, char *digits, int *length)
receive DTMF digits
Definition: rig.c:6276
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:1711
int rig_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt)
set PTT on/off
Definition: rig.c:2889
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:409
int rig_scan(RIG *rig, vfo_t vfo, scan_t scan, int ch)
perform Memory/VFO operations
Definition: rig.c:6129
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:6351
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:1653
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:6976
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:2200
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:5401
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:431
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:7022
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:6527
int rig_close(RIG *rig)
close the communication to the rig
Definition: rig.c:1378
pbwidth_t rig_passband_narrow(RIG *rig, rmode_t mode)
get the narrow passband of a mode
Definition: rig.c:2546
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:1587
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:1210
int rig_set_chan_all(RIG *rig, vfo_t vfo, const channel_t chans[])
set all channel data
Definition: mem.c:1167
int rig_set_vfo_opt(RIG *rig, int status)
set the vfo option for rigctld
Definition: rig.c:6696
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:2495
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:7012
int rig_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit)
set the RIT
Definition: rig.c:5034
const char * rig_copyright()
get the Hamlib copyright
Definition: rig.c:7032
int rig_get_twiddle(RIG *rig, int *seconds)
get the twiddle timeout value (secs)
Definition: rig.c:1629
int rig_set_ts(RIG *rig, vfo_t vfo, shortfreq_t ts)
set the Tuning Step
Definition: rig.c:5330
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:5561
int rig_open(RIG *rig)
open the communication to the rig
Definition: rig.c:798
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:6423
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:6729
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:1079
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:4200
int rig_reset(RIG *rig, reset_t reset)
reset the radio
Definition: rig.c:5886
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:5987
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:3662
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:4419
int rig_set_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t rptr_shift)
set the repeater shift
Definition: rig.c:3591
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:4048
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:6018
rig_status_e
Development status of the backend.
Definition: rig.h:368
int rig_set_xit(RIG *rig, vfo_t vfo, shortfreq_t xit)
set the XIT
Definition: rig.c:5182
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:7061
rig_spectrum_mode_e
Spectrum scope modes.
Definition: rig.h:1700
rig_model_t rig_probe(hamlib_port_t *port)
try to guess a rig
Definition: rig.c:5930
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:6660
chan_type_t
Memory channel type definition.
Definition: rig.h:1551
@ 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:400
@ RIG_SPLIT_OFF
Definition: rig.h:399
@ RIG_RPT_SHIFT_PLUS
Definition: rig.h:391
@ RIG_RPT_SHIFT_MINUS
Definition: rig.h:390
@ RIG_RPT_SHIFT_NONE
Definition: rig.h:389
@ 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:372
@ RIG_STATUS_BUGGY
Definition: rig.h:373
@ RIG_STATUS_UNTESTED
Definition: rig.h:370
@ RIG_STATUS_BETA
Definition: rig.h:371
@ RIG_STATUS_ALPHA
Definition: rig.h:369
@ RIG_SPECTRUM_MODE_CENTER_SCROLL
Definition: rig.h:1704
@ RIG_SPECTRUM_MODE_FIXED_SCROLL
Definition: rig.h:1705
@ RIG_SPECTRUM_MODE_FIXED
Definition: rig.h:1703
@ RIG_SPECTRUM_MODE_CENTER
Definition: rig.h:1702
@ RIG_MTYPE_PRIO
Definition: rig.h:1559
@ RIG_MTYPE_EDGE
Definition: rig.h:1554
@ RIG_MTYPE_MEM
Definition: rig.h:1553
@ RIG_MTYPE_CALL
Definition: rig.h:1555
@ RIG_MTYPE_SAT
Definition: rig.h:1557
@ RIG_MTYPE_MEMOPAD
Definition: rig.h:1556
@ RIG_MTYPE_NONE
Definition: rig.h:1552
@ RIG_MTYPE_BAND
Definition: rig.h:1558
int locator2longlat(double *longitude, double *latitude, const char *locator)
Convert QRA locator (Maidenhead grid square) to Longitude/Latitude.
Definition: locator.c:451
int longlat2locator(double longitude, double latitude, char *locator, int pair_count)
Convert longitude/latitude to QRA locator (Maidenhead grid square).
Definition: locator.c:545
Calibration table struct for float values.
Definition: rig.h:1656
float val
Definition: rig.h:1660
struct cal_table_float::@4 table[HAMLIB_MAX_CAL_LENGTH]
int size
Definition: rig.h:1657
int raw
Definition: rig.h:1659
Calibration table struct.
Definition: rig.h:1626
int val
Definition: rig.h:1630
struct cal_table::@3 table[HAMLIB_MAX_CAL_LENGTH]
int raw
Definition: rig.h:1629
int size
Definition: rig.h:1627
Memory channel list definition.
Definition: rig.h:1576
int startc
Definition: rig.h:1577
chan_type_t type
Definition: rig.h:1579
channel_cap_t mem_caps
Definition: rig.h:1581
int endc
Definition: rig.h:1578
Channel capability definition.
Definition: rig.h:1504
unsigned tx_vfo
Definition: rig.h:1517
unsigned tx_freq
Definition: rig.h:1512
unsigned mode
Definition: rig.h:1509
unsigned dcs_code
Definition: rig.h:1527
unsigned rit
Definition: rig.h:1521
unsigned dcs_sql
Definition: rig.h:1528
unsigned rptr_offs
Definition: rig.h:1519
unsigned bank_num
Definition: rig.h:1505
setting_t levels
Definition: rig.h:1524
unsigned width
Definition: rig.h:1510
unsigned rptr_shift
Definition: rig.h:1518
unsigned tx_width
Definition: rig.h:1514
unsigned ctcss_sql
Definition: rig.h:1526
unsigned tx_mode
Definition: rig.h:1513
unsigned freq
Definition: rig.h:1508
setting_t funcs
Definition: rig.h:1523
unsigned ctcss_tone
Definition: rig.h:1525
unsigned ext_levels
Definition: rig.h:1532
unsigned vfo
Definition: rig.h:1506
unsigned ant
Definition: rig.h:1507
unsigned split
Definition: rig.h:1516
unsigned scan_group
Definition: rig.h:1529
unsigned flags
Definition: rig.h:1530
unsigned tuning_step
Definition: rig.h:1520
unsigned xit
Definition: rig.h:1522
unsigned channel_desc
Definition: rig.h:1531
Channel structure.
Definition: rig.h:1460
shortfreq_t tuning_step
Definition: rig.h:1478
rmode_t mode
Definition: rig.h:1466
tone_t ctcss_tone
Definition: rig.h:1483
pbwidth_t tx_width
Definition: rig.h:1471
vfo_t vfo
Definition: rig.h:1463
value_t levels[64]
Definition: rig.h:1482
shortfreq_t rptr_offs
Definition: rig.h:1477
vfo_t tx_vfo
Definition: rig.h:1474
tone_t dcs_code
Definition: rig.h:1485
setting_t funcs
Definition: rig.h:1481
struct ext_list * ext_levels
Definition: rig.h:1490
tone_t ctcss_sql
Definition: rig.h:1484
shortfreq_t xit
Definition: rig.h:1480
int bank_num
Definition: rig.h:1462
pbwidth_t width
Definition: rig.h:1467
freq_t freq
Definition: rig.h:1465
rptr_shift_t rptr_shift
Definition: rig.h:1476
shortfreq_t rit
Definition: rig.h:1479
char channel_desc[HAMLIB_MAXCHANDESC]
Definition: rig.h:1489
rmode_t tx_mode
Definition: rig.h:1470
split_t split
Definition: rig.h:1473
freq_t tx_freq
Definition: rig.h:1469
ant_t ant
Definition: rig.h:1464
unsigned int flags
Definition: rig.h:1488
int scan_group
Definition: rig.h:1487
int channel_num
Definition: rig.h:1461
tone_t dcs_sql
Definition: rig.h:1486
Configuration parameter structure.
Definition: rig.h: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:1443
token_t token
Definition: rig.h:1444
value_t val
Definition: rig.h:1445
Filter definition.
Definition: rig.h:1410
rmode_t modes
Definition: rig.h:1411
pbwidth_t width
Definition: rig.h:1412
Frequency range.
Definition: rig.h:1343
freq_t startf
Definition: rig.h:1344
freq_t endf
Definition: rig.h:1345
int low_power
Definition: rig.h:1347
char * label
Definition: rig.h:1351
ant_t ant
Definition: rig.h:1350
int high_power
Definition: rig.h:1348
vfo_t vfo
Definition: rig.h:1349
rmode_t modes
Definition: rig.h:1346
level/parm granularity definition
Definition: rig.h:1611
value_t max
Definition: rig.h:1613
value_t step
Definition: rig.h:1614
value_t min
Definition: rig.h:1612
Definition: network.c:123
Rig cache data.
Definition: rig.h:2391
Callback functions and args for rig event.
Definition: rig.h:2632
rig_ptr_t mode_arg
Definition: rig.h:2636
ptt_cb_t ptt_event
Definition: rig.h:2639
vfo_cb_t vfo_event
Definition: rig.h:2637
spectrum_cb_t spectrum_event
Definition: rig.h:2645
mode_cb_t mode_event
Definition: rig.h:2635
rig_ptr_t freq_arg
Definition: rig.h:2634
rig_ptr_t spectrum_arg
Definition: rig.h:2646
rig_ptr_t ptt_arg
Definition: rig.h:2640
rig_ptr_t dcd_arg
Definition: rig.h:2642
dcd_cb_t dcd_event
Definition: rig.h:2641
rig_ptr_t pltune_arg
Definition: rig.h:2644
pltune_cb_t pltune
Definition: rig.h:2643
rig_ptr_t vfo_arg
Definition: rig.h:2638
freq_cb_t freq_event
Definition: rig.h:2633
Spectrum scope averaging modes.
Definition: rig.h:1712
Represents a single line of rig spectrum scope FFT data.
Definition: rig.h:1729
size_t spectrum_data_length
Definition: rig.h:1745
freq_t low_edge_freq
Definition: rig.h:1742
int data_level_min
Definition: rig.h:1732
int id
Definition: rig.h:1730
enum rig_spectrum_mode_e spectrum_mode
Definition: rig.h:1737
double signal_strength_max
Definition: rig.h:1735
freq_t center_freq
Definition: rig.h:1739
freq_t span_freq
Definition: rig.h:1740
double signal_strength_min
Definition: rig.h:1734
unsigned char * spectrum_data
Definition: rig.h:1746
int data_level_max
Definition: rig.h:1733
freq_t high_edge_freq
Definition: rig.h:1743
Spectrum scope.
Definition: rig.h:1692
Rig state containing live data and customized fields.
Definition: rig.h:2476
int auto_power_on
Definition: rig.h:2554
int transaction_active
Definition: rig.h:2527
int attenuator[HAMLIB_MAXDBLSTSIZ]
Definition: rig.h:2510
int vfo_opt
Definition: rig.h:2553
int twiddle_rit
Definition: rig.h:2566
setting_t has_set_parm
Definition: rig.h:2517
rmode_t mode_list
Definition: rig.h:2541
int async_data_enabled
Definition: rig.h:2534
shortfreq_t max_rit
Definition: rig.h:2503
freq_t lo_freq
Definition: rig.h:2547
int power_max
Definition: rig.h:2564
gran_t parm_gran[64]
Definition: rig.h:2520
freq_range_t rx_range_list[HAMLIB_FRQRANGESIZ]
Definition: rig.h:2492
hamlib_port_t_deprecated rigport_deprecated
Definition: rig.h:2485
vfo_t rx_vfo
Definition: rig.h:2568
rmode_t current_mode
Definition: rig.h:2537
setting_t has_set_func
Definition: rig.h:2513
int uplink
Definition: rig.h:2551
rig_ptr_t obj
Definition: rig.h:2532
int twiddle_state
Definition: rig.h:2567
struct filter_list filters[HAMLIB_FLTLSTSIZ]
Definition: rig.h:2497
pbwidth_t current_width
Definition: rig.h:2539
int ptt_share
Definition: rig.h:2561
rig_ptr_t priv
Definition: rig.h:2531
freq_range_t tx_range_list[HAMLIB_FRQRANGESIZ]
Definition: rig.h:2493
freq_t current_freq
Definition: rig.h:2536
hamlib_port_t dcdport
Definition: rig.h:2581
time_t twiddle_time
Definition: rig.h:2548
vfo_t tx_vfo
Definition: rig.h:2540
int deprecated_itu_region
Definition: rig.h:2491
int power_min
Definition: rig.h:2563
double vfo_comp
Definition: rig.h:2489
setting_t has_set_level
Definition: rig.h:2515
hamlib_port_t_deprecated pttport_deprecated
Definition: rig.h:2486
shortfreq_t max_xit
Definition: rig.h:2504
hamlib_port_t rigport
Definition: rig.h:2579
int power_now
Definition: rig.h:2562
int twiddle_timeout
Definition: rig.h:2549
int poll_interval
Definition: rig.h:2535
unsigned char disable_yaesu_bandselect
Definition: rig.h:2565
int auto_power_off
Definition: rig.h:2556
setting_t has_get_parm
Definition: rig.h:2516
int preamp[HAMLIB_MAXDBLSTSIZ]
Definition: rig.h:2509
vfo_t current_vfo
Definition: rig.h:2528
hamlib_port_t_deprecated dcdport_deprecated
Definition: rig.h:2487
int auto_disable_screensaver
Definition: rig.h:2558
int comm_state
Definition: rig.h:2530
int vfo_list
Definition: rig.h:2529
setting_t has_get_level
Definition: rig.h:2514
setting_t has_get_func
Definition: rig.h:2512
int transmit
Definition: rig.h:2544
ann_t announces
Definition: rig.h:2507
cal_table_t str_cal
Definition: rig.h:2499
shortfreq_t max_ifshift
Definition: rig.h:2505
gran_t level_gran[64]
Definition: rig.h:2519
hamlib_port_t pttport
Definition: rig.h:2580
struct tuning_step_list tuning_steps[HAMLIB_TSLSTSIZ]
Definition: rig.h:2495
The Rig structure.
Definition: rig.h:2660
struct rig_callbacks callbacks
Definition: rig.h:2663
struct rig_state state
Definition: rig.h:2662
struct rig_caps * caps
Definition: rig.h:2661
Tuning step definition.
Definition: rig.h:1375
rmode_t modes
Definition: rig.h:1376
shortfreq_t ts
Definition: rig.h:1377
Universal approach for passing values.
Definition: rig.h: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