Logo Search packages:      
Sourcecode: hamlib version File versions

int par_ptt_get ( hamlib_port_t p,
ptt_t pttx 
)

Get state of Push to Talk from Parallel Port.

Parameters:
p 
pttx return value (must be non NULL)
Returns:
RIG_OK or < 0 error

Definition at line 402 of file parallel.c.

References par_read_data(), hamlib_port_t::parallel, hamlib_port_t::parm, hamlib_port_t::ptt, rig_debug(), RIG_DEBUG_ERR, RIG_ENAVAIL, RIG_OK, RIG_PTT_OFF, RIG_PTT_ON, RIG_PTT_PARALLEL, and hamlib_port_t::type.

Referenced by rig_get_ptt().

{
      switch(p->type.ptt) {
      case RIG_PTT_PARALLEL:
            {
            unsigned char reg;
            int status;

            status = par_read_data(p, &reg);
            *pttx = reg & (1<<p->parm.parallel.pin) ? 
                              RIG_PTT_ON:RIG_PTT_OFF;
            return status;
            }
      default:
            rig_debug(RIG_DEBUG_ERR,"Unsupported PTT type %d\n", 
                                    p->type.ptt);
            return -RIG_ENAVAIL;
      }
      return RIG_OK;
}


Generated by  Doxygen 1.6.0   Back to index