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

Function par_ptt_get

src/parallel.c:680–714  ·  view source on GitHub ↗

* \brief Get state of Push to Talk from Parallel Port * \param p * \param pttx return value (must be non NULL) * \return RIG_OK or < 0 error */

Source from the content-addressed store, hash-verified

678 * \return RIG_OK or < 0 error
679 */
680int par_ptt_get(hamlib_port_t *p, ptt_t *pttx)
681{
682 rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
683
684 switch (p->type.ptt)
685 {
686 case RIG_PTT_PARALLEL:
687 {
688 unsigned char ctl;
689 int status;
690
691 par_lock(p);
692 status = par_read_control(p, &ctl);
693 par_unlock(p);
694
695 if (status == RIG_OK)
696 {
697 *pttx = (ctl & PARPORT_CONTROL_INIT) &&
698 !(ctl & PARPORT_CONTROL_STROBE) ?
699 RIG_PTT_ON : RIG_PTT_OFF;
700 }
701
702 return status;
703 }
704
705 default:
706 rig_debug(RIG_DEBUG_ERR,
707 "%s: unsupported PTT type %d\n",
708 __func__,
709 p->type.ptt);
710 return -RIG_ENAVAIL;
711 }
712
713 return RIG_OK;
714}
715
716
717/**

Callers 2

dummy_get_pttFunction · 0.85
rig_get_pttFunction · 0.85

Calls 4

rig_debugFunction · 0.85
par_lockFunction · 0.85
par_read_controlFunction · 0.85
par_unlockFunction · 0.85

Tested by

no test coverage detected