Main Page | Data Structures | Directories | File List | Data Fields | Globals | Related Pages | Examples

rig.c File Reference

Ham Radio Control Libraries interface. More...

#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 "event.h"

Functions

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

Variables

const char hamlib_version [] = "Hamlib version " PACKAGE_VERSION
 Hamlib release number.
const char hamlib_copyright []
 Hamlib copyright notice.


Detailed Description

Ham Radio Control Libraries interface.

Author:
Stephane Fillod

Frank Singleton

Date:
2000-2006
Hamlib interface is a frontend implementing wrapper functions.

Function Documentation

int rig_cleanup RIG rig  ) 
 

release a rig handle and free associated memory

Parameters:
rig The RIG handle of the radio to be closed
Releases a rig struct which port has eventualy been closed already with rig_close().

Returns:
RIG_OK if the operation has been sucessful, otherwise a negative value if an error occured (in which case, cause is set appropriately).
See also:
rig_init(), rig_close()
Examples:
/tests/testrig.c.

int rig_close RIG rig  ) 
 

close the communication to the rig

Parameters:
rig The RIG handle of the radio to be closed
Closes communication to a radio which RIG handle has been passed by argument that was previously open with rig_open().

Returns:
RIG_OK if the operation has been sucessful, otherwise a negative value if an error occured (in which case, cause is set appropriately).
See also:
rig_cleanup(), rig_open()
Examples:
/tests/testrig.c.

int rig_get_ant RIG rig,
vfo_t  vfo,
ant_t *  ant
 

get the current antenna

Parameters:
rig The rig handle
vfo The target VFO
ant The location where to store the current antenna
Retrieves the current antenna.

Returns:
RIG_OK if the operation has been sucessful, otherwise a negative value if an error occured (in which case, cause is set appropriately).
See also:
rig_set_ant()

int rig_get_dcd RIG rig,
vfo_t  vfo,
dcd_t dcd
 

get the status of the DCD

Parameters:
rig The rig handle
vfo The target VFO
dcd The location where to store the status of the DCD
Retrieves the status of DCD (is squelch open?).

Returns:
RIG_OK if the operation has been sucessful, otherwise a negative value if an error occured (in which case, cause is set appropriately).

int rig_get_freq RIG rig,
vfo_t  vfo,
freq_t freq
 

get the frequency of the target VFO

Parameters:
rig The rig handle
vfo The target VFO
freq The location where to store the current frequency
Retrieves the frequency of the target VFO. The value stored at freq location equals RIG_FREQ_NONE when the current frequency of the VFO is not defined (e.g. blank memory).

Returns:
RIG_OK if the operation has been sucessful, otherwise a negative value if an error occured (in which case, cause is set appropriately).
See also:
rig_set_freq()
Examples:
/tests/testrig.c.

const char* rig_get_info RIG rig  ) 
 

get general information from the radio

Parameters:
rig The rig handle
Retrieves some general information from the radio. This can include firmware revision, exact model name, or just nothing.

Returns:
a pointer to freshly allocated memory containing the ASCIIZ string if the operation has been sucessful, otherwise NULL if an error occured or get_info not part of capabilities.

int rig_get_mode RIG rig,
vfo_t  vfo,
rmode_t mode,
pbwidth_t width
 

get the mode of the target VFO

Parameters:
rig The rig handle
vfo The target VFO
mode The location where to store the current mode
width The location where to store the current passband width
Retrieves the mode and passband of the target VFO. If the backend is unable to determine the width, the width will be set to RIG_PASSBAND_NORMAL as a default. The value stored at mode location equals RIG_MODE_NONE when the current mode of the VFO is not defined (e.g. blank memory).

Returns:
RIG_OK if the operation has been sucessful, otherwise a negative value if an error occured (in which case, cause is set appropriately).
See also:
rig_set_mode()
Examples:
/tests/testrig.c.

int rig_get_powerstat RIG rig,
powerstat_t status
 

get the on/off status of the radio

Parameters:
rig The rig handle
status The locatation where to store the current status
Retrieve the status of the radio. See RIG_POWER_ON, RIG_POWER_OFF and RIG_POWER_STANDBY defines for the status.

Returns:
RIG_OK if the operation has been sucessful, otherwise a negative value if an error occured (in which case, cause is set appropriately).
See also:
rig_set_powerstat()

