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

misc.c File Reference


Detailed Description

Miscellaneous utility routines.

Definition in file misc.c.

#include <stdlib.h>
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include <sys/types.h>
#include <hamlib/rig.h>
#include "misc.h"

Go to the source code of this file.

Defines

#define llabs(a)   ((a)<0?-(a):(a))

Functions

unsigned long long HAMLIB_API from_bcd (const unsigned char bcd_data[], unsigned bcd_len)
 Convert BCD digits to a long long (eg. frequency in Hz).
unsigned long long HAMLIB_API from_bcd_be (const unsigned char bcd_data[], unsigned bcd_len)
 Convert bcd to binary, big-endian.
setting_t HAMLIB_API rig_parse_func (const char *s)
 Convert alpha string to enum RIG_FUNC_...
setting_t HAMLIB_API rig_parse_level (const char *s)
 Convert alpha string to enum RIG_LEVEL_...
rmode_t HAMLIB_API rig_parse_mode (const char *s)
 Convert alpha string to enum RIG_MODE.
setting_t HAMLIB_API rig_parse_parm (const char *s)
 Convert alpha string to RIG_PARM_...
rptr_shift_t HAMLIB_API rig_parse_rptr_shift (const char *s)
 Convert alpha char to enum RIG_RPT_SHIFT_...
scan_t HAMLIB_API rig_parse_scan (const char *s)
 Convert alpha string to enum RIG_SCAN_...
vfo_t HAMLIB_API rig_parse_vfo (const char *s)
 Convert alpha string to enum RIG_VFO_...
vfo_op_t HAMLIB_API rig_parse_vfo_op (const char *s)
 Convert alpha string to enum RIG_OP_...
const char *HAMLIB_API rig_strfunc (setting_t func)
 Convert enum RIG_FUNC_... to alpha string.
const char *HAMLIB_API rig_strlevel (setting_t level)
 Convert enum RIG_LEVEL_... to alpha string.
const char *HAMLIB_API rig_strparm (setting_t parm)
 Convert enum RIG_PARM_... to alpha string.
const char *HAMLIB_API rig_strptrshift (rptr_shift_t shift)
 convert enum RIG_RPT_SHIFT_... to printable character
const char *HAMLIB_API rig_strrmode (rmode_t mode)
 Convert enum RIG_MODE to alpha string.
const char *HAMLIB_API rig_strscan (scan_t rscan)
 Convert enum RIG_SCAN_... to alpha string.
const char *HAMLIB_API rig_strstatus (enum rig_status_e status)
 Convert enum RIG_STATUS_... to printable string.
const char *HAMLIB_API rig_strvfo (vfo_t vfo)
 Convert enum RIG_VFO_... to alpha string.
const char *HAMLIB_API rig_strvfop (vfo_op_t op)
 Convert enum RIG_OP_... to alpha string.
int HAMLIB_API sprintf_freq (char *str, freq_t freq)
 Pretty print a frequency.
unsigned char *HAMLIB_API to_bcd (unsigned char bcd_data[], unsigned long long freq, unsigned bcd_len)
 Convert from binary to 4-bit BCD digits, little-endian.
unsigned char *HAMLIB_API to_bcd_be (unsigned char bcd_data[], unsigned long long freq, unsigned bcd_len)
 Convert binary to bcd, big-endian.

Variables

struct {
   setting_t   func
   const char *   str
func_str []
struct {
   setting_t   level
   const char *   str
level_str []
struct {
   rmode_t   mode
   const char *   str
mode_str []
struct {
   setting_t   parm
   const char *   str
parm_str []
struct {
   scan_t   rscan
   const char *   str
scan_str []
struct {
   const char *   str
   vfo_op_t   vfo_op
vfo_op_str []
struct {
   const char *   str
   vfo_t   vfo
vfo_str []


Generated by  Doxygen 1.6.0   Back to index