1 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 /* 3 Grig: Gtk+ user interface for the Hamradio Control Libraries. 4 5 Copyright (C) 2001-2007 Alexandru Csete. 6 7 Authors: Alexandru Csete <oz9aec@gmail.com> 8 9 Comments, questions and bugreports should be submitted via 10 http://sourceforge.net/projects/groundstation/ 11 More details can be found at the project home page: 12 13 http://groundstation.sourceforge.net/ 14 15 This program is free software; you can redistribute it and/or modify 16 it under the terms of the GNU General Public License as published by 17 the Free Software Foundation; either version 2 of the License, or 18 (at your option) any later version. 19 20 This program is distributed in the hope that it will be useful, 21 but WITHOUT ANY WARRANTY; without even the implied warranty of 22 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 23 GNU General Public License for more details. 24 25 You should have received a copy of the GNU General Public License 26 along with this program; if not, visit http://www.fsf.org/ 27 28 29 30 31 */ 32 #ifndef RIG_DAEMON_H 33 #define RIG_DAEMON_H 1 34 35 36 37 38 #define C_MAX_CMD_PER_CYCLE 101 /*!< Max number of commands executed in one cycle */ 39 #define C_MAX_CYCLES 6 /*!< Number of cycles */ 40 41 #define C_DEF_RX_CMD_DELAY 10 /*!< Default delay between two RX commands [msec] */ 42 43 44 #define C_RIG_DAEMON_STOP_TIMEOUT 10000 /*!< Timeout to let the daemon process stop [msec] */ 45 #define C_RIG_DAEMON_STOP_SLEEP_TIME 100 /*!< Time to sleep between succesive attempts to cheack the clear flag. [msec] */ 46 47 48 /** \brief List of available commands. 49 * 50 * This enumeration lists the available commands that can be executed by the RIG daemon. 51 * These values should be used to define each daemon cycle. 52 */ 53 typedef enum { 54 RIG_CMD_NONE = 0, /*!< Not command. Can be used for delays between commands. */ 55 56 RIG_CMD_GET_FREQ_1, /*!< Command to acquire primary frequency from rig. */ 57 RIG_CMD_SET_FREQ_1, /*!< Command to set primary frequency. */ 58 RIG_CMD_GET_FREQ_2, /*!< Command to acquire secondary frequency from rig. */ 59 RIG_CMD_SET_FREQ_2, /*!< Command to set secondary frequency. */ 60 RIG_CMD_GET_RIT, /*!< Command to get current RIT value. */ 61 RIG_CMD_SET_RIT, /*!< Command to set new RIT value. */ 62 RIG_CMD_GET_XIT, /*!< Command to get current XIT value. */ 63 RIG_CMD_SET_XIT, /*!< Command to set new XIT value. */ 64 RIG_CMD_GET_VFO, /*!< Command to get currently active VFO. */ 65 RIG_CMD_SET_VFO, /*!< Command to select new VFO. */ 66 RIG_CMD_GET_PSTAT, /*!< Command to read power status (mains pwr, ON/OFF/STDBY). */ 67 RIG_CMD_SET_PSTAT, /*!< Command to set new power status (ON/OFF/STDBY). */ 68 RIG_CMD_GET_PTT, /*!< Command to get the current PTT status. */ 69 RIG_CMD_SET_PTT, /*!< Command to set the current PTT status. */ 70 RIG_CMD_GET_MODE, /*!< Command to get the current mode and passband width. */ 71 RIG_CMD_SET_MODE, /*!< Command to set the new mode and/or passband width. */ 72 RIG_CMD_GET_AGC, /*!< Command to get the automatic gain control level. */ 73 RIG_CMD_SET_AGC, /*!< Command to set the automatic gain control level. */ 74 RIG_CMD_GET_ATT, /*!< Command to get the attenuator level. */ 75 RIG_CMD_SET_ATT, /*!< Command to set the attenuator level. */ 76 RIG_CMD_GET_PREAMP, /*!< Command to get the pre-amplifier level. */ 77 RIG_CMD_SET_PREAMP, /*!< Command to set the pre-amplifier level. */ 78 RIG_CMD_SET_SPLIT, /*!< Command to set split mode ON/OFF. */ 79 RIG_CMD_GET_SPLIT, /*!< Command to retrieve the current status of split. */ 80 81 /* levels */ 82 RIG_CMD_SET_AF, 83 RIG_CMD_GET_AF, 84 RIG_CMD_SET_RF, 85 RIG_CMD_GET_RF, 86 RIG_CMD_SET_SQL, 87 RIG_CMD_GET_SQL, 88 RIG_CMD_SET_IFS, 89 RIG_CMD_GET_IFS, 90 RIG_CMD_SET_APF, 91 RIG_CMD_GET_APF, 92 RIG_CMD_SET_NR, 93 RIG_CMD_GET_NR, 94 RIG_CMD_SET_NOTCH, 95 RIG_CMD_GET_NOTCH, 96 RIG_CMD_SET_PBT_IN, 97 RIG_CMD_GET_PBT_IN, 98 RIG_CMD_SET_PBT_OUT, 99 RIG_CMD_GET_PBT_OUT, 100 RIG_CMD_SET_CW_PITCH, 101 RIG_CMD_GET_CW_PITCH, 102 RIG_CMD_SET_KEYSPD, 103 RIG_CMD_GET_KEYSPD, 104 RIG_CMD_SET_BKINDEL, 105 RIG_CMD_GET_BKINDEL, 106 RIG_CMD_SET_BALANCE, 107 RIG_CMD_GET_BALANCE, 108 RIG_CMD_SET_VOXDEL, 109 RIG_CMD_GET_VOXDEL, 110 RIG_CMD_SET_VOXGAIN, 111 RIG_CMD_GET_VOXGAIN, 112 RIG_CMD_SET_ANTIVOX, 113 RIG_CMD_GET_ANTIVOX, 114 RIG_CMD_SET_MICGAIN, 115 RIG_CMD_GET_MICGAIN, 116 RIG_CMD_SET_COMP, 117 RIG_CMD_GET_COMP, 118 119 RIG_CMD_GET_STRENGTH, /*!< Command to get signal strength. */ 120 RIG_CMD_SET_POWER, /*!< Command to set TX power. */ 121 RIG_CMD_GET_POWER, /*!< Command to get TX power. */ 122 RIG_CMD_GET_SWR, /*!< Command to get SWR level. */ 123 RIG_CMD_SET_ALC, /*!< Command to set ALC level. */ 124 RIG_CMD_GET_ALC, /*!< Command to get ALC level. */ 125 126 RIG_CMD_GET_LOCK, /*!< Command to get LOCK status. */ 127 RIG_CMD_SET_LOCK, /*!< Command to set LOCK status. */ 128 129 RIG_CMD_VFO_TOGGLE, /*!< Executes RIG_OP_TOGGLE. */ 130 RIG_CMD_VFO_COPY, /*!< Executes RIG_OP_CPY. */ 131 RIG_CMD_VFO_XCHG, /*!< Executes RIG_OP_XCHG. */ 132 133 RIG_CMD_SET_FUNC, /*!< Command to set func. */ 134 RIG_CMD_GET_FUNC, /*!< Command to get func. */ 135 136 RIG_CMD_NUMBER /*!< Number of available commands. */ 137 } rig_cmd_t; 138 139 140 141 int rig_daemon_start (int, const gchar *, 142 int, const gchar *, 143 const gchar *, gint, 144 gboolean, gboolean, gboolean); 145 void rig_daemon_stop (void); 146 void rig_daemon_set_suspend (gboolean); 147 gboolean rig_daemon_get_suspend (void); 148 gchar *rig_daemon_get_brand (void); 149 gchar *rig_daemon_get_model (void); 150 gint rig_daemon_get_rig_id (void); 151 gint rig_daemon_get_delay (void); 152 153 #endif 154