1 /*
2     Gpredict: Real-time satellite tracking and orbit prediction program
3 
4     Copyright (C)  2001-2015  Alexandru Csete.
5 
6     Authors: Alexandru Csete <oz9aec@gmail.com>
7 
8     Comments, questions and bugreports should be submitted via
9     http://sourceforge.net/projects/gpredict/
10     More details can be found at the project home page:
11 
12             http://gpredict.oz9aec.net/
13 
14     This program is free software; you can redistribute it and/or modify
15     it under the terms of the GNU General Public License as published by
16     the Free Software Foundation; either version 2 of the License, or
17     (at your option) any later version.
18 
19     This program is distributed in the hope that it will be useful,
20     but WITHOUT ANY WARRANTY; without even the implied warranty of
21     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22     GNU General Public License for more details.
23 
24     You should have received a copy of the GNU General Public License
25     along with this program; if not, visit http://www.fsf.org/
26 
27 
28 */
29 #ifndef RADIO_CONF_H
30 #define RADIO_CONF_H 1
31 
32 #include <glib.h>
33 
34 
35 /** \brief Radio types. */
36 typedef enum {
37     RIG_TYPE_RX = 0,            /*!< Rig can only be used as receiver */
38     RIG_TYPE_TX,                /*!< Rig can only be used as transmitter */
39     RIG_TYPE_TRX,               /*!< Rig can be used as RX/TX (simplex only) */
40     RIG_TYPE_DUPLEX,            /*!< Rig is a full duplex radio, e.g. IC910 */
41     RIG_TYPE_TOGGLE_AUTO,       /*!< Special mode for FT-817, 857 and 897 using auto T/R switch */
42     RIG_TYPE_TOGGLE_MAN         /*!< Special mode for FT-817, 857 and 897 using manual T/R switch */
43 } rig_type_t;
44 
45 typedef enum {
46     PTT_TYPE_NONE = 0,          /*!< Don't read PTT */
47     PTT_TYPE_CAT,               /*!< Read PTT using get_ptt CAT command */
48     PTT_TYPE_DCD                /*!< Read PTT using get_dcd */
49 } ptt_type_t;
50 
51 typedef enum {
52     VFO_NONE = 0,
53     VFO_A,
54     VFO_B,
55     VFO_MAIN,
56     VFO_SUB
57 } vfo_t;
58 
59 /** \brief Radio configuration. */
60 typedef struct {
61     gchar          *name;       /*!< Configuration file name, without .rig. */
62     gchar          *host;       /*!< hostname or IP */
63     gint            port;       /*!< port number */
64     gdouble         lo;         /*!< local oscillator freq in Hz (using double for
65                                    compatibility with rest of code). Downlink. */
66     gdouble         loup;       /*!< local oscillator freq in Hz for uplink. */
67     rig_type_t      type;       /*!< Radio type */
68     ptt_type_t      ptt;        /*!< PTT type (needed for RX, TX, and TRX) */
69     vfo_t           vfoDown;    /*!< Downlink VFO for full-duplex radios */
70     vfo_t           vfoUp;      /*!< Uplink VFO for full-duplex radios */
71 
72     gboolean        signal_aos; /*!< Send AOS notification to RIG */
73     gboolean        signal_los; /*!< Send LOS notification to RIG */
74 } radio_conf_t;
75 
76 
77 gboolean        radio_conf_read(radio_conf_t * conf);
78 void            radio_conf_save(radio_conf_t * conf);
79 
80 
81 #endif
82