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

Function rig_get_function_ptr

src/misc.c:2361–2644  ·  view source on GitHub ↗

* \brief Get pointer to rig function instead of using rig->caps * \param rig_model * \param rig_function * \return the corresponding function pointer */

Source from the content-addressed store, hash-verified

2359 * \return the corresponding function pointer
2360 */
2361void *HAMLIB_API rig_get_function_ptr(rig_model_t rig_model,
2362 enum rig_function_e rig_function)
2363{
2364 const struct rig_caps *caps = rig_get_caps(rig_model);
2365
2366 if (caps == NULL)
2367 {
2368 rig_debug(RIG_DEBUG_ERR, "%s: caps == null for model %d??\n", __func__,
2369 rig_model);
2370 return NULL;
2371 }
2372
2373 switch (rig_function)
2374 {
2375 case RIG_FUNCTION_INIT:
2376 return caps->rig_init;
2377
2378 case RIG_FUNCTION_CLEANUP:
2379 return caps->rig_cleanup;
2380
2381 case RIG_FUNCTION_OPEN:
2382 return caps->rig_open;
2383
2384 case RIG_FUNCTION_CLOSE:
2385 return caps->rig_close;
2386
2387 case RIG_FUNCTION_SET_FREQ:
2388 return caps->set_freq;
2389
2390 case RIG_FUNCTION_GET_FREQ:
2391 return caps->get_freq;
2392
2393 case RIG_FUNCTION_SET_MODE:
2394 return caps->set_mode;
2395
2396 case RIG_FUNCTION_GET_MODE:
2397 return caps->get_mode;
2398
2399 case RIG_FUNCTION_SET_VFO:
2400 return caps->set_vfo;
2401
2402 case RIG_FUNCTION_GET_VFO:
2403 return caps->get_vfo;
2404
2405 case RIG_FUNCTION_SET_PTT:
2406 return caps->set_ptt;
2407
2408 case RIG_FUNCTION_GET_PTT:
2409 return caps->get_ptt;
2410
2411 case RIG_FUNCTION_GET_DCD:
2412 return caps->get_dcd;
2413
2414 case RIG_FUNCTION_SET_RPTR_SHIFT:
2415 return caps->set_rptr_shift;
2416
2417 case RIG_FUNCTION_GET_RPTR_SHIFT:
2418 return caps->get_rptr_shift;

Callers

nothing calls this directly

Calls 2

rig_get_capsFunction · 0.85
rig_debugFunction · 0.85

Tested by

no test coverage detected