11 #include <sys/ioctl.h> 20 #define MAX_LENGTH 255 23 #define STS_WAIT_STX 1 25 #define STS_WAIT_ETX 3 26 #define STS_WAIT_BCC 4 51 fd = open(dev, O_RDWR | O_NDELAY | O_NOCTTY);
87 void Comm_Setup(
long baud,
int parity,
int bitlen,
int rts,
int dtr,
char code)
132 cflg = PARENB | PARODD;
170 tio.c_cflag = cflg | CREAD;
177 cfsetspeed(&
tio, brate);
178 tcflush(
fd, TCIFLUSH);
179 tcsetattr(
fd, TCSANOW, &
tio);
197 int count = write(
fd, buff, l);
222 l = strlen((
char*)buff);
250 static int RcvSts = 0;
static UCHAR stmp[MAX_LENGTH]
unsigned char rbuff[MAX_LENGTH]
static UCHAR rcv_buff[MAX_BUFF][MAX_LENGTH]
int Comm_SendData(UCHAR *buff, int l)
int Comm_Open(const char *dev)
int Comm_GetRcvData(UCHAR *buff)
void Comm_Setup(long baud, int parity, int bitlen, int rts, int dtr, char code)