Logo Search packages:      
Sourcecode: hamlib version File versions  Download package

rig.c File Reference

Detailed Description

Ham Radio Control Libraries interface.

Stephane Fillod

Frank Singleton

Hamlib provides a user-callable API, a set of "front-end" routines that call rig-specific "back-end" routines whichactually communicate with the physical rig.

Definition in file rig.c.

#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include "hamlib/rig.h"
#include "serial.h"
#include "parallel.h"
#include "usb_port.h"
#include "network.h"
#include "event.h"

Go to the source code of this file.


struct  opened_rig_l


#define CHECK_RIG_ARG(r)   (!(r) || !(r)->caps || !(r)->state.comm_state)
#define DEFAULT_PARALLEL_PORT   "/dev/parport0"
#define DEFAULT_SERIAL_PORT   "/dev/ttyS0"
#define ERROR_TBL_SZ   (sizeof(rigerror_table)/sizeof(char *))


static int add_opened_rig (RIG *rig)
int foreach_opened_rig (int(*cfunc)(RIG *, rig_ptr_t), rig_ptr_t data)
 execs cfunc() on each opened rig
static int remove_opened_rig (RIG *rig)
int HAMLIB_API rig_cleanup (RIG *rig)
 release a rig handle and free associated memory
int HAMLIB_API rig_close (RIG *rig)
 close the communication to the rig
int HAMLIB_API rig_get_ant (RIG *rig, vfo_t vfo, ant_t *ant)
 get the current antenna
int HAMLIB_API rig_get_dcd (RIG *rig, vfo_t vfo, dcd_t *dcd)
 get the status of the DCD
int HAMLIB_API rig_get_freq (RIG *rig, vfo_t vfo, freq_t *freq)
 get the frequency of the target VFO
const char *HAMLIB_API rig_get_info (RIG *rig)
 get general information from the radio
