34 #define Hold_Decode(rig) {(rig)->state.hold_decode = 1;}
35 #define Unhold_Decode(rig) {(rig)->state.hold_decode = 0;}
43 void dump_hex(
const unsigned char ptr[],
size_t size);
56 extern HAMLIB_EXPORT(
unsigned char *)
to_bcd(
unsigned char bcd_data[],
57 unsigned long long freq,
60 extern HAMLIB_EXPORT(
unsigned long long)
from_bcd(
const unsigned char
67 extern HAMLIB_EXPORT(
unsigned char *)
to_bcd_be(
unsigned char bcd_data[],
68 unsigned long long freq,
71 extern HAMLIB_EXPORT(
unsigned long long)
from_bcd_be(
const unsigned char
83 extern int no_restore_ai;
86 #define isreturn(c) ((c) == 10 || (c) == 13)
90 #ifdef HAVE_INTTYPES_H
91 # include <inttypes.h>
94 #ifdef HAVE_SYS_TIME_H
95 # include <sys/time.h>
105 extern HAMLIB_EXPORT(
int)
hl_usleep(rig_useconds_t usec);
107 extern HAMLIB_EXPORT(
double) elapsed_ms(
struct timespec *start,
int start_flag);
111 extern HAMLIB_EXPORT(
int) parse_hoststr(
char *host,
char hoststr[256],
char port[6]);
115 # define PRIll PRId64
116 # define PRXll PRIx64
129 # define SCNll SCNd64
130 # define SCNXll SCNx64
137 # define SCNXll "llx"
141 #define __FILENAME__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
142 void errmsg(
int err,
char *s,
const char *func,
const char *file,
int line);
143 #define ERRMSG(err, s) errmsg(err, s, __func__, __FILENAME__, __LINE__)
144 #define ENTERFUNC rig_debug(RIG_DEBUG_VERBOSE, "%s(%d):%s entered\n", __FILENAME__, __LINE__, __func__)
145 #define RETURNFUNC(rc) {rig_debug(RIG_DEBUG_VERBOSE, "%s(%d):%s return\n", __FILENAME__, __LINE__, __func__);return rc;}
147 #define CACHE_RESET {\
148 elapsed_ms(&rig->state.cache.time_freq, HAMLIB_ELAPSED_INVALIDATE);\
149 elapsed_ms(&rig->state.cache.time_freqCurr, HAMLIB_ELAPSED_INVALIDATE);\
150 elapsed_ms(&rig->state.cache.time_freqMainA, HAMLIB_ELAPSED_INVALIDATE);\
151 elapsed_ms(&rig->state.cache.time_freqMainB, HAMLIB_ELAPSED_INVALIDATE);\
152 elapsed_ms(&rig->state.cache.time_freqMainC, HAMLIB_ELAPSED_INVALIDATE);\
153 elapsed_ms(&rig->state.cache.time_freqSubA, HAMLIB_ELAPSED_INVALIDATE);\
154 elapsed_ms(&rig->state.cache.time_freqSubB, HAMLIB_ELAPSED_INVALIDATE);\
155 elapsed_ms(&rig->state.cache.time_vfo, HAMLIB_ELAPSED_INVALIDATE);\
156 elapsed_ms(&rig->state.cache.time_mode, HAMLIB_ELAPSED_INVALIDATE);\
157 elapsed_ms(&rig->state.cache.time_ptt, HAMLIB_ELAPSED_INVALIDATE);\
158 elapsed_ms(&rig->state.cache.time_split, HAMLIB_ELAPSED_INVALIDATE);\
int millis_to_dot10ths(int millis, int wpm)
Convert duration in milliseconds to tenths of morse code dots at the given speed.
Definition: misc.c:329
int rig_check_cache_timeout(const struct timeval *tv, int timeout)
Helper for checking cache timeout.
Definition: misc.c:1485
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.
Definition: misc.c:139
void rig_force_cache_timeout(struct timeval *tv)
Helper for forcing cache timeout next call.
Definition: misc.c:1539
setting_t rig_idx2setting(int i)
Definition: misc.c:694
__BEGIN_DECLS void dump_hex(const unsigned char ptr[], size_t size)
Do a hex dump of the unsigned char array.
Definition: debug.c:73
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)
Definition: misc.c:186
unsigned long long from_bcd_be(const unsigned char bcd_data[], unsigned bcd_len)
Convert 4-bit BCD digits to binary, big-endian.
Definition: misc.c:266
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.
Definition: misc.c:223
double morse_code_dot_to_millis(int wpm)
Convert duration of one morse code dot (element) to milliseconds at the given speed.
Definition: misc.c:303
int sprintf_freq(char *str, freq_t)
Pretty print a frequency.
Definition: misc.c:350
int dot10ths_to_millis(int dot10ths, int wpm)
Convert duration of tenths of morse code dots to milliseconds at the given speed.
Definition: misc.c:316
unsigned int vfo_t
VFO definition.
Definition: rig.h:395
int hl_usleep(rig_useconds_t usec)
provide sleep and usleep replacements
Definition: sleep.c:53
uint64_t setting_t
Setting.
Definition: rig.h:964
double freq_t
Frequency type,.
Definition: rig.h:335
Hamlib rig data structures.
The Rig structure.
Definition: rig.h:2260