kopia lustrzana https://github.com/Hamlib/Hamlib
Updated for the new frontend/backend caps
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@93 7ae35d74-ebe9-4afe-98af-79ac388436b8Hamlib-1.1.0
rodzic
1fb830bbce
commit
c931f4e485
|
@ -4,7 +4,7 @@
|
||||||
# Simple Make file for common parts.
|
# Simple Make file for common parts.
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
# $Id: Makefile,v 1.1 2000-07-25 01:01:00 javabear Exp $
|
# $Id: Makefile,v 1.2 2000-09-14 00:52:27 f4cfe Exp $
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
|
|
||||||
|
@ -20,6 +20,10 @@ all: $(MAKEALL)
|
||||||
serial.o: serial.c serial.h
|
serial.o: serial.c serial.h
|
||||||
$(CC) $(CFLAGS) $(INCLUDE) -c serial.c
|
$(CC) $(CFLAGS) $(INCLUDE) -c serial.c
|
||||||
|
|
||||||
|
rig.o: rig.c rig.h rigcaps.h riglist.h
|
||||||
|
$(CC) $(CFLAGS) $(INCLUDE) -c rig.c
|
||||||
|
|
||||||
|
|
||||||
# clean up
|
# clean up
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
|
|
75
common/rig.h
75
common/rig.h
|
@ -1,11 +1,10 @@
|
||||||
/* hamlib - (C) Frank Singleton 2000 (vk3fcs@ix.netcom.com)
|
/* hamlib - (C) Frank Singleton 2000 (vk3fcs@ix.netcom.com)
|
||||||
*
|
*
|
||||||
* rig.h - (C) Frank Singleton 2000 (vk3fcs@ix.netcom.com)
|
* rig.h - Copyright (C) 2000 Frank Singleton and Stephane Fillod
|
||||||
* This program defines some rig capabilities structures that
|
* This program defines the Hamlib API
|
||||||
* will be used for obtaining rig capabilities,
|
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* $Id: rig.h,v 1.3 2000-09-04 17:51:28 javabear Exp $ *
|
* $Id: rig.h,v 1.4 2000-09-14 00:52:27 f4cfe Exp $ *
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
|
@ -24,41 +23,61 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
#ifndef _RIG_H
|
||||||
* Basic rig type, can store some useful
|
#define _RIG_H 1
|
||||||
* info about different radios. Each lib must
|
|
||||||
* be able to populate this structure, so we can make
|
|
||||||
* useful enquiries about capablilities.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define RIG_PARITY_NONE 0
|
#include <rigcaps.h>
|
||||||
#define RIG_PARITY_ODD 1
|
|
||||||
#define RIG_PARITY_EVEN 2
|
|
||||||
|
|
||||||
struct rig_caps {
|
enum rig_parity_e; /* forward reference to <rigcaps.h> */
|
||||||
char rig_name[30]; /* eg ft847 */
|
|
||||||
unsigned short int serial_rate_min; /* eg 4800 */
|
struct rig_state {
|
||||||
unsigned short int serial_rate_max; /* eg 9600 */
|
unsigned short int serial_rate;
|
||||||
unsigned char serial_data_bits; /* eg 8 */
|
unsigned char serial_data_bits; /* eg 8 */
|
||||||
unsigned char serial_stop_bits; /* eg 2 */
|
unsigned char serial_stop_bits; /* eg 2 */
|
||||||
unsigned char serial_parity; /* */
|
enum rig_parity_e serial_parity; /* */
|
||||||
char serial_port_name[30]; /* requested serial port */
|
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... */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* visible function prototypes
|
* event based programming,
|
||||||
*
|
* really appropriate in a GUI.
|
||||||
|
* So far, haven't heard of any rig capable of this. --SF
|
||||||
*/
|
*/
|
||||||
|
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.. */
|
||||||
|
};
|
||||||
|
|
||||||
/* int open_port2(struct rig_caps *rc); */
|
/* 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;
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef struct rig RIG;
|
||||||
|
|
||||||
|
|
||||||
|
/* --------------- visible function prototypes -----------------*/
|
||||||
|
|
||||||
|
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. */
|
||||||
|
|
||||||
|
int rig_close(RIG *rig);
|
||||||
|
RIG *rig_probe(const char *rig_path);
|
||||||
|
|
||||||
|
const struct rig_caps *rig_get_caps(rig_model_t rig_model);
|
||||||
|
|
||||||
|
#endif /* _RIG_H */
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue