*/
break;
/*case 'o':
case 'O':*/
case 2:
options.c_cflag |= (PARODD | PARENB); /* 设置为奇效验*/
options.c_iflag |= INPCK; /* Disnable parity checking */
break;
/*case 'e':
case 'E':*/
case 3:
options.c_cflag |= PARENB; /* Enable parity */
options.c_cflag &= ~PARODD; /* 转换为偶效验*/
options.c_iflag |= INPCK; /* Disnable parity checking */
break;
/*case 'S':
case 's': /*as no parity*/
case 4:
options.c_cflag &= ~PARENB;
options.c_cflag &= ~CSTOPB;
break;
default:
return ERROR_PARITY;
}
/* 设置停止位*/
上一页 [1] [2] [3] [4] [5] [6] [7] [8] [9] 下一页