MCPcopy Create free account
hub / github.com/Hamlib/Hamlib / port_select

Function port_select

src/iofunc.c:687–733  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

685}
686
687static int port_select(hamlib_port_t *p,
688 int n,
689 fd_set *readfds,
690 fd_set *writefds,
691 fd_set *exceptfds,
692 struct timeval *timeout,
693 int direct)
694{
695#if 1
696
697 /* select does not work very well with writefds/exceptfds
698 * So let's pretend there's none of them
699 */
700 if (exceptfds)
701 {
702 FD_ZERO(exceptfds);
703 }
704
705 if (writefds)
706 {
707 FD_ZERO(writefds);
708 }
709
710 writefds = NULL;
711 exceptfds = NULL;
712#endif
713
714 /*
715 * Since WIN32 does its special serial select, we have
716 * to catch the microHam case to do just "select".
717 * Note that we always have RIG_PORT_SERIAL in the
718 * microHam case.
719 */
720 if (direct && is_uh_radio_fd(p->fd))
721 {
722 return select(n, readfds, writefds, exceptfds, timeout);
723 }
724
725 if (direct && p->type.rig == RIG_PORT_SERIAL)
726 {
727 return win32_serial_select(n, readfds, writefds, exceptfds, timeout);
728 }
729 else
730 {
731 return select(n, readfds, writefds, exceptfds, timeout);
732 }
733}
734
735static int port_wait_for_data_direct(hamlib_port_t *p)
736{

Callers 3

port_wait_for_dataFunction · 0.85

Calls 2

is_uh_radio_fdFunction · 0.85
win32_serial_selectFunction · 0.85

Tested by

no test coverage detected