2000-09-04 03:50:42 +00:00
|
|
|
/* hamlib - (C) Frank Singleton 2000 (vk3fcs@ix.netcom.com)
|
|
|
|
*
|
2000-09-14 00:52:27 +00:00
|
|
|
* rig.h - Copyright (C) 2000 Frank Singleton and Stephane Fillod
|
|
|
|
* This program defines the Hamlib API
|
2000-09-04 03:50:42 +00:00
|
|
|
*
|
|
|
|
*
|
2000-09-14 00:52:27 +00:00
|
|
|
* $Id: rig.h,v 1.4 2000-09-14 00:52:27 f4cfe Exp $ *
|
2000-09-04 03:50:42 +00:00
|
|
|
*
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2000-09-14 00:52:27 +00:00
|
|
|
#ifndef _RIG_H
|
|
|
|
#define _RIG_H 1
|
2000-09-04 03:19:25 +00:00
|
|
|
|
2000-09-14 00:52:27 +00:00
|
|
|
#include <rigcaps.h>
|
2000-09-04 03:19:25 +00:00
|
|
|
|
2000-09-14 00:52:27 +00:00
|
|
|
enum rig_parity_e; /* forward reference to <rigcaps.h> */
|
2000-09-04 03:19:25 +00:00
|
|
|
|
2000-09-14 00:52:27 +00:00
|
|
|
struct rig_state {
|
|
|
|
unsigned short int serial_rate;
|
|
|
|
unsigned char serial_data_bits; /* eg 8 */
|
|
|
|
unsigned char serial_stop_bits; /* eg 2 */
|
|
|
|
enum rig_parity_e serial_parity; /* */
|
|
|
|
char rig_path[MAXRIGPATHLEN]; /* requested serial port or network path(host:port) */
|
|
|
|
int fd; /* serial port/socket file handle */
|
|
|
|
void *priv; /* pointer to private data */
|
|
|
|
/* stuff like CI_V_address for Icom goes in the *priv 51 area */
|
|
|
|
|
|
|
|
/* etc... */
|
|
|
|
};
|
2000-09-04 03:19:25 +00:00
|
|
|
|
2000-09-04 17:51:35 +00:00
|
|
|
/*
|
2000-09-14 00:52:27 +00:00
|
|
|
* event based programming,
|
|
|
|
* really appropriate in a GUI.
|
|
|
|
* So far, haven't heard of any rig capable of this. --SF
|
2000-09-04 17:51:35 +00:00
|
|
|
*/
|
2000-09-14 00:52:27 +00:00
|
|
|
struct rig_callbacks {
|
|
|
|
/* the rig notify the host computer someone changed
|
|
|
|
* the freq/mode from the panel
|
|
|
|
*/
|
|
|
|
int (*freq_main_vfo_hz_event)(struct rig_state *rig_s, freq_t freq, rig_mode_t mode);
|
|
|
|
/* etc.. */
|
|
|
|
};
|
2000-09-04 17:51:35 +00:00
|
|
|
|
2000-09-14 00:52:27 +00:00
|
|
|
/* Here is the master data structure,
|
|
|
|
* acting as a handle
|
|
|
|
*/
|
|
|
|
struct rig {
|
|
|
|
const struct rig_caps *caps;
|
|
|
|
struct rig_state state;
|
|
|
|
struct rig_callback callbacks;
|
|
|
|
};
|
2000-09-04 03:19:25 +00:00
|
|
|
|
2000-09-14 00:52:27 +00:00
|
|
|
typedef struct rig RIG;
|
2000-09-04 03:19:25 +00:00
|
|
|
|
|
|
|
|
2000-09-14 00:52:27 +00:00
|
|
|
/* --------------- visible function prototypes -----------------*/
|
2000-09-04 03:19:25 +00:00
|
|
|
|
2000-09-14 00:52:27 +00:00
|
|
|
RIG *rig_open(const char *rig_path, rig_model_t rig_model);
|
|
|
|
int cmd_set_freq_main_vfo_hz(RIG *rig, freq_t freq, rig_mode_t mode);
|
|
|
|
/* etc. */
|
2000-09-04 03:19:25 +00:00
|
|
|
|
2000-09-14 00:52:27 +00:00
|
|
|
int rig_close(RIG *rig);
|
|
|
|
RIG *rig_probe(const char *rig_path);
|
2000-09-04 03:19:25 +00:00
|
|
|
|
2000-09-14 00:52:27 +00:00
|
|
|
const struct rig_caps *rig_get_caps(rig_model_t rig_model);
|
2000-09-04 03:19:25 +00:00
|
|
|
|
2000-09-14 00:52:27 +00:00
|
|
|
#endif /* _RIG_H */
|
2000-09-04 03:19:25 +00:00
|
|
|
|