Loading...
Searching...
No Matches
misc.c File Reference
Rig (transceiver) Internal API

Miscellaneous utility routines. More...

`#include <hamlib/config.h>`
`#include <stdlib.h>`
`#include <stdarg.h>`
`#include <stdio.h>`
`#include <string.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"`
`#include "sprintflst.h"`
`#include "../rigs/icom/icom.h"`
Include dependency graph for misc.c:

## 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 | rig_parse_band (const char *s)
| Convert alpha string to enum band_select_t...
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.
int | check_level_param (RIG *rig, setting_t level, value_t val, gran_t **gran)
| check input to set_level
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 (const 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.
int | rig_get_cache_timeout_ms (RIG *rig, hamlib_cache_t selection)
int | rig_set_cache_timeout_ms (RIG *rig, hamlib_cache_t selection, int ms)
vfo_t | vfo_fixup2a (RIG *rig, vfo_t vfo, split_t split, const char *func, int line)
vfo_t | vfo_fixup (RIG *rig, vfo_t vfo, split_t split)
int | parse_hoststr (char *hoststr, int hoststr_len, char host[256], char port[6])
int | rig_flush_force (hamlib_port_t *port, int flush_async_data)
| Force flush of rig communication data buffers.
int | rig_flush (hamlib_port_t *port)
const char * | rot_strstatus (rot_status_t status)
| Convert enum ROT_STATUS_... to a string.
void * | rig_get_function_ptr (rig_model_t rig_model, enum rig_function_e rig_function)
| Get pointer to rig function instead of using rig->caps.
uint64_t | rig_get_caps_int (rig_model_t rig_model, enum rig_caps_int_e rig_caps)
| Get integer/long instead of using rig->caps watch out for integer values that may be negative – if needed must change hamlib.
const char * | rig_get_caps_cptr (rig_model_t rig_model, enum rig_caps_cptr_e rig_caps)
| Function to return char pointer value from rig->caps.
const char * | rig_strcommstatus (rig_comm_status_t status)
| Convert enum RIG_COMM_STATUS... to alpha string.
void | errmsg (int err, char *s, const char *func, const char *file, int line)
uint32_t | CRC32_function (uint8_t *buf, uint32_t len)
int | queue_deferred_config (deferred_config_header_t *head, hamlib_token_t token, const char *val)

## Detailed Description

Miscellaneous utility routines.