int rig_get_ptt RIG rig,
vfo_t  vfo,
ptt_t ptt
 

get the status of the PTT

Parameters:
rig The rig handle
vfo The target VFO
ptt The location where to store the status of the PTT
Retrieves the status of PTT (are we on the air?).

Returns:
RIG_OK if the operation has been sucessful, otherwise a negative value if an error occured (in which case, cause is set appropriately).
See also:
rig_set_ptt()

const freq_range_t* rig_get_range const freq_range_t  range_list[],
freq_t  freq,
rmode_t  mode
 

find the freq_range of freq/mode

Parameters:
range_list The range list to search from
freq The frequency that will be part of this range
mode The mode that will be part of this range
Returns a pointer to the freq_range_t including freq and mode. Works for rx and tx range list as well.

Returns:
the location of the freq_range_t if found, otherwise NULL if not found or if range_list is invalid.

shortfreq_t rig_get_resolution RIG rig,
rmode_t  mode
 

get the best frequency resolution of the rig

Parameters:
rig The rig handle
mode The mode where the conversion should take place
Returns the best frequency resolution of the rig, for a given mode.

Returns:
the frequency resolution in Hertz if the operation h has been sucessful, otherwise a negative value if an error occured.

int rig_get_rit RIG rig,
vfo_t  vfo,
shortfreq_t rit
 

get the current RIT offset

Parameters:
rig The rig handle
vfo The target VFO
rit The location where to store the current RIT offset
Retrieves the current RIT offset.

Returns:
RIG_OK if the operation has been sucessful, otherwise a negative value if an error occured (in which case, cause is set appropriately).
See also:
rig_set_rit()

int rig_get_rptr_offs RIG rig,
vfo_t  vfo,
shortfreq_t rptr_offs
 

get the current repeater offset

Parameters:
rig The rig handle
vfo The target VFO
rptr_offs The location where to store the current repeater offset
Retrieves the current repeater offset.

Returns:
RIG_OK if the operation has been sucessful, otherwise a negative value if an error occured (in which case, cause is set appropriately).
See also:
rig_set_rptr_offs()

int rig_get_rptr_shift RIG rig,
vfo_t  vfo,
rptr_shift_t rptr_shift
 

get the current repeater shift

Parameters:
rig The rig handle
vfo The target VFO
rptr_shift The location where to store the current repeater shift
Retrieves the current repeater shift.

Returns:
RIG_OK if the operation has been sucessful, otherwise a negative value if an error occured (in which case, cause is set appropriately).
See also:
rig_set_rptr_shift()

int rig_get_split_freq RIG rig,
vfo_t  vfo,
freq_t tx_freq
 

get the current split frequencies

Parameters:
rig The rig handle
vfo The target VFO
tx_freq The location where to store the current transmit split frequency
Retrieves the current split(TX) frequency.

Returns:
RIG_OK if the operation has been sucessful, otherwise a negative value if an error occured (in which case, cause is set appropriately).
See also:
rig_set_split_freq()

int rig_get_split_mode RIG rig,
vfo_t  vfo,
rmode_t tx_mode,
pbwidth_t tx_width
 

get the current split modes

Parameters:
rig The rig handle
vfo The target VFO
tx_mode The location where to store the current transmit split mode
tx_width The location where to store the current transmit split width
Retrieves the current split(TX) mode.

Returns:
RIG_OK if the operation has been sucessful, otherwise a negative value if an error occured (in which case, cause is set appropriately).
See also:
rig_set_split_mode()

int rig_get_split_vfo RIG rig,
vfo_t  vfo,
split_t split,
vfo_t tx_vfo
 

get the current split mode

Parameters:
rig The rig handle
vfo The target VFO
split The location where to store the current split mode
tx_vfo The transmit VFO
Retrieves the current split mode.

Returns:
RIG_OK if the operation has been sucessful, otherwise a negative value if an error occured (in which case, cause is set appropriately).
See also:
rig_set_split_vfo()

int rig_get_ts RIG rig,
vfo_t  vfo,
shortfreq_t ts
 

get the current Tuning Step

Parameters:
rig The rig handle
vfo The target VFO
ts The location where to store the current tuning step
Retrieves the current tuning step.

