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

int HAMLIB_API par_lock ( hamlib_port_t port  ) 

Get a lock on the Parallel Port.

Parameters:
port 
Returns:
RIG_OK or < 0

Definition at line 335 of file parallel.c.

References hamlib_port_t::fd, hamlib_port_t::pathname, rig_debug(), RIG_DEBUG_ERR, RIG_EIO, RIG_ENIMPL, and RIG_OK.

Referenced by par_ptt_get(), and par_ptt_set().

{
#ifdef HAVE_LINUX_PPDEV_H
      if (ioctl(port->fd, PPCLAIM) < 0) {
            rig_debug(RIG_DEBUG_ERR, "Claiming device \"%s\": %s\n", port->pathname, strerror(errno));
            return -RIG_EIO;
      }
      return RIG_OK;
#elif defined(HAVE_DEV_PPBUS_PPI_H)
#elif defined(WIN32)
      return RIG_OK;
#endif
      return -RIG_ENIMPL;
}


Generated by  Doxygen 1.6.0   Back to index