Displaying 1 result from an estimated 1 matches for "newtio".
Did you mean:
netio
2009 Jan 26
1
ups emerson liebert GTX2 ESP-II serial protocol demo
...rres=timedread(fd,buf,8,400);
if (rres!=8)
return -1;
*chrs++=buf[6];
*chrs++=buf[5];
if (buf[7]!=cksum(buf,7))
return -1;
lcmd[4]++;
}
*chrs=0;
return 1;
}
int main(int argc, char **argv)
{
int fd, res, i,j,r;
struct termios oldtio,newtio;
unsigned char buf[255],rbyteH,rbyteL;
unsigned int ncmd;
cmd_s c[NCMD];
initcmd(&c[0]);
ncmd=GetCmdCount(&c[0]);
if(argc!=2) {
fprintf(stderr,"upsesp2 <serial device>\n");
exit(1);
}
fd = open(argv[1], O_RDWR | O_NOCTTY );
if (fd < 0) {
s...