![]() |
Hamlib 4.5.4
|
Miscellaneous utility routines. More...
#include <hamlib/config.h>
#include <stdlib.h>
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
#include <fcntl.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/time.h>
#include <math.h>
#include <hamlib/rig.h>
#include <hamlib/rotator.h>
#include <hamlib/amplifier.h>
#include "misc.h"
#include "serial.h"
#include "network.h"
Functions | |
unsigned char * | to_bcd (unsigned char bcd_data[], unsigned long long freq, unsigned bcd_len) |
Convert from binary to 4-bit BCD digits, little-endian. | |
unsigned long long | from_bcd (const unsigned char bcd_data[], unsigned bcd_len) |
Convert BCD digits, little-endian, to a long long (e.g. frequency in Hz) | |
unsigned char * | to_bcd_be (unsigned char bcd_data[], unsigned long long freq, unsigned bcd_len) |
Convert from binary to 4-bit BCD digits, big-endian. | |
unsigned long long | from_bcd_be (const unsigned char bcd_data[], unsigned bcd_len) |
Convert 4-bit BCD digits to binary, big-endian. | |
size_t | to_hex (size_t source_length, const unsigned char *source_data, size_t dest_length, char *dest_data) |
double | morse_code_dot_to_millis (int wpm) |
Convert duration of one morse code dot (element) to milliseconds at the given speed. | |
int | dot10ths_to_millis (int dot10ths, int wpm) |
Convert duration of tenths of morse code dots to milliseconds at the given speed. | |
int | millis_to_dot10ths (int millis, int wpm) |
Convert duration in milliseconds to tenths of morse code dots at the given speed. | |
int | sprintf_freq (char *str, int str_len, freq_t freq) |
Pretty print a frequency. | |
const char * | rig_strstatus (enum rig_status_e status) |
Convert enum RIG_STATUS_... to printable string. | |
rmode_t | rig_parse_mode (const char *s) |
Convert alpha string to enum RIG_MODE. | |
const char * | rig_strrmode (rmode_t mode) |
Convert enum RIG_MODE to alpha string. | |
int | rig_strrmodes (rmode_t modes, char *buf, int buflen) |
Convert RIG_MODE or'd value to alpha string of all modes. | |
vfo_t | rig_parse_vfo (const char *s) |
Convert alpha string to enum RIG_VFO_... | |
const char * | rig_strvfo (vfo_t vfo) |
Convert enum RIG_VFO_... to alpha string. | |
uint64_t | rig_idx2setting (int i) |
setting_t | rig_parse_func (const char *s) |
Convert alpha string to enum RIG_FUNC_... | |
setting_t | rot_parse_func (const char *s) |
Convert alpha string to enum ROT_FUNC_... | |
const char * | rig_strfunc (setting_t func) |
Convert enum RIG_FUNC_... to alpha string. | |
const char * | rot_strfunc (setting_t func) |
Convert enum ROT_FUNC_... to alpha string. | |
setting_t | rig_parse_level (const char *s) |
Convert alpha string to enum RIG_LEVEL_... | |
setting_t | rot_parse_level (const char *s) |
Convert alpha string to enum ROT_LEVEL_... | |
setting_t | amp_parse_level (const char *s) |
Convert alpha string to enum AMP_LEVEL_... | |
const char * | rig_strlevel (setting_t level) |
Convert enum RIG_LEVEL_... to alpha string. | |
const char * | rot_strlevel (setting_t level) |
Convert enum ROT_LEVEL_... to alpha string. | |
const char * | amp_strlevel (setting_t level) |
Convert enum AMP_LEVEL_... to alpha string. | |
setting_t | rig_parse_parm (const char *s) |
Convert alpha string to RIG_PARM_... | |
setting_t | rot_parse_parm (const char *s) |
Convert alpha string to ROT_PARM_... | |
const char * | rig_strparm (setting_t parm) |
Convert enum RIG_PARM_... to alpha string. | |
const char * | rot_strparm (setting_t parm) |
Convert enum ROT_PARM_... to alpha string. | |
const char * | rig_stragclevel (enum agc_level_e level) |
Convert enum RIG_AGC_... to alpha string. | |
value_t | rig_valueagclevel (enum agc_level_e agcLevel) |
Convert a enum agc_level_e to value. | |
enum agc_level_e | rig_levelagcvalue (int agcValue) |
Convert a value to agc_level_e – constrains the range. | |
enum agc_level_e | rig_levelagcstr (char *agcString) |
Convert AGC string... to agc_level_e. | |
vfo_op_t | rig_parse_vfo_op (const char *s) |
Convert alpha string to enum RIG_OP_... | |
const char * | rig_strvfop (vfo_op_t op) |
Convert enum RIG_OP_... to alpha string. | |
scan_t | rig_parse_scan (const char *s) |
Convert alpha string to enum RIG_SCAN_... | |
const char * | rig_strscan (scan_t rscan) |
Convert enum RIG_SCAN_... to alpha string. | |
const char * | rig_strptrshift (rptr_shift_t shift) |
convert enum RIG_RPT_SHIFT_... to printable character | |
rptr_shift_t | rig_parse_rptr_shift (const char *s) |
Convert alpha char to enum RIG_RPT_SHIFT_... | |
chan_type_t | rig_parse_mtype (const char *s) |
Convert alpha string to enum RIG_MTYPE_... | |
const char * | rig_strmtype (chan_type_t mtype) |
Convert enum RIG_MTYPE_... to alpha string. | |
const char * | rig_strspectrummode (enum rig_spectrum_mode_e mode) |
Convert enum RIG_SPECTRUM_MODE_... to alpha string. | |
int | rig_check_cache_timeout (const struct timeval *tv, int timeout) |
Helper for checking cache timeout. | |
void | rig_force_cache_timeout (struct timeval *tv) |
Helper for forcing cache timeout next call. | |
Miscellaneous utility routines.