107 / 215
Option CloudGate - Last updated on 14/05/2014
#include <sys/ioctl.h>
#include <sys/ioctl.h>
#include <errno.h>
#include <errno.h>
/***************************************************************************
/***************************************************************************
* Manifest Constants
* Manifest Constants
***************************************************************************/
***************************************************************************/
#ifndef TIOCM_OUT1
#ifndef TIOCM_OUT1
#define TIOCM_OUT1 0x2000
#define TIOCM_OUT1 0x2000
#define TIOCM_OUT2 0x4000
#define TIOCM_OUT2 0x4000
#endif
#endif
#define TIOCM_RE TIOCM_OUT1
#define TIOCM_RE TIOCM_OUT1
#define TIOCM_DE TIOCM_OUT2
#define TIOCM_DE TIOCM_OUT2
/****************************************************************************/
/****************************************************************************/
int main (void)
int main (void)
{
{
int fd = open("/dev/ttySP4",O_RDWR || O_NONBLOCK);
int fd = open("/dev/ttySP4",O_RDWR || O_NONBLOCK);
if (fd < 0) { printf("failed to pen device\n"); return 0; }
if (fd < 0) { printf("failed to pen device\n"); return 0; }
int status, err;
int status, err;
/* switch on RS485 TRANSMIT buffer and RECEIVE buffer */
/* switch on RS485 TRANSMIT buffer and RECEIVE buffer */
ioctl(fd, TIOCMGET, &status);
ioctl(fd, TIOCMGET, &status);
status |= (TIOCM_DE | TIOCM_RE);
status |= (TIOCM_DE | TIOCM_RE);
if ((err = ioctl(fd, TIOCMSET, &status)))
if ((err = ioctl(fd, TIOCMSET, &status)))
{
{
printf("ioctl error 0x%x, errno 0x%x, status %x",err, errno, status);
printf("ioctl error 0x%x, errno 0x%x, status %x",err, errno, status);
}
}
close(fd);
close(fd);
return 0;
return 0;
}
}
Summary of Contents for OPTION CloudGate
Page 1: ...CloudGate Technical documentation Copy taken from CloudGate Universe on 14 05 2014...
Page 32: ...29 215 Option CloudGate Last updated on 14 05 2014 DSB Marketing Hammond...
Page 43: ...40 215 Option CloudGate Last updated on 14 05 2014 Related Topics WAN LAN Switchover Feature...
Page 92: ...89 215 Option CloudGate Last updated on 14 05 2014...
Page 94: ...91 215 Option CloudGate Last updated on 14 05 2014...
Page 98: ...95 215 Option CloudGate Last updated on 14 05 2014 LED Descriptions...
Page 100: ...97 215 Option CloudGate Last updated on 14 05 2014...
Page 142: ...139 215 Option CloudGate Last updated on 14 05 2014 Internal Power Circuits Block Diagram...
Page 171: ...168 215 Option CloudGate Last updated on 14 05 2014 Click Save 4...
Page 179: ...176 215 Option CloudGate Last updated on 14 05 2014 4 Click Save...
Page 198: ...195 215 Option CloudGate Last updated on 14 05 2014...
Page 201: ...198 215 Option CloudGate Last updated on 14 05 2014...
Page 215: ...212 215 Option CloudGate Last updated on 14 05 2014...