UYOU
FD_ZERO(&readSet);FD_SET(fd, &readSet);printf("%d\n",fd);int iRet = select(fd + 1, &readSet, NULL, NULL, &timeout);if(iRet == -1){printf("/*SerialPort recv_data select error! */\n");return -1;}else if(iRet == 0){printf("/*SerialPort recv_data select time out! */\n");return -1;}else{ //等待接收if(FD_ISSET(fd, &readSet)){tmp_len=read(fd, tmp_buf, 1024);if(tmp_len < 0){printf("/*SerialPort recv_data error! */\n");return -1;}else{memcpy(bOutBuf+iOutBufLen, tmp_buf, tmp_len);iOutBufLen += tmp_len;memset(tmp_buf,0,1024);iLen = 105;if(iOutBufLen ==iLen){//printf("/*SerialPort recv_data sucess:*/\n");//ShowByte(bOutBuf,iOutBufLen);return 0;}}}}