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

Function rig_get_rptr_shift

src/rig.c:4505–4572  ·  view source on GitHub ↗

* \brief get the current repeater shift * \param rig The rig handle * \param vfo The target VFO * \param rptr_shift The location where to store the current repeater shift * * Retrieves the current repeater shift. * * \return RIG_OK if the operation has been successful, otherwise * a negative value if an error occurred (in which case, cause is * set appropriately). * * \sa rig_se

Source from the content-addressed store, hash-verified

4503 * \sa rig_set_rptr_shift()
4504 */
4505int HAMLIB_API rig_get_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t *rptr_shift)
4506{
4507 const struct rig_caps *caps;
4508 int retcode, rc2;
4509 vfo_t curr_vfo;
4510
4511 if (CHECK_RIG_ARG(rig))
4512 {
4513 rig_debug(RIG_DEBUG_ERR, "%s: rig or rig->caps is null\n", __func__);
4514 return -RIG_EINVAL;
4515 }
4516
4517 ELAPSED1;
4518 ENTERFUNC;
4519
4520 if (!rptr_shift)
4521 {
4522 ELAPSED2;
4523 RETURNFUNC(-RIG_EINVAL);
4524 }
4525
4526 caps = rig->caps;
4527
4528 if (caps->get_rptr_shift == NULL)
4529 {
4530 ELAPSED2;
4531 RETURNFUNC(-RIG_ENAVAIL);
4532 }
4533
4534 if (vfo == RIG_VFO_CURR
4535 || vfo == STATE(rig)->current_vfo)
4536 {
4537 HAMLIB_TRACE;
4538 retcode = caps->get_rptr_shift(rig, vfo, rptr_shift);
4539 ELAPSED2;
4540 RETURNFUNC(retcode);
4541 }
4542
4543 if (!caps->set_vfo)
4544 {
4545 ELAPSED2;
4546 RETURNFUNC(-RIG_ENAVAIL);
4547 }
4548
4549 curr_vfo = STATE(rig)->current_vfo;
4550 HAMLIB_TRACE;
4551 retcode = caps->set_vfo(rig, vfo);
4552
4553 if (retcode != RIG_OK)
4554 {
4555 ELAPSED2;
4556 RETURNFUNC(retcode);
4557 }
4558
4559 HAMLIB_TRACE;
4560 retcode = caps->get_rptr_shift(rig, vfo, rptr_shift);
4561 /* try and revert even if we had an error above */
4562 rc2 = caps->set_vfo(rig, curr_vfo);

Callers 3

getRptrShiftMethod · 0.85
generic_save_channelFunction · 0.85
rigctl_parse.cFile · 0.85

Calls 1

rig_debugFunction · 0.85

Tested by

no test coverage detected