int HAMLIB_API rig_get_mode (RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
 get the mode of the target VFO
int HAMLIB_API rig_get_powerstat (RIG *rig, powerstat_t *status)
 get the on/off status of the radio
int HAMLIB_API rig_get_ptt (RIG *rig, vfo_t vfo, ptt_t *ptt)
 get the status of the PTT
const freq_range_t *HAMLIB_API rig_get_range (const freq_range_t range_list[], freq_t freq, rmode_t mode)
 find the freq_range of freq/mode
shortfreq_t HAMLIB_API rig_get_resolution (RIG *rig, rmode_t mode)
 get the best frequency resolution of the rig
int HAMLIB_API rig_get_rit (RIG *rig, vfo_t vfo, shortfreq_t *rit)
 get the current RIT offset
int HAMLIB_API rig_get_rptr_offs (RIG *rig, vfo_t vfo, shortfreq_t *rptr_offs)
 get the current repeater offset
int HAMLIB_API rig_get_rptr_shift (RIG *rig, vfo_t vfo, rptr_shift_t *rptr_shift)
 get the current repeater shift
int HAMLIB_API rig_get_split_freq (RIG *rig, vfo_t vfo, freq_t *tx_freq)
 get the current split frequencies
int HAMLIB_API rig_get_split_mode (RIG *rig, vfo_t vfo, rmode_t *tx_mode, pbwidth_t *tx_width)
 get the current split modes
int HAMLIB_API rig_get_split_vfo (RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo)
 get the current split mode
int HAMLIB_API rig_get_ts (RIG *rig, vfo_t vfo, shortfreq_t *ts)
 get the current Tuning Step
int HAMLIB_API rig_get_vfo (RIG *rig, vfo_t *vfo)
 get the current VFO
int HAMLIB_API rig_get_xit (RIG *rig, vfo_t vfo, shortfreq_t *xit)
 get the current XIT offset
scan_t HAMLIB_API rig_has_scan (RIG *rig, scan_t scan)
 check availability of scaning functions
vfo_op_t HAMLIB_API rig_has_vfo_op (RIG *rig, vfo_op_t op)
 check retrieval ability of VFO operations
RIG *HAMLIB_API rig_init (rig_model_t rig_model)
 allocate a new RIG handle
int HAMLIB_API rig_mW2power (RIG *rig, float *power, unsigned int mwpower, freq_t freq, rmode_t mode)
 conversion utility from absolute in mW to relative range
int HAMLIB_API rig_open (RIG *rig)
 open the communication to the rig
pbwidth_t HAMLIB_API rig_passband_narrow (RIG *rig, rmode_t mode)
 get the narrow passband of a mode
pbwidth_t HAMLIB_API rig_passband_normal (RIG *rig, rmode_t mode)
 get the normal passband of a mode
pbwidth_t HAMLIB_API rig_passband_wide (RIG *rig, rmode_t mode)
 get the wide passband of a mode
int HAMLIB_API rig_power2mW (RIG *rig, unsigned int *mwpower, float power, freq_t freq, rmode_t mode)
 conversion utility from relative range to absolute in mW
rig_model_t HAMLIB_API rig_probe (hamlib_port_t *port)
 try to guess a rig
int HAMLIB_API rig_probe_all (hamlib_port_t *port, rig_probe_func_t cfunc, rig_ptr_t data)
 try to guess rigs
int rig_probe_all_backends (hamlib_port_t *p, rig_probe_func_t cfunc, rig_ptr_t data)
int rig_probe_first (hamlib_port_t *p)
int HAMLIB_API rig_recv_dtmf (RIG *rig, vfo_t vfo, char *digits, int *length)
 receive DTMF digits
int HAMLIB_API rig_reset (RIG *rig, reset_t reset)
 reset the radio
int HAMLIB_API rig_scan (RIG *rig, vfo_t vfo, scan_t scan, int ch)
 perform Memory/VFO operations
int HAMLIB_API rig_send_dtmf (RIG *rig, vfo_t vfo, const char *digits)
 send DTMF digits
int HAMLIB_API rig_send_morse (RIG *rig, vfo_t vfo, const char *msg)
 send morse code
int HAMLIB_API rig_set_ant (RIG *rig, vfo_t vfo, ant_t ant)
 set the antenna
int HAMLIB_API rig_set_freq (RIG *rig, vfo_t vfo, freq_t freq)
 set the frequency of the target VFO
int HAMLIB_API rig_set_mode (RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
 set the mode of the target VFO
int HAMLIB_API rig_set_powerstat (RIG *rig, powerstat_t status)
 turn on/off the radio
int HAMLIB_API rig_set_ptt (RIG *rig, vfo_t vfo, ptt_t ptt)
 set PTT on/off
int HAMLIB_API rig_set_rit (RIG *rig, vfo_t vfo, shortfreq_t rit)
 set the RIT
int HAMLIB_API rig_set_rptr_offs (RIG *rig, vfo_t vfo, shortfreq_t rptr_offs)
 set the repeater offset
int HAMLIB_API rig_set_rptr_shift (RIG *rig, vfo_t vfo, rptr_shift_t rptr_shift)
 set the repeater shift
int HAMLIB_API rig_set_split_freq (RIG *rig, vfo_t vfo, freq_t tx_freq)
 set the split frequencies
int HAMLIB_API rig_set_split_mode (RIG *rig, vfo_t vfo, rmode_t tx_mode, pbwidth_t tx_width)
 set the split modes
int HAMLIB_API rig_set_split_vfo (RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo)
 set the split mode
int HAMLIB_API rig_set_ts (RIG *rig, vfo_t vfo, shortfreq_t ts)
 set the Tuning Step
int HAMLIB_API rig_set_vfo (RIG *rig, vfo_t vfo)
 set the current VFO
int HAMLIB_API rig_set_xit (RIG *rig, vfo_t vfo, shortfreq_t xit)
 set the XIT
int HAMLIB_API rig_vfo_op (RIG *rig, vfo_t vfo, vfo_op_t op)
 perform Memory/VFO operations
const char *HAMLIB_API rigerror (int errnum)
 get string describing the error code


const char hamlib_copyright []
 Hamlib copyright notice.
const char hamlib_version [] = "Hamlib version " PACKAGE_VERSION
 Hamlib release number The version number has the format x.y.z.
static struct opened_rig_l * opened_rig_list = { NULL }
static const char * rigerror_table []

Generated by  Doxygen 1.6.0   Back to index