Returns:
RIG_OK if the operation has been sucessful, otherwise a negative value if an error occured (in which case, cause is set appropriately).
See also:
rig_set_ts()

int rig_get_vfo RIG rig,
vfo_t vfo
 

get the current VFO

Parameters:
rig The rig handle
vfo The location where to store the current VFO
Retrieves the current VFO. The VFO can be RIG_VFO_A, RIG_VFO_B, RIG_VFO_C for VFOA, VFOB, VFOC respectively or RIG_VFO_MEM for Memory mode. Supported VFOs depends on rig capabilities.

Returns:
RIG_OK if the operation has been sucessful, otherwise a negative value if an error occured (in which case, cause is set appropriately).
See also:
rig_set_vfo()
Examples:
/tests/testrig.c.

int rig_get_xit RIG rig,
vfo_t  vfo,
shortfreq_t xit
 

get the current XIT offset

Parameters:
rig The rig handle
vfo The target VFO
xit The location where to store the current XIT offset
Retrieves the current XIT offset.

Returns:
RIG_OK if the operation has been sucessful, otherwise a negative value if an error occured (in which case, cause is set appropriately).
See also:
rig_set_xit()

scan_t rig_has_scan RIG rig,
scan_t  scan
 

check availability of scaning functions

Parameters:
rig The rig handle
scan The scan op
Checks if a rig is capable of performing a scan operation. Since the scan parameter is an OR'ed bitmap argument, more than one op can be checked at the same time.

EXAMPLE: if (rig_has_scan(my_rig, RIG_SCAN_PRIO)) disp_SCANprio_btn();

Returns:
a bit map of supported scan settings that can be retrieved, otherwise 0 if none supported.
See also:
rig_scan()

vfo_op_t rig_has_vfo_op RIG rig,
vfo_op_t  op
 

check retrieval ability of VFO operations

Parameters:
rig The rig handle
op The VFO op
Checks if a rig is capable of executing a VFO operation. Since the op is an OR'ed bitmap argument, more than one op can be checked at the same time.

EXAMPLE: if (rig_has_vfo_op(my_rig, RIG_OP_CPY)) disp_VFOcpy_btn();

Returns:
a bit map mask of supported op settings that can be retrieved, otherwise 0 if none supported.
See also:
rig_vfo_op()

RIG* rig_init rig_model_t  rig_model  ) 
 

allocate a new RIG handle

Parameters:
rig_model The rig model for this new handle
Allocates a new RIG handle and initializes the associated data for rig_model.

Returns:
a pointer to the RIG handle otherwise NULL if memory allocation failed or rig_model is unknown (e.g. backend autoload failed).
See also:
rig_cleanup(), rig_open()
Examples:
/tests/testrig.c.

int rig_mW2power RIG rig,
float *  power,
unsigned int  mwpower,
freq_t  freq,
rmode_t  mode
 

conversion utility from absolute in mW to relative range

Parameters:
rig The rig handle
power The location where to store the converted relative power
mwpower The power in mW
freq The frequency where the conversion should take place
mode The mode where the conversion should take place
Converts a power value expressed in the real transmit power in milli Watts the radio would emit to a range on a [0.0 .. 1.0] relative scale. The freq and mode where the conversion should take place must be also provided since the relative power is peculiar to a specific freq and mode range of the radio.

Returns:
RIG_OK if the operation has been sucessful, otherwise a negative value if an error occured (in which case, cause is set appropriately).
See also:
rig_power2mW()

int rig_open RIG rig  ) 
 

open the communication to the rig

Parameters:
rig The RIG handle of the radio to be opened
Opens communication to a radio which RIG handle has been passed by argument.

Returns:
RIG_OK if the operation has been sucessful, otherwise a negative value if an error occured (in which case, cause is set appropriately).
Return values:
RIG_EINVAL rig is NULL or unconsistent.
RIG_ENIMPL port type communication is not implemented yet.
See also:
rig_init(), rig_close()
Examples:
/tests/testrig.c.

pbwidth_t rig_passband_narrow RIG rig,
rmode_t  mode
 

get the narrow passband of a mode

Parameters:
rig The rig handle
mode The mode to get the passband
Returns the narrow (closest) passband for the given mode. EXAMPLE: rig_set_mode(my_rig, RIG_MODE_LSB, rig_passband_narrow(my_rig, RIG_MODE_LSB) );

