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

int HAMLIB_API par_write_data ( hamlib_port_t port,
unsigned char  data 
)

Send data on Parallel port.

Parameters:
port 
data 

Definition at line 165 of file parallel.c.

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

Referenced by par_ptt_set().

{
#ifdef HAVE_LINUX_PPDEV_H
      int status;
      status = ioctl(port->fd, PPWDATA, &data);
      return status == 0 ? RIG_OK : -RIG_EIO;
#elif defined(HAVE_DEV_PPBUS_PPI_H)
      int status;
      status = ioctl(port->fd, PPISDATA, &data);
      return status == 0 ? RIG_OK : -RIG_EIO;
#elif defined(WIN32)
      unsigned int dummy;

      if (!(DeviceIoControl((HANDLE)(port->fd), NT_IOCTL_DATA, &data, sizeof(data), 
                  NULL, 0, (LPDWORD)&dummy, NULL))) {
            rig_debug(RIG_DEBUG_ERR, "%s: DeviceIoControl failed!\n", __FUNCTION__);
      }
#endif
      return -RIG_ENIMPL;
}


Generated by  Doxygen 1.6.0   Back to index