毕业论文开发语言企业开发JAVA技术.NET技术WEB开发Linux/Unix数据库技术Windows平台移动平台嵌入式论文范文英语论文
您现在的位置: 毕业论文 >> linux >> 正文

修改了串口通信的代码板子发送的数据PC收不到 第4页

更新时间:2012-11-12:  来源:毕业论文
sp; default:         fprintf(stderr,"Unsupported stop bits\n");         return (FALSE);     }           /* Set input parity option */    if (parity != 'n')         options.c_iflag |= INPCK;           options.c_cc[VTIME] = 150; // 15 seconds     options.c_cc[VMIN] = 0;       tcflush(fd,TCIFLUSH); /* Update the options and do it NOW */    if (tcsetattr(fd,TCSANOW,&options) != 0)     {         printf("SetupSerial 3");         return (FALSE);     }     return (TRUE);  }     /** *@breif 打开串口 */int OpenDev(char *Dev) {     int fd = open(Dev,O_RDWR | O_NOCTTY);         //| O_NOCTTY | O_NDELAY     if (-1 == fd)     {         printf("Can't Open Serial Port");         return -1;     }     return fd; }     /** *@breif    main() */int main(int argc, char **argv) {     int fd;     int nread;     int nRet = 0;     char buff[512] = {"this is Serial Port Test!\r\n"};     //char buff[512];     char *dev ="/dev/ttyS0";           fd = OpenDev(dev);     if (fd>0)     {   &nbs

上一页  [1] [2] [3] [4] [5] [6] [7] [8] [9] 下一页

设为首页 | 联系站长 | 友情链接 | 网站地图 |

copyright©chuibin.com 优尔论文网 严禁转载
如果本毕业论文网损害了您的利益或者侵犯了您的权利,请及时联系,我们一定会及时改正。