Computer Hardware User Manual

4-10 Intellio C218Turbo /PCI User's Manual
Syntax for SCO UNIX/XENIX
#define MLOWATER 0x405
int lowater; /* low water value of output buffer (default = 512 bytes) */
ioctl(moxa_fd, MLOWATER, lowater);
Syntax for UNIX SVR4
#include <sys/stropts.h>
#include <sys/sysmacros.h>
#define MLOWATER 0x405
struct strioctl ioc;
int lowater; /* low water value of output buffer (default = 512 bytes) */
ioc.ic_cmd = MLOWATER;
ioc.ic_timout = 0;
ioc.ic_len = sizeof(int);
ioc.ic_dp = (char *)&lowater;
ioctl(moxa_fd, I_STR, &ioc);
6. MSTATUS
This function is used to know the RS-232 line status (CTS/DSR/DCD).
Syntax for SCO UNIX/XENIX
#define MSTATUS 0x407
int status; /* status = RS-232 line status */
/* bit0
¡ÐCTS (1:on, 0:off) */
/* bit1
¡ÐDSR (1:on, 0:off) */
/* bit2
¡ÐDCD (1:on, 0:off) */
ioctl(moxa_fd, MSTATUS, &status);
Syntax for UNIX SVR4
#define MSTATUS 0x407
#include <sys/stropts.h>
#include <sys/sysmacros.h>
struct strioctl ioc;
int status; /* status = RS-232 line status */
/* bit0
¡ÐCTS (1:on, 0:off) */
/* bit1
¡ÐDSR (1:on, 0:off) */
/* bit2
¡ÐDCD (1:on, 0:off) */
ioc.ic_cmd = MSTATUS;
ioc.ic_timout = 0;
ioc.ic_len = sizeof(int);
ioc.ic_dp = (char *)&status;
ioctl(moxa_fd, I_STR, &ioc);