/* Set input parity option */
/* if (ai_parity != 'n')*/
if (ai_parity != 1)
options.c_iflag |= INPCK;
tcflush(ai_com,TCIFLUSH);
options.c_cc[VTIME] = 0; /* 设置超时15 seconds*/
options.c_cc[VMIN] = 1; /* define the minimum bytes data to be readed*/
if (tcsetattr(ai_com,TCSANOW,&options) != 0)
{
/*printf("set_Parity error\n");*/
return (FALSE);
}
/*printf("set_Parity success\n");*/
return (TRUE);
}
这是我的set_Parity,用在modem拨号程序上,做了些修改以对应数据库里的参数,大体上和你用的差不多
上一页 [1] [2] [3] [4] [5] [6] [7] [8] [9]