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

int HAMLIB_API ser_set_rts ( hamlib_port_t p,
int  state 
)

Set Request to Send (RTS) bit.

Parameters:
p 
state true/false
Returns:
RIG_OK or < 0

Definition at line 410 of file serial.c.

References hamlib_port_t::fd, RIG_EIO, and RIG_OK.

Referenced by port_open(), and rig_set_ptt().

{
      unsigned int y = TIOCM_RTS;

#if defined(TIOCMBIS) && defined(TIOCMBIC)
      return IOCTL(p->fd, state ? TIOCMBIS : TIOCMBIC, &y) < 0 ?
                  -RIG_EIO : RIG_OK;
#else
      if (IOCTL(p->fd, TIOCMGET, &y) < 0) {
            return -RIG_EIO;
      }
      if (state)
            y |= TIOCM_RTS;
      else
            y &= ~TIOCM_RTS;
      return IOCTL(p->fd, TIOCMSET, &y) < 0 ? -RIG_EIO : RIG_OK;
#endif
}


Generated by  Doxygen 1.6.0   Back to index