Logo Search packages:      
Sourcecode: hamlib version File versions  Download package

int par_dcd_get ( hamlib_port_t p,
dcd_t dcdx 
)

get Data Carrier Detect (squelch) from Parallel Port

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

Definition at line 456 of file parallel.c.

References hamlib_port_t::dcd, par_read_data(), hamlib_port_t::parallel, hamlib_port_t::parm, RIG_DCD_OFF, RIG_DCD_ON, RIG_DCD_PARALLEL, rig_debug(), RIG_DEBUG_ERR, RIG_ENAVAIL, RIG_OK, and hamlib_port_t::type.

Referenced by rig_get_dcd().

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

            status = par_read_data(p, &reg);
            *dcdx = reg & (1<<p->parm.parallel.pin) ? 
                        RIG_DCD_ON:RIG_DCD_OFF;
            return status;
            }
      default:
            rig_debug(RIG_DEBUG_ERR,"Unsupported DCD type %d\n", 
                                    p->type.dcd);
            return -RIG_ENAVAIL;
      }
      return RIG_OK;
}


Generated by  Doxygen 1.6.0   Back to index