Returns:
the passband in Hz if the operation has been sucessful, or a 0 if an error occured (passband not found, whatever).
See also:
rig_passband_normal(), rig_passband_wide()
Examples:
/tests/testrig.c.

pbwidth_t rig_passband_normal RIG rig,
rmode_t  mode
 

get the normal passband of a mode

Parameters:
rig The rig handle
mode The mode to get the passband
Returns the normal (default) passband for the given mode.

Returns:
the passband in Hz if the operation has been sucessful, or a 0 if an error occured (passband not found, whatever).
See also:
rig_passband_narrow(), rig_passband_wide()

pbwidth_t rig_passband_wide RIG rig,
rmode_t  mode
 

get the wide passband of a mode

Parameters:
rig The rig handle
mode The mode to get the passband
Returns the wide (default) passband for the given mode. EXAMPLE: rig_set_mode(my_rig, RIG_MODE_AM, rig_passband_wide(my_rig, RIG_MODE_AM) );

Returns:
the passband in Hz if the operation has been sucessful, or a 0 if an error occured (passband not found, whatever).
See also:
rig_passband_narrow(), rig_passband_normal()

int rig_power2mW RIG rig,
unsigned int *  mwpower,
float  power,
freq_t  freq,
rmode_t  mode
 

conversion utility from relative range to absolute in mW

Parameters:
rig The rig handle
mwpower The location where to store the converted power in mW
power The relative power
freq The frequency where the conversion should take place
mode The mode where the conversion should take place
Converts a power value expressed in a range on a [0.0 .. 1.0] relative scale to the real transmit power in milli Watts the radio would emit. The freq and mode where the conversion should take place must be also provided since the relative power is peculiar to a specific freq and mode range of the radio.

Returns:
RIG_OK if the operation has been sucessful, otherwise a negative value if an error occured (in which case, cause is set appropriately).
See also:
rig_mW2power()

rig_model_t rig_probe hamlib_port_t port  ) 
 

try to guess a rig

Parameters:
port A pointer describing a port linking the host to the rig
Try to guess what is the model of the first rig attached to the port. It can be very buggy, and mess up the radio at the other end. (but fun if it works!)

Warning:
this is really Experimental, It has been tested only with IC-706MkIIG. any feedback welcome! --SF
Returns:
the rig model id according to the rig_model_t type if found, otherwise RIG_MODEL_NONE if unable to determine rig model.
Examples:
/tests/testrig.c.

int rig_probe_all hamlib_port_t port,
rig_probe_func_t  cfunc,
char *  data
 

try to guess rigs

Parameters:
port A pointer describing a port linking the host to the rigs
cfunc Function to be called each time a rig is found
data Arbitrary data passed to cfunc
Try to guess what are the model of all rigs attached to the port. It can be very buggy, and mess up the radio at the other end. (but fun if it works!)

Warning:
this is really Experimental, It has been tested only with IC-706MkIIG. any feedback welcome! --SF
Returns:
RIG_OK if the operation has been sucessful, otherwise a negative value if an error occured (in which case, cause is set appropriately).

int rig_recv_dtmf RIG rig,
vfo_t  vfo,
char *  digits,
int *  length
 

receive DTMF digits

Parameters:
rig The rig handle
vfo The target VFO
digits Location where the digits are to be stored
length in: max length of buffer, out: number really read.
Receives DTMF digits (not blocking). See DTMF change speed, etc. (TODO).

Returns:
RIG_OK if the operation has been sucessful, otherwise a negative value if an error occured (in which case, cause is set appropriately).

int rig_reset RIG rig,
reset_t  reset
 

reset the radio

Parameters:
rig The rig handle
reset The reset operation to perform
Resets the radio. See RIG_RESET_NONE, RIG_RESET_SOFT and RIG_RESET_MCALL defines for the reset.

Returns:
RIG_OK if the operation has been sucessful, otherwise a negative value if an error occured (in which case, cause is set appropriately).

int rig_scan RIG rig,
vfo_t  vfo,
scan_t  scan,
int  ch
 

perform Memory/VFO operations

