#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 "event.h"
#include "conf.h"
Compounds | |
struct | opened_rig_l |
Defines | |
#define | HAMLIB_DLL |
#define | DEFAULT_SERIAL_PORT "/dev/ttyS0" |
#define | ERROR_TBL_SZ (sizeof(rigerror_table)/sizeof(char *)) |
Functions | |
const char * | rigerror (int errnum) |
get string describing the error code. More... | |
int | foreach_opened_rig (int(*cfunc)(RIG *, rig_ptr_t), rig_ptr_t data) |
execs cfunc() on each opened rig. More... | |
RIG * | rig_init (rig_model_t rig_model) |
allocate a new RIG handle. More... | |
int | rig_open (RIG *rig) |
open the communication to the rig. More... | |
int | rig_close (RIG *rig) |
close the communication to the rig. More... | |
int | rig_cleanup (RIG *rig) |
release a rig handle and free associated memory. More... | |
int | rig_set_freq (RIG *rig, vfo_t vfo, freq_t freq) |
set the frequency of the target VFO. More... | |
int | rig_get_freq (RIG *rig, vfo_t vfo, freq_t *freq) |
get the frequency of the target VFO. More... | |
int | rig_set_mode (RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) |
set the mode of the target VFO. More... | |
int | rig_get_mode (RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) |
get the mode of the target VFO. More... | |
pbwidth_t | rig_passband_normal (RIG *rig, rmode_t mode) |
get the normal passband of a mode. More... | |
pbwidth_t | rig_passband_narrow (RIG *rig, rmode_t mode) |
get the narrow passband of a mode. More... | |
pbwidth_t | rig_passband_wide (RIG *rig, rmode_t mode) |
get the wide passband of a mode. More... | |
int | rig_set_vfo (RIG *rig, vfo_t vfo) |
set the current VFO. More... | |
int | rig_get_vfo (RIG *rig, vfo_t *vfo) |
get the current VFO. More... | |
int | rig_set_ptt (RIG *rig, vfo_t vfo, ptt_t ptt) |
set PTT on/off. More... | |
int | rig_get_ptt (RIG *rig, vfo_t vfo, ptt_t *ptt) |
get the status of the PTT. More... | |
int | rig_get_dcd (RIG *rig, vfo_t vfo, dcd_t *dcd) |
get the status of the DCD. More... | |
int | rig_set_rptr_shift (RIG *rig, vfo_t vfo, rptr_shift_t rptr_shift) |
set the repeater shift. More... | |
int | rig_get_rptr_shift (RIG *rig, vfo_t vfo, rptr_shift_t *rptr_shift) |
get the current repeater shift. More... | |
int | rig_set_rptr_offs (RIG *rig, vfo_t vfo, shortfreq_t rptr_offs) |
set the repeater offset. More... | |
int | rig_get_rptr_offs (RIG *rig, vfo_t vfo, shortfreq_t *rptr_offs) |
get the current repeater offset. More... | |
int | rig_set_split_freq (RIG *rig, vfo_t vfo, freq_t tx_freq) |
set the split frequencies. More... | |
int | rig_get_split_freq (RIG *rig, vfo_t vfo, freq_t *tx_freq) |
get the current split frequencies. More... | |
int | rig_set_split_mode (RIG *rig, vfo_t vfo, rmode_t tx_mode, pbwidth_t tx_width) |
set the split modes. More... | |
int | rig_get_split_mode (RIG *rig, vfo_t vfo, rmode_t *tx_mode, pbwidth_t *tx_width) |
get the current split modes. More... | |
int | rig_set_split (RIG *rig, vfo_t vfo, split_t split) |
set the split mode. More... | |
int | rig_get_split (RIG *rig, vfo_t vfo, split_t *split) |
get the current split mode. More... | |
int | rig_set_rit (RIG *rig, vfo_t vfo, shortfreq_t rit) |
set the RIT. More... | |
int | rig_get_rit (RIG *rig, vfo_t vfo, shortfreq_t *rit) |
get the current RIT offset. More... | |
int | rig_set_xit (RIG *rig, vfo_t vfo, shortfreq_t xit) |
set the XIT. More... | |
int | rig_get_xit (RIG *rig, vfo_t vfo, shortfreq_t *xit) |
get the current XIT offset. More... | |
int | rig_set_ts (RIG *rig, vfo_t vfo, shortfreq_t ts) |
set the Tuning Step. More... | |
int | rig_get_ts (RIG *rig, vfo_t vfo, shortfreq_t *ts) |
get the current Tuning Step. More... | |
int | rig_set_ant (RIG *rig, vfo_t vfo, ant_t ant) |
set the antenna. More... | |
int | rig_get_ant (RIG *rig, vfo_t vfo, ant_t *ant) |
get the current antenna. More... | |
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. More... | |
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. More... | |
shortfreq_t | rig_get_resolution (RIG *rig, rmode_t mode) |
get the best frequency resolution of the rig. More... | |
int | rig_set_ctcss_tone (RIG *rig, vfo_t vfo, tone_t tone) |
set CTCSS sub-tone frequency. More... | |
int | rig_get_ctcss_tone (RIG *rig, vfo_t vfo, tone_t *tone) |
get the current CTCSS sub-tone frequency. More... | |
int | rig_set_dcs_code (RIG *rig, vfo_t vfo, tone_t code) |
set the current encoding DCS code. More... | |
int | rig_get_dcs_code (RIG *rig, vfo_t vfo, tone_t *code) |
get the current encoding DCS code. More... | |
int | rig_set_ctcss_sql (RIG *rig, vfo_t vfo, tone_t tone) |
set CTCSS squelch. More... | |
int | rig_get_ctcss_sql (RIG *rig, vfo_t vfo, tone_t *tone) |
get the current CTCSS squelch. More... | |
int | rig_set_dcs_sql (RIG *rig, vfo_t vfo, tone_t code) |
set the current DCS code. More... | |
int | rig_get_dcs_sql (RIG *rig, vfo_t vfo, tone_t *code) |
get the current DCS code. More... | |
int | rig_set_powerstat (RIG *rig, powerstat_t status) |
turn on/off the radio. More... | |
int | rig_get_powerstat (RIG *rig, powerstat_t *status) |
get the on/off status of the radio. More... | |
int | rig_reset (RIG *rig, reset_t reset) |
reset the radio. More... | |
rig_model_t | rig_probe (port_t *port) |
try to guess a rig. More... | |
int | rig_set_level (RIG *rig, vfo_t vfo, setting_t level, value_t val) |
set a radio level setting. More... | |
int | rig_get_level (RIG *rig, vfo_t vfo, setting_t level, value_t *val) |
get the value of a level. More... | |
int | rig_set_parm (RIG *rig, setting_t parm, value_t val) |
set a radio parameter. More... | |
int | rig_get_parm (RIG *rig, setting_t parm, value_t *val) |
get the value of a parameter. More... | |
setting_t | rig_has_get_level (RIG *rig, setting_t level) |
check retrieval ability of level settings. More... | |
setting_t | rig_has_set_level (RIG *rig, setting_t level) |
check settable ability of level settings. More... | |
setting_t | rig_has_get_parm (RIG *rig, setting_t parm) |
check retrieval ability of parameter settings. More... | |
setting_t | rig_has_set_parm (RIG *rig, setting_t parm) |
check settable ability of parameter settings. More... | |
setting_t | rig_has_get_func (RIG *rig, setting_t func) |
check ability of radio functions. More... | |
setting_t | rig_has_set_func (RIG *rig, setting_t func) |
check ability of radio functions. More... | |
int | rig_set_func (RIG *rig, vfo_t vfo, setting_t func, int status) |
activate/desactivate functions of radio. More... | |
int | rig_get_func (RIG *rig, vfo_t vfo, setting_t func, int *status) |
get the status of functions of the radio. More... | |
int | rig_set_conf (RIG *rig, token_t token, const char *val) |
set a radio configuration parameter. More... | |
int | rig_get_conf (RIG *rig, token_t token, char *val) |
get the value of a configuration parameter. More... | |
int | rig_set_mem (RIG *rig, vfo_t vfo, int ch) |
set the current memory channel number. More... | |
int | rig_get_mem (RIG *rig, vfo_t vfo, int *ch) |
get the current memory channel number. More... | |
vfo_op_t | rig_has_vfo_op (RIG *rig, vfo_op_t op) |
check retrieval ability of VFO operations. More... | |
int | rig_vfo_op (RIG *rig, vfo_t vfo, vfo_op_t op) |
perform Memory/VFO operations. More... | |
scan_t | rig_has_scan (RIG *rig, scan_t scan) |
check availability of scaning functions. More... | |
int | rig_scan (RIG *rig, vfo_t vfo, scan_t scan, int ch) |
perform Memory/VFO operations. More... | |
int | rig_send_dtmf (RIG *rig, vfo_t vfo, const char *digits) |
send DTMF digits. More... | |
int | rig_recv_dtmf (RIG *rig, vfo_t vfo, char *digits, int *length) |
receive DTMF digits. More... | |
int | rig_send_morse (RIG *rig, vfo_t vfo, const char *msg) |
send morse code. More... | |
int | rig_set_bank (RIG *rig, vfo_t vfo, int bank) |
set the current memory bank. More... | |
int | rig_save_channel (RIG *rig, channel_t *chan) |
save all the data associated with current VFO. More... | |
int | rig_restore_channel (RIG *rig, const channel_t *chan) |
restore all the data associated with current VFO. More... | |
int | rig_set_channel (RIG *rig, const channel_t *chan) |
set channel data. More... | |
int | rig_get_channel (RIG *rig, channel_t *chan) |
get channel data. More... | |
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. More... | |
int | rig_set_trn (RIG *rig, vfo_t vfo, int trn) |
control the transceive mode. More... | |
int | rig_get_trn (RIG *rig, vfo_t vfo, int *trn) |
get the current transceive mode. More... | |
const char * | rig_get_info (RIG *rig) |
get general information from the radio. More... | |
int | rig_setting2idx (setting_t s) |
basically convert setting_t expressed 2^n to n. More... | |
Variables | |
const char | hamlib_version [] = "Hamlib version " VERSION |
Hamlib release number. More... | |
const char | hamlib_copyright [] |
Hamlib copyright notice. More... | |
const tone_t | full_ctcss_list [] |
const tone_t | common_ctcss_list [] |
const tone_t | full_dcs_list [] |
|
|
|
For internal use only. |
|
|
|
execs cfunc() on each opened rig.
For internal use only. |
|
release a rig handle and free associated memory.
|
|
close the communication to the rig.
|
|
get the current antenna.
|
|
get channel data.
|
|
get the value of a configuration parameter.
|
|
get the current CTCSS squelch.
|
|
get the current CTCSS sub-tone frequency.
|
|
get the status of the DCD.
|
|
get the current encoding DCS code.
|
|
get the current DCS code.
|
|
get the frequency of the target VFO.
|
|
get the status of functions of the radio.
|
|
get general information from the radio.
|
|
get the value of a level.
RIG_LEVEL_STRENGTH: val is an integer, representing the S Meter level in dB, according to the ideal S Meter scale. The ideal S Meter scale is as follow: S0=-54, S1=-48, S2=-42, S3=-36, S4=-30, S5=-24, S6=-18, S7=-12, S8=-6, S9=0, +10=10, +20=20, +30=30, +40=40, +50=50 and +60=60. This is the responsability of the backend to return values calibrated for this scale.
|
|
get the current memory channel number.
|
|
get the mode of the target VFO.
|
|
get the value of a parameter.
|
|
get the on/off status of the radio.
|
|
get the status of the PTT.
|
|
find the freq_range of freq/mode.
|
|
get the best frequency resolution of the rig.
|
|
get the current RIT offset.
|
|
get the current repeater offset.
|
|
get the current repeater shift.
|
|
get the current split mode.
|
|
get the current split frequencies.
|
|
get the current split modes.
|
|
get the current transceive mode.
|
|
get the current Tuning Step.
|
|
get the current VFO.
|
|
get the current XIT offset.
|
|
check ability of radio functions.
EXAMPLE: if (rig_has_get_func(my_rig,RIG_FUNC_FAGC)) disp_fagc_button();
|
|
check retrieval ability of level settings.
EXAMPLE: if (rig_has_get_level(my_rig, RIG_LVL_STRENGTH)) disp_Smeter();
|
|
check retrieval ability of parameter settings.
EXAMPLE: if (rig_has_get_parm(my_rig, RIG_PARM_ANN)) good4you();
|
|
check availability of scaning functions.
EXAMPLE: if (rig_has_scan(my_rig, RIG_SCAN_PRIO)) disp_SCANprio_btn();
|
|
check ability of radio functions.
EXAMPLE: if (rig_has_set_func(my_rig,RIG_FUNC_FAGC)) disp_fagc_button();
|
|
check settable ability of level settings.
EXAMPLE: if (rig_has_set_level(my_rig, RIG_LVL_RFPOWER)) crank_tx();
|
|
check settable ability of parameter settings.
EXAMPLE: if (rig_has_set_parm(my_rig, RIG_PARM_ANN)) announce_all();
|
|
check retrieval ability of VFO operations.
EXAMPLE: if (rig_has_vfo_op(my_rig, RIG_OP_CPY)) disp_VFOcpy_btn();
|
|
allocate a new RIG handle.
|
|
conversion utility from absolute in mW to relative range.
|
|
open the communication to the rig.
|
|
get the narrow passband of a mode.
|
|
get the normal passband of a mode.
|
|
get the wide passband of a mode.
|
|
conversion utility from relative range to absolute in mW.
|
|
try to guess a rig.
|
|
receive DTMF digits.
|
|
reset the radio.
|
|
restore all the data associated with current VFO.
|
|
save all the data associated with current VFO.
|
|
perform Memory/VFO operations.
|
|
send DTMF digits.
|
|
send morse code.
|
|
set the antenna.
|
|
set the current memory bank.
|
|
set channel data.
|
|
set a radio configuration parameter.
|
|
set CTCSS squelch.
|
|
set CTCSS sub-tone frequency.
|
|
set the current encoding DCS code.
|
|
set the current DCS code.
|
|
set the frequency of the target VFO.
|
|
activate/desactivate functions of radio.
|
|
set a radio level setting.
|
|
set the current memory channel number.
|
|
set the mode of the target VFO.
|
|
set a radio parameter.
|
|
turn on/off the radio.
|
|
set PTT on/off.
|
|
set the RIT.
|
|
set the repeater offset.
|
|
set the repeater shift.
|
|
set the split mode.
|
|
set the split frequencies.
|
|
set the split modes.
|
|
control the transceive mode.
|
|
set the Tuning Step.
|
|
set the current VFO.
|
|
set the XIT.
|
|
basically convert setting_t expressed 2^n to n.
|
|
perform Memory/VFO operations.
|
|
get string describing the error code.
|
|
Initial value: { 670, 693, 719, 744, 770, 797, 825, 854, 885, 915, 948, 974, 1000, 1035, 1072, 1109, 1148, 1188, 1230, 1273, 1318, 1365, 1413, 1462, 1514, 1567, 1598, 1622, 1655, 1679, 1713, 1738, 1773, 1799, 1835, 1862, 1899, 1928, 1966, 1995, 2035, 2065, 2107, 2181, 2257, 2291, 2336, 2418, 2503, 2541, 0, }
|
|
Initial value: { 600, 670, 693, 719, 744, 770, 797, 825, 854, 885, 915, 948, 974, 1000, 1035, 1072, 1109, 1148, 1188, 1200, 1230, 1273, 1318, 1365, 1413, 1462, 1514, 1567, 1598, 1622, 1655, 1679, 1713, 1738, 1773, 1799, 1835, 1862, 1899, 1928, 1966, 1995, 2035, 2065, 2107, 2181, 2257, 2291, 2336, 2418, 2503, 2541, 0, } |
|
Initial value: { 017, 023, 025, 026, 031, 032, 036, 043, 047, 050, 051, 053, 054, 065, 071, 072, 073, 074, 114, 115, 116, 122, 125, 131, 132, 134, 143, 145, 152, 155, 156, 162, 165, 172, 174, 205, 212, 223, 225, 226, 243, 244, 245, 246, 251, 252, 255, 261, 263, 265, 266, 271, 274, 306, 311, 315, 325, 331, 332, 343, 346, 351, 356, 364, 365, 371, 411, 412, 413, 423, 431, 432, 445, 446, 452, 454, 455, 462, 464, 465, 466, 503, 506, 516, 523, 526, 532, 546, 565, 606, 612, 624, 627, 631, 632, 654, 662, 664, 703, 712, 723, 731, 732, 734, 743, 754, 0, } |
|
Initial value: "Copyright (C) 2000, 2001 Stephane Fillod and Frank Singleton\n" "This is free software; see the source for copying conditions. " "There is NO\n warranty; not even for MERCHANTABILITY or FITNESS FOR A" "PARTICULAR PURPOSE."
|
|
Hamlib release number.
|