MCPcopy Create free account
hub / github.com/Hamlib/Hamlib / rig_get_cache

Function rig_get_cache

src/cache.c:311–536  ·  view source on GitHub ↗

* \brief get cached values for a VFO * \param rig The rig handle * \param vfo The VFO to get information from * \param freq The frequency is stored here * \param cache_ms_freq The age of the last frequency update in ms * \param mode The mode is stored here * \param cache_ms_mode The age of the last mode update in ms * \param width The width is s

Source from the content-addressed store, hash-verified

309 *
310 */
311int rig_get_cache(RIG *rig, vfo_t vfo, freq_t *freq, int *cache_ms_freq,
312 rmode_t *mode, int *cache_ms_mode, pbwidth_t *width, int *cache_ms_width)
313{
314 struct rig_cache *cachep;
315 struct rig_state *rs;
316
317 if (CHECK_RIG_ARG(rig) || !freq || !cache_ms_freq ||
318 !mode || !cache_ms_mode || !width || !cache_ms_width)
319 {
320 return -RIG_EINVAL;
321 }
322
323 cachep = CACHE(rig);
324 rs = STATE(rig);
325
326 if (rig_need_debug(RIG_DEBUG_CACHE))
327 {
328 ENTERFUNC2;
329 }
330
331 rig_debug(RIG_DEBUG_CACHE, "%s(%d): vfo=%s, current_vfo=%s\n", __func__,
332 __LINE__,
333 rig_strvfo(vfo), rig_strvfo(rs->current_vfo));
334
335 if (vfo == RIG_VFO_CURR)
336 {
337 vfo = rs->current_vfo;
338 }
339 else if (vfo == RIG_VFO_TX)
340 {
341 vfo = rs->tx_vfo;
342 rig_debug(RIG_DEBUG_VERBOSE, "%s: TX VFO = %s\n", __func__, rig_strvfo(vfo));
343 }
344 else if (vfo == RIG_VFO_RX)
345 {
346 vfo = rs->rx_vfo;
347 rig_debug(RIG_DEBUG_VERBOSE, "%s: RX VFO = %s\n", __func__, rig_strvfo(vfo));
348 }
349 else if (vfo == RIG_VFO_OTHER)
350 {
351 switch (rs->current_vfo)
352 {
353 case RIG_VFO_CURR:
354 break; // no change
355
356 case RIG_VFO_OTHER:
357 vfo = RIG_VFO_OTHER;
358 break;
359
360 case RIG_VFO_A:
361 vfo = RIG_VFO_B;
362 break;
363
364 case RIG_VFO_MAIN_A:
365 vfo = RIG_VFO_MAIN_B;
366 break;
367
368 case RIG_VFO_MAIN:

Callers 14

id5100.cFile · 0.85
ft857_get_levelFunction · 0.85
rig_get_freqFunction · 0.85
rig_set_modeFunction · 0.85
rig_get_modeFunction · 0.85
rig_set_split_modeFunction · 0.85
rig_get_rig_infoFunction · 0.85
rig_get_cache_freqFunction · 0.85

Calls 5

rig_need_debugFunction · 0.85
rig_debugFunction · 0.85
rig_strvfoFunction · 0.85
elapsed_msFunction · 0.85
rig_strrmodeFunction · 0.85

Tested by 1

mainFunction · 0.68