Parameters:
rig The rig handle
vfo The target VFO
scan The scanning operation to perform
ch Optional channel argument used for the scan.
Performs scanning operation. See scan_t for more information.

Returns:
RIG_OK if the operation has been sucessful, otherwise a negative value if an error occured (in which case, cause is set appropriately).
See also:
rig_has_scan()

int rig_send_dtmf RIG rig,
vfo_t  vfo,
const char *  digits
 

send DTMF digits

Parameters:
rig The rig handle
vfo The target VFO
digits Digits to be send
Sends DTMF digits. See DTMF change speed, etc. (TODO).

Returns:
RIG_OK if the operation has been sucessful, otherwise a negative value if an error occured (in which case, cause is set appropriately).

int rig_send_morse RIG rig,
vfo_t  vfo,
const char *  msg
 

send morse code

Parameters:
rig The rig handle
vfo The target VFO
msg Message to be sent
Sends morse message. See keyer change speed, etc. (TODO).

Returns:
RIG_OK if the operation has been sucessful, otherwise a negative value if an error occured (in which case, cause is set appropriately).

int rig_set_ant RIG rig,
vfo_t  vfo,
ant_t  ant
 

set the antenna

Parameters:
rig The rig handle
vfo The target VFO
ant The anntena to select
Select the antenna connector.
        rig_set_ant(rig, RIG_VFO_CURR, RIG_ANT_1);  // apply to both TX&RX
        rig_set_ant(rig, RIG_VFO_RX, RIG_ANT_2);

Returns:
RIG_OK if the operation has been sucessful, otherwise a negative value if an error occured (in which case, cause is set appropriately).
See also:
rig_get_ant()

int rig_set_freq RIG rig,
vfo_t  vfo,
freq_t  freq
 

set the frequency of the target VFO

Parameters:
rig The rig handle
vfo The target VFO
freq The frequency to set to
Sets the frequency of the target VFO.

Returns:
RIG_OK if the operation has been sucessful, otherwise a negative value if an error occured (in which case, cause is set appropriately).
See also:
rig_get_freq()
Examples:
/tests/testrig.c.

int rig_set_mode RIG rig,
vfo_t  vfo,
rmode_t  mode,
pbwidth_t  width
 

set the mode of the target VFO

Parameters:
rig The rig handle
vfo The target VFO
mode The mode to set to
width The passband width to set to
Sets the mode and associated passband of the target VFO. The passband width must be supported by the backend of the rig.

Returns:
RIG_OK if the operation has been sucessful, otherwise a negative value if an error occured (in which case, cause is set appropriately).
See also:
rig_get_mode()
Examples:
/tests/testrig.c.

int rig_set_powerstat RIG rig,
powerstat_t  status
 

turn on/off the radio

Parameters:
rig The rig handle
status The status to set to
turns on/off the radio. See RIG_POWER_ON, RIG_POWER_OFF and RIG_POWER_STANDBY defines for the status.

Returns:
RIG_OK if the operation has been sucessful, ortherwise a negative value if an error occured (in which case, cause is set appropriately).
See also:
rig_get_powerstat()

int rig_set_ptt RIG rig,
vfo_t  vfo,
ptt_t  ptt
 

set PTT on/off

Parameters:
rig The rig handle
vfo The target VFO
ptt The PTT status to set to
Sets "Push-To-Talk" on/off.

Returns:
RIG_OK if the operation has been sucessful, otherwise a negative value if an error occured (in which case, cause is set appropriately).
See also:
rig_get_ptt()
Examples:
/tests/testrig.c.

int rig_set_rit RIG rig,
vfo_t  vfo,
shortfreq_t  rit
 

set the RIT

Parameters:
rig The rig handle
vfo The target VFO
rit The RIT offset to adjust to
Sets the current RIT offset. A value of 0 for rit disables RIT.

Returns:
RIG_OK if the operation has been sucessful, otherwise a negative value if an error occured (in which case, cause is set appropriately).
See also:
rig_get_rit()

int rig_set_rptr_offs RIG rig,
vfo_t  vfo,
shortfreq_t  rptr_offs
 

set the repeater offset

Parameters:
rig The rig handle
vfo The target VFO
rptr_offs The VFO to set to
Sets the current repeater offset.

Returns:
RIG_OK if the operation has been sucessful, otherwise a negative value if an error occured (in which case, cause is set appropriately).
See also:
rig_get_rptr_offs()

int rig_set_rptr_shift RIG rig,
vfo_t  vfo,
rptr_shift_t  rptr_shift
 

set the repeater shift

Parameters:
rig The rig handle
vfo The target VFO
rptr_shift The repeater shift to set to
Sets the current repeater shift.

Returns:
RIG_OK if the operation has been sucessful, otherwise a negative value if an error occured (in which case, cause is set appropriately).
See also:
rig_get_rptr_shift()

int rig_set_split_freq RIG rig,
vfo_t  vfo,
freq_t  tx_freq
 

set the split frequencies

Parameters:
rig The rig handle
vfo The target VFO
tx_freq The transmit split frequency to set to
Sets the split(TX) frequency.

Returns:
RIG_OK if the operation has been sucessful, otherwise a negative value if an error occured (in which case, cause is set appropriately).
See also:
rig_get_split_freq(), rig_set_split_vfo()

int rig_set_split_mode RIG rig,
vfo_t  vfo,
rmode_t  tx_mode,
pbwidth_t  tx_width
 

set the split modes

Parameters:
rig The rig handle
vfo The target VFO
tx_mode The transmit split mode to set to
tx_width The transmit split width to set to
Sets the split(TX) mode.

Returns:
RIG_OK if the operation has been sucessful, otherwise a negative value if an error occured (in which case, cause is set appropriately).
See also:
rig_get_split_mode()

int rig_set_split_vfo RIG rig,
vfo_t  vfo,
split_t  split,
vfo_t  tx_vfo
 

set the split mode

Parameters:
rig The rig handle
vfo The target VFO
split The split mode to set to
tx_vfo The transmit VFO
Sets the current split mode.

Returns:
RIG_OK if the operation has been sucessful, otherwise a negative value if an error occured (in which case, cause is set appropriately).
See also:
rig_get_split_vfo()

int rig_set_ts RIG rig,
vfo_t  vfo,
shortfreq_t  ts
 

set the Tuning Step

Parameters:
rig The rig handle
vfo The target VFO
ts The tuning step to set to
Sets the Tuning Step.

Returns:
RIG_OK if the operation has been sucessful, otherwise a negative value if an error occured (in which case, cause is set appropriately).
See also:
rig_get_ts()

int rig_set_vfo RIG rig,
vfo_t  vfo
 

set the current VFO

Parameters:
rig The rig handle
vfo The VFO to set to
Sets the current VFO. The VFO can be RIG_VFO_A, RIG_VFO_B, RIG_VFO_C for VFOA, VFOB, VFOC respectively or RIG_VFO_MEM for Memory mode. Supported VFOs depends on rig capabilities.

Returns:
RIG_OK if the operation has been sucessful, otherwise a negative value if an error occured (in which case, cause is set appropriately).
See also:
rig_get_vfo()
Examples:
/tests/testrig.c.

int rig_set_xit RIG rig,
vfo_t  vfo,
shortfreq_t  xit
 

set the XIT

Parameters:
rig The rig handle
vfo The target VFO
xit The XIT offset to adjust to
Sets the current XIT offset. A value of 0 for xit disables XIT.

Returns:
RIG_OK if the operation has been sucessful, otherwise a negative value if an error occured (in which case, cause is set appropriately).
See also:
rig_get_xit()

int rig_vfo_op RIG rig,
vfo_t  vfo,
vfo_op_t  op
 

perform Memory/VFO operations

Parameters:
rig The rig handle
vfo The target VFO
op The Memory/VFO operation to perform
Performs Memory/VFO operation. See vfo_op_t for more information.

Returns:
RIG_OK if the operation has been sucessful, otherwise a negative value if an error occured (in which case, cause is set appropriately).
See also:
rig_has_vfo_op()

const char* rigerror int  errnum  ) 
 

get string describing the error code

Parameters:
errnum The error code
Returns:
the appropriate description string, ortherwise a NULL pointer if the error code is unknown.
Returns a string describing the error code passed in the argument errnum.

Todo:
support gettext/localization
Examples:
/tests/testrig.c.


Generated on Sat Sep 30 15:49:37 2006 for Hamlib - the C library reference by  doxygen 1.4.4